arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2602.07032cs.AIcs.ARcs.CL
收藏

LLM-FSM: 通过大规模语言模型扩展有限状态推理用于RTL代码生成

LLM-FSM: Scaling Large Language Models for Finite-State Reasoning in RTL Code Generation

Stanford University(斯坦福大学)

Yuheng Wu, Berk Gokmen, Zhouhua Xie, Peijing Li, Caroline Trippel, Priyanka Raina, Thierry Tambe

AI总结:

LLM-FSM通过大规模语言模型评估有限状态机在RTL代码生成中的表现,展示了模型在复杂性增加时的准确性下降及训练和测试扩展的影响。

摘要:

有限状态推理,即理解并实现状态依赖行为的能力,是硬件设计的核心。本文提出了LLM-FSM,一个评估大规模语言模型(LLMs)从自然语言规范中恢复有限状态机(FSM)行为并将其转换为正确寄存器传输级(RTL)实现能力的基准。与以往依赖人工构造示例的规范到RTL基准不同,LLM-FSM通过完全自动化流程构建。LLM-FSM首先构建具有可配置状态数和受约束转换结构的FSM。然后提示LLMs以结构化的YAML格式表达每个FSM并附加应用上下文,并进一步将该YAML转换为自然语言(NL)规范。从相同的YAML中,我们的流程以正确构造的方式合成参考RTL和测试平台。所有1000个问题均通过LLM基于和SAT求解器基于的检查进行验证。我们的实验表明,即使是最强的LLMs在FSM复杂性增加时也表现出明显下降的准确性。我们进一步证明,通过监督微调(SFT)的训练时间扩展可以有效地推广到分布外(OOD)任务,而增加测试时间计算量可以提高推理可靠性。最后,LLM-FSM通过允许其FSM复杂性随未来模型能力扩展而保持可扩展性。

英文摘要:

Finite-state reasoning, the ability to understand and implement state-dependent behavior, is central to hardware design. In this paper, we present LLM-FSM, a benchmark that evaluates how well large language models (LLMs) can recover finite-state machine (FSM) behavior from natural-language specifications and translate it into correct register transfer-level (RTL) implementations. Unlike prior specification-to-RTL benchmarks that rely on manually constructed examples, LLM-FSM is built through a fully automated pipeline. LLM-FSM first constructs FSM with configurable state counts and constrained transition structures. It then prompts LLMs to express each FSM in a structured YAML format with an application context, and to further convert that YAML into a natural-language (NL) specification. From the same YAML, our pipeline synthesizes the reference RTL and testbench in a correct-by-construction manner. All 1,000 problems are verified using LLM-based and SAT-solver-based checks, with human review on a subset. Our experiments show that even the strongest LLMs exhibit sharply declining accuracy as FSM complexity increases. We further demonstrate that training-time scaling via supervised fine-tuning (SFT) generalizes effectively to out-of-distribution (OOD) tasks, while increasing test-time compute improves reasoning reliability. Finally, LLM-FSM remains extensible by allowing its FSM complexity to scale with future model capabilities.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