Skip to content

AI & ML · Machine Learning Math

Attention & transformer math

140 problems in this skill, each with a solver-verified answer key. Answers are checked the moment you submit — with a hint if you want one and a worked solution afterwards.

What the problems look like

A few statements from this skill. Answers, hints and worked solutions live in the practice session.

  1. Warm-up

    In one head of self-attention, a query q=(2,1,3)\mathbf{q} = (2, 1, 3) attends to a key k=(4,0,1)\mathbf{k} = (4, 0, 1). Compute the unnormalized attention score q⋅k\mathbf{q}\cdot\mathbf{k}.

  2. Warm-up

    In one head of self-attention, a query q=(4,2,2)\mathbf{q} = (4, 2, 2) attends to a key k=(2,3,4)\mathbf{k} = (2, 3, 4). Compute the unnormalized attention score q⋅k\mathbf{q}\cdot\mathbf{k}.

  3. Warm-up

    In one head of self-attention, a query q=(4,1,2)\mathbf{q} = (4, 1, 2) attends to a key k=(2,3,1)\mathbf{k} = (2, 3, 1). Compute the unnormalized attention score q⋅k\mathbf{q}\cdot\mathbf{k}.

Problems shown under their original terms: Generated (template, solver-computed).

Practice this free, right now

Unlimited math practice is on the free plan — no card, no trial clock.

See every Machine Learning Math skill for ai & ml