When-Does-Reasoning-Matter/math-reasoning-ift-pairs
Viewer • Updated • 458k • 577 • 8
How to use When-Does-Reasoning-Matter/Qwen2.5-3B-ift with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="When-Does-Reasoning-Matter/Qwen2.5-3B-ift")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("When-Does-Reasoning-Matter/Qwen2.5-3B-ift")
model = AutoModelForCausalLM.from_pretrained("When-Does-Reasoning-Matter/Qwen2.5-3B-ift")
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 When-Does-Reasoning-Matter/Qwen2.5-3B-ift with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "When-Does-Reasoning-Matter/Qwen2.5-3B-ift"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "When-Does-Reasoning-Matter/Qwen2.5-3B-ift",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/When-Does-Reasoning-Matter/Qwen2.5-3B-ift
How to use When-Does-Reasoning-Matter/Qwen2.5-3B-ift with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "When-Does-Reasoning-Matter/Qwen2.5-3B-ift" \
--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": "When-Does-Reasoning-Matter/Qwen2.5-3B-ift",
"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 "When-Does-Reasoning-Matter/Qwen2.5-3B-ift" \
--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": "When-Does-Reasoning-Matter/Qwen2.5-3B-ift",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use When-Does-Reasoning-Matter/Qwen2.5-3B-ift with Docker Model Runner:
docker model run hf.co/When-Does-Reasoning-Matter/Qwen2.5-3B-ift
This model was trained as part of the paper When Does Reasoning Matter? It belongs to a collection of General and Math-specific student models distilled from Instruction-Fine-Tuned (IFT) or Reasoning answers generated by Qwen/Qwen3-235B-A22B.
These models were trained on the largest set of IFT and Reasoning answer pairs:
If you use this dataset in your work, please cite: When Does Reasoning Matter?
@misc{boizard2025doesreasoningmattercontrolled,
title={When Does Reasoning Matter? A Controlled Study of Reasoning's Contribution to Model Performance},
author={Nicolas Boizard and Hippolyte Gisserot-Boukhlef and Kevin El-Haddad and Céline Hudelot and Pierre Colombo},
year={2025},
eprint={2509.22193},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.22193},
}