Complete or Abstain? Aligning SQL Completion with User Preferences

Xintong Hu, Defeng Xie, Yuxiang Wang, Chunyou Li, Haining Xie, Hao Liu, Haozhe Feng, Yang Li, Danqing Huang, Debiao He, Xiao Yan, Jiawei Jiang, Peng Chen


Abstract
SQL code completion boosts developer productivity by predicting missing snippets from editing SQL contexts. However, existing solutions yield low acceptance since they cannot abstain when no suggestion is needed and lack SQL-specific training. To address both limitations, we introduce PACE-SQL, a preference-aligned framework that improves SQL completion accuracy and user preference alignment. We build two datasets with completion and abstention samples: WeSQL-1.5M from real-world interaction logs to capture authentic user preferences, and OpenSQL-FIM from public SQL corpora. We adopt continual pretraining and supervised fine-tuning to improve completion quality, and design a reward function in the reinforcement learning to enhance alignment with user preferences. Experiments show PACE-SQL improves Exact Match and Edit Similarity scores by 9.67% and 7.52% over the best baseline on WeSQL-1.5M and raises online user acceptance rate from 5% to 29%.
Anthology ID:
2026.emnlp-industry.16
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing: Industry Track
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Pepa Atanasova, Gholamreza Haffari, Minghan Wang
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
240–258
Language:
URL:
https://aclanthology.org/2026.emnlp-industry.16/
DOI:
Bibkey:
Cite (ACL):
Xintong Hu, Defeng Xie, Yuxiang Wang, Chunyou Li, Haining Xie, Hao Liu, Haozhe Feng, Yang Li, Danqing Huang, Debiao He, Xiao Yan, Jiawei Jiang, and Peng Chen. 2026. Complete or Abstain? Aligning SQL Completion with User Preferences. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing: Industry Track, pages 240–258, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Complete or Abstain? Aligning SQL Completion with User Preferences (Hu et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-industry.16.pdf