NumPy allowed · plain Python earns 10 bonus points
Q · Kᵀ / √d scores normalized with softmax
Implement the core scaled dot-product similarity score that powers transformer attention.
Implement attention_score(q, k) that computes dot(q, k) / sqrt(d_k). This is the fundamental score in every transformer attention layer.
attention_score(q: list[float], k: list[float]) -> float