Beyond Solver Verdicts: Generative Reward Models for Autoformalization

Authors: Vikash Singh, Debargha Ganguly, Aman Goel, Ali Torkamani, Xiaoxue Han, Joseph Lilien, Ferhat Erata, Vipin Chaudhary (Case Western Reserve University & Amazon Web Services)


Summary (Overview)

  • Formalizes Verdict-Preserving-Unfaithfulness (VPU): A critical failure mode in neurosymbolic systems where an incorrect formal encoding executes successfully and matches the expected solver verdict despite being logically non-equivalent to the reference formalization.
  • Proves theoretical limits of structural verification: Demonstrates that any scoring function depending only on binary solver verdicts achieves chance-level (0.5) AUROC on verdict-matched pairs.
  • Introduces Generative Verification (GenV): A novel approach that distills an offline Z3-equivalence oracle into a reference-free, continuous verification score by repurposing the language model's native vocabulary space for next-token prediction.
  • Achieves state-of-the-art results: GenV+HN reaches 0.961 AUROC in reference-equivalence verification, generalizes zero-shot across unseen translators and formal styles, and yields an 11.3-point downstream accuracy gain in agentic test-time compute allocation.
  • Provides mechanistic interpretability: Gradient-based lenses and sparse autoencoders demonstrate that VPU and error-position information are natively recoverable from the verifier's hidden states without explicit localization training.

Introduction and Theoretical Foundation

Background and Motivation

Neurosymbolic systems promise a clean division of labor: a language model translates natural language problems into formal logic, and a sound solver (e.g., Z3) performs deduction. However, the resulting guarantee is conditional—a solver certifies what follows from the supplied encoding, but does not certify that the encoding accurately represents the source problem. The translation step is therefore an independent point of failure.

Formal Definition of VPU

The paper studies this failure relative to a designated reference formalization ss^{\star}. Reference-equivalence is defined by mutual implication:

Eq(s,s)=I[A(s)¬A(s) is unsat,A(s)¬A(s) is unsat](1)\operatorname{Eq}(s, s^{\star}) = \mathbf{I}\left[\begin{array}{l} A(s) \wedge \neg A(s^{\star}) \text{ is unsat}, \\ A(s^{\star}) \wedge \neg A(s) \text{ is unsat} \end{array}\right]\tag{1}

where A(s)A(s) denotes the logical conjunction of assertions in candidate encoding ss.

Definition 1 (Reference-relative Verdict-Preserving-Unfaithfulness): Relative to a designated reference ss^{\star}, a candidate ss is VPU when it is syntactically valid, has the same solver verdict as the reference, and is not reference-equivalent:

VPU(s;s)=I[v(s)=v(s)][1Eq(s,s)](2)\mathrm{VPU}(s; s^{\star}) = \mathbf{I}[v(s) = v(s^{\star})][1 - \mathrm{Eq}(s, s^{\star})]\tag{2}

Theoretical Impossibility Result

Proposition 1 (Binary verdict-only indistinguishability): For any paired evaluation set where si+s_i^+ is reference-equivalent and sis_i^- is VPU with v(si+)=v(si)v(s_i^+) = v(s_i^-) for every pair, any scoring function g(s)=h(v(s))g(s) = h(v(s)) that depends only on the binary solver verdict assigns tied scores to both members of every pair, yielding an empirical AUROC of 0.5.

Proof sketch: Because both members of every pair share the same verdict, g(si+)=h(v(si+))=h(v(si))=g(si)g(s_i^+) = h(v(s_i^+)) = h(v(s_i^-)) = g(s_i^-). The positive and negative score multisets are identical, so every comparison is a tie, giving AUROC = 0.5 under the half-credit convention.

This result isolates a narrow information limit but does not preclude verifiers that inspect the source problem, candidate program, execution traces, or internal model states.


Methodology

1. Verification via Next Token Prediction

Rather than appending a randomly initialized classification head (which can disrupt pre-trained representations), GenV repurposes the frozen vocabulary head as a generative classifier. The model receives a context c(x,s)c(x, s) (source problem + candidate encoding) and outputs a single token judgment ("Yes" for faithful, "No" for unfaithful).

