arg⁡max⁡\arg\max

argmax — position of the largest

Read "arg max". It gives the position (index) of the largest value, not the largest value itself.

max⁡kzk\max_k z_k is the biggest logit. arg⁡max⁡kzk\arg\max_k z_k is which token has it. Greedy decoding outputs the arg⁡max⁡\arg\max token at every step.

The difference shows up in the safe softmax too: there you subtract max⁡kzk\max_k z_k, the largest value, from every logit to prevent overflow.

Example

z=[0.1, 3.2, 1.5]:max⁡kzk=3.2,arg⁡max⁡kzk=2\mathbf{z} = [0.1,\, 3.2,\, 1.5]: \quad \max_k z_k = 3.2, \quad \arg\max_k z_k = 2

Counting positions from 1. The largest value is 3.2; it sits at position 2.

Where the course uses it

Related terms