Source-linked AI summary

Robust fine-tuning of zero-shot models

Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo-Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, Ludwig Schmidt

arXiv:2109.01903v3cs.CVcs.LG

TL;DR

zero-shot 모델을 fine-tuning하면 target distribution에서의 정확도는 높아질 수 있지만 distribution shift에 대한 robustness는 낮아질 수 있다. WiSE-FT는 zero-shot 모델과 fine-tuned 모델의 weight를 보간해, target distribution의 높은 정확도를 유지하면서 distribution shift 환경의 성능을 크게 향상한다.

  • 문제

    distribution shift 상황에서 정확도를 낮추지 않고 zero-shot 모델을 fine-tuning할 수 있는가?

  • 방법

    WiSE-FT는 zero-shot 모델을 fine-tuning한 뒤, 해당 모델의 weight와 원래 zero-shot 모델의 weight를 선형 보간한다.

  • 결과

    WiSE-FT는 다양한 distribution shift에서 robustness를 일관되게 향상하면서 target distribution의 정확도를 유지하거나 높이며, prior work 대비 4 to 6 percentage points (pp)의 향상을 포함한다.

  • 시사점 및 한계

    WiSE-FT는 standard fine-tuning과 비교해 target distribution의 정확도 손실을 최소화하거나 없애면서 distribution shift 상황의 성능을 향상하는 간단한 방법을 제공한다.

  • 시사점 및 한계

    이번 연구는 image classification에 한정되어 있으며, object detection과 natural language processing은 향후 과제로 남긴다.

Abstract

from arXiv · show

Large pre-trained models such as CLIP or ALIGN offer consistent accuracy across a range of data distributions when performing zero-shot inference (i.e., without fine-tuning on a specific dataset). Although existing fine-tuning methods substantially improve accuracy on a given target distribution, they often reduce robustness to distribution shifts. We address this tension by introducing a simple and effective method for improving robustness while fine-tuning: ensembling the weights of the zero-shot and fine-tuned models (WiSE-FT). Compared to standard fine-tuning, WiSE-FT provides large accuracy improvements under distribution shift, while preserving high accuracy on the target distribution. On ImageNet and five derived distribution shifts, WiSE-FT improves accuracy under distribution shift by 4 to 6 percentage points (pp) over prior work while increasing ImageNet accuracy by 1.6 pp. WiSE-FT achieves similarly large robustness gains (2 to 23 pp) on a diverse set of six further distribution shifts, and accuracy gains of 0.8 to 3.3 pp compared to standard fine-tuning on seven commonly used transfer learning datasets. These improvements come at no additional computational cost during fine-tuning or inference.

1 서론

WiSE-FT는 zero-shot 모델과 fine-tuned 모델의 weight를 선형 보간해 target distribution의 정확도와 robustness 간 trade-off를 해결한다. 추가 fine-tuning이나 inference 비용 없이 distribution shift 상황의 정확도를 높이면서 target 정확도를 유지하거나 향상한다.

  • 기여: WiSE-FT는 fine-tuning이나 inference 중 추가 계산 비용이 들지 않으며 hyperparameter 선택을 단순화한다.이 방법은 단순하고, 연구된 문제 전반에 보편적으로 적용 가능하며, 몇 줄의 코드로 구현할 수 있도록 제시된다.
  • 방법: WiSE-FT는 먼저 zero-shot 모델을 fine-tuning한 다음, 그 weight를 원래 zero-shot 모델의 weight와 선형 보간한다.이 weight-space ensembling 절차는 두 모델의 상호보완적인 강점을 결합하도록 설계되었다.
  • 결과: 4 to 6 percentage points: WiSE-FT는 ImageNet과 five natural shifts에서 ImageNet 정확도를 유지하거나 향상하면서, prior work보다 shifted-distribution 정확도를 높인다.zero-shot 모델과 비교하면 shifted-distribution 정확도가 1 to 9 percentage points 향상된다.
  • 결과: 이 방법은 CLIP을 넘어 일반화된다. fine-tuned BASIC-L에서는 ImageNet 정확도가 0.4 pp, 평균 shifted-distribution 정확도가 2 to 11 pp 향상된다.ALIGN과 JFT로 사전학습한 ViT 모델에서도 유사한 경향이 관찰된다.
  • 결과: WiSE-FT는 geographic, dataset-reproduction, temporal shift를 포함한 six additional distribution shifts에서 robustness를 향상한다.보고된 설정에는 WILDS-FMoW, WILDS-iWildCam, CIFAR-10.1, CIFAR-10.2가 포함된다.

2 배경 및 실험 설정

