arXiv:2501.18864cs.CV2025-01

利用训练时的平坦性特征,提升视觉语言模型在测试时的适应能力。

Flatness Guided Test-Time Adaptation for Vision-Language Models

  • 基于尖锐度感知的提示调优,定位训练中的平坦极小值区域。
  • 测试时通过样本选择确保训练与测试损失曲面的平坦区域对齐。
  • 无需昂贵的参数更新,计算开销更低,适合实际部署场景。

视觉语言模型(VLMs)的测试时自适应(TTA)已成为应对测试阶段分布偏移的重要技术。现有研究指出,TTA与模型训练历史密切相关,但当前方法如测试时提示调优(Test-time Prompt Tuning)常忽视训练特性,导致性能下降。本文提出一种新型平坦性引导自适应框架(FGA),利用尖锐度感知训练中获得的平坦性作为关键线索,统一训练与测试流程。核心思想是利用训练最小值与测试损失平坦区域的对齐关系指导适应过程。具体包括:1)训练阶段采用尖锐度感知提示调优(Sharpness-Aware Prompt Tuning),识别训练平坦极小值;2)测试阶段引入基于尖锐度的测试样本选择策略,确保训练与每个增强测试样本损失景观的平坦极小值对齐。相比现有方法,本方法避免了测试时昂贵的提示参数更新,显著降低计算开销。在领域泛化与跨数据集基准上的大量实验表明,该方法优于主流TTA方法。当使用ViT-B/16图像编码器时,其在全部四个ImageNet域外变体上平均性能超越TPT+CoOp达4.88%。

原文摘要 · Abstract (English)

Test-time adaptation (TTA) of Vision-Language Models (VLMs) has emerged as a technique for tackling distribution shifts during the test time. Recent research indicates that the test-time adaptation is intrinsically linked to the model's training history. However, existing TTA methods, such as Test-time Prompt Tuning, often design adaptation strategies in isolation from the models' training characteristics, which degrade their performance. This paper argues that the flatness acquired via sharpness-aware training is an efficient clue for the test-time adaptation of VLMs. Built on this insight, this paper proposes a novel Flatness-Guided Adaptation framework (FGA) for VLMs to cohesively unify training and test-time procedures. Its core idea is to leverage the alignment between the training minimum and test loss flat regions to guide the adaptation process. Specifically, our FGA consists of a prompt-tuning stage and a test-time adaptation stage. In the tuning stage, a Sharpness-Aware Prompt Tuning method is utilized to identify the training flat minimum, offering a geometric clue of flatness for subsequent adaptation. In the test stage, a Sharpness-based Test Sample Selection approach is proposed to ensure the alignment of flat minima between the training and each augmented test sample's loss landscape. In comparison to existing TTA methods, our FGA avoids the expensive prompt parameter updates during test time, and substantially reduces the computation overhead. Extensive experiments on both domain generalization and cross-dataset benchmarks demonstrate that our FGA achieves superior performance over prevalent TTA methods. Notably, when employing a ViT-B/16 image encoder, FGA even outperforms TPT+CoOp by an average of 4.88% across all four ImageNet out-of-domain variants.

视觉语言模型测试时自适应平坦性提示调优

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