Checking Autoformalizations with Solver Witnesses, Tested on Motion-Compensated Scan Schedules

Many systems that pair a language model with a logic solver fail in a quiet way. The language model translates a problem into formal logic, the solver runs without complaint, and the answer is wrong because one quantifier or one condition was translated slightly incorrectly. The standard repair loop sends solver error messages back to the model. It cannot catch these mistakes, because nothing crashed. We propose a different check. The solver takes the model's formalization and produces concrete example worlds: some that satisfy every constraint, and some "near-misses" that break exactly one. Each world is rendered in plain language, and a judge, who never sees the formulas, asks one question about it: does the original text allow this situation? If the text and the formula disagree about a concrete case, the translation is wrong, and the constraint that was dropped to build the near-miss points to where it is wrong.

We test the check in two places. The first is standard text logic benchmarks with gold annotations. The second is a domain where the true meaning of a request can be checked by physics: scheduling camera exposures for intermittent motion compensation. These are imaging systems in which a mirror, piezo stage, or beam deflector cancels the target's motion only while the shutter is open, then resets while it is closed. Acquisition requests for these rigs are full of the constraint types language models mistranslate. One example is "every exposure must fall inside the linear part of the sweep." Another is "no tracking excursion may exceed the stroke." Once formalized, the resulting schedule can be run in a kinematic simulator that reports blur and limit violations. That simulator gives us a ground-truth semantic oracle, which text benchmarks lack.

Core Claim

Judging whether a single concrete situation fits a description is easier and more reliable for a language model than writing a correct formula for that description. It is also more reliable than judging a formula directly. Solver-generated witnesses turn the second problem into the first. The claim is that witness probing detects silent mistranslations with substantially higher recall than resampling-and-voting at the same number of model calls. The claim also covers what happens after detection: repairing the localized constraint raises end-task accuracy over solver-error refinement and over confidence-based selective translation.

The physical-imaging setting has two jobs in this argument. It is where the judge's reliability can be measured against an exact oracle. It is also a realistic application where silent errors have a cost: a blurred or aborted acquisition on an instrument that images a cubic millimeter over weeks (Zheng et al.).

Why This Gap Is Real

Several papers establish the problem this proposal addresses. Logic-LM translates problems into Prolog, first-order logic, or constraint programs and feeds syntax errors back through a self-refiner. The information flow is one-way, though: once a quantifier is wrong, the solver has no access to the original text. Raza argues that most translation errors are exactly this kind of subtle operator or scope mismatch rather than a syntax failure. The FOLIO paper (FOLIO) reports roughly 93% syntactic validity for model-generated logic, which means the remaining errors cannot be located by syntax checking alone.

Other papers are partial solutions that constrain the design. HBLR scores each sentence with a hand-built structural filter plus a model verifier and leaves low-confidence sentences in natural language. It decides whether to translate, but it never tests what a finished translation means. VeriCoT formalizes each reasoning step and asks a model judge whether the premises are grounded. That judge still reads formulas and text side by side, and the method pays several model calls per step. IFDNS has a similar cost problem. We differ from all three in one respect: the object shown to the judge is a concrete world produced by the solver, never a formula.

The imaging papers supply the application's constraint structure and its physical ground truth. Gu et al. track with a piezo stage during exposure and reset while the shutter is closed. Their system reaches a hard 42 µm stroke limit above about 10 mm/s. Inoue et al. fire 0.33 ms exposures only on the linear part of a 750 Hz resonant mirror sweep. DaXi counter-scans a light sheet against a continuously moving stage. bdTEM acquires 3×3 supertiles per stage step and still spends about 35% of its time on non-imaging overhead. None of these papers involves language or logic. We use their published parameters only to build realistic constraint systems and simulators.

Research Program

The method has four stages. First, a language model formalizes a problem into a set of named constraints $C = \{c_1, \dots, c_m\}$ in SMT-LIB and solves it with Z3.

Second, the solver draws $k$ diverse satisfying models of $C$ and, for each constraint $c_i$, a near-miss model of $C \setminus \{c_i\} \cup \{\neg c_i\}$ where one exists. Diversity comes from blocking clauses on previously returned models.

Third, each model is rendered into a plain description. For logic puzzles this is a concrete assignment of entities and properties. For imaging it is a timeline of stage positions, mirror phases, and shutter intervals. A judge model sees the original request and one rendered world, and answers "allowed" or "not allowed." Two cases count as disagreements. A satisfying world judged not allowed means the formalization is too weak. A near-miss judged allowed means $c_i$ is too strong or wrongly scoped.

Fourth, flagged constraints alone are sent back for re-translation, and the witness that exposed the problem is included as a counterexample. This repeats up to a fixed budget.

