arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.10145cs.CL
收藏

一种帮助大型语言模型处理含数值长上下文任务的有效框架

An Effective Framework to Help Large Language Models Handle Numeric-involved Long-context Tasks

Tsinghua University(清华大学)

Yijiong Yu

AI总结:

针对大型语言模型处理含数值长上下文任务时性能下降的问题,提出一种分解为判断、提取、代码处理和结论生成四步的工作流,用小模型处理简单子任务、代码规避计算短板,在基准上提升准确率并降低API成本。

摘要:

大型语言模型(LLMs)在处理长文本方面展现出卓越能力,在传统检索任务中几乎拥有完美性能。然而,面对长上下文中的数值计算时,其性能显著下降。由于LLMs在同时处理复杂且海量信息方面存在固有局限,含数值长上下文任务在常规设置下通常无法被当前LLMs解决。一些类似思维链(CoT)的提示方法能提高准确率,但需要大量输出token,成本高且速度慢。为解决该问题,我们提出一种工作流,将含数值长上下文任务分解为4个低级子任务:判断、提取、代码处理和结论生成。前两个子任务相对简单,使我们能使用更小的模型高效处理长上下文;当需要数值计算时,我们使用LLMs生成的代码来规避其不擅长计算的缺点。在2个含数值长上下文基准上的结果表明,我们的工作流不仅能提高准确率,还能显著降低API调用成本。

英文摘要:

Large Language Models (LLMs) have demonstrated remarkable capabilities in handling long texts and have almost perfect performance in traditional retrieval tasks. However, their performance significantly degrades when it comes to numerical calculations in the long-context. Numeric-involved long-context tasks typically cannot be addressed by current LLMs in normal settings due to their inherent limitations in simultaneously handling complex and massive information. Some CoT like prompting methods can improve accuracy but demands massive output tokens, which is costly and slow. To address this issue, we propose a workflow, which decompose a numeric-involved long-context task into 4 low-level subtasks: judging, extracting and processing with code and conclusion. The former 2 subtasks is relatively simple, which allows us to use smaller models for efficiently processing long context. When numerical calculations are required, we use code generated by LLMs to avoid the disadvantage of LLM not being good at calculations. The results in 2 numeric-involved long-context benchmarks demonstrate our workflow can not only improve accuracy, but also significantly reduce the cost of API calls.

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

↑