Dive into Deep Learning · §18
Checking and measuring released models
files · port · prompts · scoring · error bars · inside · behind an API
The problem
We can build a small GPT and load GPT-2 by hand. The models that people consult we can only download, and then three questions are ours to answer.
| question | why it is not obvious |
|---|---|
| What did we download? | the name of one model says 2B, and its file of 4.55 GB holds 2,274,069,824 numbers |
| Does it run the same in our code? | two correct programs do not agree to the last bit, and a wrong one may agree to the third digit |
| Is a difference between two scores real? | a score belongs to a model, a prompt, a rule for reading the answer and a sample of questions |
A released checkpoint becomes an instrument once we can answer all three.
Goals
Running example: open checkpoints of 0.6 to a few billion parameters on one GPU with 24 GB; 500 science questions and 100 arithmetic problems.
Idea: know what the files hold, run the tensors yourself, and put an error bar on every score.
Chapter map
| movement | section | question |
|---|---|---|
| open a checkpoint | Pretrained Models with Hugging Face | what is in a checkpoint, and what does it cost to run? |
| A Released Checkpoint in the Book’s Own Code | do its tensors run the same in our code? | |
| measure it | Prompting and In-Context Learning | how much does the prompt decide? |
| Scoring Language Models | which convention gives which score? | |
| Evaluation Suites, Judges and Error Bars | is a difference real? | |
| inside and outside | Interpretability | how is a claim about the inside tested? |
| Models behind an API | what does a hosted model withhold? |
d2l.GPT with GPT-2’s weights, the key-value cache.