Automating Thesis Framework Diagrams with Multiple LLMs: An Engineering Practice for Editable Export
This article describes an engineering approach to generating thesis framework diagrams with large language model (LLM) APIs. The system separates content structuring, which models handle, from visual layout, which code handles, and exports the result as native, editable presentation shapes. It covers structured prompt design with output validation, multi-model routing with fallback, and incremental editing for iterative revisions.
Thesis framework diagrams are among the elements revised most often in academic writing. A supervisor’s comment such as “make the logical hierarchy clearer” can mean that the whole diagram needs a new structure, new levels, and new colors. With traditional drawing tools, each change means dragging many elements by hand, so rework is expensive. This article takes an engineering perspective and breaks down an automated diagram generation method based on LLM APIs. It turns a text description into an editable presentation within seconds and supports low-cost, multi-round iteration.
1. Why LLMs Suit Framework Diagram Generation
A framework diagram is a visual representation of structured information. It carries three kinds of information:
- Hierarchy: the parent-child and sequential relationships among background, methods, experiments, and conclusions;
- Semantics: the key terms and abbreviations inside each node;
- Style: colors, shapes, alignment, and other visual conventions.
LLMs are good at the first two. They can parse a natural-language description into an intermediate structured representation, such as a JSON tree or a hierarchical list. Style information can be controlled programmatically through preset templates. A sound architecture therefore assigns content structure to the model and visual presentation to code, keeping the two decoupled.
2. Overall System Architecture
A practical automated diagram system usually has four core modules:
User input (natural language or abstract)↓[Structured parsing layer] Prompt template → LLM → normalized JSON↓[Rendering layer] Layout algorithm (hierarchical / flow / matrix) → vector graphics↓[Export layer] Generates an editable presentation file (native editable shapes)↓[Interaction layer] Edit instructions → incremental update → re-export
Two design principles matter most. First, the intermediate representation must be standardized. The model must output strictly validated structured data, not drawing code directly, because structured data is easier to verify and repair. Second, the export format must stay editable. The output should consist of native shape elements, not embedded bitmaps. Then, when a supervisor asks for a color change or a shift in position, the user can make the edit directly in office software without regenerating the diagram.
3. Structured Parsing: Prompt Engineering Is Key
The quality of the model output determines the quality of the diagram. A three-part prompt works well: a role constraint, an output contract, and an example.
You are an academic diagram planning assistant. Parse the user's research description into a framework diagram structure.Output requirements:1. Return JSON only, in the format {"levels": [...], "edges": [...]}2. Use no more than four levels, with no more than eight nodes per level3. Keep each node label within 12 characters4. Mark uncertain hierarchical relationships with "uncertain": true
The model output should also be validated and repaired automatically. Retry when parsing fails, trim structures that exceed the limits, and ask the model to shorten labels that are too long. This defensive logic turns occasional failures into stable, dependable output.
4. Multi-Model Access and Routing Strategy
The original practice connects to several model providers, more than twenty models in total, and assigns them by capability tier. Without the specific brands, the neutral design of such a system can be summarized as follows:
| Model tier | Typical traits | Typical use cases |
|---|---|---|
| Flagship reasoning | Long reasoning chains, complex logical decomposition | Initial structure planning, complex diagrams |
| Balanced general-purpose | Strong Chinese-language comprehension, fast responses | Routine generation and edit instructions |
| Lightweight free | Zero cost, speed first | Simple edits, preview iterations, trial use by low-budget users |
In engineering terms, a unified model abstraction layer is recommended:
class ModelRouter:def route(self, task_complexity: int, budget: str):if task_complexity >= 3:return self.get_model(tier="reasoning")if budget == "free":return self.get_model(tier="free")return self.get_model(tier="balanced")
Pair the router with fallback and retry logic. When a high-tier model times out or hits a rate limit, the system switches automatically to a backup model so the diagram workflow does not stop. For budget-conscious individual users, simple tasks such as formatting adjustments and text edits can go to free-tier models first. High-tier models are then reserved for structural restructuring, which carries more value. On general-purpose cloud platforms such as Baidu AI Cloud, models of different sizes can also be called through a unified model service catalog, which simplifies key and billing management.
5. Editable Export: From Graphics to Presentation
The core of the export step is mapping the rendered result to native shape objects in a presentation. A common approach builds the file according to open document format specifications. Each node becomes a combination of a text box and a rectangle, each connector becomes a connector line object, and group relationships are preserved. Users can then:
- Select any shape and edit its text, color, or border directly;
- Move a node and have the connected lines follow automatically;
- Copy a single module and paste it into other slides for reuse.
Compared with exporting to SVG and converting the result to an image, native shapes provide a much better editing experience. This is what makes repeated revisions practical without regenerating the diagram.
6. Interaction Design for Iterative Edits
Edit instructions are often vague, for example “break down the experiment section a bit more.” The system needs to convert vague instructions into incremental operations on the structured intermediate representation, such as splitting nodes, adjusting levels, or reordering items. It then re-renders the diagram instead of generating everything from scratch. This keeps the overall layout stable while responding precisely to local changes. Combined with version snapshots, users can roll back to any earlier version at any time.
7. Summary
The value of automatic framework diagram generation lies not in replacing manual drawing but in handing repetitive structural adjustments to machines, so authors can focus on their content. Four steps work together: model-based structure parsing, code-controlled styling, native format export, and incremental editing. Adding multi-model routing and free-tier resource scheduling makes it possible to build a stable, efficient diagram workflow at low cost. The same approach applies to project report diagrams, system architecture diagrams, and other structured visuals, and it is worth adding to a researcher’s toolkit.
