liveBook · Manning

Attention dilution

As explained in Retrieval Augmented Generation, The Foundational Ideas

Attention dilution is the spreading of attention probability mass across more tokens as a sequence becomes longer.

Attention dilution occurs when a longer sequence spreads softmax probability mass across more tokens, preventing any single document region from receiving a dominant attention score. section 13.3

The problem complicates attention-based context pruning: weakly concentrated scores make relevant regions difficult to isolate. AttentionRAG counters it by converting a question into an answer hint prefix with one blank position, then reading attention to that focal token. section 13.3

Figure 13.2 The two obstacles to reading attention, and the answer hint prefix that resolves them. Long sequences dilute softmax mass; multi-token queries scatter focal points. Reformulating the query as a fill-in-the-blank prefix forces a single focal token whose attention concentrates on the context that informs the prediction.

The diagram connects sequence length with diluted softmax mass and shows how a fill-in-the-blank prefix concentrates attention on the context supporting the missing answer. section 13.3

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Defines softmax mass spreading and its pruning consequence, then identifies answer hint prefixes as a mitigation.
Examples
Uses long sequences, multi-token questions, and fill-in-the-blank answer hint prefixes to demonstrate diluted and concentrated attention.
What it assumes
Assumes familiarity with transformer self-attention, softmax scores, and context pruning.
What you can do after
Diagnose why attention scores fail to isolate relevant context and apply answer hint prefixes to create a focal token.
How it connects
Connects self-attention, softmax, query misalignment, answer hint prefixes, and inference-time context pruning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.