Analyzes nearly one billion LLM interactions to quantify energy use beyond token counts, incorporating repeated context processing, cache reuse, and subagent delegation.

Topological visualization of Re-Reading Is Not Free: Token Traces and Cache-Aware Energy Estimation for LLM Agents in Software Engineering
Brave API

Re-Reading Is Not Free: Token Traces and Cache-Aware Energy Estimation for LLM Agents in Software Engineering analyzes 0.99 billion API-reported tokens from ten weeks of real-world Claude Code usage to demonstrate that conventional energy estimators significantly underestimate the environmental footprint of agentic AI. The study reveals that 94.8% of all tokens are cached-context reads, where the agent repeatedly re-processes accumulated conversation history, while uncached input accounts for only 0.017%.

Key findings include: Energy Discrepancy: A cache-aware hybrid estimator assigns the workload approximately 250 kWh of energy, compared to only 10 kWh from standard output-based estimators like EcoLogits, a 25-fold difference driven by the cost of attention reads on cached context. Context Growth: Computational demands accumulate over sessions, with context growing 5.3-fold over a full session but only 1.4-fold within individual tasks; for every generated token, approximately 260 cached tokens are read. Subagent Undercounting: Parent-level logs undercount delegated subagent tokens by a factor of ten because they only report the final internal call, though correcting this changes the total energy estimate by only about 5%. Optimization Potential: Starting each task from a fresh context (isolating context) would lower the model-based energy estimate by about 60%, highlighting context management as a critical lever for reducing energy consumption.

Generated 15d ago
Open-Weights Reasoning

This work examines the energy and compute footprint of LLM-based software-engineering agents using large-scale empirical traces, rather than relying on simple input/output token accounting. It analyzes nearly one billion LLM interactions and models how real agent workloads differ from single-shot inference: contexts are repeatedly re-sent, prompt prefixes may be reused through KV-cache or similar mechanisms, and multi-agent systems can delegate work to subagents that carry duplicated or overlapping context. The central contribution is a cache-aware energy estimation method that uses token traces to approximate the actual processing cost of agent executions, distinguishing between fresh computation, cache-reuse savings, and redundant context processing.

The key insight is that token counts alone can be a poor proxy for energy use, especially in agentic settings where the same context may be processed many times or partially avoided by caching. Repeated context handling, prompt growth over multi-step workflows, and subagent delegation can materially change the energy profile of an agent, even when the visible token totals look similar across systems. The paper therefore reframes efficiency for LLM agents in software engineering: not only “how many tokens are generated,” but “how much computation is actually performed given cache behavior, context reuse, and orchestration structure.”

This matters because LLM agents are increasingly used for long-horizon, high-volume software tasks where energy, latency, and cost are not just operational concerns but also factors in scalability and sustainability. A more accurate accounting framework can help practitioners and researchers compare agent designs, identify costly orchestration patterns, and evaluate whether caching or architectural changes meaningfully reduce real-world consumption. It also provides a methodological foundation for future work on efficient agent design, benchmarking, and energy-aware scheduling for LLM-driven software engineering systems.

Generated 15d ago
Sources