Summary (Overview)
- Core Problem: Autoformalization (translating natural-language mathematics into formal proof assistants like Lean 4) is bottlenecked by the faithfulness gap—formal statements can typecheck and be provable yet encode a different theorem than intended.
- Main Contribution: Introduces Bidirectional Provability Fingerprinting (BPF), a reference-free framework that certifies faithfulness by comparing forward/backward consequence neighborhoods of candidate formalizations against semantic probes derived from the natural-language statement.
- Key Innovations: Four novel components—Counterfactual Probe Generation (CPG), the Equivalence Spectrum (a continuous faithfulness score), Adaptive Probe Budget Allocation (APBA), and Faithfulness-Guided Decoding (FGD).
- Theoretical Results: Proves a drift detection theorem and a PAC-faithfulness result showing the equivalence class of a natural-language statement is learnable from probes.
- Empirical Results: BPF + CPG detects 89.6% of drifted formalizations at 3.0% false-positive rate (vs. 41.2% for typecheck and 63.3% for LLM-judge baselines); FGD reduces drifted outputs from a state-of-the-art autoformalizer by 47%. Releases DRIFTBENCH, a benchmark of 2,183 NL/Lean 4 pairs with controlled drift labels.
Introduction and Theoretical Foundation
Background
Modern autoformalization systems translate natural-language theorem statements into formal proof assistants such as Lean 4, Rocq, or Isabelle/HOL. The dominant quality signal used to gate outputs is whether the formal statement typechecks and optionally whether a downstream prover can close it. Both signals are necessary but insufficient:
"A formal statement can be syntactically well-formed, provable, and wrong: it can mean something other than what the mathematician wrote. We call this the faithfulness gap."
Unlike code—where unit tests and runtime semantics offer an executable oracle—faithfulness in formalization is a relation between two semantic objects in different universes: a natural-language sentence interpreted under tacit mathematical convention and a formal expression under a precisely specified dependent type theory.
Formalizing Faithfulness
Definition 3.1 (Interpretation distribution): An interpretation distribution for is a probability distribution over formal statements in whose support consists of formalizations that competent mathematicians would accept as expressing in the theory .
Definition 3.2 (ε-Faithfulness): A candidate is -faithful to under if
This weakens equality to provable equivalence, accommodating notational variation while remaining strict about semantic content.
Taxonomy of Drift
Four canonical classes of semantic drift are identified:
| Drift Class | Description |
|---|---|
| Quantifier drift (e.g., swapping order of adjacent quantifiers) | |
| Hypothesis drift (dropping or weakening a stated hypothesis) | |
| Conclusion drift (altering the conclusion) | |
| Type coercion drift (changing types, e.g., Set vs. Finset) |
These four classes account for 94% of human-labeled drift instances in a pilot study of 400 randomly sampled outputs from a state-of-the-art autoformalizer.
Methodology
Bidirectional Provability Fingerprinting (BPF)
Definition 4.1 (Provability fingerprint): Let and let be a set of probes. The forward fingerprint of over is
and the backward fingerprint is
The full fingerprint is .
Why bidirectional matters: Forward-only fingerprints fail to distinguish a strict strengthening of from itself (a strictly stronger entails everything entails). Backward-only fingerprints dually fail to catch strict weakenings. Bidirectional matching is the minimum sufficient signal.
Proposition 4.2: Let be a candidate for , and let be a probe set closed under -equivalence. Then if and only if and for each pair with , the entailment also holds in 's fingerprint.
Counterfactual Probe Generation (CPG)
CPG treats probe generation as a contrastive problem. For each drift class , a counterfactual pair is constructed consisting of the natural-language statement and a drifted twin , obtained by mechanically perturbing (e.g., swapping adjacent quantifiers or dropping a hypothesis). The probe distribution for drift class is:
Key design choice: is generated mechanically, not by an LLM, ensuring the drift class label is unambiguous and that exhibits exactly the targeted failure.
The Equivalence Spectrum
Definition 6.1 (Equivalence Spectrum): Let be a probe set with predicted labels and class weights . The equivalence spectrum score is
where is the drift class targeted by probe and is the observed fingerprint cell at .
Three calibrated decision regions: (ACCEPT), (REVIEW), (REJECT).
Adaptive Probe Budget Allocation (APBA)
APBA routes budget by expected information gain. For drift class with current posterior , the expected information gain from a probe targeting is:
where is the predicted oracle outcome and is the empirical witnessability distribution.
Theorem 7.1 (APBA budget reduction): Let be the budget required by uniform allocation to reach detection rate on DRIFTBENCH. Then APBA reaches the same with budget , where is the heterogeneity ratio of witnessability rates across drift classes. On DRIFTBENCH, .
Empirical Validation / Results
DRIFTBENCH Benchmark
DRIFTBENCH contains 2,183 natural language/Lean 4 pairs with controlled drift labels across six mathlib4 subfields:
| Subfield | Faith. | Comb. | ||||
|---|---|---|---|---|---|---|
| Analysis | 198 | 64 | 71 | 58 | 33 | 31 |
| Algebra | 173 | 51 | 68 | 49 | 28 | 27 |
| Topology | 162 | 49 | 59 | 47 | 30 | 25 |
| Number Th. | 144 | 42 | 55 | 41 | 22 | 22 |
| Combinator. | 138 | 43 | 51 | 39 | 24 | 21 |
| Category | 117 | 35 | 44 | 33 | 19 | 19 |
| Total | 932 | 284 | 348 | 267 | 156 | 145 |
Main Results
Table 2: Drift detection on the controlled DRIFTBENCH split (Det@3%FPR = detection rate at 3% false-positive rate)
| Method | F1 | Det@3%FPR | FPR | Cost |
|---|---|---|---|---|
| Typecheck only | 0.27 | 0.114 | 0.020 | 1× |
| Provability | 0.42 | 0.412 | 0.030 | 18× |
| BLEU-ref | 0.55 | 0.301 | 0.030 | 1× |
| Back-translation | 0.66 | 0.589 | 0.030 | 4× |
| LLM-judge | 0.71 | 0.633 | 0.030 | 2× |
| BPF-naive | 0.85 | 0.832 | 0.031 | 22× |
| BPF + CPG | 0.91 | 0.896 | 0.030 | 26× |
| BPF + CPG + APBA | 0.91 | 0.894 | 0.031 | 8× |
BPF + CPG reduces the residual error rate of the best non-fingerprinting baseline (LLM-judge) by approximately 72% at matched FPR. Adding APBA preserves detection performance while reducing wall-clock cost by 3.2×.
Per-Class Detection
Table 3: Detection rate by drift class (at 3% FPR overall)
| Method | ||||
|---|---|---|---|---|
| Typecheck | 0.07 | 0.05 | 0.04 | 0.31 |
| Provability | 0.46 | 0.62 | 0.33 | 0.18 |
| Back-translation | 0.66 | 0.61 | 0.59 | 0.40 |
| LLM-judge | 0.74 | 0.67 | 0.64 | 0.42 |
| BPF-naive | 0.89 | 0.88 | 0.84 | 0.55 |
| BPF + CPG | 0.94 | 0.93 | 0.91 | 0.66 |
The type-coercion class () is hardest for every method, consistent with its lower witnessability rate .
Ablations
Table 4: Ablations of BPF + CPG on the controlled split
| Variant | F1 |
|---|---|
| Full BPF + CPG | 0.91 |
| - counterfactual probes (CPG) | 0.85 |
| - bidirectional (forward only) | 0.80 |
| - hypothesis-drop probes | 0.82 |
| - boundary probes | 0.88 |
| - adversarial probes | 0.87 |
| probe budget k = 8 (vs. 32) | 0.83 |
| probe budget k = 8 + APBA | 0.89 |
Removing bidirectional matching costs 11 F1 points; removing CPG costs 6 points; removing hypothesis-drop probes costs 9 points, almost all on .
FGD Downstream Impact
FGD reduces the drifted-output rate from a state-of-the-art autoformalizer from 19.4% to 10.3% at candidates (47% relative reduction), and to 8.7% at . The re-prompt component contributes most of the improvement at small ; pure reranking saturates at ~14%.
Theoretical and Practical Implications
Drift Detection Theorem
Theorem 8.1 (Drift Detection): Fix and drift class . Suppose the probe generator samples probes from a distribution such that
where is the witnessability rate for class . Then, with probe budget
BPF flags as drifted with probability at least , provided the entailment oracle is complete on the chosen probes.
Empirical witnessability rates: , , , . A budget of probes gives for the first three classes.
PAC-Faithfulness
Theorem 8.2 (PAC-Faithfulness): Let denote the equivalence class . Assume CPG probes are drawn from a distribution such that for every reachable by an LLM autoformalizer, . Then with probes, BPF produces a hypothesis such that with probability at least ,
where is the autoformalizer's output distribution.
Incomplete Oracle and Undetectable Drift
Lean's tactic stack is incomplete. Let be the probability that the oracle returns "?" on a probe that admits a -cost proof. The detection bound degrades to ; empirically on DRIFTBENCH probes. BPF cannot detect convention drift—where adopts a different notational convention invisible to provability—for which a complementary structural test is developed.
Practical Implications
- Deployment as triage tool: BPF should be deployed as a triage tool that prioritizes expert review (via the REVIEW band), not a replacement for human verification.
- Cross-system generality: The framework is system-agnostic—preliminary experiments on Isabelle/HOL show comparable detection rates (F1 = 0.88 vs. 0.91 on Lean 4).
- Computational efficiency: APBA provides 3.2× practical speedup; caching fingerprints for canonical statements and learned entailment classifiers are identified as future optimization paths.
Conclusion
This paper introduced Bidirectional Provability Fingerprinting (BPF), a framework for certifying faithfulness in autoformalization that requires no reference formalization. The four supporting innovations—counterfactual probe generation (CPG), the equivalence spectrum, adaptive probe budget allocation (APBA), and faithfulness-guided decoding (FGD)—collectively address distinct facets of the faithfulness problem.
Key takeaways:
- BPF + CPG detects 89.6% of drifted formalizations at 3.0% false-positive rate, substantially outperforming typecheck (41.2%), provability, BLEU-ref, back-translation, and LLM-judge baselines.
- FGD reduces drifted-output rates from a state-of-the-art autoformalizer by 47%.
- Theoretical guarantees (drift detection and PAC-faithfulness theorems) characterize what is and is not detectable, with polynomial probe budgets.
- DRIFTBENCH provides the first benchmark with controlled drift labels for evaluating autoformalization faithfulness end-to-end.
The faithfulness gap is identified as the bottleneck for trustworthy autoformalization at the scale of full mathematical libraries. The authors view BPF as a concrete step toward closing it, with future directions including stronger entailment oracles, cross-system validation, and integration with library-scale formalization workflows.
Related papers
- Does Accuracy Equal Evidence? Reasoning Faithfulness under KV Cache Compression
Accuracy alone masks severe reasoning degradation in KV-compressed large reasoning models, so evaluation must pair accuracy with faithfulness metrics like reasoning correctness and fidelity.
- Sorries Are Not the Hard Part: An Expert-Review Case Study of a Semi-Autonomous Formalization
LLMs excel at closing proof goals but remain weak at choosing definitions and designing APIs, so autoformalization evaluation must shift from compilation success to expert review of library quality.
- StateM: Reaching 95.3% Raw Accuracy, or a $15 Frontier Run, on Terminal-Bench 2.1 via Harness Scaling
StateM's harness scaling lifts GPT-5.6 Sol to 95.28% raw accuracy on Terminal-Bench 2.1, beating a model generation's gain at roughly $15 cost.