5 Feb 2024 | Matthew DeLorenzo, Animesh Basak Chowdhury, Vasudev Gohil, Shailja Thakur, Ramesh Karri, Siddharth Garg, Jeyavijayan Rajendran
The paper "Make Every Move Count: LLM-based High-Quality RTL Code Generation Using MCTS" addresses the challenges of generating high-quality, compilable, and PPA-optimized Verilog RTL code using large language models (LLMs). Traditional transformer decoding algorithms lack PPA awareness, leading to issues such as compilation failures and suboptimal performance. To overcome these limitations, the authors propose an automated transformer decoding algorithm that integrates Monte Carlo tree-search (MCTS) for lookahead, guiding the LLM to produce functionally correct and PPA-optimized code.
The key contributions of the paper include:
1. The first technique to enhance LLMs for Verilog generation using MCTS.
2. Overcoming challenges with search space and scalability to practical designs using domain-specific optimizations.
3. Generating functionally correct Verilog codes for various designs, such as adders, multipliers, and MAC units.
4. Leveraging MCTS to produce PPA-optimized codes to meet user objectives using LLMs.
The authors formulate the problem of generating optimal Verilog codes as a Markov decision process (MDP) and use MCTS to solve it. They address two main challenges: the large search space and the lack of scalability to large modules. To reduce the search space, they prune unnecessary paths by removing tokens that do not affect the functionality of the code. To improve efficiency, they reuse optimized modules for smaller sub-components of larger modules.
Experimental results show that the proposed approach consistently generates functionally correct code and achieves significant improvements in the area-delay product (ADP) for the largest design generated by the state-of-the-art LLM (16-bit adder), with a 31.8% improvement. The paper also discusses potential future work, including the possibility of fine-tuning the LLM to further enhance the technique.The paper "Make Every Move Count: LLM-based High-Quality RTL Code Generation Using MCTS" addresses the challenges of generating high-quality, compilable, and PPA-optimized Verilog RTL code using large language models (LLMs). Traditional transformer decoding algorithms lack PPA awareness, leading to issues such as compilation failures and suboptimal performance. To overcome these limitations, the authors propose an automated transformer decoding algorithm that integrates Monte Carlo tree-search (MCTS) for lookahead, guiding the LLM to produce functionally correct and PPA-optimized code.
The key contributions of the paper include:
1. The first technique to enhance LLMs for Verilog generation using MCTS.
2. Overcoming challenges with search space and scalability to practical designs using domain-specific optimizations.
3. Generating functionally correct Verilog codes for various designs, such as adders, multipliers, and MAC units.
4. Leveraging MCTS to produce PPA-optimized codes to meet user objectives using LLMs.
The authors formulate the problem of generating optimal Verilog codes as a Markov decision process (MDP) and use MCTS to solve it. They address two main challenges: the large search space and the lack of scalability to large modules. To reduce the search space, they prune unnecessary paths by removing tokens that do not affect the functionality of the code. To improve efficiency, they reuse optimized modules for smaller sub-components of larger modules.
Experimental results show that the proposed approach consistently generates functionally correct code and achieves significant improvements in the area-delay product (ADP) for the largest design generated by the state-of-the-art LLM (16-bit adder), with a 31.8% improvement. The paper also discusses potential future work, including the possibility of fine-tuning the LLM to further enhance the technique.