Teaching Machines to Remember

Stateless AI burns compute rebuilding context from scratch, caching offers the fix.

AI Memory · Software Engineering · Neurosymbolic AI · Computer Science
The Cold Start Tax: From Disposable Outputs to Durable Work
Every time an AI agent takes another step, it pays to relearn what it already knew. The fix borrows a discipline software engineers have trusted for decades: stop throwing away work that already happened.
2026
I. The Toll of Starting From Zero

Every contractor knows the fastest way to waste a season is to tear down the scaffolding every evening and rebuild it from scratch each morning. The job never advances, even though the crew shows up and works hard every single day. A surprising share of modern computing runs exactly this way, quietly rebuilding what it already built, over and over, and paying for the privilege each time.

Engineers have a name for this pattern: the cold start. It strikes whenever a system has no memory of what came before and must reconstruct context before doing anything useful. A cloud server that has sat idle has to reload its software environment before answering a single request. A brand new streaming subscriber gets bland, generic recommendations because the service has no viewing history to learn from. A program running on a fresh machine executes slowly while it gathers the data it needs to run efficiently.

These delays are not just an annoyance, they cost real time and real money. On Alibaba's cloud computing platform, engineers found that in some regions more than half of all cold starts took over forty five seconds to resolve, simply because the system first had to pull a fresh copy of its software environment before it could begin work. Multiply that delay across millions of requests a day, and the cold start stops looking like a minor technical hiccup. It starts looking like a tax, levied again and again on work that was already done once.

II. Why Chatbots and AI Agents Forget Everything

The most expensive version of this problem now lives inside artificial intelligence. The large language models behind today's chatbots have no built in memory between requests. Each time someone sends a message, or an AI assistant takes another step in a task, the system processes the entire exchange again: instructions, prior turns, supporting documents, as though encountering all of it for the very first time.

That blank slate becomes especially costly once an AI stops simply answering questions and starts carrying out longer jobs, searching files, calling outside tools, checking its own work across many steps. Each new step adds fresh information to the conversation, and every step after that has to resend everything that came before just to stay coherent. Industry estimates suggest that in many AI agent systems, the cost of resending earlier context now eats up roughly six out of every ten dollars spent.

Consider an assistant working through a twenty step task, adding a modest one thousand tokens of new context at each step. A naive system does not simply pay for twenty thousand tokens of context by the time it finishes. It pays for the running total resent at every single step, which adds up to more than two hundred ten thousand tokens in all. The bill does not grow with the size of the task, it grows with the square of it, which is one reason long running AI agents can become surprisingly expensive, surprisingly fast.

01 The Cold Start Tax
Why an AI agent's bill grows faster than its task. Each step resends everything that came before, so the running total compounds far faster than the task itself grows.
The Cold Start Tax Why an AI agent’s bill grows faster than its task running total 1,000 Step 1 running total 3,000 Step 2 running total 6,000 Step 3 running total 10,000 Step 4 running total 15,000 Step 5 new context added this step (1,000 tokens) older context resent again, in full, every time Carried out to a 20 step task, the running total tops 210,000 tokens more than ten times the size of the task itself
New context added this step
Older context resent again, in full
III. Teaching Machines to Remember

The simplest fix engineers have found is also the most direct: stop asking the model to reread what it has already read. A technique known as prompt caching stores the model's internal representation of a stable block of text the first time it is processed, then reuses that stored version on every later step instead of recomputing it from scratch.

Caching the prompt only solves part of the problem, since it mainly helps with instructions and reference material that stay fixed. The harder challenge is giving an AI system memory that persists across an entire conversation, or even across many separate sessions. Newer agent designs borrow a structure familiar from human memory, splitting what gets stored into a record of specific events, general accumulated knowledge, and learned routines for getting things done, often backed by searchable databases that can be queried instead of reread in full.

Anthropic, whose models power a wide range of AI assistants, reports that prompt caching can reduce costs by as much as ninety percent and cut response times by up to eighty five percent for long prompts. That is the difference between a tool that feels sluggish and expensive and one that feels instant and cheap, achieved without changing the underlying model at all, simply by refusing to throw away work that had already been done.

