Learning Strand-Equivariant Tokenizations of DNA with MirrorDNA
Nirjhor Datta, Swakkhar Shatabda, Md. Shamsuzzoha BayzidiD, M. Sohel RahmaniD
Abstract
DNA has two strands, and for most regulatory label prediction tasks a sequence and its reverse complement should get same answer. Yet DNA language models are tokenized, trained and tested on one strand at a time. We show that this makes them inconsistent. BPE and $k$-mer tokenizers split 92--100\% of transcription-factor motifs differently on the two strands, and NT-v2, DNABERT-2 and HyenaDNA change 25-31\% of their predictions when the test sequences are reverse-complemented. We introduce {\model}, a compact DNA language model with a learned tokenizer that guarantees mirror-symmetric token boundaries across reverse-complement sequences, regardless of its learned parameters. We prove that this symmetry holds through the whole model. As a result, the same model can give identical answers on both strands when the label does not depend on the strand, and can still tell the strands apart when it does, which no strand-blind model can learn. Counting only predictions that are correct on both strands, \model\ more than doubles the MCC of NT-v2, DNABERT-2 and HyenaDNA. With 2.3M parameters, it is more accurate than the Caduceus models trained on the same data, and not significantly different from NT-v2 (98M parameters) on Genomic Benchmarks or from DNABERT-2 (117M) on the Nucleotide Transformer tasks. It also stays accurate on inputs sixteen times longer than those it was trained on. The same model trained with reverse-complement augmentation instead still changes about one prediction in ten with the strand, unless its outputs are averaged over both strands. Without any annotation, the tokenizer learns to keep the splice-donor signal \texttt{AGGT} in a single token. Code: https://github.com/NIRJHOR-DATTA/MirrorDNA.
02 /Specification & Classification
Click any tag to browse matching papers- Assay
- Research Focus
- Approach
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
- Distinguishing word identity and sequence context in DNA language models
Melissa Sanabria, Jonas Hirsch, Anna R. Poetsch·BMC BioinformaticsPeer-reviewed·Sep 13, 2024
- PatchDNA: A Flexible and Biologically-Informed Alternative to Tokenization for DNA
Alice Del Vecchio, Chantriolnt-Andreas Kapourani, … Cristian Regep·bioRxiv·Nov 28, 2025
- Genomic Tokenizer: Toward a biology-driven tokenization in transformer models for DNA sequences
Bell Raj Eapen·bioRxiv·Apr 2, 2025
- DNA-LLM2Vec: Architecture-Aware Task-Conditioned Adaptation of Decoder DNA Foundation Models
Yuan Liang, Ke Zhai, … Massimo Poesio·bioRxiv·Oct 14, 2026
- 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
- Carbon: Decoding the Language of Life
Loubna Ben Allal, Qiuyi Li, … Leandro von Werra·bioRxiv·May 25, 2026