potentialpaper

Empirically Testing Expressivity Bounds for Neural Network Architectures

Alexandra Butoi, Nicola Lorenzon, Selim Jerad, Taiga Someya, Anej Svete, Ryan Cotterell, Brian DuSell

ICLR 2026 submission

Edit this page

Or clone it with git

The page gets its repository with its first edit, so start in the web editor.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Understanding neural networks' algorithmic capabilities is key to predicting their performance on real-world tasks, and formal language recognition offers a rigorous framework for evaluating what algorithms these models can employ. To this end, a growing body of theoretical work has sought to characterize the classes of formal language that various neural network architectures---particularly transformers---can recognize. These mathematical results generally rely on simplified versions of the transformer network that differ from those used in practice, so empirically testing the hypothesized expressivity bounds remains crucial. Some work has already evaluated neural networks as recognizers of hand-picked languages, but in order to test broad claims about language recognition bounds, one should test on an appropriately broad distribution of languages and see how well the hypotheses and experiments align. This paper is an attempt to do just that, using efficient algorithms for randomly sampling formal languages from certain language classes and generating labeled datasets to be used for training and evaluating neural networks on those languages. We do so for the classes of regular languages, context-free languages, partially-ordered star-free languages, and star-free languages of varying dot-depth. Along the way, we develop a novel algorithm for efficiently sampling a string of a desired length from a probabilistic context-free grammar. We experimentally test the language recognition performance of transformers, simple RNNs, and LSTMs on these classes and find that transformers can recognize only a subset of star-free languages, underperforming theoretical predictions. On context-free languages, we find that all models learn very strong approximations of the languages, but fail to learn the correct underlying mechanism. Our code is publicly available.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

add · history

No versions are recorded yet: its preprint, the venues it went to and what they decided, the camera-ready. Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…