A Lightweight Large Language Model-Based Multi-Agent System for 2D Frame Structural Analysis

Ziheng Geng, Jiachen Liu, Ran Cao, Lu Cheng, Haifeng Wang, Minghui ChengarXiv 2025 · DOI

Introduction

Structural engineering relies heavily on Finite Element Modeling (FEM) to simulate how buildings and bridges respond to various loads. Traditionally, this is a labor-intensive process requiring engineers to manually define geometry, connectivity, and material properties in specialized software like OpenSees. While Large Language Models (LLMs) are excellent at general coding, they often struggle with the spatial reasoning and topological consistency required for structural analysis. When asked to generate FEM code directly, even advanced models frequently produce syntax errors, omit critical nodes, or "hallucinate" impossible connections.

To address these challenges, researchers have developed a lightweight, multi-agent system (MAS) powered by Llama-3.3 70B. By decomposing complex structural analysis into specialized subtasks guided by expert rules, the system achieves over 80% accuracy, significantly outperforming "vanilla" state-of-the-art models.

The Multi-Agent Framework

The proposed system follows a "divide-and-conquer" strategy, utilizing five specialized agents in a pipeline to bridge the gap between natural language descriptions and executable simulation code:

  1. Problem Analysis Agent: Parses user input to extract parameters like bays, heights, and materials into a structured JSON format.
  2. Geometry Agent: Acts as the system's "brain," using expert-defined rules to derive node coordinates and element connectivity step-by-step. This prevents the model from losing track of the structure's topology.
  3. Code Translation Agent: Converts the structured geometry into executable OpenSeesPy code using a predefined template.
  4. Model Validation Agent: Identifies and fixes common LLM errors, such as duplicate nodes or irregular numbering, using deterministic Python tools.
  5. Load Agent: Extracts and merges loading conditions (e.g., point and distributed loads) into the final validated script.
Workflow of the multi-agent system translating a frame analysis problem into executable OpenSeesPy code.

This framework is powered by Llama-3.3 70B Instruct, a model that allows for local deployment and lower operational costs compared to massive proprietary APIs.

Benchmarking and Performance

The system was evaluated using a new benchmark dataset of 20 representative 2D frame problems. These included real-world topologies inspired by the Notre Dame de Paris and the Louvre Museum, as well as synthetic cases with varying story heights.

Key Results

  • Superior Accuracy: The multi-agent system achieved over 80% accuracy across the benchmark, reaching 100% in simpler three-bay scenarios.
  • Outperforming General Models: It vastly outperformed Gemini-2.5 Pro (37% accuracy) and ChatGPT-4o (0% accuracy). While Gemini showed better syntax handling than Llama, it still suffered from topological flaws like omitted nodes.
  • Efficiency and Cost: Generating a model took roughly 4.5 minutes, compared to 17+ minutes for manual coding by a human engineer. The running cost per analysis was remarkably low, ranging from $0.007 to $0.02.
Comparison of structural models generated by the Llama-3.3 70B multi-agent system against ground truth benchmarks.

Insights and Future Directions

A critical insight from this research is the importance of decoupling reasoning from coding. An ablation study revealed that an "integrated" agent attempting to handle both spatial logic and code generation simultaneously failed 100% of the time. By resolving spatial logic in a structured JSON format before writing code, the system overcomes the inherent limitations of transformers.

Limitations

Despite its success, the system's accuracy dipped to 60-70% for highly irregular, multi-bay structures, where it remains susceptible to hallucinations during lengthy sequential steps. Additionally, the current implementation is limited to 2D linear elastic analysis.

Future Work

Future developments aim to extend this system to 3D frames, which introduce more complex topological challenges and degrees of freedom. Researchers also plan to incorporate non-linear behavior and dynamic loading simulations, such as earthquake response analysis.

Summary updated

BibTeX
@misc{geng2025lightweight,
  author = {Ziheng Geng and Jiachen Liu and Ran Cao and Lu Cheng and Haifeng Wang and Minghui Cheng},
  title = {{A Lightweight Large Language Model-Based Multi-Agent System for 2D Frame Structural Analysis}},
  year = {2025},
  eprint = {2510.05414},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.05414},
}
Figure