LLM-based Automated Architecture View Generation: Where Are We Now?
This paper empirically evaluates the ability of LLMs and agentic approaches to automatically generate software architecture views from source code, finding that while they produce syntactically valid outputs, they struggle with architectural abstraction and granularity, indicating their current role is best suited as assistive tools requiring human oversight.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
🏗️ The Big Picture: The "Blueprint" Problem
Imagine you buy a massive, complex house. You want to see the blueprints (the Architecture Views) to understand how the plumbing, electricity, and rooms connect.
In the software world, these blueprints are essential. But here's the problem: Software blueprints are rarely drawn. Instead, they are scattered across millions of lines of code, like notes scribbled on napkins. When developers change the code, the blueprints usually stay the same, becoming outdated and useless. Drawing new ones by hand is slow, boring, and expensive.
The Question: Can we teach an AI (a Large Language Model or "LLM") to look at the messy code and automatically draw the clean, perfect blueprints for us?
🤖 The Experiment: Testing the AI Architects
The researchers from IIIT Hyderabad decided to put this to the test. They acted like "AI Architects" trying to build a blueprint generator.
- The Test Subjects: They took 340 real software projects (like 340 different houses) and asked the AI to draw their blueprints.
- The Tools: They tried different "teaching methods" for the AI:
- Zero-Shot: Just saying, "Draw a blueprint." (Like asking a stranger to draw your house without showing them a picture).
- Few-Shot: Showing the AI a few examples first. (Like saying, "Here are three blueprints; now draw this one.")
- General Agent: Using a smart AI assistant that can use tools and think step-by-step (like a general contractor).
- Custom Agent (ArchView): A specialized AI team built specifically for architecture, with a "Prompt Builder" (the planner), a "View Generator" (the drafter), and an "Image Renderer" (the editor who fixes mistakes).
They generated over 4,000 blueprints and compared them to the "real" blueprints (ground truth) using both computer metrics and human experts.
📉 The Results: Good at Drawing, Bad at Understanding
Here is what they found, broken down simply:
1. The AI can draw, but it doesn't "get" the big picture.
The AI was great at making the lines look right and the boxes look neat. It could generate a diagram that looked like a blueprint.
- The Analogy: Imagine a robot that can perfectly copy a drawing of a house. It gets the windows and doors in the right place. But if you ask it, "Where is the kitchen relative to the living room?" it might get it wrong because it's just copying shapes, not understanding how a house actually works.
- The Reality: The AI often got stuck in the details (the code level) instead of seeing the abstractions (the system level). It drew every single screw instead of the whole room.
2. The "Specialist" beat the "Generalist."
- General Agents (The General Contractor): These AI assistants tried to do everything themselves. They failed miserably. They got confused, drew too many tiny parts, and missed the point.
- Custom Agents (The Specialist Team): The custom-built team (ArchView) was the clear winner. By breaking the job down into specific roles (planning, drawing, checking), they produced the best blueprints.
- Result: ArchView had a 22.6% failure rate in clarity, while the general agent had a 71.8% failure rate.
3. "Show, Don't Just Tell" (Few-Shot Prompting)
Giving the AI a few examples (Few-Shot) helped a little bit. It reduced confusion by about 9%, but it wasn't a magic bullet. The AI still struggled with the deep logic.
4. The "Visual" Trap
The researchers used image similarity scores (SSIM) to see how much the AI drawing looked like the real one.
- The Surprise: Sometimes, the AI drawings looked very similar to the real ones (high visual score), but the meaning was completely wrong.
- The Analogy: It's like a student who copies the teacher's handwriting perfectly but writes the wrong answers on the test. The visual similarity is high, but the knowledge is zero.
🏆 The Verdict: AI is a Junior Intern, Not the Chief Architect
The paper concludes that AI is not ready to replace human architects.
- What AI is good at: It can quickly draft a "rough sketch." It can help you understand a messy, old codebase by giving you a starting point.
- What AI is bad at: It cannot yet understand the intent behind the system. It misses the "why" and the high-level strategy.
The Final Takeaway:
Think of the AI as a very fast, very eager intern.
- If you ask it to draw a blueprint, it will hand you a drawing in seconds.
- It will look professional.
- But, you (the human expert) still have to sit down, review it, fix the logic errors, and make sure it actually makes sense.
The paper suggests we should use these tools to speed up the work, not to do the work. We need to keep the human in the loop to ensure the "blueprints" actually represent the building.
💡 Key Metaphors Summary
| Concept | Real World Analogy |
|---|---|
| Source Code | A pile of bricks, mortar, and pipes scattered on a construction site. |
| Architecture View | The clean, organized blueprint used by the city planner. |
| LLM (Zero-Shot) | Asking a random person to draw the blueprint from the pile of bricks. |
| Few-Shot Prompting | Showing the person three examples of blueprints before asking them to draw. |
| General Agent | A general contractor who tries to do the drafting, plumbing, and electrical all at once and gets overwhelmed. |
| Custom Agent (ArchView) | A specialized drafting team with a planner, a drafter, and a quality checker. |
| Granularity Mismatch | Drawing every single nail in the wall instead of drawing the wall itself. |
| Human Evaluation | The senior architect reviewing the intern's work to see if it actually makes sense. |
In short: We are getting better at teaching AI to draw the lines, but we still need humans to teach it what the lines mean.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.