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.

AEGNN


⚑ 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
Safetensors
Model size
0.2B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for scairesearch/bertbm-aegnn_only

Finetuned
(1570)
this model