OmniSQL: توليف بيانات نص إلى SQL عالية الجودة على نطاق واسع OmniSQL: Synthesizing High-Quality Text-to-SQL Data at Scale

شارك:
المجلة: Proceedings of the VLDB Endowment، المجلد: 18، العدد: 11
DOI: https://doi.org/10.14778/3749646.3749723
تاريخ النشر: 2025-07-01
المؤلف: Haoyang Li وآخرون
الموضوع الرئيسي: نمذجة الموضوعات

نظرة عامة

تقدم الورقة إطار عمل جديد لتوليد مجموعات بيانات النص إلى SQL، مما يعالج القيود الكبيرة في الأساليب الحالية التي تعتمد على نماذج اللغة الكبيرة المغلقة المصدر (LLMs) أو تعاني من ضعف القابلية للتعميم بسبب بيانات التدريب المحدودة. يمكّن الإطار المقترح من التوليد التلقائي لمجموعات بيانات عالية الجودة على نطاق واسع مع تدخل بشري محدود، مما يؤدي إلى SynSQL-2.5M، وهو أول مجموعة بيانات من نوعها تحتوي على 2.5 مليون عينة عبر أكثر من 16,000 قاعدة بيانات اصطناعية. تتضمن كل عينة مخطط قاعدة بيانات، واستعلام SQL المقابل، وسؤال باللغة الطبيعية، وحل سلسلة من الأفكار (CoT).

استنادًا إلى SynSQL-2.5M، يقدم المؤلفون OmniSQL، وهو نموذج نص إلى SQL مفتوح المصدر متاح بأحجام من 7B و 14B و 32B من المعلمات. تشير التقييمات الشاملة عبر تسعة مجموعات بيانات مرجعية إلى أن OmniSQL يحقق أداءً رائدًا، متفوقًا على كل من LLMs المغلقة المصدر والمفتوحة المصدر، بما في ذلك GPT-4o و DeepSeek-V3، على الرغم من أن لديه عددًا أقل من المعلمات. يؤكد المؤلفون أن إصدار SynSQL-2.5M و OmniSQL سيساهم بشكل كبير في مجال أبحاث النص إلى SQL، مما يوفر موارد قيمة لمزيد من التقدم.

مقدمة

تناقش مقدمة الورقة البحثية أهمية أنظمة النص إلى SQL، التي تحول الاستعلامات باللغة الطبيعية إلى أوامر SQL قابلة للتنفيذ، مما يسهل التفاعلات مع قواعد البيانات لغير الخبراء. لقد جذبت هذه المنطقة اهتمامًا كبيرًا من كل من مجتمعات معالجة اللغة الطبيعية (NLP) وأبحاث قواعد البيانات. تبرز الورقة معيار Spider2.0، الذي يقدم سيناريو واقعي صعب مع استعلامات SQL معقدة، وسياقات واسعة، و لهجات SQL متعددة. يستخرج المؤلفون مجموعة فرعية من هذا المعيار، تُسمى Spider2.0-SQLite، للتقييم، جنبًا إلى جنب مع معايير أخرى مثل ScienceBenchmark و EHRSQL التي تركز على مجالات مهنية محددة.

تشير النتائج الرئيسية إلى أن نموذج OmniSQL يظهر أداءً متفوقًا على مختلف المعايير، محققًا تحسينات كبيرة على النماذج الأساسية عند ضبطه باستخدام بيانات اصطناعية. على سبيل المثال، يظهر OmniSQL-7B زيادة في الدقة بمعدل +8.4% مقارنة بنموذجه الأساسي، مما يضع معيارًا جديدًا لنماذج LLMs بحجم 7B. يتفوق النموذج في كل من المعايير القياسية والمعايير الخاصة بالمجالات، متفوقًا على النماذج الأكبر في سياقات معينة، لا سيما في المجال الطبي مع EHRSQL. تشير النتائج إلى أنه بينما قد لا تحقق النماذج الأكبر مكاسب في الأداء باستمرار على المعايير الأبسط، إلا أنها تظهر قدرات محسنة في المهام الأكثر تعقيدًا. علاوة على ذلك، تشير الورقة إلى أن قوة OmniSQL واضحة في أدائه ضد استبدالات المرادفات والتحديات الخاصة بالمجالات، على الرغم من أنه يواجه قيودًا في فهم المعرفة الضمنية مقارنة بالنماذج الأساسية. يقترح المؤلفون أن التحسينات الإضافية، مثل دمج المعرفة العامة وتقنيات النص إلى SQL الإضافية، يمكن أن تعزز قدرات OmniSQL.

طرق

شمل الإعداد التجريبي إطار عمل مصمم بعناية للتحقيق في فرضيات البحث. تضمنت المكونات الرئيسية اختيار المواد والمعدات المناسبة، والتي تم معايرتها لضمان الدقة والموثوقية في القياسات. تم هيكلة الإعداد لتقليل المتغيرات الخارجية التي قد تؤثر على النتائج، مما يعزز من صحة النتائج.