실험에서는 reference 및 shifted 분포에서 zero-shot, fine-tuned, WiSE-FT 모델을 평가하여 두 분포 모두에서 높은 정확도와 일관된 성능을 달성하고자 한다. 설정은 자연적 shift에 초점을 맞추며, effective robustness를 사용해 shift 성능과 reference-distribution 정확도를 분리한다.

  • 실험 설정: 평가에서는 reference distribution Dref와 shifted distribution Dshift에서 zero-shot, fine-tuned, WiSE-FT 모델을 비교하며, 두 분포 모두에서 높고 일관된 정확도를 목표로 한다.Dref에는 fine-tuning을 위한 training set이 포함되고 두 분포 모두 test set을 갖지만, zero-shot 모델은 Dref에서 학습되지 않으므로 이를 ID와 OOD라고 부르지 않는다.
  • Distribution shifts: 주요 실험에서는 ImageNet에서 파생된 다섯 가지 자연적 shift인 ImageNet-V2, ImageNet-R, ImageNet Sketch, ObjectNet, ImageNet-A를 연구한다.이러한 shift는 능동적으로 생성한 synthetic perturbation이 아니라 이미지 스타일, 장면 또는 획득 조건처럼 자연적으로 발생하는 변화를 나타낸다.
  • Effective robustness와 scatter plot: Effective robustness는 reference-distribution 정확도에서 예상되는 baseline을 넘어서는 shifted-distribution 정확도를 측정하며, ρ(f) = Accshift(f) − β(Accref(f))로 정의된다.Scatter plot에서는 x축에 Accref(f), y축에 Accshift(f)를 배치하여, robustness를 예상 baseline보다 위로 나타나는 수직 이동으로 표현한다.
  • Zero-shot 모델과 CLIP: 이 연구는 주로 CLIP [82]를 조사하고, ALIGN [45], BASIC [77], JFT-pretrained ViT [21]도 평가하며, 이들의 zero-shot 모델은 서로 구별되는 linear trend에서 effective robustness를 보인다.CLIP-like 모델은 웹에서 수집한 image-caption pair를 사용해 사전 학습된다.

3 Fine-tuning을 위한 weight-space ensemble

WiSE-FT는 zero-shot model을 fine-tuning한 뒤 원래 model과 weight를 선형 보간해 fine-tuning의 정확도와 distribution shift에 대한 zero-shot robustness를 결합한다. 추가 computational cost 없이 reference distribution 성능을 높게 유지한다.

  • 3 Fine-tuning을 위한 weight-space ensemble: WiSE-FT는 먼저 application-specific data로 zero-shot model을 fine-tuning한 다음, 원래 model과 fine-tuned model의 weight를 선형 보간한다.이 방법은 PyTorch 몇 줄로 구현할 수 있다.
  • 3 Fine-tuning을 위한 weight-space ensemble: 이 방법은 distribution shift 상황에서의 zero-shot robustness와 reference distribution에서 standard fine-tuning이 제공하는 높은 정확도의 상보성을 활용한다.Weight-space ensemble은 추가 computational cost 없이 이 두 model을 결합하며, 이는 shared optimization trajectory에 관한 선행 연구 [43] [73]에서 부분적으로 동기를 얻었다.
  • 3 Fine-tuning을 위한 weight-space ensemble: Standard fine-tuning에는 end-to-end update 또는 classifier-only update가 포함되는 반면, WiSE-FT는 weight-space에서 zero-shot model과 fine-tuned model을 연결하는 높은 정확도의 선형 경로에 의존한다.이 높은 정확도의 경로는 Section 5.2에서 더 자세히 살펴본다. Neural network는 parameter에 대해 nonlinear이므로, 서로 관련 없는 model에서는 일반적으로 모든 layer를 ensemble하는 방식이 실패한다.
  • 3 Fine-tuning을 위한 weight-space ensemble: Mixing coefficient α ∈[0, 1]에 대해 WiSE-FT는 parameter (1 − α) · θ0 + α · θ1로 예측하며, 이는 zero-shot parameter와 fine-tuned parameter의 element-wise weighted average다.Linear classifier만 fine-tuning하는 경우, 이는 전통적인 output-space ensemble 과 동등하다.
  • 3 Fine-tuning을 위한 weight-space ensemble: WiSE-FT는 fine-tuned model과 비교해 추가 computational cost 없이 단일 weight 집합을 사용하면서, distribution shift 상황의 정확도를 높이고 reference distribution 성능을 높게 유지한다.이 방법은 weight-space ensembling을 통해 원래 zero-shot parameter와 fine-tuned parameter를 결합한다.

4 결과

