CV Courseversity

Decision Theory and Utility

Develops rational-preference axioms, utility functions, expected utility maximization, and risk attitudes as the normative framework decision-theoretic AI agents use to choose actions under uncertainty.

“An autonomous vehicle's planner must decide, in the half-second before a rain-slicked intersection, whether to brake hard or ease through — and a hospital triage AI must decide whether the expected benefit of an extra diagnostic test outweighs its delay and cost. Neither decision has a certain outcome; both require weighing probable outcomes against how much each outcome is worth. This module gives you the mathematics of rational choice under uncertainty — utility functions, expected utility, and risk — that both AI systems and human decision-makers rely on to choose well.”

Rational Preferences and Utility Functions · 15 min

Decision theory, as the Stanford Encyclopedia of Philosophy frames it, studies "the reasoning underlying an agent's choices," and its dominant normative framework — expected utility (EU) theory — holds that "in situations of uncertainty, one should prefer the option with greatest expected desirability or value". The framework starts from a preference relation over outcomes or "prospects," which is considered rational only if it satisfies certain consistency axioms: completeness (for any two options, the agent can say it prefers one, prefers the other, or is indifferent) and transitivity (if A is preferred to B, and B to C, then A must be preferred to C), the basic requirements ruling out circular or gap-ridden preferences. MIT's graduate microeconomic theory sequence adds two further axioms needed specifically for choices involving risk: continuity and the independence axiom, which requires that mixing two lotteries with a third in the same proportions must preserve their original preference ordering.

The payoff of these axioms is the von Neumann–Morgenstern expected utility theorem: any preference relation satisfying them can be represented by a utility function u over outcomes such that one lottery is preferred to another exactly when it has higher expected utility, U(p) = Σ p(c)·u(c) summed over each possible consequence c. A worked example shows why this matters: suppose a decision-maker's utility for money follows u(x) = √x, and they must choose between a certain $50 and a 50/50 gamble between $100 and $0. The gamble's expected monetary value is 0.5(100) + 0.5(0) = $50, identical to the certain amount — but its expected utility is 0.5·√100 + 0.5·√0 = 0.5(10) + 0.5(0) = 5, strictly less than the certain option's utility of √50 ≈ 7.07. A rational agent with this utility function prefers the sure $50 despite the equal expected payoff.

That gap between the two options in the example is risk aversion, made mathematically visible: because √x is a concave function, its curve bends below the straight line connecting any two points on it, so a weighted average of utilities at two outcomes is always less than the utility of the weighted-average outcome. A linear utility function instead describes a risk-neutral agent (indifferent between the gamble and its expected value), and a convex utility function describes a risk-seeking agent (who would prefer the gamble). This is not merely a philosopher's abstraction — it is the same framework Russell and Norvig's foundational AI textbook uses to define a "rational agent" as one that chooses actions maximizing expected utility given its beliefs, making the choice of utility function itself a core design decision for any AI system operating under uncertainty.

Expected Utility Maximization and Decision-Theoretic Agents · 15 min

A decision-theoretic AI agent combines two ingredients: a probability distribution representing its beliefs about the world, and a utility function representing its preferences over outcomes, then chooses whichever available action maximizes expected utility, EU(a) = Σ P(outcome | a, evidence)·U(outcome), summed over every possible outcome of taking action a. A worked example: imagine an agent deciding whether to carry an umbrella, with P(rain) = 0.3. Suppose the agent assigns utility +5 to carrying an umbrella in the rain (mild hassle, stays dry), +3 to carrying one when it doesn't rain (hassle only), −10 to going without one in the rain (soaked), and +10 to going without one when it's dry (maximally convenient). Then EU(carry) = 0.3(5) + 0.7(3) = 1.5 + 2.1 = 3.6, while EU(no umbrella) = 0.3(−10) + 0.7(10) = −3 + 7 = 4.0 — so, given these specific utility values, the expected-utility-maximizing choice is to leave the umbrella behind, illustrating that the "obviously safe" choice is not always optimal once utilities, not just probabilities, are taken into account.

Berkeley's introductory AI course formalizes this reasoning with decision networks (also called influence diagrams): Bayesian networks extended with two new node types, decision nodes representing the agent's choice and a utility node representing the payoff, so that the network directly computes "the action which maximizes the expected utility given the evidence". Because the network already encodes the agent's probabilistic beliefs as a Bayes net, adding decision and utility nodes lets the same machinery used for probabilistic inference double as a planner: querying the network for the expected-utility-maximizing setting of the decision node is a direct extension of ordinary Bayesian inference. These networks also support computing the value of perfect information (VPI) — how much expected utility would improve if the agent could learn some currently-unknown variable before acting — and a key, non-obvious property is that VPI is always nonnegative (learning more can never hurt an expected-utility maximizer, since the agent can always simply ignore new information) yet nonadditive (the value of learning two facts together need not equal the sum of their individual values, because the facts may be redundant or synergistic).

