A popular way to make language models reason reliably is to have them translate a word problem into a formal program, such as a set of first-order logic formulas for the Z3 solver (a tool that mechanically checks logical consequences), and then let the solver compute the answer. Iterative refinement loops repair these programs when the solver reports a syntax error or crashes. The hardest failures, though, give no report at all. The program runs cleanly, but one premise was translated wrongly, often because the model's world knowledge pulled the translation toward what is plausible rather than what the text says. Sampling many translations and voting does not help, because the bias is systematic and every sample makes the same mistake.
We propose a fix that uses a property logic guarantees: whether an argument is valid does not depend on what its words mean. If we consistently rename the entities and predicates in a problem, using nonsense words or swapped real words that contradict common knowledge, then a correct translation must be the same program up to that renaming. We translate several renamed copies of each problem, map each program back through the known renaming, and use the solver to check equivalence clause by clause. When a clause's translation changes with the renaming, world knowledge leaked into it. That clause-level disagreement does two jobs. It gives the repair loop a specific error report where the solver gave none, and it gives a vote across copies whose errors are far less correlated than ordinary samples.
Core Claim
Consistency across meaning-altering but logic-preserving rewrites is a better error signal for autoformalization than consistency across random samples. We expect it to catch most of the silent translation errors that existing refinement loops miss, and to do so at matched inference cost. The new parts are three. First, an invariance check run inside the refinement loop, with per-clause equivalence decided by the solver. Second, a clause-level vote across rewritten copies rather than an answer-level vote across samples. Third, a falsifiable prediction: on belief-inconsistent problems, disagreement among ordinary samples will stay low on wrong answers, while disagreement across rewritten copies will rise.
Grounding in Prior Work
The motivation comes from three findings. Language Models Are Greedy Reasoners built ProntoQA, a set of multi-hop proofs over true, false, and fictional ontologies. It showed that voting over 40 sampled chains does not improve multi-hop proof accuracy, because the model keeps preferring the same misleading path. Reasoning Circuits in Language Models traced a mechanism behind this. Knowledge-retrieval attention heads compete with the syllogistic reasoning circuit, and on belief-inconsistent inputs performance degrades by nearly 300%. Consistency Training Can Entrench Misalignment shows more generally that agreement-based signals amplify coherent biases rather than correct them. Taken together, these papers say that self-consistency needs diversity in the source of error, not just in which tokens get sampled.
The method builds on LTRAG. LTRAG retrieves solved translations and, when Z3 fails, retrieves past repairs to guide a fixer model. Its authors note that the fixer cannot handle programs that run but encode the wrong logic. Our invariance check targets exactly that case. LTRAG also retrieves examples by the surface story, the problem the authors of Skill-Based Few-Shot Selection and SALA identify: retrieval by topic picks examples that share vocabulary rather than reasoning structure. Those papers fix it by first having a model rewrite the query into a description of the skill or sequence of operations it needs. We get a cheaper version of that rewrite for free. A copy with nonsense names keeps only the logical skeleton, so retrieving examples by that copy's text strips away topical overlap without an extra model call.
Two papers constrain the design. A Systematic Analysis of LLMs as Soft Reasoners shows that fine-tuning on nonsense words removes the content effect within syllogism templates but does not transfer to open-domain text. That is why we do not rely on masking alone and do not train anything. Certified Deductive Reasoning, which introduced LogicGuide, uses a theorem prover to constrain each deduction step. It assumes the premises were translated correctly and simply outputs "nothing" when they were not. Our work sits upstream of that step and is complementary to it. Quantifying Consistency via Structural Uncertainty shows that agreeing final answers can hide contradictory derivations. It measures this through the model's own verbal preferences between chains. We measure it with solver-checked equivalence of formal clauses, which does not depend on the model's judgment of itself.
Research Program
For each problem, a deterministic pipeline extracts the content words that the logic treats as entities and predicates. It then builds K rewritten copies. One is the original. Some use nonsense words drawn from a pseudo-word bank in the style of the soft-reasoners study. Others are counterfactual swaps that make the conclusion contradict world knowledge, in the spirit of DivLogicEval's counterintuitive mapping. A language model translates each copy into Z3-checkable first-order logic, using demonstrations retrieved by the nonsense-name copy. Each program is mapped back through its renaming, and the per-premise formulas are aligned across copies. For each premise, Z3 checks whether the K formulas are pairwise equivalent.
Premises whose formulas disagree go to a fixer prompt. The prompt shows the original sentence, the competing formulas, and which renamings produced each. The fixer either picks one or writes a new formula. A clause-level plurality across copies serves as the fallback. Syntax and solver errors are handled the LTRAG way, and we adopt the rollback rule from MEIC: a repair that breaks previously consistent clauses is reverted. We also log an item-level disagreement score so it can be tested as a predictor of errors.
The main analysis compares error correlation in two settings. One is across N ordinary samples of the original text. The other is across K rewritten copies at the same total number of tokens. We measure correlation with gold-formula agreement wherever gold formulas exist.
Baselines
The naive reference point is a single translation of the original text followed by one solver call, the Logic-LM setup. FOLIO reports Logic-LM at 78.1% accuracy (FOLIO), and LTRAG reports Logic-LM at 43.04% on AR-LSAT with a 39.8% rate of executable programs.
The strongest existing method is LTRAG, which combines thought-guided retrieval with a fixer loop driven by Z3. It reports 56.71% accuracy on AR-LSAT with GPT-4o and 79.67% on FOLIO with Gemma2-27b (LTRAG). It is the closest competitor because it already closes the loop on solver feedback, so any gain we show must come from catching errors that loop misses. We will rerun it on the same backbone models, with the same demonstration pools and the same cap on total generated tokens. Beating it means a statistically reliable accuracy gain on the original FOLIO and AR-LSAT, and a larger gain on their belief-inconsistent variants. Matching it on the original sets while beating it on the variants would still support the claim, but more narrowly.
A second strong baseline is self-consistency over translations: N samples of the original text, each translated, solved, and voted at the answer level. We set N so that its tokens equal those spent on our K copies plus repair. A fourth baseline is LogicGuide-style constrained decoding applied on top of a single translation.
Three ablations isolate the key ingredient. The first keeps K copies but uses only answer-level voting, with no clause check and no repair. The second replaces renamed copies with paraphrased prompts in the style of DIPPER, which diversifies prompts but keeps entity names. The third uses nonsense-name copies only.
Why not just…?
Why not just translate only the nonsense-name copy and skip the rest? This is the most serious threat. On fully synthetic sets such as ProntoQA's fictional split, it may well match our method. On open text it should fall short, for two reasons. Real names help the model parse the sentence, and the soft-reasoners study found that training on pseudo-words does not transfer beyond templates. Masking-only is therefore an explicit ablation. If it matches the full method on FOLIO's WikiLogic split and on AR-LSAT, the contribution shrinks to "mask before translating," and we will report that result as such.
Why not just sample more translations and vote? Saparov and He found that voting over 40 samples does not fix systematic proof errors. Our correlation analysis tests the same question directly for translation errors at matched token budgets. If sample-level disagreement predicts errors as well as copy-level disagreement does on belief-inconsistent items, the core claim fails.
Why not just paraphrase the prompt or mix reasoning formats, as in DIPPER or Mixture-of-Thought? Paraphrases and format changes keep the entities that trigger the prior. We expect them to diversify surface form but not the error, and the paraphrase ablation measures exactly this.
Why not just use a bigger model? DivLogicEval reports o1-preview at 51.3% zero-shot under counterintuitive mappings, against a human baseline of 86.7% (DivLogicEval). Scale alone does not remove the content effect. We nonetheless run one frontier backbone to see whether the gap narrows.
Proposed Experiments
We evaluate on five benchmarks. FOLIO is central, because its gold first-order formulas allow per-clause scoring of translation accuracy. We also build a belief-inconsistent FOLIO: entities are swapped so that conclusions contradict common knowledge, and labels are re-derived from the gold formulas with Z3. The other four are AR-LSAT, ProntoQA's true, false, and fictional splits, DivLogicEval's counterintuitive configurations, and the syllogism suite from the soft-reasoners study. Backbones include one open model around 8B to 27B parameters, so the Gemma2-27b comparison with LTRAG is possible, and GPT-4o. Metrics are accuracy, executable-program rate, per-clause translation accuracy against gold, the gap in accuracy between believable and unbelievable items, and the AUROC with which each disagreement score detects silent errors.
Three checks decide the question. First, on belief-inconsistent FOLIO, copy-level disagreement must flag wrong-but-executable programs with clearly higher AUROC than sample-level disagreement at equal cost. Second, the full method must shrink the believability gap relative to LTRAG without lowering accuracy on the original FOLIO. Third, the full method must beat the masking-only ablation on open-text splits. If any of these fails, the claim does not hold as stated.
References
- Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thought
- Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inference
- Consistency Training Can Entrench Misalignment
- LTRAG: Enhancing Autoformalization and Self-refinement for Logical Reasoning with Thought-Guided RAG
- Skill-Based Few-Shot Selection for In-Context Learning
- SALA: Semantic-Aware Logical Alignment for Complex Reasoning in In-Context Learning
- A Systematic Analysis of Large Language Models as Soft Reasoners
- Certified Deductive Reasoning with Language Models
- Quantifying Consistency in LLM Logical Reasoning via Structural Uncertainty
- MEIC: Re-thinking RTL Debug Automation using LLMs
- FOLIO: Natural Language Reasoning with First-Order Logic
- Dipper: Diversity in Prompts for Producing Large Language Model Ensembles in Reasoning tasks
- Learning to Reason via Mixture-of-Thought for Logical Reasoning
- DivLogicEval: A Framework for Benchmarking Logical Reasoning Evaluation in Large Language Models