Published May 21, 2025 | Version v1
Dataset Open

What Do Genomic Transformers Attend To? Interpreting Attention Heads Across DNABERT, Nucleotide Transformer, and scGPT

  • 1. ROR icon University of Toronto
  • 2. ROR icon Vector Institute
  • 3. ROR icon University Health Network
  • 4. ROR icon Ontario Institute for Cancer Research

Description

Transformer models have shown strong performance on biological sequence prediction tasks, but the interpretability of their internal mechanisms remains underexplored. As the use-case of these models is in the context of biomedical research, mechanistic understanding of the predictions is key to 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 summarize each head’s focus using GPT-4. Applying this to DNABERT, Nucleotide Transformer, and scGPT, we find that attention heads learn biologically meaningful associations during unsupervised 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 pretraining to finetuning, enabling insight into how these models represent nucleotides, genes, and cells.

Files

Files (8.1 GB)

Name Size Download all
md5:76ac92e3d8552b2a04dc89e0196b077a
162.9 kB Download
md5:eca672cb1dc85706e0f4b08813180fc6
372.1 MB Download
md5:74b633bd06ff8ec4f94a8b6e49f51ea2
3.7 GB Download
md5:2988f26c4ac9edb917198d0143f80222
4.1 GB Download
md5:1b6379b6f676ee59813dbe487b276492
10.4 MB Download

Additional details

Dates

Available
2025-05-21

Software

Repository URL
https://github.com/meconsens/genome-head-interpreter
Programming language
Python, R