Introduction
Generating hardware description language (HDL) code, such as Verilog, presents a unique challenge for Large Language Models (LLMs). Unlike general-purpose programming languages like Python, HDL data is relatively scarce in public training corpora. More importantly, hardware design requires a distinct form of spatial and temporal reasoning; a single natural language requirement often implies complex underlying structures like Finite State Machines (FSMs) or specific gate-level logic.
Standard prompting techniques, including Chain-of-Thought (CoT), frequently fail in this domain because the "reasoning gap" between high-level intent and low-level syntax is too vast. Models often attempt to jump directly to code, resulting in logical hallucinations or functionally broken circuits. To address this, we introduce the Abstractions-of-Thought (AoT) framework, a training-free prompting strategy that mimics human engineering workflows by guiding models through structured levels of hardware-specific abstraction.
The AoT Framework
AoT is an inference-only framework that decomposes the hardware generation task into a three-stage "thinking" pipeline. This structured approach ensures the model solves the underlying logic before committing to specific Verilog syntax.
1. Module Classification
The process begins with the LLM identifying the fundamental nature of the circuit. It classifies the design as either combinational (logic dependent only on current inputs) or sequential (logic involving memory and clocking). This classification is further refined into specific design patterns, such as Truth Tables, Multiplexers (MUX), or FSMs.
2. Hardware Intermediate Representation (IR)
Once the pattern is identified, the model generates a structured JSON object representing the circuit's logic. For an FSM, this IR defines states and transitions; for combinational logic, it might specify a Karnaugh map or Boolean equations. This step decouples functional decomposition from code generation.
3. Line-by-Line Pseudocode
The final abstraction is a natural language "blueprint" that maps the IR to a module structure. This line-by-line pseudocode acts as a bridge, providing a logical skeleton that prevents the model from getting lost in the boilerplate of Verilog syntax.
Experimental Evaluation
The framework was evaluated using the VerilogEval-Human v1.0.0 benchmark, consisting of 156 prompts. Performance was measured by pass@k, specifically focusing on functionality (the probability that a generated solution passes a functional testbench) and compilation rates.
Key Results
AoT demonstrated significant performance gains across a variety of models, including GPT-4o, GPT-4o-mini, and Llama-3.1-8B.
As shown in the results table, AoT consistently outperformed standard strategies. On GPT-4o, AoT achieved a functionality score of 60.4%. Notably, the framework proved exceptionally effective at boosting smaller models. In a multi-model setup—where a larger model (GPT-4o-mini) generates the abstractions and a smaller model (Llama-3.1-8B) performs the final translation—functionality jumped from a baseline of 16.2% to 35.9%, a more than 2x improvement.
Discussion and Efficiency
Beyond accuracy, AoT offers a major advantage in computational efficiency. While methods like Tree-of-Thought (ToT) improve performance through extensive branching and searching, they are prohibitively expensive. AoT provides a single, high-quality reasoning path, reducing the number of generated tokens by 1.8x to 5.2x compared to ToT.
Ablation studies highlighted that line-by-line pseudocode is often the most critical single abstraction, providing the necessary structure for the model to maintain logical consistency throughout the generation process.
Conclusion and Future Work
The Abstractions-of-Thought framework successfully bridges the reasoning gap in hardware design by enforcing a structured hierarchy of intermediate representations. While currently focused on single-module designs, the framework demonstrates that decoupling logic from syntax is a powerful paradigm for engineering-heavy LLM tasks. Future work will explore the scalability of AoT to complex System-on-Chips (SoCs) and its potential application in broader cyber-physical system design.
Summary updated