LIMO: Less is More for Reasoning
Paper • 2502.03387 • Published • 63
How to use Cbgcbg/limo-qwen3-8b-math-full-precision_v3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Cbgcbg/limo-qwen3-8b-math-full-precision_v3")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Cbgcbg/limo-qwen3-8b-math-full-precision_v3")
model = AutoModelForCausalLM.from_pretrained("Cbgcbg/limo-qwen3-8b-math-full-precision_v3")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use Cbgcbg/limo-qwen3-8b-math-full-precision_v3 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Cbgcbg/limo-qwen3-8b-math-full-precision_v3"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Cbgcbg/limo-qwen3-8b-math-full-precision_v3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Cbgcbg/limo-qwen3-8b-math-full-precision_v3
How to use Cbgcbg/limo-qwen3-8b-math-full-precision_v3 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Cbgcbg/limo-qwen3-8b-math-full-precision_v3" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Cbgcbg/limo-qwen3-8b-math-full-precision_v3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "Cbgcbg/limo-qwen3-8b-math-full-precision_v3" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Cbgcbg/limo-qwen3-8b-math-full-precision_v3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Cbgcbg/limo-qwen3-8b-math-full-precision_v3 with Docker Model Runner:
docker model run hf.co/Cbgcbg/limo-qwen3-8b-math-full-precision_v3
Full-precision (bfloat16) merged model trained with LIMO methodology for mathematical reasoning.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model
model = AutoModelForCausalLM.from_pretrained(
"Cbgcbg/limo-qwen3-8b-math-full-precision_v3",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"Cbgcbg/limo-qwen3-8b-math-full-precision_v3",
trust_remote_code=True
)
# Example usage
messages = [
{"role": "user", "content": "Solve: 2x + 3 = 11"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
do_sample=True
)
response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
print(response)
| Model | Size | Precision | Performance |
|---|---|---|---|
| Original Gasing-8B | 15.26 GB | Full | ✅ Baseline |
| Previous LIMO (quantized) | 5.55 GB | 4-bit | ❌ Degraded |
| This LIMO (full precision) | ~16 GB | bfloat16 | ✅ Expected +2-4% |
This model was trained using the LIMO methodology, which demonstrates that high-quality mathematical reasoning can be achieved with minimal but carefully curated training data (817 samples vs typical 100k+ datasets).
Key improvements:
If you use this model, please cite the LIMO paper:
@misc{ye2025limo,
title={LIMO: Less is More for Reasoning},
author={Yixin Ye and Zhen Huang and Yang Xiao and Ethan Chern and Shijie Xia and Pengfei Liu},
year={2025},
eprint={2502.03387},
archivePrefix={arXiv},
primaryClass={cs.CL}
}