Debug a Transformer bug in an unfamiliar repo
You are presented with an unfamiliar GitHub repository containing a Transformer model implementation. The interviewer states there is a bug leading to one of the following issues:
- Training loss diverges or becomes NaN.
- Model quality is significantly below expectations.
- Outputs violate causality in an autoregressive model.
- Shape or broadcasting errors occur silently.
Your objective is to efficiently locate and fix the bug without rewriting the entire project.
Explain:
- Your systematic debugging strategy.
- The minimal experiments or tests you would conduct to isolate the problem.
- The most frequent Transformer implementation bugs you would investigate first.
- How you would verify the fix and prevent future regressions.
AI interview prep
Core dilemma
Efficiently diagnosing and fixing a subtle bug in a complex, unfamiliar codebase under time pressure, balancing breadth of investigation with depth of analysis.
3 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Debug a Transformer bug in an unfamiliar repo
You are presented with an unfamiliar GitHub repository containing a Transformer model implementation. The interviewer states there is a bug leading to one of the following issues:
- Training loss diverges or becomes NaN.
- Model quality is significantly below expectations.
- Outputs violate causality in an autoregressive model.
- Shape or broadcasting errors occur silently.
Your objective is to efficiently locate and fix the bug without rewriting the entire project.
Explain:
- Your systematic debugging strategy.
- The minimal experiments or tests you would conduct to isolate the problem.
- The most frequent Transformer implementation bugs you would investigate first.
- How you would verify the fix and prevent future regressions.