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

ParaICL:迈向并行上下文学习

ParaICL: Towards Parallel In-Context Learning

Shanda AI Research Institute(上海沙达人工智能研究院);Nanyang Technological University(南洋理工大学);Salesforce Research(Salesforce 研究)

Xingxuan Li, Xuan-Phi Nguyen, Shafiq Joty, Lidong Bing

AI总结:

ParaICL提出并行批处理与加权语义选择机制,在不超上下文长度限制下充分利用全部演示示例,提升少样本上下文学习性能,并可与现有方法无缝集成。

摘要:

大型语言模型(LLMs)已成为自然语言处理(NLP)中的常态,凭借其卓越能力在少样本上下文学习(ICL)中表现出色。尽管如此,ICL的成功在很大程度上取决于少样本演示示例的选择,使得这一选择过程日益关键。现有方法已深入探索如何优化这些示例的数量和语义相似性以提升ICL性能。然而,我们的初步实验表明,ICL的有效性受到输入上下文长度的限制。此外,不同少样本演示示例的组合能够显著提升不同测试样本上的准确率。为解决这一问题,我们提出了一种名为并行上下文学习(ParaICL)的新方法,该方法在不超出可管理输入上下文长度的情况下有效利用所有演示示例。ParaICL采用并行批处理,根据演示中问题与测试问题的语义相似性将演示示例分配到不同批次中。然后为每个批次计算归一化批次语义分数。在自适应合理性约束下,应用加权平均语义目标来选择最合适的词元。通过大量实验,我们验证了ParaICL的有效性,并进行了消融研究以强调其设计合理性。我们进一步证明ParaICL能够与现有方法无缝集成。

英文摘要:

Large language models (LLMs) have become the norm in natural language processing (NLP), excelling in few-shot in-context learning (ICL) with their remarkable abilities. Nonetheless, the success of ICL largely hinges on the choice of few-shot demonstration examples, making the selection process increasingly crucial. Existing methods have delved into optimizing the quantity and semantic similarity of these examples to improve ICL performances. However, our preliminary experiments indicate that the effectiveness of ICL is limited by the length of the input context. Moreover, varying combinations of few-shot demonstration examples can significantly boost accuracy across different test samples. To address this, we propose a novel method named parallel in-context learning (ParaICL) that effectively utilizes all demonstration examples without exceeding the manageable input context length. ParaICL employs parallel batching to distribute demonstration examples into different batches according to the semantic similarities of the questions in the demonstrations to the test question. It then computes normalized batch semantic scores for each batch. A weighted average semantic objective, constrained by adaptive plausibility, is applied to select the most appropriate tokens. Through extensive experiments, we validate the effectiveness of ParaICL and conduct ablation studies to underscore its design rationale. We further demonstrate that ParaICL can seamlessly integrate with existing methods.

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

↑