This same expected-utility machinery reappears, often unlabeled, throughout machine learning: a "loss function" is simply negative utility, and "expected risk minimization" — the standard training objective for a supervised learning model — is expected utility maximization under a different name, minimizing the expected loss over the data distribution rather than maximizing expected payoff over an outcome distribution. Framing model training this way clarifies why the choice of loss function is not a mere implementation detail but a genuine value judgment: choosing mean-squared-error versus cross-entropy versus a custom asymmetric loss is exactly the same kind of choice as choosing a concave versus linear utility function in classical decision theory, since both encode how costly different kinds of mistakes are considered to be. A fraud-detection model, for instance, might use an asymmetric loss that penalizes a missed fraud case far more heavily than a false alarm — precisely the same design move as an agent adopting a highly risk-averse utility function over financial outcomes, and both are decisions about values, not just mathematics.

Practice

Expected Utility at a Glance

Umbrella Decision: EU(action) = ΣP(outcome)·U(outcome) A Carry No carry EU = 0.3(5)+0.7(3) = 3.6 EU = 0.3(−10)+0.7(10) = 4.0 P(rain) = 0.3 — the higher-EU action wins, even if it feels riskier.

Expected utility for two candidate actions under 30% chance of rain; the action with higher EU is the rational choice even though it forgoes the umbrella.

  • Rational preferences must be complete and transitive; adding continuity and independence yields the von Neumann–Morgenstern expected utility theorem.
  • Risk aversion has a precise mathematical signature: a concave utility function, which makes the expected utility of a gamble lower than the utility of its certain expected value.
  • A machine learning loss function is negative utility in disguise — minimizing expected loss is expected utility maximization by another name.

Recall Practice

AxiomsClick to reveal
A trading AI's preferences violate transitivity — it prefers Stock A over B, B over C, but also C over A. What problem does this create?
The preference ordering is irrational by decision theory's own standard: it is circular, meaning there is no consistent utility function that could represent it, and the agent could be exploited into a cycle of trades that leaves it worse off.
Risk attitudesClick to reveal
A self-driving car's planner assigns a strictly concave utility to travel time saved. What does this imply about how it will handle a risky shortcut with the same expected time savings as a safe route?
It will prefer the safe route — concave utility signals risk aversion, so the sure/predictable outcome is preferred over an uncertain gamble with the same expected value.
Decision networksClick to reveal
A medical AI is deciding whether to order an extra diagnostic test before recommending treatment. What decision-theoretic quantity tells it whether the test is worth ordering?
The value of perfect information (VPI) for the test result — since VPI is always nonnegative, ordering the test can never lower expected utility, but its value must be weighed against the test's cost and delay.
ML connectionClick to reveal
Why might switching a model's loss function from mean-squared-error to an asymmetric loss (penalizing underestimates more than overestimates) change what the 'optimal' prediction looks like?
Because the loss function encodes utility/cost, and different utility functions over the same outcomes can favor different actions — an asymmetric loss makes the expected-loss-minimizing prediction shift toward avoiding the more costly error type, exactly as a different utility function changes an expected-utility-maximizing choice.

Glossary

Preference Relation
An ordering over outcomes or lotteries expressing which the agent finds more desirable; rational preferences must be complete and transitive.
Utility Function
A numerical function u(x) representing an agent's preferences, such that higher values correspond to more preferred outcomes.
Expected Utility
EU(a) = Σ P(outcome|a)·U(outcome), the probability-weighted average utility of taking action a; the quantity a rational agent maximizes.
Risk Aversion
A preference for a certain outcome over a risky gamble with the same expected value, mathematically signaled by a concave utility function.
Decision Network
A Bayesian network extended with decision and utility nodes, used to compute the expected-utility-maximizing action given evidence.
Value of Information (VPI)
The expected improvement in utility from learning an unknown variable before acting; always nonnegative but not additive across variables.
Practical Activity

Computing Expected Utility on a Supplied Decision Table

This is a virtual, paper-based exercise using a small supplied decision table (an action, a probability of rain, and four hand-assigned utility values for each action/outcome combination — no real weather data or live software involved). Learners compute the expected utility of each candidate action by hand and determine which action an expected-utility-maximizing agent would choose.

Ready to test yourself?

5 questions on this module.

Start Quiz