TL;DR
The paper introduces RELIC, a novel evaluation framework that tests Large Language Models (LLMs) on their ability to determine if a string belongs to a formal context-free language presented in-context. The study reveals a striking phenomenon: as task complexity scales up, even state-of-the-art reasoning models fail to allocate more test-time compute, effectively "quiet quitting" by abandoning systematic algorithmic reasoning in favor of shallow heuristic guessing.
What Problem Does This Paper Address?
Evaluating how LLMs handle complex, multi-step reasoning is notoriously difficult. Real-world benchmarks often suffer from data contamination (where the model has already seen the test data during training) and lack precise controllability over task difficulty.
To address this, the authors turn to formal language theory—specifically, context-free grammar (CFG) recognition. By asking an LLM to decide whether a specific string can be generated by a given grammar, the task's intrinsic difficulty can be precisely dialed up or down by changing the grammar size or string length. This provides a clean, verifiable sandbox to test how well LLMs retrieve, compose, and search through dense in-context information as problems grow harder.
Methods
The authors developed the REcognition of Languages In-Context (RELIC) framework. The pipeline operates in three main steps:
- Grammar Generation: Stochastically generating unique context-free grammars in Chomsky Normal Form.
- String Sampling: Generating positive strings (validly parsed by the grammar) and negative strings (invalid).
- Prompting: Presenting the grammar and a target string to the LLM zero-shot, asking it to output "Yes" or "No".
To understand how the models were thinking, the authors used an "LLM-as-a-judge" framework (powered by GPT-5) to analyze the models' Chain-of-Thought (CoT) traces, categorizing their strategies as either rule-based (systematic parsing) or heuristic (guessing based on superficial patterns like string length).
Datasets
The paper introduces RELIC-500, a static evaluation benchmark consisting of:
- 200 stochastically generated grammars with up to 500 nonterminal production rules, optimized to ensure the structural parameters are minimally correlated.
- Positive and negative evaluation strings ranging from 1 to 50 symbols in length.
Because the grammars are synthetically generated from an astronomical space of possibilities, the risk of data contamination is virtually zero.
Key Insights and Ideas
- LLMs "Quiet Quit" on Hard Tasks: Theoretically, parsing longer strings requires a superlinear increase in computational steps. However, as strings got longer, the models' test-time compute (measured by the number of reasoning tokens generated) actually decreased after an early peak. Instead of trying harder, the models silently shifted from rigorous rule-based processing to superficial guessing.
- The Dense Context Trap: LLMs are frequently evaluated on their ability to find information in long contexts (e.g., "needle-in-a-haystack" tests). RELIC highlights a different bottleneck: dense context use. Even though the prompts were small enough to easily fit into standard context windows, the highly compositional, non-monotonic nature of searching through grammar rules caused severe model degradation.
- Fine-Tuning is Not a Quick Fix: Directly fine-tuning smaller models (like Gemma 3) on RELIC data yielded no statistically significant performance gains. This indicates that the failure is rooted in a fundamental limitation in executing complex reasoning algorithms, rather than a failure to understand the prompt instructions.
Key Results
The authors evaluated eight prominent LLMs, including OpenAI's o3, o4-mini, the gpt-4.1 family, Google's gemma-3, and DeepSeek-R1-Distill-Qwen-7B.
- Performance Collapse: While most models performed well on very small grammars and short strings, accuracy plummeted to near-chance (50%) as grammar size approached 500 productions or string length approached 50 symbols.
- Top Performer: OpenAI’s
o3achieved the highest overall class-balanced accuracy at 70.4%, followed bygpt-4.1-miniat 63.4%.
- Compute vs. Strategy: Qualitative analysis of the reasoning traces showed that the drop-off in accuracy perfectly mirrored the point where models ran out of steam, stopped generating reasoning tokens, and abandoned rule-based strategies for heuristics.
Limitations and Future Work
- Task Familiarity: While the specific generated grammars are entirely novel, the models may have encountered the general concept of CFG parsing (like the Cocke-Younger-Kasami algorithm) during pre-training, meaning the benchmark measures the application of known concepts rather than the discovery of novel solutions.
- CoT Soundness: The LLM-judge categorized whether a model attempted a rule-based strategy, but it did not verify if the internal steps of that strategy were mathematically flawless. The authors note that the actual rate of flawless rule-based execution might be lower than reported.
- Future Directions: The authors suggest expanding the framework to even harder language classes (like context-sensitive languages) to mimic complex programming language features like C macros, and exploring whether training models on highly structured step-by-step derivations can alleviate the "quiet quitting" problem.
Summary updated