Understanding the natural language of DNA using encoder–decoder foundation models with byte-level precision

Aditya Malusare, Harish Kothandaraman, Dipesh Tamboli, Nadia A Lanman, Vaneet Aggarwal

TL;DR

ENBED (Ensemble Nucleotide Byte-level Encoder-Decoder) is a new foundation model for genomics that treats DNA as a natural language with "byte-level" precision. By using an encoder-decoder Transformer architecture and treating single nucleotides as individual tokens, it outperforms existing state-of-the-art models in 21 out of 25 genomic benchmarks and excels at complex sequence-to-sequence tasks like predicting viral mutations.

What Problem Does This Paper Address?

Most existing genomic foundation models fall into two camps: encoder-only (like DNABERT), which are great at classifying sequences, or decoder-only (like HyenaDNA), which are designed for generation. Furthermore, many models use "k-mer" or Byte-Pair Encoding (BPE) tokenization, which groups multiple nucleotides into a single "word."

The authors identify two major gaps here:

  1. The Tokenization Trap: Grouping nucleotides makes models brittle. A single mutation or sequencing error can change a "word" entirely, causing the model to lose the fine-grained context of the mutation.
  2. Architectural Limitations: Neither encoder-only nor decoder-only models are perfectly suited for sequence-to-sequence transformations—the very processes (like transcription or mutation) that define biological evolution.

Methods

The authors introduce ENBED, a 1.2-billion parameter Transformer model. Its "secret sauce" consists of three main components:

  • Encoder-Decoder Architecture: Unlike its predecessors, ENBED uses a 2:1 ratio of encoder to decoder blocks. This allows the model to build deep representations of an input sequence (encoder) and then use cross-attention to transform that information into a new sequence (decoder).
  • Byte-level Tokenization: ENBED treats each of the four DNA bases (A, C, T, G) as a single token. While this increases the sequence length and computational load, it provides "byte-level precision," making the model highly resilient to single-nucleotide polymorphisms (SNPs) and sequencing noise.
  • Sub-quadratic Attention: To handle the massive sequence lengths (up to 16,384 tokens) resulting from byte-level tokenization, the authors implemented a hybrid attention mechanism. It combines sliding-window attention (for local biological context like codons) and global attention (to capture long-range regulatory interactions), reducing computational complexity from $O(L^2)$ to $O(L)$.

The model was pre-trained using Masked Language Modeling (MLM) on high-quality reference genomes, including the recent "Telomere-to-Telomere" (T2T) assemblies which include previously "unmappable" repetitive regions of the genome.

Datasets

  • Pre-training: A massive ensemble of genomes from NCBI RefSeq, including Human (T2T-CHM13), Maize, E. coli, fruit flies, and mice, plus data from the 1000 Genomes Project.
  • Evaluation Benchmarks: The model was tested against the Nucleotide Transformer (NT) and Genomic Benchmarks (GB) suites, covering tasks like enhancer identification, promoter prediction, and splice site recognition.
  • Specialized Tasks: The authors used TeloBase to generate synthetic sequencing noise and the NCBI Influenza Virus Resource to create a dataset for predicting viral mutations.

Key Insights and Ideas

  • Precision over Compression: The "aha moment" is that DNA doesn't have natural "words" like English. By forcing a byte-level approach, the model learns the actual grammar of nucleotides rather than statistical artifacts of k-mer groupings. This is why it identifies sequencing noise with 97.6% accuracy.
  • The T2T Advantage: The paper highlights that pre-training on "complete" genomes (T2T) significantly boosts performance compared to the older GRCh38 reference. This suggests that the "dark matter" of the genome (repetitive regions) contains vital linguistic patterns for foundation models.
  • Generative Mutation Modeling: By using the encoder-decoder structure, the authors could treat evolution as a translation task. ENBED doesn't just say if a mutation will happen; it can generate the mutated sequence itself.

Key Results

  • Benchmark Dominance: ENBED achieved state-of-the-art (SOTA) results in 21 out of 25 standard genomic benchmarks.
  • Mutation Prediction: In predicting Influenza virus mutations, ENBED achieved a 95.4% top-5 accuracy. For comparison, a model using BPE tokenization (grouping nucleotides) only managed 56.1%.
  • Noise Resilience: The model is significantly better at handling "messy" data. It outperformed DNABERT and Nucleotide Transformer in identifying erroneous sequences, proving the value of byte-level precision in real-world diagnostic scenarios.
  • Biological Annotation: It achieved an $F_1$ score of 74.1 in identifying biological functions (coding vs. non-coding, etc.), surpassing previous benchmarks.

Limitations and Future Work

While ENBED is powerful, the authors acknowledge the computational cost of byte-level processing. Even with sub-quadratic attention, processing 16k tokens is resource-intensive compared to models that compress DNA into k-mers.

Future work could involve:

  • Scaling the model to even longer context windows to capture distal regulatory elements.
  • Applying the encoder-decoder architecture to protein structure prediction or variant effect prediction in clinical settings.
  • Exploring "zero-shot" capabilities for newly sequenced organisms.

Summary updated

BibTeX
@article{malusare2024understanding,
  author = {Aditya Malusare and Harish Kothandaraman and Dipesh Tamboli and Nadia A Lanman and Vaneet Aggarwal},
  title = {{Understanding the natural language of DNA using encoder–decoder foundation models with byte-level precision}},
  journal = {Bioinformatics},
  year = {2024},
  doi = {10.1093/bioadv/vbae117},
}
Figure