The Hidden Structure of Adaptable AI

How reusable knowledge helps AI tackle problems it has never encountered.

Composition Is the Bridge Between Memory and Generalization
Neurosymbolic AI · Computer Science · Software Engineering
Composition Is the Bridge Between Memory and Generalization
Generality comes from reusable pieces that can safely combine
2026

How reusable knowledge, adaptable structures and explicit checks help AI tackle unfamiliar problems.

I. The Small Instruction That Exposed a Big Problem

The instruction was almost embarrassingly simple: “jump twice.” The artificial intelligence systems had already learned what “jump” meant. They had also encountered commands that repeated other actions. Yet in experiments published in 2018, combining that familiar action with that familiar instruction caused some networks to stumble badly. The SCAN study exposed a gap between learning the pieces of a problem and understanding how they fit together. A machine could perform well on many unfamiliar instructions while still failing a particular kind of novelty: a known ingredient used in a new arrangement.

Computer scientists call the ability to handle such rearrangements compositional generalization. The term describes something ordinary enough to escape notice. A finite collection of concepts can support an enormous range of possibilities, provided those concepts retain useful meaning when combined. For AI, this raises a question that sheer storage capacity cannot settle. What should a system preserve from its experience so that knowledge remains useful when the next problem differs from the last?

Memory supplies the material, but its organization determines what can be built. Remembering a complete answer helps when a similar question returns. Preserving an operation, its purpose and the conditions under which it works can support a much wider range of tasks. Composition connects these two capacities: retaining experience and extending it. The engineering challenge is to discover reusable pieces while ensuring that new combinations preserve the properties that made those pieces useful in the first place.

01 Memory becomes useful when knowledge can travel
Preserving reusable actions and rules makes unfamiliar combinations possible.
1. Memory becomes useful when knowledge can travelA familiar instruction is separated into a reusable action and rule, then combined into an instruction absent from training.1. Memory becomes useful when knowledge can travelPreserve an operation that can work with new inputs.Remember the experienceLearn the action “jump”Learn “walk twice”Separate the piecesAction: jumpRule: repeat an actionThe action can changeBuild a new combinationApply “twice” to “jump”Result: jump, jumpCompositional generalizationUse familiar pieces in an arrangement that was not taught.
II. What Evolution Suggests About Adaptable Machines

An intriguing clue comes from research into how complex systems evolve. The theory of facilitated variation describes how established biological processes can support new functions through changes in their regulation and arrangement. For computer science, the relevant principle is architectural: sophisticated capabilities become more adaptable when some connections can change without requiring everything else to be rebuilt. This does not mean that evolution produces perfectly separated components. It suggests that the organization of a system influences which future changes are feasible. The theory makes reuse central to that relationship.

Researchers at the Weizmann Institute explored this idea using simulated logic circuits. They compared circuits evolved toward an unchanging objective with circuits facing changing objectives built from related computational subproblems. Under the changing conditions, the circuits developed more modular organization and adapted more readily to unfamiliar goals. Their past had left a useful structural imprint. The 2008 study showed how repeated exposure to related challenges could favor systems whose existing machinery was easier to rearrange.

These were simplified simulations, so they do not establish a recipe for general intelligence. They do suggest a training principle worth testing: variation should reward the reuse of underlying structure. If every task changes arbitrarily, there may be little worth preserving. If nothing changes, specialization may be sufficient. Between those extremes lies a productive setting in which recurring subproblems appear in changing relationships. An AI trained there has a reason to learn both what remains stable and what can be recombined.

02 Experience can grow a reusable library
Solved programs reveal useful shared operations. A growing library supports future tasks.
2. Experience can grow a reusable librarySolved programs reveal shared patterns. These patterns become library operations that support new tasks, yielding more solved programs.2. Experience can grow a reusable libraryA conceptual view of the learning cycle explored by DreamCoder.Solve tasksConstruct programsthat produce the right outputsFind shared structureIdentify useful operationsthat recur across solutionsExpand the libraryKeep reusable operationsfor future programsTackle new tasksCombine library operationswith neural guidancePast solutions become building blocks for future problems.
III. When Memory Becomes a Library

