PrefixAgent : An LLM-Powered Design Framework for Efficient Prefix Adder Optimization

Dongsheng Zuo, Jiadong Zhu, Yang Luo, Yuzhe Ma · 2025

Read PrefixAgent : An LLM-Powered Design Framework for Efficient Prefix Adder Optimization by Dongsheng Zuo, Jiadong Zhu, Yang Luo, Yuzhe Ma (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-06127.txt.

Introduction

Dongsheng Zuo and co-authors use a language model to design prefix adders, the fast addition circuits inside chips. The design space grows explosively with bit width, and older optimizers scale poorly. Their framework splits the job in two: sketch a backbone, then refine local structures, with the model calling design tools and reading feedback.

To train the model, they mined rewrite trails from e-graphs, which explore equal circuit forms systematically. The fine-tuned agent then beats baselines on area in nearly every setup, with the edge growing at larger widths, even under a commercial design flow.

Catalog record

CREATORDongsheng Zuo, Jiadong Zhu, Yang Luo, Yuzhe Ma
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE38 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-06127

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

PrefixAgent : An LLM-Powered Design Framework for Efficient Prefix Adder Optimization Dongsheng Zuo, Jiadong Zhu, Yang Luo, Yuzhe Ma Abstract Prefix adders are fundamental arithmetic circuits, but their design space grows exponentially with bit-width, posing significant optimization challenges. Previous works face limitations in performance, generalization, and scalability. To address these challenges, we propose PrefixAgent , a large language model (LLM)-powered framework that enables efficient prefix adder optimization. Specifically, PrefixAgent reformulates the problem into subtasks including backbone synthesis and structure refinement, which effectively reduces the search space. More importantly, this new design perspective enables us to efficiently collect enormous high-quality data and reasoning traces with E-graph, which further results in an effective fine-tuning of LLM. Experimental results show that PrefixAgent synthesizes prefix adders with consistently smaller areas compared to baseline methods, while maintaining scalability and generalization in commercial EDA flows. I Introduction Adders are fundamental arithmetic components used in digital systems like processors, digital signal processors, and AI chips. Among various adder architectures, the prefix adder is well-known for its parallel structure and efficiency in addition operations. The prefix adder’s internal operation is represented by a prefix graph, where each node computes group propagate and generate signals for rapid parallel carry computation. However, the design space of prefix adders grows exponentially with bit-width, making exhaustive exploration impractical. Traditionally, adder designs rely on regular structures or cumbersome manual optimization. Therefore, developing efficient and flexible adder design methodologies is essential. Previous works on adder design primarily involve regular structures and automated design methods. Regular adder structures such as Kogge–Stone [ 1 ] , Sklansky [ 2 ] , Brent–Kung [ 3 ] , and Han–Carlson [ 4 ] have been proposed, focusing on trade-offs among logic level, maximum fanout, and wiring tracks. However, these regular structures may not satisfy diverse practical requirements. Practical design requires balancing area, delay, and power while considering timing constraints as well as various input arrival time profiles. Consequently, various heuristics and search-based methods are proposed [ 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 ] , which improve the design efficiency to some extent. However, it is difficult to design a generic optimization approach that can cover a rich set of design scenarios. In addition, a non-trivial gap remains between structural-level metrics and physical-implementation metrics. Machine learning (ML) methods have been proposed to bridge this gap. Recent works [ 15 , 16 , 17 ] utilized ML models to predict the metrics and optimize designs over pruned adder solution spaces. More recently, reinforcement learning (RL) [ 18 , 19 , 20 , 21 , 22 ] , variational autoencoder (VAE) [ 23 ] , and Monte Carlo tree search (MCTS) [ 24 ] methods have demonstrated progress in arithmetic circuit optimization tasks. These methods iteratively modify structures, guided by actual physical metrics. However, these methods suffer from challenges in generalization and scalability due to the extensive training required for each new scenario and the inefficiency of trial-and-error exploration in large action spaces. Fig. 1: The two-phase framework in PrefixAgent . Inspired by manual design practices, experienced engineers typically choose a suitable initial structure based on design specifications and refine it using detailed feedback from EDA tools. Although effective, this process requires significant engineering effort. An intelligent agent with strong reasoning and interactive capabilities can automate the design process, addressing generalization challenges and enabling more efficient, scalable optimization. Motivated by this, emerging large language models (LLMs) provide a promising solution to further automate and optimize the prefix adder design process. Recent advancements in large reasoning models (LRMs) [ 25 , 26 , 27 , 28 , 29 ] have demonstrated their powerful reasoning capabilities and potential for solving complex problems. In circuit design tasks, LLMs also have shown potential in analog circuit design [ 30 , 31 , 32 ] and RTL code design [ 33 ] . However, applying LRMs to the prefix adder design task still faces two main challenges. The first challenge is the limited capability of large models to efficiently generate and reason about complex graphs with more than 20 nodes [ 34 , 35 , 36 ] . This issue is particularly evident in the EDA domain, where existing LLM-based methods have shown promise for small graph circuits, such as analog circuits with fewer than 10 nodes [ 30 , 31 ] . Recent work [ 37 ] attempts to employ LRMs to generate textual representations of prefix graphs; however, it still faces graph reasoning challenges. Specifically, the node count in a prefix graph theoretically scales quadratically with bit-width, and these graphs must adhere to stringent structural constraints, further complicating the generation process. The second challenge is the lack of high-quality data, which is essential for fine-tuning LRMs on the prefix adder design task—an inherently complex and previously unseen problem. Recent studies highlight the importance of high-quality data in improving the reasoning capabilities of LRMs [ 38 , 39 , 40 ] . However, simple random data generation or perturbation-based strategies are ineffective in producing meaningful optimization traces for training. In this paper, we propose PrefixAgent , an LLM-powered framework that enables efficient prefix adder optimization. The overall workflow of the framework is illustrated in Figure 1 . To address LLMs’ limitations on complex graphs, our framework considers the prefix adder design problem from a new perspective, which decomposes the prefix adder synthesis task into two subtasks, including prefix adder backbone generation and local structure refinement . The backbone, representing the critical structural component of the adder, significantly simplifies the overall design complexity. The new perspective also enables the LLMs to efficiently generate zero-deficiency [ 41 ] or low-deficiency adders. Rather than requiring the LLMs to generate fully valid prefix structures with high complexity, our PrefixAgent adopts the tool-integrated reasoning (TIR) technique [ 42 , 43 ] , which delegates precise local modifications to external tools during the reasoning process. This empowers the LLM’s reasoning capabilities, allowing it to focus on high-level decision-making. Furthermore, building upon the backbone generation, we observed a correspondence between backbone optimization and E-graph-based rewriting. This enables us to gather high-quality data and interpretable reasoning traces using E-graphs, successfully addressing the second challenge in applying LLM agents. By fine-tuning the LLM on these carefully curated datasets, PrefixAgent learns to efficiently optimize adders under various scenarios and design requirements. Experimental results demonstrate that PrefixAgent exhibits strong generalization and scalability across various design scenarios. Furthermore, under commercial physical design flows, it achieves better results than adders generated by commercial synthesis tools. The key contributions of this work are summarized as follows: • We propose PrefixAgent , an LLM-powered framework for efficient prefix adder optimization, representing the first LLM-based approach that scales to 64-bit designs and outperforms commercial tools. • A new design perspective is proposed for the prefix adder, which consists of backbone generation and local refinement. An agent is utilized to perform reasoning for efficient backbone synthesis and targeted optimization. • Owing to the new design perspective, we can utilize the E-graph-based method to systematically generate comprehensive, interpretable, and high-quality optimization traces for this problem, enabling effective fine-tuning of the agent. • Experimental results show that PrefixAgent consistently synthesizes prefix

Read the complete text