WiSE-FT는 ImageNet, 추가 distribution shift, transfer dataset, 그리고 CLIP을 넘어선 모델 전반에서 기준 분포 정확도를 유지하거나 향상하면서 distribution shift에 대한 robustness를 높인다. 또한 weight interpolation은 hyperparameter 선택에 대한 민감도를 낮추고, 일반적인 기준 분포와 shifted 분포 간 정확도 trade-off를 없앤다.

  • 추가 distribution shift에서의 robustness: 6개의 추가 distribution shift에서 fine-tuning 대비 3.5 to 23.2 pp의 robustness 향상이 유지되며, 기준 정확도 감소폭은 at most 0.3 pp다.shift는 위성 영상, 야생동물 인식, CIFAR-10 재현 데이터, 시간적으로 변형된 video dataset을 포괄하며, WILDS shift에서 zero-shot 정확도가 30% 미만인 경우에도 향상이 나타난다.
  • 주요 결과: ImageNet과 관련 distribution shift: α=0.5인 WiSE-FT는 강력한 baseline보다 5개의 ImageNet distribution shift에서 평균 shifted 정확도와 평균 기준 정확도를 모두 향상한다.Figure 1은 α가 0에서 1로 변할 때 동시적인 향상을 보여주며, Table 1은 주요 ImageNet 비교 결과를 보고한다.
  • 기준 분포에서의 정확도 향상: 7개 dataset에서 4 to 49%의 relative-error 감소가 나타나, end-to-end fine-tuning 이후에도 WiSE-FT가 기준 분포 정확도를 향상할 수 있음을 보여준다.dataset은 ImageNet, CIFAR-10, CIFAR-100, Describable Textures, Food-101, SUN397, Stanford Cars다.
  • CLIP을 넘어: α=0.5인 BASIC-L에서는 shifted 분포 정확도가 7 pp 이상, ImageNet 정확도가 0.4 pp 더 높아지며, ViT-H/14는 fine-tuned ImageNet 정확도에서 0.2 pp 이내를 유지하면서 shift에서 2.2 pp 향상된다.WiSE-FT는 zero-shot 및 fine-tuned ViT-H/14 모델보다도 성능을 향상하며, ALIGN에서도 유사한 경향이 나타난다.

5 논의

논의에서는 zero-shot 모델과 fine-tuned 모델을 결합하는 것이 WiSE-FT에 이점을 주는 이유를 설명한다. 두 모델의 예측은 서로 다르며, 각 모델은 자신이 강점을 보이는 분포에서 더 높은 confidence를 보인다. End-to-end weight-space ensembling에서는 interpolation이 두 endpoint 모델을 모두 능가하고, 선형 보간한 endpoint 정확도도 초과할 수 있다.

  • 예측 다양성: Zero-shot 모델과 fine-tuned 모델은 reference 및 shifted 분포 모두에서 서로 다른 예측을 보이며, random half-ImageNet split으로 학습한 classifier와는 대조적이다.Prediction diversity는 한 classifier가 정답을 맞힌 경우 다른 classifier가 보이는 불일치를 측정한다. Figure 5에서는 서로 다른 ImageNet subset으로 fine-tuning한 linear classifier와 두 모델을 비교한다.
  • 분포별 전문성: 대부분의 shift에서는 zero-shot 모델이 fine-tuned 모델을 더 자주 override하는 반면, ImageNet에서는 fine-tuned 모델이 zero-shot 모델을 더 자주 override한다.따라서 ensemble은 분포별 모델 동작 차이를 반영한다. 이 비교는 두 모델의 예측이 다르고 ensemble이 zero-shot 예측과 일치하는 경우에만 정의된다.
  • 분포별 전문성: Zero-shot 모델은 distribution shift에서 더 높은 confidence를 보이는 반면, fine-tuned 모델은 reference 분포에서 더 높은 confidence를 보인다.Confidence는 가장 큰 비정규화 classifier output과 두 번째로 큰 output 사이의 margin δ로 측정하며, Guo et al. [33]과 같은 probability-vector 기준은 사용하지 않는다.
  • End-to-end weight-space ensembling: Weight-space ensembling은 ImageNet과 이에 대응하는 다섯 가지 distribution shift에서 zero-shot 모델과 fine-tuned 모델을 모두 능가할 수 있다.Figure 6은 일부 interpolation coefficient α가 Acc_D,f((1 −α) · θ_0 + α · θ_1) ≥ max {Acc_D,f(θ_0), Acc_D,f(θ_1)}를 만족한다고 보고한다.
  • End-to-end weight-space ensembling: ImageNet과 이에 대응하는 다섯 가지 shift에서, interpolated weight는 모든 α ∈ [0, 1]에 대해 선형 보간한 endpoint 정확도의 baseline을 초과한다.형식적으로는 Acc_D,f((1 −α) · θ_0 + α · θ_1) ≥ (1 −α) · Acc_D,f(θ_0) + α · Acc_D,f(θ_1)이다.
  • 기존 현상과의 관계: 이러한 interpolation 효과는 모델이 경로를 따라 endpoint 정확도를 초과할 수 있다는 기존 관찰 [43] [73]과 관련되며, shared initialization은 이 fine-tuning 설정에서 connectivity를 설명할 수 있다 [73].Neyshabur et al. [73]이 논의한 설정과 달리, WiSE-FT는 서로 다른 데이터로 학습한 모델 사이를 interpolation한다.

