論文の概要: SemOpt: LLM-Driven Code Optimization via Rule-Based Analysis
- arxiv url: http://arxiv.org/abs/2510.16384v1
- Date: Sat, 18 Oct 2025 07:44:18 GMT
- ステータス: 翻訳完了
- システム内更新日: 2025-10-25 00:56:38.977569
- Title: SemOpt: LLM-Driven Code Optimization via Rule-Based Analysis
- Title(参考訳): SemOpt:ルールベースの分析によるLLM駆動コード最適化
- Authors: Yuwei Zhao, Yuan-An Xiao, Qianyu Xiao, Zhao Zhang, Yingfei Xiong,
- Abstract要約: SemOptは静的プログラム分析を利用して最適化可能なコードセグメントを正確に識別し、対応する最適化戦略を検索し、最適化結果を生成するフレームワークである。
151の最適化タスクを含むベンチマークにおいて、SemOptは、ベースラインに比べて1.38から28倍の最適化を成功させることにより、異なるLLM下での有効性を示す。
- 参考スコア(独自算出の注目度): 7.451702651736553
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Automated code optimization aims to improve performance in programs by refactoring code, and recent studies focus on utilizing LLMs for the optimization. Typical existing approaches mine optimization commits from open-source codebases to construct a large-scale knowledge base, then employ information retrieval techniques such as BM25 to retrieve relevant optimization examples for hotspot code locations, thereby guiding LLMs to optimize these hotspots. However, since semantically equivalent optimizations can manifest in syntactically dissimilar code snippets, current retrieval methods often fail to identify pertinent examples, leading to suboptimal optimization performance. This limitation significantly reduces the effectiveness of existing optimization approaches. To address these limitations, we propose SemOpt, a novel framework that leverages static program analysis to precisely identify optimizable code segments, retrieve the corresponding optimization strategies, and generate the optimized results. SemOpt consists of three key components: (1) A strategy library builder that extracts and clusters optimization strategies from real-world code modifications. (2) A rule generator that generates Semgrep static analysis rules to capture the condition of applying the optimization strategy. (3) An optimizer that utilizes the strategy library to generate optimized code results. All the three components are powered by LLMs. On our benchmark containing 151 optimization tasks, SemOpt demonstrates its effectiveness under different LLMs by increasing the number of successful optimizations by 1.38 to 28 times compared to the baseline. Moreover, on popular large-scale C/C++ projects, it can improve individual performance metrics by 5.04% to 218.07%, demonstrating its practical utility.
- Abstract(参考訳): コードの自動最適化は、コードをリファクタリングすることでプログラムのパフォーマンスを改善することを目的としており、最近の研究は、最適化のためのLLMの利用に焦点を当てている。
既存のアプローチでは、オープンソースのコードベースから大規模な知識ベースを構築するための最適化コミットをマイニングし、次にBM25のような情報検索技術を使ってホットスポットのコード位置に関する適切な最適化例を検索し、それらのホットスポットを最適化するためにLLMを誘導する。
しかし、意味論的に等価な最適化は、構文的に異なるコードスニペットに現れるため、現在の検索手法は、しばしば関連する例を特定するのに失敗し、亜最適最適化性能に繋がる。
この制限により、既存の最適化アプローチの有効性が大幅に低下する。
これらの制約に対処するために,静的プログラム解析を利用して最適化可能なコードセグメントを正確に識別し,対応する最適化戦略を検索し,最適化結果を生成する新しいフレームワークであるSemOptを提案する。
SemOptは、(1)現実世界のコード修正から最適化戦略を抽出し、クラスタ化する戦略ライブラリビルダーである。
2)Semgrep静的解析ルールを生成するルールジェネレータは,最適化戦略の適用条件をキャプチャする。
(3) 最適化されたコード結果を生成するための戦略ライブラリを利用するオプティマイザ。
これら3つのコンポーネントはすべてLLMによって駆動される。
151の最適化タスクを含むベンチマークにおいて、SemOptは、ベースラインに比べて1.38から28倍の最適化を成功させることにより、異なるLLM下での有効性を示す。
さらに、一般的な大規模C/C++プロジェクトでは、個々のパフォーマンス指標を5.04%から218.07%改善し、実用性を示している。
関連論文リスト
- Search-Based LLMs for Code Optimization [16.843870288512363]
開発者によって書かれたコードは、通常効率上の問題に悩まされ、様々なパフォーマンス上のバグを含んでいる。
最近の研究は、タスクをシーケンス生成問題とみなし、大規模言語モデル(LLM)のようなディープラーニング(DL)技術を活用している。
改良された最適化手法の反復的洗練と発見を可能にする,SBLLM という検索ベース LLM フレームワークを提案する。
論文 参考訳(メタデータ) (2024-08-22T06:59:46Z) - Should AI Optimize Your Code? A Comparative Study of Classical Optimizing Compilers Versus Current Large Language Models [0.0]
大規模言語モデル(LLM)は、コード最適化に革命をもたらすAIアプローチの可能性に関する興味深い疑問を提起する。
この作業は、コンパイラコミュニティにとって重要な質問に答えることを目的としている。
本稿では3つの古典最適化コンパイラと2つの最近の大規模言語モデルの比較分析を行う。
論文 参考訳(メタデータ) (2024-06-17T23:26:41Z) - A Problem-Oriented Perspective and Anchor Verification for Code Optimization [43.28045750932116]
大規模言語モデル(LLM)は、様々なプログラミングタスクを解く際、顕著な能力を示している。
本稿では,LLMが最小実行時間に最適化する能力について検討する。
論文 参考訳(メタデータ) (2024-06-17T16:10:10Z) - LLM as a Complementary Optimizer to Gradient Descent: A Case Study in Prompt Tuning [69.95292905263393]
グラデーションベースとハイレベルなLLMは、協調最適化フレームワークを効果的に組み合わせることができることを示す。
本稿では,これらを相互に補完し,組み合わせた最適化フレームワークを効果的に連携させることができることを示す。
論文 参考訳(メタデータ) (2024-05-30T06:24:14Z) - Large Language Models as Optimizers [106.52386531624532]
本稿では,大規模言語モデル (LLM) をプロンプトとして活用するためのシンプルで効果的な手法である Prompting (OPRO) を提案する。
各最適化ステップにおいて、LLMは、前述した値を含むプロンプトから新しい解を生成する。
OPROにより最適化された最良のプロンプトは、GSM8Kで最大8%、Big-Bench Hardタスクで最大50%向上することを示した。
論文 参考訳(メタデータ) (2023-09-07T00:07:15Z)
関連論文リストは本サイト内にある論文のタイトル・アブストラクトから自動的に作成しています。
指定された論文の情報です。
本サイトの運営者は本サイト(すべての情報・翻訳含む)の品質を保証せず、本サイト(すべての情報・翻訳含む)を使用して発生したあらゆる結果について一切の責任を負いません。