For the imaging testbed, we will write several hundred acquisition requests spanning the four rig families. Their parameters come from the cited papers: 2000 fps and a 42 µm stroke; a 750 Hz sweep with 0.33 ms exposures; a 75 mm stage range with a 3.3 Hz volume rate; and 3×3 supertiles with fixed per-step overhead. Each request comes with a hand-written gold constraint set. A kinematic simulator executes any schedule. It reports residual relative displacement during each exposure (blur in pixels), stroke or phase violations, and duty cycle. A schedule counts as correct when the simulator finds no violation and all stated throughput targets are met.

This testbed is new and deliberately small. It exists to measure judge reliability against physics. It is not intended as a leaderboard.

Baselines

The naive reference point is a single-pass formalization with no repair loop. On FOLIO this measures how often a translation compiles but assigns a truth value different from the gold logic.

The strongest existing method with a reported number is Logic-LM with self-refinement. The FOLIO paper reports 78.1% accuracy for Logic-LM on FOLIO. Logic-LM reports that the GPT-4 backbone lifts AR-LSAT from about 35% to over 43%. We will rerun Logic-LM with the same backbone model, the same prompts for initial translation, and a refinement budget equal to our total model-call count. Beating it means a higher end-task accuracy at matched calls, together with a measured drop in silent errors.

HBLR is the closest competitor on this exact question, since it also targets semantic rather than syntactic error. It reports beating Logic-LM by an average of 10.3%, but no absolute FOLIO figure appears in our file. We will therefore reimplement its confidence-aware translation module on the same backbone.

Resampling-and-voting is the baseline most likely to match us. It samples $n$ independent formalizations, solves each, and takes the majority answer, with $n$ set so that total calls equal ours. No reported result on these benchmarks was found on Lacuna for this baseline, so we will run it ourselves.

A direct baseline asks the model to reason without a solver, which tests whether formalization helps at all in each domain.

For imaging only, a hand-written parametric scheduler per rig family serves as an upper-bound reference. No reported result was found on Lacuna for language-to-schedule translation on any of these rigs.

Four ablations isolate what matters. The first uses only satisfying witnesses. The second uses only near-misses. The third shows the judge the formulas instead of rendered worlds, which tests the core hypothesis directly. The fourth replaces solver witnesses with random worlds that the solver did not produce, which tests whether the solver's targeting matters.

Why not just…?

Why not just feed solver errors back, as Logic-LM does? Silent errors never produce an error message, so this loop never fires on them. Raza's analysis and FOLIO's roughly 93% syntactic validity together suggest that most remaining errors are of this kind. Our FOLIO experiment measures directly how many compile-clean translations disagree with the gold logic and how many of those each method catches.

Why not just sample several translations and vote? This is a real threat. If a model's errors are independent across samples, voting fixes them without any witnesses. It fails when a model is consistently wrong, for example when it reads "only if" the same wrong way every time, and we expect scope errors to be systematic. The matched-call comparison settles this question. If voting reaches the same silent-error recall and the same accuracy, the proposal's central claim is false and we will report it that way.

Why not just use confidence-based selective translation like HBLR? HBLR decides which sentences to formalize, but it relies on hand-crafted filters. It also offers no way to detect a confident but wrong translation. The two methods are complementary, so we also run witness probing on top of HBLR's output. If the stack adds nothing, the witnesses are redundant with HBLR's confidence scores.

Why not just skip formalization and let a neural model reason directly? Clark et al. show fine-tuned transformers reaching 99% accuracy on synthetic rule sets. However, FOLIO reports 64.2% for 8-shot GPT-4, and NIPE reports a correlation of R = 0.658 with human judgments for GPT-4 alone versus 0.927 with a symbolic planner. Physical schedules also need exact guarantees that direct reasoning does not give. The direct baseline stays in every table.

Why not just hand-write a scheduler for each rig? For a single fixed rig, this probably wins, and we include it as an upper bound. The language interface is justified only for heterogeneous, composed requests. For that reason we report results separately for requests that fit one template and for requests that combine several rig constraints.

Proposed Experiments

We run three experiments, each with a decisive check.

The first is judge reliability on imaging. For every witness, we compare the judge's allowed/not-allowed verdict against the simulator's verdict, and repeat with formulas shown instead of worlds. The hypothesis requires the rendered-world judge to agree with physics clearly more often than the formula-reading judge. If it does not, we stop.

The second is silent-error detection on FOLIO, where gold logic gives an exact oracle, and on ProofWriter. We plot detection recall against false-alarm rate for witness probing and for voting, at matched model calls.

The third measures end-task accuracy on FOLIO, AR-LSAT, and the imaging testbed against every baseline above. We test whether the AR-LSAT ordering and assignment games benefit most, since their structure is closest to scheduling. On imaging, we also report simulator-verified schedule validity and duty cycle.

We will examine cost carefully. The claim holds only if the gains survive at matched calls and tokens, because both VeriCoT and IFDNS show that multi-call verification can quietly buy accuracy with compute.