The oldest principle in software engineering reveals the deepest flaw in modern AI.
Software engineering discovered a long time ago that writing code is not really the hard part. Managing knowledge is. When a system grows large enough, the real cost is not typing new instructions but keeping existing ones consistent. The principle that formalized this insight was published in 1999 under the label DRY, for "Don't Repeat Yourself," and its core claim is precise: every piece of knowledge in a system should have a single, unambiguous, authoritative representation. The word "knowledge" is doing the real work there. DRY is not about cutting keystrokes. It is about what happens when something changes. If the definition of a tax rate lives in one place, updating it means changing one line. If it was copied to forty places at different moments by different developers, updating it means hunting, hoping, and very likely missing something.
Copy-paste and reuse are not two points on a spectrum. They are opposite logics. Copy-paste disaggregates knowledge across a system; reuse consolidates it. The mechanism that makes reuse work is indirection: a function, module, or interface that callers point to rather than duplicate, so that one definition serves many contexts. That extra layer costs something up front, and under deadline pressure, the cost feels unnecessary. This is why copy-paste persists at every scale of software development. The short-term friction of abstraction consistently loses to the short-term ease of duplication, and the bill arrives later.
The downstream cost is not hypothetical. Duplicated code must be maintained everywhere it was copied. Copies drift. A bug fixed in one instance survives in the others. A business rule updated in three of seven places becomes three conflicting truths inside the same system. What looks like a time-saving shortcut at the moment of writing becomes a liability that compounds silently until something breaks.
The proof arrives at the level of a team. A software team building a financial application copies its currency-formatting logic into twelve separate screens. After a year of individual edits, the twelve copies are no longer identical. When regulations change, no one can confidently say which copies were updated. A single formatting module, referenced rather than duplicated, would have required one change and carried no ambiguity.
When researchers began examining how large language models process text at a mechanistic level, they found something literal inside the architecture. Buried in the attention layers of models like GPT-4 and Claude are circuits called induction heads, identifiable components that do something simple and specific: when the model encounters a sequence it has seen before, they match the prefix and copy whatever token followed it previously. Part of what a language model does, at a fundamental level, is copy-paste.
Copying and abstracting are not the same operation, even inside a neural network. Copying retrieves a memorized pattern and reproduces it. Abstracting identifies the rule that generated the pattern and can apply it to cases the model has never seen. Work published by University of Edinburgh researchers in 2025 found that ablating induction heads caused in-context learning performance to drop by as much as 32 percent on abstract pattern tasks, with results collapsing toward chance. The model was not reasoning about the pattern. It was matching and reproducing it.
The limitation this creates is called compositional generalization, the ability to take rules already learned and recombine them in novel configurations. On the COGS benchmark, transformer models reach 96 to 99 percent accuracy on familiar sentence structures and fall to 16 to 35 percent on systematically recombined novel sentences built from the exact same components. The underlying vocabulary is known. The rules governing recombination are not. That gap is the copy-paste failure mode rendered in weights: the model has stored the surface but not abstracted the principle. A model trained on "the dog chased the cat" handles that pattern fluently. Asked to produce a structurally novel recombination built from the same words and grammar, it fails, because the recombination requires applying a rule rather than retrieving a memorized surface form.
The neurosymbolic research community has spent the past decade building AI systems explicitly designed to do what copying cannot: distill recurring structure into named abstractions and deploy those abstractions to solve problems they have never encountered before. DreamCoder, developed at MIT, alternates between two phases. First it solves a batch of tasks. Then it compresses those solutions, searching for shared structure that can be factored out into a reusable library function. The library grows into a hierarchy of components, and the search policy learns to use them. Working from scratch on list-processing tasks, the system converged on roughly 20 library routines that included functional programming primitives like map, filter, and fold, not because they were programmed in, but because they kept emerging as the most efficient compressions of repeated structure.
Stitch, published by MIT researchers in 2023, attacked the compression step directly. DreamCoder's abstraction search was powerful but slow. Stitch replaced it with a branch-and-bound algorithm that finds the most compressive abstractions across a program corpus three to four orders of magnitude faster. Speed matters here because the entire system depends on a tight feedback loop: better libraries improve the search that generates new programs, better programs produce richer libraries, and the cycle has to run fast enough to compound. MIT CSAIL's LILO system added a third step. After search and compression, it prompts a language model to write human-readable names and documentation for each abstraction. An abstraction with a clear name can be reused intentionally, by a human programmer or by another AI component. LILO treats naming as load-bearing architecture, on the premise that a reusable unit no one can identify is functionally invisible.
DreamCoder, given list-processing tasks and no prior programming knowledge, rediscovered the same higher-order functions that human programmers independently developed over decades. The system did not find them because they were built in. It found them because they were the optimal compressions of what kept recurring across problems. That is the distinction in its purest form: not retrieval of a stored pattern, but convergence on a structure that earns its place by being useful everywhere.
The insight that reuse is a structural property eventually became the organizing principle of an entire layer of software infrastructure. Package registries are what this looks like at scale. When a developer needs a function for parsing dates or sending an HTTP request, the modern answer is not to write one but to reference a package that thousands of other projects already reference. npm, the registry for JavaScript, hosts more than 2.3 million packages. The Python Package Index holds around 500,000. Each package is a single authoritative definition that many callers point to rather than copy, and the difference between pointing and copying is what makes the entire ecosystem function.
Design patterns operate at the level of code structure rather than distribution, and they encode the same logic. The Strategy pattern isolates an algorithm behind an interface so it can be swapped without modifying callers. The Template Method pattern writes a shared process skeleton once and defers variable steps to subclasses through composition rather than duplication. Dependency injection takes the principle further still: a module receives its dependencies from outside rather than creating them, which means it depends on an abstraction rather than a concrete implementation and can be tested, extended, or replaced without touching the calling code. These patterns are not style preferences. They are engineered indirection, deliberate choices to create a single point of definition that multiple contexts share.
Where these institutions are weak, copy-paste fills the vacuum. The left-pad incident of 2016, in which an 11-line npm package was unpublished and immediately broke builds across hundreds of companies, showed the power and fragility of reuse infrastructure at once. The breakage was instant and global because so many projects pointed to one definition. That is reuse working exactly as designed. The fragility was a property of the dependency graph's depth, not of the principle. Teams under deadline pressure, without code review or modular standards, produce clones by default. The infrastructure does not enforce reuse; it only makes reuse possible.
A working sketch of the reuse principle on a glass board inside a research lab. The distinction between a system that copies and one that references a single source is the central architectural question of both software engineering and modern AI design.
In 2025, the code analysis firm GitClear published a study of 211 million changed lines of code tracked across thousands of repositories from 2020 through 2024, covering the period when AI coding assistants moved from novelty to standard practice. What the data showed was not encouraging. Lines classified as moved, a proxy for refactoring and consolidation into reusable modules, fell from 24.8 percent of changed lines in 2021 to 9.5 percent in 2024. Copy-pasted lines rose over the same period. By 2024, for the first time in the dataset, copy-paste had overtaken moved code. Commits containing duplicated blocks of five or more lines had increased eightfold in a single year.
This is not an accident of the technology. It is a consequence of how the technology is evaluated. A model that generates code is measured on whether the output is correct and whether it satisfies the immediate prompt. It is not measured on whether it introduced a fifth copy of a function that already exists in the same repository, or whether the abstraction it chose will survive the next requirements change. The feedback that disciplines human developers into reuse patterns arrives over time through code review, debugging, and maintenance pain. A model has no exposure to any of that. It completes the session and moves on.
The neurosymbolic work points at what a different design would look like. A system that generates programs, compresses them into named abstractions, and feeds those abstractions back into the next round of generation does not accumulate copies. It accumulates reusable knowledge. NVIDIA and Caltech's Voyager agent demonstrates this concretely: it plays Minecraft by writing verified skills as executable code into a persistent, searchable library, reusing existing skills each session rather than regenerating them, and when transferred to a new environment it bootstrapped from its existing library rather than starting from scratch. The technical machinery for this already exists. Whether the software industry builds it into the tools developers use every day is a question about priorities as much as engineering. But the distinction between a tool that copies and a tool that reuses is not theoretical. At the scale of millions of repositories and billions of lines of code, it is the difference between a discipline that compounds what it knows and one that merely repeats it.
Key references: Hunt, A. and Thomas, D., The Pragmatic Programmer, Addison-Wesley, 1999. Elhage, N. et al., "A Mathematical Framework for Transformer Circuits," Anthropic, 2021. Olsson, C. et al., "In-context Learning and Induction Heads," Anthropic, 2022. Crosbie, E. and Shutova, E., "Induction Heads as an Essential Mechanism for Pattern Matching in In-context Learning," Findings of NAACL, 2025. Ellis, K. et al., "DreamCoder: Bootstrapping Inductive Program Synthesis with Wake-Sleep Library Learning," PLDI 2021. Bowers, M. et al., "Babble: Learning Better Abstractions by Exploring and Distilling the Space of Rewrite Rules," POPL 2023. Grand, G. et al., "LILO: Learning Interpretable Libraries by Compressing and Documenting Code," ICLR 2024. Wang, G. et al., "Voyager: An Open-Ended Embodied Agent with Large Language Models," NeurIPS 2023. Chollet, F. et al., "ARC Prize 2024 Technical Report," arXiv:2412.04604. GitClear, "AI Copilot Code Quality: 2025 Data," gitclear.com.
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.