How do large language models (LLMs) analyse DNA sequences?
Large language models adapted for genomics (such as DNABERT, Nucleotide Transformer, and HyenaDNA) are trained on DNA sequences as if they were text, learning regulatory grammar, predicting variant effects, and generating functional annotations directly from raw sequence data.
Why Treat DNA as a Language?
DNA is a sequence of four nucleotides — A, C, G, T — arranged in specific patterns that encode genes, regulatory elements, and structural features. This sequential, rule-governed nature makes DNA remarkably well-suited to the same transformer-based architectures that power large language models like GPT, Llama, and BERT. By training on large corpora of genomic sequences, DNA language models learn the implicit "grammar" of the genome.
Key DNA Language Models
| Model | Developer | Architecture | Training Data | Key Capabilities |
|---|---|---|---|---|
| DNABERT | King's College London | BERT (12 layers) | Human genome (k-mers) | Promoter prediction, splice site identification, TF binding |
| Nucleotide Transformer | InstaDeep / NVIDIA | BERT (up to 2.5B params) | Multi-species genomes | Gene expression prediction, regulatory annotation |
| DNABERT-2 | Zhihan Zhou et al. | Encoder-only transformer | Multi-species (single bp tokenisation) | Genome annotation, species classification |
| GROVER | University of Freiburg | RoBERTa-based | Human genome | DNA structure prediction, methylation detection |
| HyenaDNA | Stanford / Together | Hyena (subquadratic) | Human genome (1M context length) | Long-range regulatory interaction prediction |
| Enformer | DeepMind | CNN + transformer | Human + mouse genomes | Gene expression from sequence (200 kb context) |
How DNA Language Models Work
DNA language models are trained using masked language modelling — the same objective as BERT. During training, random nucleotides in a DNA sequence are masked, and the model learns to predict the masked nucleotides from their surrounding context. This forces the model to learn meaningful representations of local and long-range sequence patterns.
The key differences from NLP LLMs:
- Vocabulary: DNA has a vocabulary of only 4 tokens (A, C, G, T) vs 50,000+ for language models
- Tokenisation: Most DNA models use single-nucleotide tokenisation or 3–6-mer tokenisation (vs subword tokenisation in NLP)
- Context length: Genomic tasks often require very long contexts (up to 200 kb for regulatory prediction), pushing the limits of transformer attention
- Bidirectional: Unlike autoregressive LLMs (GPT-style) that read left-to-right, DNA models are typically bidirectional (BERT-style) because DNA is not directional in function
Applications of LLMs in Genomics
Regulatory Element Prediction
DNA language models can predict promoters, enhancers, silencers, and insulators directly from sequence. Enformer (DeepMind) achieves state-of-the-art performance in predicting gene expression from 200 kb of genomic context, including the effects of regulatory variants. Nucleotide Transformer can predict chromatin profiles and transcription factor binding sites across multiple cell types.
Variant Effect Prediction
When a single nucleotide variant (SNV) occurs in the genome, predicting whether it is benign or pathogenic is a critical challenge. DNA language models address this by computing the "log-likelihood ratio" between the reference and alternate sequences — a variant that reduces the model's confidence in the sequence is more likely to be deleterious.
Gene Structure Annotation
Models like DNABERT achieve high accuracy in identifying splice donors, splice acceptors, translation start sites, and polyadenylation signals — tasks that traditionally require comparative genomics or transcriptomic evidence.
Metagenomic Binning and Classification
DNA language models can classify short sequencing reads by species without alignment, enabling rapid taxonomic profiling of metagenomic samples. This is particularly valuable for environmental and clinical microbiome analysis.
Transformer attention scales quadratically with sequence length, making it infeasible to process long regulatory regions. Solutions include flash attention, state-space models (Mamba, Hyena), and long-convolution architectures that can process sequences up to 1 million nucleotides in length with linear scaling.
Limitations and Challenges
- Data bias: Most models are trained primarily on the human genome and may not generalise well to other species, especially non-model organisms
- Interpretability: Understanding why a model predicts a certain regulatory effect remains difficult, limiting biological insight generation
- Benchmarking: Lack of standardised benchmarks makes it hard to compare models fairly across tasks
- Computational cost: Training genome-scale models requires substantial GPU resources (typically hundreds of GPU-days)
Ethical Considerations for Genomic AI
The application of LLMs to genomics raises important ethical considerations. Models trained on human genomic data may inadvertently encode information about population ancestry, disease predispositions, or other sensitive attributes. This creates risks around privacy, consent, and potential misuse. Key considerations include: training data should represent diverse populations to avoid biased predictions; model outputs should not be used for clinical decisions without independent validation; genomic data used for training must be obtained with appropriate consent and de-identification; and models should be auditable and interpretable. Sovereign AI infrastructure — such as VigyanLLM's India-based platform — helps ensure that genomic data remains under local data protection frameworks rather than being processed on foreign servers subject to different legal regimes.
The Future of LLMs in Genomics
As DNA language models grow larger and more sophisticated, we expect to see:
- Pan-genome models that capture variation across entire populations
- Multimodal models that integrate DNA sequence with epigenomic, transcriptomic, and proteomic data
- Clinical-grade variant prioritisation for rare disease diagnosis and cancer genomics
- De novo genome design — generating synthetic genomes with desired regulatory properties
VigyanLLM is building sovereign Indian genomics AI capabilities, including DNA language model fine-tuning for Indian population genomes and primer design optimisation using transformer-based sequence representations. See our AI in molecular biology overview for more context.
AI-Driven Primer Design for Genomics
VigyanLLM combines ML-enhanced validation with primer design — optimise your primers with AI-powered predictions.
Try VigyanLLM Primer Free →