Paper commentary
Online Label-Free Gradient Matching for Continual Language Model Training
OLGA distills unlabeled text streams into a small rehearsal memory for continual updates
- Problem Gradient matching needs ground-truth labels and runs once on a fixed snapshot of data. That makes it slow on large data and unable to follow a growing stream of text.
- Method OLGA takes its matching targets from the model's own next-token predictions instead of labels. Each arriving batch is distilled and merged into a running rehearsal memory capped at five examples.
- Results In the online setting, OLGA beats the strongest selection-based continual baseline by 6.6 stream-AUC points.

Figure 1 : Overview of the components of OLGA.(a)Synthetic text is generated by matching its training gradient to that of real data, alternating with a step that maps it back to real tokens.(b)A frozen language model’s next-token predictions replace ground-truth labels, so gradient matching works on unlabeled data.(c)A running rehearsal memory extends offline distillation to an online data stream. Each new batch is distilled together with the memory, which the model then retrains on.(d)Our hybrid design first uses cheap selection to shrink each batch, then distills what remains into the few examples kept, which cuts runtime on large data.
Original paper · CC BY 4.0 · Sajjad Pakdamansavoji, Mohammad Reza Rezaei, Ilija Subasic, Pedro Garzon, Radu Paradovschi, Zhao Chen · Online Label-Free Gradient Matching for Continual Language Model Training · Original paper figure · Extracted the figure area from page 4 of the original PDF.Why gradient matching stalls on text
Deployed language models need repeated updates because the traffic they serve drifts and the model falls out of step with it. The oldest examples contribute least, so paying for them again each cycle is hard to justify.
Gradient matching stalls in three places, and the paper names each one as an obstacle. Those small pixel steps don't work for the discrete tokens of text. The image remedies that cut this cost discard part of the real data, but they rank examples by their loss against a label.
Selection avoids synthesis, but it hits a ceiling at extreme compression. A real text sequence is an atomic unit that can't be perturbed below the token level. So no selection rule can manufacture variance that doesn't already exist in the chosen sample. Text distillation has its own gap, because GradMM places ground-truth labels in its objective.
Dataset distillation, first framed as bi-level meta-learning by Wang et al. (2018), used an unrolled inner training loop. Continual learning adds another pressure, since catastrophic interference overwrites earlier knowledge when new data arrives.
Targets from the model's own predictions
OLGA keeps labels out of the matching objective and takes the target from the frozen model's own predictions instead. GradMM's objective compares the gradient of a synthetic set with the gradient of the anchors, using one minus cosine similarity over the frozen parameters. The supervised loss is the cross-entropy of a single verbalizer token, so every example of a class trains toward the same token.
Because those gradients align and add up, a handful of synthetic examples can reproduce the anchor gradient closely.
customer-facing platforms mostly receive unannotated examples, so a single class label is hard to pin down. Instead, OLGA partitions the anchors into groups, using pre-logged metadata or unsupervised clustering. For each token, it computes a pointwise mutual information between the token and the group, comparing the group's average next-token probability with the average over all anchors.
It ranks the vocabulary by this score and keeps the top k tokens, so k is the only hyperparameter the construction adds. The group probabilities over those k tokens are normalized into a target q_g, and the loss is a soft cross-entropy toward it. Substituting this loss into the objective replaces the class label with a soft group distribution, which keeps the separation between groups.
The same matching objective also governs the online setting, where the target is the full history of blocks. Computing that set directly would require keeping the entire history, so OLGA approximates it block by block.
Folding batches into a rehearsal memory
A deployed system receives its data as a sequence of blocks, so the target set has to follow a moving history. At step t, the ideal synthetic set matches the gradient of everything seen so far, with at most m examples. Storage and per-step cost would then grow without bound as the stream lengthens.
OLGA instead distills each incoming block on its own, using the offline objective from before. The resulting set is merged into a running rehearsal memory through the same gradient-matching objective. The first memory is just the first distilled block, and each later memory is rebuilt from the new set and the previous memory. Each merge distills the union back down to at most m examples, so the memory never exceeds its budget.
Because each step touches only the new block and the current memory, the cost per step stays the same. The total cost therefore grows linearly with the stream length T, not with the full history.
The experiments set the memory budget to m=5, with 50 anchors arriving at each of ten steps. The merge doesn't depend on the loss, so the same procedure applies to both the supervised and label-free objectives. At T=5, the cascaded merge reaches 72.0 stream-AUC, compared with 70.2 for one-pass and 69.8 for history-weighted. One-pass pools the old memory with the raw new batch, while history-weighted reweights old and new gradients by data volume.
Selecting before distilling
Hybrid compression splits the work between a selection stage and a distillation stage. Gradient matching then distills that pool into the m examples the memory actually keeps. Selection suffices while the budget is still wide, because a well-chosen real subset covers most of the signal. Distillation is saved for the end, where one synthetic example can combine signal from many real ones.
In the paper's setup, B is 1,000, K is 50, and m is 5, so the pipeline reaches a 99.5% compression rate overall. The authors compare this Hybrid route with Direct, which drops the middle stage and goes from B straight to m. Double keeps both stages, but it runs the second stage the same way as the first. Uniform sampling does the selection by default, and the distillation stage runs GradMM or OLGA.
With labels, GradMM-Hybrid averages 86.0 percent, against 82.7 for GradMM-Direct and 73.9 for GradMM-Double. Both hybrid routes beat the selection-only routes on average, with OLGA-Hybrid at 80.0 against 73.4 and 66.6.
Uniform sampling also beats k-center as the selector, averaging 86.0 against 82.1. Uniform sampling is faster too, finishing in 436.1 seconds on SST-2 against 564.8 for k-center. Online, GradMM-Hybrid reaches an average stream-AUC of 78.4, leading GradMM-Direct by 3.1 points.
Offline accuracy with five examples
Each task starts from 50 real anchors, which are distilled into 5 synthetic examples, and phi-1.5 is fine-tuned on them. The reference points are an oracle that fine-tunes on all real data, and GradMM with ground-truth labels, which OLGA never sees.
It is narrowest on Rotten Tomatoes, at 4.1 points, with 74.5 against 70.4. On TwitterEmotion, which every method finds hard, OLGA reaches 56.5, on par with the competing methods. Even without labels, the distilled five examples train a model better than any real subset of the same size.
Appendix A2 lists the exact values behind Figure 2(a).
Stream-AUC over ten steps
The online runs stream 50 anchors per step into a rehearsal memory capped at 5 examples, over 10 steps and 8 for IMDB. Each arriving batch is distilled into 5 synthetic examples, which the cascaded merge then folds into the memory. The comparison covers four competing online methods: k-center greedy, herding, prototypical, and reservoir sampling.
Reservoir sampling keeps a uniform sample of all data seen, which makes it the plain real-data memory baseline.
OLGA finished 6.6 stream-AUC points above k-center greedy, the strongest competing method overall at 67.0 on average. Online GradMM finished 8.5 points above k-center, so the supervised variant leads the label-free one by under two points. The largest gain for both comes on RT-Polarity, at roughly 10 points over the best competing method there.
The label-free method is weaker on SST-2, where OLGA trailed by 4.2 points. On TwitterEmotion, OLGA only drew level with the best competitor, so the shortfalls sit on the label-free side.
Figure 2(b) shows the stream-AUC of the fine-tuned phi-1.5 on each dataset, and the averages are read from it. Exact values for Figure 2(b) appear in Appendix A3, which the authors give for lookup.
Hybrid runtime and accuracy
The hybrid route keeps accuracy in the offline setting while cutting distillation runtime, with labels and without them. With labels, GradMM-Hybrid averaged 86.0 percent across the five datasets, compared to 82.7 for GradMM-Direct and 73.9 for GradMM-Double. Without labels, OLGA-Hybrid trailed OLGA-Direct by only 0.9 points on average while running at 447.5 seconds, compared to 639.9.
The authors read this trade-off as putting the two routes on par, so the choice between them comes down to accuracy against time.
Both hybrid routes beat the selection-only routes on average, with GradMM-Hybrid and OLGA-Hybrid at 86.0 and 80.0. Those selection-only routes reached 73.4 for Selection-Double and 66.6 for Selection-Direct. Uniform sampling served as the selector in these routes, and it averaged 86.0 accuracy against 82.1 for k-center. Uniform sampling also ran faster on SST-2, at 436.1 seconds against 564.8 for k-center.
In the online setting, the hybrid route still leads, with GradMM-Hybrid averaging 78.4 stream-AUC. That is compared to 72.5 for the strongest selection-only route, a gap of 5.9 points. Hybrid distills only 50 examples at each step instead of 1,000, so the online gain comes at a much smaller distillation cost. The authors only ran this comparison on SST-2 and IMDB, since those are the only datasets large enough for a stream of ten steps.
Label-free signals and merge rules
The group-distribution loss is the signal that OLGA uses, and it is compared against two label-free alternatives. The self-information signal picks the token each sequence the frozen model predicted least well and uses it as the target. Figure 4 shows that group-distribution is the steadiest of the three as the budget grows. The alternatives also run up to five times slower than group-distribution, which the runtime panel in Figure 4 reports.
The merge rule is the second choice, and the cascaded merge distills each new block on its own before merging it into the memory. At T=5 steps, the cascaded merge averaged 72.0 stream-AUC, compared to 70.2 for one-pass and 69.8 for history-weighted. Both alternatives fold the new batch in a single pass, so the cascaded design differs by keeping the per-block distillation as a separate step.
Limits of the evidence
The experiments cover five text classification datasets, all run with phi-1.5 as the only model. Distillation matches only the gradients of the output layer, which avoids recomputing gradients for all 1.3B parameters at each step. The authors note that two different models could be used for distillation and fine-tuning without changing the method, but they didn't test this.
The ADMM solver runs for 30 outer iterations of 50 inner steps at a step size of 0.008.
The learning rate was picked per dataset from three values: 7×10⁻⁶, 1×10⁻⁵, and 1.5×10⁻⁵. Because the checkpoint and learning rate are chosen on the evaluation split, the reported accuracies may be optimistic. The offline comparison uses five competing methods, and the online comparison uses four.
On TwitterEmotion, OLGA reaches just 56.5 and only matches the competing methods, so the label-free gain doesn't hold there. The online setup uses 8 steps for IMDB instead of 10, which makes its stream-AUC not directly comparable with the other datasets.
The ablation comparisons were run at m=5, and the paper reports the group-distribution loss at 75.5 percent against 74.1 for pseudo-token. The merge comparison was run at T=5 steps, while the main online experiments used T=10 steps. The authors didn't test a stream longer than the ones they used, so the benefit of the cascaded merge at longer horizons is unknown.
Paper info
- Authors
- Sajjad Pakdamansavoji, Mohammad Reza Rezaei, Ilija Subasic, Pedro Garzon, Radu Paradovschi, Zhao Chen
- Venue
- arXiv · Preprint
- First published
- 2026-11-2
- Added
- 2026-11-4
- Updated
- 2026-11-2
- Version
- v1
- arXiv
- 2611.03496
- Category
- cs.AI · cs.CL
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Language models in customer-facing products must be continually updated, since the data they serve shifts over time. As retraining on the full accumulated data is impractical, each update should instead run on a small set of examples carrying the training signal of all data seen so far. The strongest current methods build this set by gradient matching, which synthesizes examples whose training gradients match those of the full data. However, they require ground-truth labels, run once on a fixed snapshot rather than on a growing stream, and are slow on large data. We introduce \textbf{OLGA}, which lifts these limitations. It distills unlabeled data by drawing the gradient matching targets from the model's own next-token predictions. Across five text classification benchmarks with phi-1.5, it improves accuracy by 10 percentage points over the strongest selection baseline using as few as five examples. OLGA also distills online data streams by keeping a running rehearsal memory of synthetic examples, which is re-distilled together with each new batch as it arrives. In the online setting, it outperforms the strongest selection-based continual baseline by 6.6 stream-AUC percentage points. Finally, our method scales to large data by pairing distillation with selection in a hybrid pipeline, letting selection handle the mild stage of compression and distillation the extreme one. It cuts runtime by 30\% versus distillation alone at similar accuracy, and beats the best selection-only pipeline by up to 12.6 percentage points.
Figures from the paper

