Learning Strand-Equivariant Tokenizations of DNA with MirrorDNA
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.