# Exploring the Compositional Generalization in Context Dependent Text-to-SQL Parsing

**Authors:** Aiwei Liu, Wei Liu, Xuming Hu, Shuang Li, Fukun Ma, Yawen Yang, Lijie Wen  
**arXiv:** [2306.04480](https://arxiv.org/abs/2306.04480)  
**Date:** 2023-05-29  
**Summary page:** https://www.summarizepaper.com/en/paper/2306.04480v1/

## Key points

- Generated SQL statements in Text-to-SQL task are refined iteratively based on user input utterance
- Input text from each interaction can be viewed as component modifications to previous SQL statements
- Modification patterns can be extracted from these interactions and combined with other SQL statements
- Two challenging benchmarks, CoSQL-CG and SParC-CG, were constructed by recombining modification patterns and existing SQL statements
- Current models struggle to perform well on these benchmarks
- Alignment of previous SQL statements with input utterance improves compositional generalization ability of models
- A method called p-align is proposed to improve compositional generalization by aligning text and SQL statements accurately and incorporating previous SQL statements into model architecture
- The research highlights the importance of compositional generalization in context-dependent Text-to-SQL settings
- The proposed method significantly enhances model performance in handling complex queries.

## Summary

In the context-dependent Text-to-SQL task, the generated SQL statements are refined iteratively based on the user input utterance from each interaction. The input text from each interaction can be viewed as component modifications to the previous SQL statements, which could be further extracted as modification patterns. These modification patterns can also be combined with other SQL statements, requiring models to have compositional generalization to handle novel combinations. This paper explores compositional generalization in context-dependent Text-to-SQL scenarios and introduces two challenging benchmarks named CoSQL-CG and SParC-CG, constructed by recombining modification patterns and existing SQL statements. The experiments conducted on these benchmarks reveal that current models struggle to perform well. It is observed that better alignment of previous SQL statements with the input utterance can enhance models' compositional generalization ability. Based on this observation, a method called p-align is proposed to improve the compositional generalization of Text-to-SQL models. Further experiments validate the effectiveness of this method. The authors highlight several contributions of their work: they are the first to explore compositional generalization in context-dependent Text-to-SQL; they construct challenging benchmarks for related studies; and they propose a method (p-align) that effectively improves current models' compositional generalization ability by aligning text and SQL statements more accurately and incorporating previous SQL statements into their model architecture. Overall, this research sheds light on the importance of compositional generalization in context dependent Text to SQL settings and presents a method that significantly enhances model performance in handling complex queries.
