mlsanityData to 14 Oct 2026

DocCGen: Document-based Controlled Code Generation

arXiv 2406.11925 ↗First posted 17 Jun 2024cs.SE cs.AI cs.CLcited by 11

Not on the map. Why?

Abstract (arXiv)

Recent developments show that Large Language Models (LLMs) produce state-of-the-art performance on natural language (NL) to code generation for resource-rich general-purpose languages like C++, Java, and Python. However, their practical usage for structured domain-specific languages (DSLs) such as YAML, JSON is limited due to domain-specific schema, grammar, and customizations generally unseen by LLMs during pre-training. Efforts have been made to mitigate this challenge via in-context learning through relevant examples or by fine-tuning. However, it suffers from problems, such as limited DSL samples and prompt sensitivity but enterprises maintain good documentation of the DSLs. Therefore, we propose DocCGen, a framework that can leverage such rich knowledge by breaking the NL-to-Code generation task for structured code languages into a two-step process. First, it detects the correct libraries using the library documentation that best matches the NL query. Then, it utilizes schema rules extracted from the documentation of these libraries to constrain the decoding. We evaluate our framework for two complex structured languages, Ansible YAML and Bash command, consisting of two settings: Out-of-domain (OOD) and In-domain (ID). Our extensive experiments show that DocCGen consistently improves different-sized language models across all six evaluation metrics, reducing syntactic and semantic errors in structured code. We plan to open-source the datasets and code to motivate research in constrained code generation.

Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). Builds on 10 of its 22 references that are in the map. First posted on arXiv 17 Jun 2024.

Builds on

10 of 22 references.

References · 10

  1. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  2. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  3. 2021ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interactioncited by 476
  4. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
  5. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  6. 2021Retrieval Augmented Code Generation and Summarizationcited by 149
  7. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 119
  8. 2018NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating Systemcited by 98
  9. 2022When Language Model Meets Private Librarycited by 54
  10. 2023Benchmarking and Improving Text-to-SQL Generation under Ambiguitycited by 34

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 2; 2025: 4; 2026: 5.

11 papers.