Instructions to use MMOPD/Qwen3-4B-OT3-if with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MMOPD/Qwen3-4B-OT3-if with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MMOPD/Qwen3-4B-OT3-if") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MMOPD/Qwen3-4B-OT3-if") model = AutoModelForCausalLM.from_pretrained("MMOPD/Qwen3-4B-OT3-if", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MMOPD/Qwen3-4B-OT3-if with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MMOPD/Qwen3-4B-OT3-if" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MMOPD/Qwen3-4B-OT3-if", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MMOPD/Qwen3-4B-OT3-if
- SGLang
How to use MMOPD/Qwen3-4B-OT3-if 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 "MMOPD/Qwen3-4B-OT3-if" \ --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": "MMOPD/Qwen3-4B-OT3-if", "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 "MMOPD/Qwen3-4B-OT3-if" \ --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": "MMOPD/Qwen3-4B-OT3-if", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MMOPD/Qwen3-4B-OT3-if with Docker Model Runner:
docker model run hf.co/MMOPD/Qwen3-4B-OT3-if
Qwen3-4B-OT3-if (instruction-following teacher, RL)
Qwen3-4B-OT3-if is the instruction-following (IF) teacher of the MMOPD study: MMOPD/Qwen3-4B-OT3-2ep trained with
GRPO reinforcement learning on prompts with verifiable formatting / content constraints (IFEval-style instruction ids with
programmatic checkers). It raises IFEval from 51.0 to 79.1 and IFBench from 27.7 to 58.7 while keeping math and code
performance.
Training
| init | MMOPD/Qwen3-4B-OT3-2ep |
| RL | GRPO (NeMo-RL 0.7), 200 steps, 64 prompts x 8 samples per step, LR 3e-6, no KL penalty, 32,768-token rollouts at temperature 1.0 |
| reward | all verifiable instructions of the prompt satisfied (IFEval instruction registry checkers on the post-thinking answer) |
| pool | 11,728 prompts from the Nemotron RL instruction-following data (verifiable-instruction slice), decontaminated against IFEval / IFBench |
| checkpoint | RL step 200 |
Evaluation
Domain benchmarks (temperature 1.0, top-p 1.0, long generation budget; accuracy in %):
| Model | MedQA | MedXpertQA | PubMedQA | CaseHOLD | FinQA | TAT-QA (EM) |
|---|---|---|---|---|---|---|
| Qwen3-4B-OT3-if (this) | 70.9 | – | – | 58.4 | 58.6 | – |
| Qwen3-4B-OT3-2ep (student init) | 69.8 | 13.7 | 75.2 | 63.2 | 58.3 | 24.4 |
General benchmarks (Qwen3 thinking preset: temperature 0.6, top-p 0.95, top-k 20; 32,768 max new tokens; AIME = avg@8, LiveCodeBench v6 / IFEval / IFBench = 1 sample; scores in %):
| Model | AIME24 | AIME25 | AIME26 | LiveCodeBench v6 | IFEval | IFBench |
|---|---|---|---|---|---|---|
| Qwen3-4B-OT3-if (this) | 59.2 | 52.5 | 59.2 | 51.4 | 79.1 | 58.7 |
| Qwen3-4B-OT3-2ep (student init) | 66.3 | 56.3 | 58.3 | 51.7 | 51.0 | 27.7 |
Notes
- Weights are stored in bfloat16 (cast from the fp32 training master weights; this is the precision in which the teacher was evaluated and served). Apache-2.0.
- Domain scores are measured at temperature 1.0 because that is the sampling regime in which these models serve as distillation teachers; general benchmarks use the Qwen3 thinking preset.
- Part of the MMOPD model family together with
MMOPD/Qwen3-4B-OT3-{1ep,2ep},MMOPD/Qwen3-1.7B-OT3-{1ep,2ep}and the other domain teachersMMOPD/Qwen3-4B-OT3-{medical,law,finance,if}.
How to use
The models keep the Qwen3 chat template and thinking format (<think> ... </think> before the answer). Use
enable_thinking=True and sampling (not greedy); the evaluations below used a 32k-token generation budget.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "MMOPD/Qwen3-4B-OT3-if"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Write a product description for a reusable water bottle in exactly three paragraphs, without using the letter z, and end with the phrase 'Stay hydrated.'"}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
out = model.generate(**tok(text, return_tensors="pt").to(model.device), max_new_tokens=32768,
do_sample=True, temperature=0.6, top_p=0.95, top_k=20)
print(tok.decode(out[0], skip_special_tokens=True))
vLLM: vllm serve MMOPD/Qwen3-4B-OT3-if --max-model-len 40960 (the same sampling settings apply).
- Downloads last month
- 33