6 관련 연구

선행 연구는 합성 및 자연적 분포 변화에서의 견고성, 사전 학습과 fine-tuning, 출력 공간 및 가중치 공간의 ensemble 방법을 다룬다. 이와 동시에 진행된 관련 연구는 견고한 fine-tuning, ensemble 기반 trade-off, 가중치 보간을 추가로 검토한다.

  • 견고성: 견고성 연구는 합성 및 자연적 분포 변화에서의 모델 동작을 검토하지만, 합성 변화에 대한 개입은 많은 자연적 변화에 일반화되지 않는 경우가 많다 [35] [99] [65] [29] [23] [2] [37] [49] [100] [38] [97].
  • Pre-training과 transfer learning: 보조 언어 supervision을 포함한 대규모 데이터셋 기반 pre-training은 높은 성능의 vision model과 zero-shot inference를 가능하게 한다 [90] [21] [50] [107] [12] [18] [86] [111] [82] [45] [77] [109].
  • Pre-training과 transfer learning: 관련 연구는 quadratic regularization, interpolation, continual learning, fine-tuning hyperparameter를 연결하며, 여러 continual-learning 접근법이 다수의 자연적 변화에 대한 견고성을 갖추지 못함을 발견한다 [108] [63] [3] [59].
  • 전통적(output-space) ensemble: Output-space ensemble은 여러 classifier의 prediction을 결합하며, 일반적으로 분포 변화에서 성능과 uncertainty calibration을 향상한다 [58] [75].이 연구는 대신 서로 다른 데이터를 관측한 두 model의 ensembling을 고려한다.
  • Weight-space ensemble: Weight-space ensemble은 model weight를 선형 보간하며, 성능 향상을 위해 training trajectory 전반의 checkpoint를 평균내는 방법을 포함한다 [64] [32] [95] [43].Weight averaging은 central optimization method로도 설명된다.
  • 동시 및 후속 연구: 동시 및 후속 연구는 robust fine-tuning, output-space ensemble, distillation, fine-tuned weight 보간을 검토하며, reference-distribution 정확도와 변화에 대한 견고성 간 trade-off를 포함한다 [31].

7 한계, 영향 및 결론 · A Pseudocode for WiSE-FT

WiSE-FT는 target accuracy 손실을 최소화하면서 distribution shift 상황의 robustness를 향상시키지만, 평가는 image classification에 한정되며 더 광범위한 위험은 여전히 대규모 zero-shot models와 관련된다. 의사코드는 zero-shot weights에서 fine-tuning을 수행한 뒤 모든 checkpoint parameters를 interpolation하여 WiSE-FT를 구현한다.

  • 7 한계, 영향 및 결론: 이 연구는 image classification에 한정되어 있으며, object detection과 natural language processing은 향후 연구 과제로 남긴다.저자들은 이러한 발견이 다른 domain에도 더 폭넓게 적용될 수 있다고 보지만, 여기서는 해당 설정을 연구하지 않는다.
  • 7 한계, 영향 및 결론: α=0.5가 전반적으로 좋은 성능을 보이지만, 특정 target distributions에 최적인 α를 선택하는 일은 향후 연구 과제로 남는다.해결되지 않은 문제는 interpolation parameter를 개별 target distributions에 맞게 조정하는 방법이다.
  • 7 한계, 영향 및 결론: WiSE-FT는 대규모 zero-shot models를 기반으로 하므로, model biases와 surveillance systems 같은 악의적 사용을 포함한 피해를 perpetuate할 수 있다.이러한 광범위한 영향 우려는 Radford et al. [82] 및 Brown et al. [12]와 관련하여 논의된다.
  • 7 한계, 영향 및 결론: WiSE-FT는 standard fine-tuning과 비교해 target-distribution accuracy 손실을 최소화하거나 없애면서 distribution shift 상황의 성능을 substantially improves한다.저자들은 이를 zero-shot robustness를 활용해 더 신뢰할 수 있는 neural networks를 만드는 정교한 fine-tuning schemes로 나아가는 첫 단계로 제시한다.
  • A Pseudocode for WiSE-FT: 알고리즘은 zero-shot 및 fine-tuned checkpoints를 불러온 다음, 모든 weight를 (1-alpha) * theta_0[key] + alpha * theta_1[key]로 interpolation한다.생성된 state dictionary는 model에 in place로 로드된다.
  • A Pseudocode for WiSE-FT: WiSE-FT는 dataset에서 standard fine-tuning을 수행하기 전에 zero-shot weights를 model에 로드하는 것으로 시작한다.의사코드는 zero-shot checkpoint로 model을 초기화하고 dataset 및 hyperparameters와 함께 fine-tuning을 호출한다.
  • A Pseudocode for WiSE-FT: standard fine-tuning 후 WiSE-FT는 zero-shot checkpoint, fine-tuned checkpoint 및 α를 사용해 in-place weight-space ensembling을 수행한다.이 절차는 `wise_ft` routine을 통해 제공되며, fine-tuning 후 weight-interpolation routine을 호출한다.

