← Latest papers
💬 NLP

LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Prediction

LEAF-SQL is a novel framework that enhances Text-to-SQL performance on complex queries by reframing skeleton prediction as a coarse-to-fine tree search process, utilizing a three-level hierarchy and specialized agents to systematically explore and adaptively refine diverse structural hypotheses, thereby achieving state-of-the-art execution accuracy on the BIRD benchmark.

Original authors: Zhao Tan, Xiping Liu, Qing Shu, Qizhi Wan, Dexi Liu, Changxuan Wan

Published 2026-05-12
📖 4 min read☕ Coffee break read

Original authors: Zhao Tan, Xiping Liu, Qing Shu, Qizhi Wan, Dexi Liu, Changxuan Wan

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

Imagine you are trying to give a complex order to a very smart, but sometimes overly literal, robot chef. You want a specific dish, but the robot needs to know the exact recipe steps (the "SQL") to get it right from a massive pantry (the "database").

The paper LEAF-SQL is about teaching this robot a better way to figure out the recipe when the order gets complicated.

Here is the breakdown of the problem and their solution, using simple analogies:

The Problem: The "One-and-Done" Mistake

Previously, when people asked the robot for a complex dish (like "Find the top 10 customers who spent the most, but only if they bought items from the 'Electronics' section"), the robot would try to guess the entire recipe in one single leap.

  • The Risk: If the robot guessed the wrong structure for the first step (e.g., it thought you wanted a list instead of a summary), the whole recipe failed. It was like trying to build a house by guessing the location of every single brick at once. If you get the foundation wrong, the house collapses.
  • The Old Way: Most methods tried to predict the final, detailed structure immediately. If they got it wrong, there was no way to fix it.

The Solution: LEAF-SQL (The "Architect's Search")

The authors propose a new method called LEAF-SQL. Instead of guessing the final recipe all at once, they treat it like a tree search where the robot explores different possibilities, starting with a rough sketch and slowly adding details.

Think of it like a detective solving a mystery or an architect designing a building:

  1. Start with a Rough Sketch (Coarse Level):
    First, the robot asks: "Do we need a list? Do we need a summary? Do we need to combine two lists?" It doesn't worry about specific ingredients yet. It just draws a basic outline.

    • Analogy: Drawing a stick figure of a house. You know it has a roof and walls, but you don't know the color of the bricks yet.
  2. Add Details Gradually (Fine-Graining):
    Once the basic shape looks right, the robot starts filling in the blanks. "Okay, this wall needs a window here. This roof needs a chimney."

    • Analogy: Moving from the stick figure to a blue-print, and then to a 3D model with specific materials.
  3. The Two Special Agents (The Team):
    To make this work, the system uses two specialized "agents" (AI helpers):

    • The Architect (Skeleton Formulation Agent): This agent is the creative one. It looks at the current sketch and says, "What if we tried adding a sub-basement here?" or "What if we connected these two rooms differently?" It generates many different versions of the recipe structure.
    • The Inspector (Skeleton Evaluation Agent): This agent is the critical thinker. It looks at the Architect's new ideas and says, "Wait, that basement design doesn't make sense for this question," or "That connection is impossible." It prunes (cuts off) the bad ideas immediately so the system doesn't waste time on them.
  4. The Result: A Menu of Options:
    Instead of betting on just one recipe, LEAF-SQL produces a menu of several different, valid recipe structures.

    • For simple questions, it might confidently pick the most detailed, fancy recipe.
    • For very hard, confusing questions, it might stick to a simpler, safer recipe structure that is less likely to fail.
    • Finally, it tries all the recipes in the menu and picks the one that actually works (the one that gives the correct answer).

Why This is a Big Deal

The paper claims that this "search and refine" approach is much better than the old "guess it all at once" method, especially for hard problems.

  • Flexibility: If one path leads to a dead end, the system can backtrack and try a different path without starting over from scratch.
  • Adaptability: It knows when to be bold (using complex structures for easy questions) and when to be safe (using simple structures for confusing questions).
  • Performance: In their tests (specifically on a benchmark called BIRD, which is like a "final exam" for database questions), this method achieved a 71.6% success rate, beating other top methods. It proved that by exploring multiple possibilities and filtering out the bad ones, the robot chef can cook much more complex dishes correctly.

Summary

LEAF-SQL stops the AI from trying to jump to the finish line. Instead, it teaches the AI to walk step-by-step: draw a rough map, check if the map makes sense, add details, check again, and finally, try the best few maps to see which one leads to the treasure. This makes it much harder for the AI to get lost in complex logic.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →