How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="amayuelas/Qwen3.5-4B-MatRL-MT-SFT")
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("amayuelas/Qwen3.5-4B-MatRL-MT-SFT")
model = AutoModelForMultimodalLM.from_pretrained("amayuelas/Qwen3.5-4B-MatRL-MT-SFT", 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]:]))
Quick Links

Qwen3.5-4B — MatRL multi-turn SFT (cold start)

Qwen/Qwen3.5-4B cold-started on amayuelas/matrl-sft-mt: 1,123 multi-turn tool-use episodes for crystal-structure inverse design.

This is the cold-start checkpoint. Its job is format and the tool loop — propose, evaluate, refine, and above all commit within the turn budget. The chemistry is learned afterwards by RL; see amayuelas/Qwen3.5-4B-MatRL-MT-RL.

Why a cold start is needed

The base model essentially never commits. Across 2,880 multi-turn rollouts it made 3 submit calls — it proposes prolifically (~5.6 candidates/rollout) and evaluates sparingly, then runs out of turns. Strict multi-turn SUN is therefore 0% by construction: a commitment failure, not a chemistry failure. Teaching the agent to close an episode is precisely what this stage installs.

Training

base Qwen/Qwen3.5-4B
data 1,123 episodes, assistant-only loss
steps 423 (3 epochs), global batch 8
seq len 16,384
optimizer AdamW, lr 2e-5, constant
precision bf16
parallelism FSDP + context parallel (cp=2, ulysses)
trainer prime-rl

Trained on 4×A100-40GB. Final loss ~0.36.

Context parallelism uses ulysses, not ring: Qwen3.5 is a hybrid with linear attention (DeltaNet) layers, and ring attention is a softmax-attention algorithm that does not apply to them.

Important: thinking channel

This model is trained with reasoning in the native thinking channel (reasoning_content → <think>), preserved across tool calls. Do not evaluate it with enable_thinking=false — that disables exactly the behavior this run trains.

Serving

Qwen3.5 is a VL-capable model class, so vLLM requires an image-processor config even for text-only serving. preprocessor_config.json and video_preprocessor_config.json are included; without them vLLM fails on load.

Downloads last month
25
Safetensors
Model size
5B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for amayuelas/Qwen3.5-4B-MatRL-MT-SFT

Finetuned
Qwen/Qwen3.5-4B
Finetuned
(903)
this model
Finetunes
1 model

Dataset used to train amayuelas/Qwen3.5-4B-MatRL-MT-SFT