Attention sinks in NLLB: where most of the cross-attention actually goes
The first time we ran a cross-attention analysis on a set of African languages in Meta’s NLLB (No Language Left Behind) translation model…
Attention sinks in NLLB: where most of the cross-attention actually goes
The first time we ran a cross-attention analysis on a set of African languages in Meta’s NLLB (No Language Left Behind) translation model, the results made us deeply uncomfortable.
Across every language pair we tried, the numbers looked identical. Word-order preservation similarity hovered stubbornly around 36%. Different decoding modes that should have produced entirely different attention patterns looked like carbon copies of each other.
Something was broken.
It turned out we were measuring the wrong thing. Between 83% and 91% of the cross-attention mass — depending on the language pair — was being swallowed by a tiny handful of structural tokens: language tags, end-of-sentence markers, and punctuation.
Once we filtered those structural tokens out, our alignment metric jumped from 36.7% to 70.7%. It almost doubled. Suddenly, different decoding modes started behaving like themselves again. The signal had been there all along, completely buried under the noise.
What is an Attention Sink?
If you aren’t familiar with the setup: when NLLB translates a sentence, you can extract the cross-attention weights. This is the matrix that tells you exactly which source words the decoder looked at while generating each target word. Researchers use these matrices to map word alignments and see how multilingual models process different languages.
The term “attention sink” comes from research on autoregressive language models. Scientists noticed that the very first token in a sequence (usually a or beginning-of-sentence marker) attracts a massive, disproportionate amount of attention, no matter what the model is actually generating.
The reason is purely mechanical:
Each row in an attention matrix is a probability distribution forced to sum to 1 by the softmax function. The weight has to land somewhere. If an attention head has no strong content-driven reason to focus on a specific word, it defaults to a stable, constant token it can always find.
The same thing happens in Neural Machine Translation (NMT) cross-attention, but the culprits are different:
- Language Tags: NLLB prefixes every sentence with a special token indicating the language. The decoder doesn’t need this for content meaning — it’s just metadata — but it serves as a perfectly stable anchor.
- Structural Markers & Punctuation: The (end-of-sentence) tag and ubiquitous punctuation marks act the exact same way.
Because these tokens are omnipresent, they become the garbage bin for any attention head without a clear mission. When you average your attention metrics across sentences (as almost every analysis does), this structural mass completely hijacks the data. You aren’t measuring how the model processes content; you’re measuring how much it likes punctuation.
The Numbers
We broke down the cross-attention mass by token type across four language pairs (translating from English). A consistent pattern emerged:

Content gets the absolute leftovers. If your analysis treats all tokens equally, it is dominated by positions where mathematically, almost nothing is happening.
To recover the true signal, you have to filter the matrix. Look at what happens to our word-order metrics when we exclude structural tokens and renormalize the remaining mass:

The filtered data tells a completely different story. Languages finally look distinct. Decoding modes (free generation vs. teacher-forced evaluation) show entirely separate behaviors. If you’ve ever looked at NMT attention matrices and thought, “Why does everything look identical?” — this is your answer.
Why This Isn’t Just “Position Bias”
In standard language models, people often blame “position bias” — the idea that the first slot gets hammered simply because it’s the first slot.
In NMT cross-attention, the bias is vocabulary-driven, not positional. We checked. The language tag sits at the absolute beginning of the sequence, but the token sits at the very end. Both act as massive sinks. Punctuation marks scattered dead-center in the middle of a sentence do the exact same thing.
Because the issue is tied to specific token types rather than physical positions, we can clean it up cleanly without losing any spatial or positional alignment information.
The Content-Only Filtering Recipe
Fixing this takes about 30 lines of Python. For every cross-attention matrix, follow these four steps:
- Identify Structural Tokens: Build a list of token IDs for language tags,
</s>, punctuation, and Byte-Pair Encoding (BPE) subword markers. - Mask the Sinks: Zero out the corresponding rows and columns in your attention matrix.
- Renormalize the Matrix: Divide the remaining values so that each decoder-position row sums back up to 1. Do not skip this. If you don’t renormalize, downstream metrics that expect a valid probability distribution will output garbage.
- Run Your Metrics: Calculate your alignment or similarity metrics on this cleaned, content-only matrix.
What Cleansing the Data Unlocked
Filtering the noise didn’t just change our percentages; it completely salvaged our downstream research.
1. Linguistic Phylogenies Actually Work
We wanted to see if we could reconstruct language family trees purely from a model’s attention patterns. Before filtering, the resulting trees were pure noise — Bantu languages were indistinguishable from Nilotic languages. After filtering, the correct family structures emerged beautifully: the Bantu languages clustered together tightly, completely separate from Cushitic Somali and Nilotic Luo.
2. Layer-Wise Dynamics Became Legible
We knew cross-attention changes as you move from early decoder layers to later ones. With raw attention, every layer looked identical because the sinks drowned out the nuances. With filtered attention, the layer-wise differences became sharp, distinct, and highly consistent across different languages.
The Takeaway for Interpretability Research
If you are analyzing attention weights in modern multilingual models, keep three rules in mind:
- Run a 30-second sanity check: Look at the token-type breakdown of your attention mass first. If structural tokens hold the majority, stop and filter.
- Filter before you analyze, not after: Trust me, re-running a massive pipeline because you discovered a sink problem late is a massive waste of time.
- Question un-filtered baselines: Methods papers that report raw cross-attention metrics without mentioning structural tokens are often accidentally measuring sink artifacts.
Interpretability tools inherit assumptions from the models they were built on. The classic “attention as alignment” framework was designed for early, simple NMT systems with tiny vocabularies. Modern models are vastly more complex, using specialized tokens and massive multilingual vocabularies. The old metrics still work — but only if you are incredibly careful about what you are actually allowing them to measure.
The paper on attention sinks and content-only filtering, including the full per-layer breakdown is at arxiv.org/abs/2605.01229.
메타데이터
- post_id
- 02a170d635fa
- slug
- attention-sinks-in-nllb-where-most-of-the-cross-attention-actually-goes-02a170d635fa
- url
- https://medium.com/thiomi/attention-sinks-in-nllb-where-most-of-the-cross-attention-actually-goes-02a170d635fa
- canonical_url
- https://medium.com/thiomi/attention-sinks-in-nllb-where-most-of-the-cross-attention-actually-goes-02a170d635fa
- author_url
- https://medium.com/@hmutisya
- status
- ok
- fetched_at
- 2026-06-10 08:17:25