Intra-Layer Recurrence in Transformers for Language Modeling

Anthony Nguyen, Wenjun Lin
5/3/2025
4 citations
cs.CLcs.AI
transformer-attention

Official code: ant-8/Layer-Recurrent-Transformers (7 stars, Python, last commit 2025-08-05).

Abstract

Transformer models have established new benchmarks in natural language processing; however, their increasing depth results in substantial growth in parameter counts. While existing recurrent transformer methods address this issue by reprocessing layers multiple times, they often apply recurrence indiscriminately across entire blocks of layers.

Show full abstract

In this work, we investigate Intra-Layer Recurrence (ILR), a more targeted approach that applies recurrence selectively to individual layers within a single forward pass. Our experiments show that allocating more iterations to earlier layers yields optimal results. These findings suggest that ILR offers a promising direction for optimizing recurrent structures in transformer architectures.

View on arXivView PDF

Code Implementations(1)

[CanadianAI 2025] Code for paper "Intra-Layer Recurrence in Transformers for Language Modeling"

71PythonApr 21, 20251 years ago

Similar Papers

Cite this paper

@article{nguyen2025intralayer,
  title  = {Intra-Layer Recurrence in Transformers for Language Modeling},
  author = {Anthony Nguyen and Wenjun Lin},
  year   = {2025},
  eprint = {2505.01855},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.01855v2}
}

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/2505.01855.svg)](https://codeofpaper.com/paper/2505.01855)

Discussion