Module 09 Activity
Scenario
Use a pretrained encoder for a text classification task, and report it so a reviewer can judge it.
Task
- Pass a batch through one encoder block and confirm the shape is unchanged.
- Tokenise, pad and mask a small batch. Show that masked pooling differs from naive pooling.
- Freeze the encoder, cache the pooled vectors, and fit a classical head on them.
- Fine-tune end to end with the encoder at a much lower rate than the head.
- Evaluate both against the majority baseline.
- Split the metric by group and report per-slice accuracy.
Deliverable
A classification report with both approaches, the baseline, per-slice accuracy, and a limitation.
Check your work
- Input and output shapes match: a block enriches representations without resizing them.
- Naive and masked pooling give different vectors whenever padding is present.
- Frozen features train zero transformer parameters.
- Overall accuracy can look acceptable while one slice is substantially worse.
The slice rule
Decide the slices before looking at results. Choosing them afterwards is selection, not measurement.
