BareTorch-Qwen3.5-4B-Hybrid-Router
LLM complexity router
2 min read
This model does not answer user prompts; instead, it solves a supporting task: it evaluates the complexity of incoming requests on a scale from 0 to 1. Created on the basis of the 4-billion-parameter BareTorch-Qwen3.5-4B-Hybrid architecture, the router outputs a scalar easiness score (where close to 1 is a trivial task for a weak model, and close to 0 is a complex one). The tool will be useful for developers and infrastructure engineers who build cascading pipelines and want to save resources by routing simple requests to cheap models and complex ones to flagship LLMs.
Key features
- Specialized task: outputs a continuous easiness score in the range from 0 to 1.
- Hybrid backbone: built on a 4B model with 32 layers and hybrid attention (CS-LRAD + full attention).
- Routing accuracy: achieves 0.8945 accuracy on the top 20% of prompts on the RouterArena benchmark.
- Efficient training: trained via full fine-tuning in bf16 format using BCEWithLogitsLoss.
What you can do
- API optimization: set up automatic distribution of incoming user requests in an AI service between lightweight and heavy models.
- Token savings: reduce inference costs by redirecting simple tasks to compact local LLMs.
- Load monitoring: analyze the complexity of the incoming request stream in real time.
Example
import torch
from transformers import AutoTokenizer, AutoModel
model_id = "PyrrhicEval/BareTorch-Qwen3.5-4B-Hybrid-Router"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModel.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
).eval()
prompt = "What is 2 + 2?"
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=1536)
with torch.inference_mode():
out = model(**inputs)
easiness = out["easiness"].item()
print(f"Easiness: {easiness:.4f}")
Read more
DetailsBackbone: BareTorch-Qwen3.5-4B-Hybrid (32 layers, hidden size 2560)
Sequence length limit: 1536 tokens
Dataset: RouterBench oracle labels + teacher pseudo labels
Best checkpoint: step 6500 (RouterArena top-20% accuracy 0.8945)










Comments