AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Fang, Yixiong, Sun, Tianran, Shi, Yuling, Gu, Xiaodong
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914115691216896
author Fang, Yixiong
Sun, Tianran
Shi, Yuling
Gu, Xiaodong
author_facet Fang, Yixiong
Sun, Tianran
Shi, Yuling
Gu, Xiaodong
contents While RAG demonstrates remarkable capabilities in LLM applications, its effectiveness is hindered by the ever-increasing length of retrieved contexts, which introduces information redundancy and substantial computational overhead. Existing context pruning methods, such as LLMLingua, lack contextual awareness and offer limited flexibility in controlling compression rates, often resulting in either insufficient pruning or excessive information loss. In this paper, we propose AttentionRAG, an attention-guided context pruning method for RAG systems. The core idea of AttentionRAG lies in its attention focus mechanism, which reformulates RAG queries into a next-token prediction paradigm. This mechanism isolates the query's semantic focus to a single token, enabling precise and efficient attention calculation between queries and retrieved contexts. Extensive experiments on LongBench and Babilong benchmarks show that AttentionRAG achieves up to 6.3$\times$ context compression while outperforming LLMLingua methods by around 10\% in key metrics.
format Preprint
id arxiv_https___arxiv_org_abs_2503_10720
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generation
Fang, Yixiong
Sun, Tianran
Shi, Yuling
Gu, Xiaodong
Computation and Language
Artificial Intelligence
While RAG demonstrates remarkable capabilities in LLM applications, its effectiveness is hindered by the ever-increasing length of retrieved contexts, which introduces information redundancy and substantial computational overhead. Existing context pruning methods, such as LLMLingua, lack contextual awareness and offer limited flexibility in controlling compression rates, often resulting in either insufficient pruning or excessive information loss. In this paper, we propose AttentionRAG, an attention-guided context pruning method for RAG systems. The core idea of AttentionRAG lies in its attention focus mechanism, which reformulates RAG queries into a next-token prediction paradigm. This mechanism isolates the query's semantic focus to a single token, enabling precise and efficient attention calculation between queries and retrieved contexts. Extensive experiments on LongBench and Babilong benchmarks show that AttentionRAG achieves up to 6.3$\times$ context compression while outperforming LLMLingua methods by around 10\% in key metrics.
title AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generation
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2503.10720