Generalization by Construction

What learning should leave open for inference

The ultimate goal of artificial intelligence is to build systems that can act effectively in situations they have never seen before. This is especially important in robotics, where a robot will face new environments, objects, constraints, and goals. The dominant approach is to collect ever-larger datasets and train neural policies end to end to map observations directly to behavior. Yet these policies often struggle in unfamiliar settings, and it is practically impossible to gather examples covering the open-ended range of situations a robot may encounter.

Symbolic AI pursued a different approach to building generalizable systems. It separated explicit knowledge from the procedures used to reason with it. Facts, relations, rules, and actions were represented as explicit objects that could be reused and recombined during inference. A planner could use this knowledge to search for a sequence of actions that achieved a new goal. McCarthy's Programs with Common Sense and the STRIPS planning system are early examples of this approach.

A major difficulty, however, was deciding what knowledge to represent and how to search over it. For images, video, language, and physical interaction, even the right vocabulary was difficult to specify in advance. People also had to define the symbols, predicates, and operators by hand and connect them to continuous perceptual signals. Finally, search was often intractable in large and partially observed spaces.

Deep learning has made it possible to learn powerful representations directly from high-dimensional perceptual inputs. Foundation models provide a broad source of reusable knowledge that can support search and planning. However, directly training a policy model to predict behavior entangles the learned representation with the computation used to produce that behavior. The resulting mapping works well in situations that follow the regularities it has learned, but often fails when a new problem falls outside them.

In this perspective, I argue that many globally unfamiliar problems can be solved by decomposing them into locally familiar parts. By learning models of reusable structure, we can give a robot the pieces needed to construct solutions to unfamiliar tasks. Inference then determines how to combine these pieces and searches for a solution that satisfies the current goals and constraints. The central design question is what structure learning should capture in advance and what it should leave open for inference to compose and construct.

Core claim: Learning captures locally reusable structure. Inference uses it to construct solutions to globally unfamiliar problems.

Blending amortization and inference

I call this division of work between learning and inference the amortization boundary. Learning can amortize recurring decisions by building reusable rules that respond to new inputs without searching over alternatives each time. Inference can use learned models to compare and revise possible solutions for the current problem. For example, a robot can use a learned policy to choose a grasp directly, or use a learned model to evaluate several possible grasps before choosing one. The boundary marks which choices are resolved by a learned rule and which remain open to problem-specific search, selection, or refinement. Here, inference refers to this latter process.

The boundary trades computation for flexibility. Repeated search wastes computation when a learned rule can already make the decision reliably. If a new goal or constraint falls outside what a learned rule can handle, the system needs a way to reconsider its decisions. The aim is therefore not to maximize inference, but to leave open the choices whose values cannot safely be determined in advance.

The amortization boundary also changes the generalization problem itself. A direct predictor must learn how a problem maps to a complete solution. Solution inference instead uses a learned criterion for judging candidates, while search constructs a solution for the current problem. Once a candidate is proposed, judging it can depend on fewer aspects of the problem and require a simpler computation than producing the solution directly. When this judgment depends on simpler, reusable structure, learning the criterion can support better generalization than learning the full problem-to-solution mapping.

Model composition moves another choice to the inference side of the boundary. Rather than learning the criterion for each task as a whole, the system learns reusable factors for individual goals, constraints, or relationships. Because each factor depends on a narrower part of the problem, inference can recombine them to construct criteria for tasks not seen during training. Such a separation enables effective generalization to novel combinations of local relationships, dynamics, and goals.

Program specialization offers a useful analogy for the amortization boundary. A programmer can compile known assumptions into an efficient executable, while retaining a higher-level program in which those assumptions can be revised. A direct neural policy resembles an aggressively specialized executable. It is fast to run, but hard to adapt when a new problem violates its compiled assumptions. An energy function or world model can preserve a higher-level description of possible solutions or futures that sampling, optimization, or planning specializes for the current problem.

