Skip to main content
QUICK REVIEW

[论文解读] Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time

Mitchell Wortsman, Gabriel Ilharco|arXiv (Cornell University)|Mar 10, 2022
Domain Adaptation and Few-Shot Learning被引用 205
一句话总结

从多个独立微调的模型(模型汤)对权重进行平均,通常超过最佳单一模型,在不增加额外推理成本的情况下实现接近集成的性能。Greedy soup 被特别指出为特别有效。

ABSTRACT

The conventional recipe for maximizing model accuracy is to (1) train multiple models with various hyperparameters and (2) pick the individual model which performs best on a held-out validation set, discarding the remainder. In this paper, we revisit the second step of this procedure in the context of fine-tuning large pre-trained models, where fine-tuned models often appear to lie in a single low error basin. We show that averaging the weights of multiple models fine-tuned with different hyperparameter configurations often improves accuracy and robustness. Unlike a conventional ensemble, we may average many models without incurring any additional inference or memory costs -- we call the results "model soups." When fine-tuning large pre-trained models such as CLIP, ALIGN, and a ViT-G pre-trained on JFT, our soup recipe provides significant improvements over the best model in a hyperparameter sweep on ImageNet. The resulting ViT-G model, which attains 90.94% top-1 accuracy on ImageNet, achieved a new state of the art. Furthermore, we show that the model soup approach extends to multiple image classification and natural language processing tasks, improves out-of-distribution performance, and improves zero-shot performance on new downstream tasks. Finally, we analytically relate the performance similarity of weight-averaging and logit-ensembling to flatness of the loss and confidence of the predictions, and validate this relation empirically. Code is available at https://github.com/mlfoundations/model-soups.

研究动机与目标

  • 通过在超参数多样性上对权重进行平均,作为选择单一最佳微调模型的替代方案来进行动机说明。
  • 证明模型汤在分布内和分布转移数据上的准确性与鲁棒性有所提升。
  • 展示 Greedy soups 在不增加额外推理成本的情况下,优于均匀求和并接近集成性能。
  • 探索在视觉领域(CLIP/ALIGN/VIT-G)和NLP任务(包括 GLUE 基准测试)的适用性。
  • 提供对何时权重平均与 logits 集成以及损失平坦性的分析性洞察。

提出的方法

  • 对大规模预训练模型进行微调(如 CLIP、ALIGN、ViT-G),覆盖广泛的超参数扫描。
  • 通过对选定的微调模型对权重进行平均来形成模型汤(均匀汤)或通过贪婪过程逐步添加模型,只有在验证准确度提升时才添加。
  • 将汤与在分布内和分布转移下的集成与最佳单一模型进行比较。
  • 分析两模型权重平均以将汤的性能与 logits 集成及损失平坦性联系起来。
  • 在图像分类、分布转移数据集以及初始 NLP GLUE 任务上进行评估。
  • 为引用的 GitHub 仓库提供模型汤的开源代码。

实验结果

研究问题

  • RQ1独立微调模型的权重平均是否比选择最佳单一模型获得更高的准确性?
  • RQ2在视觉和NLP任务中,均匀汤和贪婪汤在准确性和鲁棒性方面有何差异?
  • RQ3模型汤的性能与集成性能及损失景观的平坦性之间有何关系?
  • RQ4模型汤是否扩展到超大视觉 Transformer 和语言模型,而不仅仅是图像分类?
  • RQ5在数据集和任务的标定与适用性方面,模型汤有哪些局限?

主要发现

  • Greedy soups 常常在 ImageNet 和分布转移数据集上超越最佳单一模型,且无需额外训练或推理成本。
  • 对在 ImageNet 上微调的 CLIP 和 ALIGN,贪婪汤分别比最佳单一模型提升 0.7–0.5 个百分点。
  • 一个 ViT-G/14 在 ImageNet 上的汤达到 90.94% 的 top-1,且在前沿方法所需的 FLOPs 更少的情况下接近 state-of-the-art。
  • 模型汤在图像分类、分布转移以及一些 NLP GLUE 任务上提高了性能,尽管在标定方面的提升有限。
  • 分析近似表明汤的性能与损失景观平坦性和预测置信度相关,并已通过实证验证。
  • Greedy soups 在资源受限时提供了对集成的实用替代方案。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。