Closing the Loop: Universal Repository Representation with RPG-Encoder
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

TL;DR
This paper introduces RPG-Encoder, a novel framework that creates a unified, high-fidelity repository representation to improve code comprehension and generation, achieving state-of-the-art localization and reconstruction accuracy.
Contribution
RPG-Encoder generalizes the Repository Planning Graph into a dynamic, scalable representation that closes the reasoning loop between code understanding and generation.
Findings
Achieves 93.7% Acc@5 on SWE-bench localization
Reduces maintenance overhead by 95.7%
Reaches 98.5% reconstruction coverage on RepoCraft
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Software Engineering Methodologies · Software System Performance and Reliability