The representation of a task also determines how much of the problem can be resolved through inference. A planner does not need to search over every motor command. Instead, it can search over task-relevant states, subgoals, or trajectories while learned skills handle familiar local transitions. A well-engineered representation enables effective inference and generalization.

This suggests four practical steps.

  1. Identify a decision whose answer changes across tasks while the structure needed to evaluate alternatives remains reusable.
  2. Choose a level of representation at which that choice can be inspected and revised.
  3. Learn reusable structure that helps resolve the choice without fixing it in advance.
  4. Use inference to resolve it for the current problem.

My PhD thesis developed this approach for the composition of learned energy landscapes. Here I use the amortization boundary to examine how the same general principle can shape both the solutions a system constructs and the computation it uses to construct them.

Hierarchical inference

Consider a household robot asked to bring a mug of coffee from a crowded kitchen counter to someone at the table. It must lift the mug without disturbing the surrounding dishes, carry it without spilling, and set it within easy reach. I distinguish five scopes according to what inference can reconfigure as the robot solves the task. The first three construct the problem and its solution, while the final two construct the computation used to solve it.

Constructing the problem and its solution

These scopes leave open the candidate solution, the model that defines the problem, or the actions that move the world toward the goal.

Inference scope
Reusable structureAvailable in advance
Constructed for this problemResolved at test time
Solution inference
An evaluator or distribution that guides search
A candidate under the fixed modelHow: Sample, compare, search, and refine
Model composition
Compatible models, factors, and interfaces
The model that defines the current problemHow: Select, ground, and compose factors
Action planning
Action-conditioned dynamics and reusable skills
An action sequence expected to reach the desired outcomeHow: Predict consequences, search for actions, and replan as needed

Constructing the computation

These scopes leave open which operation runs next and which reasoners contribute.

Inference scope
Reusable structureAvailable in advance
Constructed for this problemResolved at test time
Procedure control
Solvers, verifiers, and mechanisms for estimating competence and cost
The next reasoning operation and when to stopHow: Choose the next operation, allocate computation, and decide when to stop
Reasoner organization
Differentiated reasoners and reusable coordination mechanisms
The participating reasoners, their roles, and their connectionsHow: Select reasoners, assign roles, and route information

In this task, solution inference searches for a stable placement of the mug. Model composition combines support, uprightness, clearance, and reachability factors into a model that judges the placement. Action planning searches for actions expected to produce that outcome. Procedure control decides when to verify a plan, repair it, or replan, while reasoner organization determines which specialists propose and evaluate plans and how they exchange information.

These scopes can overlap within a single reasoning process. Action planning can use solution inference under a composed model, and selecting a reasoner can also determine which operation runs next.

Solution inference

Search a learned solution space

Deferred decisionWhich candidate?

In solution inference, learning provides an evaluator that scores proposed solutions. Given the current problem, a sampler or optimizer uses this evaluator to compare candidates and revise them toward a better solution. The evaluator remains fixed during this search, while the candidate changes.

A major advantage of solution inference is that verification is often easier than generation. In the coffee task, a direct predictor must produce a suitable placement from the kitchen scene. An evaluator can judge familiar properties of a proposed placement, such as stability and reachability, without learning how to produce the placement itself. A model that learns these simpler judgments can generalize better to unfamiliar scenes than one trained to predict a complete solution. Search uses them to construct a placement for the current scene.

An energy-based model is one way to implement solution inference. A neural network learns an energy landscape over the space of possible solutions, assigning low energy to correct candidates. Langevin dynamics performs inference by iteratively refining a sample along the negative energy gradient while adding random noise. By varying the number of sampling steps, we can trade off sample quality against computation time. We can initialize inference either from random noise or from a generated proposal. We can also adapt inference to satisfy specific constraints and obtain desired solutions. For instance, we can implement image inpainting by fixing the values of observed pixels and letting inference generate the rest of the image.

