Model reference · open weights

MathForm

LLMs openbmb Text gen 1 build Open weights 777 dl/mo

MathForm is an open-weight language model from openbmb. MathForm-8B (BF16) weighs 16.4 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.

  • MathForm-8B is an 8.2B parameter text-generation model developed by openbmb that translates natural-language mathematical statements into Lean 4.
  • It is trained on the FormalVerse dataset using supervised fine-tuning and reinforcement learning with Lean compilation feedback.
  • The model supports a context length of 40960 tokens, operates in English, and is released under the Apache 2.0 license.

Summary of the openbmb/MathForm-8B model card, 2026-10-01

What it is

Released byopenbmb
Released2026-08-14
Parameters8.2B
VRAM16.4 GB for the weights

What it runs on

Memory and cards for MathForm-8B (BF16)

16.4 GBweights, file size
147 MBcache per 1K tokens
753 MBruntime overhead, at least
40,960 tokenscontext max
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB … RTX 4060 Ti 16 GB
2 smaller cards
———
RTX 3090 24 GB51all 40K23.4 GB
RTX 4090 24 GB51all 40K23.4 GB
RTX 5090 32 GB112all 40K31.0 GB
L40S 48 GB225all 40K44.0 GB
A100 80 GB5012all 40K78.2 GB
H100 80 GB4611all 40K78.1 GB
RTX PRO 6000 Blackwell 96 GB5914all 40K93.8 GB
DGX Spark (GB10) 128 GB unified7117all 40K107 GB
H200 141 GB9624all 40K138 GB
B200 180 GB12731all 40K176 GB
2× RTX 3060 12 GB
tensor parallel
4135K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
102all 40K15.4 GB a card
2× RTX 4090 24 GB
tensor parallel
235all 40K23.4 GB a card
2× RTX 3090 24 GB
tensor parallel
235all 40K23.4 GB a card
Memory needed at each load
Requests at once8K tokens each32K tokens each
118.3 GB22.0 GB
523.2 GB41.3 GB
826.8 GB55.8 GB
1636.5 GB94.4 GB
3255.8 GB172 GB
6494.4 GB326 GB

One card, with vLLM's small-card settings.

From the model card

What openbmb says about MathForm

Read the model card

MathForm-8B is an autoformalization model that translates natural-language mathematical statements into Lean 4. It is released with the paper MathForm: Scaling Mathematical Autoformalization with Knowledge Retrieval and Verification-Guided Refinement.

The model is trained on FormalVerse through supervised fine-tuning followed by reinforcement learning using Lean compilation and semantic-consistency feedback.

Results

Usage

Transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "openbmb/MathForm-8B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype=torch.bfloat16, device_map="auto"
)

prompt = (
    "Please convert the following informal math problem to a formal one in Lean 4 with a header. "
    "Use the following theorem names: my_favorite_theorem.\n\n"
    "Show that for every real number x, x^2 is non-negative."
)

messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs, max_new_tokens=16384, temperature=0.6, top_p=0.95
)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))

vLLM

vllm serve openbmb/MathForm-8B \
  --served-model-name MathForm-8B \
  --dtype bfloat16 \
  --max-model-len 16384

SGLang

python -m sglang.launch_server \
  --model-path openbmb/MathForm-8B \
  --served-model-name MathForm-8B \
  --dtype bfloat16 \
  --context-length 16384

Both servers expose an OpenAI-compatible API at http://localhost:8000/v1/chat/completions.

Recommended Settings

SettingValue
temperature0.6
top_p0.95
max_new_tokens16384

Evaluation

The evaluation pipeline, benchmark files, and Pass@k scripts are available in the MathForm repository. Compilation checks require a running Kimina Lean Server. The experiments use Lean 4.21.0.

License

This project is licensed under the Apache License 2.0.

Citation

@misc{pu2026mathformscalingmathematicalautoformalization,
      title={MathForm: Scaling Mathematical Autoformalization with Knowledge Retrieval and Verification-Guided Refinement},
      author={Lushi Pu and Weiming Zhang and Xinheng Xie and Zixuan Fu and Bingxiang He and Hengyu Zhao and Hongya Lyu and Xin Li and Jie Zhou and Yudong Wang},
      year={2026},
      eprint={2608.14221},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2608.14221},
}

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms