Transformer Working Memory Enables Regular Language Reasoning and Natural Language Length Extrapolation

Ta-Chung Chi, Ting-Han Fan, Alexander I. Rudnicky, Peter J. Ramadge
5/5/2023
cs.CL
transformer-attention

No confident code implementation found for this paper.

Abstract

Unlike recurrent models, conventional wisdom has it that Transformers cannot perfectly model regular languages. Inspired by the notion of working memory, we propose a new Transformer variant named RegularGPT.

Show full abstract

With its novel combination of Weight-Sharing, Adaptive-Depth, and Sliding-Dilated-Attention, RegularGPT constructs working memory along the depth dimension, thereby enabling efficient and successful modeling of regular languages such as PARITY. We further test RegularGPT on the task of natural language length extrapolation and surprisingly find that it rediscovers the local windowed attention effect deemed necessary in prior work for length extrapolation.

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{chi2023transformer,
  title  = {Transformer Working Memory Enables Regular Language Reasoning and Natural Language Length Extrapolation},
  author = {Ta-Chung Chi and Ting-Han Fan and Alexander I. Rudnicky and Peter J. Ramadge},
  year   = {2023},
  eprint = {2305.03796},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.03796v1}
}

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

Discussion