Argmax vs max: choice and value explained

A model produces three scores. One operation reports 0.91. Another reports class B. The numbers came from the same landscape, but the answers have different types. Confusing them is the small notation error behind many larger reading mistakes.

Max answers how high the best score is. Argmax answers where that best score occurs. In an optimization paper, where may be a parameter vector. In classification, it may be a class label. In reinforcement learning, it may be an action.

This distinction matters because a value cannot choose an action and an action cannot be differentiated as though it were a score. Reading the output type before manipulating the equation keeps the paper's data flow intact.

One landscape supports two questions

Imagine a table mapping each candidate to a score. The candidates form the domain and the scores form the output of an objective function. Max searches the score column. Argmax searches the candidate column using the score column as its ranking rule.

For scores A equals 0.2, B equals 0.9, and C equals 0.6, max is 0.9. Argmax is B. Saying argmax equals 0.9 swaps the objective value for the input that produced it.

Read the subscript aloud. Max over x of f(x) means find the largest value produced as x varies. Argmax over x of f(x) means find the x values at which that largest value is attained.

The open Convex Optimization book by Boyd and Vandenberghe distinguishes an optimal value from an optimal point. That typed distinction is the foundation beneath max and argmax notation.

Max returns the winning value

The maximum of a finite list is the member no other member exceeds. If the list is 2, 7, and 4, the maximum is 7. The operator has discarded which position held that value unless the surrounding system retains the mapping.

In reinforcement learning, max over actions of Q(s,a) returns the highest action value available in state s. Its output has the same kind of units as Q, often expected discounted reward. It is not itself an action.

In a probability model, max may return the highest assigned probability or the largest logit depending on what enters the operator. The input expression, not the word max, determines the scale and interpretation of the result.

Argmax returns the winning address

Arg is short for argument, meaning the input supplied to a function. Argmax returns the input or inputs that make the function as large as possible. Its output belongs to the search domain, not necessarily to the real numbers.

For a classifier, argmax over class labels of p(y given x) returns the predicted label. For a policy, argmax over actions of Q(s,a) returns a greedy action. For model fitting, argmax over parameters of a likelihood returns an optimizing parameter setting.

Sutton and Barto's Reinforcement Learning textbook uses maximizing action selection throughout value-based methods. Its equations make the output contract concrete: the values rank actions, while the policy ultimately needs an action.

Superscript star often labels the returned optimizer, as in x star equals argmax of f. The star is not what performs optimization. It only names the selected object, and in other contexts a star can mean conjugate, adjoint, or another special reference.

Type checking catches the swap

Write a two-column ledger before reading a dense objective. Put every candidate in the left column and its score in the right. Then label each downstream operation with the column it requires. A selector needs a candidate. A comparison threshold usually needs a score.

If x is a vector in R to the d, argmax over x may return a vector. If the search domain is a set of token sequences, the result may be a whole sequence. The fact that the objective is scalar does not make the optimizer scalar.

Shapes can reveal the same error in code-oriented papers. A class-score tensor may have one score per class, while an argmax along the class axis removes that axis and yields integer indices. The axis is part of the operator's meaning.

The Mathematics for Machine Learning text develops optimization as choosing parameters from a domain to minimize or maximize an objective. That domain-to-value map is the simplest mental model for the two operators.

Ties make argmax set-valued

If A and B both score 0.9, max remains the single value 0.9. Argmax is mathematically the set containing A and B. Writing only A silently adds a tie-breaking rule that the objective did not supply.

Software libraries often return the first maximizing index, a deterministic implementation choice. A policy might break ties randomly. A proof may permit any maximizer. These behaviors are not interchangeable, so inspect the algorithm or library contract.

A maximum also may not exist. A supremum can describe the least upper bound even when no point attains it. Introductory ML formulas often assume a finite candidate set or an objective and domain where an optimizer exists, but research proofs state these conditions carefully.

Use the choice-versus-value sandbox

Move the three candidate scores below. Predict both outputs before reading them. Then create a tie. The visualization keeps the height and address visible at once so the distinction remains mechanical rather than verbal.

Notice that changing a losing score may change neither answer. Raising it past the leader changes both. Matching the leader changes the argmax set without changing the max value. Those three cases are useful tests for any explanation of the operators.

After the sandbox, compare the semantic entries for argmax and maximum. A symbol page should record output type and tie behavior, not only pronunciation.

Where the simple picture stops

The bar chart uses a finite discrete domain. Optimization over continuous parameters may require calculus, convexity, numerical search, or approximation. Argmax still names the desired input, but computing it can be the central difficulty of the paper.

Argmax is not ordinarily differentiable as a discrete selection step. Softmax, sampling, straight-through estimators, and continuous relaxations address different training needs, but none is simply argmax with friendlier typography. Each changes the mechanism or gradient story.

A paper may also write arg top-k, beam search, or approximate maximization when one winner is insufficient or exact search is infeasible. Preserve qualifiers such as approximate and constrained because they change what claim the equation makes.

Frequently asked questions

Is argmax always one item

No. Several inputs can tie for the largest objective value. Pure mathematics usually treats argmax as a set. An implementation may apply a documented tie-breaker and return one element.

Does softmax approximate argmax

Temperature can make a softmax distribution more concentrated around large logits, but softmax returns normalized weights and argmax returns maximizing inputs. The two outputs have different types and serve different roles.

What does argmin change

Argmin returns the input producing the smallest objective. The value-versus-choice distinction is identical. Loss functions are usually minimized, while rewards and likelihoods are often maximized.

Carry the output type forward

Practice locating domains, objectives, and outputs in the Math Decoder curriculum, then apply the same ledger method to real equations in Fanout Daily.

When you encounter either operator, write two words in the margin: value for max, choice for argmax. Then check ties, constraints, axes, and approximations before carrying the result into the next line.