让AI通过提问澄清模糊的云配置需求,逐步缩小生成范围。
Interactive Clarification for Cloud Infrastructure-as-Code Synthesis

- 基于资源、拓扑、属性三轴结构,分层识别歧义并生成追问问题。
- 在300个真实模糊任务上,交互式澄清使准确率显著提升,且越互动效果越好。
- 无需训练,适配多种大模型,适合需要精准云部署的开发者使用。
现代云基础设施规模庞大、结构复杂,使得「基础设施即代码」(IaC)成为通过声明式配置管理部署的关键。尽管大语言模型(LLMs)被用于从自然语言生成IaC配置,但用户请求常存在模糊和不完整问题。与传统代码生成不同,IaC配置合成过程中测试成本高、耗时长,迫使LLM近乎一次性完成生成。我们观察到IaC合成中的歧义具有组合性结构:配置可分解为资源、拓扑、属性三个维度,高层决策约束低层选择。为此,我们提出一种无需训练的多层级消歧框架,生成多样化候选配置,识别三轴间的结构性分歧,按信息量排序并生成针对性澄清问题,逐步缩小配置空间。我们还构建了Ambig-IaC基准,包含300个经专家验证的模糊IaC任务,并定义基于图编辑距离和精确属性匹配的评估指标。大量实验表明,该方法优于现有交互式澄清基线,性能随交互预算增加而提升,且在不同模型间具有良好泛化能力。消融研究和分析进一步验证其在交互式IaC合成中的鲁棒性。
原文摘要 · Abstract (English)
The scale and complexity of modern cloud infrastructure have made "Infrastructure-as-Code" (IaC) essential for managing deployments through declarative configurations. While large language models (LLMs) are increasingly used to generate IaC configurations from natural language, user requests are often ambiguous and underspecified. Unlike traditional code generation, it is costly and time-consuming to test IaC configurations during the synthesis, forcing the LLMs into an almost one-shot regime. We observe that ambiguity in IaC synthesis exhibits a compositional structure: configurations decompose into three axes (resources, topology, attributes) where higher-level decisions constrain lower-level ones. We propose a training-free, multi-level disambiguation framework that generates diverse candidate specifications, identifies structural disagreements across these axes, ranks them by informativeness, and produces targeted clarification questions that progressively narrow the configuration space. We further introduce Ambig-IaC, an expert-verified benchmark of 300 validated IaC tasks with ambiguous requests, and define evaluation metrics based on graph edit distance and exact attribute matching. Comprehensive experiments show that our method outperforms existing interactive clarification baselines, with gains that scale with the interaction budget and generalize across models. Extensive ablation studies and analyses further demonstrate its robustness for interactive IaC synthesis.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。