Figure 2 : Across five datasets, OLGA beats every competing method on average in both the offline and online setups, and comes close to the supervised upper bound in the online one.(a)Offline methods reduce 50 real examples to 5, and we report the held-out accuracy of phi-1.5 fine-tuned on them.(b)Online data arrives over a sequence of steps, each method keeps a memory of only 5 examples, and we report stream-AUC, the area under the accuracy-versus-step curve.
Original paper · CC BY 4.0
Table 1 : Two synthetic examples distilled by OLGA, one per dataset. Each is generated as a mix of phrases from real examples, three of which are listed below it. A shared phrase has the same color in both places, and its superscript gives the number of the real example it comes from.
Original paper · CC BY 4.0
Table 2 : Comparison of the hybrid, direct, and double routes in the offline and online settings across 5 datasets. At each time step, the data is compressed in stages fromB=1,000toK=50tom=5. The offline setting runs a single step (T=1), and the online setting runsT=10steps. Runtime is the wall-clock time of one offline distillation run on SST-2. On average, the hybrid route beats the direct and double routes for both objectives in both settings, except offline without labels, where OLGA- Hybrid is on par with OLGA-Direct. Bold marks the best result in each column, and underline marks the reference that each colored difference is measured against.
Original paper · CC BY 4.0
Figure 3 :(a)How each gradient matching objective builds its loss from the model’s next-token distribution; the dots mark which position it reads.(b)Three ways to fold a new batch into the memory: compress it first, pool it with the memory, or weight the two by hand.
Original paper · CC BY 4.0
Figure 4 : Comparison of alternative label-free objectives.(Left)Accuracy against the number of examplesm, per dataset and on average.(Right)Number of distinct tokens each signal aims at, and runtime relative to group-distribution. Group-distribution leads atm=5, stays steady at larger budgets, and runs fastest.
Original paper · CC BY 4.0
Table 3 : Effect of the selector on the offline hy- brid pipeline, averaged over the five datasets.
Original paper · CC BY 4.0
Table 4 : Comparison of online memory-merging strategies, averaged over the five datasets.
Original paper · CC BY 4.0
Table 5 : Exact values for Figure 2(a), the offline accuracy of phi-1.5 on each dataset. The upper block gives the supervised upper bounds and the lower block the label-free methods. OLGA beats the best selection method on four of the five datasets and by 10.2 points on average. Bold marks the best label-free result in each column, and underline marks the reference that each colored difference is measured against.
Original paper · CC BY 4.0
Table 6 : Exact values for Figure 2(b), the online stream-AUC of phi-1.5 on each dataset. Oracle- accumulate keeps all data seen so far and gives the upper bound. OLGA beats the best competing method by 6.6 points on average and comes within two points of supervised GradMM. Bold marks the best result in each column apart from the oracle, and underline marks the reference that each colored difference is measured against.
Original paper · CC BY 4.0
Table 7 : Offline accuracy of phi-1.5 on each dataset atm=10, the counterpart to Table 5. The upper block gives the supervised upper bounds and the lower block the label-free methods. OLGA stays ahead of the best selection method by 1.7 points on average, but leads on only two of the five datasets. Bold marks the best label-free result in each column, and underline marks the reference that each colored difference is measured against.
Original paper · CC BY 4.0
Table 8 : Synthetic example distilled by OLGA forIMDB(positive), with the seven real examples it borrows its phrasing from. A shared phrase is highlighted in both places, and its superscript gives the number of the real example it comes from.
Original paper · CC BY 4.0
Table 9 : Synthetic example distilled by OLGA forRotten Tomatoes(negative), with the four real examples it borrows its phrasing from. A shared phrase is highlighted in both places, and its super- script gives the number of the real example it comes from.
Original paper · CC BY 4.0
Table 10 : Synthetic example distilled by OLGA forRT-Polarity(positive), with the three real exam- ples it borrows its phrasing from. A shared phrase is highlighted in both places, and its superscript gives the number of the real example it comes from.
Original paper · CC BY 4.0
Table 11 : Per-dataset version of Table 3, the offline accuracy of the GradMM-Hybrid route with uniform sampling or k-center as its selector. Uniform sampling is more accurate on every dataset and faster to run. Bold marks the better selector in each column.
Original paper · CC BY 4.0
Table 12 : Per-dataset version of Table 4, the online stream-AUC of OLGA under each merge strat- egy. The cascaded merge leads on three of the five datasets and on average. Bold marks the best result in each column.
Original paper · CC BY 4.0
Figure 5 : Feature discriminability (left) and gradient contrast (right) of each memory against its stream-AUC, one point per dataset and method. Neither property predicts how well a memory trains the model.
Original paper · CC BY 4.0Quote from the paper
Sajjad Pakdamansavoji, Mohammad Reza Rezaei, Ilija Subasic, Pedro Garzon, Radu Paradovschi, Zhao Chen (2026). Online Label-Free Gradient Matching for Continual Language Model Training. arXiv:2611.03496v1. https://arxiv.org/abs/2611.03496v1
BibTeX
@misc{pakdamansavoji2026online,
title = {{Online Label-Free Gradient Matching for Continual Language Model Training}},
author = {Sajjad Pakdamansavoji and Mohammad Reza Rezaei and Ilija Subasic and Pedro Garzon and Radu Paradovschi and Zhao Chen},
year = {2026},
eprint = {2611.03496},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.03496v1}
}