CriticLean: Critic-Guided Reinforcement Learning for Mathematical Formalization

Zhongyuan Peng, Yifan Yao, Kaijing Ma, Shuyue Guo, Yizhe Li, Yichi Zhang, Chenchen Zhang, Yifan Zhang, Zhouliang Yu, Luming Li, Minghao Liu, Yihang Xia, Jiawei Shen, Yuchen Wu, Yixin Cao, Zhaoxiang Zhang, Wenhao Huang, Jiaheng Liu, Ge Zhang

TL;DR

CriticLean introduces a novel reinforcement learning framework that transforms the "critic" from a passive validator into an active driver of mathematical autoformalization. By training specialized CriticLeanGPT models to detect subtle semantic mismatches between natural language and Lean 4 code, the researchers achieved a massive leap in formalization reliability, producing a massive, high-quality dataset of over 285,000 verified mathematical problems.

What Problem Does This Paper Address?

Translating natural language mathematics into formal, executable code (like Lean 4) is known as autoformalization. While modern LLMs have become decent at generating code that compiles, they often fail at semantic fidelity—the code runs, but it doesn't actually represent the original math problem. For example, a model might formalize a request for a "cubic polynomial" as a "quadratic" one; the compiler won't complain, but the math is wrong.

Existing research has focused heavily on the generation phase. This paper argues that the "critic phase"—the step where we evaluate if the formalization truly captures the problem's intent—is the real bottleneck. Without a reliable way to judge correctness, we cannot effectively use reinforcement learning or iterative refinement to improve these models.

Methods

The authors propose CriticLean, a framework that places a trained critic model at the center of the formalization pipeline.

  1. CriticLeanGPT: They developed a specialized critic model based on the Qwen family. It is trained using a two-stage process:
  2. Supervised Fine-Tuning (SFT): Training on a mix of "critic data" (math/code pairs with explanations) and general math/code reasoning to broaden its knowledge base.
  3. Reinforcement Learning (RL): Using the GRPO (Group Relative Policy Optimization) algorithm—an "R1-style" approach—the model is refined using discrete, rule-based rewards for accuracy (matching expert labels) and formatting.
  4. Iterative Refinement: Instead of a single pass, the system uses a feedback loop. If the Lean compiler finds a syntax error, or if CriticLeanGPT finds a semantic error, the generator (AutoFormalizer) receives that feedback and tries again.
  5. Flaw Injection: To train the critic to spot errors, the authors used "flaw injection," where they took correct Lean code and used models like Gemini 2.5 Pro to meticulously introduce specific types of logical or mathematical errors.

Datasets

The paper introduces several significant data contributions:

  • CriticLeanBench: A benchmark of 500 manual-verified natural language/Lean 4 pairs (half correct, half incorrect) designed to test a model's "critic" capabilities.
  • FineLeanCorpus: A massive dataset of 285,957 fully verified Lean 4 formalizations. This is significantly larger and more diverse than previous datasets like Lean-Workbook.
  • FineLeanCorpus-Diamond: A curated subset of over 36,000 high-difficulty problems (difficulty level > 5) to push the boundaries of formal reasoning.
  • CriticLeanInstruct: A training set of 48,000 samples used to teach the models how to critique and reason about formalization.

Key Insights and Ideas

  • The Critic is the Bottleneck: Simply relying on compiler success is insufficient. The authors found that while compiler feedback fixes syntax, it is blind to logical flaws. Adding a semantic critic improved autoformalization accuracy from 54% to 84% in human evaluations.
  • RL for "Thinking": Applying RL (specifically GRPO) to the critic model significantly boosted its ability to identify subtle errors. The RL-trained models showed higher "True Negative Rates," meaning they were much better at catching "plausible but wrong" code.
  • Multi-Task Synergy: Training the critic solely on "is this correct?" data is less effective than a 1:3 mix of critic data and general math/code reasoning data. This suggests that a critic needs a deep "understanding" of math to be a good judge.
  • The Power of Persistence: Using a multi-attempt strategy (up to 200 tries) with the critic-guided pipeline allowed the system to successfully formalize 52.8% of a difficult 500-problem sample, whereas a single-pass system only managed 12.6%.

Key Results

  • Critic Performance: Their Qwen3-32B-RL model achieved 87.0% accuracy on CriticLeanBench, outperforming most closed-source models and significantly beating standard open-source Instruct models (which hovered around 60-70%).
  • Dataset Quality: Human evaluation of the FineLeanCorpus showed high correctness across various sources (e.g., 100% on DeepTheorem, 84% on Omni-MATH).
  • Scaling Laws: The researchers observed a clear scaling law: as model parameters increased (from 7B to 32B), the critic's ability to distinguish correct from incorrect formalizations improved consistently.

Limitations and Future Work

  • Generator Dependency: The pipeline's ultimate success is still limited by the base generator. If the generator cannot produce a correct candidate within its attempt limit (e.g., 200 tries), the critic has nothing to approve.
  • Computational Cost: Iterative refinement with hundreds of attempts is computationally expensive, suggesting a need for more efficient "first-guess" generators.
  • Human-in-the-loop: While the dataset is "fully verified" by the critic/compiler pipeline, the authors acknowledge that human evaluation is still the gold standard for the most complex "Diamond" problems.

Future work will likely focus on using the high-quality FineLeanCorpus to train even stronger generators, creating a virtuous cycle of better formalization and better critiquing.

Summary updated

BibTeX
@inproceedings{peng2026criticlean,
  author = {Zhongyuan Peng and Yifan Yao and Kaijing Ma and Shuyue Guo and Yizhe Li and Yichi Zhang and Chenchen Zhang and Yifan Zhang and Zhouliang Yu and Luming Li and Minghao Liu and Yihang Xia and Jiawei Shen and Yuchen Wu and Yixin Cao and Zhaoxiang Zhang and Wenhao Huang and Jiaheng Liu and Ge Zhang},
  title = {{CriticLean: Critic-Guided Reinforcement Learning for Mathematical Formalization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.139},
}
Figure