The Thousand-Graph Hypothesis: A Testable Hypothesis of Task-Conditioned Relation Materialization in Repository-Level Code Reasoning
Organizations: Alibaba Group
Abstract
Large software repositories are often beyond model context limits. Training repository knowledge into models is costly and quickly stale, while local retrieval can miss scattered requirements, and explicit relation graphs add ongoing maintenance burden. We propose an entity-only external interface with task-conditioned relation materialization during inference. A two-layer index separates global routing from local entity focus and is evaluated on DeepSeek-V4-Flash and SWE-bench Verified. The base, one-layer, and two-layer conditions achieve 92.1%, 94.2%, and 95.6% success, respectively, under zero pre-built entity-relation edges.
Figures & tables
| Dimension | Explicit graph | This work |
|---|---|---|
| External state | Entities, edges, schema, graph database | Two-layer entity index |
| Where relations come from | External extraction or inference over source graph | Hypothesis: task-conditioned attention |
| Task adaptation | Fixed graph with local subgraph query | Task-specific transient organization in inference |
| Repository updates | Recompute entities and edges with consistency | Update entities and indexes only |
| Condition | Pre-built relation edges | Success rate (%) |
|---|---|---|
| Base system | none | 92.1 |
| One-layer index | none | 94.2 |
| Two-layer index | none | 95.6 |
| Evidence level | Records |
|---|---|
| Author-reported overall | Half-year-plus usage; 200+ projects; several GitHub fixes |
| Auditable local snapshot | 6 repositories, 52 artifacts |
| Public GitHub subset | 1 repository; 29 merged PRs; 27 explicit-fix PRs |
| Index evolution in repair | 19 index-sync commits; 11 close index+fix sequences |
LLM Reasoning with Graphs
Large language model reasoning with graphs uses structured relationships to support multi-step inference, evidence retrieval, and planning.
See all 211 papers