AI Glossary / Graphs and symbolic AI / Advanced

Utility function

Definition

A utility function maps possible outcomes, states, or other objects of preference to numerical values that represent a decision-maker's preferences. Larger values indicate more preferred possibilities. When used in expected-utility decision-making, its numerical differences must also reflect preferences over uncertain alternatives, not merely the ordering of certain outcomes.

What it means

The function makes a preference model explicit. It may value a complete delivery outcome or combine attributes such as delay and resource consumption. It can be represented by a table, a formula, or a model whose parameters are elicited or learned.
The input matters as much as the formula. A function of cost alone cannot express a preference about service reliability unless that concern is represented through the input or another part of the model. Also specify whose preferences the function represents. A supplier, customer, and operator can reasonably evaluate the same outcome differently.

How it works

For certain outcomes, a utility representation preserves preference order: if outcome A is preferred to B, then U(A) exceeds U(B). Any strictly increasing transformation preserves that ordering.
For uncertain choices evaluated by expected utility, the action score is the probability-weighted average of outcome utilities. A positive affine transformation, U'(o)=aU(o)+b with a>0, preserves these comparisons because expected utility transforms by the same scale and offset. An arbitrary increasing transformation need not preserve them.
Building a function therefore requires more than assigning convenient ranks. Determine whether the task only ranks certain outcomes or also compares lotteries. Check the proposed values against representative choices, including trade-offs and unfavorable possibilities. Domain restrictions, such as nonnegative inputs to a square-root formula, must be explicit.

Three practical examples

  • A meeting assistant assigns values to complete schedule outcomes using preferences about travel and disruption. A formula that treats every minute identically may fail when a meeting overlaps a fixed commitment, requiring a constraint or a richer outcome description.
  • A production planner scores combinations of throughput and rework. The team checks whether the proposed function overvalues high output when it arrives with a large burden of defects, rather than assuming two independently chosen scores can simply be added.
  • A game agent maps terminal outcomes to values. Changing the relative value of a draw can change which uncertain strategy it prefers, even though winning remains better than drawing and drawing remains better than losing.

Think of it this way

A utility function is a scoring rule attached to a clearly defined outcome. Its ranking says which finished result is preferred. Its spacing also matters when scores are averaged across uncertain results. Two rulers can order the same marks while spacing them differently enough to change those averages.

Worked example

Consider an invented preference model for uninterrupted leisure time during one weekend. Only three outcomes are possible: 0, 4, or 9 hours. All other relevant conditions are assumed equal. Option S guarantees 4 hours. Option L gives a 50% chance of 0 hours and a 50% chance of 9 hours.
With U(h)=h, option S has utility 4. Option L has expected utility 0.5 × 0 + 0.5 × 9 = 4.5, so this model prefers L.
Now consider V(h)=sqrt(h), defined here for nonnegative hours. The three outcome values are 0, 2, and 3. Their order is unchanged: 9 hours still beats 4, which still beats 0. But S now has utility 2, while L has expected utility 0.5 × 0 + 0.5 × 3 = 1.5. This model prefers S.
The difference is substantive, not a harmless relabeling of an expected-utility scale. By contrast, replacing V with W(h)=3V(h)+7 gives S value 13 and L expected value 11.5, preserving V's recommendation. Normalizing V by dividing by 3 also preserves it: S scores 2/3 and L scores 1/2.
These are illustrative preferences, not a claim that everyone's enjoyment follows a square-root law. Asking only which certain number of hours is preferred would not distinguish the two models.

Illustrative case study

In a fictional warehouse, a planning tool initially scores shifts using completed orders. Staff explain that two shifts with the same count can differ substantially: one finishes cleanly, while another leaves unresolved packing problems for the next team.
The designers expand the outcome description to include rework and test proposed utility values against concrete comparisons. They ask managers to compare both certain shifts and uncertain plans with different failure possibilities. Where views differ, they record the disagreement rather than averaging unrelated personal scales without justification.
The resulting function is versioned with its assumptions. After an operating change, the team repeats the preference checks. A stable formula is useful only while its inputs and values continue to represent the decisions the organization intends to make.

Common misconceptions and mistakes

“Any increasing transformation is harmless.” It preserves certain-outcome rankings, but can change expected-utility choices.
“A utility function must be linear.” Its shape depends on the represented preferences; linearity in probabilities does not require linearity in an outcome attribute.
“A weighted sum is always sufficient.” Interactions among attributes may require a more expressive model.
“Normalization establishes agreement.” Putting two people's scores between zero and one does not establish common preferences or interpersonal comparability.
“More decimal places make the preferences more accurate.” Numerical precision does not replace evidence about what the values should represent.

Business use

Use a utility function when automated choices need a documented preference model. Define the outcome space, applicable constraints, stakeholder perspective, and intended treatment of uncertainty before selecting a convenient formula.
Review representative decisions with domain experts and test sensitivity to uncertain parameters. Pay particular attention to omitted consequences and thresholds where a small change reverses the selected action. Preserve the reasons for the model's values so reviewers can distinguish a changed business preference from a software defect. A function that is easy to optimize may still be inappropriate if its recommended choices do not match the organization's intended trade-offs.

People also ask

Must the output be between zero and one?

No. That range can be convenient, but other scales are valid.

Can a utility function be learned?

Yes, though inferred preferences depend on the observations, assumptions, and learning method.

Is it a probability model?

No. It represents preferences; probabilities describe uncertain outcomes.

Check your understanding

Why do U and V agree on certain outcomes?

Answer: Both increase across the three possible hour values.

Why do they disagree on the lottery?

Answer: Their different spacing changes the probability-weighted averages.

Which transformation preserves V's expected-utility preference?

Answer: Multiplying by a positive constant and adding a constant, as in W.

Related terms

  • Utility
  • Expected utility
  • Preference elicitation
  • Objective function
  • ordinal preference
  • cardinal utility
  • risk aversion
  • multiattribute utility

Learn next

Elicit a preference between a certain outcome and a lottery. Then examine how attribute interactions limit the use of additive utility functions.

  • Utility

More in Graphs and symbolic AI

  • Type signature - A type signature specifies the types of inputs and outputs associated with a function or operation.
  • UCB1 - UCB1 is a multi-armed bandit algorithm that selects an action using its average observed reward plus an exploration bonus.
  • UCT - UCT is a method for guiding Monte Carlo tree search by applying upper-confidence-bound ideas at decision nodes.
  • Łukasiewicz logic - Łukasiewicz logic is a family of many-valued logics associated with Jan Łukasiewicz.
  • Unary constraint - A unary constraint is a rule that restricts the allowed values of one variable in a constraint satisfaction problem.
  • Unbounded cost search - Unbounded-cost search seeks a valid solution without requiring its cost to fall below a specified threshold or within a specified factor of the best...

Sources

Poole and Mackworth, Preferences and Utility: https://artint.info/3e/html/ArtInt3e.Ch12.S1.html University of California, Berkeley, CS 188, Utilities: https://inst.eecs.berkeley.edu/~cs188/textbook/vpis/utilities.html

Previous: Utility Next: Utility independence

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer