miniCTX: Neural Theorem Proving with (Long-)Contexts

Jiewen Hu, Thomas Zhu, Sean Welleck
8/5/2024
cs.AIcs.CLcs.LG

No official code found. Best implementation: cmu-l3/minictx-eval (23 stars, last commit 2025-07-12).

Abstract

Real-world formal theorem proving often depends on a wealth of context, including definitions, lemmas, comments, file structure, and other information. We introduce miniCTX, which tests a model's ability to prove formal mathematical theorems that depend on new context that is not seen during training. miniCTX contains theorems sourced from real Lean projects and textbooks, each associated with a context that can span tens of thousands of tokens. Models are tasked with proving a theorem given access to code from the theorem's repository, which contains context that is needed for the proof. As a baseline for miniCTX, we tested fine-tuning and prompting methods that condition theorem proving on preceding context. Both approaches substantially outperform traditional methods that rely solely on state information. We found that this ability to use context is not captured by previous benchmarks such as miniF2F. Alongside miniCTX, we offer ntp-toolkit for automatically extracting and annotating theorem proving data, making it easy to add new projects into miniCTX to ensure that contexts are not seen during training. miniCTX offers a challenging and realistic evaluation of neural theorem provers.

View on arXivView PDF

Code Implementations(1)

cmu-l3/minictx-evalCommunity100%

Neural theorem proving evaluation via the Lean REPL

233Shell, PythonJun 6, 20241 years ago

Cite this paper

@article{hu2024minictx,
  title  = {miniCTX: Neural Theorem Proving with (Long-)Contexts},
  author = {Jiewen Hu and Thomas Zhu and Sean Welleck},
  year   = {2024},
  eprint = {2408.03350},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.03350v3},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.03350.svg)](https://codeofpaper.com/paper/2408.03350)

Discussion