Hecto: Modular Sparse Experts for Adaptive and Interpretable Reasoning
Paper
β’
2506.22919
β’
Published
Hecto is a lightweight, interpretable Mixture-of-Experts (MoE) architecture combining:
These experts are gated by a sparse, learnable Top-1 router conditioned on the [CLS] token embedding.
distilbert-base-uncased)256 β 128 β 4, Tanh activation)256 β 128 β 4)| Detail | Value |
|---|---|
| Dataset | AG News (5k sampled) |
| Loss Function | Cross-Entropy + Entropy + Diversity |
| Optimizer | AdamW |
| Epochs | 5 |
| Batch Size | 16 |
| Learning Rate | 2e-5 |
| Seeds Used | [0, 1, 2] (averaged) |
| Metric | Value |
|---|---|
| Accuracy | 90.02% |
| F1 Score | 89.91% |
| Inference Time | 0.0083 sec/sample |
| Expert Usage | FFNN = 20.1%, GRU = 79.9% |
The model routes the majority of samples to the GRU expert, especially for classes like "Sports" and "Sci/Tech". This suggests stronger reliance on sequential reasoning across AG News categories.
pytorch_model.bin: Model weightsconfig.json: Custom MoE architecture configtokenizer_config.json, tokenizer.json, vocab.txt, special_tokens_map.json: Tokenizer files (DistilBERT)from transformers import AutoTokenizer
from your_model_file import Hecto # Replace with your local Hecto class definition
import torch
from torch.nn.functional import softmax
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("ruhzi/hecto-ffnn-gru")
# Reconstruct the model architecture
model = Hecto("ff", "gru", frozen=False)
model.load_state_dict(torch.load("pytorch_model.bin"))
model.eval()
# Tokenize input
inputs = tokenizer("NASA launches new satellite to study space weather.", return_tensors="pt")
# Run inference
with torch.no_grad():
logits, _, gate_probs = model(**inputs)
probs = softmax(logits, dim=-1)
print("Predicted class:", probs.argmax().item())
print("Gate routing probabilities:", gate_probs)
Note:
Hectois a custom model and must be defined in your environment before loading weights.
To make your model easily reusable, consider including amodeling_hecto.pyfile in your repository.
If you use this model or architecture in your research, please cite:
@article{pandey2025hecto,
title = {Hecto: Modular Sparse Experts for Adaptive and Interpretable Reasoning},
author = {Pandey, Sanskar and Chopra, Ruhaan and Bhat, Saad Murtaza and Abhyudaya, Ark},
journal = {arXiv preprint arXiv:2506.22919},
year = {2025},
month = {June},
note = {Version 1 submitted June 28, 2025; version 2 updated July 1, 2025}
}