Lesson 4 of 9 in this unit
Choose what experience to retain.
Compare reservoir, task-stratified and recent replay under a frequency shift, from the same neural checkpoint.
By the end: Distinguish receipt count, unique evidence and fitting work; compare retention and adaptation at matched memory and update budgets.
Prerequisites and path options
Why learn this? Choose retained experience using coverage and budget evidence instead of assuming that a larger replay count means more independent information.
Start with something concrete.
A calibration service now sees mostly a new device. Keeping only the latest receipts may erase evidence needed by the older devices that still arrive.
Try the interactive modelA 16-slot buffer is filled from 160 receipts that reuse 32 training examples. How many independent examples are guaranteed?
Change one thing. Watch what follows.
Loading this browser experiment…
Understand what changed.
A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.
The idea in everyday terms
A small memory determines which old examples a changing service can still learn from. Train the old device task, freeze its weights, and then compare new-only fitting with three replay choices. Each strategy starts from the same checkpoint.
What to watch in the experiment
Reservoir sampling keeps a sample of receipt positions; stratified sampling reserves space for each task; recent sampling keeps the last receipts. The stream repeats 32 training rows, so neither 160 receipts nor sixteen memory slots means that many independent observations. Both fitting strategies process 32 rows per update, but replay uses fewer new-task rows.
What this does not establish
Read old and new monitoring errors together. A new-task gain can accompany an old-task regression. Monitoring points never train the model but are repeatedly visible development evidence. Exported checkpoints preserve numbers, not authenticated histories. The cumulative project asks for matched budgets and a decision, and human review remains separate.
Open the full worked examples, calculations and limitations
This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.
A memory budget is a choice about evidence
A calibration service originally handles mostly older devices. Later, new devices dominate its receipts. The service must learn their different response without quietly degrading the older devices that still arrive. Keeping the latest sixteen receipts is inexpensive, but recent does not mean representative of every protected use.
The experiment has two authored tasks. Old devices use ; new devices use . Both x and y are dimensionless teaching quantities in approximately the range −1 to 1.5. A task tag of −1 or +1 tells the shared predictor which device family is present. Each family has sixteen training coordinates. The monitoring coordinates lie between them and never enter fitting.
Follow inputs through the model
Three hidden units each compute a weighted sum of x, the task tag and a bias, then apply tanh. The output is a weighted sum of those three values plus one bias. There are thirteen learned parameters: nine input/bias coefficients, three output weights and one output bias. All gradients use the preceding parameters before any value changes.
For one prediction, suppose the target is 0.5 and the output is 0.3. The error is −0.2, squared error is 0.04 and half-squared fitting loss is 0.02. Averaging those half-squared errors defines the training objective. The displayed monitoring mean squared error uses the full squared error, so it is twice the corresponding half-squared loss. Smaller is better; it is not an accuracy percentage.
Three buffers with the same capacity
The stream contains 160 receipts drawn repeatedly from the same 32 training rows. Its first half is 80% old-task receipts. With the shift enabled, its second half is 20% old. Time records stream order; repeated row IDs reveal reused evidence.
Reservoir sampling keeps a uniform sample of receipt positions: when receipt number n arrives, draw a position uniformly among n positions and replace a stored slot only when that position lies inside the buffer. Stratification runs a reservoir separately for each task and allocates half the slots to each. Recent selection simply keeps the final receipts. Uniform over receipts is not uniform over unique measurements, and a task-balanced buffer deliberately differs from the observed frequency.
Train 100 old-task updates, freeze that checkpoint, then compare 100 candidate updates. Changing a strategy restores the same baseline. New-only fitting uses 32 new-row uses per update. Replay uses sixteen new rows plus sixteen draws from its stored buffer. Thus both process 3,200 row uses, but new-only has twice the new-task exposure. Buffer construction, storage overhead and monitoring work are additional costs. The no-adaptation control performs no gradients.
Read the retention tradeoff
Compare both old and new monitoring errors. A lower new error alone does not establish successful adaptation. Inspect buffer membership when changing capacity or freshness; a retained receipt count does not establish an independent sample size. The bars share a fixed 0–2 MSE range and disclose clipping. Exact values and row identities remain available in the tables.
These are repeated public development measurements. The network is genuinely trained, but the exported checkpoint is not authenticated training history. Save matched comparisons in Project 14 and reproduce the reservoir mechanism in the implementation studio.
Replay uses 16 old/buffer and 16 new rows; new-only uses 32 new rows per update. What is matched?
Take this idea with you.
A memory policy chooses which evidence remains available. Match memory and work budgets, then measure both the new skill and retained behavior.
Explore related topics and the topic map
How this topic connects
Explore this topic on the interactive mapUse these connections to review a foundation or choose where to go next. You can open any topic without completing the others.
What it builds on
- Forgetting and replay
Protect an existing skill while teaching a model a new one, using explicit checks for regressions.
Compare reservoir, task-stratified and recent replay under a frequency shift, from the same neural checkpoint.
What it enables
- Update without silently changing the contract
Preserve the trained baseline, regression gates and rollback record when deciding whether a real candidate should replace a working model.