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.


翻译:暂无翻译

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
大型语言模型(LLM)赋能的知识图谱构建:综述
专知会员服务
56+阅读 · 2025年10月24日
大型语言模型(LLMs),附Slides与视频
专知会员服务
71+阅读 · 2024年6月30日
《将大型语言模型(LLM)整合到海军作战规划中》
专知会员服务
131+阅读 · 2024年6月13日
LLM in Medical Domain: 大语言模型在医学领域的应用
专知会员服务
103+阅读 · 2023年6月17日
【资源】领域自适应相关论文、代码分享
专知
32+阅读 · 2019年10月12日
中文NLP福利!大规模中文自然语言处理语料
新智元
37+阅读 · 2019年2月13日
OCR开源库(文本区域定位和文本识别):github
数据挖掘入门与实战
28+阅读 · 2017年11月26日
NLP自然语言处理(二)——基础文本分析
乐享数据DataScientists
12+阅读 · 2017年2月7日
国家自然科学基金
3+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月19日
VIP会员
最新内容
ICML 2026 | 自回归Boltzmann生成器重塑分子采样
专知会员服务
1+阅读 · 6月26日
GNN跨域综述:从消息传递到图基础模型
专知会员服务
0+阅读 · 6月26日
无人机自主控制与人工智能:系统性综述
专知会员服务
11+阅读 · 6月26日
巡飞弹与反无人机系统——现代战场的两大支柱
《打造“黄金舰队”》57页报告
专知会员服务
3+阅读 · 6月26日
《北约数字教官网络发展路径》128页报告
专知会员服务
2+阅读 · 6月26日
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
7+阅读 · 6月25日
网状网络及其在军事领域的运用
专知会员服务
8+阅读 · 6月25日
无美国参与的欧洲战争方式(万字长文)
专知会员服务
8+阅读 · 6月25日
《国防领域敏感性分析白皮书》
专知会员服务
9+阅读 · 6月25日
相关VIP内容
相关基金
国家自然科学基金
3+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员