bioRxivBioinformaticsPreprint
Interpreting Attention Mechanisms in Genomic Transformer Models: A Framework for Biological Insights
Micaela Elisa ConsensiD, Ander Díaz‐NavarroiD, Vivian Chu, Lincoln David SteiniD, Housheng Hansen HeiD, Alan M MosesiD, Bo WangiD
Abstract
Transformer models have shown strong performance on biological sequence prediction tasks, but the interpretability of their internal mechanisms remains underexplored. Given their application in biomedical research, understanding the mechanisms behind these models predictions is crucial for their widespread adoption. We introduce a method to interpret attention heads in genomic transformers by correlating per-token attention scores with curated biological annotations, and we use GPT-4 to summarize each heads focus. Applying this to DNABERT, Nucleotide Transformer, and scGPT, we find that attention heads learn biologically meaningful associations during self-supervised pre-training and that these associations shift with fine-tuning. We show that interpretability varies with tokenization scheme, and that context-dependence plays a key role in head behaviour. Through ablation, we demonstrate that heads strongly associated with biological features are more important for task performance than uninformative heads in the same layers. In DNABERT trained for TATA promoter prediction, we observe heads with positive and negative associations reflecting positive and negative learning dynamics. Our results offer a framework to trace how biological features are learned from random initialization to pre-training to fine-tuning, enabling insight into how genomic foundation models represent nucleotides, genes, and cells.
- assay: DNA methylation
- assay: whole-genome sequencing
- research focus: gene regulatory network inference
- approach: statistical model
- Citations
- 5
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Explainable Transformer Models for Functional Genomics in Prokaryotes
Jim Clauwaert, Gerben Menschaert, Willem Waegeman·bioRxiv·Mar 16, 2020
- Fine-Tuning Transformers For Genomic Tasks
Vlastimil Martinek, David Čechák, … Petr Šimeček·bioRxiv·Feb 7, 2022
- DNABERT: pre-trained Bidirectional Encoder Representations from Transformers model for DNA-language in genome
Yanrong Ji, Zhihan Zhou, … Ramana V. Davuluri·BioinformaticsPeer-reviewed·Feb 3, 2021
- Genomic Tokenizer: Toward a biology-driven tokenization in transformer models for DNA sequences
Bell Raj Eapen·bioRxiv·Apr 2, 2025
- Novel transformer networks for improved sequence labeling in genomics
Jim Clauwaert, Willem Waegeman·IEEE Transactions on Computational Biology and BioinformaticsPeer-reviewed·Oct 30, 2020
- BERTology Meets Biology: Interpreting Attention in Protein Language Models
Jesse Vig, Ali Madani, … Nazneen Fatema Rajani·bioRxiv·Jun 26, 2020