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:32,674 [Hal Turing] Today we're looking at "Soup-of-Experts: Pretraining Specialist Models via Parameters Averaging," from Pierre Ablin and colleagues at Apple. It's an arXiv paper from February 2025. The question is whether one pretraining run can produce a bank of parameters, so that you can assemble a small specialist model for any data mixture instantly, with no retraining. 3 00:00:32,674 --> 00:00:47,750 [Dr. Ada Shannon] The stakes are cost. Today, if you want a small model that's excellent on patents, you pay for a pretraining run aimed at patents. Want one for math, pay again. This paper tries to pay once, and then make each later specialist close to free. 4 00:00:47,750 --> 00:00:50,399 [Hal Turing] Let's pin down "specialist." 5 00:00:50,399 --> 00:01:13,474 [Dr. Ada Shannon] A specialist is a small model that does very well on one narrow kind of text, say patents, emails or math, and gives up generality to do it. Small models are cheap to serve, which is the appeal. The catch is that your target data is usually scarce. A few hundred patents can't train a decent language model alone, so you borrow strength from a huge generic corpus. And how you weight that borrowing, meaning which parts of the generic data you emphasize, changes downstream performance a lot. 6 00:01:13,474 --> 00:01:18,000 [Hal Turing] So the first piece of background is how people pick that weighting. 7 00:01:18,000 --> 00:01:40,549 [Dr. Ada Shannon] Right. This paper splits its pretraining corpus, RedPajama-v2, into 4096 clusters. It runs k-means on sentence-BERT embeddings, hierarchically: 64 clusters, each split into 64 more. Call each cluster a domain. A set of domain weights is just a histogram over those clusters. To train on a mixture, you sample a cluster according to the histogram, then a document from that cluster. Different histogram, different training diet. 8 00:01:40,549 --> 00:01:44,125 [Hal Turing] And how do you get the histogram for a target? 9 00:01:44,125 --> 00:02:06,750 [Dr. Ada Shannon] That's clustered importance sampling, CRISP, from Grangier and colleagues in 2024, "Task-adaptive pretrained language models via clustered-importance sampling." You embed your small target set and count which clusters its documents land in. Then you train a fresh model on a mixture that imitates that count. It gives strong specialists. But every target needs its own full pretraining run, so cost grows linearly with the number of targets. That's the cost this paper attacks. 10 00:02:06,750 --> 00:02:11,050 [Hal Turing] Now the "soup" in the title. That's the model soups idea? 11 00:02:11,050 --> 00:02:30,725 [Dr. Ada Shannon] Yes, Wortsman and colleagues, ICML 2022: "Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time." You fine-tune several copies of one base model, then average their weights into a single model. Inference cost is the same as one model. 12 00:02:30,725 --> 00:02:35,525 [Hal Turing] Averaging weights sounds like it should produce garbage. Why doesn't it? 13 00:02:35,525 --> 00:02:57,650 [Dr. Ada Shannon] Because the copies share an ancestor. Fine-tuning moves each one only a short distance from the same starting point, so they stay in one basin of the loss landscape, and the average lands somewhere sensible. Average two models trained separately from scratch and you generally get nonsense, since their internal features don't line up. The Soup-of-Experts moves this idea from fine-tuning into pretraining, with experts designed to be combinable from the start. 14 00:02:57,650 --> 00:03:00,575 [Hal Turing] Which brings up the other baselines. 15 00:03:00,575 --> 00:03:21,025 [Dr. Ada Shannon] There are two. Generic pretraining is one model on everything. The other is domain experts, from Gross and colleagues in 2017, a vision paper. Train one small model per cluster, and at specialization time pick whichever has the lowest loss on your target. The paper trains only 64 of them, at the coarse level, because 4096 is infeasible. 16 00:03:21,025 --> 00:03:25,100 [Hal Turing] And the third idea in the background is hypernetworks. 17 00:03:25,100 --> 00:03:44,725 [Dr. Ada Shannon] Ha, Dai and Le, "Hypernetworks," 2017. It's a network that outputs the weights of another network. The paper doesn't use that word; that framing is ours. But it fits: a small network takes the domain histogram and produces a model. In this case it's a very constrained version, and we'll get into what constrained means next. 18 00:03:44,725 --> 00:03:51,000 [Hal Turing] Is this territory new? Training experts per domain and combining them sounds familiar. 19 00:03:51,000 --> 00:04:25,450 [Dr. Ada Shannon] It is, and it's worth flagging. Branch-Train-Merge, by Li, Gururangan, Dettmers, Lewis, Smith and Zettlemoyer in 2022, trains domain experts in parallel and combines them by ensembling or parameter averaging. Then c-BTM, Gururangan and colleagues in 2023, builds its experts from k-means clusters and ensembles them sparsely at inference. Both are close relatives. The Soup-of-Experts paper compares only against the vision-era domain-experts baseline, not these. That positioning point is ours, not the paper's, and I won't claim more about what BTM reports than that. 20 00:04:25,450 --> 00:04:28,450 [Hal Turing] One more term: amortization. 21 00:04:28,450 --> 00:04:43,150 [Dr. Ada Shannon] Pay one large training cost up front so each later specialist is nearly free. Whether that wins depends on how many specialists you actually need. The paper argues it qualitatively and never states a break-even point. 22 00:04:43,150 --> 00:04:51,650 [Hal Turing] So the roadmap: next we see how the soup is built and what it achieved, and after that whether the headline comparison holds up. 23 00:04:51,650 --> 00:04:58,250 [Dr. Ada Shannon] Yes. The mechanism is simpler than the name suggests, and the comparison is where I have the questions. 24 00:04:58,250 --> 00:05:03,150 [Hal Turing] Let's build the soup. What's in it, and what happens at each training step? 25 00:05:03,150 --> 00:05:26,200 [Dr. Ada Shannon] There are three parts. First, shared parameters S, which are one ordinary 110-million-parameter transformer's worth of weights. Second, a bank of n experts, 128 by default. Each expert is a full set of weights the same shape as S. Third, a small two-layer MLP. Give it a domain histogram h and it returns 128 coefficients, which the paper calls alpha. The model you actually run is S plus the alpha-weighted sum of the experts. 26 00:05:26,200 --> 00:05:34,175 [Hal Turing] So the histogram goes in, the MLP picks the recipe, and the recipe produces a normal-sized model. 27 00:05:34,175 --> 00:05:52,875 [Dr. Ada Shannon] Right. Training is a loop. Sample a random histogram h. Run the MLP to get alpha. Assemble the model. Draw a batch from mix(h), meaning clusters picked by h and documents picked within each cluster. Compute the loss and backpropagate into S, all the experts, and the MLP together. 28 00:05:52,875 --> 00:05:59,350 [Hal Turing] That sounds like a soup, but the experts aren't fine-tuned separately and averaged afterward. 29 00:05:59,350 --> 00:06:12,825 [Dr. Ada Shannon] That's the difference. A classic soup trains the copies independently and hopes they stay compatible. Here the experts are trained toward being combined from step one. Combinability is the training objective. 30 00:06:12,825 --> 00:06:16,800 [Hal Turing] You mentioned a hypernetwork earlier. Does that fit? 31 00:06:16,800 --> 00:06:34,450 [Dr. Ada Shannon] Partly. It holds in that a small input, the histogram, generates the weights of a bigger network. It stops there. A real hypernetwork can output any weights. This one can only reach weights inside the span of S and the 128 experts. It's a generator with a fixed linear menu. 32 00:06:34,450 --> 00:06:42,300 [Hal Turing] What does the sampling of h look like? Uniform histograms over 4096 clusters would be mush. 33 00:06:42,300 --> 00:07:04,750 [Dr. Ada Shannon] They avoid that. The meta-distribution picks s clusters, default four, then draws random weights over just those. Real targets concentrate on a few clusters, so the training diet matches what comes later. The ablation on s says s equals 1 is bad, because the soup never sees clusters interact. s equals 2 gives the best specialized loss. Larger s helps generic loss. And the best s on test mixtures matches the s it trained on. 34 00:07:04,750 --> 00:07:09,550 [Hal Turing] So the meta-distribution is a bet on your future customers. 35 00:07:09,550 --> 00:07:24,100 [Dr. Ada Shannon] Yes. One caveat on those runs: the appendix labels them 128K iterations but also 134 billion tokens, and those don't agree. They appear to have been shorter runs than the headline ones. 36 00:07:24,100 --> 00:07:28,300 [Hal Turing] Now the payoff. A new target arrives. What do I do? 37 00:07:28,300 --> 00:07:46,025 [Dr. Ada Shannon] Embed a few target documents, find the nearest cluster centroid for each, and count. That's your histogram. Run the MLP, merge the weights, done. No gradient step. If you want more, you can fit the 128 coefficients directly by gradient descent, or fine-tune the merged model afterward. 38 00:07:46,025 --> 00:07:52,050 [Hal Turing] What does it cost to train? Holding 128 copies of a model sounds heavy. 39 00:07:52,050 --> 00:08:14,475 [Dr. Ada Shannon] The forward and backward compute is about the same as ordinary training, since gradients flow through one assembled model. The extra cost is the Adam optimizer updating every expert. The bank holds 129 times 110 million, about 14 billion parameters. Measured throughput is 77% of generic pretraining. Learning rate was 1e-4 for the soup, versus 3e-4 for the others, each chosen from a small grid. 40 00:08:14,475 --> 00:08:16,875 [Hal Turing] And the experiment itself? 41 00:08:16,875 --> 00:08:38,975 [Dr. Ada Shannon] Pretrain on RedPajama-v2, then specialize to 16 Pile domains: arxiv, math, github, patents, and so on. Baselines are one generic model, 64 domain experts, and CRISP, one fresh run per target. The soup and the generic model each train on 134 billion tokens. Each CRISP model and each domain expert gets 17 billion. I'll flag that now, and we'll come back to it. 42 00:08:38,975 --> 00:08:41,275 [Hal Turing] Then what's the headline? 43 00:08:41,275 --> 00:09:04,300 [Dr. Ada Shannon] The loss is next-token surprise, so lower is better. One soup, trained once, gets the lowest average loss across the 16 targets. It beats the per-domain CRISP and domain-expert models. It also stays close to the generic model on general text. CRISP and the domain experts are worse generalists, and the domain experts fall off the generic plot entirely. The paper gives no exact end-point numbers in the text and reports no seeds or error bars. 44 00:09:04,300 --> 00:09:12,225 [Hal Turing] The soup being close on generic loss tells me something. It didn't trade away general ability to specialize. 45 00:09:12,225 --> 00:09:16,650 [Dr. Ada Shannon] Slightly worse than generic, they say, but they don't quantify the gap. 46 00:09:16,650 --> 00:09:23,950 [Hal Turing] Does the advantage survive fine-tuning? A generic model with enough target text might just catch up. 47 00:09:23,950 --> 00:09:42,675 [Dr. Ada Shannon] It does catch up eventually, but the soup keeps its lead at every fine-tuning budget they tried. The vivid case is patents. A generic model needs about 10 million tokens of patent text to match the soup's out-of-the-box model. That's the best example, not the average, and the savings vary a lot by domain. 48 00:09:42,675 --> 00:09:46,200 [Hal Turing] And if I only have a handful of documents? 49 00:09:46,200 --> 00:10:00,425 [Dr. Ada Shannon] About three documents are enough on average to match the generic model. Somewhere from 100 to 1000 get you the best the soup can do. So a small internal corpus can pick the recipe without any training. 50 00:10:00,425 --> 00:10:03,451 [Hal Turing] Any other ablations that matter? 51 00:10:03,451 --> 00:10:24,101 [Dr. Ada Shannon] The advantage holds at 35M, 55M and 110M. The negative result is more useful. Low-rank, LoRA-style experts would let you use more experts for the same parameter count. They came out worse than dense experts, from 300 million to 12 billion total parameters. The authors suspect an optimization problem but didn't show it. 52 00:10:24,101 --> 00:10:27,901 [Hal Turing] So the cheap version of the idea doesn't work yet. 53 00:10:27,901 --> 00:10:33,726 [Dr. Ada Shannon] Not as tested. Storage and memory for the full bank is the price of the dense version. 54 00:10:33,726 --> 00:10:46,726 [Hal Turing] That leaves the Figure 4 comparison. The soup got 134 billion training tokens and each CRISP model got 17 billion. Does that make "not competitive" an artifact? 55 00:10:46,726 --> 00:11:19,576 [Dr. Ada Shannon] The caption is a total-cost statement. It is not a statement about CRISP's quality at equal tokens. Those are different claims, and the paper only supports the first. The arithmetic actually helps CRISP here. Sixteen targets at 17 billion tokens each is roughly 270 billion tokens of training. That is about double the soup's 134 billion. The soup runs at 77 percent of generic speed, so in wall-clock terms it comes to about one and a half times. So even with an eighth of the tokens each, CRISP was not cheap. 56 00:11:19,576 --> 00:11:22,526 [Hal Turing] So what's the experiment that settles it? 57 00:11:22,526 --> 00:11:43,651 [Dr. Ada Shannon] There are two. Train CRISP at the full 134 billion tokens per target. Or stop the soup at the same total compute as sixteen CRISP runs, which buys roughly 206 billion soup tokens. The paper runs neither. I won't guess how either comes out. A 110-million-parameter model trained eight times longer on matched data could plausibly close the gap on its own domain, but nothing in the source says so either way. 58 00:11:43,651 --> 00:11:49,501 [Hal Turing] That moves the amortization argument from "is it cheaper" to "how many targets." 59 00:11:49,501 --> 00:12:19,826 [Dr. Ada Shannon] Right, and the paper never plots that. Derive it. Using the soup's cost of about 174 billion generic-equivalent tokens, and CRISP at 17 billion each, break-even is around ten or eleven targets. Give each CRISP model the full 134 billion and it is about two targets. The first number flatters the soup, because the baseline is handicapped. The second says the soup is cheaper per target, but we don't know the quality. And the bank itself has a cost the paper doesn't report: 14 billion parameters plus Adam state, in memory and in storage. 60 00:12:19,826 --> 00:12:23,151 [Hal Turing] Are there caveats that cut the other way? 61 00:12:23,151 --> 00:13:06,426 [Dr. Ada Shannon] Yes. CRISP receives the target's domain weights at training time, and the soup doesn't, which favors CRISP in principle. The domain-experts baseline is only 64 coarse experts. Against that, the evaluation is next-token loss on 110-million-parameter models. There are no downstream tasks, no seeds, no error bars. Estimating the target histogram uses the same clusters as pretraining, so a target far from every cluster is untested. The learning-rate schedule isn't specified. And the appendix says the Figure 7 and 8 runs used 128K iterations, 134 billion tokens. Those two numbers don't agree, since 128K iterations is about 17 billion tokens. I'd flag that as a reporting inconsistency, with no known cause. 62 00:13:06,426 --> 00:13:11,276 [Hal Turing] What about prior art? You mentioned Branch-Train-Merge in the background. 63 00:13:11,276 --> 00:13:31,751 [Dr. Ada Shannon] Neither it nor c-BTM is run as a baseline. c-BTM builds its experts from k-means clusters, as this paper does, but ensembles several at inference. So it trades serving cost for training simplicity, while the soup emits one small model. BTM's parameter-averaging variant and its compute accounting would be the natural comparison. 64 00:13:31,751 --> 00:13:34,026 [Hal Turing] And the hypernetwork side? 65 00:13:34,026 --> 00:13:50,826 [Dr. Ada Shannon] The Hypernetworks idea from Ha and colleagues suggests richer generators than a linear mix, and the authors' own pointer to combining with mixture-of-experts goes the same way. An experiment with a richer generator would show whether the linear restriction is costing anything. 66 00:13:50,826 --> 00:13:53,276 [Hal Turing] Who should actually use this? 67 00:13:53,276 --> 00:14:11,902 [Dr. Ada Shannon] Someone who needs many specialists, under a serving size limit, with scarce target data. Think per-customer or edge models. With a handful of targets, CRISP or plain fine-tuning is simpler. The memory trade is flexible in one direction: the bank is large, but each deployed model is 110 million parameters. 68 00:14:11,902 --> 00:14:13,977 [Hal Turing] And where does it go next? 69 00:14:13,977 --> 00:14:32,652 [Dr. Ada Shannon] The authors point to a mixture-of-experts base inside the soup and to fitting the coefficients by gradient on the target set. Fixing low-rank expert training would cut the memory bill. The missing experiments are equal-budget CRISP, a sweep over number of targets, scale beyond 110 million, and downstream evaluation. 70 00:14:32,652 --> 00:14:57,952 [Hal Turing] So here's where I land. A pretrained bank of jointly trained experts can be merged in one step into a stand-alone specialist. It beat the per-domain baselines it was tested against, and the gain persisted through fine-tuning. The boundary is that the headline compute comparison isn't matched. Whether the soup beats well-funded per-target CRISP training is untested. Thanks for listening, everyone. Until next time.