Table of Contents
Fetching ...

LooComp: Leverage Leave-One-Out Strategy to Encoder-only Transformer for Efficient Query-aware Context Compression

Thao Do, Dinh Phu Tran, An Vo, Seon Kwon Kim, Daeyoung Kim

TL;DR

A margin-based framework for query-driven context pruning, which identifies sentences that are critical for answering a query by measuring changes in clue richness when they are omitted, demonstrating its potential as a lightweight and practical alternative for retrieval-augmented tasks.

Abstract

Efficient context compression is crucial for improving the accuracy and scalability of question answering. For the efficiency of Retrieval Augmented Generation, context should be delivered fast, compact, and precise to ensure clue sufficiency and budget-friendly LLM reader cost. We propose a margin-based framework for query-driven context pruning, which identifies sentences that are critical for answering a query by measuring changes in clue richness when they are omitted. The model is trained with a composite ranking loss that enforces large margins for critical sentences while keeping non-critical ones near neutral. Built on a lightweight encoder-only Transformer, our approach generally achieves strong exact-match and F1 scores with high-throughput inference and lower memory requirements than those of major baselines. In addition to efficiency, our method yields effective compression ratios without degrading answering performance, demonstrating its potential as a lightweight and practical alternative for retrieval-augmented tasks.

LooComp: Leverage Leave-One-Out Strategy to Encoder-only Transformer for Efficient Query-aware Context Compression

TL;DR

A margin-based framework for query-driven context pruning, which identifies sentences that are critical for answering a query by measuring changes in clue richness when they are omitted, demonstrating its potential as a lightweight and practical alternative for retrieval-augmented tasks.

Abstract

Efficient context compression is crucial for improving the accuracy and scalability of question answering. For the efficiency of Retrieval Augmented Generation, context should be delivered fast, compact, and precise to ensure clue sufficiency and budget-friendly LLM reader cost. We propose a margin-based framework for query-driven context pruning, which identifies sentences that are critical for answering a query by measuring changes in clue richness when they are omitted. The model is trained with a composite ranking loss that enforces large margins for critical sentences while keeping non-critical ones near neutral. Built on a lightweight encoder-only Transformer, our approach generally achieves strong exact-match and F1 scores with high-throughput inference and lower memory requirements than those of major baselines. In addition to efficiency, our method yields effective compression ratios without degrading answering performance, demonstrating its potential as a lightweight and practical alternative for retrieval-augmented tasks.
Paper Structure (30 sections, 4 equations, 4 figures, 8 tables)

This paper contains 30 sections, 4 equations, 4 figures, 8 tables.

Figures (4)

  • Figure 1: Answering performance (EM, F1) and compression efficiency (QpS, Saved %) across compressors. Questions Per Second (QpS) is from compression latency; Context Saved is $100\%$ -- Compression ratio.
  • Figure 2: Overview of our framework. Our proposed lightweight context pruner includes three steps. (1) each retrieved document is segmented into sentences. (2) We measure the importance of sentences by calculating the change in clue richness, denoted as $\Delta$, when a sentence is omitted. A larger $\Delta$ indicates that the sentence is more critical. (3) We apply an adaptive threshold $\tau$ to retain most essential sentences while pruning others, dynamically.
  • Figure 3: Performance analysis on HQA at increasing top-k $=\{5, 10, 20, 30\}$ by reader Llama-3.1-8B Instruct, comparing EM, compression latency, and compression ratio between baselines and our proposed method.
  • Figure 4: Peak memory vs. end-to-end latency for all compressors (lower-left indicates better efficiency) on HQA subset 500 at $k=10$ by Llama-3.1-8B Instruct. Each point represents one model; ours is highlighted with a black ring, where our method is among the low-computationally required methods.