liveBook · Manning

Argmax

An operation that returns the argument, often an index, at which a function or collection attains its maximum value.

How 2 Manning books explain it

LLMs in Production

Argmax is the operation that returns the position of the maximum value in a set or vector.

How it is used
Uses argmax as a next-token selection option during language-model generation.
How deep it goes
Explains highest-logit selection and its role in temperature handling, without detailing the algorithm's implementation.
Examples
Uses the prompt “I am a” to illustrate token logits and probabilities, and contrasts argmax with multinomial sampling.
What you can do after
Apply argmax to select the highest-logit token as the next token instead of sampling among alternatives.

Read how LLMs in Production explains argmax →

Learn Generative AI with PyTorch

How it is used
Turns multicategory model outputs into predicted class labels for clothing images.
How deep it goes
Shows the returned maximum position in prediction code, without developing argmax beyond this classification use.
Examples
Uses ten clothing classes and five test images whose predicted numerical labels match the actual labels.
What you can do after
Apply via PyTorch to convert batch class scores into predicted labels and compare them with targets.

Read how Learn Generative AI with PyTorch explains argmax →

Also covered in

What to know first

Related concepts

Questions about argmax

What is argmax?

An operation that returns the argument, often an index, at which a function or collection attains its maximum value.

Which Manning books explain argmax?

LLMs in Production and Learn Generative AI with PyTorch.

What should I know before learning argmax?

Manning books that teach argmax usually introduce language model, softmax, array and vocabulary first.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.