Bridging informal and formal mathematical reasoning with ai
Notes from Lecture 10 of this Open MOOC offered by Berkeley RDI
-–
- Informal thoughts - Training models to think informally Lean-STAR
- In lean, given a theorem, there’s a loop between proof state and the next step(tactic) taken to complete the proof
- Neural theorem proving approach - train a model on some inputs and outputs of proof state and next steps on a dataset an generate proofs using tree search
- Lean-StaR - Training Models to think before each step, using RL
- Initialisation - train a model to retrospectively to produce CoT before taking a step
- RL-
- model—-thought+step—LEAN—Y/N—repeat
- Tree Search (Sampling Method)
- Best-First-Search - its difficult to score (thought, action) so it didn’t work well
- New method - generate multiple proofs in parallel, backtrack and retry if lean fails, until you reach max steps or complete the proof. Increasing the search budget benefits models with CoT in general (!). Informal thoughts have logical steps not present in formal code. Startup which has the current SoTA alternates between code generation and informal reasoning, before generating the final code
- Online RL - Expert iteration - collect successful trajectories, add to dataset and retrain. Added to the pass rate as much as CoT (~2.5 points)
- Benchmarks - miniF2F
- Informal provers - sketching proofs and filling the gaps - LeanHammer
- Motivation is to combine high level and low-level reasoning
- “Hammers” are tools that are used for filling in gaps for proofs. However, they are not good for proofs with higher search space, only for interactive use with humans
- Draft-Sketch-Proof: draft an informal proof, translate to a formal sketch, use a low-level prover to fill the gaps
- Draft - Human/LLM
- Sketch - LLM
- Hammer - fill gaps
- Proof Search - generate many informal proofs / informal sketches and translate [search seems to be performed at a different “layer” of abstraction]
- Inference time proof search scaling - Increasing trajectories increases proofs found until it plateaus. Proofs generated using different LLMs, and match human levels of proof [judged by count of proofs?]
- LeanHammer - Integrates automated theorem provers (SMT solvers) into interactive theorem prover (Lean, Isabelle, Coq)
- ATPs struggle with large search space. Premise Selection- select a small subset of theorems and definitions that are likely to be useful for proving a given theorem. Mathlib has 250k premises. Premise selection reduces this search space.
- Hammer Pipeline:
- Goal—->Select Premise—–Translate to ATP language—–ATP solves—–Reconstruct to Lean—–>Proof
- Goal—–>Select Premise—–Lean-auto——————zuperposition——–Duper———>Proof
- Neural Premise selection - frame premise selection as retrieval with a neural language model
- Embed mathlib/local premises
- cosine similarity to select highest scoring premise
- Contrastive loss on state, positive premise, negative premise. Retriever training is nuanced, output format dependent
- Combine premise selector and ATP with a tree search: Aesop
- Query ATP using premises
- Apply tactics using the premises
- At any step of the proof “hammer” can be called. If it succeeds, it will display the proof.
- The retriever is less than <100M parameters.
- Research-level maths - assisting in research-level projects - MiniCTX
- Steps of doing it manually - informal blueprint and a dependency graph of theorems, definitions, lemmas - formalise
- Accessibility gap - Some methods are hard to integrate into tools
- Not open source (AlphaProof)
- Expensive to run (MCTS)
- LLMLean - basic interface between lean and a language model, compatible with local LLMs
- Benchmarking gap - Instead of solving self-contained standard results-based problems like IMO, benchmark on real problems which are context dependent
- miniCTX: Test models on real Lean projects
- future mathlib - theorem added after a time cutoff
- Other recent projects included too
- Contexts
- In-file dependencies
- Cross-file dependencies - premise and context selection necessary for good performance. Competition specific models do not perform well on these.
- miniCTX: Test models on real Lean projects
-——–
https://rdi.berkeley.edu/adv-llm-agents/sp25
Written on May 30, 2025
