FANS: Formal Answer Selection for LLM Natural Language Math Reasoning Using Lean4
Jiarui Yao, Ruida Wang, Tong Zhang
Abstract
Large Language Models (LLMs) have displayed astonishing abilities in various tasks, especially in text generation, classification, question answering, etc. However, the reasoning ability of LLMs still faces many debates, especially in math reasoning. The inherent ambiguity of Natural Language (NL) limits LLMs' ability to perform verifiable reasoning, making the answers lack coherence and trustworthy support. To tackle the above challenges, we propose a novel framework named FANS: Formal ANswer Selection for LLM Natural Language Math Reasoning Using Lean4. It is a pioneering framework that utilizes Lean4 to enhance LLMs' NL math reasoning ability. In particular, given an NL math question and LLM-generated answers, FANS first translates it into Lean4 theorem statements. Then it invokes another Lean4 prover LLM to produce proofs, and finally verifies the proofs by Lean4 compiler. Answers are selected based on the verifications. It enhances LLMs' NL math ability in providing a computer-verifiable solution for its correct answer and proposes an alternative method for answer selection beyond the reward model based ones. Our experiments demonstrate the effectiveness of FANS with an improvement of nearly 2% across several math benchmarks, and even higher further based on reward models or in subfields such as algebra and number theory that Lean4 is better at. The code is available in https://github.com/MaxwellJryao/FANS .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext df26b2a0-881d-42e8-b3ed-46bafe31a62cBuilds on15
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
- SimPO: Simple Preference Optimization with a Reference-Free RewardYu Meng, Mengzhou Xia, Danqi ChenNeurIPS 2024 · 1,203 citations
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
- MetaMath: Bootstrap Your Own Mathematical Questions for Large Language ModelsLonghui Yu, Weisen Jiang, Han Shi, Jincheng Yu et al.ICLR 2024 · 637 citations
Related papers
- LoC-Decomp: LLM Autoformalization via Logical Concept Decomposition and Iterative Feedback CorrectionJiangze Shi, Zhiwei Zhang, Baoquan Ma, Shuai Zhao et al.ICLR 2026
- Safe: Enhancing Mathematical Reasoning in Large Language Models via Retrospective Step-aware Formal VerificationChengwu Liu, Ye Yuan, Yichun Yin, Yan Xu et al.ACL 2025
- TheoremLlama: Transforming General-Purpose LLMs into Lean4 ExpertsRuida Wang, Jipeng Zhang, Yizhen Jia, Rui Pan et al.EMNLP 2024 · 9 citations
- NL2Lean: Translating Natural Language into Lean 4 through Multi-Aspect Reinforcement LearningYue Fang, Shaohan Huang, Xin Yu, Haizhen Huang et al.EMNLP 2025
- Scaling Generative Verifiers For Natural Language Mathematical Proof Verification And SelectionSadegh Mahdavi, Branislav Kisacanin, Shubham Toshniwal, Wei Du et al.ICML 2026 · 10 citations
