Improving Assembly Code Performance with Large Language Models via Reinforcement Learning

要約

大規模な言語モデル(LLMS)は、幅広いプログラミングタスクで強力なパフォーマンスを実証していますが、コードの最適化の可能性は未定です。
この作業では、LLMSがアセンブリコードのパフォーマンスを最適化できるかどうかを調査します。これにより、実行に対する細かい制御により、高レベルの言語で表現するのが困難な改善が可能になります。
産業標準のコンパイラGCC -O3と比較して、テストケースを通じて検証され、実行パフォーマンスの両方を検討する報酬関数に導かれ、近位ポリシー最適化(PPO)を使用してLLMを訓練する強化学習フレームワークを提示します。
この研究をサポートするために、8,072の実世界プログラムのベンチマークを紹介します。
私たちのモデルであるQWEN2.5-CODER-7B-PPOは、96.0%のテスト合格率とGCC -O3ベースラインで1.47倍の平均スピードアップを達成し、Claude-3.7-Sonnetを含む20の他の20のモデルすべてを上回ります。
これらの結果は、補強学習がLLMの可能性を解き放ち、アセンブリコードのパフォーマンスに効果的な最適化装置として機能することを示しています。

要約(オリジナル)

Large language models (LLMs) have demonstrated strong performance across a wide range of programming tasks, yet their potential for code optimization remains underexplored. This work investigates whether LLMs can optimize the performance of assembly code, where fine-grained control over execution enables improvements that are difficult to express in high-level languages. We present a reinforcement learning framework that trains LLMs using Proximal Policy Optimization (PPO), guided by a reward function that considers both functional correctness, validated through test cases, and execution performance relative to the industry-standard compiler gcc -O3. To support this study, we introduce a benchmark of 8,072 real-world programs. Our model, Qwen2.5-Coder-7B-PPO, achieves 96.0% test pass rates and an average speedup of 1.47x over the gcc -O3 baseline, outperforming all 20 other models evaluated, including Claude-3.7-sonnet. These results indicate that reinforcement learning can unlock the potential of LLMs to serve as effective optimizers for assembly code performance.

arxiv情報

著者 Anjiang Wei,Tarun Suresh,Huanmi Tan,Yinglun Xu,Gagandeep Singh,Ke Wang,Alex Aiken
発行日 2025-05-16 17:40:45+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.PF, cs.PL, cs.SE パーマリンク