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

05/05/2023
by   Ta-Chung Chi, et al.
0

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. 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/14/2023

Advancing Regular Language Reasoning in Linear Recurrent Neural Networks

In recent studies, linear recurrent neural networks (LRNNs) have achieve...
research
04/19/2023

Scaling Transformer to 1M tokens and beyond with RMT

This technical report presents the application of a recurrent memory to ...
research
02/24/2022

Overcoming a Theoretical Limitation of Self-Attention

Although transformers are remarkably effective for many tasks, there are...
research
06/05/2020

GMAT: Global Memory Augmentation for Transformers

Transformer-based models have become ubiquitous in natural language proc...
research
09/02/2023

Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languages

Despite that Transformers perform well in NLP tasks, recent studies sugg...
research
08/06/2023

Average-Hard Attention Transformers are Constant-Depth Uniform Threshold Circuits

Transformers have emerged as a widely used neural network model for vari...
research
10/27/2022

Working Alliance Transformer for Psychotherapy Dialogue Classification

As a predictive measure of the treatment outcome in psychotherapy, the w...

Please sign up or login with your details

Forgot password? Click here to reset