Source-linked AI summary

The Thousand-Graph Hypothesis: A Testable Hypothesis of Task-Conditioned Relation Materialization in Repository-Level Code Reasoning

Fei Ding

arXiv:2608.26602v1cs.SEcs.CL

TL;DR

Large, changing repositories challenge context-limited reasoning because training becomes stale, retrieval can miss scattered requirements, and explicit graphs require maintenance. The paper tests an entity-only interface that materializes task-conditioned relations during inference through two-layer indexing. In the controlled evaluation, two-layer indexing reaches 95.6% success under zero pre-built entity-relation edges, compared with 92.1% for the base and 94.2% for one-layer conditions.

  • Problem

    Repository-level reasoning lacks a low-maintenance way to organize scattered, evolving repository knowledge within limited context without repeated training or persistent relation graphs.

  • Method

    The paper uses persistent entities and indexes while task-conditioned relations are materialized transiently during inference through a two-layer interface.

  • Results

    95.6% success is achieved by the two-layer condition versus 92.1% for base and 94.2% for one-layer conditions, with zero pre-built entity-relation edges.

  • Takeaways & Limitations

    The controlled evidence supports task-conditioned relation materialization as a repository reasoning mechanism without persistent external relation edges.

  • Takeaways & Limitations

    The current scope does not directly establish internal causal mechanisms, cross-model generality, or full long-term cost accounting.

Abstract

from arXiv · show

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.

1 INTRODUCTION

Repository-level code reasoning must handle large, evolving repositories while preserving task-critical signals. The paper proposes persistent entities with task-conditioned relations materialized during inference, supported by a two-layer interface.

  • Motivation: Large repositories exceed model context windows and continuously change through commits, refactoring, migration, and requirement updates.These dynamics make repository knowledge both difficult to process and difficult to keep current.
  • Motivation: Larger context windows still suffer positional decay and evidence interference that reduce effective use of key signals.
  • Motivation: Existing routes trade off cost, freshness, retrieval coverage, and maintenance: trained knowledge becomes stale, local retrieval can miss cross-file entities, and explicit graphs require updates and consistency work.
  • Hypothesis: The Thousand-Graph Hypothesis proposes storing entities without pre-built edges and temporarily materializing task-specific relations once relevant entities enter context.
  • Approach: A two-layer entity index separates global routing from local entity focus while assembling task-specific inputs from persistent entities and zero pre-built edges.
  • Contributions: The paper contributes a task framing, a mechanism hypothesis, a scalable global-local interface, controlled benchmark evidence, and a deployment note distinguishing reported usage from auditable evidence.

2 THE CONTINUOUS KNOWLEDGE GAP

Repository knowledge is a long-tail, evolving-state problem: tasks touch scattered entities while context budgets limit flat inclusion. The paper asks how to organize entities at inference without repeated training or persistent relation maintenance.

  • Problem: Repositories evolve over time, and tasks may touch scattered entities across files and modules.
  • Problem: When flat entity candidates exceed the effective context budget B, feeding all repository information at once becomes infeasible.
  • Existing tradeoffs: Training repository knowledge into model parameters is expensive and requires repeated updates, while local retrieval may miss cross-file constraints.
  • Existing tradeoffs: The three established tracks are training into the model, on-demand retrieval, and external explicit graphs, respectively characterized as stale, potentially incomplete, and costly to maintain.
  • Research question: The central question is how to solve repository-level tasks without repeated full training or long-term external relation maintenance while organizing entities during inference.
  • Entity representation: The proposed external state extracts a repository entity set V(R), with each entity carrying content or summary and metadata such as type, path, span, signature, and responsibility tag.

3 RELATED WORK

Related work spans retrieval-oriented agents and explicit repository graphs. These approaches improve search or structured navigation but generally retain external relation objects and their lifecycle requirements.

  • Positioning: The paper positions its approach against systems that externalize relations, emphasizing a distinction between persistent entities and task-time relation formation.
  • Retrieval systems: Retrieval-oriented agents improve repository search through iterative retrieval, selective retrieval, or hierarchical structure.
  • Explicit graphs: Explicit-graph systems build graph-based navigation or retrieval structures, with some maintaining multi-view graphs or task-conditioned chain prediction.
  • Lifecycle costs: Explicit relations require schema design, extraction, cross-file linking, storage, and update workflows.

4 TWO-LAYER REPOSITORY ENTITY INTERFACE

