Instructions to use metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R") model = AutoModelForMultimodalLM.from_pretrained("metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R
- SGLang
How to use metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R 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 "metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R" \ --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": "metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R", "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 "metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R" \ --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": "metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R with Docker Model Runner:
docker model run hf.co/metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R
Qwen3.5-4B-MBT-R
Qwen/Qwen3.5-4B-Base fine-tuned on traces edited by MBT-R: the editor rewrites the whole trace in one call. It accompanies the paper "Distilling Metacognitive Behaviors through Agentic Editing" (anonymous submission).
| Model | Training data |
|---|---|
| Qwen3.5-4B-Unedited-SFT | Unedited teacher traces |
| Qwen3.5-4B-MBT-R | MBT-R (rewrite) |
| Qwen3.5-4B-MBT-I | MBT-I (insert) |
| Qwen3.5-4B-MBT-A | MBT-A (agentic) |
Training data: built from the traces in
metacognitive-behavioral-tuning/mbt-traces.
Code and prompts:
GitHub.
Usage
The chat template that ships with the model opens a <think> block, so the generated text is the
reasoning, then </think> and the answer. End the question with the instruction used in training:
from vllm import LLM, SamplingParams
llm = LLM("metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R")
question = "Find the remainder when 2^100 is divided by 7."
prompt = question + "\n\nPlease reason step by step, and put your final answer within \\boxed{}."
params = SamplingParams(temperature=1.0, top_p=0.95, max_tokens=122880)
out = llm.chat([{"role": "user", "content": prompt}], params)
print(out[0].outputs[0].text)
The weights are bf16. Long answers are common, so leave room for tens of thousands of tokens.
Training
| Setting | Value |
|---|---|
| Base model | Qwen/Qwen3.5-4B-Base |
| Method | Full-parameter supervised fine-tuning, loss on assistant tokens only |
| Epochs | 15 |
| Optimizer | Muon (Megatron implementation), learning rate 1e-5, weight decay 0 |
| Schedule | Constant with 40 warmup steps |
| Global batch | 64 sequences (8 GPUs x 8 accumulation steps), padding-free packing |
| Maximum length | 131,072 tokens |
| Precision | bf16 autocast with fp32 master weights; released in bf16 |
License
Apache-2.0, following the base model. The training data is CC BY-SA 4.0; see the dataset card for upstream attribution.
Citation
@misc{mbt2026,
title = {Distilling Metacognitive Behaviors through Agentic Editing},
author = {Anonymous},
year = {2026},
note = {Under review}
}
- Downloads last month
- 202
Model tree for metacognitive-behavioral-tuning/Qwen3.5-4B-MBT-R
Base model
Qwen/Qwen3.5-4B-Base