Introduction
Translating natural language into SQL (Text-to-SQL) is a vital step toward making complex data accessible to non-experts. However, a significant hurdle in modern parsing is cross-domain generalization. Most existing models are "domain-aware," meaning they rely heavily on the specific semantic names of tables and columns (e.g., "Player_Name" in a sports database). When these models encounter unseen databases with different naming conventions, performance often degrades because they fail to link the user's question to the new schema structure.
The Abstraction Problem
The core issue is that models often learn specific vocabulary rather than the underlying logical intent. To address this, ShadowGNN introduces a method to "abstract" queries. Instead of processing a specific question like "What are the names of teams?", the model learns to handle a generic structure like "What are the [column_1] of [table_1]?". This creates a "shadow" representation that remains consistent across different domains, regardless of the specific database content.
Methodology: Graph Projection and Inference
ShadowGNN utilizes a two-phase encoder architecture designed to decouple database structure from domain-specific names: Abstracting and Inferring.
Graph Projection Neural Network (GPNN)
The GPNN is the primary innovation of this work. It processes three distinct inputs: the Natural Language (NL) question, the Semantic Schema (actual names), and the Abstract Schema (structural types like "table" or "column"). Through a "Projection Attention" mechanism, the model uses the semantic schema as a bridge to update the question's representation using the abstract schema. This effectively "delexicalizes" the input, stripping away domain-specific noise while preserving essential structural relationships.
Relation-Aware Transformer (RAT) and Decoder
Following abstraction, a Relation-Aware Transformer (RAT) extracts logical links between the question and the schema. Because the input has been normalized into a domain-independent format, the transformer can focus purely on structural logic. Finally, an improved SemQL decoder outputs an abstract syntax tree, which is converted into valid SQL with a near-perfect recovery rate.
Experimental Results
The model was evaluated on the Spider benchmark, the most challenging large-scale cross-domain Text-to-SQL dataset, featuring 146 databases across 138 domains.
- State-of-the-Art Performance: ShadowGNN achieved 66.1% accuracy on the Spider test set, outperforming established models such as RATSQL.
- Data Efficiency: A key finding is ShadowGNN's robustness in low-data scenarios. When trained on only 10% of the available data, it maintained a significant performance lead (approximately 5% absolute) over its closest competitors. This suggests that abstraction is a far more efficient learning strategy than brute-force pattern matching.
- Ablation Success: Removing the GPNN abstraction layer resulted in a significant performance drop, confirming its role as the critical component for cross-domain generalization.
Conclusion
ShadowGNN demonstrates that by ignoring specific names and focusing on the "shadow" logic of databases, AI can achieve superior cross-domain performance and data efficiency. Future work may involve integrating specialized pre-trained models like TaBERT or GraPPa to further enhance the bridging of natural language and tabular structures.
Summary updated