IaC Generation with LLMs: An Error Taxonomy and A Study on Configuration Knowledge Injection

Roman Nekrasov, Stefano Fossati, Indika Kumara, Damian Andrew Tamburri, Willem-Jan van den Heuvel
12/16/2025
cs.AIcs.SE
rag

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) currently exhibit low success rates in generating correct and intent-aligned Infrastructure as Code (IaC). This research investigated methods to improve LLM-based IaC generation, specifically for Terraform, by systematically injecting structured configuration knowledge.

Show full abstract

To facilitate this, an existing IaC-Eval benchmark was significantly enhanced with cloud emulation and automated error analysis. Additionally, a novel error taxonomy for LLM-assisted IaC code generation was developed. A series of knowledge injection techniques was implemented and evaluated, progressing from Naive Retrieval-Augmented Generation (RAG) to more sophisticated Graph RAG approaches. These included semantic enrichment of graph components and modeling inter-resource dependencies. Experimental results demonstrated that while baseline LLM performance was poor (27.1% overall success), injecting structured configuration knowledge increased technical validation success to 75.3% and overall success to 62.6%. Despite these gains in technical correctness, intent alignment plateaued, revealing a "Correctness-Congruence Gap" where LLMs can become proficient "coders" but remain limited "architects" in fulfilling nuanced user intent.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nekrasov2025generation,
  title  = {IaC Generation with LLMs: An Error Taxonomy and A Study on Configuration Knowledge Injection},
  author = {Roman Nekrasov and Stefano Fossati and Indika Kumara and Damian Andrew Tamburri and Willem-Jan van den Heuvel},
  year   = {2025},
  eprint = {2512.14792},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.14792v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.14792.svg)](https://codeofpaper.com/paper/2512.14792)

Discussion