Reproduce “ContextModule: Improving Code Completion via Repository-level Contextual Information” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Zhanming Guan, Junlin Liu, Jierui Liu, Chao Peng, Dexin Liu, Ningyuan Sun, Bo Jiang, Wenchao Li and 2 more

ByteDance's ContextModule enhances LLM-based code completion by dynamically integrating three types of repository-level context, including user behavior, similar code, and CKG-based symbol definitions. The system, deployed in ByteDance's internal environment, achieved over 15% relative improvement in user acceptance rates.

Key insights

  • Leveraging implicit user behavior (navigation patterns) provides valuable context not captured by semantic similarity alone.
  • A token-based Jaccard similarity with specific feature extraction (Cut Token strategy) proved more effective and efficient for similar code retrieval than embedding-based methods.
  • A proprietary Code Knowledge Graph (CKG) system, with incremental parsing, offers more accurate and significantly faster symbol definition retrieval (within 50ms) compared to traditional Language Server Protocol (LSP) approaches.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.