用双循环反馈提升大模型生成API请求的准确率与效率
AutoFeedback: An LLM-based Framework for Efficient and Accurate API Request Generation
- 引入静态扫描与动态分析双组件,注入真实错误和文档信息增强反馈
- 在真实数据集上实现100%准确率,交互成本降低超10%
- 适合需要高精度调用API的开发人员和自动化系统
大型语言模型(LLM)主要通过生成API请求来调用外部工具,以提高任务完成效率。然而,由于LLM固有的幻觉问题,准确生成正确的API请求仍具挑战性。现有基于提示的反馈方法缺乏事实依据且细节不足。为此,我们提出AutoFeedback,一个基于LLM的高效准确的API请求生成框架,包含静态扫描组件(SSC)和动态分析组件(DAC)。SSC将检测到的API请求错误作为伪事实注入反馈,丰富事实信息;DAC从API文档中检索信息,提升反馈细节。基于这两组件,AutoFeedback在生成过程中实施双重反馈循环。大量实验表明,该方法显著提升了API请求生成的准确性并降低了交互成本:在真实世界API数据集上达到100.00%准确率,使GPT-3.5 Turbo的交互成本减少23.44%,GPT-4 Turbo减少11.85%。
原文摘要 · Abstract (English)
Large Language Models (LLMs) leverage external tools primarily through generating the API request to enhance task completion efficiency. The accuracy of API request generation significantly determines the capability of LLMs to accomplish tasks. Due to the inherent hallucinations within the LLM, it is difficult to efficiently and accurately generate the correct API request. Current research uses prompt-based feedback to facilitate the LLM-based API request generation. However, existing methods lack factual information and are insufficiently detailed. To address these issues, we propose AutoFeedback, an LLM-based framework for efficient and accurate API request generation, with a Static Scanning Component (SSC) and a Dynamic Analysis Component (DAC). SSC incorporates errors detected in the API requests as pseudo-facts into the feedback, enriching the factual information. DAC retrieves information from API documentation, enhancing the level of detail in feedback. Based on this two components, Autofeedback implementes two feedback loops during the process of generating API requests by the LLM. Extensive experiments demonstrate that it significantly improves accuracy of API request generation and reduces the interaction cost. AutoFeedback achieves an accuracy of 100.00\% on a real-world API dataset and reduces the cost of interaction with GPT-3.5 Turbo by 23.44\%, and GPT-4 Turbo by 11.85\%.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。