The continuous verification score is computed in a single forward pass by renormalizing probability mass over target classes:

fθ(x,s)=uYπuuYπu+uNπu+ε(4)f_{\theta}(x, s) = \frac{\sum_{u \in Y} \pi_u}{\sum_{u \in Y} \pi_u + \sum_{u \in N} \pi_u + \varepsilon}\tag{4}

where ε=109\varepsilon = 10^{-9} is a stabilization constant, YY and NN are vocabulary token ID sets for positive/negative answers, and π=pθ(c(x,s))\pi = p_{\theta}(\cdot \mid c(x, s)).

2. Supervised Fine-Tuning with Oracle Labels

Training data D={(xi,si,yi)}i=1m\mathcal{D} = \{(x_i, s_i, y_i)\}_{i=1}^{m} uses binary labels yi=Eq(si,si)y_i = \mathrm{Eq}(s_i, s_i^{\star}) pre-computed by the exact Z3-equivalence oracle. The model is fine-tuned with causal cross-entropy loss over the answer sequence only:

L(θ)=1mi=1mj=1Milogpθ(ai,j[ci;ai,<j])(5)\mathcal{L}(\theta) = -\frac{1}{m}\sum_{i=1}^{m}\sum_{j=1}^{M_i} \log p_{\theta}\left(a_{i,j} \mid [c_i; a_{i,<j}]\right)\tag{5}

Context tokens condition the forward pass but their loss is masked out, preventing catastrophic forgetting.

3. Oracle-Guided Hard Negative Mining

To address the sparsity of deceptive false positives, the framework bootstraps the training manifold with programmatic hard negatives. Targeted mutation operators μ()\mu(\cdot) (e.g., flipping relational operators, perturbing constants, reversing implications) are applied to gold references. A mutated candidate is retained if and only if it is syntactically correct and satisfies the VPU criteria from Definition 1, with Z3 serving as the deterministic adjudicator.


Empirical Validation / Results

RQ1: Representation vs. Structure in Equivalence Verification

Table 1: Reference-faithfulness AUROC

SystemAUROC
(a) Combined benchmark (950 rows, 260 VPU)
GenV+HN (deployed), ours0.961
GenV, without mined negatives0.956
Self-consistency vote (K=5)0.863
Outcome RM (token head)0.762
Process RM (token head)0.756
Solver-only (verdict match)0.500
(b) Expanded split (488 rows, 184 VPU): prior methods
Generative readout, oursrfours^{rf}0.950
GTED tree-edit distance0.835
FormalAlign (fwd+bwd)0.752
Round-trip back-translation rf^{rf}0.578

Table 2: Matched supervision and readout ablation

ReadoutSupervisionAUROC
Generative P(Yes)whole-encoding0.983
2-class head, warm initwhole-encoding0.921
2-class head, cold initwhole-encoding0.920
per-step token head, ORM labelper-step, min-agg0.827
per-step token head, PRM labelper-step, min-agg0.633

Key findings:

  • The vocabulary-space readout provides an additional improvement over the two-class head under matched supervision.
  • Ablations confirm robustness to target token choice (e.g., "Yes/No" vs. "A/B" or "X/Y"), indicating the model genuinely tracks the equivalence target rather than exploiting linguistic biases.

RQ2: Zero-Shot Generalization

Table 3: Zero-shot AUROC across out-of-domain formal styles

DatasetG-20 readoutGenVProcess RMOutcome RMGenV+HN (ours)
In-domain0.9590.9560.7560.7620.961
FOLIO0.6670.5950.7740.5340.830
ProofWriter0.8370.8310.7740.5600.842
MALLS0.8630.8260.7970.5090.925
ProverQA0.9060.8220.5880.5280.964
ProntoQA0.8650.8000.6300.5350.915
LogicNLI0.6030.5930.5590.5770.642

GenV+HN maintains consistent margins across all OOD formal styles, while token-head reward models suffer severe degradation.

RQ3: Diagnostic Alignment with Human Intent

Table 4: Reference-equivalence vs. panel-majority intent on a contested slice

