Summary of SHADOWBENCH: Toward Reliable Automatic Evaluation of Semantic Alignment in Autoformalization
Summary (Overview)
- Novel evaluation metric (SA-PASS): The paper introduces Semantic Alignment Pass (SA-PASS), an automatic metric that evaluates whether a generated formal statement is semantically equivalent to the intended informal theorem using both forward and backward implication checks against a set of "shadow theorems."
- New benchmark (SHADOWBENCH): A Lean 4 full-autoformalization benchmark containing 178 postgraduate- to research-level problems across eight mathematical areas, each annotated with complete shadow theorem sets.
- Key finding: Current systems achieve high compile rates but low semantic alignment—Claude Code (Opus 4.8) with Numina-Lean-Agent reaches 61.8% compile rate but only 11.2% SA-PASS, revealing that compilation substantially overestimates semantic alignment.
- High reliability: SA-PASS achieves 98.8% binary agreement with expert judgments across six agentic configurations, compared to 17.8% for compile rate and 80.6% for BEq+.
- Transferability: SA-PASS transfers to existing benchmarks like ProofNet, where it achieves perfect agreement with expert judgments.
Introduction and Theoretical Foundation
Background and Motivation
Autoformalization translates informal mathematical theorems written in natural language into code for proof assistants such as Lean. In the full autoformalization setting, the input is an informal theorem statement and proof, and the output is code containing the corresponding formal statement and proof.
The core challenge is assessing whether the generated formal statement expresses the same mathematics as the informal statement. Existing evaluation approaches have significant limitations:
- Compile rate can produce false positives by accepting type-correct but semantically misaligned statements
- Reference-based metrics (BLEU, BEq+) can produce false negatives by rejecting correct statements formulated differently
- Expert judgment is reliable but too costly to scale for repeated evaluations
Theoretical Foundation
The paper formalizes the task as follows:
Definition 1 (Full autoformalization task): Given an informal theorem statement and its proof, generate a formal statement together with a machine-checkable proof of . Let denote the intended formal statement. The semantic alignment objective is:
Definition 2 (Shadow theorem): For an intended formal statement , a shadow theorem consists of an auxiliary formal statement and a machine-checkable proof of . Its forward checker theorem states that implies :
Definition 3 (Complete shadow set): Let be the intended formal statement, and let be a finite set of shadow statements. The set is complete if the shadows jointly characterize , i.e., the backward checker theorem states:
Together with the forward checker theorems , this gives:
The key insight is that a complete shadow set characterizes the intended theorem exactly—the shadows are individually implied by and jointly imply (Figure 2 in the paper).
Methodology
SA-PASS Scoring
Definition 4 (Passing condition): For a problem whose intended formal statement is , a generated formal theorem with statement passes if and only if its declaration and proof type-check in Lean and it passes the forward checks:
and the backward check:
Definition 5 (SA-PASS): For a generated formal theorem with statement and a complete shadow set :
Definition 6 (SA-PASS): A graded variant that assigns partial credit:
Benchmark Construction
The SHADOWBENCH construction process involves:
- Informal theorem collection: Sourced from textbooks, lecture notes, and research repositories
- Reference formalization: LLM-assisted drafting with expert revision until Lean type-checks
- Checker theorem construction: Qwen3-235B proposes candidate shadow sets; Lean verifies completeness; experts review and guide revisions (initial drafts complete for 85% of problems)
- Checker diversification: Rules and LLM-based adapters handle binder style, field notation, and declaration name variations
Table 1: SHADOWBENCH problem distribution
| Area | L1 | L2 | L3 | Total |
|---|---|---|---|---|
| geometry (Geo) | 18 | 6 | 0 | 24 |
| topology (Top) | 16 | 9 | 0 | 25 |
| algebra (Alg) | 19 | 4 | 3 | 26 |
| analysis (Anl) | 14 | 10 | 4 | 28 |
| algebraic-geometry (AG) | 2 | 16 | 4 | 22 |
| combinatorics (Cmb) | 8 | 6 | 0 | 14 |
| number-theory (NT) | 17 | 0 | 2 | 19 |
| probability (Prob) | 19 | 1 | 0 | 20 |
| Total | 113 | 52 | 13 | 178 |
Table 2: Checker theorem statistics
| Type | Count | Mean | Min | Max |
|---|---|---|---|---|
| Forward | 513 | 2.88 | 1 | 13 |
| Backward | 193 | 1.08 | 1 | 12 |
| Total | 706 | 3.97 | 1 | 25 |
Empirical Validation / Results
Main Results on SHADOWBENCH
Table 3 (key results): Per-difficulty pass rates (%) on SHADOWBENCH
| Method | L1 Compile | L1 SA-PASS | L2 Compile | L2 SA-PASS | L3 Compile | L3 SA-PASS | Avg Compile | Avg SA-PASS |
|---|---|---|---|---|---|---|---|---|
| Claude Code (Opus 4.8) + Numina | 61.1 | 6.2 | 71.2 | 23.1 | 30.8 | 7.7 | 61.8 | 11.2 |
| Codex (GPT-5.4) + Numina | 61.9 | 8.8 | 48.1 | 13.5 | 30.8 | 7.7 | 55.6 | 10.1 |
| Claude Code (Opus 4.6) + Numina | 55.8 | 8.8 | 36.5 | 11.5 | 15.4 | 0.0 | 47.2 | 9.0 |
| Claude Code (Opus 4.8) | 24.8 | 2.7 | 13.5 | 3.8 | 7.7 | 0.0 | 20.2 | 2.8 |
| Codex (GPT-5.4) | 20.4 | 2.7 | 11.5 | 1.9 | 7.7 | 0.0 | 16.9 | 2.2 |
| All non-agentic methods | — | 0.0 | — | 0.0 | — | 0.0 | — | 0.0 |
Key findings:
- Compilation overestimates semantic alignment: The gap between compile rate (61.8%) and SA-PASS (11.2%) is 50.6 points for the best system
- Numina-Lean-Agent helps compilation more than alignment: Gains of 41.6 points in compile rate but only 8.4 points in SA-PASS for Claude Code (Opus 4.8)
- Semantic alignment remains largely unsolved: All non-agentic methods score 0.0% on SA-PASS
Agreement with Expert Judgment
Table 4: Binary agreement of automatic metrics with expert judgment
| Metric | Precision | Recall | F1 | Agreement |
|---|---|---|---|---|
| Compile | 0.178 | 1.000 | 0.302 | 0.178 |
| BLEU | 0.234 | 0.674 | 0.347 | 0.550 |
| LLM-as-judge | 0.235 | 0.093 | 0.133 | 0.785 |
| BEq+ | 0.400 | 0.186 | 0.254 | 0.806 |
| SA-PASS | 0.414 | 0.953 | 0.577 | 0.752 |
| SA-PASS | 1.000 | 0.930 | 0.964 | 0.988 |
SA-PASS achieves perfect precision and near-perfect recall, with 98.8% agreement with expert judgments. Compile rate has perfect recall but extremely low precision (0.178), confirming that most compile-passed outputs are semantically misaligned.
Results on ProofNet
SA-PASS transfers to the existing ProofNet benchmark. Across 16 non-agentic models:
- Compile rate and SA-PASS differ by only 2.1 points on average (max 7.8 points)
- SA-PASS achieves perfect agreement with expert judgments on ProofNet outputs (Table 6)
This smaller gap is attributed to ProofNet's shorter, less compositional targets (single conclusions, no auxiliary declarations) compared to SHADOWBENCH's longer formalizations (~1.6× longer by line count, 4.5 auxiliary declarations per problem on average).
Forward vs. Backward Checker Analysis
Table 7 (key results): Checker metrics for agentic systems
| Method | Fwd | Fwd | Bwd | SA-PASS |
|---|---|---|---|---|
| Claude Code (Opus 4.8) + Numina | 14.0 | 14.0 | 22.5 | 11.2 |
| Codex (GPT-5.4) + Numina | 17.4 | 17.4 | 16.3 | 10.1 |
The two implication directions detect different forms of semantic mismatch:
- Failing forward checks: omitted conclusions or added assumptions
- Failing backward checks: added conclusions or omitted assumptions
Theoretical and Practical Implications
Theoretical Contributions
-
Formalization of semantic alignment: The paper provides a rigorous, machine-checkable definition of semantic alignment via complete shadow sets, reducing the problem to provable implication checks in Lean.
-
Reusable expert supervision: Shadow sets are constructed once per intended theorem (not per generated formalization), making expert knowledge reusable across unlimited evaluations.
-
Addresses both false positives and false negatives: Unlike compile rate (false positives) or reference-based metrics (false negatives), SA-PASS provides a balanced evaluation through bidirectional implication checks.
Practical Implications
-
Benchmark design: SHADOWBENCH's separation of public problem inputs from hidden checking artifacts prevents benchmark gaming and enables fair repeated evaluation.
-
System development guidance: The large gap between compile rate and SA-PASS indicates that current systems optimize for type-correctness rather than semantic alignment, suggesting a need for new training objectives and evaluation protocols.
-
Scalable evaluation: SA-PASS enables automatic evaluation at scale, replacing costly expert judgments for routine evaluation while maintaining reliability.
Conclusion
Main Takeaways
- SA-PASS provides a reliable, automatic metric for evaluating semantic alignment in autoformalization through Lean-checkable forward and backward implication checks against complete shadow theorem sets
- SHADOWBENCH reveals that current state-of-the-art systems achieve high compile rates (61.8%) but low semantic alignment (11.2% SA-PASS)
- SA-PASS achieves 98.8% agreement with expert judgments, substantially outperforming existing metrics
Future Directions
- Extending SHADOWBENCH coverage to more mathematical domains and proof styles
- Improving systems to optimize for semantic alignment rather than mere compilation
- Developing methods to further automate shadow set construction
Limitations
- SHADOWBENCH covers 178 problems across eight areas; broader coverage is needed
- SA-PASS requires one-time construction of shadow statements and checker proofs for each problem
Potential Risks
- Benchmark leakage: If checker artifacts are exposed, systems could optimize for the checks rather than the informal theorem. Mitigated by separating public problem inputs from hidden checking artifacts.
Related papers
- Update from Hell: Can Coding Agents Survive Hidden Breakage in Dependency Upgrades?
DEPEND-REPAIR benchmark shows current coding agents solve only 51% of dependency-upgrade tasks, failing primarily due to incomplete propagation of API changes across codebases.
- DeepSWE: Measuring Frontier Coding Agents on Original, Long-Horizon Engineering Tasks
DeepSWE, a benchmark of 113 original never-merged coding tasks with hand-written verifiers, cuts grading errors tenfold versus SWE-Bench Pro and better separates frontier model performance.
- Explore More, Drift Less: Outcome-Only Reinforcement Learning Can Suffice for Long-Horizon Interactive Agents
Outcome-only reinforcement learning with CANOPY, a protocol fixing signal starvation and policy drift, lets a single open 14B model top the AppWorld leaderboard.