Introduction
Semantic parsing—the task of translating natural language into machine-readable code like SQL—is a cornerstone of modern data interaction. Traditionally, models are trained on pairs of questions and logical forms, leaving the internal mapping between specific words and SQL tokens as a latent variable. This "guesswork" becomes particularly challenging when there is minimal textual overlap between the question and the database schema, such as mapping the word "who" to a column named athlete.
The SQUALL Dataset
To address this limitation, the authors introduce SQUALL (SQL+QUestion pairs ALigned Lexically), the first large-scale dataset providing manual lexical-to-logical alignments. Derived from the WikiTableQuestions (WTQ) training set, SQUALL consists of 11,276 table-question-answer triplets. Notably, 49.8% of question tokens are explicitly aligned to SQL fragments, providing a "finer-grained" level of supervision that was previously missing in benchmarks like WikiSQL or Spider.
Methodology
The research explores two primary strategies to utilize these manual alignments:
- Supervised Attention: Instead of allowing the model to learn attention weights autonomously, a loss term is added to penalize deviations from human-annotated alignments.
- Column Prediction: An auxiliary task requires the model to explicitly predict which table column a specific question fragment refers to, reinforcing the link between natural language and database headers.
These techniques were integrated into a Seq2seq model with attention and copying mechanisms, further enhanced by BERT feature extractors.
Key Insights and Results
The inclusion of alignment data yields several critical insights:
- Efficiency of Annotation: Manual alignment annotation takes less than half the time required to write the SQL query itself, making it a cost-effective supervision method.
- The 5% Rule: Providing alignments for just 5% of the training data captured over half of the total accuracy improvement seen with full alignment data.
- Bridging the Lexical Gap: Alignments are most effective when questions use synonyms or vague terms. As shown in Figure 6, the ALIGN model correctly identifies that "show" refers to a specific column, whereas standard models might struggle.
- Performance Boost: The "ALIGN" model achieved a 4.4% boost in execution accuracy over strong baselines. When combined with BERT, the model reached 54.1% execution accuracy, surpassing the previous weakly-supervised state-of-the-art of 48.8%.
- Robust Generalization: Models trained with alignments demonstrated significantly better performance on SQL templates unseen during training, suggesting a deeper understanding of the underlying logic.
Conclusion and Future Work
SQUALL represents a major advancement in semantic parsing supervision. While currently limited to the subset of WikiTableQuestions translatable to SQL (~81%), future work could extend these alignments to more complex datasets like Spider. The authors suggest exploring syntax-based methods or automatically converting SQUALL alignments into other logical formalisms to further unlock the potential of fine-grained supervision.
Summary updated