The DOI matches its Crossref record; 9 of the 9 references it cites were found in a registry or an index.
Reducing Cost of LLM Agents with Trajectory Reduction
Published version of a preprint
Abstract
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Chain-Of-Thought Prompting Elicits Reasoning in Large Language Models
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E., Le, Q. V., & Zhou, D. (2022) · Advances in Neural Information Processing Systems 35 · doi:10.52202/068431-1800 · Cited by 4,505
ReAct: Synergizing Reasoning and Acting in Language Models
Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. (2022) · arXiv · doi:10.48550/arxiv.2210.03629 · Cited by 608
LLMs Get Lost In Multi-Turn Conversation
Laban, P., Hayashi, H., Zhou, Y., & Neville, J. (2025) · arXiv · Cited by 419
MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents
Zhou, Z., Qu, A., Wu, Z., Kim, S., Prakash, A., Rus, D., Zhao, J., Low, B. K. H., & Liang, P. P. (2025) · arXiv · doi:10.48550/arxiv.2506.15841 · Cited by 218
Compressing Context to Enhance Inference Efficiency of Large Language Models
Li, Y., Dong, B., Lin, C., & Guerin, F. (2023) · arXiv · Cited by 88
LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression
Pan, Z., Wu, Q., Jiang, H., Xia, M., Luo, X., Zhang, J., Lin, Q., Rühle, V., Yang, Y., Lin, C.-Y., et al. (2024) · Findings of the Association for Computational Linguistics: ACL 2024 · doi:10.18653/v1/2024.findings-acl.57 · Cited by 58
LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression
Pan, Z., Wu, Q., Jiang, H., Xia, M., Luo, X., Zhang, J., Lin, Q., Rühle, V., Yang, Y., Lin, C.-Y., et al. (2024) · arXiv · Cited by 2
Lindenbauer, T., Slinko, I., Felder, L., Bogomolov, E., & Zharov, Y. (2025) · arXiv · doi:10.48550/arxiv.2508.21433
SWE-Effi: Re-Evaluating Software AI Agent System Effectiveness Under Resource Constraints
Fan, Z., Vasilevski, K., Lin, D., Chen, B., Chen, Y., Zhong, Z., Zhang, J. M., He, P., & Hassan, A. E. (2025) · arXiv · doi:10.48550/arxiv.2509.09853
Research works printed but not linked: 38
- 10.1145/3597503.3639183 · DOI · Paper page
- Anthropic. 2025. Claude Code: Deep coding at terminal velocity. https://www.anthropic.com/claude-code
- 10.1109/ICSE55347.2025.00157 · DOI
- 10.48550/arXiv.2501.16214 · DOI
- 10.48550/arXiv.2509.09853 · DOI · Paper page
- 10.48550/arXiv.2509.01947 · DOI
- 10.48550/arXiv.2507.23370 · DOI
- 10.1109/ICSE48619.2023.00125 · DOI · Paper page
- Carlos E. Jimenez John Yang Alexander Wettig Shunyu Yao Kexin Pei Ofir Press and Karthik Narasimhan. 2024. SWE- bench: Can Language Models Resolve Real-World GitHub Issues? arXiv:2310.06770 [cs] doi:10.48550/arXiv.2310.06770 10.48550/arXiv.2310.06770 · DOI · Paper page
- 10.1007/s10664-024- · DOI
- 10.18653/v1/2025.acl-long.1324 · DOI
- 10.18653/v1/2023.emnlp-main.391 · DOI · Paper page
- 10.1609/aaai.v39i23.34639 · DOI
- 10.1145/3796507 · DOI
- 10.1162/tacl_a_00638 · DOI · Paper page
- 10.18653/v1/2025.findings-acl.800 · DOI
- 10.48550/arXiv · DOI
- Dangfeng Pan Zhensu Sun Cenyuan Zhang David Lo and Xiaoning Du. 2025. The Hidden Cost of Readability: How Code Formatting Silently Consumes Your LLM Budget. (2025). doi:10.48550/arXiv.2508.13666 10.48550/arXiv.2508.13666 · DOI
- 10.18653/v1/2024 · DOI
- 10.1145/3663529 · DOI
- Yihao Qin Shangwen Wang Yiling Lou Jinhao Dong Kaixin Wang Xiaoling Li and Xiaoguang Mao. 2024. AgentFL: Scaling LLM-based Fault Localization to Project-Level Context. arXiv preprint arXiv:2403.16362 (2024). doi:10.48550/ arXiv.2403.16362 10.48550/arXiv.2403.16362 · DOI · Paper page
- 10.1145/3520312.3534869 · DOI
- 10.1145/3715773 · DOI
- 10.1145/3468264.3468545 · DOI
- 10.48550/arXiv.1706.03762 · DOI · Paper page
- Xingyao Wang Yangyi Chen Lifan Yuan Yizhe Zhang Yunzhu Li Hao Peng and Heng Ji. 2024. Executable Code Actions Elicit Better LLM Agents. arXiv:2402.01030 [cs] doi:10.48550/arXiv.2402.01030 10.48550/arXiv.2402.01030 · DOI · Paper page
- Xingyao Wang Boxuan Li Yufan Song Frank F. Xu Xiangru Tang Mingchen Zhuge Jiayi Pan Yueqi Song Bowen Li Jaskirat Singh Hoang H. Tran Fuqiang Li Ren Ma Mingzhang Zheng Bill Qian Yanjun Shao Niklas Muennighoff Yizhe Zhang Binyuan Hui Junyang Lin Robert Brennan Hao Peng Heng Ji and Graham Neubig. 2024. OpenHands: An Open Platform for AI Software Developers as Generalist Agents. arXiv:2407.16741 [cs] doi:10.48550/arXiv.2407.16741 10.48550/arXiv.2407.16741 · DOI · Paper page
- 10.1145/3643753 · DOI · Paper page
- 10.48550/arXiv.2311.08377 · DOI · Paper page
- 10.1145/3715754 · DOI · Paper page
- 10.1145/3650212.3680323 · DOI
- 10.48550/arXiv.2310.04408 · DOI
- 10.1145/3735636 · DOI
- 10.52202/079017-1601 · DOI · Paper page
- Daoguang Zan Zhirong Huang Wei Liu Hanwu Chen Linhao Zhang Shulin Xin Lu Chen Qi Liu Xiaojian Zhong Aoyan Li et al. 2025. Multi-SWE-bench: A Multilingual Benchmark for Issue Resolving. arXiv preprint arXiv:2504.02605 (2025). doi:10.48550/arXiv.2504.02605 10.48550/arXiv.2504.02605 · DOI · Paper page
- 10.1145/3650212.3680384 · DOI · Paper page
- 10.1145/3540250.3549094 · DOI · Paper page
- 10.48550/arXiv.2505.14582 · DOI
Cited by
Memory in the Age of AI Agents
Hu, Y., Liu, S., Yue, Y., Zhang, G., Liu, B., Zhu, F., Lin, J., Guo, H., Dou, S., Xi, Z., et al. (2025) · arXiv · doi:10.48550/arxiv.2512.13564 · Cited by 389
Kong, Z., Li, Y., Zeng, F., Xin, L., Messica, S., Lin, X., Zhao, P., Kellis, M., Tang, H., & Zitnik, M. (2025) · arXiv · doi:10.48550/arxiv.2505.18227 · Cited by 51
Context as a Tool: Context Management for Long-Horizon SWE-Agents
Liu, S., Yang, J., Jiang, B., Li, Y., Guo, J., Liu, X., & Dai, B. (2025) · arXiv · doi:10.48550/arxiv.2512.22087 · Cited by 35
Better Harnesses, Smaller Models: Building 90% Cheaper Agents via Automated Harness Adaptation
Yang, C., Zhao, X., Wu, T., & Kästner, C. (2026) · arXiv · doi:10.48550/arxiv.2607.08938 · Cited by 11
SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents
Wang, Y., Shi, Y., Yang, M., Zhang, R., He, S., Lian, H., Chen, Y., Ye, S., Cai, K., & Gu, X. (2026) · arXiv · doi:10.48550/arxiv.2601.16746 · Cited by 2
“…in software engineering tasks, from simple code understanding (Chen et al., 2021; Li et al., 2023b; Yang et al., 2025; Hu et al., 2025) to interactive agents capable of navigating repositories, running tests, and submitting patches end-to-end (Chen et al., 2025; Li et al., 2025; Xiao et al., 2025).”
Lindenbauer, T., Slinko, I., Felder, L., Bogomolov, E., & Zharov, Y. (2025) · arXiv · doi:10.48550/arxiv.2508.21433
“Concurrently with our work, Xiao et al. [34] propose an LLM-Summary variant for efficient SE agent context management.”
Self-GC: Self-Governing Context for Long-Horizon LLM Agents
Hao, X., Meng, H., Yin, X., Zhu, J., & Cao, C. (2026) · arXiv · doi:10.48550/arxiv.2607.00692
“AgentDiet reduces LLM-agent cost through trajectory reduction (Xiao et al. 2025), AgentFold performs proactive context folding for long-horizon web agents (Ye et al. 2026), and LongCodeZip compresses long code context for code language models (Shi et al. 2025).”
Shared Selective Persistent Memory for Agentic LLM Systems
Pedada, S., Dhavala, A., & Patil, N. (2026) · arXiv · doi:10.48550/arxiv.2607.09493
“We observe that this re-specification is both the primary source of user friction and the primary source of wasted tokens.”
Reducing Token Usage of State-in-Context Agents using Minification
Hrubec, N., & Cito, J. (2026) · arXiv · doi:10.48550/arxiv.2606.01326
Metadata
- Authors
- Xiao, Y.-A., Gao, P., Peng, C., & Xiong, Y.
- Venue
- Proceedings of the ACM on Software Engineering
- Published
- 2026-06-30
- Volume
- 3
- Issue
- FSE
- Pages
- 1241-1263
- ISSN
- 2994-970X
- Cited by
- 6
- References
- 9
- Language
- en
- Funders
- National Natural Science Foundation of China (92582202)
- National Key Research and Development Program of China (2022YFB4501902)
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.