In-Context Learning (ICL), which formulates target tasks as prompt completion conditioned on in-context demonstrations, has become the prevailing utilization of LLMs. In this paper, we first disclose an actual predicament for this typical usage that it can not scale up with training data due to context length restriction. Besides, existing works have shown that ICL also suffers from various biases and requires delicate calibration treatment. To address both challenges, we advocate a simple and effective solution, $k$NN Prompting, which first queries LLM with training data for distributed representations, then predicts test instances by simply referring to nearest neighbors. We conduct comprehensive experiments to demonstrate its two-fold superiority: 1) Calibration-Free: $k$NN Prompting does not directly align LLM output distribution with task-specific label space, instead leverages such distribution to align test and training instances. It significantly outperforms state-of-the-art calibration-based methods under comparable few-shot scenario. 2) Beyond-Context: $k$NN Prompting can further scale up effectively with as many training data as are available, continually bringing substantial improvements. The scaling trend holds across 10 orders of magnitude ranging from 2 shots to 1024 shots as well as different LLMs scales ranging from 0.8B to 30B. It successfully bridges data scaling into model scaling, and brings new potentials for the gradient-free paradigm of LLM deployment. Code is publicly available.


翻译:上下文学习(In-Context Learning, ICL)将目标任务转化为基于上下文示例的提示补全任务,已成为大语言模型(LLM)的主流应用范式。本文首先揭示该典型用法面临的实际困境:由于上下文长度限制,其无法随训练数据规模扩展。此外,现有研究表明ICL存在多种偏差问题,需要精细的校准处理。为解决上述挑战,我们提出一种简洁高效的解决方案——$k$NN Prompting。该方法首先利用训练数据查询LLM获取分布式表征,随后通过简单参考最近邻来预测测试实例。我们通过全面实验证明其双重优势:1)无校准性:$k$NN Prompting不直接对齐LLM输出分布与任务特定标签空间,而是利用该分布对齐测试实例与训练实例。在可比小样本场景下,其显著优于现有最先进的基于校准的方法。2)超越上下文:$k$NN Prompting可随可用训练数据规模有效扩展,持续带来显著性能提升。该扩展趋势在2-shot至1024-shot的10个数量级范围,以及0.8B至30B的LLM参数量级中均保持一致。该方法成功将数据扩展与模型扩展相融合,为LLM部署的无梯度范式开辟了新可能。代码已开源。

0
下载
关闭预览

相关内容

百篇论文纵览大型语言模型最新研究进展
专知会员服务
70+阅读 · 2023年3月31日
专知会员服务
55+阅读 · 2021年2月2日
最新《自监督表示学习》报告,70页ppt
专知会员服务
86+阅读 · 2020年12月22日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
一文了解prompt learning在计算机视觉领域进展
极市平台
7+阅读 · 2022年11月11日
浅聊对比学习(Contrastive Learning)
极市平台
3+阅读 · 2022年7月26日
ACL‘22杰出论文:Prompt范式有bug!
夕小瑶的卖萌屋
2+阅读 · 2022年7月10日
强化学习三篇论文 避免遗忘等
CreateAMind
20+阅读 · 2019年5月24日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2023年5月12日
Arxiv
0+阅读 · 2023年5月12日
Arxiv
14+阅读 · 2022年5月6日
VIP会员
最新内容
综述 | 世界动作模型:少做梦,多行动
专知会员服务
4+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
7+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
4+阅读 · 6月23日
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
8+阅读 · 6月22日
21世纪的无人机战争
专知会员服务
4+阅读 · 6月22日
《量子技术的军事任务技术适配与利用》
专知会员服务
5+阅读 · 6月22日
相关VIP内容
相关资讯
一文了解prompt learning在计算机视觉领域进展
极市平台
7+阅读 · 2022年11月11日
浅聊对比学习(Contrastive Learning)
极市平台
3+阅读 · 2022年7月26日
ACL‘22杰出论文:Prompt范式有bug!
夕小瑶的卖萌屋
2+阅读 · 2022年7月10日
强化学习三篇论文 避免遗忘等
CreateAMind
20+阅读 · 2019年5月24日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员