An Algebraic View of the Expressivity of Recurrent Language Models

2026-06-01Formal Languages and Automata Theory

Formal Languages and Automata TheoryComputation and LanguageMachine Learning
AI summary

The authors look into what kinds of formal languages recurrent neural networks (RNNs) can understand, noting previous studies give conflicting answers. They explain these differences come from how the networks do arithmetic internally. By using algebra, the authors connect the problem to a mathematical concept called syntactic monoids and wreath products to describe expressivity. They also test a specific RNN type and find it can act as a counter under integer math but not with floating-point math. This work clarifies how the arithmetic model affects what RNNs can recognize.

recurrent neural networksformal languagesTuring-completenessregular languagesarithmetic modelssyntactic monoidwreath productstate-space modelsfloating-point arithmeticinteger quantization
Authors
Franz Nowak, Ryan Cotterell, Reda Boumasmoud
Abstract
What formal languages can a recurrent neural language model recognize? Formal results in the literature conflict: some authors report Turing-completeness, while others show equivalence to regular languages. The reason for this discrepancy is that the underlying arithmetic model differs. The paper develops a unified algebraic account of the expressivity of recurrent neural networks, starting with a formal account of various arithmetic models. This account reduces expressivity to an algebraic question, e.g., whether a network's syntactic monoid divides a certain wreath product. As a case study, the paper revisits diagonal state-space models: the same architecture cannot implement an even-modulus counter once floating-point recurrences are enforced, yet realizes every even-modulus counter under unsigned-integer quantization.