SwAP-7B-theta0.1
a language model for concise reasoning
2 min readupdated
Trained using the SwAP method (Stepwise Penalization for Length-Efficient Chain-of-Thought Reasoning, introduced in a NeurIPS 2026 paper), this model trims Chain-of-Thought sequences (its internal reasoning steps) by penalizing excess length based on each step's importance. It builds on deepseek-ai/DeepSeek-R1-Distill-Qwen-7B (7.62B parameters) fine-tuned on math problems via the GRPO algorithm. Outputs are nearly twice as fast and require far fewer tokens while matching the base model's accuracy on hard benchmarks—making it a practical choice for researchers and developers optimizing LLM reasoning efficiency.
Key features
- Built on DeepSeek-R1-Distill-Qwen-7B using the GRPO algorithm and the SwAP method.
- Fine-tuned on the DeepScaleR dataset (40K competition-level math problems).
- Cuts average response length on complex problems from 8,102 down to 4,970 tokens.
- Maintains strong accuracy on benchmarks like MATH-500 and GPQA-Diamond.
What you can do
- Run math reasoning inference through vllm with shorter output lengths.
- Deploy it in bots and services that solve complex problems where speed and token efficiency matter.
- Use it as a baseline for experimenting with Chain-of-Thought length optimization.
Example
Sample inference setup for solving math problems with vllm:
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
model = "Kaylee0501/SwAP-7B-theta0.1"
tok = AutoTokenizer.from_pretrained(model)
question = "What is the sum of all positive divisors of 36?"
prompt = tok.apply_chat_template(
[{"role": "user", "content": question + " Let's think step by step and output the final answer within \\boxed{}."}],
tokenize=False, add_generation_prompt=True)
llm = LLM(model=model)
out = llm.generate([prompt], SamplingParams(temperature=0.8, top_p=0.95, max_tokens=16384))
print(out[0].outputs[0].text)Read more
DetailsMetrics and training:
• Average response length dropped from 8,102 to 4,970 tokens with comparable average accuracy (64.5% vs. 64.8%).
• Benchmark scores: 93.5% on MATH-500, 49.5% on GPQA-Diamond.
• Training framework: verl.










Comments