Pith. sign in

REVIEW 2 cited by

DocCGen: Document-based Controlled Code Generation

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2406.11925 v2 pith:4AC66SWI submitted 2024-06-17 cs.SE cs.AIcs.CL

DocCGen: Document-based Controlled Code Generation

classification cs.SE cs.AIcs.CL
keywords codegenerationlanguagesstructureddoccgendocumentationlanguagedomain-specific
verification ladder T0 review T1 audit T2 compute T3 formal T4 reserved
0 comments
read the original abstract

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.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. PHITSBench: an execution-scored benchmark for AI-assisted PHITS radiation-transport input generation using natural language

    cs.AI 2026-07 conditional novelty 6.0

    A structured PHITS knowledge catalog lifts GPT-5.4 from 0% to 57% success generating full radiation-transport simulations; agentic repair reaches 66–73%.

  2. IaC Generation with LLMs: An Error Taxonomy and A Study on Configuration Knowledge Injection

    cs.AI 2025-12 conditional novelty 6.0

    Structured configuration knowledge injected as a knowledge graph significantly improves technical correctness of LLM-generated Terraform code but not alignment with user intent.