English

Theoretical Analysis of Hierarchical Language Recognition and Generation by Transformers without Positional Encoding

Computation and Language 2024-10-17 v1

Abstract

In this study, we provide constructive proof that Transformers can recognize and generate hierarchical language efficiently with respect to model size, even without the need for a specific positional encoding. Specifically, we show that causal masking and a starting token enable Transformers to compute positional information and depth within hierarchical structures. We demonstrate that Transformers without positional encoding can generate hierarchical languages. Furthermore, we suggest that explicit positional encoding might have a detrimental effect on generalization with respect to sequence length.

Keywords

Cite

@article{arxiv.2410.12413,
  title  = {Theoretical Analysis of Hierarchical Language Recognition and Generation by Transformers without Positional Encoding},
  author = {Daichi Hayakawa and Issei Sato},
  journal= {arXiv preprint arXiv:2410.12413},
  year   = {2024}
}

Comments

55 pages, 11 figures

R2 v1 2026-06-28T19:23:57.953Z