Skip to content

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.

Advanced ~12 min8 steps

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

01

Four ways to start from a model

Read

Open 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:

02

The four choices

Read
ChoiceWhat trainsUse it when
Adapt to new dataA small adapter: LoRA, BitFit or the output layerYou have fewer new rows than the model was trained on, or little time
Continue trainingEvery weight, starting from the model'sNew rows keep arriving and the old ones still matter
Distill into a networkA new network that copies the modelYou want a smaller, faster model; the teacher can be any learner
CompressNothing: the model's weights are pruned and/or stored in 8 bitsYou want a smaller file and want to know what that costs
03

Where a model came from

Read

The 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.

04

Adapting: few weights, same start

Read

An 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.

05

Continuing without forgetting

Read

Training 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.
06

Predict: what an anchor does

Predict

Predict 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?

It stays closer to the old modelIt moves further from the old modelNothing changes
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.

07

Distilling: a small student copies a teacher

Read

A 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.

08

Compressing: smaller, then measured

Read

Pruning 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