paper-with-me

홈 › Papers

Text2DSL: LLM-Based Code Generation for Domain-Specific Languages

2026-06-21 · Alexander V. Kozachok, Alexander M. Nazimov, Shamil G. Magomedov arxiv

Domain-specific languages (DSLs) are widely used for managing operating system security policies, yet manually authoring rules in such languages demands high expertise and is error-prone. This paper formalises the task of automatic DSL code generation from natural language descriptions - Text2DSL - as a distinct problem class, separate from Text-to-SQL and general-purpose code generation. We introduce the PolkitBench dataset comprising 4,204 verified natural-language-to-Polkit-rule pairs, each validated through a three-level AST-based pipeline. Controlled prompt experiments on two MoE models of different scale and provenance - GigaChat-10B-A1.8B (1.8B active parameters) and Nemotron-3-Nano-30B-A3B (3B active) - demonstrate the critical role of structured context (BNF grammar, API specification, permitted identifier vocabulary) for LLM-based DSL code generation. Across both models, supplying context raises syntactic validity to 98.6-99.4%, structural validity by +9.7 to +35.5 pp, and the CodeBLEU score by +60% to +95%. The consistency of the effect across models of different scale and provenance indicates that, for the Text2DSL class of problems, injecting a formal target-language specification into the prompt context is a robust enabling factor for high-quality generation without model fine-tuning.

📄 PDF Abstract BibTeX arXiv:2606.22586

Code (0)

등록된 구현이 없습니다.

Tasks

Code Generation

Similar Papers 제목 키워드 기반

The Code2Text Challenge: Text Generation in Source Libraries

2017-09-01 · WS 2017 9 · Kyle Richardson, Sina Zarrie{\ss}, Jonas Kuhn

We propose a new shared task for tactical data-to-text generation in the domain of source code libraries. Specifically, we focus on text generation of function descriptions from example software projects. Data is drawn f…

Data-to-Text GenerationText Generation

The Code2Text Challenge: Text Generation in Source Code Libraries

2017-07-31 · Kyle Richardson, Sina Zarrieß, Jonas Kuhn

We propose a new shared task for tactical data-to-text generation in the domain of source code libraries. Specifically, we focus on text generation of function descriptions from example software projects. Data is drawn f…

Data-to-Text GenerationText Generation

DocCGen: Document-based Controlled Code Generation

2024-06-17 · Sameer Pimparkhede, Mehant Kammakomati, Srikanth Tamilselvam, Prince Kumar 외

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,…

Code GenerationIn-Context Learning

ConCodeEval: Evaluating Large Language Models for Code Constraints in Domain-Specific Languages

2024-07-03 · Mehant Kammakomati, Sameer Pimparkhede, Srikanth Tamilselvam, Prince Kumar 외

Recent work shows Large Language Models (LLMs) struggle to understand natural language constraints for various text generation tasks in zero- and few-shot settings. While, in the code domain, there is wide usage of const…

Text Generation

CangjieBench: Benchmarking LLMs on a Low-Resource General-Purpose Programming Language

2026-03-15 · Junhang Cheng, Fang Liu, Jia Li, Chengru Wu 외 arxiv

Large Language Models excel in high-resource programming languages but struggle with low-resource ones. Existing research related to low-resource programming languages primarily focuses on Domain-Specific Languages (DSLs…

Text-to-Code GenerationCode Translation