The part they really cared about was how you collapse the sequence of token embeddings into a single vector before the classification head.
Start by systematically reviewing the code from data loading through model definition, training loop, and prediction. Identify common bugs such as incorrect tensor shapes, missing normalization, wrong loss function, or improper masking. Then fix each issue, validate with a small dataset, and ensure the model trains and predicts correctly.
Pro tip: Always run a quick sanity check with a tiny dataset to catch shape mismatches and verify that the model can overfit a single batch before scaling up. This isolates bugs early and saves debugging time.
Check tokenization, padding, attention masks, and label alignment. Ensure inputs are correctly formatted and batched.
Verify the Transformer layers, embedding dimensions, and output layer match the task (e.g., classification head). Look for missing components like positional encodings or dropout.
Check loss function, optimizer, learning rate, and gradient updates. Ensure the model is in training mode and gradients are computed correctly.
Inspect inference code for correct model evaluation mode, no gradient computation, and proper post-processing (e.g., softmax, argmax).
Run the fixed code on a small subset, monitor loss and accuracy, and debug any remaining issues until the model trains and predicts as expected.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.