The Code Is Disposable

AI now generates software faster than anyone expected, but speed is the wrong thing to optimize.

 Most enterprise AI budgets rest on the same belief that a more capable model, given more context, will write better software. Eighteen months of research points the other way, with one telling result coming from a lab at MIT.

Omar Khattab and Alex Zhang, working with Tim Kraska in MIT’s CSAIL lab, kept hitting the same wall. Feed a language model a sufficiently long document, and its accuracy drops. On one diff-tracking test, GPT-5 solved fewer than 1 in 10 cases once the history exceeded 75,000 tokens. The context window was not the constraint most assumed it was.

So, they tried something else. Instead of feeding the model an entire corpus, they stored it as a variable and let the model explore it programmatically, peeking at sections, searching with regex, spawning sub-models on promising fragments, and synthesizing the results. They called the technique Recursive Language Models.  

The recursive approach won by wide margins while costing no more per query. On OOLONG, a long-context benchmark, it beat a straight GPT-5 call by 114% at 132,000 tokens and maintained a 49% edge as the context grew to 263,000 tokens. On a harder retrieval test, it was the only approach that maintained near-perfect accuracy up to 1,000 documents, while the direct model fell off.

From the outside, it looked like an ordinary API call. Inside, the model explored the document in fragments rather than forcing it all through the context window at once. It held only a small slice in context at a time, which kept its accuracy steady as the input grew.

The damage in production

The finding reaches beyond the benchmarks. For three years, the industry’s answer for better results from a model has been to give it more. The MIT result shows that more is often what breaks it. That same answer runs through the tooling, with bigger context windows, longer prompts, and more tokens per call. In production, it is generating worse software, and three studies from the past eighteen months measure the damage in three different places.

The first, a USENIX Security 2025 study evaluated 16 code-generating models across 576,000 code samples in Python and JavaScript. Hallucinated package recommendations occurred at an average rate of at least 5.2% for commercial models and 21.7% for open-source models, producing 205,474 unique nonexistent package names. The same fake names recurred, and 58% reappeared within 10 prompts. An attacker publishes malicious code under a hallucinated name and waits.

The second comes from GitClear, which analyzed 211 million changed lines across repositories at Google, Microsoft, Meta, and enterprise C-corps. From 2021 to 2024, refactoring activity dropped from 25% of changed lines to below 10%, while copy-pasted lines rose from 8.3% to 12.3%. Code reuse declined as generation volume climbed. The codebase compiles and passes its tests, yet it is illegible, because two generations rarely share the same mental model.

The third measures a cost that shows up in no codebase at all. Nataliya Kosmyna and her colleagues at the MIT Media Lab wired 54 participants to headsets that record brain activity (electroencephalography) and asked them to write essays. One group wrote using a language model, another using a search engine, and a third using nothing but their own minds. After three sessions, the researchers swapped the groups.

The language model users showed the weakest brain connectivity of the three groups. They scored lowest on ownership of their own writing. Asked to quote their own essays, they struggled. And when they were switched to the brain-only condition, they underperformed everyone, including the original control group. Over four months, the tool had eroded their baseline ability, a decline the paper called cognitive debt.

Why more stops working

Token consumption continues to rise, while the value delivered per token declines. Many teams conclude that AI produces no net cost reduction, and the numbers back them up.

The prompt is the problem. It is a throwaway instruction that forgets its context the moment the chat closes. It carries a schema and a request, while the knowledge a production system actually runs on stays outside it, held in people’s heads and other systems. How the application deploys, where the data originates, the rule that sends a claim over €50,000 for a second approval, all of it lives beyond the prompt’s reach.

Then there is the audit trail. A person writes a function and leaves a commit, a pull request, a reviewer, a decision record. Then the model generates the same function, and the prompt behind it is gone. Six months later, an auditor asks why a specific rule applies to claims under a specific threshold, and no one can answer.

The EU AI Act requires high-risk systems to record their events automatically throughout the system’s lifetime, and those obligations are due to take effect in December 2027. Regulated industries cannot run systems they cannot audit.

The prompt and the code it generates are both disposable. Teams keep trying to improve the disposable thing, but returns keep shrinking. What survives an engagement is the intent behind the code, and that is the part nobody writes down.

Stop treating the prompt as the asset.

Specification-driven development inverts the relationship. The spec is written in formats that are both human-readable and machine-testable, such as Gherkin contracts. Every line of generated code traces back to a requirement. Thoughtworks identified three maturity levels. Spec-First: write the spec before the code, but the spec can drift. Spec-Anchored: keep the spec alive as the system evolves, but the code remains primary. Spec-as-Source: the spec is the permanent record. The code is regenerated on demand.

rinf.delivery, a platform developed by rinf.tech and used across its enterprise delivery teams, operates at the Spec-as-Source level. The business logic lives in the specification, so when an engagement ends, the client owns it and can regenerate the system on demand.

The platform builds an understanding of system dependencies before making changes. It coordinates updates across code, tests, and pipelines in a structured sequence. Small changes ripple across systems, and the platform maps the ripples before they happen.

New team members receive context and guidance as they produce work. They become productive faster and learn operational patterns while shipping code. The supervision overhead that consumes senior engineers declines. In practice, the system acts as a capable junior developer to a senior architect, and as an experienced senior guide to a junior one, giving each structure and direction.

It also benchmarks candidate implementations against the spec and discards the over-engineered ones. It ships the leanest variant that satisfies the requirement.

Less code, less cost

That efficiency carries weight. The International Energy Agency projects global data center electricity consumption will reach 1,050 terawatt-hours by 2026, enough to make data centers the world’s fifth-largest consumer. Grid connections in mature markets can take years to secure, so shipping less code is a structural advantage.

A national energy utility faced decades of technical debt across mainframe, COBOL, and .NET systems. The platform completed architecture analysis and documentation ten times faster than the utility’s own baseline for the same work. It produced accurate documentation for legacy JCL and PL/I systems. Legacy services became modern APIs in hours, work the team had budgeted in weeks.

An internal platform supporting regulated market engagements generated and ran 300,000 automated security test payloads over the course of one engagement. The return on investment was 10-to-1, measured against the engineering time the manual process would have required.

Forrester reports that coding productivity may improve by 30–40% with AI, but overall team productivity often rises by less than 10% when planning, testing, and release remain manual.

Control built in

Governance belongs in the workflow from the start, and today oversight lags far behind adoption. IBM’s 2025 Cost of a Data Breach report found that between 40% and 65% of employees use AI tools their IT department has not approved.

rinf.delivery embeds governance into the workflow itself. Specification normalization aligns daily output with structural requirements. Sensitive data scanning detects risks as code is written. Generated code traces back to the specification requirement behind it. The audit trail is built in, not reconstructed later.

The MIT researchers proved that intelligently exploring a corpus beats trying to hold it all at once. Kosmyna’s team showed what happens when you optimize for the wrong thing long enough. The market is optimizing generation speed. The companies that last will optimize for something else.