Instructions to use PyrrhicEval/BareTorch-Qwen3.5-4B-Hybrid-Router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PyrrhicEval/BareTorch-Qwen3.5-4B-Hybrid-Router with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="PyrrhicEval/BareTorch-Qwen3.5-4B-Hybrid-Router", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PyrrhicEval/BareTorch-Qwen3.5-4B-Hybrid-Router", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
BareTorch-Qwen3.5-4B-Hybrid-Router
A router model. It does not answer the prompt.
Its only job is to emit a single continuous easiness score in [0, 1] (higher = easier) so an orchestrator can send easy prompts to a cheap model and hard prompts to a stronger one.
This router uses BareTorch-Qwen3.5-4B-Hybrid model found in this repository : https://huggingface.co/model-rampage/BareTorch-Qwen3.5-4B-Hybrid
The pretrained backbone is part of the Baretorch line of models produced by Model Rampage.
Due to the novel architecture of the Baretorch family of models - which you can read more about on their website (https://www.model-rampage.com/)
- it is able to ingest long context prompts extremely quickly.
This makes it the perfect choice for a router.
Architecture
- Backbone: BareTorch-Qwen3.5-4B-Hybrid (32 layers, d_model=2560, hybrid CS-LRAD + full attention)
- Training: Full-weight fine-tuning in bf16 (no LoRA)
- Head: Last-token pooling โ Dropout(0.1) โ Linear(2560 โ 1) โ sigmoid
- Sequence length: 1536 (beginning + end kept when truncating)
- Position IDs: Explicit M-RoPE-style
position_idsof shape(3, batch, seq)
Input
Single user prompt wrapped in the modelโs chat template.
Output
Exactly one scalar in [0, 1]:
The closer to a perfect score of one, the more likely the example is to be easy.
The model is most accurate in the range from ~0.45 to 1.00. South of that, it begins to misclassify the difficulty of examples.
This is likely because easier examples are often less complex. It is an easy task to determine the easiness of an example, because the domain knowledge needed to understand a simple example is generally low, whereas a more complex example requires more domain knowledge and is likely too difficult for the model to understand.
In any case this model is meant as a device to measure the easiness of an example but fails to properly measure the difficulty of an example. It should be used to determine easiness only.
Usage
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}")
Training
- Data: RouterBench oracle labels + teacher pseudo labels (pseudo-only run)
- Loss:
BCEWithLogitsLoss - Best checkpoint: step 6500, RouterArena top-20% easiness accuracy 0.8945
Evaluation
Model was evaluated on the full RouterArena evaluation dataset of 8400 examples. It was evaluated using the accuracy scores from anthropic/claude-haiku-5.5, deepseek/deepseek-v4-flash and google/gemini-3.7-flash. The accuracy scores are computed using the code in the RouterArena repository, along with custom code for statistical analysis. You can find out more about the accuracy metric by looking at the RouterArena repository here : https://github.com/RouteWorks/RouterArena.
The results can be seen in the tables below.
While the model fails in the task of grouping the hardest examples at the bottom of the distribution, it succeeds in pushing the easy examples to the top. We get good scores at the .9, .8, .7 percent cutoffs and even slightly lower.
Pay close attention to the 'overall avg accuracy' of each model. This will show you how well the model does without the use of a router.
Citation
@article{kovacevic2026baretorch,
title={BareTorch: Challenging State-of-The-Art Sequence Mixing Topologies via Kernel-Free, Pure GEMM-Compliant Architectures},
author={Kovacevic Buvinic, Martin Ignacio},
year={2026},
url={https://github.com/martin-kbcc/baretorch}
}
- Downloads last month
- 4
Model tree for PyrrhicEval/BareTorch-Qwen3.5-4B-Hybrid-Router
Base model
Qwen/Qwen3.5-4B-Base

