Multi-IaC-Eval: Benchmarking Cloud Infrastructure as Code Across Multiple Formats

Sam Davidson, Li Sun, Bhavana Bhasker, Laurent Callot, Anoop DeorasarXiv 2025 · DOI

Abstract

Infrastructure as Code (IaC) is essential for modern cloud management, yet evaluating Large Language Models (LLMs) on their ability to modify existing infrastructure across diverse formats remains a challenge. We present Multi-IaC-Eval, a comprehensive benchmark for evaluating LLM performance in mutating CloudFormation, Terraform, and CDK configurations. Our evaluation of state-of-the-art models like Claude 3.5 Sonnet and DeepSeek R1 demonstrates that while high syntactic accuracy is achievable, it requires iterative feedback loops and sophisticated prompting strategies to handle the semantic complexities of infrastructure mutation.

Introduction

In the modern DevOps landscape, Infrastructure as Code (IaC) has become the standard for managing cloud resources. However, cloud architects face a "Tower of Babel" problem, requiring proficiency in multiple, often incompatible formats such as AWS CloudFormation (YAML/JSON), HashiCorp Terraform (HCL), and the AWS Cloud Development Kit (CDK). While LLMs show promise in automating these tasks, existing benchmarks often suffer from a "from scratch" bias—testing generation from a blank slate rather than the real-world task of modifying existing, complex templates. Furthermore, most datasets focus on a single language, ignoring the multi-format reality of enterprise environments.

Multi-IaC-Eval bridges this gap by focusing on IaC mutation: the ability of an AI to take an existing configuration and a natural language request (e.g., "Add an S3 bucket with encryption") and produce a valid, updated template.

Methods and Dataset Generation

The researchers developed a sophisticated synthetic data generation pipeline to create the Multi-IaC-Bench dataset. The process begins with high-quality, real-world templates sourced from public GitHub repositories. These templates are then processed through a two-stage synthetic mutation pipeline using Amazon Nova Pro. First, the model analyzes a template to suggest a realistic customer request; second, it implements that change.

Automated pipeline for synthetic data generation and validation, featuring an iterative retry loop for linting and security checks.

A critical component of this pipeline is the "Retry Loop." To ensure the benchmark is solvable and high-quality, the system implements an automated feedback loop. If a generated template fails static analysis (linting), the model receives the error message and is prompted to self-correct. Finally, an "LLM Judge" ensures the changes align with the user's intent, a process validated against human expert reviews with 91.6% alignment.

The resulting Multi-IaC-Bench dataset consists of triplets: an initial template, a natural language modification request, and the expected updated template. It includes 337 test cases for CloudFormation (CFN), 171 for Terraform (TF), and 191 for CDK (Python and TypeScript).

Results and Analysis

The benchmarking of state-of-the-art models—Llama 3.2 11B, DeepSeek R1, and Claude 3.5 Sonnet V2—revealed several key insights into the current capabilities of LLMs in the DevOps domain.

Performance metrics of leading LLMs across different IaC formats, highlighting pass rates and the impact of iterative calls.

Top Performers and Efficiency

Claude 3.5 Sonnet V2 emerged as the leader, achieving a 98.5% lint pass rate for CloudFormation and a perfect 100% pass rate for Terraform when utilizing the retry loop. DeepSeek R1 demonstrated impressive efficiency, often requiring fewer LLM calls on average than Sonnet to reach a valid solution, particularly in the CloudFormation and CDK categories.

The Challenge of CDK

CDK remains the most difficult format for LLMs. Even top-tier models saw lower scores here, highlighting the difficulty of managing infrastructure via imperative programming languages. The researchers found higher success by using a "Pivot" strategy: mutating a declarative CloudFormation template first and then using conversion utilities to return to CDK code.

Syntax vs. Semantics

While models are increasingly proficient at writing syntactically correct code, they still struggle with "semantic alignment"—ensuring the code performs exactly what was requested without introducing extraneous changes. The study found that moving from basic prompts to full prompts with Chain-of-Thought reasoning improved success rates by 10-15%.

Conclusion and Future Work

Multi-IaC-Eval demonstrates that while general-purpose LLMs are capable of handling complex IaC tasks, specialized prompting and iterative feedback are necessary for production-grade reliability. Future work will involve expanding the benchmark to include live deployment testing to catch runtime errors, such as IAM permission conflicts, and extending support to other formats like Pulumi and Ansible. The results suggest a significant opportunity for the development of specialized "Infrastructure LLMs" with a deeper understanding of cloud-specific resource relationships.

Summary updated

BibTeX
@misc{davidson2025multi,
  author = {Sam Davidson and Li Sun and Bhavana Bhasker and Laurent Callot and Anoop Deoras},
  title = {{Multi-IaC-Eval: Benchmarking Cloud Infrastructure as Code Across Multiple Formats}},
  year = {2025},
  eprint = {2509.05303},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.05303},
}
Figure