Run this model with HF Jobs

Run markm39/openproof-tactic-2b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/markm39/openproof-tactic-2b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/markm39/openproof-tactic-2b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/markm39/openproof-tactic-2b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/markm39/openproof-tactic-2b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

OpenProof Tactic 2B

A Lean 4 tactic prediction model fine-tuned from Qwen/Qwen3.5-2B on 190K+ Mathlib tactic pairs.

Given a Lean 4 proof goal state, the model predicts the next tactic to apply. Designed for use in best-first search (BFS) proof engines like OpenProof.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch

base = "Qwen/Qwen3.5-2B"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="cuda")
model = PeftModel.from_pretrained(model, "markm39/openproof-tactic-2b")

# Input: goal state followed by :::
prompt = "n m : Nat\\nโŠข n + m = m + n:::"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
    out = model.generate(**inputs, max_new_tokens=64, do_sample=True, temperature=0.6, top_k=10)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
# Output: induction m with | zero => simp | succ m ih => simp [Nat.add_assoc, ih, Nat.add_comm]

Training

  • Base model: Qwen/Qwen3.5-2B
  • Method: SFT with LoRA (rank 64, alpha 128)
  • Trainable params: 43.6M / 1.93B (2.3%)
  • Data: markm39/openproof-tactic-pairs -- 190K+ Lean 4 goal-tactic pairs extracted from Mathlib
  • Input format: {goal_state}:::
  • Output format: tactic string
  • Epochs: ~1.8 (12,500 steps)
  • Batch size: effective 128 (2 per device x 32 gradient accumulation)
  • Learning rate: 2e-5 cosine schedule
  • Best eval loss: 0.5492 (checkpoint-12500)
  • Hardware: RunPod GPU instance
  • Framework: HuggingFace TRL + PEFT

Intended Use

Tactic prediction for automated theorem proving in Lean 4. The model generates candidate tactics given a proof goal state, which are then verified by the Lean type checker. Designed to be used with beam search -- sample multiple candidates and verify each.

Not intended for general-purpose text generation.

Limitations

  • Trained on Mathlib tactics only -- may not generalize to custom Lean libraries
  • LoRA adapter (must be loaded on top of Qwen3.5-2B base)
  • SFT only (no RL/GRPO refinement yet)
  • May hallucinate lemma names that don't exist in Mathlib

Links

Acknowledgments

Training data derived from LeanDojo (Yang et al.), Lean Workbook (InternLM), and Goedel-Pset (Goedel-LM). Tactic extraction from whole proofs uses Pantograph kernel-level invocations.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for markm39/openproof-tactic-2b

Finetuned
Qwen/Qwen3.5-2B
Adapter
(467)
this model

Dataset used to train markm39/openproof-tactic-2b