Do this only if the format matches
Confirm the round with recruiting first. This is an original practice exercise, not a claim that a specific company uses this exact prompt.
Protocol
- Choose one primitive and restate its tensor or graph contract before coding.
- Implement the smallest correct baseline without importing the target abstraction.
- Run the focused test, localize the first failure, and add two edge tests.
- State time, memory, and numerical behavior.
- Handle one changed constraint without replacing the design.
- Explain how the production implementation differs from the toy version.
Deliverables
- A passing implementation for each chosen primitive.
- Two candidate-written tests per primitive.
- A complexity and numerical-stability note.
- One production follow-up per primitive.
Graduation gates
Tests cover shape, edge behavior, and gradient or probability semantics.
Causal and incremental paths agree with full computation.
Frozen and trainable parameters are explicit.
You can explain every operation without framework magic.
Starter files
Set READMEExercise list and graduation rules.Open file →Decoder starterCausal attention and decoder block.Open file →KV-cache starterIncremental decode equivalence.Open file →Beam-search starterBounded hypotheses and EOS.Open file →LoRA starterFrozen base plus low-rank update.Open file →Autograd starterScalar computation graph and reverse pass.Open file →