mlsanityData to 14 Oct 2026

PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overhead

arXiv 2409.19745 ↗First posted 29 Sep 2024cs.CL cs.AIcited by 1

On the map: Retrieval-augmented generation → Generation and context integration

Abstract (arXiv)

Large language models (LLMs) enhanced with retrieval-augmented generation (RAG) have introduced a new paradigm for web search. However, the limited context awareness of LLMs degrades their performance on RAG tasks. Existing methods to enhance context awareness are often inefficient, incurring time or memory overhead during inference, and many are tailored to specific position embeddings. In this paper, we propose Position-Embedding-Agnostic attention Re-weighting (PEAR), which enhances the context awareness of LLMs with zero inference overhead. Specifically, on a proxy task focused on context copying, we first detect heads which suppress the models' context awareness thereby diminishing RAG performance. To weaken the impact of these heads, we re-weight their outputs with learnable coefficients. The LLM (with frozen parameters) is optimized by adjusting these coefficients to minimize loss on the proxy task. As a result, the coefficients are optimized to values less than one, thereby reducing their tendency to suppress RAG performance. During inference, the optimized coefficients are fixed to re-weight these heads, regardless of the specific task at hand. Our proposed PEAR offers two major advantages over previous approaches: (1) It introduces zero additional inference overhead in terms of memory usage or inference time, while outperforming competitive baselines in accuracy and efficiency across various RAG tasks. (2) It is independent of position embedding algorithms, ensuring broader applicability.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Generation and context integration, one of 15 directions in Retrieval-augmented generation. Builds on 29 of its 43 references that are in the map. First posted on arXiv 29 Sep 2024.

Builds on

29 of 43 references.

Closest ancestors · 1

Same direction, newest first

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks22 May

Other references · 28

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2020Measuring Massive Multitask Language Understandingcited by 7,963
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  4. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  5. 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,509
  6. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  7. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  8. 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,282
  9. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
  10. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  11. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  12. 2022In-context Learning and Induction Headscited by 964
16 more
  1. 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 916
  2. 2019Latent Retrieval for Weakly Supervised Open Domain Question Answeringcited by 695
  3. 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 528
  4. 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 486
  5. 2023ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Casescited by 393
  6. 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
  7. 2023Circuit Component Reuse Across Tasks in Transformer Language Modelscited by 108
  8. 2023Attention Sorting Combats Recency Bias In Long Context Language Modelscited by 90
  9. 2024Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalizationcited by 79
  10. 2023Copy Suppression: Comprehensively Understanding an Attention Headcited by 76
  11. 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
  12. 2023Characterizing Mechanisms for Factual Recall in Language Modelscited by 48
  13. 2024Interpreting Key Mechanisms of Factual Recall in Transformer-Based Language Modelscited by 31
  14. 2023Fortify the Shortest Stave in Attention: Enhancing Context Awareness of Large Language Models for Effective Tool Usecited by 27
  15. 2024Mixture of In-Context Experts Enhance LLMs' Long Context Awarenesscited by 17
  16. 2024Mixture-of-Modules: Reinventing Transformers as Dynamic Assemblies of Modulescited by 11

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generation
  2. 2025Infinite Retrieval: Attention Enhanced LLMs in Long-Context Processing
  3. 2024Context Awareness Gate For Retrieval Augmented Generation
  4. 2024Lighter And Better: Towards Flexible Context Adaptation For Retrieval Augmented Generation
  5. 2025Oreo: A Plug-in Context Reconstructor to Enhance Retrieval-Augmented Generation
  6. 2025Dynamic Context Selection for Retrieval-Augmented Generation: Mitigating Distractors and Positional Bias
  7. 2025Re-ranking the Context for Multimodal Retrieval Augmented Generation
  8. 2024Contextual Compression in Retrieval-Augmented Generation for Large Language Models: A Survey