B 혼합 계수 · C 추가 실험

WiSE-FT는 distribution-specific 최적값을 사용할 때와 거의 동일한 성능을 간단한 기본값 α=0.5로도 낸다. 추가 실험에서는 주요 결과를 세분화하고, 여섯 가지 추가 shift를 테스트하며, WiSE-FT를 대안들과 비교한다.

  • B 혼합 계수: ImageNet과 다섯 가지 derived shift에서 최적의 α는 α=0.5보다 평균 성능을 0 to 0.4 percentage points만큼 향상시킨다.이 작은 격차는 domain knowledge가 없을 때 α=0.5를 사용하는 근거가 된다.
  • B 혼합 계수: WiSE-FT는 단순성과 효과성 때문에 domain knowledge가 없을 때 α=0.5를 권장한다.각 distribution에 대한 최적 혼합 계수를 찾는 일은 향후 연구의 미해결 문제로 남아 있다.
  • C 추가 실험: Section C.1에서는 각 distribution shift에 대해 Figure 1의 결과를 개별적으로 세분화한다.
  • C 추가 실험: 여섯 가지 추가 distribution shift에서 WiSE-FT는 reference distribution의 성능을 낮추지 않으면서 일관되게 robustness를 향상시킨다.Section C.2에서는 effective-robustness scatter plot을 사용해 이러한 결과를 제시한다.
  • C 추가 실험: Section C.3에서는 distillation과 CoOp [112]를 포함한 추가 대안들과 WiSE-FT를 비교한다.
  • C 추가 실험: 이 실험들은 함께 shift별 세분화 결과, 추가 robustness 평가, 대안 방법들과의 비교를 통해 Section 4를 보완한다.

C.1 ImageNet에서 CLIP 실험 분석 · C.2 추가 distribution shift에서의 robustness

부록에서는 개별 distribution shift와 mixing coefficient에 따른 WiSE-FT의 ImageNet robustness 결과를 분석한 뒤, 6개의 추가 shifted dataset에서 robustness를 평가한다. 이 분석 전반에서 WiSE-FT는 더 폭넓은 robustness testbed와 비교하면서 standard fine-tuning 대비 distribution shift 상황의 accuracy를 높인다.

  • C.1 ImageNet에서 CLIP 실험 분석: 최적 mixing coefficient는 보고된 metric 전반에서 CLIP ViT-B/16 및 ViT-L/14@336의 고정 α=0.5를 능가할 수 있다.Table 3은 각 metric을 최대화하도록 α를 개별적으로 선택하고, 그 결과 성능을 α=0.5와 비교한다.
  • C.1 ImageNet에서 CLIP 실험 분석: WiSE-FT는 dataset별 분석에서 ImageNet과 5개의 derived distribution shift 각각에 대한 accuracy를 높인다.Figures 7과 8은 평균을 낸 주요 실험의 근거가 되는 개별 shift 결과를 보고한다.
  • C.1 ImageNet에서 CLIP 실험 분석: ImageNet 비교는 WiSE-FT를 standard model, 더 많은 data로 학습한 model, 그리고 Taori et al. testbed [97]의 기존 robustness intervention과 비교해 해석한다.해당 intervention에는 특수 data augmentation과 adversarially robust model이 포함된다 [19] [28] [36] [65] [15] [85] [87].
  • C.1 ImageNet에서 CLIP 실험 분석: WiSE-FT의 ImageNet 결과는 CLIP ViT-L/14@336과 ViT-B/16 모두에 대해 다양한 mixing coefficient α에서 보고된다.표에는 reference-distribution accuracy, shifted-distribution accuracy, 그리고 5개 shift에 대한 평균이 포함된다. α=0.0은 zero-shot이고 α=1.0은 standard fine-tuning이다.
  • C.2 추가 distribution shift에서의 robustness: WiSE-FT는 6개의 추가 dataset에서 standard fine-tuning 대비 distribution shift 상황의 accuracy를 높인다.Figure 9는 ImageNet-Vid-Robust, YTBB-Robust [88], CIFAR-10.1 [83], CIFAR-10.2 [62], WILDS-FMoW [49, 13], WILDS-iWildCam [49, 6]을 다룬다.
  • C.2 추가 distribution shift에서의 robustness: 추가 shift는 temporal video perturbation, shifted CIFAR 재현, 그리고 satellite 및 wildlife recognition의 geographic 또는 temporal shift를 포괄한다.이 설정에는 ImageNet-Vid-Robust와 YTBB-Robust, CIFAR-10.1과 CIFAR-10.2, WILDS-FMoW, WILDS-iWildCam이 포함된다.

