When Is Program Structure Required? Certificate-Grounded Calibration of Program-Induction Difficulty

Wenzhang DuarXiv 2026 · arXiv

TL;DR

This paper introduces certificate-grounded calibration, a rigorous method to verify the minimum program complexity required to solve a set of input-output examples. By using complete enumeration to rule out "shortcut" solutions, the authors demonstrate that while Large Language Models (LLMs) struggle significantly more when forced to use complex program structures, the resulting programs generalize better to unshown data.

What Problem Does This Paper Address?

In Program-by-Example (PBE) benchmarks, we often assume that if a task was generated by a complex program (e.g., one with multiple rules), then a model must use a similarly complex program to solve it. However, this isn't always true. A set of examples intended to test multi-step reasoning might accidentally be solvable by a single, simpler rule—a "shortcut."

If benchmarks contain these hidden shortcuts, they don't accurately measure a model's ability to induce complex program structures. The authors tackle this ambiguity by providing a way to "certify" the difficulty of a task, ensuring that the examples provided actually demand the level of complexity being tested.

Methods

The authors focus on a bounded string-replacement language where programs consist of one or more replace(a, b) rules. Their core innovation is certificate-grounded calibration:

  1. Complete Enumeration: For a given set of examples, the system exhaustively checks every possible single-rule program within defined bounds. If a single-rule solution exists, the task is certified as "Minimum: 1 rule."
  2. Matched Task Pairs: They construct pairs of tasks—a Control and a Separation task—that share a base set of examples.
  3. The Control task adds an example that allows at least one single-rule solution to persist.
  4. The Separation task adds a different example (matched for length and edit features) that excludes all possible single-rule solutions, forcing a minimum of two rules.
  5. Verification: A two-rule "witness" program is used to verify that a valid multi-rule solution exists for both tasks.

This process, illustrated in Figure 1, happens before any model inference, providing a ground-truth difficulty level.

Figure 1: Certifying the program structure required by an example set. (a) A two-rule reference generates five shared examples, all of which also admit the single replacement exa→azy. (b) Two matched additions produce tasks with minimum lengths of one and two rules. Complete enumeration in the stated replacement language verifies the one-rule solution sets, and the reference satisfies both tasks. (c) Each model call receives the displayed examples and a synthesis instruction. The returned program is executed on its displayed task, the common-nine target, the wholly unshown witness pair, and separately sampled uniform and rule-active inputs.

Datasets

  • Reference Families: 120 newly constructed families of string-replacement tasks, each with matched control/separation variants.
  • Saved Archive: An audit of 1,008 existing replacement tasks from prior work.
  • Models Evaluated: Qwen3-8B, Olmo-3-7B-Think, and Phi-4-mini-reasoning.

Key Insights and Ideas

  • Shortcuts are the Default: Models like Qwen and Olmo are highly sensitive to shortcuts. If a single-rule solution is possible, they will often find it, even if the "intended" logic was more complex.
  • The Generalization Paradox: Forcing a model to use more structure (the Separation tasks) makes the task harder to complete, but it improves generalization. When a model successfully solves a Separation task, it is significantly more likely to correctly handle "witness" inputs that were never shown in the prompt.
  • One Example Changes Everything: The paper highlights how a single, carefully chosen example can act as a "certificate" that rules out an entire class of simpler programs, fundamentally shifting the model's behavior.
  • Archive Mismatch: The audit of the 1,008-task archive revealed that 23 tasks previously thought to require multiple rules actually had one-rule shortcuts, proving that generative references are not a reliable proxy for task difficulty.

Key Results

The quantitative impact of certified difficulty is stark, as shown in the validation results (Table 1):

  • Completion Drop: On certified Separation tasks (requiring 2 rules), task completion was 23.53 to 45.83 percentage points lower than on matched Control tasks.
  • Generalization Gain: Despite the lower completion rate, success on a wholly unshown "witness" pair was 8.40 to 13.45 points higher for Separation tasks. This suggests that requiring more structure leads to programs that better capture the underlying logic rather than just fitting the surface features of the examples.
  • Rule Agreement: Agreement on inputs that activate both reference rules remained very low (1.93–5.78%), highlighting that multi-step induction remains a significant challenge for current LLMs.

Limitations and Future Work

  • Language Scope: The current guarantees are limited to a bounded string-replacement language. Extending this to more expressive domains (like full Python or domain-specific languages with loops/conditionals) is computationally difficult because it requires exhaustive search to certify the "minimum" program.
  • Search vs. Delivery: The authors note that the gap in performance is partly due to the models failing to find the right program (search) and partly due to failing to output it correctly (delivery). Disentangling these further is a suggested next step.
  • Scaling: Future work could explore whether larger models or different reasoning techniques (like Chain-of-Thought) can close the gap on certified separation tasks.

Summary updated

Abstract

A program-induction benchmark is informative when its examples require the structure it aims to test. Yet a two-rule generator can produce demonstrations that a single rule also explains. We introduce certificate-grounded calibration, which constructs matched tasks with minimum solution lengths of one and two in a bounded string-replacement language. Complete one-rule enumeration and an executable two-rule witness certify the change before model inference. We evaluate 120 reference families with three to six shared examples, using 1,440 new model trajectories and 480 saved trajectories. Across Qwen3-8B and Olmo-3-7B-Think, displayed-task completion is 23.53-45.83 percentage points lower on certified separation tasks, while success on a wholly unshown witness pair is 8.40-13.45 points higher. These witness gains accompany lower agreement on uniformly sampled strings and 1.93-5.78% agreement on inputs that activate both reference rules. Recertification also reveals that a single unchanged example can exclude a shortcut and determine whether two rules are required. Together, these results show how the evidence supplied by examples shapes both the required solution and the programs models produce. The construction provides an executable testbed for comparing program search, final-answer delivery, and behavior on new inputs under verified task requirements.
BibTeX
@misc{du2026when,
  author = {Wenzhang Du},
  title = {{When Is Program Structure Required? Certificate-Grounded Calibration of Program-Induction Difficulty}},
  year = {2026},
  eprint = {2611.24975},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.24975},
}
Figure