[论文解读] Many-Shot In-Context Learning in Multimodal Foundation Models
本文通过最多接近2,000个多模态演示,研究了多模态基础模型中的少样本内上下文学习(ICL)。结果表明,GPT-4o和Gemini 1.5 Pro在多样本ICL中均实现了显著的性能提升,其中Gemini 1.5 Pro展现出更优的数据效率和对数线性性能提升,而查询批处理在不损失准确率的前提下降低了每个示例的延迟和成本。
Large language models are effective at few-shot in-context learning (ICL). Recent advancements in multimodal foundation models have enabled unprecedentedly long context windows, presenting an opportunity to explore their capability to perform ICL with many more demonstrating examples. In this work, we evaluate the performance of multimodal foundation models scaling from few-shot to many-shot ICL. We benchmark GPT-4o and Gemini 1.5 Pro across 14 datasets spanning multiple domains (natural imagery, medical imagery, remote sensing, and molecular imagery) and tasks (image classification, visual QA, and object localization). We observe that many-shot ICL, including up to almost 2,000 demonstrating examples, leads to substantial improvements compared to few-shot (<100 examples) ICL across all of the datasets. Further, Gemini 1.5 Pro performance continues to improve log-linearly up to the maximum number of tested examples on many datasets. We also find open-weights multimodal foundation models like Llama 3.2-Vision do not benefit from the demonstrating examples, highlighting an important gap between open and closed multimodal foundation models. Given the high inference costs required for many-shot ICL, we also explore the impact of batching multiple queries in a single API call. We show that batching up to 50 queries can lead to performance improvements under zero-shot and many-shot ICL, with substantial gains in the zero-shot setting on multiple datasets, while drastically reducing per-query cost and latency. Finally, while GPT-4o and Gemini 1.5 Pro achieve similar zero-shot performance across the datasets, Gemini 1.5 Pro learns more quickly than GPT-4o on most datasets. Our results suggest that many-shot ICL could enable users to efficiently adapt multimodal foundation models to new applications and domains. Our codebase is publicly available at https://github.com/stanfordmlgroup/ManyICL .
研究动机与目标
- 评估多模态基础模型在内上下文学习(ICL)中的表现,随着演示示例数量从少样本增加到多样本。
- 比较GPT-4o和Gemini 1.5 Pro在多样化多模态数据集上的数据效率和性能扩展特性。
- 研究在单个API调用中批量处理多个查询对推理成本、延迟和性能的影响,涵盖零样本和多样本ICL设置。
- 分析批量零样本ICL中观察到的性能提升背后的机制,包括领域校准和自生成演示。
- 评估在无需微调的情况下,使用多样本ICL将基础模型适配到新任务的实用可行性。
提出的方法
- 在涵盖自然图像、医学影像、遥感图像和分子图像的10个多模态数据集上,对GPT-4o和Gemini 1.5 Pro进行基准测试,任务类型包括多类、多标签和细粒度分类。
- 通过在提示中包含大量多模态演示,将内上下文学习从少样本(<100个示例)扩展到多样本(最多1,999个示例)。
- 在不同样本设置下,测量性能提升、数据效率以及有无查询批处理时的推理成本和延迟。
- 使用最多每API调用50个查询的查询批处理技术,降低每个示例的延迟和成本,同时保持或提升性能。
- 通过消融研究分析批量零样本ICL中性能提升的来源,识别出领域校准、类别校准以及自回归自生成演示是关键贡献因素。
- 在相同硬件和地理位置下进行实验,以确保公平比较并最小化数据传输带来的干扰。

实验结果
研究问题
- RQ1将内上下文演示数量从少样本增加到多样本,如何影响多样化数据集上多模态基础模型的性能?
- RQ2在多样本ICL设置下,GPT-4o和Gemini 1.5 Pro在数据效率和性能扩展方面如何比较?
- RQ3能否通过将多个查询批量处理为单个API调用,降低每个示例的推理成本和延迟,同时保持或提升性能?
- RQ4批量零样本ICL中观察到的性能提升背后的机制是什么?
- RQ5多样本ICL在多大程度上可以替代微调,用于将基础模型适配到新任务和新领域?
主要发现
- Gemini 1.5 Pro的性能随着内上下文示例数量的增加呈对数线性提升,而GPT-4o的性能提升则不够稳定。
- 在评估的10个数据集中,Gemini 1.5 Pro在大多数数据集上的内上下文学习数据效率高于GPT-4o。
- 在多样本ICL设置下,批量处理最多50个查询可将每个示例的延迟降低最多35倍,成本降低最多45倍,相比单个查询。
- 查询批处理在零样本设置中带来了显著的性能提升,其原因可归因于领域校准、类别校准以及自生成演示。
- 在HAM10000数据集中,批量处理将每个示例的延迟从17.3秒降低至0.54秒,成本从$0.8420降至$0.0877(在350-shot ICL中)。
- 在TerraIncognita数据集中,批量处理将每个示例的延迟从34.9秒降低至1.7秒,成本从$1.8420降至$0.0406(在810-shot ICL中)。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。