C.3 대안 방법과의 비교 … C.4 데이터 증강의 변화

대안 fine-tuning 방법들과 비교하면 WiSE-FT는 robustness를 유지하면서 대체로 경쟁 방법과 동등하거나 더 나은 성능을 보인다. output-space ensemble, EMA 변형, linear-classifier 방법, CoOp와의 비교에서도 유리하다. 더 강한 ImageNet augmentation에서도 유사한 경향이 유지되지만, 그 효과는 추가 연구가 필요하다.

  • C.3 대안 방법과의 비교: 더 폭넓은 비교에는 ImageNet-Vid-Robust, YTBB-Robust [88], CIFAR-10.1 [83], CIFAR10.2 [62], WILDS-FMoW [49, 13], WILDS-iWildCam [49, 6]이 포함된다.Table 6은 처음 두 benchmark에는 linear-classifier fine-tuning을, 나머지에는 end-to-end fine-tuning을 보고한다.
  • C.3.1 Output-space ensemble: weight-space와 output-space ensemble 모두 유리한 경향을 보이지만, output-space ensembling에는 두 배의 compute가 필요하다.output-space 방법은 weight를 interpolation하는 대신 zero-shot 모델과 fine-tuned 모델의 prediction을 결합한다.
  • C.3 대안 방법과의 비교: learning rate를 낮추거나 training을 단축하거나 early stopping을 적용하는 방법과 달리, EMA와 그 decay parameter는 WiSE-FT curve를 따라가거나 그보다 약간 바깥에 있는 solution에 도달할 수 있다.비교 대상은 reference distribution과 shifted distribution에서의 성능이다.
  • C.3.2 Exponential moving average와의 비교: EMA decay를 바꾸면 WiSE-FT curve를 따라가거나 그보다 약간 바깥으로 이동할 수 있으며, EMA solution에 WiSE-FT를 적용하면 추가적인 robustness를 얻을 수 있다.biased EMA의 경우 mixing coefficient 1 −β^T로 WiSE-FT를 적용하면 두 번째 EMA 변형을 정확히 복원한다.
  • C.3.3 Linear classifier fine-tuning에서의 추가 비교: linear classifier만 fine-tuning할 때 WiSE-FT는 더 많은 compute를 요구하는 방법과 동등한 성능을 내거나 더 나은 성능을 제공하지만, 여러 대안은 concave한 effective-robustness 경향을 보인다.대안에는 random interpolation, softmax-output ensembling, regularized classifier, distillation, zero-shot weight를 향한 regularization이 포함된다.
  • C.4 데이터 증강의 변화: 더 강한 기본 ImageNet augmentation—random cropping, horizontal flipping, color jitter—을 사용해도 WiSE-FT는 minimal augmentation에서와 유사한 경향을 보인다.논문은 augmentation 효과에 대한 추가 조사를 향후 연구 방향으로 제시한다.

C.5 reference dataset에서의 정확도 향상 … C.8 zero-shot CLIP과 독립적으로 학습된 모델의 앙상블

