TLDR: Miffie is a novel framework that automates database schema normalization using a dual-model self-refinement architecture powered by large language models (LLMs). It employs GPT-4 for generating normalized schemas and o1-mini for verifying them, iteratively refining the output based on feedback. This approach, combined with task-specific zero-shot prompts, significantly reduces manual effort, maintains high accuracy, and improves cost-efficiency in managing relational databases.
Maintaining the integrity and efficiency of data in relational databases is paramount, and a key process for this is database normalization. Traditionally, this has been a complex, time-consuming, and often error-prone task, heavily reliant on the manual efforts of data engineers. However, a new framework called Miffie is changing this by leveraging the power of large language models (LLMs) to automate database normalization with impressive accuracy.
Miffie, developed by Eunjae Jo, Nakyung Lee, and Gyuyeong Kim from Sungshin Women’s University, addresses the long-standing challenge of automating database normalization. While LLMs have shown promise in understanding structured data and identifying issues, simply applying them with basic instructions often leads to inaccuracies due to the subtle semantic relationships within data.
How Miffie Works: A Dual-Model Approach
The core innovation of Miffie lies in its unique dual-model self-refinement architecture. Unlike conventional self-refinement methods that use a single model for both generation and feedback, Miffie employs two distinct LLMs, each optimized for a specific role: schema generation and verification.
Here’s a breakdown of the process:
- Generation Module: This module, powered by GPT-4, takes an initial, unnormalized database schema as input from the user. Its task is to generate a normalized schema, aiming to satisfy normal forms like 1NF, 2NF, and 3NF.
- Verification Module: This module, utilizing o1-mini, rigorously checks the schema produced by the generation module. It performs a binary verification, identifying any violations of normalization requirements.
- Self-Refinement Loop: If the verification module detects anomalies, it provides detailed feedback, explaining the issues and suggesting corrective actions (e.g., splitting tables). The generation module then refines its output based on this feedback. This iterative process continues until the schema is fully normalized or a maximum number of refinement attempts is reached.
This dual-model strategy capitalizes on the strengths of each LLM. Experiments showed that GPT-4 excels at generating schemas, consistently removing anomalies across different normal forms, while o1-mini demonstrates near-perfect anomaly detection rates, making it ideal for verification.
Smart Prompting for Efficiency
Another crucial aspect of Miffie is its use of carefully designed task-specific zero-shot prompts. While LLMs possess extensive knowledge of database normalization, generic prompts often fall short. Miffie’s prompts explicitly clarify the requirements for each normal form, guiding the models to detect anomalies accurately without needing examples (few-shot prompting), which significantly reduces token usage and improves cost-efficiency.
Also Read:
- Enhancing Table Understanding with CHAIN-OF-QUERY: A Multi-Agent Approach for LLMs
- HyST: A New Approach to Smarter Recommendations with AI
Key Findings and Benefits
The research demonstrates several compelling advantages of the Miffie framework:
- Higher Accuracy: Miffie consistently achieves higher normalization accuracy compared to naive prompting methods, improving performance by approximately 1.2 times across all normal forms.
- Cost-Efficiency: The zero-shot prompting approach delivers comparable or better accuracy than more token-intensive one-shot or few-shot methods.
- Robustness: The dual-model architecture and iterative feedback loops enable Miffie to handle complex database schemas effectively, even though accuracy might slightly decrease with extremely hard schemas, it still resolves most 3NF anomalies.
- Reduced Human Effort: By automating a traditionally manual task, Miffie significantly reduces the time and effort required from data engineers, allowing them to focus on more strategic tasks.
Most normalization tasks within Miffie are successfully completed within three refinement attempts, showcasing its efficiency. This framework not only automates a critical database management process but also offers valuable insights into how dual-model self-refinement can outperform single-model approaches in domain-specific tasks.
For more in-depth information, you can read the full research paper: Database Normalization via Dual-LLM Self-Refinement.