تم جمع البيانات في ظروف محكومة، مع وضع بروتوكولات محددة للحفاظ على الاتساق عبر التجارب. شملت المنهجية استخدام أدوات إحصائية لتحليل البيانات، مما يضمن أن النتائج يمكن تفسيرها بدرجة عالية من الثقة. بشكل عام، كان الإعداد التجريبي محوريًا في تسهيل فحص قوي للأسئلة البحثية المطروحة.

مناقشة

في قسم المناقشة من الورقة البحثية، يتناول المؤلفون التعقيدات المرتبطة بإنشاء إطار عمل تلقائي وقابل للتوسع لتوليد البيانات لمهام النص إلى SQL. يحددون التحديات الرئيسية، مثل ضمان جودة وتنوع البيانات المولدة مع الحفاظ على الأتمتة. لمواجهة هذه القضايا، يقترحون خط أنابيب تدريجي يكسر عملية التوليد إلى خطوات قابلة للإدارة، كل منها مؤتمت باستخدام نماذج اللغة الكبيرة (LLMs). يتضمن خط الأنابيب توليد قواعد بيانات واقعية من جداول الويب، وتوليد استعلامات SQL ذات تعقيد متنوع، وترجمة هذه الاستعلامات إلى أسئلة باللغة الطبيعية بأساليب لغوية متنوعة، وإنتاج حلول سلسلة من الأفكار (CoT) التي توضح المنطق وراء بناء استعلام SQL.

يقدم المؤلفون SynSQL-2.5M، وهي مجموعة بيانات كبيرة تضم أكثر من 2.5 مليون عينة نص إلى SQL، والتي تظهر تنوعًا وتعقيدًا عاليين مقارنة بمجموعات البيانات الحالية. تعمل هذه المجموعة كقاعدة ل OmniSQL، وهو نموذج نص إلى SQL متعدد المقاييس يحقق أداءً رائدًا عبر معايير مختلفة، متفوقًا على كل من النماذج المفتوحة المصدر والمغلقة المصدر الرائدة على الرغم من حجمه الأصغر. تشمل مساهمات الدراسة تطوير إطار عمل قوي لتوليد البيانات، وإنشاء مجموعة بيانات اصطناعية كبيرة، وإقامة معيار جديد لأداء النص إلى SQL، وكل ذلك متاح للجمهور لتسهيل المزيد من الأبحاث في هذا المجال.

القيود

تسلط القيود المفروضة على الحلول الحالية الرائدة (SOTA) في مجال النص إلى SQL الضوء على التحديات الكبيرة التي تواجهها كل من الأساليب المعتمدة على التوجيه والأساليب المعتمدة على الضبط الدقيق. تواجه الأساليب المعتمدة على التوجيه، التي تستخدم نماذج اللغة الكبيرة القوية (LLMs) من خلال واجهات برمجة التطبيقات، مشكلات مثل ارتفاع تكاليف التشغيل، ومخاوف الخصوصية، والسيطرة المحدودة على سلوك النموذج. من ناحية أخرى، تكافح طرق الضبط الدقيق، على الرغم من فعاليتها على مجموعات بيانات التدريب مثل Spider و BIRD، مع القابلية للتعميم على قواعد البيانات المعقدة أو الخاصة بالمجالات، كما يتضح من انخفاض دقة التنفيذ على مجموعات البيانات خارج المجال (43.8% و 31.4% لمعايير ScienceBenchmark و EHRSQL، على التوالي). بالمقابل، يظهر التوجيه بدون عينة مع نماذج مثل GPT-4-Turbo أداءً أفضل، محققًا دقة تنفيذ تبلغ 59.2% و 43.1%.

لمعالجة هذه القيود، تقترح الورقة إطار عمل جديد لتوليد بيانات النص إلى SQL يقوم بأتمتة توليد عينات بيانات متنوعة وعالية الجودة مع تدخل بشري محدود. يهدف هذا الإطار إلى تعزيز أداء وقابلية تعميم LLMs المفتوحة المصدر من خلال توفير بيانات قابلة للتوسع وواقعية تتماشى مع احتياجات المستخدمين في العالم الحقيقي. من خلال التغلب على قيود أساليب تعزيز البيانات الحالية، التي غالبًا ما تؤدي إلى تنوع محدود وتتطلب جهدًا بشريًا كبيرًا، يقدم هذا النهج اتجاهًا واعدًا لتحسين أنظمة النص إلى SQL مع ضمان الفعالية من حيث التكلفة وأمان البيانات.

Journal: Proceedings of the VLDB Endowment, Volume: 18, Issue: 11
DOI: https://doi.org/10.14778/3749646.3749723
Publication Date: 2025-07-01
Author(s): Haoyang Li et al.
Primary Topic: Topic Modeling

Overview

The paper presents a novel framework for synthesizing text-to-SQL datasets, addressing significant limitations in existing approaches that rely on closed-source large language models (LLMs) or suffer from poor generalizability due to limited training data. The proposed framework enables the automatic generation of large-scale, high-quality datasets with minimal human intervention, resulting in SynSQL-2.5M, the first dataset of its kind containing 2.5 million samples across over 16,000 synthetic databases. Each sample includes a database schema, corresponding SQL query, natural language question, and a chain-of-thought (CoT) solution.

