LLM-based Iterative Approach to Metamodeling in Automotive

Nenad Petrović, Fengjunjie Pan, Vahid Zolfaghari, Alois Knoll

Abstract

As automotive systems transition toward centralized, software-defined architectures, the complexity of system metamodeling has increased significantly. Traditional manual approaches to Model-Driven Engineering (MDE) are slow and error-prone. This paper presents an automated, iterative pipeline leveraging Large Language Models (LLMs) to transform plain-text requirements into formal Ecore metamodels. By integrating Retrieval-Augmented Generation (RAG) and a human-in-the-loop feedback mechanism, the proposed system reduces metamodel update times from hours to seconds while maintaining high structural accuracy.

Introduction

In the automotive industry, Model-Driven Engineering (MDE) serves as the foundation for designing complex systems, from sensor suites to autonomous driving logic. Metamodels—formal definitions of system concepts and relationships—are essential for maintaining consistency across large-scale engineering projects. However, the rapid evolution of vehicular architectures requires frequent updates to these models. Currently, domain experts must manually translate dense requirement documents into rigid formats like Eclipse’s Ecore, creating a significant innovation bottleneck. This research explores the use of LLMs to bridge the gap between natural language requirements and formal software blueprints.

Methodology

The researchers developed a multi-stage workflow designed to handle the scale and precision required for automotive engineering. The pipeline consists of five primary phases:

  1. Requirement Filtering (RAG): To manage massive documentation, a Retrieval-Augmented Generation system chunks the text and extracts only the data relevant to the specific vehicle subsystem being modeled.
  2. Iterative Construction: Rather than attempting a "one-shot" generation, the system builds the metamodel in layers, starting with base classes and adding complexity in successive iterations.
  3. Dual-Output Generation: For every iteration, the LLM generates both an Ecore metamodel (XML-based for tool compatibility) and PlantUML code (for human-readable visualization).
  4. Human-in-the-Loop: A human expert reviews the PlantUML diagrams and provides natural language feedback to refine the model.
  5. Local Model Pipeline: To address OEM privacy concerns, the authors implemented a "Model-to-Model" transformation step for local models like DeepSeek 7B, using PlantUML as an intermediate language to bypass the syntax errors common in smaller models attempting to generate complex XML.
The end-to-end automated pipeline for transforming automotive requirements into simulation-ready code.

Iterative Metamodel Construction

The core of the approach is the decomposition of the modeling task. By breaking the process into smaller steps—such as focusing first on sensors, then actuators, and finally hardware accelerators—the LLM's reasoning capabilities are maximized. This iterative loop allows the system to maintain context and accuracy that would be lost in a single, massive prompt.

The iterative metamodeling process showing how requirements are incrementally transformed into a formal model with human feedback.

Key Results and Discussion

The prototype was evaluated using both commercial (GPT-4o) and local (DeepSeek 7B) models. Key findings include:

  • Efficiency: GPT-4o generated partial metamodels in approximately 9 to 11 seconds per iteration, representing a massive speedup over manual modeling.
  • Accuracy: In a three-iteration test covering sensors, actuators, and hardware accelerators, GPT-4o successfully identified all required classes and relationships.
  • The Syntax Gap: While GPT-4o handled Ecore XML natively, smaller local models struggled with the strict syntax. The use of PlantUML as an intermediate representation proved vital for local model viability, allowing DeepSeek 7B to correctly identify 100% of classes and composition relationships in the sensor test.
  • Visualization as Interface: The dual-output strategy proved essential. Because Ecore files are nearly unreadable to humans, the PlantUML diagrams served as the primary interface for human-AI collaboration.

Conclusion and Future Work

This research demonstrates that LLMs can significantly accelerate automotive metamodeling through an iterative, human-in-the-loop approach. While risks of hallucinations and context window limits remain, the use of RAG and intermediate visual representations provides a robust framework for industrial application. Future work will focus on automating the validation of generated models against industry standards (e.g., OCL rules) and further fine-tuning local models to match the performance of cloud-based commercial counterparts without compromising data privacy.

Summary updated

BibTeX
@misc{petrovic2025llm,
  author = {Nenad Petrović and Fengjunjie Pan and Vahid Zolfaghari and Alois Knoll},
  title = {{LLM-based Iterative Approach to Metamodeling in Automotive}},
  year = {2025},
  eprint = {2503.05449},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.05449},
}
Figure