Skip to content

Atlamtiz/LEAF-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍃 LEAF-SQL

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

Paper Conference License: MIT Python

Official implementation of the LEAF-SQL paper.

📄 Paper · 💻 Code · ✉️ Contact


🎉 News

  • [2026] 🏆 LEAF-SQL has been accepted to ICDE 2026! Read the paper on arXiv.

📖 Introduction

LEAF-SQL is a framework that treats Text-to-SQL as a tree search problem, exploring multiple skeleton candidates with diverse structures and granularities to improve the final query's accuracy.

LEAF-SQL method overview

🚀 Quick Start

For a quick demonstration of the LEAF-SQL method, you can run the example script. Note that this is a simplified version and does not represent the full functionality.

python example.py

🏁 Standard Usage

Follow these steps for the complete setup and execution.

Step 1 · Install Dependencies

Install all the required packages from requirements.txt.

pip install -r requirements.txt

Step 2 · Download Models and Dataset

Download the necessary models from ModelScope:

# Download the SkeEva model
modelscope download --model mrtanzhao/SkeEva --local_dir ./models/skeeva

# Download the SkeFor model
modelscope download --model Qwen/Qwen3-14B --local_dir ./models/skefor

Download the BIRD dataset from the official website: https://bird-bench.github.io/

Step 3 · Configure Settings

Modify the configuration file ./config/config.yaml to match your environment settings (e.g., file paths, api_key).

Step 4 · Launch API Servers

Start the two model services in separate terminal sessions. Adjust the parameters (like CUDA_VISIBLE_DEVICES, tensor-parallel-size, etc.) according to your hardware specifications.

The following example assumes an 8-GPU environment, assigning 4 GPUs to each model for optimal performance.

CUDA_VISIBLE_DEVICES=0,1,2,3 python -m vllm.entrypoints.openai.api_server \
    --model ./models/skefor \
    --served-model-name skefor \
    --port 8001 \
    --tensor-parallel-size 4 \
    --max-num-seqs 32 \
    --max-num-batched-tokens 1024
CUDA_VISIBLE_DEVICES=4,5,6,7 python -m vllm.entrypoints.openai.api_server \
    --model ./models/skeeva \
    --served-model-name skeeva \
    --port 8002 \
    --tensor-parallel-size 4 \
    --max-num-seqs 32 \
    --max-num-batched-tokens 1024

Step 5 · Run the Main Program

Once the services are running, execute the main script. You will see a progress bar indicating the processing status of the tasks.

python main.py

🌈 Contact Us

This project welcomes contributions and suggestions 👍.

If you find a bug, encounter a problem, or have a suggestion for LEAF-SQL, please submit an issue or reach out via email at tanzhao325@gmail.com.


📝 Citation

If you find our work useful or inspiring, please consider citing:

@inproceedings{leaf-sql-icde2026,
  author    = {Zhao Tan and
               Xiping Liu and
               Qing Shu and
               Qizhi Wan and
               Dexi Liu and
               Changxuan Wan},
  title     = {LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Prediction},
  booktitle = {Proceedings of the 42nd IEEE International Conference on Data Engineering (ICDE)},
  year      = {2026}
}

You may also cite the preprint:

@article{leaf-sql-arxiv,
  author  = {Zhao Tan and
             Xiping Liu and
             Qing Shu and
             Qizhi Wan and
             Dexi Liu and
             Changxuan Wan},
  title   = {LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Prediction},
  journal = {arXiv preprint arXiv:2605.09295},
  year    = {2026}
}

📜 License

This project is released under the MIT License.

About

A Text-to-SQL frame-work that reframes skeleton prediction as a coarse-to- fine tree search process. (ICDE 2026)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages