Instructions to use PJiNH/QFFT-repro-LIMO-QFFT-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PJiNH/QFFT-repro-LIMO-QFFT-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PJiNH/QFFT-repro-LIMO-QFFT-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PJiNH/QFFT-repro-LIMO-QFFT-7B") model = AutoModelForCausalLM.from_pretrained("PJiNH/QFFT-repro-LIMO-QFFT-7B", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PJiNH/QFFT-repro-LIMO-QFFT-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PJiNH/QFFT-repro-LIMO-QFFT-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PJiNH/QFFT-repro-LIMO-QFFT-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PJiNH/QFFT-repro-LIMO-QFFT-7B
- SGLang
How to use PJiNH/QFFT-repro-LIMO-QFFT-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "PJiNH/QFFT-repro-LIMO-QFFT-7B" \ --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": "PJiNH/QFFT-repro-LIMO-QFFT-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "PJiNH/QFFT-repro-LIMO-QFFT-7B" \ --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": "PJiNH/QFFT-repro-LIMO-QFFT-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PJiNH/QFFT-repro-LIMO-QFFT-7B with Docker Model Runner:
docker model run hf.co/PJiNH/QFFT-repro-LIMO-QFFT-7B
QFFT-repro-LIMO-QFFT-7B
This is the LIMO / QFFT model from QFFT: Question-Free Fine-Tuning for Adaptive Reasoning (Liu et al., 2025, arXiv:2506.12860), trained independently to reproduce the paper.
It is not the authors' checkpoint.
It is not affiliated with or endorsed by the QFFT authors, Qwen / Alibaba Cloud, or the dataset authors.
Code, training configs, data notices, evaluation outputs and research notes: https://github.com/RomEscape/Research-Question_Free-
Base model: Qwen/Qwen2.5-7B-Instruct (Apache-2.0). These weights are a full fine-tune of that model, so they are a modified version of it.
SFT baseline trained on the same responses with questions: PJiNH/QFFT-repro-LIMO-SFT-7B
Training
| Item | Value |
|---|---|
| Method | QFFT. Each example is the response only, with no system prompt and no question. The loss is on the response (LLaMA-Factory template qwen_qfft). |
| Data | limo_data_qfft.json: lwl-uestc/LIMO_QFFT, the 817 GAIR/LIMO responses without questions |
| Framework | LLaMA-Factory (bundled in the GitHub repository), full fine-tuning, bf16 |
| Hyperparameters | cutoff length 16,384; 6 epochs; learning rate 1e-5 with a cosine schedule and warmup ratio 0.1; batch size 1 with gradient accumulation 8 (effective 8); weight decay 1e-4; seed 42 |
| Hardware | 1 × NVIDIA RTX PRO 6000 Blackwell; DeepSpeed ZeRO-2 with CPU optimizer offload; SDPA attention |
| Config | LLaMA-Factory/examples/train_qfft/train_limo_qfft.yaml |
| Final train loss / runtime | 0.3503 / 21,057 s |
The training data is byte-identical to the authors' release (lwl-uestc/LIMO_QFFT). The hyperparameters above match the paper's Table 5 and the values recorded in the authors' released QFFT checkpoints.
Known differences from the original setup:
- GPU count and loss grouping: we used 1 GPU with gradient accumulation 8. The paper gives the batch size (8) but not the GPU count. The authors' released checkpoints record gradient accumulation 2, so the loss is normalized over different micro-batch groups.
- Step count: we took 618 optimizer steps (6 full epochs). The authors' LIMO checkpoint records 612.
- Attention and DeepSpeed: SDPA instead of FlashAttention-2, and DeepSpeed ZeRO-2 with CPU optimizer offload instead of ZeRO-3 from the upstream config.
- Library versions: transformers 4.52.1 and PyTorch 2.13, newer than the authors' checkpoints (transformers 4.51.0, PyTorch 2.6).
Evaluation (this reproduction)
Settings follow the released eval/eval.sh:
- Qwen chat template with the system prompt "Please reason step by step, and put your final answer within \boxed{}." The paper's Figure 8 writes
$\boxed{}$; the released code, used here, has no$. - temperature 0.6, top-p 1.0, at most 32,000 new tokens, 16 samples per problem, one vLLM 0.11.0 engine on one GPU.
The paper text states a 32,768-token budget; the released code uses 32,000. The table columns are:
- Acc: accuracy averaged over the 16 samples.
- Tokens: mean generated length.
- RAK: the paper's Definition 2, with Qwen2.5-7B-Instruct as the reference, averaged over the 16 runs.
| Benchmark | Acc | Tokens | RAK | Paper (Acc / Tokens / RAK) |
|---|---|---|---|---|
| GSM8K | 86.1 | 0.8K | 22.3 | 88.0 / 0.7K / 26.7 |
| MATH500 | 80.3 | 4.6K | 39.0 | 80.6 / 4.1K / 40.1 |
| AIME25 | 15.4 | 18.1K | 19.9 | 17.2 / 15.6K / 34.2 |
| Average | 60.6 | 7.9K | 27.1 | 61.9 / 6.8K / 33.7 |
Usage
The model is prompted in the normal chat format, as in the evaluation above.
from vllm import LLM, SamplingParams
llm = LLM(model="PJiNH/QFFT-repro-LIMO-QFFT-7B")
tok = llm.get_tokenizer()
messages = [
{"role": "system", "content": "Please reason step by step, and put your final answer within \\boxed{}."},
{"role": "user", "content": "What is the sum of the first 50 positive odd integers?"},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
out = llm.generate([prompt], SamplingParams(temperature=0.6, top_p=1.0, max_tokens=32000))
print(out[0].outputs[0].text)
License and data terms
- Weights: Apache-2.0, inherited from Qwen2.5-7B-Instruct. The
LICENSEfile in this repository carries the original notice, Copyright 2024 Alibaba Cloud. The change is the full fine-tuning described above. - Training data:
- lwl-uestc/LIMO_QFFT (Apache-2.0).
- It is derived from GAIR/LIMO, Apache-2.0 per its dataset card (the LIMO project README says MIT). Please cite LIMO (Ye et al., 2025, arXiv:2502.03387).
- According to the LIMO paper, the reasoning traces were produced with DeepSeek-R1 and other models.
- Full notices:
THIRD_PARTY_NOTICES.mdin the GitHub repository.
Citation
Please cite the QFFT paper (arXiv:2506.12860) and the LIMO paper (arXiv:2502.03387).
- Downloads last month
- 351