AI
New framework uses targeted questions to resolve ambiguity in AI-generated cloud infrastructure code
Researchers propose an interactive method that asks clarifying questions to help large language models generate more accurate Infrastructure-as-Code configurations from vague user requests.
Large language models are increasingly tasked with generating cloud infrastructure configurations from plain-language requests, but users rarely specify exactly what they need. A new approach tackles this challenge by asking structured clarification questions instead of relying on a single best-guess output.
The problem with ambiguous infrastructure requests#
Managing modern cloud deployments requires detailed configuration files written in specialized languages. When users describe what they want in natural language—often with incomplete or conflicting requirements—LLMs must make assumptions that can lead to costly misconfigurations. Unlike traditional software, testing cloud infrastructure is time-consuming and expensive, pushing these systems toward a single-attempt scenario where errors have real consequences.
Three-layer structure for smarter disambiguation#
The researchers discovered that ambiguity in infrastructure specifications follows a predictable pattern: decisions cascade through three levels—which resources to provision, how they connect to each other, and what specific attributes each resource should have. Higher-level choices constrain what's possible at lower levels.
The proposed method exploits this structure by generating multiple candidate configurations, comparing where they diverge across these three dimensions, and ranking disagreements by how much information resolving them would provide. The system then poses targeted clarification questions designed to progressively narrow down the intended configuration.
Benchmark and evaluation#
To validate the approach, the team created Ambig-IaC, a dataset of 300 real-world infrastructure tasks with deliberately ambiguous requests that were verified by experts. They measured success using graph edit distance (how structurally different configurations are) and exact attribute matching (whether specific settings align with user intent).
Experiments showed the method outperformed other interactive clarification approaches, with improvements that scaled as users answered more questions and generalized across different language models.
Read the full paper: arxiv.org/abs/2604.02382

