Downloads · 30 days
28
28% of all-time downloads
mrothroc/dna-enhancers-mamba3-mixlab
dna-enhancers-mamba3-mixlab is a feature extraction model from mrothroc. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
A small canonical Mamba-3 DNA language model, pretrained on human genome in mixlab on a single Apple-silicon Mac. It is a reusable backbone: load it, then fine-tune a classifier on your own genomic task. On the humane…
Downloads · 30 days
28
28% of all-time downloads
All-time downloads
99
Public
Parameters
14.3M
57.4 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors57.4 MB · 100%
From the Hugging Face model README
A small canonical Mamba-3 DNA language model, pretrained on human genome in
mixlab on a single Apple-silicon Mac. It is a reusable backbone: load
it, then fine-tune a classifier on your own genomic task. On the human_enhancers_cohn benchmark, a
classifier fine-tuned on this backbone reaches 0.728 accuracy / 0.811 AUROC, ahead of a same-size
attention model (0.717) and the benchmark's baseline CNN (~0.69-0.70).
This is a model to learn from and build on, not a state-of-the-art result. The point is that a real selective-scan state-space model (Mamba-3), trained on a laptop on only three chromosomes, is competitive with much larger whole-genome-pretrained models, and that swapping the mixer to get there is a config edit in mixlab, not new model code.
mamba3-canonical blocks interleaved with 6 SwiGLU blocks, model_dim 384,
seq_len 512, nucleotide vocab 9 (A/C/G/T/N + BOS/EOS/PAD/MASK). Mamba-3 = selective-scan SSM with a
complex-valued state update, a multi-input multi-output (MIMO) B/C formulation, and the
exponential-trapezoidal recurrence (Lahoti et al. 2026).This is a custom-code export, so load with trust_remote_code=True. The token ids are BOS=1, EOS=2, PAD=0,
and A/C/G/T/N = 4/5/6/7/8.
import torch
from transformers import AutoModel
repo = "mrothroc/dna-enhancers-mamba3-mixlab"
model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval() # backbone hidden states
ids = torch.tensor([[1, 4, 5, 6, 7, 4, 5, 2]]) # BOS A C G T A C EOS
hidden = model(input_ids=ids).last_hidden_state # [1, 8, 384]
To reproduce the enhancer classifier, fine-tune with AutoModelForSequenceClassification (or use mixlab's
native classification training). The full recipe is in the cookbook below.
Full recipe (reproduce an attention baseline, then improve it by swapping the mixer to Mamba, all on a laptop): mixlab cookbook, genomics-mamba. The same-size attention baseline is at mrothroc/dna-enhancers-attention-mixlab.
For the story behind it, read I Built an ML Architecture Lab in Go.
Please cite what this builds on: