mlsanityData to 14 Oct 2026

DocPrompting: Generating Code by Retrieving the Docs

arXiv 2207.05987 ↗First posted 13 Jul 2022cs.CL cs.AI cs.SEcited by 153

Not on the map. Why?

Cited by 43 in Retrieval-augmented generation, but placed by its own abstract, which didn’t fit.

Abstract (arXiv)

Publicly available source-code libraries are continuously growing and changing. This makes it impossible for models of code to keep current with all available APIs by simply training these models on existing code repositories. Thus, existing models inherently cannot generalize to using unseen functions and libraries, because these would never appear in the training data. In contrast, when human programmers use functions and libraries for the first time, they frequently refer to textual resources such as code manuals and documentation, to explore and understand the available functionality. Inspired by this observation, we introduce DocPrompting: a natural-language-to-code generation approach that explicitly leverages documentation by (1) retrieving the relevant documentation pieces given an NL intent, and (2) generating code based on the NL intent and the retrieved documentation. DocPrompting is general: it can be applied to any programming language and is agnostic to the underlying neural model. We demonstrate that DocPrompting consistently improves NL-to-code models: DocPrompting improves strong base models such as CodeT5 by 2.85% in pass@1 (52% relative gain) and 4.39% in pass@10 (30% relative gain) in execution-based evaluation on the popular Python CoNaLa benchmark; on a new Bash dataset tldr, DocPrompting improves CodeT5 and GPT-Neo1.3B by up to absolute 6.9% exact match.

Key facts. Cited by 153 papers in the map (data through 14 Oct 2026). Builds on 32 of its 46 references that are in the map. First posted on arXiv 13 Jul 2022.

Builds on

32 of 46 references.

References · 32

  1. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  2. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
  3. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
  6. 2021Program Synthesis with Large Language Modelscited by 3,637
  7. 2019The Curious Case of Neural Text Degenerationcited by 2,916
  8. 2017Billion-scale similarity search with GPUscited by 2,497
  9. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
  10. 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,141
  11. 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,210
  12. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
20 more
  1. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  2. 2022A Systematic Evaluation of Large Language Models of Codecited by 363
  3. 2022Memorizing Transformerscited by 226
  4. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  5. 2021Retrieval Augmented Code Generation and Summarizationcited by 149
  6. 2022Natural Language to Code Translation with Executioncited by 124
  7. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  8. 2018Mapping Language to Code in Programmatic Contextcited by 104
  9. 2018NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating Systemcited by 98
  10. 2017Abstract Syntax Networks for Code Generation and Semantic Parsingcited by 92
  11. 2018A Retrieve-and-Edit Framework for Predicting Structured Outputscited by 73
  12. 2018Generative Code Modeling with Graphscited by 60
  13. 2018Retrieval-Based Neural Code Generationcited by 41
  14. 2014Learning to Win by Reading Manuals in a Monte-Carlo Frameworkcited by 39
  15. 2020Incorporating External Knowledge through Pre-training for Natural Language to Code Generationcited by 36
  16. 2021Controllable Semantic Parsing via Retrieval Augmentationcited by 35
  17. 2019RTFM: Generalising to Novel Environment Dynamics via Readingcited by 33
  18. 2022The impact of lexical and grammatical processing on generating code from natural languagecited by 6
  19. 2020Project CLAI: Instrumenting the Command Line as a New Environment for AI Agentscited by 3
  20. 2017Data-Driven Program Completioncited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2022: 2; 2023: 27; 2024: 54; 2025: 36; 2026: 34.

153 papers.

Sort:

By area:

  1. 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,332
  2. 2024A Survey on Large Language Models for Code Generationcited by 658
  3. 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 452
  4. 2023Cognitive Architectures for Language Agentscited by 429
  5. 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 427
  6. 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 354
  7. 2026SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Taskscited by 315
  8. 2023Benchmarking Large Language Models in Retrieval-Augmented Generationcited by 312
  9. 2023Tool Learning with Foundation Modelscited by 302
  10. 2023ChipNeMo: Domain-Adapted LLMs for Chip Designcited by 174
  11. 2023Text2Reward: Reward Shaping with Language Models for Reinforcement Learningcited by 160
  12. 2024RQ-RAG: Learning to Refine Queries for Retrieval Augmented Generationcited by 147
38 more
  1. 2023AutoMix: Automatically Mixing Language Modelscited by 125
  2. 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 102
  3. 2024InstructRAG: Instructing Retrieval-Augmented Generation via Self-Synthesized Rationalescited by 101
  4. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 91
  5. 2023Retrieving Multimodal Information for Augmented Generation: A Surveycited by 85
  6. 2024RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Horizon Generationcited by 75
  7. 2024Reliable, Adaptable, and Attributable Language Models with Retrievalcited by 73
  8. 2024Can Language Models Solve Olympiad Programming?cited by 72
  9. 2023Tool Documentation Enables Zero-Shot Tool-Usage with Large Language Modelscited by 68
  10. 2024MindSearch: Mimicking Human Minds Elicits Deep AI Searchercited by 66
  11. 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 65
  12. 2024RAGChecker: A Fine-grained Framework for Diagnosing Retrieval-Augmented Generationcited by 61
  13. 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
  14. 2025VDocRAG: Retrieval-Augmented Generation over Visually-Rich Documentscited by 59
  15. 2024CodeUltraFeedback: An LLM-as-a-Judge Dataset for Aligning Large Language Models to Coding Preferencescited by 57
  16. 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
  17. 2024What Are Tools Anyway? A Survey from the Language Model Perspectivecited by 54
  18. 2023SelfEvolve: A Code Evolution Framework via Large Language Modelscited by 43
  19. 2024Synatra: Turning Indirect Knowledge into Direct Demonstrations for Digital Agents at Scalecited by 43
  20. 2023Large Language Models as Tax Attorneys: A Case Study in Legal Capabilities Emergencecited by 42
  21. 2024What is the Role of Small Models in the LLM Era: A Surveycited by 41
  22. 2023RepoFusion: Training Code Models to Understand Your Repositorycited by 40
  23. 2023LLM as OS, Agents as Apps: Envisioning AIOS, Agents and the AIOS-Agent Ecosystemcited by 38
  24. 2025MultiKernelBench: A Multi-Platform Benchmark for Kernel Generationcited by 38
  25. 2024LeanAgent: Lifelong Learning for Formal Theorem Provingcited by 35
  26. 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrievalcited by 34
  27. 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
  28. 2024HijackRAG: Hijacking Attacks against Retrieval-Augmented Large Language Modelscited by 27
  29. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
  30. 2024On Mitigating Code LLM Hallucinations with API Documentationcited by 21
  31. 2023Guiding Language Models of Code with Global Context using Monitorscited by 20
  32. 2024NLPerturbator: Studying the Robustness of Code LLMs to Natural Language Variationscited by 20
  33. 2024CodeUpdateArena: Benchmarking Knowledge Editing on API Updatescited by 19
  34. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 18
  35. 2025DocAgent: A Multi-Agent System for Automated Code Documentation Generationcited by 18
  36. 2022Python Code Generation by Asking Clarification Questionscited by 17
  37. 2023WeaverBird: Empowering Financial Decision-Making with Large Language Model, Knowledge Base, and Search Enginecited by 17
  38. 2024TimeRAF: Retrieval-Augmented Foundation model for Zero-shot Time Series Forecastingcited by 17

50 most cited of 153 All 153 (JSON)