Research Engineering & Debugging · Problem 3 of 8
Write unit tests for causal masking (no token may attend to the future).
Implement the function/class skeleton in the editor. Any correct approach is accepted.
import torch
def test_causal_no_future_leak(model, vocab=100, T=8, seed=0):
raise NotImplementedError
def test_causal_mask_is_triangular(attn_weights):
raise NotImplementedErrorReady when you are
Submit your solution and a structured review appears here — verdict, score, and concrete feedback. Any correct approach passes.
Write unit tests for causal masking (no token may attend to the future).
Implement the function/class skeleton in the editor. Any correct approach is accepted.