1 00:00:01,000 --> 00:00:09,300 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:09,300 --> 00:00:46,849 [Hal Turing] Today's paper is "Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time." The first author is Mitchell Wortsman, at the University of Washington, with colleagues from Columbia, Google Research's Brain Team, Meta AI Research and Tel Aviv University. It's arXiv 2203.05482, and it appeared at ICML in 2022. The question is simple. A team runs dozens of fine-tuning jobs, keeps the one checkpoint with the best validation score, and deletes the rest. Why throw those away? 3 00:00:46,849 --> 00:01:05,174 [Dr. Ada Shannon] Because that's the standard recipe, and the paper says the discard step costs you something. Their answer is to average the weights of several of those fine-tuned models into one network. Inference costs the same as a single model. The catch is that this should not work, and the interesting part is why it does. 4 00:01:05,174 --> 00:01:25,625 [Hal Turing] Let me set up the recipe first. You start from a big pre-trained model, like CLIP or ALIGN, or a huge ViT pre-trained on Google's JFT-3B image set. Then you fine-tune all the weights on ImageNet, many times, with different learning rates, augmentation, mixup, label smoothing, weight decay, and seeds. 5 00:01:25,625 --> 00:01:47,375 [Dr. Ada Shannon] Right. And every run starts from the same pre-trained weights. That shared starting point carries the whole argument. Then you pick a winner using a held-out validation set. Keep that word, validation-selected, in mind. There's also an oracle baseline, where you pick the best model separately on each test set. Nobody can deploy that, because you'd need the test labels. It's an upper bound for single models, and it will matter later when we judge the numbers. 6 00:01:47,375 --> 00:01:54,575 [Hal Turing] The obvious alternative is an ensemble. Run all the models and average their output logits. 7 00:01:54,575 --> 00:02:06,225 [Dr. Ada Shannon] Ensembles are accurate and better calibrated, but k models means k forward passes and k copies in memory. Soups promise ensemble-like gains at one model's cost. 8 00:02:06,225 --> 00:02:17,475 [Hal Turing] So why is averaging weights dangerous? Averaging outputs is obviously fine. Averaging parameters sounds like averaging two different recipes for the same cake. 9 00:02:17,475 --> 00:02:59,875 [Dr. Ada Shannon] The danger is the loss landscape. Loss as a function of the weights is non-convex, with many valleys, which we call basins. A basin is a region where the loss stays low. Two networks are linearly mode connected if the straight line between their weights stays low-loss, with no barrier in between. If two networks sit in different basins, their midpoint lands on a ridge and the averaged network is broken. Hidden units can also be permuted without changing the function, so independently trained networks line up badly. Frankle, Dziugaite, Roy and Carbin showed in 2020, in their ICML paper on linear mode connectivity and the lottery ticket hypothesis, that ImageNet-scale networks from separate runs generally do have a barrier. They only become linearly connected if they share a stable early part of training. 10 00:02:59,875 --> 00:03:04,825 [Hal Turing] And the pre-trained checkpoint plays the role of that shared early part. 11 00:03:04,825 --> 00:03:24,850 [Dr. Ada Shannon] That's the premise. Neyshabur, Sedghi and Zhang asked in 2020, in "What is being transferred in transfer learning?", and found that models fine-tuned from the same pre-trained checkpoint stay in the same basin and close to each other. Treat that as the premise the soup relies on, not as proof it works. The soup paper still has to show the averages are good. 12 00:03:24,850 --> 00:03:27,900 [Hal Turing] Averaging weights isn't new, though. 13 00:03:27,900 --> 00:03:55,875 [Dr. Ada Shannon] No. Izmailov and colleagues introduced stochastic weight averaging in 2018, in "Averaging Weights Leads to Wider Optima and Better Generalization." It averages checkpoints along one training trajectory. Soups extend that to independent runs with different hyperparameters. One analogy for kernel people is merging many topic branches that all forked from the same base commit. It works because they share ancestry. The limit is that a merge conflict here is not reported, it just gives you a worse model. 14 00:03:55,875 --> 00:04:01,125 [Hal Turing] The paper also leans on distribution shift. What are those test sets? 15 00:04:01,125 --> 00:04:25,975 [Dr. Ada Shannon] They are ImageNet-style evaluations whose images differ from the training distribution. ImageNet-V2 is re-collected images. R is renditions, such as art and cartoons. Sketch is sketches. ObjectNet has unusual poses and backgrounds. A is adversarially filtered images. Higher accuracy is better, and the paper reports the average over these five. The relevant background is that fine-tuning often raises ImageNet accuracy while eroding the robustness the zero-shot model had. 16 00:04:25,975 --> 00:04:31,475 [Hal Turing] So fine-tuning buys in-distribution accuracy and sells robustness. 17 00:04:31,475 --> 00:04:52,525 [Dr. Ada Shannon] Often, yes. The same group's WiSE-FT work, by Wortsman, Ilharco and colleagues in 2022, interpolates between zero-shot and fine-tuned weights and recovers much of that robustness. That raises a question we'll come back to at the end. Do soups gain on shifted data simply because averaging pulls the weights back toward the initialization, or is something else going on? 18 00:04:52,525 --> 00:04:59,275 [Hal Turing] So the recipe. If I'm holding a pile of fine-tuned checkpoints, what do I actually do with them? 19 00:04:59,275 --> 00:05:18,500 [Dr. Ada Shannon] Two versions. The uniform soup averages every checkpoint in the sweep. The greedy soup is the one that matters. Sort the models by held-out validation accuracy, best first. Start the soup with the top model. Then take each next model, tentatively average it in, and check validation accuracy. Keep it only if accuracy doesn't drop. 20 00:05:18,500 --> 00:05:23,675 [Hal Turing] So the soup can't be worse than the best single model on validation. 21 00:05:23,675 --> 00:05:46,225 [Dr. Ada Shannon] Right, by construction. And the filter does a second job. A model from a different basin, like a high-learning-rate run, drags the average across a barrier. Validation accuracy falls and the model gets rejected. The validation set is about two percent of the ImageNet training set, kept separate from the test sets. There's also a learned soup, which optimizes the mixing coefficients by gradient descent. It needs every model in memory at once, which defeats the purpose. 22 00:05:46,225 --> 00:05:52,100 [Hal Turing] Fine. But why should the average land somewhere good? Ensembling has a clear story. 23 00:05:52,100 --> 00:06:08,926 [Dr. Ada Shannon] Section 3.2 gives a picture. Take the initialization and two independently fine-tuned solutions. Those three points define a plane. Plot loss and error over that plane and you see a basin, with the best point between the two solutions, not at either one. 24 00:06:08,926 --> 00:06:14,126 [Hal Turing] Between them, not at them. That implies each run overshoots a little. 25 00:06:14,126 --> 00:06:37,651 [Dr. Ada Shannon] That's a reasonable reading, though it's a picture of one slice, not a proof. The second figure adds a condition. The gain from averaging a pair grows with the angle between their fine-tuning directions, meaning the vectors from the initialization to each solution. Changing the seed alone gives small angles. Changing learning rate or augmentation gives wider ones. So hyperparameter diversity is useful, which matches Gontijo-Lopes and colleagues, who found that varying training methods helps ensembles. 26 00:06:37,651 --> 00:06:42,201 [Hal Turing] And Section 4 asks when the soup acts like the ensemble? 27 00:06:42,201 --> 00:07:11,826 [Dr. Ada Shannon] Yes, for two models, and it's a loss-based approximation. The soup tracks the logit ensemble when two things hold. First, the loss is flat and convex along the line between the models. Second, predictions are confident, or the models are similar, so the models' logits differ little where it matters. The ensemble term always favors the ensemble. The flatness term favors the soup. The approximation correlates strongly with the true gap, except at a learning rate of 1e-4. Those models sit far from the initialization, and the greedy filter usually rejects them anyway. 28 00:07:11,826 --> 00:07:16,501 [Hal Turing] Now the results. Does the greedy soup earn its keep on the CLIP sweep? 29 00:07:16,501 --> 00:07:35,976 [Dr. Ada Shannon] On CLIP ViT-B/32, with a 72-model random sweep, the greedy soup beats the best single model by about two thirds of a point on ImageNet. The bigger effect is under distribution shift. The average over the five shifted test sets rises by about three points, from roughly 48 to 51. 30 00:07:35,976 --> 00:07:38,301 [Hal Turing] What about the uniform soup? 31 00:07:38,301 --> 00:07:59,726 [Dr. Ada Shannon] It loses about four tenths of a point on ImageNet to the best single model, because the high-learning-rate runs poison the average. Yet it still scores above 51 on the shifted sets. So the filter protects in-distribution accuracy. The ensemble edges the soup on ImageNet, 81.19 against 81.03, but does about the same under shift. The soup trades a sliver of accuracy for one-model inference. 32 00:07:59,726 --> 00:08:07,126 [Hal Turing] The headline model is ViT-G/14, pre-trained on JFT-3B. What happens there? 33 00:08:07,126 --> 00:08:25,801 [Dr. Ada Shannon] 58 fine-tunes, 14 in the soup. The soup gets 90.94 on ImageNet. The model you'd actually pick by validation gets 90.72. That's about 22 more images right out of every 10,000. On the shifted sets, the gap is roughly 64 per 10,000. 34 00:08:25,801 --> 00:08:32,301 [Hal Turing] The paper's own table compares against something higher than 90.72, though. 35 00:08:32,301 --> 00:08:59,776 [Dr. Ada Shannon] The oracle, 90.78. It picks the best model separately for each test set, so nobody could deploy it. The soup is statistically better than the validation-selected model on every dataset except ObjectNet. Against the oracle, though, an individual model wins on ReaL and ObjectNet. The greedy ensemble nearly ties on ImageNet at 90.93, but is worse under shift. That's the soup's real pitch: ensemble-level accuracy at single-model cost. Whether 22 in 10,000 means much is a question for the end. 36 00:08:59,776 --> 00:09:03,826 [Hal Turing] Any implementation details a listener should know? 37 00:09:03,826 --> 00:09:24,051 [Dr. Ada Shannon] Everything is fine-tuned end to end. They average exponential-moving-average checkpoints, using a low decay of 0.999 for souping, and draw candidates from checkpoints every 1000 steps. The ViT-G sweep varied learning rate, decay schedule, loss function, crop size, and RandAugment, mixup and CutMix settings, plus four SAM runs. 38 00:09:24,051 --> 00:09:26,326 [Hal Turing] And where does it stop working? 39 00:09:26,326 --> 00:09:45,776 [Dr. Ada Shannon] Gains are smaller for an ImageNet-22k pre-trained ViT-B. On GLUE with BERT and T5, gains are small. BERT on MRPC and CoLA gets exactly zero, and the authors call the NLP results preliminary. Calibration doesn't improve the way it does for ensembles. 40 00:09:45,776 --> 00:09:57,101 [Hal Turing] Let me take the headline gap. The paper's Table 1 says the soup beats the best single ViT-G model by 0.16 points, but that's against the oracle. 41 00:09:57,101 --> 00:10:09,376 [Dr. Ada Shannon] Right. The fair baseline is the validation-selected model at 90.72. Against it the gain is 0.22 points, so Table 1 actually flatters the baseline. 42 00:10:09,376 --> 00:10:16,101 [Hal Turing] They run significance tests, though. Does that settle whether 22 in 10,000 is real? 43 00:10:16,101 --> 00:10:34,551 [Dr. Ada Shannon] No. McNemar and permutation tests ask whether two models' predictions differ more than chance on this test set. They say nothing about whether a fresh sweep with different seeds would give the same ordering. The paper has one sweep, one seed per configuration, one test set, and no variance across sweeps. 44 00:10:34,551 --> 00:10:36,676 [Hal Turing] So what would settle it? 45 00:10:36,676 --> 00:10:56,776 [Dr. Ada Shannon] Repeat the whole sweep several times and report the distribution of soup minus selected-model gaps. That's expensive at ViT-G scale, which is probably why it's missing. The counterweights are decent, though. The shifted-set gain is bigger, and the CLIP and ALIGN gains are larger. The direction looks real. At ViT-G scale the size is small, and I wouldn't claim more. 46 00:10:56,776 --> 00:11:04,201 [Hal Turing] Then the state-of-the-art claim. 90.94 against CoAtNet-7 at 90.88. 47 00:11:04,201 --> 00:11:34,426 [Dr. Ada Shannon] That's six images in 10,000, on one test set. I'd read it as a tie. The paper also notes lower inference FLOPs than CoAtNet-7, about 25 percent, and that's a real, separate advantage. What I'd push on is the training side. The soup took 14 ingredients out of 58 full fine-tunes. The authors argue practitioners run sweeps anyway, so the soup is nearly free, and that holds if you already have the sweep. But the single-model baseline gets no matched budget. Spend those 58 runs on more seeds, longer training or better tuning, and we don't know what happens. 48 00:11:34,426 --> 00:11:43,126 [Hal Turing] That sounds like the same hole as the OOD story. Do soups just drift back toward the initialization, like WiSE-FT? 49 00:11:43,126 --> 00:12:06,301 [Dr. Ada Shannon] It's a live hypothesis, and the paper doesn't isolate it. An average of fine-tuned endpoints cancels some of the fine-tuning displacement, and we know shrinking toward the initialization restores robustness. The ensemble result hints that more than diversity is involved. The greedy ensemble matches the soup on ImageNet but does worse under shift. Still, the clean test would be to compare against interpolation toward the initialization at equal in-distribution accuracy. That isn't here. 50 00:12:06,301 --> 00:12:10,926 [Hal Turing] And the premise itself, the shared basin. Where does it give out? 51 00:12:10,926 --> 00:12:31,676 [Dr. Ada Shannon] It needs a strong pre-trained anchor. Gains shrink for the ImageNet-22k ViT-B. High-learning-rate runs fall out of the basin. From-scratch runs don't average at all, which is the Frankle result. The Section 4 theory is also a two-model approximation. It describes loss, not the error rate they report, and it breaks at the learning rate where soups themselves fail. 52 00:12:31,676 --> 00:12:33,801 [Hal Turing] What else is missing? 53 00:12:33,801 --> 00:12:55,851 [Dr. Ada Shannon] Calibration doesn't improve, so a soup isn't a drop-in for ensembles used for uncertainty. The NLP evidence is four small GLUE tasks per model family, with gains from zero to under a point and no variance reported, so I can't separate it from noise. The learned soup needs all models in memory, which rules it out at this scale. And greedy selection depends on a clean validation split, with decisions made sequentially on that same set. 54 00:12:55,851 --> 00:13:00,501 [Hal Turing] So what should someone with a sweep sitting on disk actually do? 55 00:13:00,501 --> 00:13:21,527 [Dr. Ada Shannon] Try a greedy soup. After the fact it's cheap, inference cost stays at one model, and for vision or vision-language models fine-tuned from one strong checkpoint the downside looks small. Use a clean validation split. Expect more help under shift than in-distribution. If you need calibrated uncertainty, keep the ensemble. What the paper doesn't tell you is whether your sweep budget would have been better spent some other way. 56 00:13:21,527 --> 00:13:23,902 [Hal Turing] And the open questions? 57 00:13:23,902 --> 00:13:43,902 [Dr. Ada Shannon] Variance across sweeps and seeds. Equal-compute baselines. Whether the robustness gain survives a WiSE-FT-style comparison. Behavior at LLM scale and with parameter-efficient adapters, which the paper doesn't test. And a way to tell which checkpoints share a basin without spending validation passes on each. 58 00:13:43,902 --> 00:14:11,727 [Hal Turing] Here's where I land. Averaging independently fine-tuned models from one strong pre-trained checkpoint often matches or beats the validation-selected single model at no extra inference cost, and the clearest benefit is under distribution shift. The boundary is that the headline ImageNet gain is about 0.2 points on one sweep, not shown to be reproducible. And the record is a 0.06-point tie bought with a large sweep. That's our time. Thanks for listening, everyone. 59 00:14:11,727 --> 00:14:13,902 [Dr. Ada Shannon] Thanks, everyone. Goodbye.