The proposed interface keeps entities and indexes externally while routing tasks globally and selecting local entities before reasoning. Its task input contains entity content but no pre-built relation edges.

  • External state: The external state includes entities and indexes only, rather than persistent external relation edges.
  • Global routing: Layer 1 returns a compact candidate set from repository-level modules and responsibilities.
  • Local focus: Layer 2 selects local task-relevant entities within each candidate domain.
  • Prompt assembly: The final task input contains tasks and entity content, not pre-built relation edges.
  • End-to-end process: The process combines persistent extraction, global routing, local entity selection, prompt assembly, reasoning, and test-validated patch updates.
  • Boundary: Compared with explicit-graph systems that maintain (V, E), this approach keeps only V externally.

5 THE THOUSAND-GRAPH HYPOTHESIS: IMPLICIT RELATION MATERIALIZATION

The Thousand-Graph Hypothesis proposes that repositories need persist entities rather than pre-built edges, with task-specific relations materialized during inference. It predicts task-sensitive latent graphs and tests zero-edge feasibility through controlled coverage and indexing conditions.

  • Hypothesis: The Thousand-Graph Hypothesis treats task-time relation materialization as a latent quantity rather than an explicitly stored external graph.The paper does not output or persist the inferred edges.
  • Hypothesis: For different tasks in the same repository, the hypothesis predicts different latent task graphs, but not as a deterministic consequence of input differences alone.The prediction is behavioral and task-conditioned.
  • Predictions: Task sensitivity means that relevant entities and interactions differ by task.This is one of the hypothesis's stated empirical predictions.
  • Predictions: Zero-edge feasibility means repository repair can still succeed without pre-built edges when task entities enter context.The experiments directly test this prediction.
  • Predictions: Missing entity coverage hurts success, while higher coverage improves it.The paper tests this coverage effect indirectly through layer ablations.

6 CONTROLLED EXPERIMENT

The controlled experiment evaluates base, one-layer, and two-layer conditions on SWE-bench Verified with DeepSeek-V4-Flash, while keeping all conditions free of pre-built entity-relation edges. The two-layer design achieves the highest reported success.

  • Design: The evaluation compares three conditions on SWE-bench Verified using DeepSeek-V4-Flash.The listed base system has no entity index.
  • Design: All conditions use no pre-built entity-relation edges, isolating the effect of the indexing conditions.The zero-edge constraint is shared across the comparison.
  • Results: 95.6% success is achieved by the two-layer design, versus 92.1% for base and 94.2% for one-layer.The two-layer design gains 3.5 points over base and 1.4 points over one-layer.
  • Results: Table 2 reports DeepSeek-V4-Flash results on SWE-bench Verified.The table is the experiment's named evaluation display.

7 LONG-TERM PRACTICE

The paper reports usage across more than 200 projects over half a year, alongside a smaller currently auditable subset. The auditable evidence supports deployment viability but does not directly prove causal effect.

  • Reported practice: The authors report over half a year of usage, participation in more than 200 projects, and multiple public GitHub fixes.These figures describe reported long-term practice.
  • Auditable subset: The currently auditable subset contains 6 repositories and 52 validation artifacts.Its upper-bound public baseline date is 2026-07-29.
  • Auditable subset: The auditable subset includes 29 merged PRs in one open repository, 27 with explicit fix commits.This narrows the public evidence to a specific repository-level subset.
  • Scope: Table 3 contrasts reported scale with the auditable subset.The table frames the distinction between broad reported usage and currently auditable evidence.

8 CONCLUSION AND BOUNDARY

The paper concludes that two-layer indexing reaches 95.6% success under zero-edge constraints, while bounding the claim to its controlled setting. It does not establish internal causal mechanisms, cross-model generality, or full long-term cost accounting.

  • Conclusion: 95.6% success is attained by two-layer indexing under zero-edge constraints, outperforming one-layer and base conditions.The conclusion presents this result within the controlled setting.
  • Conclusion: The Thousand-Graph Hypothesis is framed as a mechanism hypothesis combining persistent entities, task-time relation materialization, and no pre-built external relation graph.This states the paper's central proposed mechanism.
  • Boundary: The current scope does not directly establish internal causal mechanisms, cross-model generality, or full long-term cost accounting.These are explicit boundaries of the conclusion.

AI STATEMENT

Generative AI supported drafting, refinement, and figure preparation, while authors retained responsibility for the paper’s core ideas, methods, implementations, and results.

  • Generative AI tools supported drafting and refinement, including wording polish, falsifiability checks, LaTeX adjustments, and figure preparation.
  • The authors provided and approved the core ideas, experimental methods, implementations, and results.
  • AI tools did not replace the experiments or alter the primary observed outcomes.

REPRODUCIBILITY STATEMENT

The release package is intended to support auditing by providing materials for the model, benchmark, controlled conditions, and SWE-bench runs.

  • The study reports the base model, public benchmark, and three controlled conditions.
  • Index-construction scripts, prompts, configurations, and prediction logs will be included in the release package.
  • The release package will also include SWE-bench run logs for the auditable subset.
Loading 2608.26602v1…