TL;DR
The paper introduces LLM-FSM, a fully automated and scalable benchmark designed to evaluate how well large language models (LLMs) handle finite-state reasoning when generating hardware code (RTL). By testing 18 frontier models across 1,000 automatically generated and formally verified problems, the authors reveal that even top-tier models struggle as finite-state machine (FSM) complexity scales, but show that both training-time and test-time scaling can significantly mitigate these failures.
What Problem Does This Paper Address?
In hardware design, finite-state reasoning—the ability to understand and implement state-dependent behavior—is foundational. It drives everything from simple controllers to complex network protocols. While LLMs have shown promise in generating Register-Transfer Level (RTL) code (like SystemVerilog) from natural language specifications, evaluating their true hardware reasoning capabilities has been bottlenecked by existing datasets.
Current benchmarks are small, manually written by experts, and combine multiple types of logic, making it impossible to isolate or systematically scale FSM complexity. The authors address this gap by asking: How can we automatically create a large, controllable, and scalable natural language-to-RTL benchmark specifically focused on finite-state reasoning?
Methods
The core innovation of LLM-FSM is its correct-by-construction data curation pipeline, which eliminates manual engineering while ensuring rigorous correctness through formal verification.
The pipeline follows these steps:
- Abstract Graph Generation: The system procedurally samples a valid abstract FSM graph based on user-defined parameters (number of states, transition density, etc.) using a structured, phase-based topology.
- Semantic Enrichment: An LLM takes this abstract graph and invents a realistic hardware scenario (e.g., a Quad-SPI burst-read controller), assigning meaningful names to states, inputs, and outputs, and outputs a structured FSM YAML file.
- Isomorphism & RTL Synthesis: The pipeline verifies that the YAML graph is structurally identical to the abstract graph. It then uses the open-source tool
fsm2svto mechanically compile the YAML into a reference SystemVerilog implementation and generates a testbench that guarantees 100% transition coverage. - NL Specification & Round-Trip Verification: An LLM translates the YAML into a natural language specification. To ensure this specification is unambiguous, a separate LLM attempts to reconstruct the YAML from the text. Finally, a Yosys SAT-solver formally checks that the original and reconstructed RTL designs are behaviorally equivalent.
To evaluate models, the authors design three distinct tool-chain settings: direct RTL generation (Spec→RTL), intermediate structured generation (Spec→YAML→RTL), and high-level hardware language generation (Spec→SystemC).
Datasets
The paper introduces the LLM-FSM benchmark, consisting of 1,000 verified problems categorized into three difficulty tiers based on state counts (ranging from 4 to 59 states) and edge complexity:
- Easy: 4–14 states
- Medium: 14–27 states
- Hard: 27–59 states
For cross-validation and correlation analysis, the authors evaluate the models on two prominent human-written benchmarks: VerilogEval v2 and RTLLM v2.
Key Insights and Ideas
- Complexity is a Sharp Lever: LLM performance is highly sensitive to the number of states and transitions. The procedural generation framework allows researchers to fine-tune task difficulty precisely, providing a benchmark that can scale alongside future model capabilities.
- The SystemC Paradox: Even though SystemC is based on C++ (a language LLMs are highly proficient in), models performed significantly worse generating SystemC than standard Verilog RTL. This highlights a lack of alignment with hardware-compatible high-level languages.
- Synthetic Data Generalizes to OOD Tasks: Supervised Fine-Tuning (SFT) on the Easy and Medium tiers of LLM-FSM allowed models to generalize effectively to the unseen Hard tier (out-of-distribution), and even improved their performance on human-authored benchmarks.
- Parallel Sampling Beats Serial Thinking: When exploring test-time scaling (TTS), generating multiple alternative solutions in parallel (multi-trace sampling, e.g., pass@16) yielded massive performance boosts for FSM reasoning, whereas letting a model "think" longer in a single trace was far less effective.
Key Results
- Frontier Models Struggle: Across 18 frontier models, the overall average Pass@1 accuracy was just 41.1%.
- Top Performers: Claude-4.5-Sonnet achieved the highest overall score at 80.3%, but its performance dropped sharply to 65.6% on the Hard tier. GPT-5 followed closely with an overall score of 75.4%.
- SFT Impact: Fine-tuning a base model like Qwen3-14B on synthetic thinking traces boosted its performance on the Hard (OOD) tier from a dismal 4.5% to 34.3%.
- Human Benchmark Correlation: Model performance on LLM-FSM strongly correlated with human-written benchmarks (Pearson correlation of ~0.82–0.85), proving that the automated benchmark accurately reflects real-world RTL generation capabilities.
Limitations and Future Work
While the SAT-solver ensures that the final dataset contains zero semantic mismatches, the pipeline still relies on an LLM to generate the initial natural language specifications. As a result, the generation pass rate decreases for very large FSMs (dropping to 62.4% for the hard tier), which increases the computational budget required to filter out bad samples.
The authors suggest that future iterations could adopt a hierarchical FSM generation approach to efficiently scale to even larger, industrial-sized hardware designs containing hundreds of states.
Summary updated