Do Transformers Have the Ability for Periodicity Generalization?

Huanyu Liu, Ge Li, Yihong Dong, Sihan Wu, Peixu Wang +5 more
1/30/2026
cs.LGcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) based on the Transformer have demonstrated strong performance across diverse tasks. However, current models still exhibit substantial limitations in out-of-distribution (OOD) generalization compared with humans.

Show full abstract

We investigate this gap through periodicity, one of the basic OOD scenarios. Periodicity captures invariance amid variation. Periodicity generalization represents a model's ability to extract periodic patterns from training data and generalize to OOD scenarios. We introduce a unified interpretation of periodicity from the perspective of abstract algebra and reasoning, including both single and composite periodicity, to explain why Transformers struggle to generalize periodicity. Then we construct Coper about composite periodicity, a controllable generative benchmark with two OOD settings, Hollow and Extrapolation. Experiments reveal that periodicity generalization in Transformers is limited, where models can memorize periodic data during training, but cannot generalize to unseen composite periodicity. We release the source code to support future research.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liu2026transformers,
  title  = {Do Transformers Have the Ability for Periodicity Generalization?},
  author = {Huanyu Liu and Ge Li and Yihong Dong and Sihan Wu and Peixu Wang and Sihao Cheng and Taozhi Chen and Kechi Zhang and Hao Zhu and Tongxuan Liu},
  year   = {2026},
  eprint = {2601.22690},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.22690v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.22690.svg)](https://codeofpaper.com/paper/2601.22690)

Discussion