mlsanityData to 7 Oct 2026

Teaching Code LLMs to Use Autocompletion Tools in Repository-Level Code Generation

arXiv 2401.06391 ↗First posted 12 Jan 2024cs.SEcited by 30

Not on the map. Why?

Abstract (arXiv)

Code large language models (LLMs) face limitations in repository-level code generation due to their lack of awareness of repository-level dependencies (e.g., user-defined attributes), resulting in dependency errors such as undefined-variable and no-member errors. In this work, we introduce ToolGen, an approach that integrates autocompletion tools into the code LLM generation process to address these dependencies. ToolGen comprises two main phases: Trigger Insertion and Model Fine-tuning (Offline), and Tool-integrated Code Generation (Online). During the offline phase, ToolGen augments functions within a given code corpus with a special mark token, indicating positions to trigger autocompletion tools. These augmented functions, along with their corresponding docstrings, are then used to fine-tune a selected code LLM. In the online phase, ToolGen iteratively generates functions by predicting tokens step-by-step using the fine-tuned LLM. Whenever a mark token is encountered, ToolGen invokes the autocompletion tool to suggest code completions and selects the most appropriate one. We conduct comprehensive experiments to evaluate ToolGen's effectiveness in repository-level code generation. To facilitate this evaluation, we create a benchmark comprising 671 real-world code repositories and introduce two new dependency-based metrics: Dependency Coverage and Static Validity Rate. The results demonstrate that ToolGen significantly improves Dependency Coverage by 31.4% to 39.1% and Static Validity Rate by 44.9% to 57.7% across the three LLMs, while maintaining competitive or improved performance in widely recognized similarity metrics such as BLEU-4, CodeBLEU, Edit Similarity, and Exact Match. On the CoderEval dataset, ToolGen achieves improvements of 40.0% and 25.0% in Pass@1 for CodeT5 and CodeLlama, respectively.

Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). First posted on arXiv 12 Jan 2024.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 9; 2025: 16; 2026: 5.

30 papers.

Sort:

By area:

  1. 2024A Survey on Large Language Models for Code Generationcited by 646
  2. 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 173
  3. 2024LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigationcited by 92
  4. 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
  5. 2024HelloBench: Evaluating Long Text Generation Capabilities of Large Language Modelscited by 42
  6. 2024Source Code Summarization in the Era of Large Language Modelscited by 30
  7. 2025Uncertainty-Guided Chain-of-Thought for Code Generation with LLMscited by 30
  8. 2025Large Language Models for Code Generation: A Comprehensive Survey of Challenges, Techniques, Evaluation, and Applicationscited by 26
  9. 2024Beyond pip install: Evaluating LLM Agents for the Automated Installation of Python Projectscited by 21
  10. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
  11. 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
  12. 2025Exploring the Potential of Diffusion Large Language Models in Code Generationcited by 16
18 more
  1. 2025How Far Are AI Scientists from Changing the World?cited by 15
  2. 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
  3. 2025Hallucination by Code Generation LLMs: Taxonomy, Benchmarks, Mitigation, and Challengescited by 9
  4. 2025Marking Code Without Breaking It: Code Watermarking for Detecting LLM-Generated Codecited by 7
  5. 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunitiescited by 7
  6. 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
  7. 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
  8. 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChatcited by 5
  9. 2025Enhancing Project-Specific Code Completion by Inferring Internal API Informationcited by 5
  10. 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Modelscited by 5
  11. 2025SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM Prefillingcited by 3
  12. 2025Accelerating Automatic Program Repair with Dual Retrieval-Augmented Fine-Tuning and Patch Generation on Large Language Modelscited by 1
  13. 2025From LLMs to Agents: A Comparative Evaluation of LLMs and LLM-based Agents in Security Patch Detectioncited by 1
  14. 2025BabelCoder: Agentic Code Translation with Specification Alignmentcited by 1
  15. 2026How to Ask the AI: A User Perspective Survey for Large Language Model Promptingcited by 1
  16. 2025EduBot -- Can LLMs Solve Personalized Learning and Programming Assignments?cited by 0
  17. 2025What a diff makes: automating code migration with large language modelscited by 0
  18. 2026Design-Specification Tiling for ICL-based CAD Code Generationcited by 0