Models from models: adapt, continue, distill, compress
Adapt a trained network to new rows, keep training it without forgetting, distill any model into a smaller network, or compress it. Each makes an ordinary run that remembers where it came from.
You will be able to
- Choose between adapting, continuing, distilling and compressing for a goal
- Explain how replay rows and an anchor protect what a network already learned
- Read a distilled or compressed run's score against its parent on the same rows
Read first
Four ways to start from a model
ReadOpen a finished neural-network run, or a registered version, and use Make a model from this (the branch icon). Each choice makes a normal Predict run, with folds, a leaderboard score and a final model, that starts from the model you picked:
The four choices
Read| Choice | What trains | Use it when |
|---|---|---|
| Adapt to new data | A small adapter: LoRA, BitFit or the output layer | You have fewer new rows than the model was trained on, or little time |
| Continue training | Every weight, starting from the model's | New rows keep arriving and the old ones still matter |
| Distill into a network | A new network that copies the model | You want a smaller, faster model; the teacher can be any learner |
| Compress | Nothing: the model's weights are pruned and/or stored in 8 bits | You want a smaller file and want to know what that costs |
Where a model came from
ReadThe run's Lineage tab shows what it came from, nearest first. A model that others were made from can't be deleted until they are, so every model keeps a record of its source. Erase everywhere removes the models made from an erased dataset's models too, because they carry its rows.
Adapting: few weights, same start
ReadAn adapter freezes the network and trains a few extra numbers. LoRA adds a low-rank update B·A to each weight matrix. B starts at zero, so training starts exactly at the old model. BitFit trains only the bias terms. Training the output layer too is the usual choice when the new target differs a little from the old one. The saved model has the update folded in, so it scores and explains like any other.
Continuing without forgetting
ReadTraining further on new rows can wipe out what a network learned before: catastrophic forgetting. Continue training has two guards:
- Replay rows: a sample of the model's own training rows trains again with the new ones. They are never scored.
- An anchor: a penalty for moving away from the old weights. L2-SP pulls every weight back equally. EWC pulls hardest on the weights that mattered most for the old rows, measured on the replay rows.
Predict: what an anchor does
PredictPredict first
You continue training a network with an anchor strength of 50 instead of 0. Compared with no anchor, where do its weights end up?
Reveal
Closer to the old model. The anchor adds a cost for every step away from the old weights, so the network fits the new rows only as far as that cost allows.
Distilling: a small student copies a teacher
ReadA student network trains on soft targets: the teacher's predicted probabilities, blended with the true labels. Probabilities carry more than the right answer. A teacher that says "70% churn, 30% stay" tells the student the case was close. The temperature flattens those probabilities so small ones count more. The teacher can be any learner, a gradient-boosted ensemble included.
Compare the student with its teacher on the same rows. If the student loses little, you can serve the smaller model.
Compressing: smaller, then measured
ReadPruning sets the smallest weights to zero, one share across all weight matrices; the output layer is kept whole. 8-bit weights store each weight as a whole number from −127 to 127 with one scale per row of weights. Without fine-tuning nothing trains, so every fold scores the same compressed network. On the model's own training rows that score is optimistic; choose rows it didn't train on. Fine-tune after pruning trains the kept weights for a few epochs in each fold while the pruned ones stay zero, which wins back some accuracy; 8-bit rounding then comes last.
Check yourself
Your best model is a large gradient-boosted ensemble that is too slow to serve. Which choice fits?
Show the answer
Answer: b
Distillation works from any teacher, so a small network can learn to copy the ensemble's predictions. Adapt and Compress start from a neural network's own weights.
Check yourself
You erase a dataset everywhere. A model trained on it was adapted to other rows. What happens to the adapted model?
Show the answer
Answer: a
The adapted model starts from the erased model's weights, so it still carries what that model learned. Erase everywhere lists it under "Models made from these".
Concepts in this lesson