Evaluation of Coding Schemes for Transformer-based Gene Sequence Modeling

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Gong, Chenlei, Tian, Yuanhe, Mao, Lei, Song, Yan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909697137704960
author Gong, Chenlei
Tian, Yuanhe
Mao, Lei
Song, Yan
author_facet Gong, Chenlei
Tian, Yuanhe
Mao, Lei
Song, Yan
contents Currently, many studies view DNA sequences as a special type of language and utilize Transformers to model them. These studies use fixed-length k-mer segmentation and BPE subword tokenization but lack a systematic evaluation to determine which is superior. We compare k-mer segmentation with k=1,3,4,5,6, a 4,096-token BPE vocabulary, and three positional encoding methods-sinusoidal, AliBi, and RoPE. Each configuration is trained from scratch in 3, 6, 12, and 24-layer Transformer encoders and evaluated on GUE benchmark dataset. In general, BPE delivers higher and more stable performance across tasks by compressing frequent motifs into variable-length tokens, reducing sequence length, and improving model generalization. RoPE excels at capturing periodic motifs and extrapolating to long sequences, while AliBi also performs well on tasks driven by local dependencies. In terms of depth, we observe significant gains when increasing layers from 3 to 12, with only marginal improvements or slight overfitting at 24 layers. This study provides practical guidance for designing tokenization and positional encoding in DNA Transformer models.
format Preprint
id arxiv_https___arxiv_org_abs_2507_15087
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Evaluation of Coding Schemes for Transformer-based Gene Sequence Modeling
Gong, Chenlei
Tian, Yuanhe
Mao, Lei
Song, Yan
Computation and Language
Artificial Intelligence
Currently, many studies view DNA sequences as a special type of language and utilize Transformers to model them. These studies use fixed-length k-mer segmentation and BPE subword tokenization but lack a systematic evaluation to determine which is superior. We compare k-mer segmentation with k=1,3,4,5,6, a 4,096-token BPE vocabulary, and three positional encoding methods-sinusoidal, AliBi, and RoPE. Each configuration is trained from scratch in 3, 6, 12, and 24-layer Transformer encoders and evaluated on GUE benchmark dataset. In general, BPE delivers higher and more stable performance across tasks by compressing frequent motifs into variable-length tokens, reducing sequence length, and improving model generalization. RoPE excels at capturing periodic motifs and extrapolating to long sequences, while AliBi also performs well on tasks driven by local dependencies. In terms of depth, we observe significant gains when increasing layers from 3 to 12, with only marginal improvements or slight overfitting at 24 layers. This study provides practical guidance for designing tokenization and positional encoding in DNA Transformer models.
title Evaluation of Coding Schemes for Transformer-based Gene Sequence Modeling
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2507.15087