Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

A Primer in BERTology: What we know about how BERT works

Researchers survey BERT's knowledge, how it is stored, and how to compress it

  • Problem Transformers like BERT perform well, but researchers can't yet say clearly why. That gap limits hypothesis-driven changes to their architecture.
  • Method The authors review BERT studies on what it learns, how it represents that knowledge, and how it is compressed.
  • Results The survey covers over 150 studies of BERT and outlines directions for future research.

Why BERT's behaviour is hard to explain

Transformers, introduced in 2017, reshaped NLP by allowing more parallel computation and better handling of long-range dependencies. BERT is the best-known model of this family and remains a standard baseline across many benchmarks. It works well, but researchers can't say clearly why, and that limits hypothesis-driven changes to its architecture.

Transformers also have little cognitive motivation, and their size makes pre-training experiments and ablation studies hard to run.

What the pre-trained stack consists of

BERT is a stack of Transformer encoder layers, and each layer holds several self-attention heads that build weighted representations from key, value and query vectors. Training has two stages: pre-training with masked language modeling and next sentence prediction, then fine-tuning with one or more fully-connected layers added on top of the final encoder layer.

Its input words are split into wordpieces, and token, position and segment embeddings are summed into a fixed-length vector. So the open question is where this knowledge is stored inside the stack, and that is what the probes below try to locate.

Impact maps from perturbed masking

The key idea is to measure how much masking one word changes the prediction of another word, and to store all those effects in one matrix per sentence. That matrix is called an impact matrix, and a heatmap of it is called an impact map. The method needs no extra trained parameters, so it can probe a model as it stands.

For each sentence, token-level perturbed masking produces the impact matrix F. Graph-based algorithms then induce a dependency tree from F, and that tree is compared against ground-truth annotations. The authors fed BERT 1,000 sentences from the English PUD treebank of the CoNLL 2017 Shared Task, using the pre-processing steps of BERT pre-training.

The authors noticed that the impact pattern often looks like syntactic structure, which led them to try extracting dependency trees from the matrices. The dependency probe's question is whether BERT can outperform linguistically uninformed baselines in unsupervised dependency parsing.

What one example impact map shows

That stripe means the word different strongly affects the earlier words of its phrase. This agrees with a ground-truth dependency tree that makes different the head of the remaining words in its phrase, and similar patterns appear for transitions and Hill.

A constituency tree places media closer to transitions than on is. A syntactically uninformed model would give media and on comparable impacts on transitions, but the map shows a much darker cell for media. So in this sentence the impact pattern tracks syntactic distance, although the authors test the observation quantitatively only in later sections.

Along the diagonal, the words form four contiguous chunks, and the two middle chunks interact strongly enough to form a larger verb phrase. The authors suggest that BERT may capture compositionality, though this rests on one example sentence.

Syntax in token embeddings, not in attention weights

Lin et al. (2019) showed that BERT representations are hierarchical rather than linear, so something like a syntactic tree sits alongside word order. Tenney et al. (2019b) and Liu et al. (2019a) found that the embeddings also encode parts of speech, syntactic chunks and roles. Hewitt and Manning (2019) learned transformation matrices that recovered syntactic dependencies in PennTreebank data from BERT token embeddings.

Jawahar et al. (2019) show a dependency tree read from self-attention, but give no quantitative evaluation of it. Jawahar et al. (2019) found dependency trees the best fit among 5 decomposition schemes applied to the [CLS] token, though the MSE differences were very small.

Which layers hold syntax

Hewitt and Manning (2019) reconstructed syntactic tree depth best from the middle layers, layers 6-9 for base BERT and 14-19 for BERT-large. Goldberg (2019) found the best subject-verb agreement around layers 8-9, and syntactic probing used by Jawahar et al. (2019) also peaked near the middle. This middle-layer pattern fits the finding of Liu et al.

(2019a) that middle layers are the most transferable across tasks.

The evidence on chunks conflicts, though, because Tenney et al. (2019a) place basic syntax earlier in the network while Liu et al. (2019a) find chunking best at middle layers. The studies use different suites of probing tasks, so the conflict isn't resolved yet. The final layers are the most specific to the masked language modeling task, which is one reason middle layers transfer better.

During fine-tuning the final layers change the most, and restoring the lower layers of a fine-tuned BERT to their original values barely hurts performance.

Layerwise trade-off in ELMo

The authors retrained softmax classifiers for bidirectional language modeling on each layer's representations, since the ELMo models were trained on the Billion Word Benchmark. The held-out portion was split into 80% for training, about 6.2M tokens, and 20% for evaluation, about 1.6M tokens, to limit domain shift.

Higher layers of the recurrent models consistently reached lower perplexity. The ELMo transformer model did not show this monotonic increase, although its top layer was the best of its layers. Across models, the layers better suited to language modeling also showed worse probing performance, so layers trade general features for task-specific ones.