That possibility leads to a practical question. Who identifies the reusable pieces? Software developers ordinarily decide which operations deserve their own functions. An AI that learns from experience needs some way to make similar decisions. Store every successful solution intact and the collection can become unwieldy. Extract abstractions too eagerly and the system may preserve patterns that have little value beyond their original setting. Useful memory therefore requires selection: identifying recurring structure that makes subsequent problems easier to represent and solve.

DreamCoder, presented at a programming languages conference in 2021, explored this process directly. The system constructed programs to solve tasks, then identified recurring fragments that could become reusable components. A neural network guided the search for promising programs, while an expanding symbolic library supplied the available operations. The two improved together. Across eight experimental domains, learning both the library and the search strategy enabled DreamCoder to solve more problems and solve them faster. Its published results demonstrated a concrete connection between accumulated experience and reusable computational knowledge.

The important change was in what a previous success made possible. A solved problem could contribute a new building block, shortening the description of later solutions and helping the system find them. This is one promise of neurosymbolic AI, which combines learned pattern recognition with explicitly represented operations or rules. The approach still depends on the available starting components and the structure of its tasks. But it makes generalization tangible: experience changes the language in which a machine can express its next solution.

Conceptual illustration of reusable circuit modules combining into a new computational structure

Reusable operations turn past solutions into building blocks. Reliable combinations depend on compatible connections and explicit requirements.

IV. A Good Guess Needs Somewhere to Be Checked

An expanding library creates another difficulty. More pieces mean more possible arrangements, many of them useless or invalid. Searching every combination soon becomes impractical. Neural networks can help by predicting which possibilities deserve attention, but a promising prediction is not a guarantee. A dependable system needs a way to distinguish a useful suggestion from an established result. Neurosymbolic architectures can assign these jobs to different mechanisms, allowing learned search to operate alongside reasoning whose steps have explicit conditions.

Google DeepMind’s original AlphaGeometry system demonstrated this arrangement in 2024. A neural language model proposed additional geometric constructions that might unlock a difficult proof. A symbolic engine then pursued deductions using the resulting configuration and established rules. On a benchmark of 30 olympiad geometry problems, the system solved 25. The research showed how learned proposals could help a reasoning engine reach solutions that were difficult to discover through its existing deductions alone.

The significance extends beyond the score. The neural component helped decide where to search; the symbolic component constrained what could follow. Geometry makes this collaboration unusually manageable because its objects and rules can be specified precisely. Other applications face ambiguous requests, incomplete observations and changing environments. There, a formally valid result may still rest on a mistaken interpretation. The broader lesson is that reliable composition requires attention to both the reasoning process and the accuracy of the representation on which that reasoning operates.

V. The Rules That Let Pieces Travel

Software engineering already has a language for some of these requirements. Types describe the values an operation accepts and produces. Contracts specify what must be true before it runs and what it promises afterward. Verification tools can check whether code satisfies those stated obligations. For two operations to combine correctly, the first must establish the conditions the second requires, while respecting relevant effects on shared data. Systems such as Dafny make these responsibilities explicit. Their guarantees concern the properties actually specified.

Consider an AI assistant asked to total prices collected from several sources. It might correctly extract each amount, correctly perform currency conversions and correctly add numbers, yet assemble an incorrect calculation. Some amounts could already be converted; others might lack currency labels. An ordinary numeric input type would not necessarily reveal either problem. A more dependable design would preserve currency information, record conversion status and check that every amount met the same conditions before addition. The components become safely reusable because their assumptions travel with them.

This points toward a practical meaning of greater generality. A system needs operations that remain useful across contexts, a way to select and combine them, and checks that establish whether the combination meets its requirements. Evaluation must then ask whether those capabilities survive arrangements absent from training. None of this eliminates uncertainty or the need to learn new concepts. It gives experience a more durable form. The next advance may depend as much on what machines can reliably assemble from what they know as on how much they can remember.

03 Reliable combinations need explicit checks
Learned search proposes a plan. Explicit checks test the requirements before execution.
3. Reliable combinations need explicit checksAn AI proposes a combination, then checks its assumptions and connections. Plans that pass can execute within the checked scope. Failed checks lead to revision.3. Reliable combinations need explicit checksLearned search proposes a plan. Rules check its requirements.Propose a planChoose operationsand their orderCheck the connectionsAre inputs compatible?Do assumptions hold?Are effects allowed?Execute the planRun the combinationwithin the checked scopePassFailRevise the proposalReliability extends only to the properties actually checked.