SafeRoute routers

Trained routers of SafeRoute (ACL 2025 Findings). A router is a small Bayesian MLP (2048 → 512 → 512 → 1) on the last-layer, last-token hidden state of meta-llama/Llama-Guard-3-1B. It decides, per input, whether to use the larger safety guard model instead of the 1B model. Code: https://github.com/seanie12/safe-route

Folder Larger model Avg. safety F1 (6 benchmarks) Routed to larger model
llama-guard-3-8b/seed{0..4} meta-llama/Llama-Guard-3-8B 0.755 ± 0.001 19.7%
granite-guardian-3-8b/seed{0..4} ibm-granite/granite-guardian-3.0-8b 0.771 ± 0.002 19.1%

Mean ± std over the five seeds, as reported in arXiv v6 (corrected results). Each folder has model.safetensors (the BNN state dict in models.py) and config.json. Training data: dongboklee/SafeRoute-data.

Usage

With the code repository, download a router and evaluate it on the six benchmarks. --version is the larger model, llama-guard-3-8b or granite-guardian-3-8b.

python download.py router --version llama-guard-3-8b --seed 0    # writes save/llama-guard-3-8b/seed0/model.pt
python eval.py --version llama-guard-3-8b --seed 0               # writes results/<benchmark>/llama-guard-3-8b/seed0/ours.json

The paper reports the mean over the five seeds:

for seed in 0 1 2 3 4; do
  python download.py router --version granite-guardian-3-8b --seed $seed
  python eval.py --version granite-guardian-3-8b --seed $seed
done

eval.py runs Llama-Guard-3-1B and the larger model, so you need access to those models on the Hub.

License

The router weights are released under the MIT License. The guard models they are used with have their own licenses: Llama-Guard-3-1B (Llama 3.2 Community License), Llama-Guard-3-8B (Llama 3.1 Community License) and Granite-Guardian-3.0-8B (Apache 2.0).

Citation

@inproceedings{lee2025saferoute,
  title={SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Models},
  author={Lee, Seanie and Lee, Dong Bok and Wagner, Dominik and Kang, Minki and Seong, Haebin and Bocklet, Tobias and Lee, Juho and Hwang, Sung Ju},
  booktitle={Findings of the Association for Computational Linguistics: ACL 2025},
  year={2025}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for dongboklee/SafeRoute-router

Finetuned
(10)
this model

Paper for dongboklee/SafeRoute-router