Building on SynSQL-2.5M, the authors introduce OmniSQL, an open-source text-to-SQL model available in sizes of 7B, 14B, and 32B parameters. Extensive evaluations across nine benchmark datasets indicate that OmniSQL achieves state-of-the-art performance, outperforming both closed-source and open-source LLMs, including GPT-4o and DeepSeek-V3, despite having fewer parameters. The authors emphasize that the release of SynSQL-2.5M and OmniSQL will significantly contribute to the field of text-to-SQL research, providing valuable resources for further advancements.

Introduction

The introduction of the research paper discusses the significance of Text-to-SQL systems, which convert natural language queries into executable SQL commands, thereby facilitating database interactions for non-experts. This area has attracted considerable attention from both the natural language processing (NLP) and database research communities. The paper highlights the Spider2.0 benchmark, which presents a challenging real-world scenario with complex SQL queries, extensive contexts, and multiple SQL dialects. The authors extract a subset of this benchmark, named Spider2.0-SQLite, for evaluation, alongside other benchmarks like ScienceBenchmark and EHRSQL that focus on specific professional domains.

The main findings indicate that the OmniSQL model demonstrates superior performance on various benchmarks, achieving significant improvements over base models when fine-tuned with synthetic data. For instance, OmniSQL-7B shows an average accuracy increase of +8.4% compared to its base model, setting a new standard for 7B-scale LLMs. The model excels in both standard and domain-specific benchmarks, outperforming larger models in certain contexts, particularly in the medical domain with EHRSQL. The results suggest that while larger models may not consistently yield performance gains on simpler benchmarks, they show enhanced capabilities on more complex tasks. Furthermore, the paper notes that OmniSQL’s robustness is evident in its performance against synonym substitutions and domain-specific challenges, although it faces limitations in understanding implicit knowledge compared to base models. The authors propose that further refinements, such as incorporating commonsense knowledge and additional text-to-SQL techniques, could enhance OmniSQL’s capabilities.

Methods

The experimental setup involved a carefully designed framework to investigate the research hypotheses. Key components included the selection of appropriate materials and equipment, which were calibrated to ensure accuracy and reliability in measurements. The setup was structured to minimize external variables that could influence the results, thereby enhancing the validity of the findings.

Data collection was conducted under controlled conditions, with specific protocols established to maintain consistency across trials. The methodology included the use of statistical tools to analyze the data, ensuring that the results could be interpreted with a high degree of confidence. Overall, the experimental setup was pivotal in facilitating a robust examination of the research questions posed.

Discussion

In the discussion section of the research paper, the authors address the complexities involved in creating an automatic and scalable data synthesis framework for text-to-SQL tasks. They identify key challenges, such as ensuring the quality and diversity of generated data while maintaining automation. To tackle these issues, they propose a progressive pipeline that breaks down the synthesis process into manageable steps, each automated with large language models (LLMs). The pipeline includes synthesizing realistic databases from web tables, generating SQL queries of varying complexity, translating these queries into natural language questions with diverse linguistic styles, and producing chain-of-thought (CoT) solutions that elucidate the reasoning behind SQL query construction.

The authors introduce SynSQL-2.5M, a large-scale dataset comprising over 2.5 million text-to-SQL samples, which demonstrates high diversity and complexity compared to existing datasets. This dataset serves as the foundation for OmniSQL, a multi-scale text-to-SQL model that achieves state-of-the-art performance across various benchmarks, outperforming both leading open-source and closed-source models despite its smaller size. The contributions of the study include the development of a robust data synthesis framework, the creation of a significant synthetic dataset, and the establishment of a new benchmark for text-to-SQL performance, all of which are made publicly available to facilitate further research in the field.

Limitations

The limitations of current state-of-the-art (SOTA) solutions in the text-to-SQL domain highlight significant challenges faced by both prompting-based and fine-tuning-based methods. Prompting-based approaches, which utilize powerful large language models (LLMs) through APIs, encounter issues such as high operational costs, data privacy concerns, and limited control over model behavior. Conversely, fine-tuning methods, while effective on training datasets like Spider and BIRD, struggle with generalizability to complex or domain-specific databases, as evidenced by low execution accuracy on out-of-domain datasets (43.8% and 31.4% for ScienceBenchmark and EHRSQL, respectively). In contrast, zero-shot prompting with models like GPT-4-Turbo demonstrates better performance, achieving execution accuracies of 59.2% and 43.1%.

To address these limitations, the paper proposes a novel text-to-SQL data synthesis framework that automates the generation of diverse, high-quality data samples with minimal human intervention. This framework aims to enhance the performance and generalizability of open-source LLMs by providing scalable and realistic data that aligns with real-world user needs. By overcoming the constraints of existing data augmentation methods, which often yield limited diversity and require extensive human effort, this approach presents a promising direction for improving text-to-SQL systems while ensuring cost-effectiveness and data security.