Skip to content

Structure-Aware Dependency Retrieval for Repository-Level Code Completion via Graph Attention

Sep 2026 · Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research

Abstract

When Large Language Models (LLMs) write code inside an existing repository, the quality of their output depends heavily on the context they are given. The difficulty is that a function’s docstring rarely mentions the base class, callee, or field the function actually depends on. Lexical and dense retrievers both treat code as flat text, so they tend to miss dependencies that are close in the code structure but share little wording with the query. We address this by building a knowledge graph for each repository. It extends the CodexGraph schema with containment at the repository and directory level, and with call edges that cross file boundaries, resolved through the import graph. On top of this graph, we train a small graph neural network that reranks the top K candidates from a dense retriever by examining each candidate together with its immediate neighbours, using attention that is conditioned on the query. We train and evaluate it on a new benchmark built from CodeSearchNet: 68,685 queries across 294 repositories, with graded relevance labels derived from the code’s syntax trees and no repository shared between training and test. We measure retrieval quality directly and leave end-to-end completion to future work. Over the strongest baseline, which expands BM25 results by one hop in the same graph and reranks them by embedding similarity, our reranker improves NDCG@5 from 12.76 to 17.04, a 33% relative gain that is statistically significant under a paired bootstrap test. Access to the graph alone is not enough, since that baseline barely improves on plain BM25. Ablations show that the gain comes from message passing over the dependency graph rather than from the training labels, with USES edges (calls and variable accesses, resolved across files through imports) carrying most of the signal.

View source

Similar papers

#small language model Dataset Open access Oct 2026

Socratic guiding questions in synthetic arithmetic data: matched LoRA runs (revision v2)

Supporting data, adapters, predictions and code for the article *Low-Cost LoRA Fine-Tuning of Small Language Models for Multi-Step Arithmetic Reasoning* by Jake O'Grady, Asena Isik Gürhan, Chee Fong Ting and Effirul Ramlan (University of Galway). We generated 20,000 GSM8K-derived arithmetic problems with step-by-step s...

O'Grady, Jake, Gürhan, Asena Isik, Chee, Fong Ting et al. · 465 citations
#computer vision Open access Jun 2016

Software Development in Startup Companies: The Greenfield Startup Model

The results are packaged in the Greenfield Startup Model (GSM), which explains the priority of startups to release the product as quickly as possible, and the need to shorten time-to-market, by speeding up the development through low-precision engineering activities.

Carmine Giardino, Nicolò Paternoster, M. Unterkalmsteiner et al. · 178 citations · ⚡14
#computer vision Open access Oct 2016

Software Startups - A Research Agenda

Software startup companies develop innovative, software-intensive products within limited timeframes and with few resources, searching for sustainable and scalable business models.

M. Unterkalmsteiner, P. Abrahamsson, Xiaofeng Wang et al. · 157 citations · ⚡17
#machine learning Review Open access Oct 2016

“Failures” to be celebrated: an analysis of major pivots of software startups

This study conducts a case survey study based on the secondary data of the major pivots happened in 49 software startups, and demonstrates that customer need pivot is the most common among all pivot types.

Sohaib Shahid Bajwa, Xiaofeng Wang, Anh Nguyen-Duc et al. · 127 citations · ⚡15
#computer vision Review Open access May 2015

A survey study on major technical barriers affecting the decision to adopt cloud services

The comparison of adopter and non-adopter sample reveals three potential adoption inhibitor, security, data privacy, and portability, which underlines the importance of the technical and security perspectives for research investigating the adoption of technology.

Nattakarn Phaphoom, Xiaofeng Wang, S. Samuel et al. · 111 citations · ⚡8
#computer vision Open access Feb 2018

Lean Internal Startups for Software Product Innovation in Large Companies: Enablers and Inhibitors

This study investigates how Lean internal startup facilitates software product innovation in large companies and identifies its enablers and inhibitors, and shows the potential of the method-in-action framework to investigate the Lean startup approach in non-startup context.

Henry Edison, Nina M. Smørsgård, Xiaofeng Wang et al. · 78 citations · ⚡6

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.