dnaHNet: Tokenizer-Free Genomic Model
- dnaHNet is a foundation model for genomic sequences that employs differentiable dynamic chunking to adaptively compress raw nucleotides while preserving motif integrity.
- Its modular, hierarchical design—with recursive Encoder, Main Network, and Decoder blocks—yields a theoretical 36× FLOP reduction and over 3× empirical speedup compared to standard Transformers.
- Pretraining on 144 billion prokaryotic bases demonstrates superior zero-shot performance in tasks like protein variant effect prediction and gene essentiality, outperforming comparable architectures.
dnaHNet is a tokenizer-free, autoregressive foundation model for genomic sequences that addresses the central trade-off in large-scale genome modeling: reconciling biological fidelity with computational scalability. Standard fixed-vocabulary tokenizers fragment motifs such as codons and regulatory elements, while nucleotide-level models yield prohibitively high costs for long contexts. dnaHNet leverages a differentiable dynamic chunking mechanism to segment raw nucleotides into latent tokens end-to-end, enabling adaptive compression while maintaining predictive accuracy. The model is pretrained on prokaryotic genomic data and demonstrates superior scaling, efficiency, and emergent interpretability compared to leading architectures.
1. Model Architecture and Mechanisms
dnaHNet models a DNA sequence , , through an autoregressive factorization:
To scale efficiently to sequences of length , dnaHNet abandons fixed tokenization in favor of a modular architecture composed of three interconnected components—Encoder (), Main Network (), and Decoder ()—each enabling recursive stacking for multi-stage compression.
Differentiable Dynamic Chunking
The Encoder first embeds the raw sequence with four Mamba layers and one Transformer layer, producing hidden states . For each position , a boundary predictor computes a continuous boundary probability: where 0. High 1 values indicate context shifts (e.g., codon boundaries or regulatory motifs). During inference, boundaries 2 are discretized, and the Chunking layer downsamples by retaining only 3 where 4, producing a compressed latent sequence 5.
Recursive Hierarchy
Latents 6 are input to 7, which may itself be another Encoder–Main–Decoder block, supporting multi-stage compression. In practice, dnaHNet adopts a two-stage hierarchy with compression ratios 8 (codon granularity) and 9 (capturing codon-pair biases), for an overall expected compression factor 0.
Each Main Network alternates Mamba layers (subquadratic SSM-based operators) and Transformer layers (quadratic attention), with parameter allocation by scale. In the XL configuration (1B parameters), 30% of parameters are assigned to encoders/decoders and 70% to Main Networks (Transformer depth 2, 3, 4 attention heads).
Upsampling and Decoder
The Main Network outputs 5, which are smoothed recursively: 6 Each smoothed latent 7 is uniformly copied to its constituent nucleotides, yielding 8. Four Mamba layers and one Transformer layer decode 9 into logits over 0.
Compression-Rate Regularization
To avoid degenerate chunking, an auxiliary loss aligns the discrete boundary rate 1 with continuous expectation 2 per stage 3. For target ratio 4: 5 The total loss is 6, with 7 and negative log-likelihood 8.
2. Computational Complexity and Efficiency
Standard Transformers on length 9 incur a computational cost of 0 due to quadratic self-attention. dnaHNet restructures this cost:
1
With quadratic attention in the Main Network operating on 2, the dominant term becomes 3. For 4, this is a 5 FLOP reduction. Encoder and decoder terms are linear: 6.
Empirical benchmarks on 7 nucleotides indicate that dnaHNet (218M parameters) reduces inference FLOPs by 8 compared to StripedHyena2 (166M parameters), and achieves more than 9 end-to-end speedup over equivalently sized Transformers.
3. Pretraining and Zero-Shot Evaluation
Pretraining Data and Objective
dnaHNet is pretrained on 17,648,721 prokaryotic genome sequences (from GTDB, 85,205 species), totaling 144 billion nucleotides, with each non-overlapping chunk up to 8192 bp. The end-to-end training objective combines autoregressive next-nucleotide prediction with two-stage compression-rate regularization (0).
Zero-Shot Task Performance
Protein Variant Effect Prediction (MaveDB; 21,250 data points): Model fitness predicted by log-likelihood differences.
| Model | Training FLOPs | Spearman ρ |
|---|---|---|
| dnaHNet | 1 | 0.2601 |
| 2 | 0.2865 | |
| 3 | 0.3143 | |
| 4 | 0.3266 | |
| StripedHyena2 | 5 | 0.2639 |
| 6 | 0.2921 | |
| 7 | 0.3084 | |
| 8 | 0.3110 | |
| Transformer | 9 | 0.1348 |
| 0 | 0.1355 | |
| 1 | 0.1497 | |
| 2 | 0.1555 |
dnaHNet outperforms StripedHyena2 by approximately 0.015 in Spearman correlation at the highest compute budgets.
Gene Essentiality (DEG; 185,226 genes): Predicts loss of essential genes after in silico premature stop codon insertion, measured by AUROC.
| Model | Training FLOPs | AUROC |
|---|---|---|
| dnaHNet (3,2 hierarchy) | 3 | 0.5719 |
| 4 | 0.5840 | |
| 5 | 0.5993 | |
| 6 | 0.6050 | |
| dnaHNet (2,2 hierarchy) | 7 | 0.5538 |
| 8 | 0.5797 | |
| 9 | 0.5854 | |
| 0 | 0.5900 | |
| StripedHyena2 | 1 | 0.5375 |
| 2 | 0.5670 | |
| 3 | 0.5720 | |
| 4 | 0.5759 |
The (3,2) hierarchy, aligning with codon structure, yields the best scaling and AUROC.
4. Emergent Biological Interpretability
dnaHNet’s hierarchical chunking discovers biologically relevant structures without supervision. The learned boundaries, at each hierarchy stage, exhibit interpretable selection rates.
Triplet Codon Awareness (Stage 1)
Boundary selection rates in coding regions show marked periodicity:
- Position 1: 6.5%
- Position 2: 42.6%
- Position 3: 58.4%
Outside coding regions, selection is comparatively uniform (∼35.8%), indicating chunking does not force a codon structure where none exists.
Functional Region Awareness (Stage 2)
Selection rates differ by genomic region:
- Promoter: 71.5%
- Start codon: 81.3%
- Coding region: 48.4%
- Stop codon: 51.7%
- Intergenic: 74.6%
This suggests the upper hierarchy learns to identify functional elements, utilizing lower-layer codon-aware representations to delineate regulatory and genic structures.
Hierarchical Chunking Statistics
| Genomic Feature | Stage 1 | Stage 2 |
|---|---|---|
| Global selection | 35.8% | 51.3% |
| Promoter | 35.6% | 71.5% |
| Start codon | 35.1% | 81.3% |
| Coding region | 35.8% | 48.4% |
| Stop codon | 34.5% | 51.7% |
| Intergenic | 35.3% | 74.6% |
| Position 1 | 6.5% | 51.8% |
| Position 2 | 42.6% | 38.0% |
| Position 3 | 58.4% | 55.9% |
5. Context, Significance, and Applications
dnaHNet establishes a unified framework for modeling genomic sequences at scale, resolving the trade-off between long-context efficiency and biological motif coherence. Its recursive chunking enables theoretical 5 FLOP savings, which translates to greater than 6 empirical inference speedup. The model, pretrained on 144 billion prokaryotic bases, not only surpasses previous architectures (e.g., StripedHyena2, Transformers) on zero-shot protein and gene essentiality tasks, but also recapitulates biological syntax at multiple hierarchical levels.
A plausible implication is that the model architecture may generalize to other contexts in genomics where hierarchical motif discovery and computational tractability are essential. The adaptive chunking mechanism provides a transparent window into learned sequence grammar, conferring interpretability that is often lacking in large foundation models.
6. Limitations and Future Directions
While dnaHNet demonstrates robust scaling and interpretability on prokaryotic sequences, its current instantiation is based on unsupervised learning and fixed (albeit biologically motivated) compression ratios. Its generalizability to eukaryotic genomes, or to tasks requiring explicit supervision at intermediate levels, remains to be fully explored. Potential extensions may include dynamic adaptation of hierarchical depths, integration with downstream supervised predictors, and transferability to non-genomic biological sequence domains.