CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Context
Not on the map. Why?
Abstract (arXiv)
While pre-trained language models (LM) for code have achieved great success in code completion, they generate code conditioned only on the contents within the file, i.e., in-file context, but ignore the rich semantics in other files within the same project, i.e., cross-file context, a critical source of information that is especially useful in modern modular software development. Such overlooking constrains code language models' capacity in code completion, leading to unexpected behaviors such as generating hallucinated class member functions or function calls with unexpected arguments. In this work, we develop a cross-file context finder tool, CCFINDER, that effectively locates and retrieves the most relevant cross-file context. We propose CoCoMIC, a framework that incorporates cross-file context to learn the in-file and cross-file context jointly on top of pretrained code LMs. CoCoMIC successfully improves the existing code LM with a 33.94% relative increase in exact match and a 28.69% relative increase in identifier matching for code completion when the cross-file context is provided.
Key facts. Cited by 64 papers in the map (data through 7 Oct 2026). Builds on 29 of its 61 references that are in the map. First posted on arXiv 20 Dec 2022.
Builds on
29 of 61 references.
References · 29
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2017Graph Attention Networkscited by 8,854
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2022Survey of Hallucination in Natural Language Generationcited by 2,056
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
17 more
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2019Quantifying the Carbon Emissions of Machine Learningcited by 516
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2022Grounded Copilot: How Programmers Interact with Code-Generating Modelscited by 216
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 106
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
- 2021GNN-LM: Language Modeling based on Global Contexts via GNNcited by 27
- 2021CoCoSum: Contextual Code Summarization with Multi-Relational Graph Neural Networkcited by 22
- 2020A Toolkit for Generating Code Knowledge Graphscited by 17
- 2021Towards Learning (Dis)-Similarity of Source Code from Program Contrastscited by 17
- 2021Can Machines Read Coding Manuals Yet? -- A Benchmark for Building Better Language Models for Code Understandingcited by 5
Built on by
Citing papers per year: 2023: 12; 2024: 27; 2025: 16; 2026: 9.
64 papers.
Sort:
By area:
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 414
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2023Retrieving Multimodal Information for Augmented Generation: A Surveycited by 84
- 2025SWE-PolyBench: A multi-language benchmark for repository level evaluation of coding agentscited by 80
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
38 more
- 2024EffiBench: Benchmarking the Efficiency of Automatically Generated Codecited by 62
- 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2023Bias Testing and Mitigation in LLM-based Code Generationcited by 53
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 45
- 2024You Name It, I Run It: An LLM Agent to Execute Tests of Arbitrary Projectscited by 45
- 2023RepoFusion: Training Code Models to Understand Your Repositorycited by 40
- 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
- 2024SWE-bench-java: A GitHub Issue Resolving Benchmark for Javacited by 34
- 2024REPOFUSE: Repository-Level Code Completion with Fused Dual Contextcited by 32
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
- 2024MHPP: Exploring the Capabilities and Limitations of Language Models Beyond Basic Code Generationcited by 25
- 2024Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Taskscited by 24
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2024On the Impacts of Contexts on Repository-Level Code Generationcited by 21
- 2024M2rc-Eval: Massively Multilingual Repository-level Code Completion Evaluationcited by 21
- 2023Guiding Language Models of Code with Global Context using Monitorscited by 20
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluationcited by 19
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
- 2024RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completioncited by 15
- 2024Top General Performance = Top Domain Performance? DomainCodeBench: A Multi-domain Code Generation Benchmarkcited by 13
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completioncited by 12
- 2024Enhancing LLM-Based Coding Tools through Native Integration of IDE-Derived Static Contextcited by 10
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024R2C2-Coder: Enhancing and Benchmarking Real-world Repository-level Code Completion Abilities of Code Large Language Modelscited by 9
- 2024Statically Contextualizing Large Language Models with Typed Holescited by 9
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrievalcited by 7
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2025Knowledge Augmented Complex Problem Solving with Large Language Models: A Surveycited by 6
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Informationcited by 5
- 2025Impact-driven Context Filtering For Cross-file Code Completioncited by 5
- 2023Revisiting File Context for Source Code Summarizationcited by 3
- 2025CoRet: Improved Retriever for Code Editingcited by 3
- 2026RepoShapley: Shapley-Enhanced Context Filtering for Repository-Level Code Completioncited by 3
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
50 most cited of 64 All 64 (JSON)
- 2026Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation1 Sep 2026
- 2026OctoLong: Mid-Training On Cross-Repository Code Contexts Enhances Long-Context Modeling5 Aug 2026
- 2026Dependency-Guided Code Generation: Structured Matrix Decomposition and Consistency-Guided Refinement18 Jul 2026
- 2026An Empirical Study of LLM-Generated Specifications for VeriFast25 Jun 2026
- 2026Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution4 Jun 2026
- 2026ReFEree: Reference-Free and Fine-Grained Method for Evaluating Factual Consistency in Real-World Code Summarization12 Apr 2026
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2026RepoShapley: Shapley-Enhanced Context Filtering for Repository-Level Code Completion6 Jan 2026
- 2025SemanticForge: Repository-Level Code Generation through Semantic Knowledge Graphs and Constraint Satisfaction10 Nov 2025
- 2025On Pretraining for Project-Level Code Completion15 Oct 2025
- 2025Relative Positioning Based Code Chunking Method For Rich Context Retrieval In Repository Level Code Completion Task With Code Language Model7 Oct 2025
38 more
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrieval27 Sep 2025
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion19 Sep 2025
- 2025SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion13 Aug 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Information28 Jul 2025
- 2025CoRet: Improved Retriever for Code Editing30 May 2025
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks22 May 2025
- 2025Structure-Aware Corpus Construction and User-Perception-Aligned Metrics for Large-Language-Model Code Completion19 May 2025
- 2025Knowledge Augmented Complex Problem Solving with Large Language Models: A Survey6 May 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025SWE-PolyBench: A multi-language benchmark for repository level evaluation of coding agents11 Apr 2025
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar 2025
- 2024Top General Performance = Top Domain Performance? DomainCodeBench: A Multi-domain Code Generation Benchmark24 Dec 2024
- 2024Knowledge Graphs: The Future of Data Integration and Insightful Discovery17 Dec 2024
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluation16 Dec 2024
- 2024You Name It, I Run It: An LLM Agent to Execute Tests of Arbitrary Projects13 Dec 2024
- 2024M2rc-Eval: Massively Multilingual Repository-level Code Completion Evaluation28 Oct 2024
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024
- 2024Statically Contextualizing Large Language Models with Typed Holes2 Sep 2024
- 2024SWE-bench-java: A GitHub Issue Resolving Benchmark for Java26 Aug 2024
- 2024On the Impacts of Contexts on Repository-Level Code Generation17 Jun 2024
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model11 Jun 2024
- 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Exploration3 Jun 2024
- 2024R2C2-Coder: Enhancing and Benchmarking Real-world Repository-level Code Completion Abilities of Code Large Language Models3 Jun 2024
- 2024A Survey on Large Language Models for Code Generation1 Jun 2024
- 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completion30 May 2024
- 2024MHPP: Exploring the Capabilities and Limitations of Language Models Beyond Basic Code Generation19 May 2024
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generation13 May 2024
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedback25 Mar 2024
- 2024Exploring Language Model's Code Generation Ability with Auxiliary Functions15 Mar 2024
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar 2024
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar 2024
- 2024RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completion10 Mar 2024
- 2024Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Tasks7 Mar 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2024REPOFUSE: Repository-Level Code Completion with Fused Dual Context22 Feb 2024
- 2024Enhancing LLM-Based Coding Tools through Native Integration of IDE-Derived Static Context6 Feb 2024
50 newest of 64 All 64 (JSON)
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 414
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completioncited by 12
- 2025Impact-driven Context Filtering For Cross-file Code Completioncited by 5
- 2026RepoShapley: Shapley-Enhanced Context Filtering for Repository-Level Code Completioncited by 3
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
- 2023Dynamic Retrieval-Augmented Generationcited by 1
12 most cited of 13 All 13 (JSON)
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026RepoShapley: Shapley-Enhanced Context Filtering for Repository-Level Code Completion6 Jan 2026
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion19 Sep 2025
- 2025SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion13 Aug 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar 2025
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model11 Jun 2024
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generation13 May 2024
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2023Dynamic Retrieval-Augmented Generation14 Dec 2023
12 newest of 13 All 13 (JSON)
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2023Retrieving Multimodal Information for Augmented Generation: A Surveycited by 84
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2024EffiBench: Benchmarking the Efficiency of Automatically Generated Codecited by 62
- 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
- 2023Bias Testing and Mitigation in LLM-based Code Generationcited by 53
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 45
12 most cited of 46 All 46 (JSON)
- 2026Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation1 Sep 2026
- 2026Dependency-Guided Code Generation: Structured Matrix Decomposition and Consistency-Guided Refinement18 Jul 2026
- 2026An Empirical Study of LLM-Generated Specifications for VeriFast25 Jun 2026
- 2026Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution4 Jun 2026
- 2026ReFEree: Reference-Free and Fine-Grained Method for Evaluating Factual Consistency in Real-World Code Summarization12 Apr 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2025SemanticForge: Repository-Level Code Generation through Semantic Knowledge Graphs and Constraint Satisfaction10 Nov 2025
- 2025On Pretraining for Project-Level Code Completion15 Oct 2025
- 2025Relative Positioning Based Code Chunking Method For Rich Context Retrieval In Repository Level Code Completion Task With Code Language Model7 Oct 2025
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrieval27 Sep 2025
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Information28 Jul 2025
- 2025CoRet: Improved Retriever for Code Editing30 May 2025
12 newest of 46 All 46 (JSON)