mlsanityData to 24 Nov 2026

The Physical Cost of Context: Quality-Constrained Resource Accounting for Coding Agents

arXiv 2610.34763 ↗Submitted 26 Oct 2026cs.SE cs.AIcited by 1

On the map: LLM agents and tool use → Software engineering coding agents also fits: Agent memory systems

Abstract (arXiv)

Coding agents resend a growing context on every model call, and context policies are usually judged by the prompt tokens they save. Executed work also depends on call count and prefix reuse: a caching runtime prefills only the tokens after the longest cached prefix. A shorter prompt can therefore cost more if it rewrites cached history. Our quality-gated protocol splits executed prefill into logical prompt minus reused prefix and measures KV residency, time, and energy. On 450 localization cases derived from SWE-rebench V2, preloading ten retrieved blocks (Eager) and adding anchored history compaction (Compact) both pass a five-point non-inferiority gate. In a separate 900-cell study, Eager cuts model calls by 35.7% and the GPU-energy proxy by 33.2% against on-demand search (Grep); Compact saves nothing further. Enabling prefix caching leaves Eager's prompt volume similar (+8.3%; its 95% CI spans zero) but cuts its uncached prefill by 67.7%. Deleting history can turn a token saving into extra work. With mini-SWE-agent on 100 SWE-bench Verified instances, keeping only the last five observations (Mask-5) cuts Eager's prompt volume by 33.3% but loses 135.9k reusable tokens per task. Uncached prefill rises by 608.5%, the energy proxy by 125.6%, and the policy misses the quality gate. Policies thus save physical work by shortening the trajectory and can multiply it by editing reusable history.

Key facts. Cited by 1 paper in the map (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 35 of its 47 references that are in the map. Submitted 26 Oct 2026.

Builds on

35 of 47 references.

Closest ancestors · 8

Same direction, newest first

  1. 2026CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agents28 Jul
  2. 2026SWE-rebench V2: Language-Agnostic SWE Task Collection at Scale27 Feb
  3. 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan
  4. 2025Context as a Tool: Context Management for Long-Horizon SWE-Agents26 Dec
  5. 2025Reducing Cost of LLM Agents with Trajectory Reduction28 Sep
  6. 2025LocAgent: Graph-Guided LLM Agents for Code Localization12 Mar
  7. 2025OrcaLoca: An LLM Agent Framework for Software Issue Localization1 Feb
  8. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May

Other references · 27

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,845
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 9,589
  3. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 6,685
  4. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,871
  5. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,444
  6. 2023MemGPT: Towards LLMs as Operating Systemscited by 1,655
  7. 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,372
  8. 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 1,003
  9. 2019Green AIcited by 643
  10. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 500
  11. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 387
  12. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 384
15 more
  1. 2023Prompt Cache: Modular Attention Reuse for Low-Latency Inferencecited by 307
  2. 2024AutoCodeRover: Autonomous Program Improvementcited by 303
  3. 2024CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusioncited by 262
  4. 2023CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Servingcited by 223
  5. 2026DFlash: Block Diffusion for Flash Speculative Decodingcited by 217
  6. 2024RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graphcited by 104
  7. 2022Zeus: Understanding and Optimizing GPU Energy Consumption of DNN Trainingcited by 84
  8. 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 73
  9. 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 70
  10. 2025Issue Localization via LLM-Driven Iterative Code Graph Searchingcited by 27
  11. 2025Rethinking Key-Value Cache Compression Techniques for Large Language Model Servingcited by 11
  12. 2025ContextPilot: Fast Long-Context Inference via Context Reusecited by 10
  13. 2026On the Effectiveness of Context Compression for Repository-Level Tasks: An Empirical Investigationcited by 4
  14. 2026CodeMEM: AST-Guided Adaptive Memory for Repository-Level Iterative Code Generationcited by 3
  15. 2026Stream2LLM: Overlap Context Streaming and Prefill for Reduced Time-to-First-Token (TTFT)cited by 3

Built on by

Cited by year (2026 to 24 Nov)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Caching
  2. 2026What Does Context Compression Cost an Agent? Interaction Costs Unrevealed by Task-Completion Metrics
  3. 2026An Empirical Cost Attribution of Context-Compression Gateways in Multi-Turn Coding Agents
  4. 2026The Handoff Tax: Continuing Non-Native Trajectories in LLM Agents
  5. 2026Beyond Token Savings: A Systematic Study of Context Compression in LLM Agents
  6. 2026Prompt-Induced Waste in Coding Agents: Reasoning, Effort, Harness Design, and End-to-End Cost
  7. 2026BudgetBench: A Budget-Tiered Protocol and Pilot Harness for Memory Strategy Evaluation in Local Large Language Model Agents
  8. 2026Control Under Compression: Reliability Frontiers for Tool-Using Agents