ROSUM-MCTS:基于蒙特卡洛树搜索的HDL代码摘要生成与结构奖励
ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewards
AI总结:
提出ROSUM-MCTS方法,利用蒙特卡洛树搜索引导大语言模型,通过分层候选扩展和复合奖励函数优化硬件描述语言代码摘要,在VHDL和Verilog数据集上优于基线方法。
摘要:
大型语言模型(LLMs)在代码摘要方面显示出潜力,但其对硬件描述语言(HDL)如VHDL和Verilog的有效性尚未充分探索。我们提出ROSUM-MCTS,一种受蒙特卡洛树搜索(MCTS)启发的LLM引导方法,通过结构化探索和强化驱动优化来改进摘要。我们的方法通过分层候选扩展机制整合局部和全局上下文,并使用复合奖励函数优化摘要,该函数平衡功能正确性(FC)、局部内容充分性(LCA)和流畅性。我们在VHDL-eval和Verilog-eval数据集上评估ROSUM-MCTS,证明其通过利用结构化自底向上细化和基于强化的优化,持续优于基线方法。消融研究证实了局部和全局扩展策略的必要性,以及平衡FC和LCA以获得最佳性能的重要性。此外,ROSUM-MCTS对表面修改(如变量重命名)具有鲁棒性,在基线性能下降时仍能保持摘要质量。这些结果确立了ROSUM-MCTS作为有效且鲁棒的HDL摘要框架,为进一步研究强化增强的代码摘要铺平了道路。
英文摘要:
Large language models (LLMs) have shown promise in code summarization, yet their effectiveness for Hardware Description Languages (HDLs) like VHDL and Verilog remains underexplored. We propose ROSUM-MCTS, an LLM-guided approach inspired by Monte Carlo Tree Search (MCTS) that refines summaries through structured exploration and reinforcement-driven optimization. Our method integrates both local and global context via a hierarchical candidate expansion mechanism and optimizes summaries using a composite reward function balancing functional correctness (FC), local content adequacy (LCA), and fluency. We evaluate ROSUM-MCTS on the VHDL-eval and Verilog-eval datasets, demonstrating its consistent outperformance over baseline methods by leveraging structured bottom-up refinement and reinforcement-based optimization. Ablation studies confirm the necessity of both local and global expansion strategies, as well as the importance of balancing FC and LCA for optimal performance. Furthermore, ROSUM-MCTS proves robust against superficial modifications, such as variable renaming, maintaining summary quality where baselines degrade. These results establish ROSUM-MCTS as an effective and robust HDL summarization framework, paving the way for further research into reinforcement-enhanced code summarization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。