## Introduction: Hitting the Data Wall Norris: Welcome back to Mechanical Dreams, the podcast where we dream of electric sheep and then argue about the hyperparameters used to generate them. I’m Professor Norris. Linda: And I’m Linda! And Professor, today we are standing at the edge of a precipice. We are looking into the abyss. Norris: Good heavens, Linda. Is the coffee machine broken again? Or did you just find a typo in a Transformer paper? Linda: Worse. We’re running out of internet. Or, specifically, we’re running out of high-quality text to train our models on. Norris: Running out? Have you seen social media? I feel like we produce enough text every day to fill the Library of Alexandria, mostly consisting of cat memes and bad political takes. Linda: Exactly! That’s the 'bad' text. But the high-quality stuff—books, scientific papers, well-written code—is a finite resource. There’s this concept called the 'Data Wall'. Some projections, like Villalobos et al., suggest we might exhaust readily available high-quality public text by as early as 2026. Norris: 2026? That is... alarmingly soon. So the era of 'just make the dataset bigger' is over? Linda: Precisely. The scaling laws have driven progress for a decade—more data, bigger models. But now that the data factor is saturating, the game is changing. We have to shift from 'more tokens' to 'better tokens'. Norris: Better tokens. It sounds like a marketing slogan for a crypto scam. But I assume you mean we need to be pickier about what the model actually sees? Linda: Right. We need to treat data selection not just as a preprocessing step you do once before training, but as an integral part of the optimization process itself. And that brings us to this week’s paper: 'OPUS: Towards Efficient and Principled Data Selection in Large Language Model Pre-training in Every Iteration'. Norris: OPUS. A grand name. Sounds like a magnum opus. Who are the composers of this symphony? Linda: It’s a collaboration between folks at Alibaba's Qwen Team, Shanghai Jiao Tong University, UW-Madison, and Mila. And they are tackling exactly this problem: if every update step consumes scarce tokens, which tokens should shape the model at that specific moment? Norris: So, instead of a buffet where you eat everything in sight, it's a curated tasting menu served course by course? Linda: That’s a great analogy! But most current methods for doing this are... well, they’re a bit like trying to pair wine with food while wearing a blindfold. And that is what OPUS is trying to fix. ## The Flaw in Current Data Selection Norris: So, Linda, you left us with a rather evocative image of blindfolded sommeliers pairing wine. But surely, we aren't completely blind? We have sophisticated ways of filtering data. I recall seeing datasets like FineWeb-Edu that use classifiers to pick out the 'educational' content. Linda: We do, and those are what we call static selection methods. They're great! You train a classifier to say, 'This looks like a textbook, keep it,' or 'This looks like a comment section argument, burn it.' You filter the whole pool once before you even start training. Norris: Sounds sensible. Keep the Shakespeare, toss the shopping lists. Why is that not enough? Linda: Because it ignores the student! Static selection assumes that a piece of data is equally valuable at step one as it is at step one hundred thousand. But a model’s needs evolve. What’s useful when you’re a blank slate might be redundant or trivial later on. Norris: Ah, I see. Just as I don't need to re-read 'The Very Hungry Caterpillar' every week, despite its compelling narrative arc regarding gluttony. Linda: Exactly. So, people moved to *dynamic* data selection. The idea is to select batches on the fly based on what the model currently finds difficult. Usually, this involves looking at the gradients. If a sample produces a large gradient, it means the model is learning a lot from it, so we prioritize it. Norris: That seems logically sound. The squeaky wheel gets the grease. High gradient means high signal. Linda: It *would* be sound, if we were training these massive LLMs using basic Stochastic Gradient Descent, or SGD. In SGD, the update direction is basically just the raw gradient. But Professor, nobody trains LLMs with vanilla SGD anymore. Norris: True. It’s all AdamW this, and more recently, Muon that. We like our optimizers fancy and adaptive. Linda: Right, and that’s the flaw! Adaptive optimizers like AdamW or Muon don’t just follow the raw gradient. They precondition it. They reshape the update geometry. They might scale down a direction where the gradient is huge but noisy, or scale up a direction where it's small but consistent. Norris: Wait, so you're saying the 'squeaky wheel' might actually be ignored by AdamW because the optimizer knows it’s just noise? Linda: Precisely. Previous dynamic selection methods score data based on the *raw* gradient space. But the model actually updates in the *optimizer-induced* space. The paper calls this the 'Misalignment Gap'. You’re selecting data thinking it will push the model one way, but the optimizer takes those ingredients and cooks something completely different. Norris: So it's like buying ingredients for a soup recipe, but the chef—AdamW in this case—decides to make a stir-fry. Your selection criteria are completely out of sync with the cooking process. Linda: That is surprisingly accurate. If you select data based on raw gradients, you're implicitly assuming SGD dynamics. But since we use AdamW or Muon, that assumption is wrong. We need to measure utility based on where the parameters actually move, not just where the raw gradient points. Norris: And I suspect OPUS has a way to peek into the kitchen and see what the chef is actually doing? Linda: Oh, it does more than peek. It realigns the entire menu. ## Defining Utility in the Optimizer's World Norris: Okay, Linda, I’m with you on the problem. We’ve established that asking AdamW to cook a soup with raw ingredients usually results in a stir-fry. So how does OPUS force the chef to make what we actually want? Or rather, how does it pick the ingredients that result in the right dish? Linda: It starts with the name: OPUS stands for Optimizer-induced Projected Utility Selection. A mouthful, I know, but every word matters. The key insight is redefining what 'utility' means. Norris: I assume 'utility' here isn't just 'how much I like this paragraph about quantum mechanics'? Linda: Not quite. In OPUS, a batch of data is only considered useful if it moves the model parameters in a direction that improves performance on a specific target. We call this target the 'proxy'. Norris: The proxy. Sounds like a stand-in. Is this our 'gold standard'? Linda: Exactly. The proxy is a small, high-quality dataset—think of the validation set or a carefully curated sample of what you want the model to be good at. The goal is to lower the loss on *that* proxy. Norris: So, conceptually, we have a compass pointing towards 'lower loss on the proxy'. And we want to pick training data that moves us North, if North is where the proxy is. Linda: Yes! But remember the flaw we discussed? Previous methods looked at a candidate batch—say, a web page about gardening—and calculated its raw gradient. They’d ask, 'Does this raw arrow point North?' Norris: But AdamW bends the arrow. Linda: Right. AdamW might look at the terrain—the variance of the gradients—and say, 'Actually, going straight North is too rocky; we’re going North-East.' OPUS anticipates this. It doesn't look at the raw arrow. It calculates the *effective* update vector. Norris: The effective update... meaning, it simulates what the optimizer will actually do to the parameters? Linda: Precisely. It applies the optimizer’s specific transformation—the 'preconditioner'—to the gradient. *Then* it projects that final, curved trajectory onto the proxy’s descent direction. It measures the alignment between where the optimizer *will* take us and where we *want* to go. Norris: That is remarkably clever. It’s like having a GPS that doesn't just know the destination, but also knows exactly how your car handles corners. Linda: That’s a perfect analogy. And it adapts to the car! If you're using AdamW, OPUS scales the gradients by the inverse square root of the second moments. If you're using Muon—that new optimizer for matrix-shaped parameters—OPUS approximates Muon’s Newton-Schulz orthogonalization. Norris: Muon? Ah yes, the one that treats parameters as matrices rather than vectors. I imagine the geometry there is completely different from SGD. Linda: It is. It’s like driving a drift car versus a tank. 'Turn left' means very different things for the trajectory. If you used raw gradients to score data for Muon, you’d be completely lost. OPUS is the first method to explicitly model that drift. Norris: So, mathematically, we are calculating an inner product? Between the optimizer-adjusted update of our candidate data and the gradient of our proxy? Linda: Spot on, Professor. It’s a dot product in the optimizer’s geometry. If that product is high, the data gets a high score. It means, 'Even after AdamW messes with this update, it will still push us towards the gold standard.' Norris: This all sounds fantastic in theory, Linda. But calculating these 'future updates' for every single piece of data in a massive corpus... that sounds computationally ruinous. Are we running a simulation for every sentence on the internet? Linda: That is the million-dollar question. Or perhaps the million-GPU-hour question. And the answer involves ghosts. ## Scaling Up: Ghosts and Sketches Norris: Ghosts, Linda? I knew machine learning was becoming alchemy, but I didn't realize we had crossed over into the supernatural. Are we summoning the spirits of old mainframes? Linda: Nothing so spooky, Professor! The 'Ghost technique' is actually a very clever math trick. It lets us work with gradients that aren't really there. Norris: Gradients that aren't there. Schrodinger's gradients? Please explain before I call an exorcist. Linda: Okay, so normally, to score a data sample, you need its gradient. For a Linear layer in a transformer, that gradient is huge—it's a massive matrix formed by the outer product of the input activations and the backward error signal. Norris: Right. If you have a thousand samples in a buffer, and billions of parameters, calculating and storing a gradient matrix for *each* sample is impossible. You’d run out of memory instantly. Linda: Exactly. That’s 'materializing' the gradient. The Ghost technique avoids this. It realizes that we don't actually need the full matrix. We just need to know how that matrix aligns with our proxy target. Norris: So you compute the alignment score without building the matrix? Linda: Yes! Because the gradient is just vector A times vector B, we can use the associative property of multiplication. We multiply the proxy vector with the error term first, and then the activation term. We chain the operations so we never have to build that giant N-by-N square matrix in the middle. Norris: Ah, the beauty of linear algebra. You bypass the heavy lifting by rearranging the parentheses. But wait, even with that trick, these vectors are still millions of dimensions long. Surely dot products are still slow? Linda: They are. That’s where the second piece of magic comes in: CountSketch. Norris: CountSketch? Sounds like a vampire accountant. Linda: It’s a randomized projection method. Imagine taking a high-definition photograph and turning it into a pixel art thumbnail. You lose detail, but you can still tell if it's a picture of a cat or a dog. Norris: So we compress these million-dimensional gradient vectors into... what? A few thousand? Linda: Exactly. OPUS projects the gradients down to a much smaller 'sketch' space using random hash functions. And the math guarantees that the inner product—the alignment score—in this small sketch space is a very good unbiased estimator of the true value. Norris: Unbiased estimator. Music to my ears. So, putting it together: we use the Ghost trick to avoid building the matrices, and CountSketch to shrink the vectors. Linda: And the result? The overhead is tiny. The paper reports only about 4.7% additional compute cost to run this selection. Compared to the efficiency gains in training, that’s practically free. Norris: 4.7% is impressive. Usually, when students bring me 'dynamic selection' papers, the selection mechanism costs more than just training on the random data would have. Linda: Not this time. It’s scalable enough to run in every single iteration of pre-training. We are literally curating the dataset in real-time, at LLM scale. ## Diversity via Boltzmann and The Proxy Norris: I must admit, the Ghost trick is clever. But I see a potential pitfall here. If we have this sophisticated GPS telling us exactly which data points are the 'best' for our optimizer, won't we end up obsessively picking the same type of data? Linda: You mean like eating only dessert because it has the most sugar? Norris: Precisely. If the model finds Wikipedia articles helpful, a greedy selection mechanism might just feed it Wikipedia until it overfits, ignoring the rest of the nutritious internet. Linda: That’s called 'diversity collapse,' and it is a huge risk with dynamic selection. If you just grab the top-K highest scoring samples every time, you lose the breadth needed for a general-purpose model. OPUS solves this with two things: Boltzmann sampling and a redundancy penalty. Norris: Boltzmann sampling... so instead of deterministically grabbing the top scorers, we treat the scores as probabilities? Linda: Exactly. We use a temperature parameter to smooth out the distribution. It means high-scoring data is *likely* to be picked, but lower-scoring—perhaps unique or niche—data still has a chance. It keeps the diet varied. Norris: And the redundancy penalty? Linda: It’s built right into the utility function. OPUS subtracts points if a candidate's update vector is too similar to what's already in the current batch. It forces the system to pick data that pushes the model in *new* directions, not just the same direction over and over. Norris: Very sensible. Now, earlier you mentioned this 'Proxy'—the compass pointing North. But what exactly is this proxy? If it's just a validation set, isn't it tiny compared to the training data? And potentially weirdly formatted? Linda: That is the other big innovation: 'Bench-Proxy'. You're right, using a raw benchmark validation set—like a list of multiple-choice questions—is dangerous. It’s out-of-distribution. The gradients would be noisy because the format is so different from normal web text. Norris: So the compass would be spinning wildly because the map doesn't match the terrain. Linda: Right. So instead of using the benchmark directly, OPUS uses it as a query. They take the benchmark data, search through the pre-training corpus, and retrieve the web documents that are semantically similar to the benchmark. Norris: Ah! So the proxy isn't the exam itself, but the textbooks and articles that *teach* the material on the exam. Linda: Exactly! This creates a 'Bench-Proxy' pool. It’s stable, it’s in-distribution—because it’s literally from the web corpus—but it’s highly aligned with the downstream tasks we care about. That becomes the stable North star for the optimizer. ## Results and Final Thoughts Linda: So, the moment of truth. Does all this fancy math—the ghosts, the sketches, the proxies—actually work? Norris: I am bracing myself. Don't tell me it performed 'competitively' with a random number generator. Linda: Far from it! On GPT-2 Large and XL training runs, OPUS consistently outperformed industrial baselines, including the very strong FineWeb-Edu static classifier. In fact, it often matched the performance of models trained on *twice* the amount of data using random selection. Norris: Twice the efficiency? That is effectively doubling our data supply. That is not a rounding error. Linda: It gets better. When they tested it on continued pre-training for the Qwen3-8B model on scientific data, OPUS reached the target accuracy using only 0.5 billion tokens. The standard full training took 3 billion tokens. Norris: A six-fold reduction? Well, I suppose I must concede. Treating the optimizer as a partner rather than an obstacle seems to be the way forward. We might just scale that Data Wall after all. Linda: One carefully selected token at a time. That’s it for this week's Mechanical Dreams! Norris: Indeed. Until next time, keep your gradients clipped and your proxies stable. Goodnight.