mlsanityData to 14 Oct 2026

Reducing Cost of LLM Agents with Trajectory Reduction

arXiv 2509.23586 ↗First posted 28 Sep 2025cs.SE cs.AIcited by 48

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Multi-turn agent systems based on Large Language Models (LLMs) have become increasingly popular for software engineering tasks. While LLM agents demonstrate promising effectiveness, the high computational cost of input tokens due to ever-growing trajectories remains a significant efficiency concern. Efficiency has been largely overlooked in existing studies and agent products, and this paper addresses this gap by introducing an inference-time trajectory reduction approach that reduces computational costs. By analyzing existing agent trajectories, we demonstrate that useless, redundant, and expired information is widespread across trajectories. Such waste can be identified and reduced without compromising the agent's performance. We propose a simple yet effective trajectory reduction approach, AgentDiet, which automatically removes such waste during agent execution. We implement AgentDiet on a top-performing coding agent, and our evaluation on two LLMs and two benchmarks shows that AgentDiet can reduce input tokens by 39.9%-59.7% and the total computational cost by 21.1%-35.9%, while maintaining the same agent performance. These results indicate that inference-time trajectory reduction is a promising direction for agent systems.

Key facts. Cited by 48 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 36 of its 50 references that are in the map. First posted on arXiv 28 Sep 2025.

Builds on

36 of 50 references.

Closest ancestors · 6

Same direction, newest first

  1. 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul
  2. 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep
  3. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
  4. 2024Agentless: Demystifying LLM-based Software Engineering Agents1 Jul
  5. 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repair25 Mar
  6. 2024Executable Code Actions Elicit Better LLM Agents1 Feb

Other references · 30

  1. 2017Attention Is All You Needcited by 60,361
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  5. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  6. 2025LLMs Get Lost In Multi-Turn Conversationcited by 429
  7. 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 348
  8. 2024AutoCodeRover: Autonomous Program Improvementcited by 278
  9. 2025MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agentscited by 238
  10. 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 189
  11. 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 171
  12. 2023Keep the Conversation Going: Fixing 162 out of 337 bugs for 0.42 each using ChatGPTcited by 125
18 more
  1. 2024Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inferencecited by 116
  2. 2023Learning to Filter Context for Retrieval-Augmented Generationcited by 83
  3. 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
  4. 2024Prompt Compression with Context-Aware Sentence Encoding for Fast and Improved LLM Inferencecited by 53
  5. 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 48
  6. 2024AgentFL: Scaling LLM-based Fault Localization to Project-Level Contextcited by 47
  7. 2023Explainable Automated Debugging via Large Language Model-driven Scientific Debuggingcited by 40
  8. 2025Provence: efficient and robust context pruning for retrieval-augmented generationcited by 25
  9. 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
  10. 2025PISCO: Pretty Simple Compression for Retrieval-Augmented Generationcited by 20
  11. 2025Can Pruning Improve Reasoning? Revisiting Long-CoT Compression with Capability in Mind for Better Reasoningcited by 19
  12. 2020Probing Model Signal-Awareness via Prediction-Preserving Input Minimizationcited by 14
  13. 2025LONGCODEU: Benchmarking Long-Context Language Models on Long Code Understandingcited by 13
  14. 2025The Hidden Cost of Readability: How Code Formatting Silently Consumes Your LLM Budgetcited by 12
  15. 2024Natural Is The Best: Model-Agnostic Code Simplification for Pre-trained Large Language Modelscited by 10
  16. 2022Syntax-Guided Program Reduction for Understanding Neural Code Intelligence Modelscited by 7
  17. 2024ALPINE: An adaptive language-agnostic pruning method for language models for codecited by 4
  18. 2025Automated Repair of C Programs Using Large Language Modelscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 45.

48 papers.

Sort:

By area:

  1. 2025Memory in the Age of AI Agentscited by 303
  2. 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 44
  3. 2025Context as a Tool: Context Management for Long-Horizon SWE-Agentscited by 43
  4. 2026BackdoorAgent: A Unified Framework for Backdoor Attacks on LLM-based Agentscited by 16
  5. 2026Scaling Test-Time Compute for Agentic Codingcited by 15
  6. 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 15
  7. 2026Self-GC: Self-Governing Context for Long-Horizon LLM Agentscited by 11
  8. 2026How to Interpret Agent Behaviorcited by 10
  9. 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agentcited by 10
  10. 2025Agentic Software Issue Resolution with Large Language Models: A Surveycited by 6
  11. 2026Do LLMs Benefit From Their Own Words?cited by 5
  12. 2026SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harnesscited by 5
