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

TL;DR
This paper presents a systematic approach to improve LLM-generated Infrastructure as Code by injecting structured configuration knowledge, developing an error taxonomy, and evaluating techniques that significantly enhance correctness but reveal persistent intent alignment challenges.
Contribution
It introduces a novel error taxonomy for LLM-assisted IaC generation and demonstrates that knowledge injection techniques substantially improve technical correctness in Terraform code.
Findings
Knowledge injection increased success rate from 27.1% to 62.6%.
Enhanced error analysis facilitated targeted improvements.
Intent alignment remains a challenge despite technical gains.
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. 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),…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Graph Neural Networks · BIM and Construction Integration · Multimodal Machine Learning Applications