For LSTMs, moving up the layers yields more task-specific representations, but the same doesn't hold for transformers. This motivates gradual unfreezing from the final layer during fine-tuning (Howard and Ruder, 2018).

Semantic and world knowledge gaps

Ettinger (2019) found that BERT's predictions were not altered by shuffled word order, truncated sentences or removed subjects and objects. This could mean the syntactic knowledge is incomplete, or that BERT doesn't need it for its tasks, and the authors judge the second more likely.

Replacing names in the coreference task changed 85% of predictions, which suggests the model has no generic idea of named entities. This holds even though its F1 scores on NER probing tasks are high (Tenney et al., 2019a). Addition and number decoding also showed that BERT forms poor representations for floating point numbers, partly because wordpiece splits break similar numbers apart.

The masked language modeling objective can fill cloze blanks to recall facts, and for some relation types vanilla BERT competes with knowledge-base methods (Petroni et al., 2019). Performance also drops as the number of necessary inference steps grows (Zhou et al., 2020; Richardson and Sabharwal, 2019).

Self-attention heads and special tokens

Kovaleva et al. (2019) describe five attention patterns, one of them heterogeneous, which is the pattern that could carry linguistic information. When BERT is fine-tuned on GLUE, fewer than 50% of heads show the heterogeneous pattern. Much of the model instead shows the vertical pattern, with attention on [CLS], [SEP] and punctuation. The authors of this survey link this redundancy to overparameterization.

Clark et al. (2019) found that early-layer heads attend more to [CLS], middle-layer heads to [SEP], and final-layer heads to periods and commas. They read this as a no-op signal that tells the model to ignore a head when its pattern doesn't apply. After fine-tuning, both [SEP] and [CLS] receive much attention, depending on the task. Punctuation also draws attention, because periods and commas are nearly as frequent as special tokens.

Compressing BERT and what it costs

Knowledge distillation trains a smaller student network to mimic a larger teacher, and quantization lowers the precision of the weights to save memory. Pruning zeroes out parts of the model, either in structured form, which drops whole blocks as in LayerDrop, or in unstructured form, which removes weights wherever they are.

In the comparison table, DistilBERT reaches ×1.5 compression with 90% performance retention relative to BERT-base. Some rows reach far larger compression, such as TinyBERT at ×7.5 with 96% retention, but those rows use different evaluation tasks.

Prasanna et al. (2020) and Chen et al. (2020) look for winning subnetworks in pre-trained BERT under the lottery ticket hypothesis, and they find such subnetworks exist. Transferability between subnetworks for different tasks varies. Adapter modules approximate fine-tuning and reach competitive performance on 26 classification tasks at a fraction of the computational cost.

Overparameterization and training changes

Base BERT's 110M parameters are now dwarfed by the 17B of Turing-NLG (Microsoft, 2020). Human language may need many parameters, but current models don't make good use of the ones they already have.

Depending on the task, some heads or layers are harmful as well as redundant, and disabling heads helped in some tasks. Larger isn't always better: BERT-base outperformed BERT-large on subject-verb agreement (Goldberg, 2019).

Clark et al. (2019) suggest that attention dropout, which zeroes some attention weights during training, may be one reason heads become redundant. Large-batch training with 8k examples improved both language model perplexity and downstream performance (Liu et al., 2019b). Warm-start training, which copies a shallower model's parameters into deeper layers, reached 25% faster training without sacrificing performance.

Limits of probing evidence

A probe that fails to find a pattern doesn't show the pattern is absent, and finding it doesn't show how the model uses it (Tenney et al., 2019a). If a more complex probe recovers more information, it's unclear how much of that still comes from the original model (Liu et al., 2019a). Different probing methods can give complementary or contradictory conclusions, so a single test is insufficient.

Many attention studies are qualitative and often use cherry-picked examples (Belinkov and Glass, 2019). Most studies also drop special tokens from inter-word attention, which may miss information that matters at inference time. Amnesic probing removes specific information from the model and measures the change in performance (Elazar et al., 2020).

Paper info

Authors
Anna Rogers, Olga Kovaleva, Anna Rumshisky
Venue
arXiv · Preprint
First published
2020-2-27
Added
2026-11-13
Updated
2020-11-9
Version
v3
arXiv
2002.12327
Category
cs.CL
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Anna Rogers, Olga Kovaleva, Anna Rumshisky (2020). A Primer in BERTology: What we know about how BERT works. arXiv:2002.12327v3. https://arxiv.org/abs/2002.12327v3

BibTeX
@misc{rogers2020primer,
  title = {{A Primer in BERTology: What we know about how BERT works}},
  author = {Anna Rogers and Olga Kovaleva and Anna Rumshisky},
  year = {2020},
  eprint = {2002.12327},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.12327v3}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up