Abstractions-of-Thought: Intermediate Representations for LLM Reasoning in Hardware Design

Matthew DeLorenzo, Kevin Tieu, Prithwish Jana, Piyush Jha, Dileep Kalathil, Vijay Ganesh, Jeyavijayan RajendranarXiv 2025 · DOI

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.

The Abstractions-of-Thought (AoT) framework pipeline, illustrating the transition from base prompt to Verilog code through intermediate abstractions.

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.

Comparison of AoT accuracy against baseline and alternative prompting strategies (CoT, SoT, ToT) across multiple LLM configurations.

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

Abstract

Large language models (LLMs) have achieved impressive proficiency on logic and programming tasks, often rivaling expert-level performance. However, generating functionally correct hardware description language (HDL) code from natural language specifications remains challenging, primarily in data-scarce domains. Therefore, we present Abstractions-of-Thought (AoT) - a training-free, inference-only prompting framework to mitigate misinterpretations and reasoning pitfalls of LLMs through a series of task-based abstractions within the prompting procedure, assisting in the transition from high-level to low-level representations of hardware. Furthermore, AoT consists of the following stages: (1) an LLM-based classification of hardware design patterns, (2) a structured intermediate representation (IR) to separate functional decomposition from code syntax, and (3) a line-by-line pseudocode solution enabling a more direct mapping to the final Verilog implementation. Experimental results on the VerilogEval benchmark depict that AoT demonstrates improvements in functionality when applied to large non-reasoning models (such as GPT-4o, outperforming all baseline techniques (including 1-shot, Chain-of-Thought, and Tree-of-Thought) while significantly reducing the generated tokens by 1.8-5.2x compared to popular Tree-of-Thought prompting.
BibTeX
@misc{delorenzo2025abstractions,
  author = {Matthew DeLorenzo and Kevin Tieu and Prithwish Jana and Piyush Jha and Dileep Kalathil and Vijay Ganesh and Jeyavijayan Rajendran},
  title = {{Abstractions-of-Thought: Intermediate Representations for LLM Reasoning in Hardware Design}},
  year = {2025},
  eprint = {2505.15873},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.15873},
}
Figure