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

分而治之、重加权与征服:一种用于上下文学习的 Logit 算术方法

Divide, Reweight, and Conquer: A Logit Arithmetic Approach for In-Context Learning

Washington University in St. Louis(圣路易斯华盛顿大学)

Chengsong Huang, Langlin Huang, Jiaxin Huang

AI总结:

提出 LARA 框架,通过将长输入示例划分为可并行短输入并基于非梯度优化对各组 logit 进行重加权集成,有效提升了上下文学习的准确性和内存效率。

摘要:

上下文学习(ICL)成为大型语言模型(LLM)的关键特性,使其能够通过利用特定任务的示例来适应新任务,而无需更新模型参数。然而,随着示例数量的增加,由于性能下降和二次方计算成本,ICL 面临挑战。在本文中,我们提出了 Logit 算术重加权方法(LARA),这是一种通过使用基于 logit 的多示例集成来增强 ICL 的新框架。我们的方法将长输入示例划分为可并行的较短输入,以显著降低内存需求,然后通过非梯度优化方法对每组的 logit 进行重加权,从而有效地聚合信息。我们进一步引入了 Binary LARA(B-LARA),这是一种将权重限制为二进制值的变体,旨在简化搜索空间并通过过滤掉信息量较少的示例组来减少内存使用。在 BBH 和 MMLU 上的实验表明,LARA 和 B-LARA 在准确性和内存效率方面均优于所有基线方法。我们还进行了广泛的分析,表明 LARA 能够很好地泛化到从有限示例到多示例演示的不同数量示例的场景。

英文摘要:

In-Context Learning (ICL) emerges as a key feature for Large Language Models (LLMs), allowing them to adapt to new tasks by leveraging task-specific examples without updating model parameters. However, ICL faces challenges with increasing numbers of examples due to performance degradation and quadratic computational costs. In this paper, we propose Logit Arithmetic Reweighting Approach (LARA), a novel framework that enhances ICL by using logit-based ensembling of multiple demonstrations. Our approach divides long input demonstrations into parallelizable shorter inputs to significantly reduce memory requirements, and then effectively aggregate the information by reweighting logits of each group via a non-gradient optimization approach. We further introduce Binary LARA (B-LARA), a variant that constrains weights to binary values to simplify the search space and reduces memory usage by filtering out less informative demonstration groups. Experiments on BBH and MMLU demonstrate that LARA and B-LARA outperform all baseline methods in both accuracy and memory efficiency. We also conduct extensive analysis to show that LARA generalizes well to scenarios of varying numbers of examples from limited to many-shot demonstrations.

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

↑