ループを閉じる:RPG-Encoderによる普遍的なリポジトリ表現
Closing the Loop: Universal Repository Representation with RPG-Encoder
February 2, 2026
著者: Jane Luo, Chengyu Yin, Xin Zhang, Qingtao Li, Steven Liu, Yiming Huang, Jie Wu, Hao Liu, Yangyu Huang, Yu Kang, Fangkai Yang, Ying Xin, Scarlett Li
cs.AI
要旨
現在のリポジトリエージェントは、断片化された表現による推論の断絶に直面している。既存の手法は、意味論的深みに欠けるAPIドキュメントや依存関係グラフの孤立した利用に依存しているためである。我々は、リポジトリの理解と生成を、統一された循環プロセスにおける逆方向の作業と捉える。つまり、生成は意図を実装へと展開し、理解は実装を意図へと圧縮する。この課題に対処するため、静的な生成設計図であるRepository Planning Graph(RPG)を、統一された高精度表現へと一般化するフレームワーク「RPG-Encoder」を提案する。RPG-Encoderは以下の3つのメカニズムで推論ループを閉じる:(1)生のコードを、意味的特徴とコード依存関係を統合したRPGへエンコードする;(2)トポロジーを段階的に進化させ、メンテナンスコストをリポジトリ規模から分離し、オーバーヘッドを95.7%削減する;(3)構造を意識したナビゲーションの統一インターフェースとして機能する。評価では、RPG-EncoderはSWE-bench Verifiedにおいて93.7%のAcc@5を達成しリポジトリ理解の最新技術を確立、SWE-bench Live Liteでは最高ベースラインを10%以上上回った。これらの結果は、複雑なコードベースにおける優れた細粒度ローカライゼーション精度を実証する。さらにRepoCraftでは98.5%の再構成カバレッジを達成し、RPGが元のコードベースを高精度に反映する能力と、意図と実装の間のループを閉じることを確認した。
English
Current repository agents encounter a reasoning disconnect due to fragmented representations, as existing methods rely on isolated API documentation or dependency graphs that lack semantic depth. We consider repository comprehension and generation to be inverse processes within a unified cycle: generation expands intent into implementation, while comprehension compresses implementation back into intent. To address this, we propose RPG-Encoder, a framework that generalizes the Repository Planning Graph (RPG) from a static generative blueprint into a unified, high-fidelity representation. RPG-Encoder closes the reasoning loop through three mechanisms: (1) Encoding raw code into the RPG that combines lifted semantic features with code dependencies; (2) Evolving the topology incrementally to decouple maintenance costs from repository scale, reducing overhead by 95.7%; and (3) Operating as a unified interface for structure-aware navigation. In evaluations, RPG-Encoder establishes state-of-the-art repository understanding on SWE-bench Verified with 93.7% Acc@5 and exceeds the best baseline by over 10% on SWE-bench Live Lite. These results highlight our superior fine-grained localization accuracy in complex codebases. Furthermore, it achieves 98.5% reconstruction coverage on RepoCraft, confirming RPG's high-fidelity capacity to mirror the original codebase and closing the loop between intent and implementation.