02 Teaching Machines to Remember
Caching turns repeated work into a one time cost. Without it, every step in an AI agent's task reprocesses the full conversation from the start.
Teaching Machines to Remember Caching turns repeated work into a one time cost Without caching every step reprocesses the full conversation from the start Step 1 full context reprocessed Step 2 full context reprocessed Step 3 full context reprocessed Step 4 full context reprocessed cost climbs every step With caching the stable part of the context is stored once and reused Cached context instructions and history, stored once reused, not reread Step 1 new bit only Step 2 new bit only Step 3 new bit only Step 4 new bit only cost stays nearly flat Anthropic reports prompt caching can cut costs up to 90 percent and response time up to 85 percent on long prompts
Full context reprocessed each step
Cached context, computed once
Only the new piece of context
Durable computational memory, structure that persists instead of being rebuilt

Durable work, visualized: structure that is computed once, stored, and carried forward into every later step, instead of being rebuilt from nothing each time.

IV. When Machines Learn to Build Their Own Toolkits

Remembering past work is powerful, but some research groups have pushed a step further, building AI systems that learn reusable structure rather than just storing raw memories. The idea resembles how an experienced programmer builds up a personal library of utility functions over the years, so that each new project starts not from zero but from a toolkit already proven to work.

Researchers at MIT have built program writing systems that do exactly this, cycling between solving new problems and compressing what they learn into a growing library of reusable building blocks. Each cycle leaves the system a little more capable than the last, because the library from one round of problems carries forward into the next, rather than being discarded once the immediate task is finished.

A team working with an AI agent inside the video game Minecraft, built at NVIDIA and Caltech, demonstrated just how much that compounding can matter. The agent wrote and saved working pieces of code for skills it discovered, then reused and combined them later. It unlocked the game's early tool making milestones more than fifteen times faster than earlier approaches, and when dropped into a completely new and unfamiliar game world, it kept performing well immediately, while systems with no memory of past skills had to start over from nothing.

V. Borrowing Wisdom From Software's Oldest Tricks

Long before anyone worried about AI memory, software engineers solved a closely related problem for code itself. Large software projects can take hours to build from scratch, and rebuilding everything after a single small change is obviously wasteful. The tools developed to fix this offer a blueprint that AI system designers are now beginning to follow.

The core trick is called content addressing. Instead of tracking files by name, these systems identify each piece of work by a digital fingerprint of its exact contents and the inputs that produced it. If nothing about a piece of code or data has changed, its fingerprint stays the same, and the system can safely reuse the previously computed result instead of redoing the work. This same principle, of doing only the work that has actually changed, traces back to the earliest philosophy of building small, composable programs that pass clean, predictable output from one to the next.

Bazel, a build tool originally developed at Google and now used widely across the software industry, puts this into daily practice. It breaks a build into small pieces, fingerprints each one, and pulls unchanged pieces straight from a shared cache instead of rebuilding them, sometimes turning what was once an hours long rebuild into one that finishes in seconds for an entire engineering team. It is a small reminder that the soundest fix for artificial intelligence's cold start tax may not require inventing anything new. It may simply mean applying, to thinking machines, a discipline that software engineers already trust with everything else they build.

03 Durable Work Compounds
Each reused piece of work makes the next task cheaper. The same compounding logic runs through neurosymbolic library learning and content addressed build systems alike.
Durable Work Compounds Each reused piece of work makes the next task cheaper Cycle 1 library 1 reusable piece effort for next task Cycle 2 library 2 reusable pieces effort for next task Cycle 3 library 4 reusable pieces effort for next task Cycle 4 library 6 reusable pieces effort for next task library carries forward library carries forward The same structure runs through code and AI alike Neurosymbolic library learning an AI agent inside Minecraft, built at NVIDIA and Caltech, saved working code for skills it discovered, then reused it unlocked early milestones 15x faster Content addressed build systems Bazel fingerprints each piece of a build and pulls unchanged pieces from a shared cache instead of redoing them turns hours long rebuilds into seconds The fix for artificial intelligence’s cold start tax may not require inventing anything new, only applying a discipline software engineers already trust with everything they build
Reusable library pieces, carried forward
Effort still required for the next task
Neurosymbolic library learning

Key references: Anthropic, "Prompt caching with Claude," 2024. Alibaba Cloud, FaaSNet: Scalable and Fast Provisioning of Custom Serverless Container Runtimes, USENIX ATC, 2021. MIT CSAIL, "LILO: Learning Interpretable Libraries by Compressing and Documenting Code," ICLR, 2024. MIT, "DreamCoder: Bootstrapping Inductive Program Synthesis with Wake-Sleep Library Learning," PLDI, 2021. NVIDIA and Caltech, "Voyager: An Open-Ended Embodied Agent with Large Language Models," NeurIPS, 2023. Google, Bazel build system documentation. Industry analyses of agentic AI token costs and context engineering practices, 2025 to 2026.