TargetGenV+HNJudge
Z3-equivalence to reference0.9070.654
Panel-majority intent0.6790.778

GenV+HN's advantage is specific to strict reference-equivalence; the gap on subjective human intent highlights an open challenge in resolving informal ambiguity.

RQ4: Test-Time Agentic Utility

Table 5: Mechanism attribution by replay on identical recorded pools

MechanismComparisonBase AccVerified AccΔpts
Best-of-N itselfvote@5 vs. single-shot PoT0.6550.748+9.3
Gated escalationvote, full pool vs. vote@50.7480.760+1.2
Verifier selectionfaith² vote vs. vote, full pool0.7600.768+0.9
Full adaptive system vs single-shot PoT0.6550.768+11.3
Solver-gate controlsolver-gated vs. shipped gate0.7680.758-1.0
Advisory feedbackfeedback vs. none, equal budget71/72 flips≈0

The integration of GenV+HN drives total system accuracy from 0.655 to 0.768 (+11.3 points), with the dynamic verification gate (not static re-ranking) being the superior deployment mechanism.


Theoretical and Practical Implications

Theoretical Contributions

  1. Formal characterization of VPU: Provides a rigorous, operational definition of reference-relative unfaithfulness that is deterministic and trainable.
  2. Information-theoretic limits: Proves that binary verdict-only scoring is mathematically bounded to chance-level detection on verdict-matched pairs.
  3. Separation of supervision from deployment: Establishes a clean distinction between privileged oracle information (used only in training) and reference-free inference inputs.

Practical Implications

  1. Deployable verification: GenV+HN requires only the source problem and candidate encoding at inference time—no reference formalization needed.
  2. Agentic compute allocation: The verifier effectively governs test-time compute, providing gains across diverse backends (from +2.3 to +42.6 points depending on generator capability).
  3. Architecture-agnostic: The generative readout works within the model's native vocabulary space, requiring no architectural changes.

Mechanistic Insights

The paper demonstrates that VPU and error-position information are diagnostically recoverable from intermediate representations:

  • Decision-projected gradient lens: The margin g=logsumexpuYzulogsumexpuNzug = \mathrm{logsumexp}_{u \in Y} z_u - \mathrm{logsumexp}_{u \in N} z_u combined with gradient-times-activation attribution q,t=gh,t,h,tq_{\ell,t} = \left\langle \frac{\partial g}{\partial h_{\ell,t}}, h_{\ell,t} \right\rangle localizes mutations without explicit localization training.
  • Sparse autoencoder probes: A TopK SAE on layer-48 activations recovers 0.960 AUROC for GenV+HN, showing that PRM and ORM hidden states contain substantially more VPU information than their deployed output scores expose.

Conclusion

GenV+HN resolves the critical vulnerability of Verdict-Preserving-Unfaithfulness in neurosymbolic systems by distilling offline Z3-equivalence into a reference-free generative readout. Key takeaways:

  1. Structural checks are fundamentally insufficient for detecting VPU—only learned, reference-equivalence-aware verification can bridge this gap.
  2. Generative readouts outperform classification heads under matched supervision, and hard-negative mining provides additional robustness.
  3. The verifier generalizes zero-shot across unseen translators and divergent formal styles, though severe OOD shifts can degrade calibration.
  4. Reference-equivalence serves as an uncompromising, reproducible target for formal evaluation, but subjective human intent remains an open challenge.

Future Directions

  • Bridging the semantic gap between strict reference-equivalence and subjective human intent via human-labeled benchmarks
  • Extending diagnostic internal representations to causally steer multi-error repair pipelines
  • Handling naturally occurring correlated, multi-error distributions (current mining uses synthetic single-edit mutations)
  • Addressing the vacuous-equivalence limitation for unsatisfiable reference formulas

Limitations

  • Supervision is bounded by SMT decidability limits and assumes a fully specified gold reference
  • Advisory feedback does not yield measurable accuracy improvements without expanding the sampling budget
  • The logical equivalence guarantee applies only to satisfiable formal specifications (two unsatisfiable formulas are vacuously equivalent under standard Z3 model checking)

Related papers