Reassessing the Limits of Encoder Pre-training Recipes
This article revisits why bidirectional encoders still appear to hit a capability ceiling earlier than generative models. It argues that the issue lies less in architecture than in pre-training recipes, particularly the 15% masking ratio carried over since 2018. The core problem is that past comparisons were run under small token budgets, which measure convergence speed rather than final representation quality. The article explains how to treat training budget as a first-class experimental variable, run a two-dimensional sweep over budget and masking ratio, and evaluate with downstream metrics. It also examines why classification and retrieval are hard to optimize together and outlines recipe adjustments such as mixed objectives, staged scheduling, and budget-dependent masking ratios. A practical checklist and conclusions are included for cost-sensitive inference settings.
1. The Misread “Fate” of Encoders
With generative large models dominating the conversation, bidirectional encoders are often labeled as previous-generation technology. In real engineering systems, however, their position is more secure: retrieval recall needs millisecond-level responses, data quality filtering must process massive numbers of samples, and reinforcement learning reward scoring requires high-frequency calls. These scenarios are extremely sensitive to latency and unit cost. A billion-parameter-scale encoder is often more cost-effective than calling a ten-billion-parameter generative model, and its results are not necessarily worse.
So the question becomes: why does the capability curve of encoders appear to peak earlier? The industry tends to attribute this to the architecture, assuming encoders lack the scaling benefits that generative models enjoy. But the training recipe itself is more deserving of suspicion—especially the 15% masking ratio in masked language modeling that has been used unchanged since 2018.
2. Optimal Conclusions Compressed into a “Small Budget”
Masked language modeling works by hiding some words in a sentence and having the model reconstruct them from context. The masking ratio determines the information density of a single training pass: if the ratio is too low, the task is too easy and the model fails to learn long-range dependencies; if it is too high, the context is too incomplete and reconstruction degrades into guessing.
The key issue is the source of evidence. Past systematic comparisons of the optimal masking ratio were mostly conducted under training budgets of 10 billion to 100 billion tokens. This scale is enough to judge “who converges first,” but not enough to judge “who is ultimately stronger.” An analogy is exam preparation: with only one week, the “efficient method” you identify may simply be effective for short-term cramming; with a full semester, the conclusion may completely reverse.
Therefore, small-budget experiments measure convergence speed, not the upper limit of representation quality. Treating convergence speed as optimality is a systematic bias at the recipe level.
3. Treating Budget as a First-Class Variable
To correct this bias, training budget needs to be elevated from an “experimental condition” to an “experimental variable,” using a two-dimensional sweep rather than single-point comparisons.
# Illustrative: two-dimensional sweep of budget x masking ratiobudgets = [1e10, 5e10, 2e11, 8e11] # token budgetratios = [0.15, 0.25, 0.35, 0.45] # masking ratiofor b in budgets:for r in ratios:run = train(model_cfg, tokens=b, mask_ratio=r,schedule="cosine", warmup="linear")log(b, r, eval(run)) # log downstream metrics, not just training loss
There are three key points. First, evaluation must be based on downstream task metrics; a fast drop in training loss does not mean the representations are usable. Second, the learning rate and schedule need to be adjusted in sync with the budget, otherwise optimizer issues will be misjudged as recipe issues. Third, keep fixed control points to make it easier to compare trends across budgets rather than absolute values.
4. Why Classification and Retrieval Are Hard to Achieve Together
Classification tasks focus on the global discriminability of sentence vectors, while retrieval tasks focus on relative distances and separability in the vector space. The two have different demands on representation geometry: the former wants compact intra-class and separated inter-class distributions, while the latter wants semantically similar samples to remain stably close in space and is extremely sensitive to how in-batch negatives are constructed.
When the budget is insufficient, the model tends to satisfy the easiest objective to optimize first, sacrificing the other and creating an appearance of “choosing one over the other.” This is not a fate determined by architecture, but the result of imbalanced training signal allocation.
5. Recipe Adjustments for Dual Objectives
Feasible adjustment directions include: mixed training objectives, so that masked reconstruction and in-batch contrastive signals act on the same encoder; staged scheduling, using reconstruction early to establish language structure and increasing contrastive and discriminative signals later; and adjusting the masking ratio along the budget gradient, moderately increasing it under small budgets to raise information density and reducing it under large budgets to avoid excessive context corruption.
# Illustrative: multi-objective mixing and staged schedulingdef loss_fn(out, labels, batch):mlm = masked_lm_loss(out, batch) # structural understandingcls = cross_entropy(out.cls, labels) # discriminabilityret = in_batch_contrastive(out.emb, temp=0.05) # retrieval-friendlyw = stage_weights(step) # early stage favors mlm, later favors cls/retreturn w[0]*mlm + w[1]*cls + w[2]*ret
6. Practical Checklist and Conclusions
For implementation, four points are recommended: use token budget as the horizontal axis to judge trends rather than pursuing single-point optima; select models by downstream metrics rather than training loss; jointly tune learning rate schedules and masking ratios; and introduce retrieval-friendly contrastive signals early in training to avoid irreparable issues later.
The conclusion is not complicated: the capability ceiling of encoders depends more on the scientific rigor of the training recipe than on architectural generations. By explicitly incorporating budget into experimental design and recalibrating masking ratios and multi-objective weights, classification and retrieval no longer have to be an either-or choice. In cost-sensitive inference scenarios, this kind of recipe-level optimization is often more cost-effective than stacking parameters, and it better fits the on-demand allocation of elastic compute in the cloud.
