NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Kimina Lean Server: A High-Performance Lean Server for Large-Scale Verification

Marco Dos Santos, Hugues de Saxcé, Haiming Wang, Mantas Baksys, Mert Unsal, Junqi Liu, Zhengying Liu, Jia Li

TL;DR

This paper introduces the Kimina Lean Server, an open-source tool designed to dramatically speed up the verification of mathematical proofs generated by AI. By combining parallel processing and smart caching, it achieves a 1.5-2x speedup over existing methods, making large-scale AI training for theorem proving much more efficient.

What Problem Does This Paper Address?

Training AI models to prove mathematical theorems, especially using reinforcement learning, requires verifying a massive number of proofs. This process is computationally intensive and slow, creating a bottleneck for research progress. Existing tools for interacting with proof assistants like Lean 4 are often single-threaded or lack efficient mechanisms for handling the sheer volume of proofs needed for large-scale training. This gap hinders the development of more capable AI mathematicians.

Methods

The Kimina Lean Server tackles this challenge with two core innovations:

  • Server-Side Parallelization: Instead of running Lean proofs one by one, the server manages a pool of parallel Lean processes. When a proof request comes in, it's routed to an available process, allowing it to fully utilize multi-core CPUs for efficient batch processing.
  • LRU Caching of Imported Modules: Loading Lean libraries (like Mathlib) is computationally expensive. The server implements a Least Recently Used (LRU) cache that stores pre-initialized Lean environments. When a new proof script arrives, if its imports have been seen recently, the server reuses the existing environment, significantly reducing initialization overhead.

On the client side, a lightweight Python package simplifies interaction, allowing users to submit proof batches and receive structured feedback, including extracted tactic information.

Datasets

The primary dataset used for evaluation is a filtered subset of the NuminaMath-LEAN dataset. This dataset contains 9,419 valid, "sorry-free" proofs, meaning they are complete and do not contain placeholders. The paper does not introduce a new benchmark but rather uses an existing one for rigorous evaluation.

Key Insights and Ideas

  • Parallelism is Key, but Caching is Crucial: While parallelizing Lean processes is essential for speed, the significant cost of loading libraries means that effective caching of these loaded modules is equally, if not more, important for achieving substantial performance gains.
  • Specialized Tools for AI Training: The paper highlights that existing general-purpose Lean interaction tools are not optimized for the specific demands of large-scale AI training, necessitating a dedicated solution like the Kimina Lean Server.
  • Structured Proof Data for AI: The ability to extract structured proof steps (tactics and their states) is vital for AI models, especially those employing tree search strategies, and the Kimina Lean Server facilitates this extraction.

Key Results

  • Significant Speedup: The Kimina Lean Server achieves a 1.5 to 2 times speedup in verification time compared to existing tools like leanclient and LeanInteract.
  • Scalability: Performance scales effectively with the number of CPU cores. For instance, scaling from 8 to 32 cores reduced verification time by nearly 4x.
  • Caching Effectiveness: The LRU caching mechanism reduces average verification time by approximately 1.94x when compared to a non-cached approach.
  • Real-World Application: The server has been successfully used as the core verification engine for training state-of-the-art AI models like Kimina-Prover, which have achieved top performance on benchmarks like miniF2F.

Limitations and Future Work

  • Compatibility: The server's compatibility is tied to the Lean REPL, meaning it will work with any Lean version supported by the REPL. Minor modifications to the process spawning logic could allow adaptation to alternative Lean proof checkers.
  • Future Work: The authors express hope that their open-source project will benefit the AI for mathematics community by reducing the effort required to interact with Lean from Python, thereby accelerating future research. The modular architecture suggests potential for extending its capabilities or adapting it to different proof assistants.

Summary updated

BibTeX
@inproceedings{santos2025kimina,
  author = {Marco Dos Santos and Hugues de Saxcé and Haiming Wang and Mantas Baksys and Mert Unsal and Junqi Liu and Zhengying Liu and Jia LI},
  title = {{Kimina Lean Server: A High-Performance Lean Server for Large-Scale Verification}},
  booktitle = {MATH-AI @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=orPt2nxLoC},
}
Figure