arXiv:2505.18585cs.AIcs.CL2025-05NeurIPS被引 14

用领域知识实时验证大模型输出,提升关键场景下的可靠性。

RvLLM: LLM Runtime Verification with Domain Knowledge

  • 设计轻量易用的领域规范语言ESL,支持专家自定义校验规则。
  • 在新加坡地铁法、数值比较等任务中,准确识别大模型错误输出。
  • 适合医疗、法律等需要高可靠性的专业领域使用。

大语言模型(LLMs)凭借强大的文本理解与生成能力成为主流人工智能范式,但其输出常出现不一致或错误,影响在高风险场景中的可信度。现有研究多聚焦通用场景下的行为检测,忽视领域知识的整合潜力。本文提出RvLLM框架,通过设计新型规范语言ESL,使领域专家能以轻量、直观方式定义特定约束,并在运行时对LLM输出进行验证。我们在三个典型任务上评估:新加坡快速轨道交通系统法案违规检测、数值比较与不等式求解。实验表明,RvLLM能高效、灵活地识别多种大模型的错误输出。结果揭示,尽管大模型表现卓越,仍因可解释性有限和推理过程缺乏形式化保证而易犯低级错误。本框架通过引入专家领域知识,为实现严格、高效的运行时验证提供了可行路径。

原文摘要 · Abstract (English)

Large language models (LLMs) have emerged as a dominant AI paradigm due to their exceptional text understanding and generation capabilities. However, their tendency to generate inconsistent or erroneous outputs challenges their reliability, especially in high-stakes domains requiring accuracy and trustworthiness. Existing research primarily focuses on detecting and mitigating model misbehavior in general-purpose scenarios, often overlooking the potential of integrating domain-specific knowledge. In this work, we advance misbehavior detection by incorporating domain knowledge. The core idea is to design a general specification language that enables domain experts to customize domain-specific predicates in a lightweight and intuitive manner, supporting later runtime verification of LLM outputs. To achieve this, we design a novel specification language, ESL, and introduce a runtime verification framework, RvLLM, to validate LLM output against domain-specific constraints defined in ESL. We evaluate RvLLM on three representative tasks: violation detection against Singapore Rapid Transit Systems Act, numerical comparison, and inequality solving. Experimental results demonstrate that RvLLM effectively detects erroneous outputs across various LLMs in a lightweight and flexible manner. The results reveal that despite their impressive capabilities, LLMs remain prone to low-level errors due to limited interpretability and a lack of formal guarantees during inference, and our framework offers a potential long-term solution by leveraging expert domain knowledge to rigorously and efficiently verify LLM outputs.

大模型验证领域知识运行时检查

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。