数据库失败时如何安全恢复:面向任务对话中LLM的轻量级提示策略

When the Database Fails: Prompting LLM Dialogue Agents for Safe Recovery in Task-Oriented Dialogue

精选理由

论文用实际数据告诉你,数据库出错时LLM会瞎编内容,但加个简单提示就能把幻觉砍掉一半。不用重训模型,看各家的差距有多大。

AI 摘要

一项研究分析了六种开源模型家族(DeepSeek-R1、Gemma-2、Llama-3、Mistral、Phi-3、Qwen-2.5)在任务导向对话中面对数据库调用失败时的表现。基于MultiWOZ 2.2(5领域)和SGD(20领域)构建的故障注入基准显示,朴素智能体在30.5%(MultiWOZ)和20.9%(SGD)的失败轮次中产生幻觉。提出的Guided-Retry策略无需重新训练即可将MultiWOZ上的幻觉率从30.5%降至15.3%(降低50%),SGD上从20.9%降至12.2%(降低42%)。但各模型残差幻觉仍达6-37%,跨域失败最难处理。

原文 · arXiv: DeepSeek

When the Database Fails: Prompting LLM Dialogue Agents for Safe Recovery in Task-Oriented Dialogue

Large language models used in task-oriented dialogue often produce fluent but unsafe responses when backend database calls fail, return empty results, or surface mismatched information, inventing venues, confirmations, or booking details not grounded in the database. We study a lightweight prompting-based recovery approach that improves robustness without retraining or additional model calls. We compare three response strategies, including a guided recovery prompt conditioned on structured database status, across six open-weight model families (DeepSeek-R1, Gemma-2, Llama-3, Mistral, Phi-3, and Qwen-2.5) and four database conditions: empty result, wrong-domain retrieval, API error, and clean retrieval. Using fault-injected benchmarks built on two structurally different datasets, MultiWOZ 2.2 (5 domains) and SGD (20 domains), we find that naive agents hallucinate on 30.5% of failure turns on MultiWOZ and 20.9% on SGD. Our Guided-Retry strategy reduces hallucination by 50% on MultiWOZ (30.5 to 15.3%) and by 42% on SGD (20.9 to 12.2%) without retraining. However, residual hallucination remains substantial (6-37% across models), with wrong-domain failures the hardest case. Results are consistent across both datasets and all six model families, and human annotation shows substantial agreement while supporting the validity of the automatic commitment-safety metric.