TL;DR
The AbsCon (Abstraction-Concretization) framework improves the reliability of LLM-generated graph models (like flowcharts or taxonomies) by merging multiple candidate outputs into a probabilistic model. It then uses formal constraint optimization to ensure the final graph is both semantically accurate and strictly follows domain-specific rules, often achieving 100% consistency where raw LLMs fail.
What Problem Does This Paper Address?
While Large Language Models (LLMs) are surprisingly good at translating natural language into structured formats, they struggle with "composite" structures like graphs. When asked to generate a flowchart or a software model, LLMs frequently suffer from three issues:
- Syntax Violations: The output doesn't follow the required format (e.g., bad Mermaid or PlantUML code).
- Constraint Inconsistencies: The graph is structurally "illegal" (e.g., a flowchart decision node with only one exit).
- Inaccuracy: The model hallucinates elements that weren't in the original text description.
Existing solutions usually focus on fixing syntax, but they ignore the deeper structural rules (metamodels) and the inherent uncertainty of LLM outputs. The authors aim to bridge the gap between the creative but "hallucination-prone" nature of LLMs and the rigid requirements of formal Model-Driven Engineering (MDE).
Methods
The authors propose a two-stage framework called AbsCon:
- Abstraction (Merging the "Wisdom of the Crowd"):
- The system prompts an LLM to generate multiple candidate graphs for the same description.
- It uses Sentence-BERT embeddings to calculate similarity between node labels and Graph Edit Distance to match the structures of these candidates.
- These candidates are merged into a Probabilistic Partial Model, where every node and edge is assigned a probability based on how often it appeared across the different LLM outputs.
- Concretization (The "Formal Veto"):
- Domain-specific rules (e.g., "a taxonomy must be a tree with one root") are translated into First-Order Logic (FOL) and then into linear constraints.
- The framework treats the final graph generation as a Constraint Optimization Problem. It searches for the set of nodes and edges that maximizes the total probability (based on the LLM's "votes") while strictly satisfying 100% of the formal constraints.
Datasets
The framework was evaluated on three distinct types of graph modeling tasks:
- Flowcharts (PAGED Dataset): Procedural graphs extracted from text descriptions.
- Taxonomies (WordNet): Hierarchical structures representing "is-a" relationships between English terms.
- Program Induction (Clevr): Executable program graphs used for visual question answering.
The authors tested these across several LLMs, including GPT-4o, GPT-4o-mini, Llama 3.1-8B, and Llama 3.1-70B.
Key Insights and Ideas
- Constraints as Heuristics: Interestingly, enforcing formal rules doesn't just make the models "legal"—it actually makes them more accurate. By "vetoing" structurally impossible hallucinations, the solver often forces the system to pick the correct, lower-probability elements that the LLM actually got right in a few samples.
- Small Models, Big Gains: AbsCon provides a massive boost to smaller, open-source models. In several tests, a Llama 3.1-8B model equipped with AbsCon outperformed a "raw" GPT-4o in terms of model quality.
- The "Majority Voting" Trap: Simple majority voting (picking elements that appear in >50% of samples) often results in invalid graphs. You need the global view of a constraint solver to ensure the pieces fit together correctly.
- Efficiency: You don't need hundreds of samples. The authors found that performance usually plateaus after just 5 to 8 candidates, making the approach computationally feasible for real-time use.
Key Results
- Consistency: AbsCon achieved 100% consistency (zero rule violations) in 6 out of 12 experimental setups, significantly higher than direct LLM generation (which often hovered around 50-90%).
- Quality (F1-Score): On the WordNet taxonomy task, AbsCon improved the F1-score by an average of 8.61% over direct generation.
- Accuracy: For the Clevr program induction task, where a model must be "runnable" to be correct, AbsCon increased answer accuracy by approximately 27% on average.
Limitations and Future Work
- Manual Constraint Mapping: Currently, domain experts must manually translate metamodel constraints into First-Order Logic. The authors suggest that future work could involve using LLMs to automate this translation.
- Assumption of Commonality: The method assumes that the LLM will produce the "correct" subgraph more often than any specific "incorrect" one. If an LLM is fundamentally incapable of understanding a specific complex instruction, AbsCon might still fail.
- Runtime: While most samples were processed in seconds, graph matching is NP-hard. For extremely large, complex graphs, the abstraction phase might become a bottleneck.
Summary updated