This formulation also lets a model spend more computation on harder reasoning problems. In iterative reasoning through energy minimization, each optimization step revises a candidate answer under a learned energy function. A model trained to predict shortest-path distances on graphs with up to ten nodes achieves lower error on fifteen-node graphs than the feedforward and iterative baselines tested. The verifier–generator analysis shows how recognizing a solution can require far less computation than constructing one.

A language model can also be used in this way. The negative log probability it assigns to a candidate sequence acts as an energy. We can then perform solution inference through iterative sampling that favors lower-energy responses. This procedure substantially improves reasoning performance over ordinary sampling from the base language model. On several reasoning tasks, it performs comparably to versions of the same models finetuned with reinforcement learning, without any additional training.

The effectiveness of this search depends on how training shapes the geometry of the energy landscape. A sequence of landscapes can guide inference from broad, smooth basins toward sharper constraints, helping the solver approach a solution before resolving its finer details. Equilibrium Matching instead learns a single smoothed energy landscape for optimization.

Illustrative work
Model composition

Compose the model required by the problem

Deferred decisionWhich task model?

A new task may require a combination of goals and constraints that no single learned model represents. Model composition lets the system construct a task model from reusable factors after the task is known. Each factor evaluates a particular aspect of a candidate solution. Inference selects and combines the relevant factors to guide the search for a solution.

For the coffee task, the robot can combine factors that favor an upright mug, clearance from nearby dishes, stable support on the table, and reachability for the person. A support factor can evaluate the mug and its supporting surface, while a clearance factor evaluates the mug and nearby objects. Neither factor needs to model the entire kitchen arrangement. By composing these local judgments, the robot can evaluate an arrangement it has never seen as a whole.

Composition provides a way to program a new task using factors learned from earlier data. Diffusion-CCSP learns factors for constraint types such as collision avoidance and spatial relations. A task specifies a graph connecting these factors to the object poses they constrain. Adding their energies defines a joint criterion, allowing inference to search for poses that satisfy unfamiliar combinations of familiar constraints. Set It Up! builds on this idea by using a language model to construct relation graphs from instructions, examples, and a task sketch. The graph specifies which learned factors guide the arrangement.

Visual factors can support both generating a scene and understanding one. In compositional visual generation, learned factors for individual concepts are combined to specify what an image should contain. For compositional scene understanding, inference searches for the object locations or attributes under which the combined factors best explain an observed image. The learned factors remain reusable, while the inferred locations and attributes describe the particular scene.

Composing additional instances of a learned factor can also extend inference to larger problems than those used in training. In Compositional Generative Inverse Design, factors trained on trajectories of two interacting bodies are composed to design initial conditions for systems with four or eight bodies. Each factor evaluates the motion of a pair within the same global trajectory. Inference jointly revises the initial conditions and trajectory under the combined dynamics factors and the design objective. The larger system does not have to be learned as a whole.

The same principle applies to reasoning. For Boolean satisfiability, clause-level factors can be learned and their composition refined on small problems, then composed into larger instances at test time. With training instances of at most twenty variables, this approach solves more fifty-variable problems than the neural baselines tested. Familiar local constraints can therefore support search over a larger, unfamiliar problem.

Factors can also draw on knowledge from models pretrained for different purposes. Iterative Consensus combines a pretrained generator with factors supplied by separately learned evaluators. For image generation, these factors judge whether candidate images match a requested description. Product of Experts for Visual Generation combines factors derived from visual models with constraints from graphics or physics. An appearance factor can favor realistic video, while a motion factor favors agreement with a simulated trajectory. The full task is expressed by selecting and combining the relevant factors at inference time.

The vocabulary of factors does not need to be manually designed. Learning can discover factors in an unsupervised manner. It can also infer a new task factor from demonstrations while leaving a pretrained generator unchanged. A newly learned factor can then be combined with earlier ones to express further tasks.

The combined factors must be paired with an inference procedure suited to them. For example, summing the scores of diffusion factors and running standard reverse diffusion does not in general sample the intended product distribution. Reduce, Reuse, Recycle develops sampling procedures to address this mismatch. Effective composition depends on both the reusable factors and the procedure used to reconcile them.

