Advancing Regular Language Reasoning in Linear Recurrent Neural Networks

Ting-Han Fan, Ta-Chung Chi, Alexander I. Rudnicky
9/14/2023
cs.CLcs.LG

Official code: tinghanf/RegluarLRNN (4 stars, last commit 2023-10-27).

Abstract

In recent studies, linear recurrent neural networks (LRNNs) have achieved Transformer-level performance in natural language and long-range modeling, while offering rapid parallel training and constant inference cost. With the resurgence of interest in LRNNs, we study whether they can learn the hidden rules in training sequences, such as the grammatical structures of regular language. We theoretically analyze some existing LRNNs and discover their limitations in modeling regular language. Motivated by this analysis, we propose a new LRNN equipped with a block-diagonal and input-dependent transition matrix. Experiments suggest that the proposed model is the only LRNN capable of performing length extrapolation on regular language tasks such as Sum, Even Pair, and Modular Arithmetic. The code is released at \url{https://github.com/tinghanf/RegluarLRNN}.

View on arXivView PDF

Code Implementations(1)

40PythonOct 27, 20232 years ago

Cite this paper

@article{fan2023advancing,
  title  = {Advancing Regular Language Reasoning in Linear Recurrent Neural Networks},
  author = {Ting-Han Fan and Ta-Chung Chi and Alexander I. Rudnicky},
  year   = {2023},
  eprint = {2309.07412},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.07412v2}
}

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

Discussion