English

AttnLink: Turning Attention into Schema Links for Text-to-SQL

Computation and Language 2026-08-01 v1

Abstract

Schema linking is a critical component of Text-to-SQL systems, but existing approaches often trade off contextual modeling capacity, score-based controllability, and inference efficiency. We introduce AttnLink, an attention-based framework that converts LLMs' internal attention into continuous relevance scores for schema items. AttnLink extracts the attention from the generation-start position to candidate schema spans, enabling all candidates to be ranked in a single prefill pass without autoregressive decoding. We develop two variants: AttnLink-U, which directly probes pretrained attention without parameter updates, and AttnLink-S, which aligns the attention distribution with gold schema items through direct supervision. To improve coverage of multiple relevant schema items, AttnLink-S combines a set-mass objective with an adaptive probability-floor regularizer. The resulting scores support post-hoc precision-recall control through temperature scaling and cumulative-mass selection. Experiments on Spider, BIRD, and Spider2-SQLite show that AttnLink-S achieves mAP scores of 99.22%, 95.95%, and 83.29%, respectively, with millisecond-scale schema-linking latency. It also yields the best or tied-best execution accuracy for downstream SQL generation in seven of nine generator-dataset settings.

Cite

@article{arxiv.2608.00693,
  title  = {AttnLink: Turning Attention into Schema Links for Text-to-SQL},
  author = {Jinwang Song and Tao Liu and Haowen Zheng and Xiangheng Li and Yifan Li and Hongying Zan},
  journal= {arXiv preprint arXiv:2608.00693},
  year   = {2026}
}