Employing Large Language Models (LLMs) for semantic parsing has achieved remarkable success. However, we find existing methods fall short in terms of reliability and efficiency when hallucinations are encountered. In this paper, we address these challenges with a framework called QueryAgent, which solves a question step-by-step and performs step-wise self-correction. We introduce an environmental feedback-based self-correction method called ERASER. Unlike traditional approaches, ERASER leverages rich environmental feedback in the intermediate steps to perform selective and differentiated self-correction only when necessary. Experimental results demonstrate that QueryAgent notably outperforms all previous few-shot methods using only one example on GrailQA and GraphQ by 7.0 and 15.0 F1. Moreover, our approach exhibits superiority in terms of efficiency, including runtime, query overhead, and API invocation costs. By leveraging ERASER, we further improve another baseline (i.e., AgentBench) by approximately 10 points, revealing the strong transferability of our approach.
翻译:采用大语言模型(LLMs)进行语义解析已取得显著成功。然而,我们发现现有方法在遭遇幻觉现象时在可靠性和效率方面存在不足。本文提出名为QueryAgent的框架来解决这些挑战,该框架逐步求解问题并执行逐步自校正。我们引入了一种基于环境反馈的自校正方法ERASER。与传统方法不同,ERASER利用中间步骤中的丰富环境反馈,仅在必要时进行选择性差异化自校正。实验结果表明,QueryAgent在GrailQA和GraphQ数据集上仅使用一个示例即比所有先前的小样本方法分别高出7.0和15.0 F1值。此外,我们的方法在运行时间、查询开销和API调用成本等效率指标上均展现出优越性。通过利用ERASER,我们将另一基线方法(即AgentBench)进一步提升了约10个百分点,揭示了该方法强大的可迁移性。