As Large Language Models (LLMs) transition from simple chatbots to autonomous agents capable of managing entire software repositories, their environmental impact is coming under increased scrutiny. A new paper, "Re-Reading Is Not Free," argues that our current methods for estimating AI energy consumption are fundamentally flawed when applied to these long-running "agentic" workflows. By ignoring the massive amount of data these agents "re-read" from their memory caches, we may be underestimating their energy footprint by as much as 25 times.
TL;DR
Current energy estimators for LLMs focus on what the model generates, but for autonomous agents, the real cost lies in "re-reading" accumulated context. This study analyzes a billion-token real-world trace, revealing that 95% of tokens are cached reads, leading to energy demands 25x higher than standard estimates.
What Problem Does This Paper Address?
Most energy models for AI are built for "single-shot" interactions—you ask a question, the model gives an answer, and the session ends. However, AI agents in software engineering (like GitHub Copilot or Claude Code) operate in long sessions. They maintain a history of the conversation, the code they’ve read, and the output of tools they’ve run.
To save time, cloud providers use prompt caching, which avoids re-calculating the "meaning" (embeddings) of this history every time. While this makes the model faster, it doesn't make it "free." Every time the agent generates a new word, it still has to perform "attention" operations over that entire cached history. The authors tackle the gap in current energy accounting that treats this cached context as if it has zero or negligible cost.
Methods
The researchers conducted a retrospective study of a massive real-world dataset. They developed a cache-aware hybrid energy estimator by extending existing analytical models.
Their methodology involved:
- Token Trace Analysis: Categorizing tokens into four classes: uncached input, cache writes, cached reads, and generated output.
- Hybrid Modeling: Combining model-level computational characteristics (like parameter counts and attention mechanisms) with infrastructure-level data (like server power and cooling efficiency).
- Delegation Reconstruction: They discovered that standard logs often hide the work done by "subagents" (smaller models called by the main agent), so they manually reconstructed these "invisible" workloads from private transcripts.
Datasets
The study is based on a unique, high-fidelity dataset:
- The Trace: Nearly one billion tokens collected over ten weeks of real-world AI-assisted software development.
- Scope: 42 sessions and 752 task episodes across six different industrial research workstreams.
- Tooling: The data comes from the use of Claude Code, involving various model tiers (Haiku, Sonnet, and Opus).
Key Insights and Ideas
- The "Attention Tax": Even with caching, the energy cost of "attention" scales with context length. In agentic workflows, "Attention reads" dominate the energy footprint, accounting for roughly 90% of the IT energy.
- The 260:1 Ratio: For every single token the agent generates, it reads approximately 260 tokens from its cached context. This "re-reading" is the primary driver of energy consumption.
- Context Bloat: Context doesn't just grow; it accelerates. Over a single development session, the amount of context the model must attend to grows 5.3-fold.
- The Invisible Subagent: When an agent delegates a task to a subagent, the parent log typically only records the subagent's final response. The authors found this undercounts the actual tokens processed by a factor of ten.
Key Results
The quantitative findings are a wake-up call for "Green AI" researchers:
- The 25x Gap: Standard output-based estimators (like EcoLogits) estimated the workload at ~10 kWh. The authors' cache-aware model estimated it at ~250 kWh.
- Task Costs: "Refactoring" tasks are the most expensive, consuming a median of 835k tokens per episode, largely because they require the agent to hold massive amounts of code in its "head" (context).
- Potential Savings: The study found that simply starting each task from a "fresh" context (clearing the cache) would lower the energy estimate by about 60%, though this comes at the cost of the agent "forgetting" previous work.
Limitations and Future Work
The authors acknowledge several limitations:
- Single-User Trace: The data comes from one engineer's workflow, which may not represent all software engineering styles.
- Proprietary Models: Because models like Claude are "black boxes," the authors had to estimate their internal architectures (layer counts, etc.) based on public registries.
- Modeled vs. Measured: The energy figures are analytical estimates, not direct hardware measurements, which are currently impossible for users of commercial cloud APIs.
Future Work: The researchers call for "workflow-level" energy accounting and suggest that tool vendors should provide users with per-request energy feedback to encourage more sustainable AI usage.
Summary updated