Algorithmadvanced
AGV mechanism
Also called d'Aspremont-Gerard-Varet mechanism, expected externality mechanism.
Picks the efficient outcome and pays each agent the expected welfare of the others given its report. With independent types it is BIC and exactly budget balanced, but not always IR.
- Time
- O((m + n) n k^n) worst
- Space
- O(n k) extra
- Where
- k = the number of types of each agent; m = the number of outcomes; n = the number of agents
- Model
- Word RAM
- Properties
- comparison baseddeterministiciterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Claude d'Aspremont, Louis Andre Gerard Varet, Kenneth J. Arrow, 1979
The AGV mechanism, after d'Aspremont and Gerard-Varet, picks the outcome of largest reported welfare and pays each agent the expected welfare of the other agents, where the expectation is over the others' types and the agent's own report is held fixed. The money for these payments is raised from the other agents, so the payments add up to exactly zero at every profile. With independent types, truth telling is a Bayes-Nash equilibrium, so the mechanism is Bayesian incentive compatible (BIC). It differs from the VCG mechanism in what it gives up: VCG is truthful in dominant strategies and runs a surplus or a deficit, while AGV balances the budget but is truthful only in expectation and can leave an agent with negative expected utility.
In plain words
A group must make one shared decision, such as building a road, and each member privately knows what the road is worth to them. No money may come in from outside or go out. Each member states a value, and the mechanism picks the decision that is best for the stated values. It then pays each member the average benefit that the others would get, guessed from what the member said and from what is known about the others in general. Each member pays an equal share of the amounts given to the others. A member who is paid for the others' benefit wants the group to choose well, and so tells the truth, at least when the others do. The payments cancel out, but a member with a low value can end up worse off than if it had stayed out.
The problem
There are agents and a finite set of outcomes. Agent has a private type from a finite set , drawn from a prior , and the types of different agents are independent. The value of agent of type for outcome is , which may be negative. Utility is quasilinear: if the outcome is and agent pays , its utility is . A negative is a transfer to the agent.
The goal is a direct mechanism that maps reports to an outcome and payments such that:
- the outcome maximizes the reported welfare (efficiency),
- at every profile (strong budget balance),
- truth telling is a Bayes-Nash equilibrium (BIC).
By the Green-Laffont theorem, no mechanism has all three properties with dominant-strategy truthfulness on a rich domain of valuations, so BIC is the price paid for the balanced budget.
The algorithm
AGV(T, f, O, v, b)- 1
h_i(t) ← 0 for each agent i and each type t in T_i - 2
for each type profile t in T_1 × ... × T_n: - 3
o ← the first outcome in O that maximizes Σ_j v_j(t_j, o) - 4
for each agent i: - 5
h_i(t_i) ← h_i(t_i) + Pr[t_-i] · Σ_{j ≠ i} v_j(t_j, o) - 6
o* ← the first outcome in O that maximizes Σ_j v_j(b_j, o) - 7
for each agent i: - 8
p_i ← (1 / (n - 1)) Σ_{j ≠ i} h_j(b_j) - h_i(b_i) - 9
return o*, p
Here . Lines L1 to L5 depend only on the prior and the valuations, not on the reports, so they can run once before any agent reports. After the loop, is the expected externality term
the expected welfare of the others when agent reports and the others tell the truth, where is the rule of line L3. Line L8 gives agent the amount and charges it a share of what the others get. Lines L3 and L6 must break ties in the same way, here by the order of ; the proof below needs to be computed with the rule that is actually applied.
Example
Three agents decide whether to build a project that costs 60. Each pays a share of 20 if it is built, so the value of agent is and . Each type is 10 or 35 with probability 1/2, independently. The project has positive welfare exactly when at least two agents have type 35, because and .
Lines L1 to L5 give the same table for every agent. For type 10, the others' welfare is positive only when both others have type 35: then it is , so . For type 35, the project is built when at least one other has type 35, and the others' welfare is , or , so .
| reports | outcome | utilities | |
|---|---|---|---|
| 10, 10, 10 | no | 0, 0, 0 | 0, 0, 0 |
| 10, 10, 35 | no | 5/4, 5/4, -5/2 | -5/4, -5/4, 5/2 |
| 10, 35, 35 | build | 5/2, -5/4, -5/4 | -25/2, 65/4, 65/4 |
| 35, 35, 35 | build | 0, 0, 0 | 15, 15, 15 |
For , line L8 gives agent 1 the payment , and agents 2 and 3 each . The three payments add up to 0, as in every row. The other four profiles are permutations of these rows.
Averaged over the others' types, an agent of type 35 who tells the truth expects , and if it reports 10. An agent of type 10 expects from the truth and from the report 35. So truth is the best report for both types, but the low type expects a loss. The total of the expected utilities, , equals the expected welfare of the efficient decision, as budget balance requires. The tests check all these numbers in exact arithmetic.
Correctness
The full proof is in proofs/correctness.md. Efficiency holds because line L6 maximizes the reported welfare. Budget balance holds because in each appears times, so the sum is and cancels the second term.
For BIC, fix agent with true type and let the others tell the truth. Report gives the expected utility
where does not depend on . Independence is used here: the distribution of is the same whatever is, so the computed from the prior is the expectation that agent itself forms. For each the true efficient outcome gives the largest true welfare, so maximizes the expectation. This is the Groves idea of paying each agent the others' welfare, applied in expectation; because depends only on agent 's own report, the payments can be recycled among the agents.
Proof: The AGV mechanism is efficient, strongly budget balanced and Bayesian incentive compatiblefull
The setting has agents and a finite set of outcomes. Agent has a type in a finite set , drawn from a prior , and the types of different agents are independent. The value of agent of type for outcome is . The utility is quasilinear: an agent who gets outcome and pays has utility . For a profile , write .
What the code computes
Let be the first outcome in the list that maximizes . Line L3 and line L6 both use this rule. Line L5 adds, for each profile and each agent , the term to , where . Each profile with is visited once by line L2, so after the loop
So is the expected welfare of the other agents when agent reports and the others report their true types. Line L8 sets, for the reports ,
Efficiency
Line L6 returns , which maximizes over by definition. When all agents report their true types, the outcome maximizes the true welfare. This holds at every profile, not only in expectation.
Strong budget balance
At every profile ,
In the double sum each index appears once for each , that is times. So the first term is , and the total is . The mechanism pays out exactly what it collects, at every profile and for any reports, true or not.
Bayesian incentive compatibility
Fix an agent with true type , and let the others report their true types , drawn from the prior. If agent reports , its expected utility is
The expectation over does not depend on , because the types are independent. This is where independence is used. The last term does not depend on . Call it . Put in the formula for :
For each fixed , the outcome maximizes over all of , and is one element of . So the term inside the expectation is at least as large for as for any other , pointwise in . Taking expectations, for every . Truth telling is a Bayes-Nash equilibrium, which is the definition of BIC.
The argument uses that was computed with the same outcome rule , tie rule included, that the mechanism applies. If line L3 and line L6 broke ties in different ways, the identity above would fail at the tie profiles.
What is not claimed
The proof gives a Bayes-Nash equilibrium, not a dominant strategy. If the others lie, is not the expectation that the formula needs, and a lie of agent can pay. The node page shows a profile of the public project example where a lie gains ex post. The mechanism is also not individually rational in general. In the same example the low type has interim utility under truth telling. Adding constants to the payments keeps BIC, and keeps budget balance only if , so constants cannot always repair interim IR; the Myerson-Satterthwaite theorem shows that in bilateral trade no BIC, budget balanced and efficient mechanism is interim IR.
Cost
Line L2 visits profiles, which is when each agent has types. For each profile line L3 scans outcomes at each, and lines L4 and L5 take more work if the probability is obtained as (for positive ) or as a product of prefix and suffix products. The table costs time and space. After that, one run of lines L6 to L9 costs .
Complexity
The table needs one pass over the type profiles when each agent has types. Each profile costs for line L3 and per agent for lines L4 and L5 when is a plain product, which is what the code does; the total is time and extra space for the table. Prefix and suffix products of the probabilities bring lines L4 and L5 to per profile. After the table is built, each run of lines L6 to L9 costs . The exponential term is the size of the type space, which the input in this form already lists through the prior; for a continuous prior, is an integral that must be computed or approximated for the given model. All arithmetic is exact in rationals.
Properties
- Efficient at every profile of reports.
- Strongly budget balanced at every profile: no money comes in or goes out, even when agents lie.
- BIC with independent types. Truth is a Bayes-Nash equilibrium. It is not a dominant strategy: at in the example, agent 1 of type 10 gets from the truth and from the report 35, so the lie gains ex post.
- Not individually rational in general. In the example the type 10 agent expects , so interim IR fails, and ex post it can lose . Shifting the payments by constants keeps BIC and keeps budget balance only when . Here each agent would need (a transfer of at least to it), which does not sum to zero, so no shift of AGV is interim IR on this instance.
- Payments depend only on single reports. is a sum of functions of one report each, which is why the budget can balance.
Variants and improvements
- Arrow's version. Arrow found the same transfers independently in 1979 for public decisions; textbooks call both the expected externality mechanism.
- Two agents. With , line L8 reads : each agent pays the other's expected externality term and receives its own.
- Unequal sharing. Any rule that collects the amounts from agents other than in fixed shares works. The split is the symmetric choice.
- Participation. To get interim IR as well, one can shift the payments by constants when the expected welfare is large enough, or accept a subsidy. In bilateral trade no efficient BIC mechanism is both budget balanced and interim IR, so some loss is unavoidable there; automated mechanism design can find the best compromise for a given prior by linear programming.
- Correlated types. If the types are correlated, computed from the prior is not the agent's own conditional expectation and BIC can fail. Correlation also helps, though: side bets on the others' reports, as in the Cremer-McLean theorem, can give efficiency and balance with weaker trade-offs.
When to use it
Use AGV when the decision must be efficient, no outside money is available, the prior is common knowledge and independent, and agents cannot opt out after they learn their types (or the expected gains are large enough that no type wants to). Examples are internal allocation within a firm and committee decisions with compulsory participation. If agents can walk away, check interim IR first. If the prior is not trusted, use a dominant-strategy mechanism such as VCG and accept the budget imbalance.
Pitfalls
- Treating BIC as DSIC. The equilibrium depends on everyone else reporting truthfully and on the prior being right. With a wrong prior the payments are computed for the wrong distribution and truth need not be optimal.
- Ignoring participation. A low type expects a loss, as the example shows. In bilateral trade with seller cost in and buyer value in , each with probability 1/2, AGV gives the buyer of value 1 an expected utility of .
- Different tie rules. If the table uses one tie rule and the outcome another, BIC can fail at tie profiles. Use one rule in both lines L3 and L6.
- Correlated priors. The proof needs independence; with correlation, recompute the incentives before you use the mechanism.
- One agent. The formula divides by . With one agent there is no one to balance against, and the code raises an error.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/agv-mechanism/. The authors are listed in prov/KNJ3AG.jsonl.
"""The AGV (d'Aspremont-Gerard-Varet) expected externality mechanism.
An instance has n >= 2 agents. Agent i has a finite list of types types[i] and an
independent prior probs[i], a dict from type to Fraction. There is a finite list of
outcomes. value[i][t][o] is the value of agent i of type t for outcome o. The
payment p_i is paid by agent i; a negative payment is a transfer to the agent.
"""
from fractions import Fraction
from itertools import product
def efficient_outcome(outcomes, value, profile):
"""Return the first outcome, in list order, that maximizes the reported welfare."""
best, best_w = None, None
for o in outcomes:
w = sum(Fraction(value[i][t][o]) for i, t in enumerate(profile))
if best_w is None or w > best_w:
best, best_w = o, w
return best
def expected_externalities(types, probs, outcomes, value):
"""Return h, with h[i][t] the expected welfare of the others when agent i reports t.
The others report their true types, drawn from the prior, and the outcome is the
efficient one. One pass over all type profiles fills every h[i][t].
"""
n = len(types)
h = [{t: Fraction(0) for t in types[i]} for i in range(n)] # @line L1
for t in product(*types): # @line L2
o = efficient_outcome(outcomes, value, t) # @line L3
vals = [Fraction(value[j][t[j]][o]) for j in range(n)]
total = sum(vals)
for i in range(n): # @line L4
pr = Fraction(1)
for j in range(n):
if j != i:
pr *= Fraction(probs[j][t[j]])
h[i][t[i]] += pr * (total - vals[i]) # @line L5
return h
def agv_payments(h, bids):
"""Return the AGV payments for the reported profile, given the table h."""
n = len(bids)
if n < 2:
raise ValueError("the AGV mechanism needs at least two agents")
payments = []
for i in range(n): # @line L7
others = sum(h[j][bids[j]] for j in range(n) if j != i)
payments.append(others / (n - 1) - h[i][bids[i]]) # @line L8
return payments
def agv(types, probs, outcomes, value, bids):
"""Run the AGV mechanism on the reports bids. Return (outcome, payments)."""
h = expected_externalities(types, probs, outcomes, value)
o = efficient_outcome(outcomes, value, bids) # @line L6
return o, agv_payments(h, bids) # @line L9
def interim_utility(types, probs, outcomes, value, i, true_type, report):
"""Expected utility of agent i of type true_type who reports report, when the
others report their true types drawn from the prior. Exact, in Fraction."""
n = len(types)
h = expected_externalities(types, probs, outcomes, value)
total = Fraction(0)
others = [types[j] for j in range(n) if j != i]
for rest in product(*others):
prof = list(rest[:i]) + [report] + list(rest[i:])
pr = Fraction(1)
for j in range(n):
if j != i:
pr *= Fraction(probs[j][prof[j]])
o = efficient_outcome(outcomes, value, prof)
pay = agv_payments(h, prof)[i]
total += pr * (Fraction(value[i][true_type][o]) - pay)
return total
test_agv_mechanism.py 166 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/agv-mechanism/. The authors are listed in prov/KNJ3AG.jsonl.
import random
from fractions import Fraction
from itertools import product
from agv_mechanism import (
agv,
agv_payments,
efficient_outcome,
expected_externalities,
interim_utility,
)
def random_instance(rng, n, k, m):
types = [list(range(k)) for _ in range(n)]
probs = []
for _ in range(n):
w = [rng.randint(1, 5) for _ in range(k)]
s = sum(w)
probs.append({t: Fraction(w[t], s) for t in range(k)})
outcomes = list(range(m))
value = [
{t: {o: rng.randint(-5, 10) for o in outcomes} for t in range(k)}
for _ in range(n)
]
return types, probs, outcomes, value
def instances():
rng = random.Random(20251120)
out = []
for n in (2, 3):
for k in (1, 2, 3):
for m in (1, 2, 3, 4):
for _ in range(3):
out.append(random_instance(rng, n, k, m))
return out
def welfare(value, profile, o):
return sum(Fraction(value[i][t][o]) for i, t in enumerate(profile))
def h_direct(types, probs, outcomes, value):
# A second formula for h: for each agent and type, loop over the others only.
n = len(types)
h = []
for i in range(n):
hi = {}
for t in types[i]:
acc = Fraction(0)
others = [types[j] for j in range(n) if j != i]
for rest in product(*others):
prof = list(rest[:i]) + [t] + list(rest[i:])
pr = Fraction(1)
for j in range(n):
if j != i:
pr *= probs[j][prof[j]]
o = efficient_outcome(outcomes, value, prof)
acc += pr * sum(Fraction(value[j][prof[j]][o]) for j in range(n) if j != i)
hi[t] = acc
h.append(hi)
return h
def public_project():
types = [[10, 35]] * 3
probs = [{10: Fraction(1, 2), 35: Fraction(1, 2)}] * 3
outcomes = ["no", "build"]
value = [{t: {"no": 0, "build": t - 20} for t in (10, 35)} for _ in range(3)]
return types, probs, outcomes, value
def test_efficient_against_brute_force():
for types, probs, outcomes, value in instances():
for prof in product(*types):
o, _ = agv(types, probs, outcomes, value, prof)
best = max(welfare(value, prof, q) for q in outcomes)
assert welfare(value, prof, o) == best
def test_h_matches_second_formula():
for types, probs, outcomes, value in instances():
assert expected_externalities(types, probs, outcomes, value) == h_direct(
types, probs, outcomes, value
)
def test_strong_budget_balance_on_every_profile():
for types, probs, outcomes, value in instances():
for prof in product(*types):
_, pay = agv(types, probs, outcomes, value, prof)
assert sum(pay) == 0
def test_bayesian_incentive_compatible():
for types, probs, outcomes, value in instances():
for i in range(len(types)):
for t in types[i]:
truth = interim_utility(types, probs, outcomes, value, i, t, t)
for r in types[i]:
assert truth >= interim_utility(types, probs, outcomes, value, i, t, r)
def test_public_project_numbers():
types, probs, outcomes, value = public_project()
h = expected_externalities(types, probs, outcomes, value)
assert h == [{10: Fraction(15, 2), 35: Fraction(10)}] * 3
o, pay = agv(types, probs, outcomes, value, (10, 35, 35))
assert o == "build"
assert pay == [Fraction(5, 2), Fraction(-5, 4), Fraction(-5, 4)]
assert interim_utility(types, probs, outcomes, value, 0, 10, 10) == Fraction(-15, 4)
assert interim_utility(types, probs, outcomes, value, 0, 35, 35) == Fraction(25, 2)
def test_not_interim_individually_rational():
# The low type of the public project expects a loss, so interim IR fails.
types, probs, outcomes, value = public_project()
assert interim_utility(types, probs, outcomes, value, 0, 10, 10) < 0
# Bilateral trade: seller cost in {0, 2}, buyer value in {1, 3}.
types = [[0, 2], [1, 3]]
probs = [{0: Fraction(1, 2), 2: Fraction(1, 2)}, {1: Fraction(1, 2), 3: Fraction(1, 2)}]
outcomes = ["no", "trade"]
value = [{c: {"no": 0, "trade": -c} for c in (0, 2)}, {v: {"no": 0, "trade": v} for v in (1, 3)}]
assert interim_utility(types, probs, outcomes, value, 1, 1, 1) == Fraction(-5, 4)
def test_not_dominant_strategy_incentive_compatible():
types, probs, outcomes, value = public_project()
h = expected_externalities(types, probs, outcomes, value)
def ex_post(true_t, prof):
o = efficient_outcome(outcomes, value, prof)
return value[0][true_t][o] - agv_payments(h, prof)[0]
assert ex_post(10, (10, 35, 35)) == Fraction(-25, 2)
assert ex_post(10, (35, 35, 35)) == Fraction(-10)
assert ex_post(10, (35, 35, 35)) > ex_post(10, (10, 35, 35))
def test_expected_welfare_is_shared_exactly():
# Budget balance means the interim utilities add up to the expected welfare.
for types, probs, outcomes, value in instances():
n = len(types)
exp_w = Fraction(0)
for prof in product(*types):
pr = Fraction(1)
for j in range(n):
pr *= probs[j][prof[j]]
exp_w += pr * welfare(value, prof, efficient_outcome(outcomes, value, prof))
total = Fraction(0)
for i in range(n):
for t in types[i]:
total += probs[i][t] * interim_utility(types, probs, outcomes, value, i, t, t)
assert total == exp_w
def test_needs_two_agents():
try:
agv_payments([{0: Fraction(0)}], (0,))
except ValueError:
return
raise AssertionError("expected ValueError")
History
d'Aspremont and Gerard-Varet (1979) and Arrow (1979) found, independently, that the incentive problem of public decisions becomes easier when one asks only for truth telling in Bayes-Nash equilibrium. Groves and Clarke had shown earlier in the decade that dominant-strategy truthful efficient mechanisms exist, and Green and Laffont showed that such mechanisms cannot balance the budget. The expected externality payments get around this by paying each agent a function of its own report only. Myerson and Satterthwaite (1983) then showed that the remaining weakness, the lack of individual rationality, cannot be removed in bilateral trade.
References
- Claude d'Aspremont and Louis-Andre Gerard-Varet, Incentives and incomplete information, Journal of Public Economics 11(1) (1979), 25-45, the expected externality transfers for public decisions, with independent beliefs, and the proof that they balance the budget and make truth a Bayes-Nash equilibrium
- Kenneth J. Arrow, The property rights doctrine and demand revelation under incomplete information, in Michael J. Boskin (ed.), Economics and Human Welfare, Academic Press (1979), 23-39, the same balanced mechanism, found independently
- Andreu Mas-Colell, Michael D. Whinston and Jerry R. Green, Microeconomic Theory, Oxford University Press, 1995, Chapter 23, Section 23.D (Bayesian implementation and the expected externality mechanism) and Section 23.E (participation constraints)
- Vijay Krishna, Auction Theory, 2nd edition, Academic Press, 2010, Chapter 5 (mechanism design, efficient mechanisms and budget balance)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag KNJ3AG Edit this page History Report an error Markdown