QRAE: Query-Relevant Attention Entropy for Context Compression in DeepSearch Agents
Organizations: Tsinghua University · Huawei Technologies Ltd.
Abstract
DeepSearch LLM agents repeatedly search and carry retrieved sources into subsequent reasoning steps. This expanding context increases token consumption and latency, although many results do not contribute to later reasoning. We propose Query-Relevant Attention Entropy (QRAE), an online context compression method that uses sparse evidence-assessment heads to decide which intact retrieved chunks should persist across reasoning steps. It scores bounded candidate batches through paired prefills: a query-free control suppresses shared attention responses, while normalized entropy measures the breadth of the positive response within each chunk. High-scoring chunks enter a persistent evidence whitelist and are included in the reasoning context. Uncertain chunks remain outside the reasoning context but are retained in a candidate cache, where they can be retrieved for later reevaluation. QRAE requires neither an additional generative compression pass nor modification of the attention operator. Across multiple DeepSearch benchmarks and reasoning models, QRAE improves task success by an average of 2.35 percentage points and reduces end-to-end latency and reported token usage by an average of 30% and 45%, respectively. These benefits generalize to a model with nearly 100B parameters.
Figures & tables
| Dataset | Metric | DeepSearch | Lingua-2 | ACON | Rerank | QRHead | SideQuest | QRAE |
|---|---|---|---|---|---|---|---|---|
| No comp. | Compression baselines | Ours | ||||||
| BrowseComp- Plus | Succ. (%) | 13.8 | 14.3 | 12.1 | 14.7 | 11.6 | 10.6 | 17.2 |
| Time (s) | 29.5 | 28.8 | 50.0 | 35.6 | 45.1 | 24.3 | 20.5 | |
| Tokens | 177k | 171k | 98k | 148k | 149k | 66k | 54k | |
| XBench- DeepSearch | Succ. (%) | 38.0 | 43.0 | 40.0 | 41.0 | 35.0 | 36.0 | 44.0 |
| Time (s) | 276.0 | 245.3 | 324.8 | 213.6 | 357.5 | 167.2 | 150.4 | |
| Method | OpenResearcher-30B | OpenPangu-2.0-Flash-92B | ||||
|---|---|---|---|---|---|---|
| Success (%) | Time (s) | Tokens | Success (%) | Time (s) | Tokens | |
| DeepSearch | 53.2 | 151.0 | 1981k | 54.9 | 308.6 | 1077k |
| LLMLingua-2 | 52.1 | 154.7 | 2037k | 54.2 | 304.5 | 1057k |
| ACON | 49.4 | 188.1 | 842k | 50.1 | 429.8 | 879k |
| Rerank | 50.7 | 162.0 | 2157k | 54.3 | 344.7 | 970k |
| QRHead | 51.1 | 189.3 | 1771k | 53.8 | 393.8 | 982k |
| Model | 5 chunks | 20 chunks | ||||
|---|---|---|---|---|---|---|
| AUC | Recall@1 | Recall@3 | AUC | Recall@1 | Recall@10 | |
| LiteResearcher-4B | 76.6 | 48.3% | 76.6% | 81.8 | 35.2% | 83.2% |
| DeepDiver-7B | 83.2 | 54.6% | 83.2% | 84.4 | 44.6% | 88.7% |
| WebSeer-14B | 84.1 | 53.9% | 84.5% | 85.1 | 47.8% | 89.2% |
| OpenResearcher-30B | 90.3 | 74.1% | 90.5% | 89.6 | 57.4% | 93.0% |
| OpenPangu-2.0-Flash-92B | 92.5 | 83.8% | 93.4% | 92.2 | 66.2% | 96.8% |
| Variant | 5 chunks | 20 chunks | ||||
|---|---|---|---|---|---|---|
| AUC | Recall@1 | Recall@3 | AUC | Recall@1 | Recall@10 | |
| QRAE (full) | 83.2 | 54.6% | 83.2% | 84.4 | 44.6% | 88.7% |
| w/o query-free subtraction | 79.6 | 48.6% | 80.9% | 78.8 | 34.2% | 84.5% |
| Attention sum | 75.0 | 44.7% | 79.5% | 81.3 | 32.6% | 80.0% |
| Variant | BrowseComp-Plus | XBench-DeepSearch | ||||
|---|---|---|---|---|---|---|
| Succ. (%) | Time (s) | Tokens | Succ. (%) | Time (s) | Tokens | |
| QRAE (full) | 17.2 | 20.5 | 54 | 44.0 | 150.4 | 117 |
| w/o query-free subtraction | 15.8 | 24.1 | 73 | 42.0 | 192.8 | 186 |
| Attention sum | 14.6 | 27.3 | 92 | 42.0 | 181.6 | 177 |
| Current-search filtering | 14.9 | 30.2 | 129 | 41.0 | 232.3 | 225 |
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Selected layer–head pairs | |
|---|---|---|
| LiteResearcher-4B | 2 | L20H15, L18H15 |
| DeepDiver-7B | 2 | L18H22, L17H0 |
| WebSeer-14B | 2 | L36H21, L47H33 |
| OpenResearcher-30B | 3 | L26H9, L26H25, L19H18 |
| OpenPangu-2.0-Flash-92B | 5 | L45H36, L39H24, L39H30, L39H32, L36H41 |
| Setting | Value or rule |
|---|---|
| Calibration | 100 HotpotQA trajectories; one answer-containing input each |
| Head set | Fixed per model; Table 6 |
| Batch size | Agent’s configured search-result count per query |
| Chunking | Agent’s search splitting rules and length limits |
| Trigger | Candidate count at least ; at most once per query update |
| Batch selection | candidates with the fewest prior scores |
| Benchmark | Role | Evaluation set |
|---|---|---|
| BrowseComp-Plus | End-to-end and evidence ranking | 830 questions |
| XBench-DeepSearch | End-to-end and head transfer | 2510 release; 100 questions |
| FRAMES | End-to-end multi-hop QA | Test split; 824 questions |
| SimpleQA | End-to-end factual QA | Original test set; 4,326 questions |
| HotpotQA | Offline localization and evidence analysis | 100 sampled trajectories |
| Model | Official checkpoint |
|---|---|
| DeepDiver-7B | openpangu/openPangu-Embedded-7B-DeepDiver |
| OpenResearcher-30B | OpenResearcher/OpenResearcher-30B-A3B |
| OpenPangu-2.0-Flash-92B | openpangu/openPangu-2.0-Flash |
| LiteResearcher-4B | simplex-ai-inc/LiteResearcher-4B |
| WebSeer-14B | 99hgz/WebSeer-14b |
| Model | Max. output tokens per call | Max. interaction rounds |
|---|---|---|
| DeepDiver-7B | 256 | 50 |
| OpenResearcher-30B | 8,192 | 50 |
| OpenPangu-2.0-Flash-92B | 4,096 | 50 |
| Setting | Retrieval source | Top- | Search snippet |
|---|---|---|---|
| BrowseComp-Plus: DeepDiver | BM25, official index | 5 | First 512 tokens per document; Qwen3-0.6B tokenizer |
| BrowseComp-Plus: OpenResearcher | Official dense-retrieval service | 10 | Query-highlighted summary, at most 180 characters |
| BrowseComp-Plus: OpenPangu | BM25, official index | 10 | At most 256 tokens per document |
| XBench-DeepSearch | Serper web search | 10 | API snippet, truncated to 512 tokens if longer |
| FRAMES | Serper web search | 10 | API snippet, truncated to 512 tokens if longer |
| SimpleQA | Serper web search | 10 | API snippet, truncated to 512 tokens if longer |
| Method | Configuration |
|---|---|
| DeepSearch | Uncompressed retrieved context under the matched agent and retrieval budgets. |
| QRAE | by default; fixed heads in Table 6 ; Search-aligned and ; online paired prefills; no evaluator generation. |
| LLMLingua-2 | microsoft/llmlingua-2-xlm-roberta-large-meetingbank ; token retention rate 0.5 on each query’s returned snippet text, before it enters the agent context; source metadata and snippet boundaries are protected. |
| ACON | Observation-compression variant with GPT-4.1-mini and the published observation-compression guideline, conditioned on the task and interaction history. Compress a query’s search observation when its snippet text exceeds 400 tokens, targeting 50% of its original text length; retain only the refined observation and leave the existing history unchanged. |
| Rerank | Qwen/Qwen3-Reranker-0.6B , using its query–document relevance prompt and yes/no score. Rerank the same retrieved snippets and keep the top ; use the snippet limits above without retrieving additional candidates. |
| QRHead | QRRetriever scoring on the corresponding frozen reasoning model: 16 heads for DeepDiver and 32 for OpenResearcher and OpenPangu. Average query-token attention mass over selected heads, subtract the score for the null query N/A , and retain the top snippets per query. |
| Model | Hardware | Precision |
|---|---|---|
| DeepDiver-7B | NVIDIA RTX 4090 | BF16 |
| OpenResearcher-30B | NVIDIA RTX 4090 | BF16 |
| OpenPangu-2.0-Flash-92B | NVIDIA H200 | BF16 |
| Metric | BrowseComp-Plus | XBench-DeepSearch |
|---|---|---|
| Delayed admissions per trajectory | 4.36 | 11.17 |
| Annotated evidence among delayed admissions per trajectory | 1.31 | 2.69 |
| Mean admission delay (steps) | 2.00 | 2.10 |
| Trajectories with delayed admission | 745/830 (89.8%) | 89/100 (89.0%) |
| Example | Initially deferred | Reassessed and admitted | Final answer |
|---|---|---|---|
| Question 66: roast duck | Step 3; ranks | Step 5; ranks | Peking duck (correct) |
| Question 75: The Voice of China | Step 5; ranks | Step 8; ranks | Li Wei (correct) |
| Model | 5 chunks | 20 chunks | ||||
|---|---|---|---|---|---|---|
| AUC | Recall@1 | Recall@3 | AUC | Recall@1 | Recall@10 | |
| DeepDiver | ||||||
| Dataset | Method | Success (%) | Time (s) | Tokens (k) |
|---|---|---|---|---|
| BrowseComp- Plus | DeepSearch | |||
| QRAE | ||||
| XBench- DeepSearch | DeepSearch | |||
| QRAE | ||||
| FRAMES | DeepSearch | |||
| QRAE |
| Target | Scope | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|---|
| Chunk | Prefill | 11 | 11 | 12 | 15 | 16 | 19 |
| Chunk | All | 11 | 11 | 12 | 14 | 16 | 19 |
| Token | Prefill | 11 | 11 | 12 | 12 | 14 | 15 |
| Token | All | 11 | 11 | 12 | 13 | 14 | 16 |
| Dataset | Method | Time (s) | Tokens (k) | ||||
|---|---|---|---|---|---|---|---|
| Reasoning | Tool | Compression | Input | Output | Compression | ||
| BrowseComp- Plus | DeepSearch | 28.2 | 1.3 | – | 175 | 2.4 | – |
| QRAE | 17.3 | 0.9 | 2.3 | 48 | 1.3 | 4.9 | |
| XBench- DeepSearch | DeepSearch | 144.3 | 131.7 | – | 314 | 4.6 | – |
| QRAE | 41.1 | 98.6 | 10.7 | 77 | 2.8 | 37 | |
| Head set | 5 chunks | 20 chunks | ||||
|---|---|---|---|---|---|---|
| AUC | Recall@1 | Recall@3 | AUC | Recall@1 | Recall@10 | |
| QRAE (full) | 83.2 | 54.6% | 83.2% | 84.4 | 44.6% | 88.7% |
| Random heads | 45.7 | 9.9% | 38.8% | 53.0 | 5.3% | 40.2% |
| Heads selected by QRHead | 68.3 | 24.5% | 70.0% | 70.4 | 13.9% | 63.3% |