Paying Down Rarity Debt When Adapting Language Models to Informal Text

Language models learn common words well and rare words poorly. Every training step pushes the vectors of frequent words into shape, while a rare word's vector moves only on the few steps where that word appears, and a steady weight-decay pull shrinks it the rest of the time. When a model pretrained on edited text such as Wikipedia and books is adapted to tweets, the words that suddenly matter most are the ones it saw least: "ur", "smh", hashtags, slang, and the odd word fragments that informal spellings break into. Our hypothesis is that much of the formal-to-informal gap is this inherited under-training, which we call rarity debt, and not a lack of informal data. We further argue that standard continued pretraining repays the debt slowly, because it treats every vocabulary row the same.

We propose to measure each token's debt as the ratio of its frequency in the target informal corpus to its frequency in the formal pretraining corpus. During continued pretraining we then give high-debt embedding rows a larger learning rate and exempt them from weight decay, leaving the training loss itself unchanged. This per-token optimizer change differs from existing frequency-aware losses in two ways. It conditions on the shift between domains rather than on counts from one corpus, and it never downweights the grammatical glue words, which earlier reweighting work found harmful. The domain ratio also offers a principled way to separate legitimate slang (frequent in the target) from typos (rare everywhere), a distinction existing tail-reweighting schemes cannot draw.

Core Claim

Tokens whose informal-domain frequency far exceeds their formal-domain frequency begin continued pretraining with embeddings that are short, close to where they were initialized, and bunched together with unrelated rare tokens. These are the pathologies documented by FRAGE, which found rare words stay near the origin with unrelated rare neighbors, and by Bis et al. (2021), who showed rare tokens are pushed together into a narrow cone because they are almost never the prediction target. Pinto et al. (2024) showed that weight decay in particular slows rare-token learning while average loss looks healthy. On IMDB, raising decay from 0 to 1 nearly tripled token-balanced loss (0.066 to 0.163) while average loss barely moved (0.051 to 0.068).

We claim two things that can be falsified. First, per-token debt predicts which informal tokens stay poorly represented after standard domain-adaptive pretraining. Second, a debt-targeted optimizer reaches the downstream quality of full continued pretraining with substantially fewer steps, and ends higher at a matched budget. The gain must come from which tokens are targeted, not simply from removing weight decay on embeddings.

Relation to Prior Work

Two frequency-aware losses motivate the approach but also constrain it. Jiang et al. (2019) downweight frequent tokens in dialogue generation, and they report the resulting objective is unstable except as a fine-tuning stage. Gu et al. (2020) weight translation loss by token frequency under two rules: no weight falls below 1, and the average weight stays near 1. They also recommend a Chi-Square weighting that discounts the extreme tail on noisy data, because that tail is mostly typos. Both use static counts from a single corpus.

In the informal setting, Gu et al.'s advice turns against us, since the extreme tail relative to formal text is where slang lives. We keep their "do no harm" lesson by not touching the loss at all. We replace single-corpus counts with a cross-domain ratio.

Two papers join frequency and domain in ways that differ from ours. FRAGE treats popular versus rare words as two "domains" and trains adversarially so a classifier cannot tell their embeddings apart. It does this within a single corpus, with a fixed 20/80 split and an unstable minimax trade-off. We handle a real domain shift with no adversary. CAI repairs vocabulary and frequency gaps for sparse retrieval by expanding the vocabulary and applying inverse-document-frequency weights at inference time, and only on formal biomedical and scientific shifts. We change training dynamics for an encoder on informal social text.

The informal-domain papers supply the evidence and evaluation. Saphra (2016) found that GloVe trained on 121GB of tweets places informal variants near their formal counterparts only 11% of the time at top-1 (24% at top-20). That suggests more data alone does not fix the representations, though the result concerns static word vectors and not transformers. Sarkar et al. (2021) built fBERT by continued masked-language-model training on 1.4M offensive tweets from SOLID, raising HatEval Macro F1 from 0.483 to 0.596. That is the recipe we modify. Xiong et al. (2019) show TWEETQA shares only about 10% of its vocabulary with SQuAD, and that BERT trails humans there (69.6 vs 78.2 BLEU-1).

Ovalle et al. (2024) supply a method we reuse as a baseline and a constraint. Updating only the embedding layer matched full fine-tuning for neopronouns, which suggests the lexical layer is where much of the rare-token problem sits. Ren et al. (2024) warn that retraining on unfamiliar styles can erode general ability, so we track forgetting.

Method

Let $c_S(w)$ and $c_T(w)$ be the relative frequencies of subword token $w$ in a formal source sample and the informal target corpus. Because the exact pretraining mix is not public, the source sample is an English Wikipedia sample tokenized with the model's own tokenizer. We define the debt as

$$d(w) = \max\left(0,\ \log\frac{c_T(w)+\alpha}{c_S(w)+\alpha}\right),$$

where $\alpha$ is a small smoothing count. Because $d(w)$ is large only when a token is common in the target, one-off typos get $d \approx 0$ automatically, which addresses the typo-versus-slang tension left by Gu et al.

During continued pretraining, embedding row $w$ (tied input and output) gets learning-rate multiplier $m(w)$ and weight decay $\lambda(w)$, given by