For decision making, factors can express both what should happen and what actions can cause. Objective factors represent goals, rewards, and constraints, while dynamics factors capture the behavior of objects, agents, and their interactions. Action planning uses their combination to search for actions whose predicted consequences satisfy the objective.

Illustrative work
Action planning

Plan through possible futures

Deferred decisionWhich actions reach the goal?

Composing a desired outcome with a model of what can happen defines a decision problem, but it does not determine how the agent should act. In the coffee task, the robot must still choose a grasp, lift the mug clear of nearby dishes, carry it without spilling, and place it at the selected location. Planning leaves this action sequence open. The planner predicts the consequences of possible actions and searches for a sequence expected to reach the desired state.

A direct policy resolves the action choice through a learned mapping from observations and goals. When a new situation falls outside the regularities captured by this mapping, the policy may fail even if the relevant dynamics and skills are familiar. Planning keeps the action sequence available for search under the current task model. Behavior initially constructed through search can later be absorbed into a policy or skill when it recurs.

Planning does not always operate directly on individual motor commands. It can search over subgoals, intermediate states, or complete trajectories, depending on what must be decided for the current task. Searching over intermediate states under learned dynamics allowed a planner to route around obstacles not encountered during training. A generative model of complete state-action trajectories provides a space of possible behaviors in which new rewards, endpoints, or constraints can guide search. In both cases, learning captures what recurs across tasks while search resolves the route required by the task at hand.

Predictive control repeats this search as the world changes. For locomotion, a learned trajectory prior can be combined with new rewards and constraints to adapt behavior to the current task. A task planner can also be composed with action-conditioned dynamics to improve the feasibility of trajectories that pursue the current goal.

For longer-horizon tasks, video provides an intermediate representation between a high-level goal and low-level control. It can describe how the scene should change while an embodiment-specific model determines how a particular robot makes that change happen. A learned video model can propose a task-level visual trajectory from which actions are extracted. Search can compare and connect these proposals into longer-horizon plans.

Different models can also divide the problem across levels of abstraction. We can compose language, video, and action models so that language proposes high-level steps, video grounds them in the scene, and an action model tests their physical executability. The components provide complementary views of the same evolving future. Planning searches for a course of action supported at every level, using the structure supplied by model composition.

Action proposal, consequence prediction, and search can also be separated within a planner. A vision-language model specifies a sequence of action primitives, which a low-level controller translates into robot actions. An action-conditioned world model predicts their consequences, and global correction and local search revise the proposals for the current task. The same verification–generation separation that motivates solution inference therefore reappears in sequential decision making. Judging whether an imagined consequence makes progress can be easier than generating the entire successful behavior at once.

Illustrative work
Procedure control

Control the reasoning process

Deferred decisionWhich operation and for how long?

Generalization by construction also applies to the computation used to solve a problem. An unfamiliar task may require a new sequence of familiar reasoning operations or a different combination of specialists. By leaving these choices open to inference, a system can reuse learned capabilities to construct a reasoning process suited to the current problem.

Results from previous rounds of inference can guide what computation the system performs next. Procedure control combines this feedback with the current setting. A failed verification can identify which parts of a candidate to preserve and which to revise, while a successful check can let the system stop reasoning and begin execution. The system can also estimate task difficulty from these results and adjust the sequence and amount of computation accordingly.

For the robot, an uncertain estimate of the mug's pose may call for another perception step before planning. If verification identifies a problem with the grasp, the next round of planning can focus on revising that part of the trajectory. If the trajectory passes verification, the controller can proceed to execution. During execution, the model's estimated likelihood of the current plan can provide further feedback for deciding whether to continue or replan from the existing trajectory.