reference dataset, 규모, model family 전반에서 WiSE-FT는 standard fine-tuning을 넘어 accuracy와 robustness를 향상시키며, low-data setting과 ALIGN, JFT-pretrained ViT, BASIC에서도 효과를 보인다. Output ensembling은 distribution shift에서도 독립적으로 학습된 EfficientNet model의 성능을 향상시키지만, 서로 다른 architecture를 사용하므로 inference 비용이 더 높다.

  • C.5 reference dataset에서의 accuracy 향상: WiSE-FT는 ImageNet과 여섯 개의 reference dataset인 CIFAR-10, CIFAR-100, Describable Textures, Food-101, SUN397, Stanford Cars에서 accuracy를 향상시킨다.Figure 16은 모든 mixing coefficient α에서의 accuracy를 보고하며, Table 2를 보완한다.
  • C.6 pre-training compute 규모 전반의 robustness: WiSE-FT는 pre-training compute가 여러 자릿수 규모로 변하는 상황에서도, 더 작은 CLIP model을 포함해 reference performance 손실을 최소화하면서 distribution shift에서의 accuracy를 향상시킨다.이 section은 standard test accuracy가 shifted-distribution accuracy와 강하게 상관되므로, 더 작고 실행하기 쉬운 model에서 robustness를 탐색할 필요성을 제시한다.
  • C.7 WiSE-FT와 추가 model: WiSE-FT는 CLIP을 넘어 ALIGN, BASIC, JFT-300M으로 pre-training된 ViT-H/14 model에서도 평가되며, reference distribution과 shifted distribution 전반의 결과를 요약한다.Table 8은 CLIP, ALIGN, BASIC, JFT-pretrained ViT를 주요 연구 model family로 제시한다.
  • C.7.1 ALIGN: ALIGN에서는 mixing coefficient α와 reference 및 shifted distribution 전반에 걸쳐 end-to-end 및 linear-classifier fine-tuning 모두로 WiSE-FT를 평가한다.End-to-end fine-tuning에는 AdamW, 40,000 steps, batch size 512, maximum learning rate 5 × 10^-6, weight decay 0.1을 사용한다.
  • C.7.2 JFT pre-training: JFT-pretrained ViT-H/14에서는 ImageNet 1000개 class 중 973개를 JFT class에 mapping하여 zero-shot ImageNet weight를 도출하고, WiSE-FT를 end-to-end 및 linear classifier 방식으로 평가한다.Zero-shot weight는 pretrained model의 final-layer weight에서 얻으며, linear classifier는 고정된 penultimate layer에서 L-BFGS를 사용해 학습한다.
  • C.7.3 BASIC: BASIC에서는 ImageNet의 절반에 contrastive loss를 적용해 두 encoder를 모두 fine-tuning하며, ImageNet과 다섯 개의 derived shift 전반에서 fine-tuned model 대비 accuracy를 향상시킨다.BASIC 실험에서는 ImageNet class name을 사용해 BASIC-L의 zero-shot classifier를 구성하고, BASIC-M과 BASIC-L의 결과를 제시한다.
  • C.8 zero-shot CLIP과 독립적으로 학습된 model의 앙상블: zero-shot CLIP을 독립적으로 학습된 EfficientNet-B6 및 EfficientNet-L2 model과 각각 앙상블했을 때, distribution shift에서 평균 accuracy가 각각 13.6 pp와 6.9 pp 향상되었다.EfficientNet-B6는 end-to-end fine-tuned CLIP과 비슷한 기준 성능을 보였고, EfficientNet-L2는 인용된 PyTorch ImageNet Models 컬렉션에서 이용 가능한 모델 중 가장 강력했다.

D 실험 세부사항 … D.4 ObjectNet

