Raiders of the Lost Dependency: Fixing Dependency Conflicts in Python using LLMs

要約

Python依存関係の問題の修正は、サードパーティモジュールとPython通訳者の環境依存関係とバージョンの制約を手動で特定して解決する必要がある開発者にとって、退屈でエラーが発生しやすいタスクです。
研究者は、大規模な知識グラフとデータベースルックアップテーブルに依存することにより、このプロセスを自動化しようとしました。
ただし、これらの従来のアプローチは、依存関係エラータイプの多様性、可能なモジュールバージョンの大きなセット、および推移的依存関係の間の競合により、制限に直面しています。
この研究では、Pythonプログラムの依存関係の問題を自動的に修正するために、大規模な言語モデル(LLMS)を使用する可能性を調査します。
PLLM(「Plum」と発音)を導入します。これは、LLMのImption Pythonバージョンと特定のPythonファイルに必要なモジュールを支援するために、検索された生成(RAG)を採用する新しい手法です。
PLLMは、(1)モジュールの組み合わせのLLMを繰り返しプロンプトするテスト環境を構築し、(2)推奨される変更をテストし、(3)フィードバック(エラーメッセージ)をLLMに提供して修正を改善します。
このフィードバックサイクルは、自然言語処理(NLP)を活用して、ビルドエラーメッセージをインテリジェントに解析および解釈します。
挑戦的なシングルファイルPython GistのコレクションであるGistable Hg2.9KデータセットにPLLMをベンチマークします。
PLLMを2つの最先端の自動依存関係推論アプローチ、つまりPyego and Redpye、W.R.T。
依存関係の問題を解決する能力。
我々の結果は、PLLMが2つのベースラインよりも多くの依存関係の問題を修正できることを示しています。+218( +15.97%)がredpyeよりも多くの修正、+281( +21.58%)がPyegoよりも+281( +21.58%)です。
私たちのより深い分析は、PLLMが多くの依存関係を持つプロジェクトや、特定のサードパーティの数値および機械学習モジュールに特に有益であることを示唆しています。
私たちの調査結果は、Python依存関係の問題を繰り返し解決するLLMベースのアプローチの可能性を示しています。

要約(オリジナル)

Fixing Python dependency issues is a tedious and error-prone task for developers, who must manually identify and resolve environment dependencies and version constraints of third-party modules and Python interpreters. Researchers have attempted to automate this process by relying on large knowledge graphs and database lookup tables. However, these traditional approaches face limitations due to the variety of dependency error types, large sets of possible module versions, and conflicts among transitive dependencies. This study explores the potential of using large language models (LLMs) to automatically fix dependency issues in Python programs. We introduce PLLM (pronounced ‘plum’), a novel technique that employs retrieval-augmented generation (RAG) to help an LLM infer Python versions and required modules for a given Python file. PLLM builds a testing environment that iteratively (1) prompts the LLM for module combinations, (2) tests the suggested changes, and (3) provides feedback (error messages) to the LLM to refine the fix. This feedback cycle leverages natural language processing (NLP) to intelligently parse and interpret build error messages. We benchmark PLLM on the Gistable HG2.9K dataset, a collection of challenging single-file Python gists. We compare PLLM against two state-of-the-art automatic dependency inference approaches, namely PyEGo and ReadPyE, w.r.t. the ability to resolve dependency issues. Our results indicate that PLLM can fix more dependency issues than the two baselines, with +218 (+15.97%) more fixes over ReadPyE and +281 (+21.58%) over PyEGo. Our deeper analyses suggest that PLLM is particularly beneficial for projects with many dependencies and for specific third-party numerical and machine-learning modules. Our findings demonstrate the potential of LLM-based approaches to iteratively resolve Python dependency issues.

arxiv情報

著者 Antony Bartlett,Cynthia Liem,Annibale Panichella
発行日 2025-01-27 16:45:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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