Qwen3.5-4B TraceVerse Distilled v2
On-policy knowledge distillation from a domain-adapted Qwen3.5-9B-SFT teacher into a 4B student. This is the second iteration -- v1 used a generic 9B teacher, v2 uses an SFT'd teacher that understands trace analysis formats.
Model Details
| Attribute | Value |
|---|---|
| Student base | kshitijthakkar/qwen3.5-4b-traceverse-distill (distill v1) |
| Teacher | kshitijthakkar/qwen3.5-9b-traceverse-sft (domain-adapted) |
| Parameters | 4.2B |
| Distillation method | TRL DistillationTrainer (on-policy, reverse KL) |
| Training samples | 500 (50 per environment x 10 core types) |
| Distillation config | lmbda=0.5, beta=1.0, loss_top_k=5 |
| Final train loss | 0.26 (vs 1.52 for v1 with generic teacher) |
| On-policy loss | 0.47 (vs 0.75 for v1) |
| Hardware | NVIDIA H100 PCIe 80GB |
| Training time | 48 min |
Why v2 is Better Than v1
| Metric | Distill v1 (generic 9B) | Distill v2 (SFT'd 9B) |
|---|---|---|
| Train loss | 1.52 | 0.26 (6x lower) |
| On-policy loss | 0.75 | 0.47 (37% lower) |
| Teacher | Generic Qwen3.5-9B | Domain-adapted 9B-SFT |
The generic teacher penalized domain-specific trace analysis outputs because it didn't understand the format. The SFT'd teacher provides meaningful logprob signal.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"kshitijthakkar/qwen3.5-4b-traceverse-distill-v2",
torch_dtype="bfloat16", device_map="auto", trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("kshitijthakkar/qwen3.5-4b-traceverse-distill-v2")
Training Pipeline
Qwen3.5-4B (base)
-> SFT warmup (10,463 examples, 3 epochs) = qwen3.5-4b-traceverse-sft
-> Distill v1 (generic 9B teacher, 2300 samples) = qwen3.5-4b-traceverse-distill
-> Distill v2 (SFT'd 9B teacher, 500 samples) = this model
GGUF Quantized Versions
Pre-quantized GGUF files for llama.cpp, Ollama, and other GGUF-compatible runtimes:
| File | Size | Bits/Weight | Use Case |
|---|---|---|---|
qwen3.5-4b-distill-v2-f16.gguf | 8.4 GB | 16.00 | Full precision, no quality loss |
qwen3.5-4b-distill-v2-Q8_0.gguf | 4.3 GB | 8.51 | High quality |
qwen3.5-4b-distill-v2-Q4_K_M.gguf | 2.6 GB | 5.13 | Best quality/size, recommended |
Run with Ollama
# Download Q4_K_M (recommended, 2.6GB)
huggingface-cli download kshitijthakkar/qwen3.5-4b-traceverse-distill-v2 \
qwen3.5-4b-distill-v2-Q4_K_M.gguf --local-dir .
# Create Modelfile
cat > Modelfile << 'MEOF'
FROM ./qwen3.5-4b-distill-v2-Q4_K_M.gguf
PARAMETER temperature 0.7
PARAMETER num_ctx 4096
SYSTEM You are a helpful AI assistant specialized in analyzing OpenTelemetry trace data from the genai-otel-instrument library.
MEOF
# Create and run model
ollama create traceverse-4b -f Modelfile
ollama run traceverse-4b "Analyze this trace: service=api-gateway, duration_ms=2450, spans=12"
Run with llama.cpp
llama-cli -m qwen3.5-4b-distill-v2-Q4_K_M.gguf \
-p "Analyze this OpenTelemetry trace for performance issues:" \
-n 512 --temp 0.7
Related
- LoRA adapter: kshitijthakkar/qwen3.5-4b-traceverse-distill-v2-lora
- Teacher: kshitijthakkar/qwen3.5-9b-traceverse-sft
- Eval results: TraceVerse-RL-Eval-Inference (subset: qwen3.5_4b_distill_v2)
License
Apache 2.0
Benchmark Results — TraceVerse-RL-Eval-Golden
Judged by lightning-ai/gpt-oss-120b on 436 examples across 4 dimensions (1-10 scale).
| Overall | Accuracy | Completeness | Format | Grounding |
|---|---|---|---|---|
| 5.24 | 5.42 | 5.06 | 3.78 | 6.03 |
Per-environment
| Environment | N | Overall |
|---|---|---|
| cloud_incident_response | 6 | 8.5 |
| incident_ops | 6 | 7.53 |
| soc_triage_gym | 6 | 6.13 |
| quality_evaluator | 22 | 6.0 |
| agent_scorer | 60 | 5.67 |
| tool_orchestrator | 86 | 5.48 |
| orchestration_planner | 46 | 5.27 |
| trace_classifier | 120 | 5.18 |
| deep_investigator | 18 | 4.14 |
| report_generator | 66 | 4.06 |
See full per-sample scores at kshitijthakkar/TraceVerse-RL-Eval-Inference.