36 more
  1. 2026From Patches to Trajectories: Privileged Process Supervision for Software-Engineering Agentscited by 4
  2. 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
  3. 2026Turning Interaction History into Execution State: A Runtime Layer for Long-Horizon Coding Agentscited by 4
  4. 2026SWE-Prime: Fewer Trajectories, Better Performancecited by 4
  5. 2026Diagnosing and Mitigating Context Rot in Long-horizon Searchcited by 3
  6. 2026The Devil Is in the Interface: Evaluating How Tool Architecture Shapes Coding Agent Behaviorcited by 3
  7. 2026ProgRouter: Online Progress-Guided Orchestration for Multi-Agent LLM Workflows under Quality-Cost Tradeoffscited by 3
  8. 2026PseudoAct: Leveraging Pseudocode Synthesis for Flexible Planning and Action Control in Large Language Model Agentscited by 2
  9. 2026View-oriented Conversation Compiler for Agent Trace Analysiscited by 2
  10. 2026AGORA: Adapter-Grounded Observation-Action Retention for Inference-Free Prompt Compression in LLM Agentscited by 2
  11. 2026Redundant or Necessary? A Benchmark for Detecting Redundant Steps in Agent Trajectoriescited by 2
  12. 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
  13. 2026CORVUS: Context Optimization and Reduction Via Underlying Synchronization for LLM Coding Agentscited by 2
  14. 2026Cost-Utility Alignment in LLM Agent Trajectories:Profiling,Attribution,Diagnosis,Adaptation,and Evaluationcited by 2
  15. 2026Last Step Matters: Early Uncertainty Cannot Predict Failure in Long-Horizon Agentscited by 2
  16. 2026ObjectGraph: From Document Injection to Knowledge Traversal -- A Native File Format for the Agentic Eracited by 1
  17. 2026Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessingcited by 1
  18. 2026Shared Selective Persistent Memory for Agentic LLM Systemscited by 1
  19. 2026The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languagescited by 1
  20. 2026Agentic Vulnerability Reasoning on COTS Binariescited by 0
  21. 2026MEMOA: Massive Mixtures of Online Agents via Mean-Field Decentralized Nash Equilibriacited by 0
  22. 2026Towards Feedback-to-Plan Decisions for Self-Evolving LLM Agents in CUDA Kernel Generationcited by 0
  23. 2026Diagnosis-Driven Automatic Repair for Agentic Workflow via Symbolic Inferencecited by 0
  24. 2026CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agentscited by 0
  25. 2026Read Less, Solve More: Token-Efficient Sparse Reading for AI Agentscited by 0
  26. 2026openJiuwen: Beyond Static Harnesses for Long-Horizon Coding Agentscited by 0
  27. 2026LEGIT: Credentialing Protocol for Trustworthy AI Agent Marketplacescited by 0
  28. 2026DENSE: Distilling Agent Trajectories into Evidence-Grounded Shortcut Trees for Self-Refinementcited by 0
  29. 2026Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agentscited by 0
  30. 2026Beyond Token Savings: A Systematic Study of Context Compression in LLM Agentscited by 0
  31. 2026TokenCast: Forecasting Token Consumption During LLM Agent Executioncited by 0
  32. 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agentscited by 0
  33. 2026Complex Agents, Shallow Tests: Demystifying and Enhancing Test Adequacy of Agent Harness in the Wildcited by 0
  34. 2026TurnCost: Turns, Not Observations: Cache-Aware Loop Engineering for Coding Agentscited by 0
  35. 2026StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agentscited by 0
  36. 2026Pack Light, CarryOn: Building Object-Oriented Context for Long-Horizon Agentscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025Efficient Agents: Building Effective Agents While Reducing Cost
  2. 2026Yet Even Less Is Even Better For Agentic, Reasoning, and Coding LLMs
  3. 2026Beyond Quantity: Trajectory Diversity Scaling for Code Agents
  4. 2026AgentPerfBench: A Benchmarking and Evaluation Suite for Inference Performance of Agentic LLMs
  5. 2025DARS: Dynamic Action Re-Sampling to Enhance Coding Agent Performance by Adaptive Tree Traversal
  6. 2026The Handoff Tax: Continuing Non-Native Trajectories in LLM Agents
  7. 2026Rethinking the Evaluation of Efficiency Methods for Multi-Agent Systems
  8. 2025MapCoder-Lite: Distilling Multi-Agent Coding into a Single Small LLM