Benchmarking Neural Networks on Formal Language Classes
Brian DuSell, Alexandra Butoi, Selim Jerad, Nicola Lorenzon, Taiga Someya, Anej Svete, Ryan Cotterell
Abstract
Understanding the computational abilities of neural networks is key to predicting their performance on real-world tasks, and formal language theory offers a mature, rigorous framework for characterizing what kinds of problems they can solve. A large body of theoretical work has sought to pin down which formal language classes they can express, but this work relies on various simplifications (e.g., hard attention) that differ from practice. Empirical studies that use unsimplified architectures therefore provide an important supplement to this work, but they typically evaluate models on small sets of hand-picked languages, leaving the rest of a class drastically underexplored. To remedy this, we evaluate transformers, simple RNNs, and LSTMs on formal languages sampled randomly from a hierarchy of pertinent classes: -trivial, star-free, regular, and context-free languages. We sample from distributions with full support over each class, so expanding the coverage of a class is simply a matter of scale. Our experiments on a benchmark of 30 languages per class, which we call SoL (Sets of Languages), reveal that transformers recognize some -trivial and star-free languages but no non-star-free regular languages. All models learn to approximate context-free languages well but struggle to recognize them perfectly. We have publicly released our code.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
- Comments
- 34 pages, 1 figure
Related papers
WISDOM: A Cross-Regional Multilingual Benchmark for Proverbs and Figurative Language
Shared title terminologycs.CLSalmane Chafik, Salima Lamsiyah, Saad Ezzini et al.
Cognitive-Biometric Recognition from Language Usage: A Feasibility Study
Shared title terminologycs.CLNeeti Pokhriyal, Kshitij Tayal, Ifeoma Nwogu et al.
Do Models Fail to Understand Images, or Do Benchmarks Fail to Understand Models? Probing Image Utility and Understanding in MNER
Shared title terminologycs.CLShakib Yazdani, Bela Gipp, Jan Philip Wahle
Not All Evidence Is Equal: Source-Sensitive Calibration in Large Language Models
Shared title terminologycs.CLSercan Karakaş, Yusuf Şimşek
Language models don't add up identities
Shared title terminologycs.CLNisarg Bhavsar
UzBLiMP: A Benchmark of Linguistic Minimal Pairs for Uzbek in Three Alphabets
Shared title terminologycs.CLKattabek Norbaev, Javohir Matniyozov