$$m(w) = \min\left(1 + \beta\, d(w),\ m_{\max}\right), \qquad \lambda(w) = \lambda\, e^{-\gamma\, d(w)},$$

with $\beta$, $\gamma$, and $m_{\max}$ as three scalar hyperparameters and $\lambda$ the standard decay. All transformer layers and the loss are unchanged, so zero-debt tokens train exactly as in the baseline.

Research Program

The work proceeds in three stages. The first stage is diagnostic. On BERT-base and RoBERTa-base we measure, for every vocabulary token, its debt, embedding norm, and distance moved from pretrained initialization during standard fBERT-style continued pretraining. We also measure the Saphra UrbanDictionary variant-pair retrieval accuracy, computed with contextual token embeddings averaged over occurrences. If debt does not predict post-adaptation representation quality, the premise fails and we stop.

The second stage is the intervention: the debt-targeted optimizer run on SOLID, compared against baselines at matched step budgets from 10% to 100% of the fBERT schedule.

The third stage is analysis. It asks whether gains concentrate on examples containing high-debt tokens, and whether general-domain ability is preserved.

Baselines

The naive reference point is the pretrained model fine-tuned directly on each downstream task, with no continued pretraining. For HatEval, Sarkar et al. (2021) report vanilla BERT at 0.483 Macro F1.

The strongest existing method is fBERT-style domain-adaptive pretraining: standard masked-language-model training of the whole model on SOLID. The reported numbers are Macro F1 of 0.596 on HatEval, 0.813 on OLID and 0.878 on HS & O. We reproduce it with the same data, tokenizer, schedule and downstream fine-tuning protocol, and compare against our reproduction, not the published figures. Beating it means either of two outcomes, each averaged over at least five seeds with confidence intervals. One is matching its HatEval Macro F1 with at most half the continued-pretraining steps. The other is exceeding it at the full budget by more than seed variance, without losing GLUE dev accuracy.

The frequency-aware loss baseline applies Gu et al. (2020) Exponential and Chi-Square weighting, computed from target-corpus counts, during the same continued pretraining. It receives the same hyperparameter search budget as our three scalars.

The lexical-only baseline follows Ovalle et al. (2024): it freezes the transformer and trains only embeddings on SOLID.

A post-hoc baseline applies mean-centering from Bis et al. (2021) to the fBERT-style model.

Two ablations isolate the key ingredient. The first, "decay off," removes weight decay and raises the learning rate for all embedding rows uniformly, matched to our average multiplier. The second, "shuffled debt," keeps the exact distribution of per-token multipliers but assigns them to random tokens. We also run the method with only the learning-rate term and only the decay term, and variants where debt is replaced by target frequency alone or source rarity alone.

Why not just…?

Why not just pretrain longer on more tweets? This is the fBERT baseline taken to its limit. It may eventually close the debt, and our claim is partly about how fast that happens. The step-budget curves settle this directly. If standard training reaches our final score within a small constant factor more steps, the contribution shrinks to an efficiency trick, and we will report it as such. Saphra's 11% top-1 result argues that scale alone leaves representations poor, but it concerns GloVe, not transformers, so we treat it as suggestive only.

Why not just turn off weight decay on the embeddings? This is the most serious threat. Pinto et al. (2024) point to decay as the culprit, so a uniform fix might capture most of the gain. The "decay off" and "shuffled debt" ablations exist to test this. If either matches the debt-targeted version, the domain-ratio idea is unnecessary and we will say so.

Why not just normalize tweets into standard English? Normalization erases persona and dialect markers, per Saphra (2016). fBERT deliberately kept mentions, emojis and hashtags because they carry toxicity signal. We include a normalized-input run on HatEval as a secondary reference, expecting it to lose on exactly the slang-bearing examples.

Why not just reweight the loss by frequency? Gu et al. (2020) and Jiang et al. (2019) report that loss reweighting destabilizes training or harms glue words. Using single-corpus counts also cannot tell slang from typos. The Gu baseline, run on target counts, tests whether this matters in practice.

Why not just center the embeddings afterward? Centering is one global shift. It cannot move a specific under-trained row toward its formal synonym. The centering baseline and the variant-pair retrieval metric show whether it closes the gap anyway.

Proposed Experiments

Continued pretraining uses SOLID, following fBERT. Downstream evaluation covers HatEval, OLID and HS & O (Macro F1) and TWEETQA (BLEU-1; the reported BERT figure is 69.6). Representation quality is measured by UrbanDictionary variant-pair top-1 and top-20 accuracy, and tail quality by Rare Words Spearman correlation. Forgetting is measured on GLUE dev.

The decisive checks are three. First, the diagnostic correlation between debt and post-adaptation embedding movement and pair retrieval must hold. Second, the debt-targeted model must beat both "decay off" and "shuffled debt" at matched budgets. Third, on HatEval and TWEETQA, the gain over the fBERT reproduction must be concentrated on examples whose tokens have high debt. We will test this by splitting test sets by the maximum debt in each example. A uniform gain across splits would suggest a generic regularization effect rather than repaid rarity debt. A missing gain on high-debt splits would refute the mechanism outright.