Mini Checkpoint — Adaptation and RL Foundations
Complete this checkpoint after L8.7.
1. Choose the intervention
For each case, choose prompting, retrieval/tooling, application logic, or fine-tuning and justify the choice:
- a policy changed this morning;
- JSON must contain exactly three required fields;
- a model repeatedly uses the wrong stable response convention despite a clear prompt;
- refunds above a fixed amount require human approval.
2. Design and protect instruction data
Create an easy example, a boundary example, and an abstention example. Then explain how you would preserve provenance and keep all rows from one source conversation on the same side of the train/validation split.
3. Mark SFT loss positions
For a sequence containing system instruction, user input, assistant marker, response, and EOS, identify which token positions contribute under response-only loss. Explain why prompt tokens still influence the forward pass.
4. Compare full fine-tuning with PEFT/LoRA
For a 512 by 512 layer with rank 8, calculate:
- full matrix parameter count;
- A and B shapes;
- LoRA trainable parameter count;
- LoRA/full ratio.
Then state what remains frozen and what still participates in computation.
5. Trace a LoRA update
Explain the path:
x -> A x -> B(Ax) -> scale -> add to W x
State what should happen when adapter scale is zero.
6. Explain the RL loop
For a two-action game, identify:
- agent;
- environment;
- observation/state;
- action;
- reward;
- policy.
Then explain exploration versus exploitation and why a large immediate reward may not imply the best longer-term return.
Check your reasoning after you try
- Recent changing knowledge usually fits retrieval/tooling; exact output rules and approval thresholds fit application logic; a stable behavior convention that prompting does not fix may justify fine-tuning.
- Related records should be grouped before splitting so near-duplicate context does not leak across train and validation.
- Response-only loss counts selected assistant-response positions while prompt tokens still provide context.
- A 512 by 512 matrix has 262,144 parameters. Rank-8 LoRA uses 8 by 512 and 512 by 8 factors, totaling 8,192 trainable parameters, or 3.125% of the full matrix.
- Scale zero removes the adapter correction but leaves the base path.
- RL repeatedly observes, acts, receives reward, and updates what it believes or how its policy behaves. Exploration gathers information; exploitation uses the current best estimate.
Pass condition
You are ready for L8.8 when you can protect the adaptation data boundary, explain SFT and LoRA mechanics, and describe the RL interaction loop without starting from equations.
Completion is stored locally on this device.