ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQL

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Jiao, Yiwen, Ren, Tonghui, Gao, Yuche, He, Zhenying, Jing, Yinan, Zhang, Kai, Wang, X. Sean
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917059327164416
author Jiao, Yiwen
Ren, Tonghui
Gao, Yuche
He, Zhenying
Jing, Yinan
Zhang, Kai
Wang, X. Sean
author_facet Jiao, Yiwen
Ren, Tonghui
Gao, Yuche
He, Zhenying
Jing, Yinan
Zhang, Kai
Wang, X. Sean
contents Large Language Models (LLMs) have demonstrated remarkable progress in translating natural language to SQL, but a significant semantic gap persists between their general knowledge and domain-specific semantics of databases. Historical translation logs constitute a rich source of this missing in-domain knowledge, where SQL queries inherently encapsulate real-world usage patterns of database schema. Existing methods primarily enhance the reasoning process for individual translations but fail to accumulate in-domain knowledge from past translations. We introduce ORANGE, an online self-evolutionary framework that constructs database-specific knowledge bases by parsing SQL queries from translation logs. By accumulating in-domain knowledge that contains schema and data semantics, ORANGE progressively reduces the semantic gap and enhances the accuracy of subsequent SQL translations. To ensure reliability, we propose a novel nested Chain-of-Thought SQL-to-Text strategy with tuple-semantic tracking, which reduces semantic errors during knowledge generation. Experiments on multiple benchmarks confirm the practicality of ORANGE, demonstrating its effectiveness for real-world Text-to-SQL deployment, particularly in handling complex and domain-specific queries.
format Preprint
id arxiv_https___arxiv_org_abs_2511_00985
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQL
Jiao, Yiwen
Ren, Tonghui
Gao, Yuche
He, Zhenying
Jing, Yinan
Zhang, Kai
Wang, X. Sean
Databases
Artificial Intelligence
Computation and Language
Large Language Models (LLMs) have demonstrated remarkable progress in translating natural language to SQL, but a significant semantic gap persists between their general knowledge and domain-specific semantics of databases. Historical translation logs constitute a rich source of this missing in-domain knowledge, where SQL queries inherently encapsulate real-world usage patterns of database schema. Existing methods primarily enhance the reasoning process for individual translations but fail to accumulate in-domain knowledge from past translations. We introduce ORANGE, an online self-evolutionary framework that constructs database-specific knowledge bases by parsing SQL queries from translation logs. By accumulating in-domain knowledge that contains schema and data semantics, ORANGE progressively reduces the semantic gap and enhances the accuracy of subsequent SQL translations. To ensure reliability, we propose a novel nested Chain-of-Thought SQL-to-Text strategy with tuple-semantic tracking, which reduces semantic errors during knowledge generation. Experiments on multiple benchmarks confirm the practicality of ORANGE, demonstrating its effectiveness for real-world Text-to-SQL deployment, particularly in handling complex and domain-specific queries.
title ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQL
topic Databases
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2511.00985