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

Wenshan Wang, Yihang Wang, Yixing Fan, Huaming Liao, Jiafeng Guo
8/1/2024
cs.CLcs.AI

Official code: Wenshansilvia/attention_compressor (14 stars, last commit 2025-11-11).

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.

View on arXivView PDF

Code Implementations(1)

Official Repo of paper "QUITO: Accelerating Long-Context Reasoning through Query-Guided Context Compression".

142PythonJun 30, 202411 months ago

Similar Papers

Cite this paper

@article{wang2024quito,
  title  = {QUITO: Accelerating Long-Context Reasoning through Query-Guided Context Compression},
  author = {Wenshan Wang and Yihang Wang and Yixing Fan and Huaming Liao and Jiafeng Guo},
  year   = {2024},
  eprint = {2408.00274},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.00274v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.00274.svg)](https://codeofpaper.com/paper/2408.00274)

Discussion