mlsanityData to 14 Oct 2026

How Do AI Agents Spend Your Money? Analyzing and Predicting Token Consumption in Agentic Coding Tasks

arXiv 2604.22750 ↗First posted 24 Apr 2026cs.CL cs.AI cs.CYcited by 33

On the map: LLM agents and tool use → Agent memory systems

Abstract (arXiv)

The wide adoption of AI agents in complex human workflows is driving rapid growth in LLM token consumption. When agents are deployed on tasks that require a significant amount of tokens, three questions naturally arise: (1) Where do AI agents spend the tokens? (2) Which models are more token-efficient? and (3) Can agents predict their token usage before task execution? In this paper, we present the first systematic study of token consumption patterns in agentic coding tasks. We analyze trajectories from eight frontier LLMs on SWE-bench Verified and evaluate models' ability to predict their own token costs before task execution. We find that: (1) agentic tasks are uniquely expensive, consuming 1000x more tokens than code reasoning and code chat, with input tokens rather than output tokens driving the overall cost; (2) token usage is highly variable and inherently stochastic: runs on the same task can differ by up to 30x in total tokens, and higher token usage does not translate into higher accuracy; instead, accuracy often peaks at intermediate cost and saturates at higher costs; (3) models vary substantially in token efficiency: on the same tasks, Kimi-K2 and Claude-Sonnet-4.5, on average, consume over 1.5 million more tokens than GPT-5; (4) task difficulty rated by human experts only weakly aligns with actual token costs, revealing a fundamental gap between human-perceived complexity and the computational effort agents actually expend; and (5) frontier models fail to accurately predict their own token usage (with weak-to-moderate correlations, up to 0.39) and systematically underestimate real token costs. Our study offers new insights into the economics of AI agents and can inspire future research in this direction.

Key facts. Cited by 33 papers in the map (data through 14 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 18 of its 22 references that are in the map. First posted on arXiv 24 Apr 2026.

Builds on

18 of 22 references.

References · 18

  1. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  2. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  3. 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,191
  4. 2024Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameterscited by 1,986
  5. 2022Language Models (Mostly) Know What They Knowcited by 1,856
  6. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
  7. 2024Executable Code Actions Elicit Better LLM Agentscited by 564
  8. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
  9. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
  10. 2025Towards Thinking-Optimal Scaling of Test-Time Compute for LLM Reasoningcited by 119
  11. 2025Revisiting the Test-Time Scaling of o1-like Models: Do they Truly Possess Test-Time Scaling Capabilities?cited by 70
  12. 2025Inverse Scaling in Test-Time Computecited by 50
6 more
  1. 2025Budget-Aware Tool Use Enables Effective Agent Scalingcited by 44
  2. 2025OptimalThinkingBench: Evaluating Over and Underthinking in LLMscited by 35
  3. 2025Efficient Agents: Building Effective Agents While Reducing Costcited by 32
  4. 2025SWE-Effi: Re-Evaluating Software AI Agent System Effectiveness Under Resource Constraintscited by 17
  5. 2026Tokenomics: Quantifying Where Tokens Are Used in Agentic Software Engineeringcited by 12
  6. 2026The Price Reversal Phenomenon: When Cheaper Reasoning Models Cost Morecited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 33.

33 papers.

Sort:

By area:

  1. 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 15
  2. 2026BAGEN: Are LLM Agents Budget-Aware?cited by 13
  3. 2026Token Economics for LLM Agents: A Dual-View Study from Computing and Economicscited by 6
  4. 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
  5. 2026FrogNano: Training a 4B Coding Agent via Online Task Synthesiscited by 4
  6. 2026When Agents Coordinate: Measuring Coordination in Multi-Agent AI Codingcited by 3
  7. 2026Zipping the Thought: When and How Compressed Reasoning Data Works in LLM Post-Trainingcited by 2
  8. 2026What Should Agents Say? Action-state Communication for Efficient Multi-Agent Systemscited by 2
  9. 2026Reasoning effort, not tool access, buys first-try reliability in agentic code generation: an observational studycited by 2
  10. 2026SMetric: Rethink LLM Scheduling for Serving Agents with Balanced Session-centric Schedulingcited by 2
  11. 2026Markets, Not Planners: Decentralized Orchestration of LLM Agents with Private Informationcited by 2
  12. 2026Cost-Utility Alignment in LLM Agent Trajectories:Profiling,Attribution,Diagnosis,Adaptation,and Evaluationcited by 2
21 more
  1. 2026Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Studycited by 1
  2. 2026The Token Tax of Epistemic Accuracy: Comparing RAG and Long-Context Architectures for Document-Grounded Generative AI Applicationscited by 1
  3. 2026The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languagescited by 1
  4. 2026Can your AI agent be cheaper? Investigating the effects of task specifications on token spend in agentic coding taskscited by 1
  5. 2026MEMOA: Massive Mixtures of Online Agents via Mean-Field Decentralized Nash Equilibriacited by 0
  6. 2026AI Tokenomics: The Economics of Tokens, Computation, and Pricing in Foundation Modelscited by 0
  7. 2026ACEM: A Cost Estimation Model for Agentic Software Engineeringcited by 0
  8. 2026Predicting Task Difficulty Without Rolloutscited by 0
  9. 2026Can a Lightweight Multimodal Model Estimate LLM Reasoning Performance? A Study for Compute-Optimal Document Inferencecited by 0
  10. 2026AgentDecarbonizer: Carbon-Aware Execution for AI Agentscited by 0
  11. 2026LLM Agents as Computational Typologistscited by 0
  12. 2026AgentKV: Phase-Aware KV Eviction for Agentic LLMscited by 0
  13. 2026Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agentscited by 0
  14. 2026ResonAct: Streaming Metrics for Runtime Diagnosis and Self-Healing in Multi-Agent Systemscited by 0
  15. 2026TokenCast: Forecasting Token Consumption During LLM Agent Executioncited by 0
  16. 2026LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoningcited by 0
  17. 2026Complex Agents, Shallow Tests: Demystifying and Enhancing Test Adequacy of Agent Harness in the Wildcited by 0
  18. 2026Disentangling Task Difficulty from Run-Level Failure in Agent Failure Predictioncited by 0
  19. 2026U-Space: Uncovering When and Why Uncertainty Arises in Language Modelscited by 0
  20. 2026ByteMark: A Unified Byte-Level Watermark for Detection Across Language Modelscited by 0
  21. 2026Maximising Transparency in Context Compaction Improves Retention of Facts and Commitments for Lightweight Coding Agentscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2026Beyond Token Savings: A Systematic Study of Context Compression in LLM Agents
  2. 2026Agentic Coding in the Wild: Characterizing GitHub Copilot Traces at Production Scale
  3. 2026The Harness Effect: How Orchestration Design Sets the Token Economics of Enterprise Agentic AI
  4. 2026TraceLab: Characterizing Coding Agent Workloads for LLM Serving
  5. 2026On the Impact of AGENTS.md Files on the Efficiency of AI Coding Agents
  6. 2026Are Online Skill and Memory Modules Always Worth Their Tokens? A Budget-Constrained Study of Web Agents
  7. 2026Agentic AI Systems Should Be Designed as Marginal Token Allocators
  8. 2026How Do AI Coding Agents Contribute to Software Development? an Empirical Study of Agentic Pull Requests