Objectives addressed:
Work through this notebook today to learn about what the outputs of a language model look like. You’ll see how it’s a token-by-token classification model.
The main objective is for us to understand the output of a language model. We’ll see that the output is a probability distribution over the vocabulary for each token in the sequence.
Logits in Causal Language Models
(name: u09n1-lm-logits.ipynb; show preview,
open in Colab)
This exercise addresses the following course objectives:
You may also found opportunities to demonstrate the following course objectives:
We’re going to do the same task as Discussion 1, but in code.
Start by picking one specific example from your Discussion 1 task. We’ll hard-code it for simplicity.
Write code that runs the “FlipFlop” experiment for your one example by calling an LLM API. Run the experiment 5 times (in a loop) and report the average initial accuracy and average accuracy after the “are you sure?”.
Notes:
Repeat the same experiment but running the model within your own notebook. Follow instructions on Hugging Face Chat Basics.
You might choose models like:
Write a Jupyter notebook with your code and experiment results.