arXiv:2410.01724cs.CLcs.AI2024-10被引 3

用批量内生成结果作示范,提升大模型批量处理效果

Auto-Demo Prompting: Leveraging Generated Outputs as Demonstrations for Enhanced Batch Prompting

  • 用批次内前序问答对作示范,优化后续推理
  • 五项NLP任务中缓解批量增大导致的性能下降
  • 适合需要高效批量推理的实用场景

批量提示是大语言模型中常用的技术,用于同时处理多个输入以提高计算效率。然而,随着批量大小增加,模型因难以处理长上下文而常出现性能下降。现有方法仅依赖数据排列和多数投票,未改进批量提示设计本身。本文提出「Auto-Demo Prompting」,利用批次内早期问题的问答对作为后续答案推断的示范。我们对该方法在自回归生成过程中的作用进行了形式化理论分析,说明其如何利用先前输出优化模型内部表示。该方法有效弥合了批量提示与少样本提示之间的差距,在仅轻微增加词元使用的情况下提升性能。五项NLP任务的实验表明,该方法能有效缓解性能退化,甚至在某些情况下超越单次提示。此外,它为在批量提示中应用少样本学习技术(如示范选择)开辟了新路径,是一种适用于实际场景的稳健解决方案。

原文摘要 · Abstract (English)

Batch prompting is a common technique in large language models (LLMs) used to process multiple inputs simultaneously, aiming to improve computational efficiency. However, as batch sizes increase, performance degradation often occurs due to the model's difficulty in handling lengthy context inputs. Existing methods that attempt to mitigate these issues rely solely on batch data arrangement and majority voting rather than improving the design of the batch prompt itself. In this paper, we address these limitations by proposing "Auto-Demo Prompting," a novel approach that leverages the question-output pairs from earlier questions within a batch as demonstrations for subsequent answer inference. We provide a formal theoretical analysis of how Auto-Demo Prompting functions within the autoregressive generation process of LLMs, illustrating how it utilizes prior outputs to optimize the model's internal representations. Our method effectively bridges the gap between batch prompting and few-shot prompting, enhancing performance with only a slight compromise in token usage. Experimental results across five NLP tasks demonstrate its effectiveness in mitigating performance degradation and occasionally outperforming single prompts. Furthermore, it opens new avenues for applying few-shot learning techniques, such as demonstration selection, within batch prompting, making it a robust solution for real-world applications.

批量提示少样本学习大模型优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。