arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.12049cs.LG
收藏

通过实时强化学习与真实机器基准奖励提升LLM的HPC代码生成能力

Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewards

Department of Computer Science, Nagoya University(名古屋大学计算机科学系);Graduate School of Informatics, Nagoya University(名古屋大学信息科学研究生院);Information Technology Center, Nagoya University(名古屋大学信息技术中心)

Ryo Mikasa, Shun-ichiro Hayashi, Daichi Mukunoki, Tetsuya Hoshino, Takahiro Katagiri

AI总结:

本研究通过实时强化学习与真实机器基准奖励提升LLM在HPC领域的代码生成能力。

摘要:

大型语言模型(LLMs)在代码生成方面表现出强大的能力,但生成代码的运行时性能无法保证,在HPC领域利用运行时性能作为奖励训练LLMs的研究尝试很少。我们提出了一种在线强化学习方法,该方法在超级计算机上执行LLM生成的代码,并将测量的运行时性能(GFLOPS)直接作为奖励反馈。我们进一步引入了分阶段质量-多样性(SQD)算法,该算法在问题级别上逐步变化允许的优化技术,使模型能够从不同角度学习代码优化。我们构建了一个连接GPU训练集群和CPU基准测试集群的分布式系统,并使用分组相对策略优化(GRPO)在双精度矩阵乘法任务上训练Qwen2.5 Coder 14B。通过两个实验,我们展示了结合运行时性能反馈和分阶段优化的强化学习可以提升LLM的HPC代码生成能力。

英文摘要:

Large language models (LLMs) have demonstrated strong code generation capabilities, yet the runtime performance of generated code is not guaranteed, and there have been few attempts to train LLMs using runtime performance as a reward in the HPC domain. We propose an online reinforcement learning approach that executes LLM-generated code on a supercomputer and directly feeds back the measured runtime performance (GFLOPS) as a reward. We further introduce a Staged Quality-Diversity (SQD) algorithm that progressively varies the permitted optimization techniques on a per-problem basis, enabling the model to learn code optimization from diverse perspectives. We build a distributed system connecting a GPU training cluster with a CPU benchmarking cluster, and train Qwen2.5 Coder 14B on a double-precision matrix multiplication task using Group Relative Policy Optimization (GRPO). Through two experiments, we show that reinforcement learning combining runtime performance feedback with staged optimization can improve the HPC code generation capability of LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