Table of Contents
Fetching ...

QUITO: Accelerating Long-Context Reasoning through Query-Guided Context Compression

Wenshan Wang, Yihang Wang, Yixing Fan, Huaming Liao, Jiafeng Guo

TL;DR

This work tackles the efficiency challenge of long-context reasoning in large language models by introducing QUITO, a query-guided attention-based context compression method. QUITO uses a trigger-token mechanism within a prompt-filled template to assign importance scores to context tokens via self-attention, then employs budget-controlled filtering (phrase-level, sentence-level, and dynamic sentence-level) to produce a compact, query-relevant context. The approach demonstrates substantial improvements over strong baselines on NaturalQuestions and ASQA across multiple generation models, including when using a small compression model, highlighting both effectiveness and efficiency. These results suggest that aligning context compression with the query through attention signals can significantly preserve essential information while reducing computation, with practical impact for open-domain and long-form QA tasks; code is publicly available.

Abstract

In-context learning (ICL) capabilities are foundational to the success of large language models (LLMs). Recently, context compression has attracted growing interest since it can largely reduce reasoning complexities and computation costs of LLMs. In this paper, we introduce a novel Query-gUIded aTtention cOmpression (QUITO) method, which leverages attention of the question over the contexts to filter useless information. Specifically, we take a trigger token to calculate the attention distribution of the context in response to the question. Based on the distribution, we propose three different filtering methods to satisfy the budget constraints of the context length. We evaluate the QUITO using two widely-used datasets, namely, NaturalQuestions and ASQA. Experimental results demonstrate that QUITO significantly outperforms established baselines across various datasets and downstream LLMs, underscoring its effectiveness. Our code is available at https://github.com/Wenshansilvia/attention_compressor.

QUITO: Accelerating Long-Context Reasoning through Query-Guided Context Compression

TL;DR

This work tackles the efficiency challenge of long-context reasoning in large language models by introducing QUITO, a query-guided attention-based context compression method. QUITO uses a trigger-token mechanism within a prompt-filled template to assign importance scores to context tokens via self-attention, then employs budget-controlled filtering (phrase-level, sentence-level, and dynamic sentence-level) to produce a compact, query-relevant context. The approach demonstrates substantial improvements over strong baselines on NaturalQuestions and ASQA across multiple generation models, including when using a small compression model, highlighting both effectiveness and efficiency. These results suggest that aligning context compression with the query through attention signals can significantly preserve essential information while reducing computation, with practical impact for open-domain and long-form QA tasks; code is publicly available.

Abstract

In-context learning (ICL) capabilities are foundational to the success of large language models (LLMs). Recently, context compression has attracted growing interest since it can largely reduce reasoning complexities and computation costs of LLMs. In this paper, we introduce a novel Query-gUIded aTtention cOmpression (QUITO) method, which leverages attention of the question over the contexts to filter useless information. Specifically, we take a trigger token to calculate the attention distribution of the context in response to the question. Based on the distribution, we propose three different filtering methods to satisfy the budget constraints of the context length. We evaluate the QUITO using two widely-used datasets, namely, NaturalQuestions and ASQA. Experimental results demonstrate that QUITO significantly outperforms established baselines across various datasets and downstream LLMs, underscoring its effectiveness. Our code is available at https://github.com/Wenshansilvia/attention_compressor.
Paper Structure (23 sections, 5 equations, 3 figures, 1 table)

This paper contains 23 sections, 5 equations, 3 figures, 1 table.

Figures (3)

  • Figure 1: The overall framework of QUITO
  • Figure 2: Experimental comparison of different ground-truth context positions.
  • Figure 3: Experimental results of different generation models on NQ dataset.