arXiv Machine Learning

MoE-Context: Show the Model Only What It Needs

MoE-Context is a method that partitions a language model’s context into blocks and uses a fast yes/no pass to select only the blocks needed for each step, keeping the rest as one-line notes. In experiments with Qwen3-1.7B on a synthetic lookup task, this selective context raises accuracy from 93 to 119 out of 120, and masked blocks are effectively hidden. The authors also explore a supervised linear probe to improve block selection, noting its limited transferability, and discuss two practical usage patterns enabled by block switching: undoing failed attempts and running subagents without a new context.

arXiv AI
6d ago

Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Caching

The paper investigates how adding or removing context in large language model coding agents affects cost and performance. Using over 20,000 runs on SWE‑bench, Loc‑Bench, and Verified, the authors find that retrieved code can reduce read and search commands but may increase overall cost when cached input is cheaper. Removing old observations can either save or increase cost depending on cache pricing, and shorter prompts do not necessarily lead to cheaper runs because agents may take more steps. The study also highlights that shared cached prefixes in concurrent experiments can distort cost comparisons.

By Zerui Yang, Miaomiao Dong, Quan Xue, Chaorui Zhang, Xuanyu Zheng, Xiyuan Wang, Haolin Ruan, Xueyan Niu, Guangcheng Song, Weixi Zhang, Wei Han, Bo Bai
arXiv AI
4d ago

Semantic Context Handoff with On-Demand Evidence for Long-Horizon Agents

Semantic Context Handoff (SCH) separates a compact semantic state from the supporting action–observation evidence, allowing long‑horizon agents to retain only essential context while keeping earlier evidence accessible for later use. This approach reduces inference cost and improves accuracy by preventing unnecessary growth of the prompt history. In a 150‑task SWE‑bench study, SCH raised Pass@1 from 80.0 % to 86.9 % with unchanged token use and execution time, and in full‑system comparisons it achieved 86.9 % Pass@1 while using 43 % fewer tokens and 41 % less wall‑clock time than the strongest baseline.

By Guolong Zheng, Chen Hou, Xu Yang, Jianshan Zhang, Tao Huang
arXiv AI
Sep 3

Language Models Can Control Their Own Attention

The paper introduces Declarative Attention (DA), a protocol that lets language models explicitly declare which parts of their context to focus on during generation. By partitioning decoding into full-context, region-specific, and recent-output-only modes, the inference engine can skip large portions of the KV cache, dramatically reducing attended tokens. Experiments on 15 long-context tasks with off-the-shelf models show significant savings (52.0% and 31.1% reductions) with only modest accuracy drops that diminish as model size increases.

By Namgyu Ho, Huzama Ahmad, Woosung Koh, Se-Young Yun, Tal Schuster, Cicero Nogueira dos Santos
arXiv Computation and Language
Nov 4

When Should an Agent Refresh? Adaptive Index Reuse for Efficient Long-Horizon Reasoning

The paper introduces Adaptive Index Reuse (AIR), a method that dynamically determines how many layers of a sparse attention indexer should refresh during a language agent’s reasoning process. AIR replaces the static layer‑refresh schedule of IndexCache with a small controller that selects from a nested library of patterns based on recent computation signals and tool events, optimizing for task reward under a compute budget. Experiments on Qwen3‑4B‑Instruct‑2507 with a 128K context show AIR improving success rates on SWE‑bench Verified, Terminal‑Bench 2.0, and three τ²‑bench domains while reducing time per successful task, and it matches or surpasses the static schedule across 50 varied settings.

By Guangyuan Wang, Yifan Zhang, Shilong Liu
arXiv AI
Oct 28

Rare, Relevant, and Still Wrong: How Memory Fails LLM Group Decisions

The paper investigates how short memory representations of large‑language‑model (LLM) group discussions affect final decision quality. It introduces CrossProfile, a benchmark of 480 hidden‑profile tasks that separates supporting, decoy, and irrelevant facts while keeping their wording constant. Experiments with Qwen2.5‑7B, Llama‑3.1‑8B, and DeepSeek models show that heuristics based on rarity or relevance both fail in predictable ways, and that the decision model’s social‑proof bias further degrades accuracy. Removing attribution tags or randomizing them improves performance, yet natural transcripts still lose more evidence than no notes at all.

By Anouar Imel, Imad Charradi, Abderrahman Sghir, Khalil El Khammar
arXiv AI
Sep 28

Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agents

The paper introduces LOHA, a context layout that compresses older tool observations into soft tokens while keeping the agent’s own turns and the last K observations in plain text, and ACD, a training method that distills full‑text predictions into this latent representation while anchoring behavior on plain text. This approach reduces context per call by up to 57% without significant loss in resolve rates, and improves instance throughput in single‑GPU serving. Experiments on SWE‑bench Verified show that K=3 yields a 43–57% compression with only modest performance impact, while larger windows favor task performance over compression.

By Zhensheng Zou (Peking University), Guoqing Wang (Peking University), Dan Hao (Peking University)
arXiv AI
Nov 14

Folio: Recoverable Multi-Resolution Context Folding for Long-Horizon Language Agents

Folio is a context‑management system for long‑horizon language agents that records and folds conversation history into three linked levels—short turn notes, event manifests, and source records—allowing the agent to programmatically compress older turns while preserving recoverable handles. By printing these handles, Folio enables efficient recovery and analysis of the full history with minimal additional input. In benchmark tests on 75 LOCA‑bench tasks, Folio outperformed existing model‑written compaction methods, solving 66 tasks versus 54, and reduced runtime cost by 2.4× while keeping fold times around 0.6 seconds.

By Yubo Ruan, Tao Peng, Jiao Zhang, Chuanguo Ma, Lei Xu, Han Zhou, Wenwu Wang, Xiafei Lv, Xingjie Zhou, Guiju Fan, Hao Wang, Fenghui Zhang, Mao Miao, Shuo Li
arXiv Computation and Language
Nov 5

LLM Agents Already Know When to Call Tools -- Even Without Reasoning

The paper introduces When2Tool, a benchmark of 18 environments that categorizes tasks by whether a tool call is necessary, covering computational scale, knowledge boundaries, and execution reliability. It evaluates two training‑free baselines—Prompt‑only and Reason‑then‑Act—finding they inadequately control tool usage. By probing hidden states, the authors discover that models can predict tool necessity with high accuracy, leading to the Probe&Prefill method that reduces unnecessary tool calls by 38% with minimal accuracy loss.

By Chung-En Sun, Linbo Liu, Ge Yan, Zimo Wang, Tsui-Wei Weng