Solver-Aware Decompositions for Programming-by-Example: When Dividing Requires Knowing how to Conquer

Janis Zenkner, Tobias Sesterhenn, Tim Grams, Christian Bartelt

TL;DR

Standard divide-and-conquer approaches in AI train models to split complex tasks based on human-annotated "ground truth" decompositions. This paper reveals the accuracy paradox: mimicking human subgoals often hurts performance because it ignores the specific search biases of the downstream solver. By introducing Solver-Aware Decomposition (SAD), the authors train a decomposer using direct feedback from a frozen synthesizer, significantly boosting program synthesis success by prioritizing solver tractability over human alignment.

What Problem Does This Paper Address?

Programming-by-Example (PBE) involves generating a computer program from a few input-output examples. To scale this to complex tasks, modern systems use a two-stage pipeline: a decomposer breaks the main task into simpler intermediate subgoals, and a synthesizer (or solver) writes the code to solve each subtask.

Traditionally, decomposers are trained via supervised learning to perfectly mimic human-annotated ground-truth (GT) subgoals. The authors challenge this fundamental assumption. They argue that a bounded solver has its own unique search dynamics and inductive biases. A subgoal that makes perfect sense to a human annotator might be a logical dead-end or computationally intractable for a specific neural synthesizer. This misalignment causes standard pipelines to fail because the decomposer proposes valid but "un-solvable" subproblems.

Methods

The authors propose Solver-Aware Decomposition (SAD), a framework that optimizes the decomposer specifically for the downstream solver's capabilities.

  1. Structural Scaffold: SAD retains a standard supervised cross-entropy loss ($\mathcal{L}_{\text{sup}}$) on ground-truth subgoals. This acts as a regularizer to keep the decomposer within a meaningful, structured problem space.
  2. Synthesizer Feedback Loop: The core innovation is optimizing the decomposer via Reinforcement Learning (RL) using Self-Critical Sequence Training (SCST). The decomposer samples a subgoal and also generates a greedy baseline subgoal. Both are passed to a fixed, frozen synthesizer.
  3. Dense Reward Signal: Instead of a binary success/failure reward, SAD uses the synthesizer's cross-entropy loss against the target program tokens as a dense reward. This provides informative feedback even for partially correct programs. The advantage term (sampled reward minus greedy baseline reward) guides the decomposer toward subgoals where the synthesizer's search distribution naturally peaks.
Figure 2: Solver-aware training loop: the decomposer is trained using feedback from a frozen synthesizer. Note, the supervised signal Lsup is not displayed.

Datasets

The method is evaluated across three distinct PBE domains:

  • Deepcoder: A sequential domain operating on integer lists using first- and higher-order functions (e.g., Map, Filter). It features high decomposition ambiguity (multiple valid ways to split a task).
  • Lambdabeam: An extension of Deepcoder with dynamically constructed lambda functions and conditional If-operations, creating a much larger and less constrained search space.
  • Robustfill: A string transformation domain (e.g., text editing). Crucially, Robustfill has a structurally fixed decomposition order where any deviation propagates failure immediately. The authors use this as a designed falsifiability check—SAD should show no gains here if their alignment hypothesis is correct.

Each domain is tested both in-distribution and on a challenging length generalization task (testing on longer programs than seen during training).

Key Insights and Ideas

  • The Accuracy Paradox: Neurally mimicking human annotations can actively harm performance. A solver-blind decomposer achieves much higher exact-match accuracy with human subgoals but results in lower final synthesis success compared to SAD.
Figure 1: Subgoal similarity to GT is a poor proxy for solver utility. Left: decomposition accuracy (exact match with GT subgoals): solver-blind training scores higher than the solver-aware training. Right: synthesis accuracy given predicted subgoals: solver-blind training scores lower despite its higher GT alignment. This shows that higher decomposition accuracy does not translate into better synthesis performance.
  • Decomposition is Solver-Relative: There is no such thing as a universally "optimal" decomposition. A good subtask is defined entirely by whether the specific downstream executor can handle it.
  • SAD-only Solutions: SAD frequently discovers alternative synthesis paths that completely bypass complex human-designed primitives (like Scanl1 or complex ZipWith chains), opting instead for simpler, element-wise scaling sequences that the synthesizer finds easier to search.

Key Results

  • Task Accuracy Gains: SAD consistently outperformed solver-blind baselines and the state-of-the-art reference ExeDec. On Deepcoder length generalization, SAD achieved a 22.2% relative improvement over the solver-blind baseline. On Lambdabeam length generalization, it showed a 14.0% relative improvement.
Figure 3: Task accuracy on Deepcoder and Lambdabeam. SAD consistently outperforms both baselines across domains and evaluation settings. This shows that improvements in task accuracy are driven by better alignment with the synthesizer, particularly under distribution shift. Note, ns : p > 0.05, ∗: p < 0.05, ∗∗: p < 0.01, ∗∗∗: p < 0.001.
  • Beating the Oracle: Remarkably, SAD successfully solved a consistent subset of tasks where a Ground-Truth Oracle (which feeds perfect human subgoals directly to the synthesizer) failed. This provides direct empirical proof that human decompositions can introduce friction for bounded neural solvers.
  • Falsifiability Confirmed: On Robustfill, where decomposition ambiguity is structurally absent, SAD's performance matched the baseline exactly (94.1% in-distribution), proving the RL framework doesn't introduce instability when there's no alignment gap to exploit.

Limitations and Future Work

  • Synthesizer Dependency: Because SAD optimizes the decomposer for a specific frozen synthesizer, the decomposer must be completely retrained if the synthesizer's architecture or weights change.
  • Fixed Granularity: The training operates on a single-step constraint, meaning the decomposer and synthesizer cannot dynamically negotiate the depth or scale of a subtask on the fly.
  • Requirement for GT Programs: SAD currently relies on ground-truth programs during training to compute the dense cross-entropy reward. Extending the framework to use purely execution-based rewards (checking if the output matches the specification) would make it applicable to specification-only settings where ground-truth code is unavailable.

Summary updated

BibTeX
@inproceedings{zenkner2026solver,
  author = {Janis Zenkner and Tobias Sesterhenn and Tim Grams and Christian Bartelt},
  title = {{Solver-Aware Decompositions for Programming-by-Example: When Dividing Requires Knowing how to Conquer}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=SffA3K1Xus},
}
Figure