r/deeplearning • u/Abject_League6170 • 29d ago
Developing intuition for model behavior, architecture choices, and convergence?
Hi everyone, this is my first post so m kind of nervous đ ,
I recently built a Transformer from scratch and trained it for English-to-French translation,trying to recreate Attention Is All You Need with a 30M and 60M model. The 60M model has less data diversity.(wmt dataset)
Even though I can see the model performs decently, I go all over the place trying to explain my point when I try to interpret it. I am struggling with these specific conditions:
- When using interpretation tools (e.g., attention visualization, logit lens, even linear probing): I cant seem to understand where the failure modes are, or what's driving the model to perform so well like having a concrete idea to explain model behaviour.
- When modifying the architecture (e.g., adding something like a residual stream):How do u develop the skill to understand or diagnose whats wrong with a models behaviour or know whether u need to add something to improve the model?
- When managing training dynamics (e.g., using a warmup scheduler and cosine decay): How do i know if a model converged or if the learning rate is just no longer high enough to do actual improvement? It feels like m leaving performance on the table.
I wanted to know from you guys how do u develop that overall intuition of knowing when something isnt really helping.
View all comments
1
u/Massive_Distance_616 29d ago
Welcome to first-post nerves building both a 30M and 60M from scratch and asking why rather than just what puts you ahead of most.
Attention visualization and failure modes. Attention maps show where the model looks but not whether that caused the output attention weights ignore the norm of the value vectors and the MLP updates that follow. More useful: categorise your translation errors first (sentence length, negation, word order, rare vocab). Then use the logit lens project the decoderâs residual stream at each layer onto vocabulary space and track the rank of the correct French token. If itâs rank 1 at layer 6 but drops to rank 25 at layer 10, something in those later layers is overwriting a correct early representation. That tells you where to look, not just that something went wrong.
Architecture changes. Write down the exact failure before adding anything: âthe model drops negation on sentences longer than 20 tokensâ is actionable; âperforms not as goodâ isnât. Then ask what existing mechanism should handle that and why it isnât. For a 30â60M model on WMT, degradation on medium-length sentences almost always points to optimisation or data quality, not a fundamental architectural gap. The diagnosis comes before the intervention.
Convergence vs. stale LR. Cosine decay naturally forces the loss to flatten because the LR approaches zero a flat curve near the end isnât proof of convergence. Test it: take a checkpoint from 80% through training, drop LR by 5Ă and run 500 more steps. If validation loss improves, you still had gradient signal; the schedule was just throttling it. Also track gradient norms if theyâre non-trivial but loss is flat, LR is the likely culprit. If both loss and norms are flat, check your training vs. validation gap: your 60M with less data diversity may be starting to memorise rather than stall.
One addition: supplement BLEU with chrF, which is more sensitive to morphological errors in French. Aggregate scores hide exactly the failure modes youâre trying to diagnose.