Syllabus Lesson 208 of 246 · Module 20: Adapting a trained model cheaply
Module 20: Adapting a trained model cheaply

Learning new, forgetting old

Why it matters Every useful model gets adapted: to a company's documents, a coding style, a language. The obvious way, keep training on the new data, has a cost nobody sees until it is too late: the model gets worse at what it knew.

The course's recorded GPT learned English from the course's lesson text. Its new job: Python code, taken from the Python course's worked solutions. Before training, it scores 1.70 on held-out English and 3.25 on held-out code (it has barely seen code).

Train every weight on code for 60 steps of 8 windows (the most that fits a lesson in the browser) and measure both again. Watch the scene first: the two losses, step by step, for this full fine-tune and for the cheaper method you will build in this module.

Predict first: after 60 steps on code, will the English loss stay about the same, or rise?

Your turn

Set my_guess to "same" or "rises". Fill before and after with adapt.losses(model) (English loss, code loss) around adapt.train(model, code_train, steps=60, batch=8).

Spotted a problem in this lesson? Report it · Ask about this lesson

This exercise opens soon

Finish the lesson before it and this one unlocks. The whole course is free, no account needed, and you can read this lesson right now.