Model reference · open weights
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.
Summary of the openbmb/MathForm-8B model card, 2026-10-01
What it is
| Released by | openbmb |
|---|---|
| Released | 2026-08-14 |
| Parameters | 8.2B |
| VRAM | 16.4 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB … RTX 4060 Ti 16 GB 2 smaller cards | — | — | — | |
| RTX 3090 24 GB | 5 | 1 | all 40K | 23.4 GB |
| RTX 4090 24 GB | 5 | 1 | all 40K | 23.4 GB |
| RTX 5090 32 GB | 11 | 2 | all 40K | 31.0 GB |
| L40S 48 GB | 22 | 5 | all 40K | 44.0 GB |
| A100 80 GB | 50 | 12 | all 40K | 78.2 GB |
| H100 80 GB | 46 | 11 | all 40K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 59 | 14 | all 40K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 71 | 17 | all 40K | 107 GB |
| H200 141 GB | 96 | 24 | all 40K | 138 GB |
| B200 180 GB | 127 | 31 | all 40K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 4 | 1 | 35K | 11.6 GB a card |
| 2× RTX 4060 Ti 16 GB tensor parallel | 10 | 2 | all 40K | 15.4 GB a card |
| 2× RTX 4090 24 GB tensor parallel | 23 | 5 | all 40K | 23.4 GB a card |
| 2× RTX 3090 24 GB tensor parallel | 23 | 5 | all 40K | 23.4 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 18.3 GB | 22.0 GB |
| 5 | 23.2 GB | 41.3 GB |
| 8 | 26.8 GB | 55.8 GB |
| 16 | 36.5 GB | 94.4 GB |
| 32 | 55.8 GB | 172 GB |
| 64 | 94.4 GB | 326 GB |
One card, with vLLM's small-card settings.
From 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.
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 serve openbmb/MathForm-8B \
--served-model-name MathForm-8B \
--dtype bfloat16 \
--max-model-len 16384
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.
| Setting | Value |
|---|---|
temperature | 0.6 |
top_p | 0.95 |
max_new_tokens | 16384 |
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.
This project is licensed under the Apache License 2.0.
@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.