Lightweight Transformers for Zero-Shot and Fine-Tuned Text-to-SQL Generation Using Spider

2508.04623v1 cs.CL, cs.IR, 68T50 % Natural language processing (in Computer Science), I.2.7; H.2.3 2025-08-09
Авторы:

Chirag Seth, Utkarsh Singh

Резюме на русском

**Резюме** Тексто-к SQL перевод позволяет неэкспертным пользователям выполнять запросы к реляционным базам данных с использованием естественного языка, что находит применение в образовании и бизнес-интеллекту. В данном исследовании анализируются три лёгких трансформерных модели — T5-Small, BART-Small и GPT-2 — на Spider датасете, сфокусированном на сценарии с ограниченными ресурсами. Разработанная авторами модельно-независимая конвейерная модель адаптирует схемы к особенностям каждой модели. Модели были обучены в течение 1000–5000 эпох, оцениваясь по метрикам Logical Form Accuracy (LFAcc), BLEU и Exact Match (EM). Легкая T5-Small показала наилучший результат LFAcc (27.8%), превосходя BART-Small (23.98%) и GPT-2 (20.1%). Это подтверждает преимущество encoder-decoder моделей в схемосознающей генерации SQL. Несмотря на ресурсные ограничения, модульность pipeline позволяет добавить расширенные схемоподключения и рассматривать другие модели. Результаты показывают, что легкие трансформеры могут делать text-to-SQL доступным в условиях ограниченных ресурсов.

Abstract

Text-to-SQL translation enables non-expert users to query relational databases using natural language, with applications in education and business intelligence. This study evaluates three lightweight transformer models - T5-Small, BART-Small, and GPT-2 - on the Spider dataset, focusing on low-resource settings. We developed a reusable, model-agnostic pipeline that tailors schema formatting to each model's architecture, training them across 1000 to 5000 iterations and evaluating on 1000 test samples using Logical Form Accuracy (LFAcc), BLEU, and Exact Match (EM) metrics. Fine-tuned T5-Small achieves the highest LFAcc (27.8%), outperforming BART-Small (23.98%) and GPT-2 (20.1%), highlighting encoder-decoder models' superiority in schema-aware SQL generation. Despite resource constraints limiting performance, our pipeline's modularity supports future enhancements, such as advanced schema linking or alternative base models. This work underscores the potential of compact transformers for accessible text-to-SQL solutions in resource-scarce environments.

Ссылки и действия