The operation the last eight years of AI are built on. Write it from scratch.
Implement attention(q, k, v, mask=None):
attention(Q, K, V) = softmax(Q Kᵀ / √d_k) V
q, k, v have shape (seq_len, d_k)mask, when given, is a boolean array of shape (seq_len, seq_len) where True means allowed and False means the position must not be attended to(seq_len, d_k)Three things this problem is actually testing:
√d_k. Without it, dot products grow with dimension, softmax saturates, and gradients vanish.Build the architecture on a canvas: place the components, configure them, connect them into a data flow, and write a short reason for each one. The AI reviewer grades your design against a rubric written specifically for this problem.
Minimum 5 components · needs a wide desktop screen