Can Reasoning Models Reason about Hardware? An Agentic HLS Perspective

Luca Collini, Andrew Hennessee, Ramesh Karri, Siddharth GargarXiv 2025 · DOI

Introduction

The advent of "reasoning" Large Language Models (LLMs), such as DeepSeek-R1 and OpenAI o3-mini, has sparked interest in their application to specialized engineering domains. This paper investigates whether these models, designed for step-by-step Chain-of-Thought (CoT) processing, possess a genuine advantage in hardware design, specifically within the context of High-Level Synthesis (HLS).

The Challenge of HLS Optimization

High-Level Synthesis allows developers to describe hardware using C or C++, which tools then compile into Register-Transfer Level (RTL) logic. Achieving optimal performance requires the manual insertion of "pragmas"—directives that control loop unrolling, pipelining, and array partitioning. This process, known as Design Space Exploration (DSE), is a complex combinatorial problem that typically requires human expertise to balance latency against chip area.

Methodology: An Agentic HLS Framework

To evaluate LLM capabilities, researchers developed an agentic framework that automates HLS optimization in two distinct phases.

The two-phase agentic HLS optimization framework, involving kernel-level optimization and system-level design space exploration.
  1. Kernel-Level Optimization: The LLM generates various implementations of individual functions (kernels) by rewriting code and inserting pragmas. A feedback loop is employed where compilation or functional test errors are returned to the LLM for iterative refinement.
  2. Full-System Optimization: The LLM acts as a system architect. It inspects kernel data, invokes HLS tools for performance metrics, and can even generate Python scripts utilizing Integer Linear Programming (ILP) solvers to find mathematically optimal configurations under area constraints.

Experimental Setup

The framework was tested against 12 benchmarks, including six synthetic benchmarks (SYN1-SYN6) designed to evaluate specific hardware patterns like sequential vs. parallel calls, and six real-world benchmarks such as AES encryption, SHA256 hashing, and FIR+IIR filters.

Results and Discussion

Reliability and Success Rates

A primary finding was the superior reliability of reasoning models. DeepSeek-R1 and o3-mini demonstrated significantly higher success rates in completing the optimization workflow compared to the non-reasoning DeepSeek-V3.

Success rates across benchmarks for DeepSeek-V3, DeepSeek-R1, and o3-mini, highlighting the robustness of reasoning models.

As shown in Figure 4, DeepSeek-R1 was remarkably robust, failing only once across all benchmarks. In contrast, DeepSeek-V3 failed 60% of the time on complex tasks like AES, often due to context window limitations or ineffective code "hallucinations" during bug fixing.

The Parallelism Blind Spot

Despite their reliability, reasoning models struggled with fundamental hardware concepts. Most notably, they often failed to grasp hardware parallelism. While software execution time is typically additive ($A + B$), parallel hardware latency is determined by the maximum path ($max(A, B)$). LLMs frequently defaulted to software-centric logic, summing latencies even when parallel structures were evident. Analysis of DeepSeek-R1’s internal reasoning tokens revealed that the model sometimes "over-analyzed" constraints, leading to confusion and eventual "guessing" rather than precise mathematical modeling.

Optimization Quality

Interestingly, higher reliability did not always translate to superior optimization. For certain modules, such as the AES Cipher, the non-reasoning DeepSeek-V3 produced more efficient designs than its reasoning counterparts when it succeeded. However, the overall agentic workflow—providing tools and feedback—consistently outperformed previous non-agentic LLM methods.

Conclusion

Reasoning LLMs represent a significant step forward in automating hardware design due to their robustness and ability to manage complex workflows. However, their lack of "hardware intuition"—particularly regarding parallelism and data-flow dependencies—remains a critical bottleneck. Future improvements may require domain-specific fine-tuning on HLS reports and hardware dependency graphs to bridge the gap between software logic and hardware reality.

Summary updated

Abstract

Recent Large Language Models (LLMs) such as OpenAI o3-mini and DeepSeek-R1 use enhanced reasoning through Chain-of-Thought (CoT). Their potential in hardware design, which relies on expert-driven iterative optimization, remains unexplored. This paper investigates whether reasoning LLMs can address challenges in High-Level Synthesis (HLS) design space exploration and optimization. During HLS, engineers manually define pragmas/directives to balance performance and resource constraints. We propose an LLM-based optimization agentic framework that automatically restructures code, inserts pragmas, and identifies optimal design points via feedback from HLs tools and access to integer-linear programming (ILP) solvers. Experiments compare reasoning models against conventional LLMs on benchmarks using success rate, efficiency, and design quality (area/latency) metrics, and provide the first-ever glimpse into the CoTs produced by a powerful open-source reasoning model like DeepSeek-R1.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
AESDeepSeek-R1latency736 cyclesarea-target=3800 μm²
Source quote
L200: To better evaluate the models on task~\ding{203}, we reran it in isolation for the AES benchmark, starting from the same subkernel implementations for all models. In this setting, DeepSeek-R1 performed the best, achieving an area of 3596 \mu m^2 (the area target was 3800\mu m^2) and a latency of 736 cycles. DeepSeek-V3's best result reached an area of 3707\mu m^2 and a latency of 763 cycles. o3-mini's best result had an area of 4339\mu m^2 (failing to meet the target area) and a latency of 638 cycles. These results significantly differ from the best overall results, underscoring the impact of task~\ding{202} on achieving strong performance in task~\ding {203}.
AESDeepSeek-V3latency763 cyclesarea-target=3800 μm²
Source quote
L200: To better evaluate the models on task~\ding{203}, we reran it in isolation for the AES benchmark, starting from the same subkernel implementations for all models. In this setting, DeepSeek-R1 performed the best, achieving an area of 3596 \mu m^2 (the area target was 3800\mu m^2) and a latency of 736 cycles. DeepSeek-V3's best result reached an area of 3707\mu m^2 and a latency of 763 cycles. o3-mini's best result had an area of 4339\mu m^2 (failing to meet the target area) and a latency of 638 cycles. These results significantly differ from the best overall results, underscoring the impact of task~\ding{202} on achieving strong performance in task~\ding {203}.
AESo3-minilatency638 cyclesarea-target=3800 μm²
Source quote
L200: To better evaluate the models on task~\ding{203}, we reran it in isolation for the AES benchmark, starting from the same subkernel implementations for all models. In this setting, DeepSeek-R1 performed the best, achieving an area of 3596 \mu m^2 (the area target was 3800\mu m^2) and a latency of 736 cycles. DeepSeek-V3's best result reached an area of 3707\mu m^2 and a latency of 763 cycles. o3-mini's best result had an area of 4339\mu m^2 (failing to meet the target area) and a latency of 638 cycles. These results significantly differ from the best overall results, underscoring the impact of task~\ding{202} on achieving strong performance in task~\ding {203}.
BibTeX
@misc{collini2025can,
  author = {Luca Collini and Andrew Hennessee and Ramesh Karri and Siddharth Garg},
  title = {{Can Reasoning Models Reason about Hardware? An Agentic HLS Perspective}},
  year = {2025},
  eprint = {2503.12721},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.12721},
}
Figure