arXiv論文メモ
新着一覧
cs.SE / cs.AI · 査読状況未確認

機能から必要なコードを探す動的グラフ検索

FeatLens: Feature-Guided Dynamic Code Graph Construction and Retrieval for Repository-Level Code Generation

Xutian Li, Bo Xiong, Yifeng Zhu, Kunze Li, Xianlin Zhao, Runbang Yan, Yanzhen Zou, Lu Zhang, Bing Xie

この論文をやさしく読む

ひとことで言うと

リポジトリ内の関数を作る際、必要な既存コードを機能説明から小さなグラフとして探す方法。

何に役立つ?

大規模なコードベースで依存先を探す際の検索費用削減に役立つ可能性がある。

この研究の面白いところ

常設の全体グラフや言語モデルの探索を使わず、課題ごとに小さなグラフを作って検索する。

どこまで分かった?

数値はDevEvalとEvoCodeBenchなど記載された評価での結果。DR@15やDIR@1の向上と、生成コードのPass@1は異なる指標である。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

近年のコード生成研究は、単独の関数補完から、既存コードベース内でのリポジトリ単位の生成へ移っている。対象の関数を正しく実装するには、既存の関数、API、別ファイルの定義など、再利用できる依存先を大規模言語モデルが見つける必要がある。従来の検索はコードの類似検索、リポジトリ全体の常設グラフ、言語モデルによるグラフ探索などで文脈を与えるが、グラフ構築、推論、トークンの費用が高くなりがちである。機能を中心に見る方法はソフトウェアの機能を自然に表せるが、主に要件分解、計画、機能編集に使われ、コードの依存関係検索には使われてこなかった。本研究は、機能に導かれる動的なコードグラフ構築・検索法FeatLensを提案する。自然言語による機能の説明を関数単位のコード要素へ結び付ける機能索引を作り、生成課題が与えられると、その索引から課題固有の起点グラフを動的に構築する。個人化PageRankを用いた意味・構造両面のグラフ推論により、コンパクトな推論用グラフを選ぶ。これにより、リポジトリ全体の常設グラフ維持と言語モデルによる探索を、決定的で軽量な依存関係検索に置き換える。DevEvalとEvoCodeBenchでの実験では、疎検索、密検索、グラフ型の基準法の中でDR@15が最高となり、それぞれ0.501、0.460だった。DevEvalの生成ではDIR@1が最高となり、DeepSeek-V3.2で52.91%、GPT-5-miniで53.58%に達し、Pass@1は競争力を保ち、生成コードは短かった。最も強いグラフ型基準法と比べ、グラフのノードを61.0%、辺を86.2%、総トークン負担を45.9%減らし、検索中には言語モデルのトークンを使用しなかった。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-22(UTC)
最新改訂
2026-09-22 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Recent code generation research has moved from isolated function completion toward repository-level generation in existing codebases. To implement a target function correctly, an LLM must identify reusable repository dependencies such as existing functions, APIs, and cross-file definitions. Existing retrieval methods provide such context through code similarity search, persistent whole-repository graphs, or LLM-driven graph exploration, but often incur high graph construction, reasoning, and token costs. Feature-oriented methods offer a natural view of software functionality, yet they mainly support requirement decomposition, planning, or feature editing rather than code dependency retrieval. This paper presents \textbf{FeatLens}, a feature-guided dynamic code graph construction and retrieval approach for repository-level code generation. FeatLens builds a feature index that links natural-language feature descriptions to function-level code entities. Given a generation task, it dynamically constructs a task-specific seed graph from the feature index and applies semantic-structural graph reasoning with personalized PageRank to select a compact reasoning graph. This design replaces persistent whole-repository graph maintenance and LLM exploration with deterministic and lightweight dependency retrieval. Experiments on DevEval and EvoCodeBench show that FeatLens achieves the best DR@15 among sparse, dense, and graph-based baselines (0.501 and 0.460). On DevEval generation, it obtains the highest DIR@1, reaching 52.91\% with DeepSeek-V3.2 and 53.58\% with GPT-5-mini, while maintaining competitive Pass@1 and producing shorter code. Compared with the strongest graph-based baseline, FeatLens reduces graph nodes by 61.0\%, edges by 86.2\%, and total token overhead by 45.9\%, with no LLM tokens used during retrieval.

arXiv ID: 2609.26480 / 要約の誤りについて