要約
大規模な言語モデル(LLMS)の出現は、コード生成タスクの開発を大幅に促進し、関連する文献の急増を引き起こしました。
現在の研究は、冗長生成の結果と短期的にローカルパターンを過剰に抑える傾向によって妨げられています。
既存の研究は、マルチトークン予測戦略を採用することにより問題を軽減しようとしますが、世代に適した処理長を選択することに焦点が留められています。
LLMSの生成プロセス中のトークン間の注意を分析することにより、注意スコアの高いスパイクが通常、行の最後に表示されることが観察できます。
この洞察は、コードの各行を基本処理装置として扱い、それらを連続的に生成することが合理的であることを示唆しています。
これに触発されて、\ textbf {lsr-mcts}アルゴリズムを提案します。これは、MCTを活用してコードラインバイラインを決定し、最適なパスを選択します。
さらに、各ノードで自己反復メカニズムを統合して、多様性を高め、エラー修正を通じて高品質のプログラムを生成します。
3つのパブリックコーディングベンチマークでの広範な実験と包括的な分析は、この方法が最先端のパフォーマンスアプローチを上回ることを示しています。
要約(オリジナル)
The emergence of large language models (LLMs) has significantly promoted the development of code generation task, sparking a surge in pertinent literature. Current research is hindered by redundant generation results and a tendency to overfit local patterns in the short term. Although existing studies attempt to alleviate the issue by adopting a multi-token prediction strategy, there remains limited focus on choosing the appropriate processing length for generations. By analyzing the attention between tokens during the generation process of LLMs, it can be observed that the high spikes of the attention scores typically appear at the end of lines. This insight suggests that it is reasonable to treat each line of code as a fundamental processing unit and generate them sequentially. Inspired by this, we propose the \textbf{LSR-MCTS} algorithm, which leverages MCTS to determine the code line-by-line and select the optimal path. Further, we integrate a self-refine mechanism at each node to enhance diversity and generate higher-quality programs through error correction. Extensive experiments and comprehensive analyses on three public coding benchmarks demonstrate that our method outperforms the state-of-the-art performance approaches.
arxiv情報
著者 | Tingwei Lu,Yangning Li,Liyuan Wang,Binghuai Lin,Jiwei Tang,Wanshi Xu,Hai-Tao Zheng,Yinghui Li,Bingxu An,Zhao Wei,Yong Xu |
発行日 | 2025-04-18 17:03:01+00:00 |
arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google