A Regex Minimization Benchmark: A PSPACE-Complete Challenge for Language Models

Hyundong Jin, Joonghyuk Hahn, Yo-Sub Han


Abstract
Language models (LMs) have shown impressive reasoning capabilities across various domains. A fundamental question is the extent of their reasoning power. While recent studies show that LMs can solve NP-complete problems, their ability to handle PSPACE-complete problems remains underexplored. We investigate regex minimization as a PSPACE-complete challenge for LMs to address this issue. Regexes, formal expressions for regular languages widely used in NLP, software engineering (SE), and programming language (PL), are supported by several efficient tools for their manipulation grounded in theoretical backgrounds. Inspired by this, we introduce the first benchmark for regex minimization containing over a million regexes paired with their minimal equivalents. Through extensive experiments with two LMs trained on our dataset and five open-source large language models (LLMs), we analyze how well LMs perform on PSPACE-complete problems, highlighting their capabilities of generalization and limitations in reasoning. To the best of our knowledge, this is the first study to systematically evaluate LM reasoning in regex minimization and establish a foundation for solving PSPACE-complete problems with LMs. Our code is available at https://github.com/hyundong98/RegexPSPACE.
Anthology ID:
2026.eacl-long.375
Volume:
Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
March
Year:
2026
Address:
Rabat, Morocco
Editors:
Vera Demberg, Kentaro Inui, Lluís Marquez
Venue:
EACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
8020–8048
Language:
URL:
https://preview.aclanthology.org/ingest-eacl/2026.eacl-long.375/
DOI:
Bibkey:
Cite (ACL):
Hyundong Jin, Joonghyuk Hahn, and Yo-Sub Han. 2026. A Regex Minimization Benchmark: A PSPACE-Complete Challenge for Language Models. In Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8020–8048, Rabat, Morocco. Association for Computational Linguistics.
Cite (Informal):
A Regex Minimization Benchmark: A PSPACE-Complete Challenge for Language Models (Jin et al., EACL 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-eacl/2026.eacl-long.375.pdf