LatentRefusal: Latent-Signal Refusal for Unanswerable Text-to-SQL Queries
Paper · 2026 · Xuancheng Ren, Shijing Hu, Zhihui Lu et al.
Summary
LLM-based Text-to-SQL systems can answer unanswerable or underspecified questions with SQL that runs but answers the wrong question. Such questions include missing schema elements, out-of-scope requests, subjective criteria and ambiguity. This is a serious risk in areas like finance. Prompting the model to abstain fails exactly when it hallucinates. Sampling-based uncertainty is slow and may require executing dubious SQL. The authors frame safe refusal as an answerability gate that must decide before any SQL is generated or executed. Their method, LatentRefusal, keeps the base LLM frozen and reads hidden states from a single intermediate layer in one forward pass. A small probe, the Tri-Residual Gated Encoder (TRGE), adds a SwiGLU-gated residual branch to Transformer blocks. This branch dampens schema noise and highlights sparse question–schema mismatches. If the predicted answerability falls below a calibrated threshold, the system refuses. Across four benchmarks, it reaches an average F1 of 88.5% on Llama-3.1-8B and 88.8% on Qwen-3-8B, adding roughly 2 ms. This makes it a cheap, attachable safety layer for locally deployed models with white-box access.
Key points
- The gate is single-pass, pre-generation and execution-free. It needs access to intermediate activations but no updates to the base LLM.
- In ablations on Qwen-3-8B / TriageSQL, full TRGE reaches 87.1% F1. Variants score lower:
- without the gating branch: 85.4%
- with an MLP instead of SwiGLU: 83.0%
- with a linear probe: 70.4%
- SwiGLU also outperformed the GLU and GeGLU gates.
- The best signal comes from the middle layer (−16 of 32), with 87.1% F1 and 99.8% recall. The authors suggest later layers may collapse uncertainty into confident hallucinations.
- A 4-layer probe (19.0M parameters, about 2.6 ms) is optimal; deeper probes overfit the 300-sample training set. Training takes about 10 minutes on one A100-80G.
- Limitations:
- The probe needs re-tuning for new domains.
- The MD-Enterprise dataset cannot be released for privacy reasons.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 18,614 worksArtificial Intelligence · 17,965 worksArts and Humanities · 17,450 worksLanguage and Linguistics · 17,296 works
🧭 Topics 2Research subjects and languages the work is about.Semantic parsing & meaning representation · 193 worksCode & programming languages · 168 works
Cite
Cite as Xuancheng Ren, Shijing Hu, Zhihui Lu, Jiangqi Huang and Qiang Duan. 2026. LatentRefusal: Latent-Signal Refusal for Unanswerable Text-to-SQL Queries. Findings of the Association for Computational Linguistics: ACL 2026.
@inproceedings{ren2026latentrefusal,
title = {{LatentRefusal: Latent-Signal Refusal for Unanswerable Text-to-SQL Queries}},
author = {Xuancheng Ren, Shijing Hu, Zhihui Lu, Jiangqi Huang and Qiang Duan},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2026},
year = {2026},
doi = {10.18653/v1/2026.findings-acl.1007},
url = {https://doi.org/10.18653/v1/2026.findings-acl.1007}
}References
- Amos Azaria and Tom Mitchell. 2023. The internal state of an LLM knows when it’s lying. arXiv preprint arXiv:2304.13734.
- Collin Burns, Haotian Ye, Dan Klein, and Jacob Steinhardt. 2023. Discovering Latent Knowledge in Language Models without Supervision. In International Conference on Learning Representations (ICLR). find
- Chen Chen, Kexin Liu, Zepu Chen, Yanzhe Gu, Yijie Wu, Ming Tao, Zhaowei Fu, and Jieping Ye. 2024. INSIDE: LLMs’ internal states retain the power of hallucination detection. arXiv preprint arXiv:2402.03744.
- Qian Cheng, Ting Sun, Xin Liu, Wenge Zhang, Zhibin Yin, Si Li, Lizhen Li, Zhilin He, Kai Chen, and Xipeng Qiu. 2024. Can AI assistants know what they don’t know? arXiv preprint arXiv:2401.13275. — [arXiv:2401.13275](https://arxiv.org/abs/2401.13275) find
- C. K. Chow. 1970. On optimum recognition error and reject tradeoff. IEEE Transactions on Information Theory, 16(1):41–46. find
- Mingwen Dong, N. Anand Kumar, Yushi Hu, Saurabh Kaushik, Dongmei Song, Cho-Jui Hsieh, and Jinyang Li. 2024. PRACTIQ: A practical conversational text-to-SQL dataset with ambiguous and unanswerable queries. arXiv preprint arXiv:2410.11076.
- Xiang Du, Chen Xiao, and Yang Li. 2024. HaloScope: Harnessing Unlabeled LLM Generations for Hallucination Detection. arXiv preprint arXiv:2409.17504. — [arXiv:2409.17504](https://arxiv.org/abs/2409.17504) find
- Lei Huang, Weijiang Yu, Weitao Ma, Weihua Zhong, Zhenxin Feng, Haotian Wang, Qianglong Chen, Weihua Peng, Xiaocheng He, Sakit Li, Tianyun Zhu, and Binghuai Lin. 2023. A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions. arXiv preprint arXiv:2311.0…
- Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Yejin Bang, Andrea Madotto, and Pascale Fung. 2023. Survey of Hallucination in Natural Language Generation. ACM Computing Surveys, 55(12):1–38.
- Saurav Kadavath, Thomas Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield-Dodds, Nova DasSarma, Eli Tran-Johnson, Scott Johnston, Sheer El-Showk, Andy Jones, Nelson Elhage, Tristan Hume, Anna Chen, Yuntao Bai, Sam Bowman, Stanislav Fort, and 17 others. 20… find
- Jannik Kossen, Jiarui Han, Mohammed Razzak, Lisa Schut, Shreshth A Malik, and Yarin Gal. 2024. Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMs. arXiv preprint arXiv:2406.15927. — [arXiv:2406.15927](https://arxiv.org/abs/2406.15927) find
- Lennart Kuhn, Yarin Gal, and Sebastian Farquhar. 2023. Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generation. In International Conference on Learning Representations (ICLR).
- Ran El-Yaniv and Yair Wiener. 2010. On the Foundations of Noise-free Selective Classification. Journal of Machine Learning Research, 11:1605–1641. find
- Stephanie Lin, Jacob Hilton, and Owain Evans. 2022. Teaching Models to Express Their Uncertainty in Words. Transactions on Machine Learning Research. find
- Sebastian Farquhar, Jannik Kossen, Lennart Kuhn, and Yarin Gal. 2024. Detecting Hallucinations in Large Language Models Using Semantic Entropy. Nature, 630(8017):625–630. find
- Aiwei Liu, Xuming Hu, Lijie Wen, and Philip S. Yu. 2024. A survey of Text-to-SQL in the era of LLMs. arXiv preprint arXiv:2408.05109. — [arXiv:2408.05109](https://arxiv.org/abs/2408.05109) find
- Jing Gao, Biye Wang, Yuchen Li, Youtao Zhang, and Rui Wang. 2024. Text-to-SQL empowered by large language models: A benchmark evaluation. Proceedings of the VLDB Endowment, 17(11):2842–2855.
- Potsawee Manakul, Adian Liusie, and Mark J. F. Gales. 2023. SelfCheckGPT: Zero-resource black-box hallucination detection for generative large language models. arXiv preprint arXiv:2303.08896. find
- Yonatan Geifman and Ran El-Yaniv. 2017. Selective Classification for Deep Neural Networks. In Advances in Neural Information Processing Systems. find
- Samuel Marks and Max Tegmark. 2024. The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasets. In Conference on Language Modeling (COLM).
- Yonatan Geifman and Ran El-Yaniv. 2019. SelectiveNet: A Deep Neural Network with an Integrated Reject Option. In International Conference on Machine Learning. find
- Alexandre Grattafiori, Ayush Dubey, Ayush Jauhri, Ayush Pandey, Ayush Kadian, Alex Letman, Ankit Mathur, Armen Schelten, Arthur Vaughan, Bowen Yang, Angela Fan, Ankit Goyal, Asa Hartshorn, and Zheng Ma. 2024. The Llama 3 herd of models. arXiv preprint arXiv:2407.21783.
- Sung-Min Park, Xue-Ying Du, Ming-Chang Yeh, Hsin-Wei Wang, and Yu-Chiang Li. 2025. Steer LLM Latents for Hallucination Detection. arXiv preprint arXiv:2503.01917. — [arXiv:2503.01917](https://arxiv.org/abs/2503.01917) find
- Bing Qin, Binyuan Hui, Lihan Wang, Min Yang, Jinyang Li, Binyi Li, Ruiying Geng, Rong Cao, Jian Sun, Luo Si, Fei Huang, and Yongbin Li. 2022. A survey on Text-to-SQL parsing: Concepts, methods, and future directions. arXiv preprint arXiv:2208.13629. — [arXiv:2208.13629](https://arxiv.org/abs/2208.13629) find
- Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018. Know What You Don’t Know: Unanswerable Questions for SQuAD. arXiv preprint arXiv:1806.03822.
- Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing.
- Jie Ren, Jing Luo, Yuxin Zhao, Kalpesh Krishna, Mohammad Saleh, Balaji Lakshminarayanan, and Peter J. Liu. 2023. Out-of-Distribution Detection and Selective Generation for Conditional Language Models. In International Conference on Learning Representations (ICLR).
- P. Sahoo, A. K. Singh, S. Saha, V. Jain, S. Mondal, and A. Chadha. 2024. A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applications. arXiv preprint arXiv:2402.07927.
- Irina Saparina and Mirella Lapata. 2024. AMBROSIA: A benchmark for parsing ambiguous questions into database queries. arXiv preprint arXiv:2406.19073. — [arXiv:2406.19073](https://arxiv.org/abs/2406.19073) find
- An Yang, An Li, Bin Yang, Botao Zhang, Binyuan Hui, Bosheng Zheng, Bowen Yu, Chao Gao, Chen Huang, Cheng Lv, Chuan Zheng, Dai Liu, Feng Zhou, Fei Huang, Fu Hu, Hao Ge, Hong Wei, Hongyi Lin, Jian Tang, and Zhaoye Qiu. 2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388.
- Yutao Zhang, Xinyi Dong, Shuaichen Chang, Tao Yu, Peng Shi, and Rui Zhang. 2020. Did You Ask a Good Question? A Cross-Domain Question Intention Classification Benchmark for Text-to-SQL. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings. find
- Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, Alexander Pan, Xinyang Yin, Mantas Mazeika, Ann-Kathrin Dombrowski, Shubhangi Goel, Nathaniel Li, Michael J. Byun, Zifan Wang, Alex Mallen, Steven Basart, Sanmi Koyejo, Dawn Song, Matt Fredrikson, and Dan Hendrycks. 2023. Rep… — Representation Engineering: A Top-Down Approach to AI Transparency
- O. Skean, M. R. Arefin, D. Zhao, N. Patel, J. Naghiyev, and Y. LeCun. 2025. Layer by Layer: Uncovering Hidden Representations in Language Models. arXiv preprint arXiv:2502.02013.
- Ruoxi Sun, Soumya Sanyal, Raymond Cheng, Li Bo, and Xifeng Yan. 2024. SQL-PaLM: Improved large language model for Text-to-SQL. Transactions on Machine Learning Research. find
- Y. M. Tsai, T. Cojean, and H. Anzt. 2020. Evaluating the performance of NVIDIA’s A100 Ampere GPU for sparse linear algebra computations. arXiv preprint arXiv:2008.08478. find
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is All you Need. In Advances in Neural Information Processing Systems.
- Bowen Wang, Yuxuan Gao, Zhen Li, and Jian-Guang Lou. 2022. Know What I don’t know: Handling Ambiguous and Unanswerable Questions for Text-to-SQL. arXiv preprint arXiv:2212.08902. — [arXiv:2212.08902](https://arxiv.org/abs/2212.08902) find
- Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-Consistency Improves Chain of Thought Reasoning in Language Models. In International Conference on Learning Representations (ICLR).
- Miao Xiong, Zhiyuan Hu, Xinyang Lu, Yifei Li, Jie Fu, Junxian He, and Bryan Hooi. 2024. Can LLMs express their uncertainty? an empirical evaluation of confidence elicitation in LLMs. In International Conference on Learning Representations (ICLR). find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/ren-2026-latentrefusal-latent-signal-refusal-unanswerable/