실험에서는 CLIP inference, end-to-end 및 linear-classifier fine-tuning 절차, 그리고 ObjectNet 전용 class-shift adaptation을 다룬다. ObjectNet class-name adaptation은 성능을 2.3% 향상시키며, weight-space ensemble은 이를 적용한 경우와 적용하지 않은 경우에 대해 평가된다.

  • D.1 CLIP zero-shot: CLIP inference에는 ViT-L/14@336px를 사용하고, 학습된 temperature를 Wzero-shot에 반영하며, 수동으로 prompt를 설계한 5개 dataset을 제외한 CLIP의 80개 prompt를 ensemble한다.zero-shot classifier는 CLIP이 제공한 80개 prompt로 구성하며, 5개 dataset에는 수동 prompt engineering을 적용한다.
  • D.2 End-to-end fine-tuning: End-to-end fine-tuning에서는 classification layer를 temperature-scaled CLIP zero-shot weights로 초기화하고, temperature 학습은 생략하며, image-encoder output은 계속 정규화한다.이러한 선택은 fine-tuning 중에도 zero-shot classifier와의 호환성을 유지한다.
  • D.2 End-to-end fine-tuning: 별도로 명시하지 않는 한, end-to-end fine-tuning에는 cosine annealing을 사용하는 AdamW, 500회의 warm-up step, learning rate 3 × 10^-5, gradient clipping, 10 epoch를 사용한다.기본 설정은 β1 = 0.9, β2 = 0.999, ϵ = 10^-8, weight decay 0.1이며, 8개 GPU에서 실행 가능한 가장 큰 batch를 사용한다.
  • D.3 Fine-tuning a linear classifier: Linear-classifier 실험에서는 64개 configuration에 걸쳐 네 가지 regularization 전략을 평가하며, batch size는 {64, 128, 256}에서, learning-rate exponent는 [0, 6]에서 균등하게 sampling한다.전략은 regularization 없음, weight decay, L1 regularization, label smoothing이다.
  • D.3 Fine-tuning a linear classifier: Sampling한 linear-classifier hyperparameter는 distillation 및 regularization 실험에서 재사용하며, low-data 설정에서는 각 k와 dataset마다 search를 반복한다.이는 hyperparameter search를 Appendix C.3 및 Section C.5에 설명된 추가 분석과 연결한다.
  • D.3 Fine-tuning a linear classifier: k-shot linear-classifier training에서는 제거된 data에 따라 epoch 수가 대략 반비례하여 조정되며, epoch를 두 배로 늘려 성능이 포화될 때까지 진행한 뒤 후보 epoch 수를 균등하게 sampling한다.이 절차에서는 learning rate 0.001과 weight decay 0.01을 사용하는 AdamW를 적용하여, data가 감소해도 iteration 수를 대략 일정하게 유지한다.
  • D.4 ObjectNet: 2.3% improvement는 ImageNet의 ObjectNet zero-shot model을 ObjectNet class name에 맞게 adaptation한 결과이며, weight-space ensemble은 이 adaptation을 적용한 경우와 적용하지 않은 경우를 비교한다.ObjectNet은 다섯 개의 주요 Section 3 dataset 중 이러한 class-shift adaptation이 가능한 유일한 dataset이다.

E 다양성 측정 · F weight-space ensemble은 언제 output-space ensemble을 근사하는가?

이 논문은 prediction-, agreement-, distribution-, representation-based measure를 통해 classifier 다양성을 평가한 뒤, weight-space ensembling이 output-space ensembling과 일치하는 조건을 규명한다. 두 parameter setting 사이의 interpolation path에서 model이 linear일 때 정확한 동치가 성립하며, 이는 NTK regime와 관련된 조건이다.

  • E 다양성 측정: 이 연구는 Prediction Diversity, Cohen’s Kappa Complement, KL Divergence, Centered Kernel Alignment Complement를 사용해 classifier 간 다양성을 정의한다.이 measure들은 각각 한 classifier가 정답일 때의 불일치, agreement complement, probability-distribution divergence, representation-similarity complement를 포착한다.
  • E 다양성 측정: Prediction Diversity는 두 classifier가 불일치하면서 그중 하나가 정답인 sample의 비율을 측정한다.
  • E 다양성 측정: Cohen’s Kappa Complement는 Cohen’s kappa의 complement를 classifier-diversity measure로 사용한다.그 formulation은 classifier 간 expected agreement와 empirical agreement를 사용한다.
  • E 다양성 측정: KL Divergence는 sample 전반에서 classifier들이 예측한 probability distribution 간 평균 차이를 측정한다.
  • E 다양성 측정: Centered Kernel Alignment Complement는 CKA에 complement를 적용해 representation 다양성을 측정한다. CKA의 값이 클수록 similarity가 크고 따라서 diversity는 작다.CKA는 dataset sample의 centered representation으로 구성한 pairwise-similarity matrix를 비교한다.
  • E 다양성 측정: CKAC는 large dataset에서 계산 비용이 높으므로, 10,000개를 초과하는 sample을 사용하는 실험에서는 random 10,000-sample subset에서 계산한다.
  • F weight-space ensemble은 언제 output-space ensemble을 근사하는가?: training이 linear expansion으로 잘 근사되는 regime에서는 weight-space ensembling이 output-space ensembling을 근사할 수 있으며, NTK regime가 그 예다 [44].Fort et al. [24]는 neural network training의 후반 phase에서 linear expansion이 더 정확해진다는 사실을 보였다.
  • F weight-space ensemble은 언제 output-space ensemble을 근사하는가?: model이 θ0과 θ1 사이의 parameter path를 따라 linear일 때 weight-space ensemble과 output-space ensemble은 equivalent하다.구체적으로 path 위의 모든 θ에 대해 f(θ) = f(θ0) + ∇f(θ0)⊤(θ − θ0)이면 두 ensemble construction은 일치한다.
Loading 2109.01903v3…