Do LLMs Align with My Task? Evaluating Text-to-SQL via Dataset Alignment

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Rafiei, Davood, Heisler, Morgan Lindsay, Zhang, Weiwei, Pourreza, Mohammadreza, Zhang, Yong
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866915535149596672
author Rafiei, Davood
Heisler, Morgan Lindsay
Zhang, Weiwei
Pourreza, Mohammadreza
Zhang, Yong
author_facet Rafiei, Davood
Heisler, Morgan Lindsay
Zhang, Weiwei
Pourreza, Mohammadreza
Zhang, Yong
contents Supervised Fine-Tuning (SFT) is an effective method for adapting Large Language Models (LLMs) on downstream tasks. However, variability in training data can hinder a model's ability to generalize across domains. This paper studies the problem of dataset alignment for Natural Language to SQL (NL2SQL or text to SQL), examining how well SFT training data matches the structural characteristics of target queries and how this alignment impacts model performance. We hypothesize that alignment can be accurately estimated by comparing the distributions of structural SQL features across the training set, target data, and the model's predictions prior to SFT. Through comprehensive experiments on three large cross-domain NL2SQL benchmarks and multiple model families, we show that structural alignment is a strong predictor of fine-tuning success. When alignment is high, SFT yields substantial gains in accuracy and SQL generation quality; when alignment is low, improvements are marginal or absent. These findings highlight the importance of alignment-aware data selection for effective fine-tuning and generalization in NL2SQL tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2510_04919
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Do LLMs Align with My Task? Evaluating Text-to-SQL via Dataset Alignment
Rafiei, Davood
Heisler, Morgan Lindsay
Zhang, Weiwei
Pourreza, Mohammadreza
Zhang, Yong
Computation and Language
Artificial Intelligence
Databases
Supervised Fine-Tuning (SFT) is an effective method for adapting Large Language Models (LLMs) on downstream tasks. However, variability in training data can hinder a model's ability to generalize across domains. This paper studies the problem of dataset alignment for Natural Language to SQL (NL2SQL or text to SQL), examining how well SFT training data matches the structural characteristics of target queries and how this alignment impacts model performance. We hypothesize that alignment can be accurately estimated by comparing the distributions of structural SQL features across the training set, target data, and the model's predictions prior to SFT. Through comprehensive experiments on three large cross-domain NL2SQL benchmarks and multiple model families, we show that structural alignment is a strong predictor of fine-tuning success. When alignment is high, SFT yields substantial gains in accuracy and SQL generation quality; when alignment is low, improvements are marginal or absent. These findings highlight the importance of alignment-aware data selection for effective fine-tuning and generalization in NL2SQL tasks.
title Do LLMs Align with My Task? Evaluating Text-to-SQL via Dataset Alignment
topic Computation and Language
Artificial Intelligence
Databases
url https://arxiv.org/abs/2510.04919