SwarmFormer
Collection
Our collection of our frontier SwarmFormer architecture models.
•
2 items
•
Updated
•
2
SwarmFormer-Small is a lightweight variant of the SwarmFormer architecture, designed for efficient text classification with minimal computational requirements.
Compact version of SwarmFormer with:
Token embedding layer with dropout (0.3)
Two SwarmFormer layers
Mean pooling and classification
Optimized for shorter sequences
Developed by: Jordan Legg, Mikus Sturmanis, Takara.ai
Funded by: Takara.ai
Shared by: Takara.ai
Model type: Hierarchical transformer
Language(s): English
License: Not specified
Finetuned from model: Trained from scratch
Token Embedding Layer:
- Embedding layer (vocab_size → 128)
- Dropout rate: 0.3
Local Swarm Aggregator:
- Input dropout: 0.3
- Local MLP:
- Linear(128 → 128)
- GELU
- Dropout(0.3)
- Linear(128 → 128)
- Gate network with GELU
Clustering Mechanism:
Global Cluster Attention:
- Q/K/V projections: Linear(128 → 128)
- Attention dropout: 0.3
from swarmformer import SwarmFormerModel
model = SwarmFormerModel(
vocab_size=30000,
d_model=128,
seq_len=256,
cluster_size=8,
num_layers=2,
T_local=3
)
@article{legg2025swarmformer,
title={SwarmFormer: Local-Global Hierarchical Attention via Swarming Token Representations},
author={Legg, Jordan and Sturmanis, Mikus and {Takara.ai}},
journal={Takara.ai Research},
year={2025},
url={https://takara.ai/papers/SwarmFormer-Local-Global-Hierarchical-Attention-via-Swarming-Token-Representations.pdf}
}
Jordan Legg, Mikus Sturmanis, Takara.ai Research Team