Instructions to use scairesearch/bertbm-aegnn_only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scairesearch/bertbm-aegnn_only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="scairesearch/bertbm-aegnn_only", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("scairesearch/bertbm-aegnn_only", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
BertBM π aegnn
Transformers only look at tokens. BertBM looks at structure.
BertBM bolts a whole geometry lab onto ModernBERT: Fourier transforms for the rhythm of language, graph networks for who-talks-to-whom, an event-driven graph that skips the parts that didn't change, and a PoincarΓ© manifold where the latents actually live on a curved surface.
β‘ Highlights
| BertBM | ModernBERT-base | |
|---|---|---|
| Architecture | ModernBERT + 1 operators + GateFuse | attention only |
| Parameters | 191.9M | 149M |
| Operator params | 40.00M | 0 |
| Layers | 12 | 22 |
| Hidden size | 768 | 768 |
| Heads | 12 | 12 |
| Context | 8192 | 8192 |
| Tokenizer | answerdotai/ModernBERT-base (BPE) |
same |
| Training step | 1000 | β |
𧬠The operator stack
β‘ AEGNN β Asynchronous Event-Driven GNN
The speedrun build. Nodes that didn't change don't get recomputed. Fire an event, update that neighbourhood, leave the rest of the graph alone. Less compute, same brain.
π¦ GateFuse β the router
Every operator is a specialist; GateFuse is the editor. It learns, per sequence, how much of the language field, the spectral view, the geometric view, the learned graph and the event-driven graph to keep. It starts out almost fully on the plain language field (so the pretrained backbone is never stomped on) and the operators earn their way in during training.
ποΈ Training
| Dataset | wikitext2:train |
| Steps | 1000 |
| Schedule | cosine + warmup, gradient clipping 1.0 |
| Optimiser | AdamW |
| Init | answerdotai/ModernBERT-base backbone |
| Precision | bf16 / fp32 |
π Results
| Metric | Value |
|---|---|
| Eval NLL | 0.4323 |
| Eval perplexity | 1.54 |
Learning curve:
| Step | Train loss | Eval NLL | Eval PPL |
|---|---|---|---|
| 200 | 2.2006 | 1.0510 | 2.86 |
| 400 | 1.8709 | 0.6419 | 1.90 |
| 600 | 1.8484 | 0.5285 | 1.70 |
| 800 | 1.8277 | 0.4259 | 1.53 |
| 1000 | 1.8401 | 0.4057 | 1.50 |
| 1000 | 1.8401 | 0.4323 | 1.54 |
π Fair-play note: these numbers come from a limited-budget run (see the table above) β they're not directly comparable with production-scale numbers for ModernBERT, which see orders of magnitude more tokens. Use the curve above to compare operator configurations trained under the same protocol.
π Usage
import torch
from transformers import AutoTokenizer, AutoModelForMaskedLM
repo = "scairesearch/bertbm-None"
tokenizer = AutoTokenizer.from_pretrained("answerdotai/ModernBERT-base")
model = AutoModelForMaskedLM.from_pretrained(repo, trust_remote_code=True)
inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")
with torch.no_grad():
out = model(**inputs)
top = out.logits[0, inputs["input_ids"].shape[1] - 1].topk(5)
for idx, score in zip(top.indices, top.values):
print(tokenizer.decode([idx]), f"{float(score):.2f}")
Just want the backbone?
The export also ships a plain ModernBERT-compatible checkpoint
(model.safetensors.backbone) with the operators removed β drop it in as a
modernbert model.
π§ͺ Try the other configs
The same repo family ships the isolated operator ablations, so you can see what each piece is actually worth:
| Repo | Operators |
|---|---|
scairesearch/bertbm-100m |
fno + gnp + gnn + aegnn + riemann |
scairesearch/bertbm-300m |
fno + gnp + gnn + aegnn + riemann |
scairesearch/bertbm-gnn-only |
gnn |
scairesearch/bertbm-aegnn-only |
aegnn |
π Citation
This model is part of the BertBM research line:
@misc{bertbm2026,
title = {BertBM: Spectral-Geometric Operator Fusion for Transformer Language Models},
author = {Niranjan Hasabnis and SCAI Research Labs},
year = {2026},
eprint = {arXiv:XXXX.XXXXX},
archivePrefix = {arXiv},
primaryClass = {cs.LG}
}
π License
Apache 2.0
- Downloads last month
- 19
Model tree for scairesearch/bertbm-aegnn_only
Base model
answerdotai/ModernBERT-base