arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.10398cs.AI

LatentRefusal:用于无法回答的文本到SQL查询的潜在信号拒绝

LatentRefusal: Latent-Signal Refusal for Unanswerable Text-to-SQL Queries

Fudan University(复旦大学);Pennsylvania State University(宾夕法尼亚州立大学);Abington College(阿宾顿学院)

Xuancheng Ren, Shijing Hu, Zhihui Lu, Jiangqi Huang, Qiang Duan

AI总结:

本文提出LatentRefusal方法,通过分析大语言模型的中间隐藏激活来预测查询可回答性,从而在文本到SQL系统中实现安全拒绝,提升系统安全性与效率。

摘要:

在基于LLM的文本到SQL系统中,无法回答和描述不明确的用户查询不仅会产生错误文本,还可能生成产生误导结果或违反安全约束的可执行程序,成为安全部署的主要障碍。现有拒绝策略要么依赖输出级指令遵循,因模型幻觉而脆弱,要么估计输出不确定性,增加复杂性和开销。为解决这一挑战,我们正式将安全拒绝定义为答案性门控问题,并提出LatentRefusal,一种基于潜在信号的拒绝机制,通过大语言模型的中间隐藏激活预测查询可回答性。我们引入Tri-Residual Gated Encoder,一种轻量级探测架构,以抑制模式噪声并放大稀疏、局部化的疑问-模式不匹配线索,以指示不可回答性。广泛的经验评估、不同模糊和不可回答设置的评估,以及消融研究和可解释性分析,证明了所提出方法的有效性,并显示LatentRefusal为文本到SQL系统提供了一个可附加且高效的安全部署层。在四个基准测试中,LatentRefusal在两种backbone上将平均F1提高到88.5%,同时增加约2毫秒的探测开销。

英文摘要:

In LLM-based text-to-SQL systems, unanswerable and underspecified user queries may generate not only incorrect text but also executable programs that yield misleading results or violate safety constraints, posing a major barrier to safe deployment. Existing refusal strategies for such queries either rely on output-level instruction following, which is brittle due to model hallucinations, or estimate output uncertainty, which adds complexity and overhead. To address this challenge, we formalize safe refusal in text-to-SQL systems as an answerability-gating problem and propose LatentRefusal, a latent-signal refusal mechanism that predicts query answerability from intermediate hidden activations of a large language model. We introduce the Tri-Residual Gated Encoder, a lightweight probing architecture, to suppress schema noise and amplify sparse, localized cues of question-schema mismatch that indicate unanswerability. Extensive empirical evaluations across diverse ambiguous and unanswerable settings, together with ablation studies and interpretability analyses, demonstrate the effectiveness of the proposed approach and show that LatentRefusal provides an attachable and efficient safety layer for text-to-SQL systems. Across four benchmarks, LatentRefusal improves average F1 to 88.5 percent on both backbones while adding approximately 2 milliseconds of probe overhead.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