Verification can also determine where the next round of generation begins. If a verifier identifies where a generated trajectory first goes wrong, the system can preserve a valid prefix and resume generation from it. The next round can then focus on extending a partial solution that has already passed verification. The generate–verify–restart loop stays fixed, while feedback determines which prefix to expand and when to stop. On Keys-and-Doors puzzles with solution paths longer than those in training, this procedure improves success over sampling complete rollouts at the same generation budget. Symbolic verification identifies the prefixes that can be retained, and every solved episode in this held-out setting comes from a restarted branch.

Repeated failures or slow progress can indicate that the current task is harder than expected. The controller can then devote more computation to unresolved decisions or try a different reasoning operation. The choice of model size and numerical precision also affects both answer quality and latency. For an embodied system, the value of another reasoning step depends on whether it can improve the action before that action is needed.

Illustrative work
Reasoner organization

Assemble the reasoning system

Deferred decisionWhich reasoners and connections?

Procedure control chooses the next operation within an already assembled system. Reasoner organization leaves the assembly itself open. Inference may determine which specialists and tools participate, what roles they take on, what state is shared, and how information moves among them. Model composition constructs the task model that defines what counts as a solution. Reasoner organization assembles the specialists that supply or evaluate the relevant information.

One benefit of using multiple reasoners is diversity in how they approach a problem. A single reasoning process can become stuck repeatedly revising an unproductive candidate. Different reasoners can explore alternative candidates, assumptions, or strategies. By exchanging and debating their proposals, they can use one another's progress to redirect their own search. This gives the system ways to move beyond an unproductive line of reasoning on a hard problem. The benefit depends on preserving useful differences among reasoners and evaluating the alternatives they propose.

A second benefit is the ability to divide a complex task into simpler subproblems. In the coffee task, separate specialists can estimate the mug's pose, choose a stable grasp, and plan a collision-free route. Each specialist reasons about a narrower problem using knowledge relevant to that part of the task. Their decisions must then be coordinated so that the grasp and route are compatible. This decomposition can reduce the difficulty faced by each reasoner and let the system construct a solution to an unfamiliar task from familiar local capabilities. Verification can also be decomposed by assigning reasoners to check different aspects of a candidate and combining their judgments.

These benefits are possible even when the participants and coordination rules are fixed before deployment. Training can produce complementary generator and critic behaviors that preserve diverse reasoning chains and are reused across problems. In such systems, inference uses the interaction among reasoners to solve the current problem. Leaving the organization open adds the ability to choose which reasoners participate, how the task is divided, and how their contributions are combined for the problem at hand.

In the coffee task, suppose a single planner repeatedly fails to find a reliable grasp. The system can then assign several reasoners to explore different grasp strategies and ask another to compare their proposals. If the proposals still fail verification, it can recruit a grasp specialist and route that specialist's feedback to the proposing reasoners. The goal and task model remain fixed while inference changes the participants, their responsibilities, and the information they exchange.

Reusable incentives and local rules can govern this adaptation by determining when reasoners participate and how their contributions are valued, allowing a task-specific organization to emerge without a central scheduler. For example, auctions can select a problem-dependent sequence of specialists from a fixed population. The population stays fixed during evaluation, while economic selection reshapes it across optimization episodes. Selecting who acts also determines what computation runs next, so this mechanism spans procedure control and reasoner organization.

Illustrative work

Generalization as construction

The ultimate goal of artificial intelligence is to build systems that generalize reliably to unfamiliar situations. Generalization as construction offers a way to solve globally unfamiliar problems by breaking them down into simpler, locally familiar parts. Learning captures recurring structure in the environment, while inference uses it to construct a solution for the current problem.

As a robot repeatedly interacts with its environment, learning can absorb the parts of problem solving that recur. A behavior first constructed through planning can become a reusable skill, and a useful sequence of reasoning operations can become a learned procedure. These learned skills and procedures give inference new pieces to combine, allowing later problems to be solved without repeating every step of the original search. The amortization boundary can then move with experience. The robot can solve familiar problems faster and use what it has learned to construct solutions to increasingly complex ones.