paper-with-me

Papers

DocCGen: Document-based Controlled Code Generation

2024-06-17 · Sameer Pimparkhede, Mehant Kammakomati, Srikanth Tamilselvam, Prince Kumar, Ashok Pon Kumar, Pushpak Bhattacharyya

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.

📄 PDF Abstract BibTeX arXiv:2406.11925

Code (0)

등록된 구현이 없습니다.

Tasks

Code GenerationIn-Context Learning

Methods 이 논문이 사용한 방법론

Library 설명 없음

Similar Papers 제목 키워드 기반

Can Developers Prompt? A Controlled Experiment for Code Documentation Generation

2024-08-01

Large language models (LLMs) bear great potential for automating tedious development tasks such as creating and maintaining code documentation. However, it is unclear to what extent developers can effectively prompt LLMs…

Sequentially Controlled Text Generation

2023-01-05 · Alexander Spangher, Xinyu Hua, Yao Ming, Nanyun Peng

While GPT-2 generates sentences that are remarkably human-like, longer documents can ramble and do not follow human-like writing structure. We study the problem of imposing structure on long-range text. We propose a nove…

Text Generation

Decoupling Knowledge and Task Subspaces for Composable Parametric Retrieval Augmented Generation

2026-04-29 · Weihang Su, Hanwen Zhang, Qingyao Ai, Yiqun Liu arxiv

Parametric Retrieval-Augmented Generation (PRAG) encodes external documents into lightweight parameter modules that can be retrieved and merged at inference time, offering a promising alternative to in-context retrieval …

Sequentially Controlled Text Generation

2022-01-16 · ACL ARR January 2022 1 · Anonymous

While GPT2 generates sentences that are remarkably human-like, longer documents can ramble and are structurally different from human-written articles. We study the problem of imposing structure on long-range text. We pro…

ArticlesText Generation

Verifiable Source Code Documentation in Controlled Natural Language

2013-11-12 · Tobias Kuhn, Alexandre Bergel

Writing documentation about software internals is rarely considered a rewarding activity. It is highly time-consuming and the resulting documentation is fragile when the software is continuously evolving in a multi-devel…