Algorithmic Game Theory · Lecture Notes
Chapter 14: Future Directions
The earlier chapters of the course studied games, equilibria, and mechanisms mostly among people, under fixed rules, and at sizes that can be solved by hand. Today the same questions are being asked again in a new setting. Some of the players are now software agents that speak on behalf of a user. Mechanisms are learned from data instead of being designed by hand. Some rules are enforced by public code that no one can change afterwards. This chapter uses worked numerical examples to show how the tools of the course apply in these three areas and where they fall short: bargaining between agents and algorithmic collusion, learning prices from data and privacy, transaction fee mechanisms and the power to order transactions, and finally the problems of computation at scale. The experimental protocol is summarized in 14.2.8; the table in 14.6 links to the map that ties all the chapters of the course together.
Learning outcomes
- New players
- Describe the game-theoretic questions that AI agents raise in bargaining and pricing.
- Design from data
- Explain learning a mechanism from data and the notion of sample complexity with a numerical example.
- On-chain mechanisms
- Interpret transaction fee auctions, the base fee rule, and MEV (maximal extractable value, the value obtainable from the power to order transactions).
- Tying the course together
- Relate all the chapters of the course on a single map.
14.1Introduction
This chapter builds no new theory; it carries the tools learned in earlier chapters into new settings. Backward induction, trigger strategies in repeated games, incentive compatibility, revenue maximization, the second-price idea, voting rules, and the price of anarchy all reappear here. What changes is the nature of the players and of the rules. For this reason every section asks two questions together: what does the tool of the course say in this case, and which of its assumptions no longer holds?
The chapter touches on fast-moving areas. Particular products, versions, and current practices change within a few years. The notes therefore tie the examples to lasting principles rather than to product names: patience is bargaining power, anything selected and measured on the same data has its success overstated, and an ordering power that everyone can see carries value. These principles remain valid even when the form of the application changes.
14.1.1Starting with a game: the AI agent tournament
The chapter opens with a small tournament. Four simple agents play a chosen game against one another. Each match lasts 60 or 120 rounds. In the full tournament every agent meets every other agent once; for four agents that means 4 · 3 / 2 = 6 matches. The ranking is based on the total payoff each agent collects over all its matches.
The agents are:
- Random: in every round it picks one of the two moves with probability one half.
- Always Cooperate: it cooperates in every round and never looks at its opponent.
- Always Defect: it defects in every round.
- Best Response: it predicts that the opponent's next move will be the one the opponent has played most often so far, and plays the best response to it. When there is no history, that is, in the first round, it cooperates.
Figure 14.1 shows the pairings. The tournament raises two intriguing questions. First, which of these four agents finishes first? Second, does the agent that wins one game also win another? The answer to the first can be computed from the structure of the game; the second is one of the main lessons of the chapter. Both questions rest on the notions of repeated games and best response, and both are answered with numbers in 14.2.7.
The importance of this tournament does not come from whether the agents are "smart". The agents are very simple. What matters is that an agent's success depends not only on its own rule but also on its opponents and on the game being played. This is the basic observation of game theory, and it gains weight as software agents become widespread.
14.1.2A field in motion
Algorithmic game theory arose at the intersection of computer science and economics, and its applications are growing quickly. In industry and academia it is used in areas such as autonomous vehicles, online platforms, and energy networks. Three technological trends fuel this growth:
- Artificial intelligence and machine learning: some of the decision makers are now learning software.
- Big data and real-time decisions: prices, bids, and routes are updated within seconds.
- Blockchains and smart contracts: rules are enforced automatically by public code.
Four research axes arise from these trends. Each is directly related to a chapter of the course.
| Axis | Question | Counterpart in the course |
|---|---|---|
| Fairness and ethics | Can mechanisms be fair and transparent? | Fairness criteria, fair division |
| Dynamic and learning systems | How do adaptive autonomous agents behave? | Learning dynamics, regret |
| Large networks | How can strategic interaction among millions of players be analyzed? | Congestion games, price of anarchy |
| Incentives and policy | Which rules should be designed for social welfare and sustainability? | Mechanism design, pricing of externalities |
The aim of this chapter is to show how the tools of the course are used in these new areas and where they fall short. Falling short is instructive too. For example, classical mechanism design assumes that the designer will stick to the announced rule afterwards. Smart contracts enforce this assumption in code but create a new problem: pending transactions are visible to everyone, and this visibility can be exploited. Similarly, classical theory assumes that players are rational. Agents based on language models, by contrast, can be sensitive to how a problem is framed and may deviate from this assumption.
14.1.3Application areas
The four areas where game theory is used most today can be summarized as follows.
- Finance
- Algorithmic trading and portfolio management. Trading algorithms play against one another: the profit of one algorithm depends on the orders and the speed of the others. This is a game, not a single-agent optimization.
- Traffic and logistics
- Autonomous vehicle networks and route choice. Each vehicle wants to shorten its own travel time; this selfish routing can lead to outcomes such as Braess's paradox, where adding a road to the network slows everyone down.
- Online platforms
- Recommender systems, ad auctions, and social network analysis. The ad slots next to search results are sold in a separate auction for each search.
- Energy grids
- Load balancing, demand response, and electricity markets. Consumers shift their consumption in response to price signals; producers bid into the market.
What these areas have in common is that the decision makers are increasingly software. A trading algorithm, a routing app, or an ad-bidding tool is an agent playing on behalf of its owner. The rest of the chapter starts from this observation.
14.2AI agents
This section examines the questions that arise once software agents appear as players: the new problems agents create, bargaining between agents (finite and infinite horizon), and collusion among pricing algorithms. The results of the opening tournament are also explained with these tools.
14.2.1Strategic AI agents
Agents based on large language models can take on tasks such as shopping, bargaining, planning, and resource sharing on a user's behalf. The agent is then no longer merely a tool; it is an actor with a goal, knowledge, and a strategy. In other words, it is a player in the game-theoretic sense. One can ask what the player wants, what it knows, and what it can choose. This brings the old questions of game theory back onto the agenda.
Figure 14.2 shows the typical structure. A user assigns a task to agent A, and a seller assigns one to agent B. The two agents meet in a mechanism, for example in a market or an auction. Every link of this chain raises a separate game-theoretic question.
Principal–agent problem: One party (the principal) delegates a task to another party (the agent). If the agent's goal differs from the principal's and the principal cannot observe every action of the agent, the agent may act in the interest of its own goal rather than the principal's. The principal's problem is to set up an incentive or monitoring scheme that aligns the agent's goal with its own.
This problem is much older than AI agents. The relationships between a homeowner and a real estate agent, a shareholder and a manager, or a patient and a doctor have the same structure. For example, a commission-based real estate agent may not want to spend weeks of effort to sell the house at a slightly higher price, because only a small part of the price increase comes to the agent, while the whole effort falls on the agent. With software agents the problem appears in four forms.
- Goal alignment
- Is the agent's goal the same as the user's? The agent's goal is inferred from the user's words or from training data. A user says "find the cheapest" but may in fact also care about fast delivery. If the agent follows the stated goal literally, it can miss the user's real utility. This is the most direct form of the principal–agent problem.
- The rationality assumption
- Classical game theory assumes that players maximize their payoffs. The behavior of an agent based on a language model, however, can be sensitive to how the problem is presented, that is, to framing. It may choose different moves in two different descriptions of the same game. For this reason the Nash equilibrium is not always a good prediction of the behavior of these agents. The observations made about people in behavioral game theory apply here to agents as well.
- Manipulation
- The agent reads text written by the other side. The opposing agent can try to steer the agent in its own favor by embedding hidden instructions in its message. This is called prompt injection. From the game-theoretic point of view, it is a new kind of strategy in which the other side can influence not only the choice of moves but also the opponent's decision rule.
- Identity and accountability
- On whose behalf is the agent speaking, who is responsible if something goes wrong, and how is an agreement that has been made verified? Mechanism design assumes that it is known who the players are and that a contract is enforceable. These assumptions must be established separately for agents.
Taken together, these four questions say the following: agents do not make game theory unnecessary; on the contrary, they make its questions more important. Which game the agent is playing, on whose behalf it plays, and what the rules of the game are must all be modeled explicitly. Bargaining and pricing models are two concrete examples of this modeling.
14.2.2Bargaining between agents: finite horizon
Suppose two agents must share an amount. For example, a buyer agent and a seller agent bargain over how to split a gain of 100 TL arising from a transaction. Bargaining proceeds through proposals made in turn.
Alternating-offers bargaining: Two players share an amount. In odd-numbered rounds A, and in even-numbered rounds B, proposes a division. If the other side accepts the proposal, the game ends and the division is carried out. If it rejects, play moves on to the next round. Every delay multiplies the value to be shared by a discount factor δ. In a game of T rounds, if the last proposal is also rejected, both sides get 0.
δ = 0.9 means that the value shrinks by 10% in every round. This has two interpretations. The first is that there is a real loss: for example, a product that spoils or an opportunity that slips away. The second is that the players are impatient: 100 TL received one round later is worth as much as 90 TL received today. In both interpretations, the larger δ is, the more patient the player.
Because the game is finite, it is solved by backward induction. We start from the last round and apply the rule "the proposer offers the smallest share that leaves the other side indifferent between accepting and rejecting" in every round. Whatever the other side would get in the next round if it rejects, the present value of that amount is its lower bound.
100 TL is to be shared, δ = 0.9, and the game lasts four rounds. A proposes in the odd rounds (1 and 3) and B in the even rounds (2 and 4).
- Round 4 (B proposes, last round). If A rejects, both get 0. For A there is no difference between accepting and rejecting; the indifferent side is assumed to accept. B proposes 100 for itself and 0 for A: (A, B) = (0, 100).
- Round 3 (A proposes). If B rejects, it gets 100 in round 4. Its present value is 0.9 · 100 = 90. A must offer B at least 90; offering more is unnecessary. The division is (10, 90).
- Round 2 (B proposes). If A rejects, it gets 10 in round 3; the present value is 0.9 · 10 = 9. B offers A 9: (9, 91).
- Round 1 (A proposes). If B rejects, it gets 91 in round 2; the present value is 0.9 · 91 = 81.9. A offers B 81.9 and keeps 100 − 81.9 = 18.1 for itself: (18.1, 81.9).
B accepts the round 1 proposal immediately; the bargaining ends without delay and no value is lost. This outcome is a subgame perfect equilibrium: in every round, even in the game starting from that round, everyone plays a best move.
Figure 14.3 reads the solution from right to left. There is a surprising result at first sight: although A makes the first proposal, it gets only 18.1% of the pie. The reason is that B has the last word. In round 4 B can take everything, and this threat propagates back through all the rounds. With each round we go back, the advantage of the last word shrinks by a factor of δ but does not vanish entirely.
The same calculation can be carried out for different numbers of rounds. One observation shortens the work. Let xT be the share of the first proposer (A) in a game of T rounds. In the first round, A must satisfy the other side up to its waiting value. For B, the game starting from the second round is a game of T − 1 rounds in which B itself is the first proposer; there B gets the share xT−1. Therefore:
x1 = 100, xT = 100 − δ · xT−1
The rule starts with the one-round game: with a single round, A proposes everything and B accepts (rejection gives both 0). Applying the rule repeatedly yields Table 14.2.
| Number of rounds T | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ∞ |
|---|---|---|---|---|---|---|---|---|---|
| A's share | 100 | 10 | 91 | 18.1 | 83.7 | 24.7 | 77.8 | 30 | 52.6 |
In the table each value is computed from the previous one. For example, x2 = 100 − 0.9 · 100 = 10, x3 = 100 − 0.9 · 10 = 91, x4 = 100 − 0.9 · 91 = 18.1, x5 = 100 − 0.9 · 18.1 = 83.71. The values oscillate: if the number of rounds is odd, the last word is A's and A gets a large share; if it is even, the last word is B's and A gets a small share. The case T = 1 is the ultimatum game: there is a single proposal, and the other side either accepts or both get 0. The theoretical prediction is that the proposer takes almost everything.
The amplitude of the oscillation shrinks as the number of rounds grows, and the values approach about 52.6. This limit is derived in 14.2.3. Two lessons follow for agent design. The first is that patience (the size of δ) and the right of the last word are bargaining power. The second is that knowledge of the horizon is also strategic, because the deadline determines who makes the last offer. An agent gains power by knowing when the bargaining will end, or by being able to determine it.
- Assuming the first proposer is always strong: With a finite horizon, the power lies with the last proposer. At T = 4, the first proposer A gets only 18.1.
- Writing the waiting value without discounting: B's lower bound in round 3 is not 100 but 0.9 · 100 = 90; 100 one round later is worth 90 today.
- Starting backward induction from the beginning: The calculation starts from the last round. Without knowing what will happen in the last round, the proposal in the first round cannot be found.
14.2.3Infinite horizon: the Rubinstein solution
If bargaining has no last round, backward induction cannot start; there is no final round to start from. Rubinstein (1982) showed that even in this case there is a unique subgame perfect equilibrium. The solution is found with stationary strategies. A stationary strategy makes the same offer in every round, without looking at the past. When A proposes, it always keeps the share x* for itself; when B proposes, it always leaves A the share y*. Let us write the shares as fractions of 1 (the whole amount).
The equilibrium has two conditions.
- B is indifferent about A's proposal. A's proposal leaves B 1 − x*. If B rejects, it proposes in the next round and gets 1 − y*; the present value of that is δB(1 − y*). A leaves B exactly this much: 1 − x* = δB · (1 − y*).
- A is indifferent about B's proposal. B's proposal leaves A y*. If A rejects, it gets x* in the next round; the present value is δA x*. Hence y* = δA · x*.
Substitute the second equation into the first: 1 − x* = δB(1 − δA x*) = δB − δAδB x*. Collect the terms containing x* on one side: x* − δAδB x* = 1 − δB, that is, x*(1 − δAδB) = 1 − δB. Divide both sides by 1 − δAδB.
In infinite-horizon alternating-offers bargaining with discount factors δA, δB < 1, there is a unique subgame perfect equilibrium. The share of the first proposer A is
x* = (1 − δB) / (1 − δAδB)
and the proposal is accepted in the first round. With symmetric patience (δA = δB = δ), x* = 1/(1 + δ).
The symmetric formula follows from the general one: since 1 − δ2 = (1 − δ)(1 + δ), we get (1 − δ)/(1 − δ2) = 1/(1 + δ). For δ = 0.9 this gives 100/1.9 ≈ 52.6 TL. This is the value toward which the oscillation in Table 14.2 converges. The connection is clear: the fixed point of the finite-horizon rule xT = 100 − δ xT−1, that is, the solution of the equation x = 100 − δx, is x = 100/(1 + δ). As the horizon lengthens, the effect of the last round is multiplied by δ at every step and dies out, and the share approaches this fixed point.
Figure 14.4 shows the advantage of the first proposer. Among impatient players (small δ) the first proposal is very valuable, because if the other side rejects, waiting for the next round is costly for it. As patience grows, waiting becomes cheap and the first proposer's advantage shrinks. Very patient players share roughly equally.
When patience differs, the result is more striking. Table 14.3 shows the shares the formula gives in four examples.
| δA | δB | Calculation | A | B |
|---|---|---|---|---|
| 0.9 | 0.9 | 0.1 / 0.19 | 52.6 | 47.4 |
| 0.9 | 0.8 | 0.2 / 0.28 | 71.4 | 28.6 |
| 0.8 | 0.9 | 0.1 / 0.28 | 35.7 | 64.3 |
| 0.99 | 0.9 | 0.1 / 0.109 | 91.7 | 8.3 |
Let δA = 0.9 and δB = 0.8. A's share is found as follows.
- Numerator of the fraction: 1 − δB = 1 − 0.8 = 0.2.
- Denominator of the fraction: δAδB = 0.72, so 1 − 0.72 = 0.28.
- x* = 0.2 / 0.28 ≈ 0.714: A gets 71.4 TL and B gets 28.6 TL.
- Check: in B's proposal A is left y* = δA x* = 0.9 · 0.714 ≈ 0.643. B must be indifferent between accepting and rejecting A's proposal: δB(1 − y*) = 0.8 · 0.357 ≈ 0.286 = 1 − x* ✓.
If the roles stay the same but the patience levels are swapped (δA = 0.8, δB = 0.9), A gets only 35.7 even though it is the first proposer. The difference in patience is stronger than the first-proposer advantage.
The last row of the table is an extreme case: δA = 0.99 represents a very patient A, and A gets 91.7% of the pie. The lesson for agent design is this: patience is power. An agent that is truly hasty (with a low δ) gets a smaller share. With incomplete information the situation is somewhat subtler: if the other side does not know the agent's true patience, appearing hasty also has a similar effect by changing the opponent's beliefs. It is therefore important that a bargaining agent not leak the user's deadline or urgency to the other side.
Confusing finite and infinite horizons. With a finite horizon the last proposer is strong: at T = 4, A gets only 18.1. With an infinite horizon there is no last round and the first proposer is slightly ahead: 52.6. Whether a bargaining process has a deadline completely changes who is strong.
14.2.4Can pricing algorithms collude?
Most online sellers set their prices with algorithms. These algorithms monitor one another's prices and update their own accordingly. This raises a question relevant to competition law: can algorithms that never talk to one another meet at a high price, just as competitors do when they strike a deal?
Collusion is when competitors, instead of competing, keep prices above the competitive level for their joint benefit. Reaching this outcome through the interaction of pricing algorithms, without an explicit agreement, is called algorithmic collusion.
The model is as follows. Two firms sell the same product. If both charge the monopoly price, the total profit is 100 and each gets 50. If one undercuts the price slightly, then as in Bertrand competition the cheaper firm takes the whole market: it earns 100 that period and the other 0. If prices eventually fall to cost, profit vanishes. The one-shot game is the Prisoner's Dilemma: whatever the other side does, undercutting is more profitable, yet the equilibrium leaves both firms with 0.
If the game is repeated every period, the situation changes. The firms can use the following strategy:
Grim trigger strategy: charge the high (monopoly) price until the rival undercuts; if the rival undercuts even once, switch to the competitive price forever.
This strategy sustains cooperation with a threat. Deviating pays today but destroys all future profits. Whether deviating is profitable depends on how much the firm values the future, that is, on the discount factor δ.
Let us compare the present values of the two paths. On the cooperation path the firm gets 50 every period. Its present value is a geometric series:
50 + 50δ + 50δ2 + … = 50 / (1 − δ)
This sum is found as follows. Let the series be S. Since δS = 50δ + 50δ2 + …, we have S − δS = 50, which gives S = 50/(1 − δ). On the deviation path the firm gets 100 today, then the trigger strategy kicks in and it gets 0 forever. Its present value is 100. For cooperation to continue, the value of cooperating must not be smaller than that of deviating:
50/(1 − δ) ≥ 100 ⟺ 50 ≥ 100(1 − δ) ⟺ 1 − δ ≤ 1/2 ⟺ δ ≥ 1/2
In the second step both sides were multiplied by (1 − δ); since δ < 1 this number is positive, so the direction of the inequality does not change. The result: if the firms value the future enough (δ ≥ 1/2), nobody wants to undercut and the high price persists. This structure is the same as in the repeated Prisoner's Dilemma.
Calvano et al. (2020) studied what this theoretical result means for algorithms with a simulation. Reinforcement-learning pricing agents (which update their pricing rule every period according to the profit signal) were able to learn prices above the competitive level without ever messaging one another. Moreover, when one agent undercut, the other responded with a temporary price war; that is, the agents spontaneously learned a punishment behavior resembling the trigger strategy.
This finding raises a regulatory question. Competition law is traditionally built on the notion of an agreement between people: competitors meeting to discuss prices is prohibited. Algorithms that learn a high price without communicating explicitly strain this framework. If there is no agreement, is there collusion? Who is responsible: the person who wrote the algorithm or the one who uses it? These questions rest on the results of game theory: repeated interaction and the value of the future can sustain cooperation even without an explicit agreement.
14.2.5Code trace: compare()
To see the trigger condition in numbers, the cumulative value of the two paths can be computed period by period. The function below compares, over T periods, the path that cooperates with 50 each period against the deviation path that undercuts in period s, earns 100 in that period, and then earns 0.
def compare(delta, s, T):
coop, dev = 0.0, 0.0 # cooperate / deviate
for t in range(T):
coop += delta**t * 50
if t < s:
dev += delta**t * 50
elif t == s:
dev += delta**t * 100 # A undercuts
# t > s: trigger fired, profit 0
return round(coop, 2), round(dev, 2)
print(compare(0.6, 2, 6))
print(compare(0.4, 2, 6))The code runs line by line as follows:
coopis the cumulative present value of the cooperation path anddevthat of the deviation path; both start at 0.- The loop runs over the periods
t = 0, 1, …, T − 1. The profit of each period is multiplied bydelta**t; this is the present value of a profit received t periods later. - The cooperation path adds 50 every period.
- The deviation path cooperates before the moment of deviation (
t < s) and adds 50. At the moment of deviation (t == s) it takes the whole market and adds 100. After that (t > s) the trigger is in effect and nothing is added. - The function returns the two values rounded to two decimal places.
The first call is for δ = 0.6, s = 2, T = 6. The trace is in Table 14.4.
| t | δt | cooperation adds | coop | deviation adds | dev |
|---|---|---|---|---|---|
| 0 | 1 | 50 | 50 | 50 | 50 |
| 1 | 0.6 | 30 | 80 | 30 | 80 |
| 2 | 0.36 | 18 | 98 | 36 (deviation) | 116 |
| 3 | 0.216 | 10.8 | 108.8 | 0 | 116 |
| 4 | 0.1296 | 6.48 | 115.28 | 0 | 116 |
| 5 | 0.0778 | 3.89 | 119.17 | 0 | 116 |
In the first two periods the two paths are identical. At t = 2 the deviating firm takes the whole market: 0.36 · 100 = 36; the cooperation path adds only 0.36 · 50 = 18, so deviation moves ahead by 18. Then the trigger kicks in; the deviation path no longer adds anything, while the cooperation path keeps adding every period. At t = 4 the gap falls to 0.72, and at t = 5 cooperation pulls ahead: 119.17 > 116. The short-term gain of 18 has been paid back by the lost future profits.
Figure 14.5 shows the six-period window. In the infinite horizon the gap is even larger: the value of cooperation is 50/(1 − 0.6) = 125, while that of deviation stays at 116 (nothing is added after the moment of deviation). So at δ = 0.6 deviation is not profitable, which is consistent with the condition δ ≥ 1/2.
The second call is for δ = 0.4. This time the future loses value faster.
In Figure 14.6 the cooperation path adds 50, 20, 8, 3.2, 1.28, and 0.51, reaching 82.99. The deviation path adds 50, 20, and 16 and stays at 86. In the infinite horizon the value of cooperation is 50/0.6 ≈ 83.3, which is again smaller than 86. Deviation is profitable and the collusion collapses. The threshold is δ = 1/2: at this value the two paths are equal in the limit (50/0.5 = 100).
Deciding from a finite window. The code sums 6 periods; this is only an illustration. The trigger condition is defined over the infinite horizon. At δ = 0.6 the gap after 6 periods is 3.17, while in the limit it is 125 − 116 = 9. If δ is very close to the threshold, a short window can give the wrong conclusion.
14.2.6Conditions that facilitate and hinder collusion
The trigger condition also tells us in which markets collusion is more likely. The first factor is the number of firms. If n firms share the monopoly profit equally, each gets 100/n per period. A deviating firm still takes the whole market (100) for one period and then 0. The condition becomes:
(100/n) / (1 − δ) ≥ 100 ⟺ 1/n ≥ 1 − δ ⟺ δ ≥ 1 − 1/n
| Firms n | Share 100/n | Required δ |
|---|---|---|
| 2 | 50 | 0.50 |
| 3 | 33.3 | 0.67 |
| 4 | 25 | 0.75 |
| 5 | 20 | 0.80 |
| 10 | 10 | 0.90 |
As firms multiply, the cooperation share shrinks while the payoff from deviating stays the same. Sustaining collusion in a crowded market therefore takes much more patience. The δ = 0.6 that suffices with two firms is not enough in a market with five.
Three firms share the monopoly profit (100) and δ = 0.7. Does collusion hold?
- Under cooperation each firm's share is 100/3 ≈ 33.3; its value is 33.3/(1 − 0.7) = 33.3/0.3 ≈ 111.1.
- The value of deviating is 100.
- Since 111.1 ≥ 100, deviation is not profitable and collusion holds. By the formula too: δ = 0.7 ≥ 1 − 1/3 ≈ 0.67 ✓.
- If a fourth firm enters, the threshold rises to 0.75. δ = 0.7 is no longer enough: 25/0.3 ≈ 83.3 < 100. The entry of a new competitor breaks the collusion.
Besides the number of firms, three more factors matter. They explain why algorithmic pricing can make collusion easier.
- Frequent price updates
- δ depends on the length of a period. If prices change once a year, a profit one period later loses considerable value relative to today. If prices are updated every minute, a profit one minute later is worth almost as much as today's; δ ≈ 1 per period. Moreover, the deviator's gain is limited to the few minutes until the rival reacts. Both effects make collusion easier.
- Transparent prices
- If the rival's price is visible instantly, a deviation is noticed immediately and the punishment is not delayed. If a deviation could be noticed only several periods later, the deviator would earn 100 in all those periods and the threshold would rise.
- Price-matching guarantees
- A guarantee such as "if a competitor is cheaper, we pay the difference" looks consumer-friendly at first sight. Yet it wipes out the gain from undercutting: if the rival cuts its price, the customer still buys from the firm offering the guarantee. Since undercutting wins no customers, nobody undercuts and the collusion is preserved.
- Regulatory proposals
- Test a pricing algorithm against other algorithms in a simulation environment before releasing it to the market, and open the algorithm's decision logs to audit. These proposals rest on the observation that collusion can arise from a dynamic rather than from an agreement.
Forgetting the number of firms. The patience that suffices with two firms is not enough in a crowded market. The threshold is δ ≥ 1 − 1/n; for n = 5 it is 0.80. Memorizing the condition as always δ ≥ 1/2 is wrong.
14.2.7Back to the tournament
The first game of the opening tournament is the Prisoner's Dilemma. The payoffs are (3, 3) for mutual cooperation, (0, 5) or (5, 0) between a cooperator and a defector, and (1, 1) for mutual defection. Each match is 60 rounds. Since the Random agent decides with probability one half each round, its matches are computed with expected values. The Best Response agent cooperates in the first round. After that it plays the best response to the opponent's most frequent move. In the Prisoner's Dilemma defection is the dominant strategy, so the best response is defection whatever the opponent does. That is, the Best Response agent always defects after the first round.
Let us compute the expected total of each agent's three matches one by one.
- Always Defect. Against Always Cooperate it gets 5 every round: 60 · 5 = 300. Against Random it gets 5 or 1 with equal probability each round, 3 in expectation: 60 · 3 = 180. Against Best Response it gets 5 in the first round (the opponent cooperates) and 1 in the next 59 rounds: 5 + 59 = 64. The total is 300 + 180 + 64 = 544.
- Best Response. Against Always Cooperate it gets 3 in the first round, then 5 for 59 rounds: 3 + 295 = 298. Against Always Defect it gets 0 in the first round, then 1 for 59 rounds: 59. Against Random it gets (3 + 0)/2 = 1.5 in expectation in the first round, then (5 + 1)/2 = 3 every round: 1.5 + 177 = 178.5. The total is 535.5.
- Random. Against Always Cooperate it gets (3 + 5)/2 = 4 every round: 240. Against Always Defect it gets (0 + 1)/2 = 0.5 every round: 30. Against Best Response it gets 4 in the first round, then 0.5 for 59 rounds: 4 + 29.5 = 33.5. The total is 303.5.
- Always Cooperate. Against Always Defect it gets 0. Against Random it gets (3 + 0)/2 = 1.5 every round: 90. Against Best Response it gets 3 in the first round, then 0: 3. The total is 93.
| Agent | Expected total |
|---|---|
| Always Defect | 544 |
| Best Response | 535.5 |
| Random | 303.5 |
| Always Cooperate | 93 |
The answer to the first question is Always Defect. Best Response finishes a very close second; the difference between the two comes only from the cooperation in the first round. In this tournament mutual cooperation is almost never seen, because no agent rewards or punishes based on the past. Since there is no threat to sustain cooperation, the dominant strategy wins.
For the second question the game is changed. In Matching Pennies, one player wins if the two choices match and the other wins if they differ; the game is zero-sum and has no pure equilibrium. Here the ranking changes. Two fixed agents that always make the same move are easily exploited: the Best Response agent learns their move and wins every round after the first. This puts it first with about +118. The Random agent, on the other hand, cannot be exploited by any opponent; its expected payoff in every match is 0. This is the security value of the mixed equilibrium of Matching Pennies (playing half and half).
Real tournaments teach the same lesson. Axelrod's (1980) repeated Prisoner's Dilemma tournament was won by Tit-for-Tat (the strategy that cooperates in the first round and then repeats the opponent's last move). Reciprocity and the threat of punishment sustained cooperation. Among the four agents here, none punishes based on the past; so cooperation does not arise. The pricing agents in Calvano et al. (2020), by contrast, remember the previous period, and can learn to punish and sustain a high price. The difference lies in memory.
The general lesson of the tournament is this: there is no universally best strategy. The success of a strategy depends on the game being played, the population of opponents, noise, and memory. It is wrong to test an agent in a single environment and assume it will do well everywhere. This observation also explains why reproducible experiments across several games and several opponents are necessary to evaluate agents (14.2.8).
14.2.8A reproducible experimental protocol
The moves of language-model agents involve randomness: the same pairing can give different scores twice. A result is reliable if someone else can repeat the same experiment and obtain the same result. This is called reproducibility. In an agent tournament experiment, the following are recorded:
- a fixed random seed;
- the full text of the prompt;
- the version of the model used and the temperature value;
- the order of opponents and the number of rounds: these are held fixed and stated in the report.
The report then gives the following:
- each pairing is repeated at least N times (for example N = 30);
- the spread together with the mean: the standard deviation or a 95% confidence interval;
- the code and the game logs are shared in an open repository.
A confidence interval, instead of a single mean, gives a range in which the true mean most likely lies. If the mean of N repetitions is m and the standard deviation is s, the approximate 95% confidence interval is m ± 1.96 · s / √N. Here s/√N is the uncertainty of the mean itself; it shrinks as the number of repetitions grows.
Over 30 repetitions the mean score is 2.6 and the standard deviation is 0.4.
- √30 ≈ 5.48, 0.4 / 5.48 ≈ 0.073.
- Half-width: 1.96 · 0.073 ≈ 0.14.
- Interval: 2.6 ± 0.14, that is, [2.46, 2.74].
If another agent's mean falls inside this interval, keep in mind that the difference between the two agents may be due to noise.
14.3Learning mechanisms
In mechanism design the designer chooses the rule so as to produce the desired outcome. In the classical approach this choice is made with a proof. This section examines a second approach: learning the rule as the solution of an optimization problem or directly from data. Two new problems that learning brings are also addressed: overstating one's own success on little data, and the privacy of individuals' data.
14.3.1Automated mechanism design
The classical way of doing mechanism design is as follows. A human proposes a rule: a second-price (Vickrey) auction, the VCG mechanism, or Myerson's auction that maximizes expected revenue. Then it is proved by hand that the rule is incentive compatible and optimal for a given objective. This approach is very successful for well-structured problems such as selling a single item. But with many items and many buyers, the mechanism that maximizes expected revenue is often unknown; there is not even a candidate to prove things about by hand.
In the automated approach the mechanism is the solution of an optimization problem. The problem has an objective (revenue or social welfare) and two kinds of constraints.
Incentive compatibility (IC): For every player, reporting the true type (value) is no worse than reporting any other type. In short, telling the truth is best.
Individual rationality (IR): For every player, participating in the mechanism is no worse than not participating. In short, participation does not hurt: the expected utility does not fall below zero.
Automated design takes two basic forms.
- Linear programming. If the players' types come from a finite set, then for each type the allocation probability and the payment are variables. The objective and the constraints are linear in these variables. Because the allocation probabilities are variables, randomized mechanisms are allowed and the problem is solved by linear programming (Conitzer and Sandholm, 2002); if only deterministic mechanisms are wanted, the problem becomes hard in general. The example in 14.3.2 is of this kind.
- Auctions as neural networks. If types are continuous and multidimensional, the mechanism is represented by a neural network: the network takes the bids and outputs the allocation and the payments. The IC constraint cannot be written directly; instead a regret penalty is added (Dütting et al., 2019). Here regret is the largest extra utility a bidder could gain by lying. Training tries to increase revenue while driving regret toward zero.
The automated approach has three limits:
- Approximate IC
- The learned rule may not be exactly incentive compatible; a small regret remains after training. This is called approximate incentive compatibility. If the gain from lying is so small that many participants would not find it worth computing, it may not be a problem in practice, but it is not a proven guarantee.
- Generalization
- The rule is learned from the value distribution in the training data. If the true distribution changes (for example, through an economic shock), the rule may become ineffective.
- Explainability
- When a participant asks "Why did I pay this price?", the weights of a neural network give no understandable answer. The Vickrey rule, on the other hand, can be explained in one sentence: "the winner pays the second-highest bid".
14.3.2Code trace: revenue()
The smallest example of automated design involves a single buyer and a single item. The buyer has two possible types: type L values the item at 1 and has probability qL; type H values it at 3 and has probability 1 − qL. The seller does not know the buyer's type and asks the buyer to report it. For every reported type the mechanism specifies an allocation probability and a payment. Type H always gets the item. Type L gets it with probability xL. The payments are pL and pH.
When revenue is maximized, two constraints hold with equality (they bind). They are derived as follows.
- L's participation constraint (IR). The utility of type L must satisfy 1 · xL − pL ≥ 0. To raise revenue, the seller pushes pL up to this limit: pL = xL. The price for L is the highest amount L is willing to pay.
- H's incentive compatibility constraint (IC). If type H says "I am L", it gets the item with probability xL and pays pL: its utility is 3xL − pL. If it tells the truth, its utility is 3 − pH. Telling the truth must be at least as good as lying: 3 − pH ≥ 3xL − pL. The seller pushes pH up to this limit: pH = pL + 3(1 − xL).
- Expected revenue. G = qL pL + (1 − qL) pH.
Once the payments are substituted, the revenue depends only on xL:
G(xL) = qL xL + (1 − qL)(3 − 2xL) = 3(1 − qL) + xL(3qL − 2)
This expression is linear in xL. Selling to L has a cost: selling cheaply to L also opens a lying option for H and lowers H's price. The code below computes the revenue for three values of xL and two values of qL.
def revenue(xL, qL, vL=1, vH=3):
pL = xL * vL # L's IR binds
pH = pL + vH * (1 - xL) # H's IC binds
return qL * pL + (1 - qL) * pH
for qL in [0.5, 0.75]:
G = [revenue(x, qL) for x in [0, 0.5, 1]]
print(qL, G)The code runs line by line as follows. pL is the payment that makes L's participation constraint bind. pH is the payment that makes H's incentive compatibility constraint bind. The function returns the average weighted by the probabilities of the two types. The loop tries xL ∈ {0, 0.5, 1} for qL = 0.5 and 0.75.
| qL | xL | pL | pH | Revenue |
|---|---|---|---|---|
| 0.5 | 0 | 0 | 3 | 0.5 · 3 = 1.5 |
| 0.5 | 0.5 | 0.5 | 2 | 0.25 + 1 = 1.25 |
| 0.5 | 1 | 1 | 1 | 1 |
| 0.75 | 0 | 0 | 3 | 0.25 · 3 = 0.75 |
| 0.75 | 0.5 | 0.5 | 2 | 0.375 + 0.5 = 0.875 |
| 0.75 | 1 | 1 | 1 | 1 |
The row xL = 0.5 shows the trade-off clearly. Selling to L with probability one half and receiving an expected payment of 0.5 (the price is 1 if a sale occurs) opens H the option "if I say L, I earn 3 · 0.5 − 0.5 = 1". To make H willing to tell the truth, H's price must fall from 3 to 2. At qL = 0.5 this loss is greater than the extra revenue from L.
Two lines are visible in Figure 14.7. At qL = 0.5 the best choice is xL = 0: sell only to H at 3, for revenue 1.5. At qL = 0.75 type L is the majority; selling only to H now earns little (0.75), and the best choice is to sell to everyone at 1, for revenue 1. The coefficient of xL in the revenue formula is 3qL − 2. It is −0.5 at qL = 0.5 and +0.25 at qL = 0.75.
There is an important observation: since revenue is linear in xL, at least one optimum is always at an endpoint (at qL = 2/3 the coefficient is 0 and every xL gives the same revenue). This is a general property of linear programming: if the feasible region is a bounded polyhedron, at least one optimum is at a vertex. Both solutions are in fact a posted price: either "price 3" or "price 1". So in this small example automated design rediscovers the result that Myerson's theory gives for a single item: the mechanism that maximizes expected revenue is a well-chosen reserve price. The real value of automated design emerges in multi-item settings where no such theory exists.
14.3.3Learning a reserve price from data
In the previous example the seller knew the type distribution. In reality the distribution is unknown; all we have are values observed in the past. In that case a natural approach is to choose the price that would have brought the most revenue on the historical data.
Let n sample values v1, …, vn be given. At price p, the buyers whose value is at least p buy. The empirical revenue is the average revenue per buyer:
g(p) = p · (number of samples with value ≥ p) / n
Empirical revenue maximization is choosing the price that maximizes this function.
Which prices need to be tried is found as follows. If a price is chosen between two consecutive sample values, it can be raised without changing the number of buyers, and this increases revenue. So the best price is always one of the sample values. Sort the values from largest to smallest. If the k-th largest value is the price, exactly k buyers buy (if there are no ties). So trying only n candidate prices suffices.
def best_price(samples):
v = sorted(samples, reverse=True)
n = len(v)
price, revenue = 0, 0
for k in range(1, n + 1):
p = v[k - 1] # k-th highest
g = p * k / n # k buyers buy
if g > revenue:
price, revenue = p, g
return price, revenueThe code runs line by line as follows. v is the samples sorted from largest to smallest. price and revenue hold the best price so far and its empirical revenue. For k = 1, …, n the loop tries the k-th largest value as the price. If the values are all distinct, k buyers buy at this price and the empirical revenue is p · k / n. (If several samples share the same value, all of them buy; the last position of that value gives the correct count, and the largest revenue is still found correctly.) If the revenue exceeds the previous best, the best price is updated.
In the example, the 8 buyer values observed in the past are 0.62, 0.15, 0.91, 0.47, 0.33, 0.78, 0.55, 0.08. Sorted, they are 0.91, 0.78, 0.62, 0.55, 0.47, 0.33, 0.15, 0.08.
| k | p | g = p·k/8 | Best (price, revenue) |
|---|---|---|---|
| 1 | 0.91 | 0.114 | (0.91, 0.114) new |
| 2 | 0.78 | 0.195 | (0.78, 0.195) new |
| 3 | 0.62 | 0.2325 | (0.62, 0.2325) new |
| 4 | 0.55 | 0.275 | (0.55, 0.275) new |
| 5 | 0.47 | 0.294 | (0.47, 0.294) new |
| 6 | 0.33 | 0.2475 | unchanged |
| 7 | 0.15 | 0.131 | unchanged |
| 8 | 0.08 | 0.08 | unchanged |
Figure 14.8 shows the learned price. As the price falls, the number of buyers rises but the money taken from each buyer shrinks. In the first five steps the effect of more buyers dominates; at the sixth step (0.33) the effect of the price drop starts to dominate. The learned price is 0.47 and the empirical revenue is about 0.294.
14.3.4Empirical versus true revenue
What the learned price will actually earn in the future depends on the true distribution from which the values come. For example, suppose the values come from the distribution U[0, 1]. This means that intervals of equal length between 0 and 1 are equally likely. In this distribution the probability that a buyer's value exceeds p is 1 − p. So the true revenue per buyer at price p is:
G(p) = p · (1 − p)
This function is a parabola. Its maximum is at the midpoint: at p = 0.5, G = 0.5 · 0.5 = 0.25. The true revenue of the learned price is 0.47 · 0.53 ≈ 0.249. So the learned price is almost as good as the best one. But the empirical revenue (0.294) is clearly higher than the true revenue (0.249).
Figure 14.9 compares the two curves. The empirical curve is like a sawtooth: between two sample values it rises linearly with the price, and when it passes a sample value it drops because that buyer is lost. The true curve is a smooth parabola. The empirical curve lies above the truth at some prices and below it at others.
That the empirical success of the chosen price is overstated is no coincidence. The price was chosen as the highest point of the empirical curve. The places where the empirical curve rises above the truth are places where the samples happen to be plentiful by chance. When the highest point is chosen, one of these lucky fluctuations is chosen too. Because the data that is measured is the same as the data that is selected, an optimistic bias arises. The gap between the true best revenue (0.25) and the true revenue of the chosen price (0.249) is small; but as the sample shrinks, both this gap and the optimistic bias grow.
Taking empirical revenue for the truth. The success of a price that is selected and measured on the same data is overstated. In this example 0.294 is measured but the truth is 0.249; the gap is 18%. To measure the success of a price, an auction rule, or any learned model, separate data that was not used in the selection is needed.
14.3.5How many samples are enough? Sample complexity
As the number of samples grows, the empirical curve approaches the truth. A simulation shows this: draw n values from U[0, 1], maximize the empirical revenue, and record the empirical and true revenue of the chosen price. This is repeated hundreds of times for each n and averaged.
| Samples n | Empirical revenue | True revenue | 0.25 − true |
|---|---|---|---|
| 10 | 0.311 | 0.224 | 0.0262 |
| 100 | 0.263 | 0.245 | 0.005 |
| 1.000 | 0.253 | 0.249 | 0.0011 |
| 10.000 | 0.25 | 0.25 | 0.0002 |
The table shows two things. First, overfitting: with few samples the empirical revenue looks much higher than the true one (0.311 against 0.224 at n = 10). The learned price fits the features of those particular samples rather than of the true distribution; in a sense it has "memorized" the samples. Second, as the samples grow, the two columns approach each other and 0.25. The loss in true revenue falls to roughly one fifth with every tenfold increase in samples.
Sample complexity: The minimum number of samples needed to find, with high probability (for example 95%), a price that is as close to the best revenue as desired (for example at most ε short of it).
Cole and Roughgarden (2014) studied this question for auctions. Roughly, the result is this: if the value distribution does not produce extreme values, the number of samples needed for a good mechanism grows moderately (polynomially) in the number of bidders and the desired accuracy. So the sample count does not explode for "a bit more accuracy". For distributions with extreme values, no such guarantee may be possible. The reason is intuitive: if very rare but very large values make up a significant part of the revenue, a great many samples are needed to see these values often enough.
The lesson of this subsection is familiar from machine learning: a mechanism learned from data overstates its own success on little data. Separating training and evaluation data is as necessary in mechanism design as in machine learning.
14.3.6Separate data for choosing and measuring
The simplest way to prevent optimistic bias is to split the data in two. The training data is used to choose the price and the validation data to measure the chosen price. Because the validation data was not used in the selection, a measurement made on it is not biased.
Use the split in Figure 14.10: training = 0.62, 0.15, 0.91, 0.47 and validation = 0.33, 0.78, 0.55, 0.08.
- Choosing the price on the training data. The sorted training values are 0.91, 0.62, 0.47, 0.15. The empirical revenues are 0.91 · 1/4 ≈ 0.228, 0.62 · 2/4 = 0.31, 0.47 · 3/4 ≈ 0.353, 0.15 · 4/4 = 0.15. The best is p = 0.47, with training revenue 0.353.
- Measuring on the validation data. Of the validation values, 0.78 and 0.55 are above the price: 0.47 · 2/4 = 0.235.
- Comparison. The true revenue is 0.47 · 0.53 ≈ 0.249. The training measurement (0.353) is very optimistic; the validation measurement (0.235) is close to the truth.
- When the roles are swapped. If training = the last 4, the sorted values are 0.78, 0.55, 0.33, 0.08 and the revenues are 0.195, 0.275, 0.2475, 0.08. The chosen price is 0.55. In the first 4 there are 0.62 and 0.91 above this price: 0.55 · 2/4 = 0.275.
- Cross-validation. The two validation estimates are averaged: (0.235 + 0.275)/2 = 0.255.
| Measurement | Calculation | Revenue |
|---|---|---|
| On the training data (where it was chosen) | 0.47 · 3/4 | 0.353 |
| On the validation data | 0.47 · 2/4 | 0.235 |
| True, U[0, 1] | 0.47 · 0.53 | 0.249 |
This method has a cost: the price is now chosen with only 4 samples rather than 8, so it is noisier. Cross-validation reduces this cost by using all the data in turn for both selection and measurement.
There is one more risk specific to mechanisms. In machine learning the data usually comes from nature; the data's producers do not care what the model will do. In an auction, however, the data comes from the bidders themselves. If buyers know that their past bids determine the future price, they can deliberately bid low today: they lose a little but face a lower reserve price in the future. That is, the data can also be strategic. In that case the learning algorithm is itself a mechanism, and it too must be incentive compatible.
14.3.7Differential privacy and the exponential mechanism
Another problem with learning from data is privacy. Once the learned price is announced, it leaks something about the values of past buyers. For example, if adding the data of a single buyer changes the price a great deal, that buyer's value can be inferred from the price.
Let M be a mechanism with random output. For every pair of datasets D and D′ that differ in the data of only one person, and for every outcome o,
P[M(D) = o] ≤ eε · P[M(D′) = o]
if this holds, then M is ε-differentially private.
In plain terms: even if one person's data is added or removed, the probability of every outcome changes only slightly. ε is the measure of privacy. A small ε means more privacy: the probabilities can change by a factor of at most eε. ε = 0 is perfect privacy, but then the output cannot depend on the data at all; as ε grows the output tracks the data more closely but privacy decreases. The definition requires a randomized mechanism. A deterministic rule can jump from one outcome to another with one person's data; the probability of that outcome drops from 1 to 0 and the ratio becomes infinite.
McSherry and Talwar (2007) gave a general tool that satisfies this definition.
Exponential mechanism: Each candidate outcome p has a score R(p) (for example the revenue of the price). Δ is the most a score can change when a single person is removed. The mechanism picks each candidate with probability proportional to its weight:
P[p is chosen] = exp(ε · R(p) / 2Δ) / Σp′ exp(ε · R(p′) / 2Δ)
The mechanism does not choose the best price with certainty; it draws a lottery. Good prices get exponentially higher probability; bad prices get a small but nonzero probability. The reason for the 2 in the formula is this: when one person is removed, both the numerator (the weight of the chosen candidate) and the denominator (the sum of all weights) can change. Each changes by a factor of at most eε/2; together they produce a change of at most a factor of eε. This is the bound in the definition.
This mechanism has a strong connection with game theory. Because a single person's report affects the outcome little, the gain that person can obtain by lying is also small. If utilities lie, for example, in the interval [0, 1] and the person changes their own report, then under ε-differential privacy the extra gain from lying is at most eε − 1. So differential privacy yields approximate incentive compatibility, and does so together with privacy. This is a surprising result: privacy and incentives can be handled with the same mathematical tool.
Figure 14.11 visualizes what the definition says. When one buyer is removed from the data, the selection probabilities change, but only a little. In this example the largest change is by a factor of 1.44; the bound the definition permits is e2 ≈ 7.39. The step-by-step calculation of the probabilities is in 14.3.8.
Assuming a linear proportion in the exponential mechanism. The probability is proportional not to the revenue but to exp(ε · R / 2Δ). A revenue difference translates exponentially into the probability ratio: if two candidates differ by 1 in score and ε = 2, Δ = 1, the probability ratio is e1 ≈ 2.72, not the ratio of the scores.
14.3.8Code trace: exp_mech()
The code below applies the exponential mechanism with the 8 buyer values from the example of learning a price from data. The candidate reserve prices are 0.2, 0.4, 0.6, 0.8. The score is the price times the number of buyers who would buy at that price (the total revenue). Since the prices are below 1, removing one buyer changes the score of a price by at most 1; hence Δ = 1. With ε = 2 the weight formula simplifies to exp(2R/2) = eR.
import math
def exp_mech(v, prices, eps):
R = [p * sum(x >= p for x in v) for p in prices]
w = [math.exp(eps * r / 2) for r in R] # Δ = 1
W = sum(w)
return [x / W for x in w]
v = [0.62, 0.15, 0.91, 0.47, 0.33, 0.78, 0.55, 0.08]
P = [0.2, 0.4, 0.6, 0.8]
q = exp_mech(v, P, 2)
print([round(x, 3) for x in q])
q = exp_mech(v[1:], P, 2) # 0.62 removed
print([round(x, 3) for x in q])The code runs line by line as follows. R computes the score of each candidate price; sum(x >= p for x in v) counts the buyers whose value is at least the price. w holds the weights. W is the sum of the weights. The function divides each weight by the sum and returns the probabilities. The code is run first with all the data and then with the first buyer (0.62) removed.
| p | R (D) | w = eR | q (D) | R (D′) | w′ | q (D′) | Ratio |
|---|---|---|---|---|---|---|---|
| 0.2 | 0.2 · 6 = 1.20 | 3.32 | 0.175 | 0.2 · 5 = 1.00 | 2.72 | 0.206 | 1.18 |
| 0.4 | 0.4 · 5 = 2.00 | 7.39 | 0.389 | 0.4 · 4 = 1.60 | 4.95 | 0.375 | 1.04 |
| 0.6 | 0.6 · 3 = 1.80 | 6.05 | 0.319 | 0.6 · 2 = 1.20 | 3.32 | 0.251 | 1.27 |
| 0.8 | 0.8 · 1 = 0.80 | 2.23 | 0.117 | 0.8 · 1 = 0.80 | 2.23 | 0.168 | 1.44 |
| Total | W = 18.98 | 1 | W′ = 13.22 | 1 | |||
With all the data the most likely price is p = 0.4 (38.9%); but it is not alone, and even the bad price 0.8 has an 11.7% chance. The differences among the weights are exponential: when the score rises from 0.8 to 2, the weight rises from 2.23 to 7.39. When the buyer of value 0.62 is removed, the scores of p = 0.2, 0.4, and 0.6 fall; the score of p = 0.6 falls the most (by 0.6). The score of p = 0.8 does not change, because 0.62 was already below 0.8. Since the total weight shrinks, the probability of p = 0.8 increases.
The last column is the ratio of the two distributions (the larger over the smaller). The largest ratio is 1.44, far below the bound e2 ≈ 7.39. The data of a single person affects the outcome only to a bounded extent; the mechanism is ε-differentially private. The bound is for the worst case; on a typical dataset the actual change is usually much smaller.
14.4Blockchain mechanisms
Blockchains are systems that enforce rules with public code. This section examines them not as a technology but as a setting for mechanism design. Three mechanisms are covered: transaction fee auctions that allocate scarce block space, the automated market maker that sets prices with a formula, and the value arising from the power to determine the order of transactions (MEV). The concrete rules and tools used in this area change often; the notes emphasize the lasting principles.
14.4.1Blockchains and smart contracts
Smart contract: A program whose code is public and which runs automatically on a blockchain when specified conditions occur. From the mechanism design point of view, it is a self-enforcing mechanism.
The importance of this definition for game theory is as follows. Mechanism design assumes that the designer will stick to the announced rules afterwards, that is, that there is a commitment. For example, in a second-price auction the seller cannot say, after seeing the bids, "actually you will pay the first price". In real life this assumption rests on trust or on law. In a smart contract, commitment is provided by code: once the rule is published, nobody can change it.
But this setting also brings a new problem. Pending transactions are visible to everyone before they enter a block. Seeing in advance what a transaction will do opens a way to profit from it. There is also a block producer that places transactions in blocks. The producer decides which transactions enter the block and in what order. Block space is limited; that is, it is a scarce resource, and a scarce resource is naturally allocated by an auction.
Figure 14.12 shows the process. Users send their transactions to the mempool. The block producer selects transactions from the pool and orders them. Three mechanism design questions arise in this structure:
- Transaction fee auction: How should limited block space be allocated among users who bid transaction fees?
- Decentralized exchange: Can the counterparty of a trade be a formula instead of a person? This is the idea of the automated market maker (AMM).
- On-chain governance: Token-weighted voting is used to change the rules of a system. The known problems of voting rules (strategic voting, Condorcet cycles, the power of large holders) apply here too.
14.4.2Transaction fee auctions
The number of transactions that fit in a block is limited. If more transactions are waiting, a rule decides which ones enter. This rule is called a transaction fee mechanism. Let us compare two designs.
The first-price design. In the design used by the first blockchains, each transaction bids a fee. The producer takes the highest bids and everyone pays their own bid. This is the familiar first-price auction. Suppose five transactions are pending with values 9, 7, 6, 4, 2, and the block capacity is 3. If everyone bids honestly, the three highest transactions enter and the producer is paid 9 + 7 + 6 = 22.
But in a first-price auction, honest bidding is not the best strategy. A user whose value is 9 gets no surplus by bidding 9; the user wants to bid the smallest amount that is enough to get in. So everyone shades their bid. The amount of shading depends on a guess about what the others will bid. As a result, every user struggles with the question "how much should I bid?" This is tiring, and users who cannot make the guess either overpay or are left out.
The base fee + tip design. In the design known in the literature as EIP-1559 (Ethereum Improvement Proposal), the protocol sets a base fee r for every block. Every transaction that is willing to pay the base fee enters. The base fee is burned: it is paid to no one and leaves circulation. Only a small tip added by the user goes to the producer.
The same five transactions (values 9, 7, 6, 4, 2), capacity 3, base fee r = 5, tip 1.
- For a transaction to enter, its value must be at least r + tip = 6. The transactions 9, 7, and 6 clear this threshold; 4 and 2 do not.
- 3 transactions enter; this does not exceed capacity, so no auction is needed.
- Burned: 3 · 5 = 15. Tips going to the producer: 3 · 1 = 3.
- The users' net utilities: 9 − 6 = 3, 7 − 6 = 1, 6 − 6 = 0.
No guesswork is needed on the user side: each user only answers the question "is my value greater than 6?"
Figure 14.13 compares the two designs on the same data. The main advantage of the base fee design is simplicity: if demand does not exceed capacity, the best strategy is to pay "base fee + small tip", and no price guessing is needed. This resembles buying at a posted price. When demand exceeds capacity, however, the design reverts to an auction: users compete on the tip.
Roughgarden (2021) formally defined the goals of a good transaction fee mechanism: simple bidding for the user, honest behavior for the producer, and resistance to collusion. It is hard to find a rule that satisfies all of these goals completely. These goals are treated in detail in 14.4.4.
14.4.3The base fee adjusts to demand
The base fee is not fixed; it tracks demand. The general principle is simple: if a block is above the target fullness the fee rises, and if it is below the target the fee falls. With the parameters of the original design, the update rule is:
rt+1 = rt · (1 + ⅛ · (gt − gtarget) / gtarget)
Here gt is the space used in block t, and gtarget is half the block capacity. The parts of the formula read as follows. (gt − gtarget)/gtarget is the relative deviation of fullness from the target. If the block is completely full, gt = 2gtarget and the deviation is +1. If the block is empty the deviation is −1. At the target the deviation is 0. Because the deviation is multiplied by ⅛, the fee rises or falls by at most 12.5% in a block.
Initially r = 100. The fullness levels of eight blocks are 100%, 100%, 100%, 100%, 50%, 25%, 0%, 0%.
- Block 1 is 100% full: deviation +1, change +12.5%. r = 100 · 1.125 = 112.5.
- Block 2 is 100% full: r = 112.5 · 1.125 ≈ 126.6.
- Block 3 is 100% full: r ≈ 126.6 · 1.125 ≈ 142.4.
- Block 4 is 100% full: r ≈ 160.2. In a demand surge the fee rises by at most 12.5% per block.
- Block 5 is 50% full: deviation 0, the fee stays the same: r ≈ 160.2.
- Block 6 is 25% full: deviation (0.25 − 0.5)/0.5 = −0.5, change −0.5/8 = −6.25%. r ≈ 160.2 · 0.9375 ≈ 150.2.
- Block 7 is 0% full: deviation −1, change −12.5%. r ≈ 150.2 · 0.875 ≈ 131.4.
- Block 8 is 0% full: r ≈ 131.4 · 0.875 ≈ 115. Empty blocks lower the fee; when demand falls, the price comes back.
Figure 14.14 shows how the fee tracks demand. The base fee works like a posted price that follows demand. When demand rises, the price rises too and blocks return to the target fullness. But adjustment takes time: in a sudden demand surge the fee can rise only in steps of 12.5%. Meanwhile the blocks are full and the system temporarily reverts to a tip-based auction.
The change is multiplicative. After four full blocks the fee is 100 · 1.1254 ≈ 160.2, not 100 + 4 · 12.5 = 150. Moreover, an increase is not exactly undone by a decrease of the same percentage: since 1.125 · 0.875 ≈ 0.984, one full and one empty block lower the fee by 1.6%.
Updating the base fee additively. The change is multiplicative: two full blocks give 100 → 112.5 → 126.6, not 125. A second mistake is to think that the base fee goes to the producer. The base fee is burned; only the tip goes to the producer.
14.4.4Why burn it?
Burning the base fee instead of giving it to the producer looks wasteful at first sight. The reason for this choice is explained by three properties of a good fee mechanism.
- User incentive compatibility
- If demand does not exceed capacity, the best bid for a user is the base fee plus a small tip. The user does not wonder "how much should I shade my bid?"
- Producer incentive compatibility
- The producer earns the most by following the rule. Adding fake transactions or hiding real ones does not pay.
- Collusion resistance
- The producer and some users cannot make a deal off-chain to increase their joint gain. For example, a side deal such as "pay the tip off-chain and keep the base fee low" should not pay.
The rationale for burning is seen in Figure 14.15. If the base fee went to the producer, it would be free for the producer to add its own fake transactions to the block: the fee it paid would return to itself. These fake transactions would fill the block and cause the base fee to rise in the next block. The producer could thus inflate the fee as it wished. When the fee is burned, every fake transaction is a real loss of r: 5 fake transactions burn 5r. Creating fake demand is now expensive.
Burning does not solve every problem. When blocks are full, users still compete on the tip and first-price behavior returns. This reflects a theoretical limit. Later work showed that when block space is scarce, the three properties formalized by Roughgarden (2021) cannot all be satisfied exactly at the same time (Chung and Shi, 2023; Chung, Roughgarden, and Shi, 2024). The two papers use different definitions of collusion resistance; the result is an impossibility under both definitions. That is, every transaction fee mechanism must make a trade-off among these three goals.
14.4.5Automated market maker: the constant-product rule
In a classical exchange, trades occur when buyer and seller orders are matched. In most decentralized exchanges, however, the counterparty is not a person but a pool. The pool holds two assets and the price is set by a formula.
Constant-product market maker: The pool holds x units of A and y units of B. After every trade the product x · y = k is preserved. A user who sells Δx units of A receives the amount of B that preserves the product:
(x + Δx) · (y − Δy) = x · y ⟹ Δy = y · Δx / (x + Δx)
The formula is derived as follows. After the trade the pool holds x + Δx of A and y − Δy of B, and the product does not change. Divide both sides by x + Δx: y − Δy = xy/(x + Δx). Hence Δy = y − xy/(x + Δx) = y(x + Δx − x)/(x + Δx) = yΔx/(x + Δx).
The instantaneous price of the pool is y/x (how many B one A is worth). If the pool is (1000, 1000), the initial price is 1 A = 1 B. But a large trade cannot be made at this price, because as the trade proceeds the B in the pool decreases and B becomes more expensive. The proportion by which the user receives less than at the initial price is called slippage.
| Δx (A) | Calculation | B received | Slippage |
|---|---|---|---|
| 10 | 1000 · 10 / 1010 | 9.90 | %1.0 |
| 100 | 1000 · 100 / 1100 | 90.91 | %9.1 |
| 250 | 1000 · 250 / 1250 | 200.00 | %20.0 |
| 500 | 1000 · 500 / 1500 | 333.33 | %33.3 |
A general rule follows from the table: slippage equals Δx/(x + Δx); that is, it depends on the size of the trade relative to the pool. For 10 A one receives 9.90 B instead of 10 B, a slippage of 1%. A user who sells half the pool (500 A) trades at a loss of one third. Real pools also charge a small trading fee. With a 0.3% fee, only 99.7 of 100 A goes into the pool: one receives 1000 · 99.7 / 1099.7 ≈ 90.66 B. The fee stays in the pool and goes to the liquidity providers who put assets into the pool.
Figure 14.16 shows how a trade moves the pool along the curve. After the 100 A trade the new price is 1100 / 909.09 ≈ 1.21 A: 1 B is now worth 1.21 A. A large trade moves the price against itself; this is called price impact. This structure has three consequences:
- When a gap opens between the pool price and the outside market price, arbitrageurs who buy cheap and sell dear rebalance the pool. The pool price thereby tracks the outside price.
- The price impact can be computed in advance and exactly by the formula. Where a pending trade will take the pool is known to everyone.
- This is why it is profitable to get ahead of a large pending trade (14.4.6).
14.4.6MEV and the sandwich attack
When the visibility of pending transactions combines with the predictability of price impact, someone who can determine the order of transactions can profit. The best-known way is the sandwich attack. The example uses the constant-product pool (1000, 1000); x · y = 1,000,000. A user wants to sell 100 A. Trading alone, the user would receive 90.91 B.
- Seeing. Before it enters the block, the user's transaction is visible to everyone in the mempool.
- Front-running. The attacker, who can determine the order, puts its own transaction ahead of the user's and sells 50 A. The B it receives: 1000 · 50 / 1050 ≈ 47.62. The pool becomes (1050, 952.38). The attacker has bought B cheaply and pushed the price up.
- The user's transaction. The user sells 100 A: it receives 952.38 · 100 / 1150 ≈ 82.82 B. The pool becomes (1150, 869.57). The user would have received 90.91 B alone; it has lost 90.91 − 82.82 = 8.09 B. The user's trade pushes the price of B up even further.
- Back-running. The attacker sells its 47.62 B back to the pool. In the pool B is now expensive and A is plentiful: it receives 1150 · 47.62 / (869.57 + 47.62) ≈ 59.71 A. The pool becomes (1090.29, 917.18).
- Outcome. The attacker started with 50 A and ended with 59.71 A: a profit of 9.71 A (excluding trading fees). The user's loss is 8.09 B.
| Step | Trade | Pool (A, B) | Result |
|---|---|---|---|
| 0 | Start | (1000, 1000) | |
| 1 | Attacker sells 50 A (front-run) | (1050, 952.38) | receives 47.62 B |
| 2 | User sells 100 A | (1150, 869.57) | receives 82.82 B (90.91 alone) |
| 3 | Attacker sells the B back (back-run) | (1090.29, 917.18) | receives 59.71 A |
The two halves of the attack form a "sandwich": the user's trade lies between the attacker's two trades. The attacker's profit comes from making the user trade at a bad price. The attacker pushes the price of B up before the user, then sells at the price the user has pushed even higher.
MEV (maximal extractable value): The value that can be obtained from the power to order, include, and exclude the transactions in a block (Daian et al., 2020).
The sandwich attack is one example of MEV. There are other sources of MEV, such as arbitrage (being the first to close a price gap between pools) and liquidation (being the first to close a loan whose collateral has become insufficient). What they share is that order carries value. From the mechanism design point of view, the basic question is: who has the ordering power, and who pays the price of this power? In the sandwich example the user pays.
14.4.7Code trace: sandwich()
The user has a simple protection: a slippage tolerance. The user sets a limit on the least amount of B that will be accepted. If the price falls below this limit, the trade is cancelled. The code below carries out the sandwich attack together with this limit.
swap = lambda x, y, dx: y - x * y / (x + dx) # xy=k
def sandwich(x, y, a, u, min_out):
b1 = swap(x, y, a) # front-run: sell a A
x, y = x + a, y - b1
b2 = swap(x, y, u) # user: sell u A
if b2 < min_out:
return None # tx reverted
x, y = x + u, y - b2
a2 = swap(y, x, b1) # back-run: sell b1 B
return round(a2 - a, 2)
for a in [20, 50, 80]:
print(a, sandwich(1000, 1000, a, 100, 82))The code runs line by line as follows:
swap(x, y, dx)is the amount of the second asset received whendxunits of the first asset are sold to the pool: y − xy/(x + dx). This is the same formula as in Definition 14.11.b1: the attacker sellsaA and receivesb1B. The pool is updated.b2: the user sellsuA and receivesb2B. Ifb2is smaller than the user's limitmin_out, the trade is cancelled and the function returnsNone.a2: the attacker sellsb1B back. This time B enters the pool and A leaves it; so the function is called with the arguments swapped:swap(y, x, b1).- The function returns the attacker's profit, that is,
a2 − a.
The user will sell 100 A and wants at least 82 B. The attacker tries three values for the front-run amount a.
| a | b1 (attacker's B) | b2 (user's B) | b2 ≥ 82? | a2 (A back) | Profit |
|---|---|---|---|---|---|
| 20 | 19.61 | 87.54 | yes | 24.07 | 4.07 |
| 50 | 47.62 | 82.82 | yes | 59.71 | 9.71 |
| 80 | 74.07 | 78.47 | no | — | None (cancelled) |
Figure 14.17 summarizes the result. A larger front-run pushes the price more and brings more profit. But the user's slippage limit cuts this off: at a = 80 the user would receive only 78.47 B, so the trade is cancelled and the attacker gains nothing. The attacker's best move is therefore the front-run amount that pushes exactly to the user's limit. A tight tolerance narrows the attacker's room and is a simple protection against MEV.
Thinking a loose slippage tolerance is safe. A loose tolerance raises the chance that the trade goes through, but it leaves the attacker more room to front-run. If the user's limit were 75 B, a = 80 would also go through and the attacker would earn more. On the other hand, a very tight tolerance causes the trade to be cancelled even with ordinary price movements. The tolerance is a trade-off.
14.4.8Countermeasures against MEV
The methods proposed against MEV can be grouped into five ideas. Each has a cost.
| Method | Idea | Cost |
|---|---|---|
| Tight slippage tolerance | A minimum amount to be received is set; a large front-run causes the trade to be cancelled. | Trades are rejected more often. |
| Commit–reveal | First a digest (hash) of the transaction is published; the content is revealed once the order is final. | Two steps and delay; transactions that are never revealed. |
| Encrypted mempool | The transaction is decrypted after its position has been fixed. | Requires trust in whoever holds the key. |
| Batch auction | All orders in a time slice are matched at the same price; order becomes irrelevant. | Waiting for the length of the slice. |
| Auctioning the right to order | The right to build the block is sold openly; MEV revenue is distributed competitively rather than secretly. | MEV does not disappear; ordering concentrates in a few large block builders. |
The first three methods restrict either the attacker's information or its room to act. Commit–reveal and the encrypted pool hide the content of the transaction until the order is fixed; the attacker cannot know what to get ahead of. This idea resembles the logic of the sealed-bid auction: bids are opened after everyone has submitted theirs.
A batch auction neutralizes the sandwich completely. All buy and sell orders in a time slice are matched at a single price. The attacker's "buy first" and "sell afterwards" orders execute in the same batch as the user's, at the same price. Because the buy and sell prices are the same, the profit is 0. Order no longer carries value.
The last method is a different approach: instead of trying to eliminate MEV, it prices it explicitly. When the right to order is sold in an auction, the value obtainable from MEV is reflected in the price of this right through competition. But this method may lead to power concentrating in a few large actors.
The forms these countermeasures take in practice change often. The lasting idea is this: ordering power carries value, and this value must either be reduced (hiding, batch matching) or priced explicitly (auctions). This is a general lesson of mechanism design: if a resource (here, position in the order) is valuable and is distributed for free, a hidden competition arises to capture it.
14.5Scale and open questions
The examples in the previous sections worked with a few players and a few options. In real applications the numbers of players, items, and strategies are very large. This section addresses the computational problems that scale brings, the approximate methods developed against them, and the open questions of the field.
14.5.1Computation and scale
The concepts of game theory must be computable. Knowing that an equilibrium exists does not mean that we can find it. Four observations stand out here.
- Finding an equilibrium can be hard. Finding a Nash equilibrium in general games is a PPAD-complete problem. That is, no efficient (polynomial-time) algorithm is expected for large games. In practice, approximate equilibria and learning dynamics are used instead of exact equilibria: players play repeatedly and update their strategies in a way that reduces their regret.
- Learning and search are powerful together. Superhuman results in multiplayer poker were obtained by combining regret-minimizing algorithms with search (Brown and Sandholm, 2019). Poker is an imperfect-information, multiplayer, and enormous game; the exact equilibrium cannot be computed, but a good approximate strategy can be found.
- Combinatorial auctions are hard. In auctions where several items are sold in bundles, determining the winner is NP-hard. For this reason the bidding language (which bundles bidders can report values for, and how) is designed carefully and approximation algorithms are used.
- Costs outside the theory matter too. Latency, data access, and energy costs determine the practicality of a mechanism as much as a theoretical guarantee does. An ad auction must finish within milliseconds; a better but slower rule is useless.
The source of the scale problem is the exponential growth of possibilities. In an auction with m items, each item is either in a bundle or not. The number of subsets is therefore 2m; removing the empty bundle leaves 2m − 1 bundles.
| Items m | Number of bundles 2m − 1 |
|---|---|
| 5 | 31 |
| 10 | 1.023 |
| 20 | 1.048.575 |
| 30 | 1.073.741.823 |
If every bidder reports a value for every bundle, the input grows exponentially in the number of items. With 30 items the number of values a single bidder would report exceeds one billion. The same explosion appears in games: in a game with n players and two actions each, the number of strategy profiles is 2n; for n = 20 there are 1,048,576 profiles. Even writing a payoff matrix as a table may be impossible. Large games are therefore defined by a short structure, as in congestion games (for example, by one delay function per road).
14.5.2Winner determination in combinatorial auctions
In a combinatorial auction, bidders bid not on individual items but on bundles of items. For example, a telecommunications firm may want the spectrum licenses of two neighboring regions together; a single region alone is worth little to it. The auctioneer must decide which bids win.
Winner determination problem: Each bid consists of a bundle and a value: (Si, vi). The problem is to choose, from among bids that share no items (do not overlap), the set that maximizes the total value.
This problem is the same as the weighted set packing problem of computer science. It is NP-hard and in general cannot be well approximated: it cannot be guaranteed that an efficient algorithm will stay within a given factor of the optimum on every input. The brute-force method tries 2n subsets for n bids. In practice, integer programming solvers are used that prune this search cleverly (cutting unpromising branches early).
The hardness of winner determination also affects the VCG mechanism. In VCG each winner pays the harm its presence causes the others. To compute this, the problem is solved once with all the bids and then once with each bidder removed; a total of n + 1 solutions are needed. If the problem is solved only approximately, the truthfulness guarantee of VCG can break. A bidder can lie to exploit the error of the approximation algorithm and obtain a better allocation in its own favor.
There are three items (a, b, c) and four bids.
| Bid | Bundle | Value |
|---|---|---|
| t1 | {a, b, c} | 10 |
| t2 | {a} | 4 |
| t3 | {b} | 4 |
| t4 | {c} | 3 |
- t1 contains all the items, so it overlaps with the other three bids. If t1 is chosen, no other bid can be chosen: total 10.
- t2, t3, and t4 do not overlap with one another. They can all be chosen together: 4 + 4 + 3 = 11.
- Intermediate choices are worth less: for example {t2, t3} = 8.
- The optimum is {t2, t3, t4} = 11. A single large bid is worth less than the sum of the small bids.
14.5.3Code trace: greedy()
A common approach for NP-hard problems is greedy selection: the bids are sorted by a key and, in order, every bid that does not overlap with the earlier ones is taken. What determines the result is which key is used.
def greedy(bids, key):
ranked = sorted(bids, key=key, reverse=True)
total, used = 0, set()
for S, v in ranked:
if not (S & used): # no overlap
total += v
used |= S
return total
T = [({'a','b','c'}, 10), ({'a'}, 4), ({'b'}, 4), ({'c'}, 3)]
print(greedy(T, lambda t: t[1]))
print(greedy(T, lambda t: t[1] / len(t[0])))The code runs line by line as follows. ranked sorts the bids from largest to smallest by the given key. total holds the value of what has been selected, and used holds the items in the selected bundles. For each bid, the loop looks at the intersection of the bundle with the used items (S & used). If the intersection is empty, the bid is taken: its value is added to the total and its items are added to the used set (|=). The code is run with two keys: first the value of the bid, then the value per item.
| Step | By value | Total | By value per item | Total |
|---|---|---|---|---|
| 1 | t1 {a, b, c} (10): taken | 10 | t2 {a} (4): taken | 4 |
| 2 | t2 {a} (4): a is used, skipped | 10 | t3 {b} (4): taken | 8 |
| 3 | t3 {b} (4): b is used, skipped | 10 | t1 {a, b, c} (10/3 ≈ 3.33): a and b are used, skipped | 8 |
| 4 | t4 {c} (3): c is used, skipped | 10 | t4 {c} (3): taken | 11 |
Figure 14.18 shows the result of the first key. Sorting by value takes the large bundle early and leaves out all the small bids. The result is 10; the optimum is 11. Greedy selection by value is fooled by large bundles, because it does not compare the value of a bundle with the resources it uses.
In Figure 14.19 the second key is used. The values per item are 4 for t2 and t3, 10/3 ≈ 3.33 for t1, and 3 for t4. t2 and t3 are tied; Python's sorted function keeps the original order on ties. Because this ordering measures value relative to the resources, it finds the optimum.
But this key can also fail. Consider the bids ({a, b}, 10) and ({a}, 6). The values per item are 5 and 6; greedy selection takes the 6 first, then skips the 10 because it overlaps, and stays at 6. Yet the bid of 10 alone is better. Both keys have bad examples. Lehmann, O'Callaghan, and Shoham (2002) proposed a key that divides the value by the square root of the bundle size: v / √|S|. With this key, greedy selection guarantees, even in the worst case, at least 1/√m of the optimal value (m is the number of items). Moreover, combined with a suitable payment rule, this greedy algorithm is incentive compatible when each bidder values only a single bundle (single-minded bidders).
Assuming that a greedy rule that finds the optimum in one example is always right. Value per item finds the optimum in the example of Table 14.17 but not in the example of ({a, b}, 10) and ({a}, 6). For an NP-hard problem, a simple rule is meaningful only together with an approximation guarantee.
14.5.4Other research directions
Besides the main topics of the chapter, four more research directions stand out.
Influence maximization in social networks. A firm will give a free product to k people and hopes that they will spread it to their friends. Who are the k "seed" people that maximize the spread (Kempe, Kleinberg, and Tardos, 2003)? The spread is described by a model.
Independent cascade model: Initially the seed people are influenced. Each newly influenced person tries to influence each of its neighbors exactly once, with probability p. The influenced neighbors do the same in the next step. The process stops when nobody is newly influenced.
Finding the best seed set is NP-hard. But the problem has a structure: the expected spread is submodular, that is, it has diminishing marginal returns. The additional contribution of making a person a seed decreases as the seed set grows, because the people that person would reach may already have been reached by other seeds. Thanks to this structure a simple greedy algorithm works well: at each step the person who contributes most to the expected spread is added to the seed set. This algorithm guarantees at least 1 − 1/e ≈ 63% of the best spread. Unlike the winner determination problem, here the structure gives greedy selection a strong guarantee.
- Multi-agent reinforcement learning
- Each agent's environment includes the other learning agents. Because the others also change as one agent learns, the environment is not stationary. Convergence guarantees in single-agent learning assume that the environment is fixed; so they do not hold here. Algorithmic collusion is an example of this problem.
- Sustainable systems
- Mechanisms such as carbon emission permit markets and demand response in electricity price an externality. The cost a player imposes on others is charged to that player through a tax (a Pigouvian tax). This is the same idea as in congestion pricing.
- Robustness
- Mechanisms that work well despite adversarial, faulty, or boundedly rational players. Classical theory assumes that everyone is rational; in real systems some participants do not conform to this assumption.
In addition, the following directions are active: information design or Bayesian persuasion (steering the receiver's decision by choosing the rule for disclosing information); aggregating human preferences in AI alignment (producing a single objective from the preferences of many people is a social choice problem); and prediction markets and peer prediction methods, which reward unverifiable reports by comparing them with the reports of others.
14.5.5Open research questions
The questions the field is seeking answers to today can be grouped under six headings. These questions rest not on a particular technology but on lasting tensions seen throughout the chapter.
- Human + AI markets
- How should the rules change when humans and agents interact in the same market? Agents are fast and tireless; humans are slow and have limited attention. The same rule can affect the two groups differently.
- Quantifying trade-offs
- How should the trade-offs among efficiency, privacy, and fairness be measured? In the exponential mechanism, privacy increases as ε decreases but revenue falls; there is no common language for such trade-offs.
- Adaptive robustness
- How can strategy-robust mechanisms adapt to changing behavior? If a mechanism adapts by learning, the learning process itself can be manipulated.
- Theory and data
- How can the assumptions of models be tested with real platform data? Theory assumes particular value distributions and rationality; the data may not confirm these assumptions.
- Equilibrium of learning agents
- What do algorithms that learn against one another converge to, and how can collusion be prevented?
- Verifiable mechanisms
- How can it be proved or audited that a learned rule is incentive compatible? For hand-designed rules there are proofs; for neural network rules there is only measured regret.
14.6Review: common mistakes and worked problems
This section collects the chapter's numerical results in a table, lists the most common mistakes together, and gives the example problems from the slides with their solutions.
| Topic | Description | Number in this chapter |
|---|---|---|
| Bargaining between agents | Backward induction; patience and the last word are power | T = 4: A 18.1; infinite horizon 52.6 |
| Algorithmic collusion | The trigger strategy sustains cooperation if δ is large enough | δ ≥ 1/2 |
| Price from data | Empirical revenue maximization; overfitting with few samples | p = 0.47: empirical 0.294, true 0.249 |
| Exponential mechanism | Probability ∝ exp(ε · revenue / 2Δ); privacy + approximate IC | ε = 2: ratio ≤ e2 ≈ 7.39 (1.44 in the example) |
| Base fee | +12.5% for a full block, −12.5% for an empty one; the fee is burned | 100 → 160.2 → 115 |
| MEV | Ordering power carries value; the sandwich attack | User −8.09 B, attacker +9.71 A |
| Course map | Equilibrium → design → application → learning → future | A single concept map from the preliminaries to future directions |
- Forgetting the number of firms: The patience that suffices with two firms is not enough in a crowded market: the threshold is δ ≥ 1 − 1/n, which is 0.80 for n = 5.
- Confusing finite and infinite horizons: With a finite horizon the last proposer is strong (A gets 18.1 at T = 4); with an infinite horizon the first proposer is slightly ahead (52.6).
- Taking empirical revenue for the truth: The success of a price selected and measured on the same data is overstated; separate validation data is needed.
- Linear proportion in the exponential mechanism: The probability is proportional not to revenue but to exp(ε · R / 2Δ); a revenue difference translates exponentially into the probability ratio.
- Updating the base fee additively: The change is multiplicative: two full blocks give 100 → 112.5 → 126.6 (not 125). The base fee does not go to the producer; it is burned.
- Thinking a loose slippage tolerance is safe: It raises the chance that the trade goes through, but leaves the attacker more room to front-run.
The six worked problems below briefly repeat the chapter's calculations.
Two-round bargaining. 100 TL, A proposes and then B, δ = 0.9. Round 2 is the last round and B gets 100 there. In round 1, A offers B its waiting value: 0.9 · 100 = 90. The division is A 10, B 90. In the infinite horizon A's share is 100/1.9 ≈ 52.6.
Trigger with three firms. The monopoly profit of 100 is shared equally; a deviator gets 100 for one period, then 0. The condition is (100/3)/(1 − δ) ≥ 100 ⟺ 1 − δ ≤ 1/3 ⟺ δ ≥ 2/3. As the number of players grows, collusion gets harder.
Empirical price. The sample values are 0.9, 0.6, 0.5, 0.2. The revenues are 0.9 · 1/4 = 0.225, 0.6 · 2/4 = 0.3, 0.5 · 3/4 = 0.375, 0.2 · 4/4 = 0.2. The best is p = 0.5, with revenue 0.375.
Base fee. r = 100, three full blocks and one empty block: 100 · 1.1253 · 0.875 ≈ 124.58.
Map question. In the GSP–VCG comparison at the Online Platforms node, VCG comes from the Mechanism Design topic. The second-price idea on which GSP rests comes from the second-price (Vickrey) auction in the Auctions topic.
Exponential mechanism. Two candidate prices have revenues 2 and 1, ε = 2, Δ = 1. The weights are e2 and e1. The probabilities are e2/(e2 + e) = e/(e + 1) ≈ 0.731 and 1/(e + 1) ≈ 0.269.
One simple example to try on your own is the pizza vote: three friends must agree on a single pizza, each proposes toppings, and then they vote. Even a small console application shows the voting rule and strategic voting (14.6.1).
14.6.1Example: the pizza vote
A small example can show modeling a situation, solving it, and seeing strategic behavior all at once. Three friends must agree on a single pizza. Their preferences are as follows:
| Person | 1st | 2nd | 3rd |
|---|---|---|---|
| Ali | mushroom | sausage | olives |
| Banu | sausage | mushroom | olives |
| Cem | olives | sausage | mushroom |
- Model. The players are the three people. A strategy is the reported ranking. The payoff is 2, 1, or 0 depending on where the winning topping stands in the person's true ranking.
- Plurality. Each candidate gets one first-place vote: a 1–1–1 tie. The plurality rule cannot decide.
- Borda (2, 1, 0). Mushroom: 2 + 1 + 0 = 3; sausage: 1 + 2 + 1 = 4; olives: 0 + 0 + 2 = 2. Sausage wins.
- Condorcet. Sausage versus mushroom: Banu and Cem prefer sausage, 2–1. Sausage versus olives: Ali and Banu prefer sausage, 2–1. Sausage wins both pairwise comparisons: it is the Condorcet winner.
- Strategic vote. If Ali buries sausage at the bottom and reports "mushroom, olives, sausage", the Borda scores become mushroom 2 + 1 + 0 = 3, olives 1 + 0 + 2 = 3, sausage 0 + 2 + 1 = 3. If the tie is broken alphabetically, mushroom wins. By lying, Ali has gotten his favorite chosen: his payoff rises from 1 to 2.
This finding is an example of the burying strategy in the Borda count (pushing the strong rival to the bottom of the ranking) and a small reflection of the Gibbard–Satterthwaite theorem. The example can also be tried in code. A console version takes the rankings and counts them under the plurality, two-round runoff, Borda, Condorcet, and approval voting rules side by side. In a web version the user changes one player's report and sees how the winner shifts. Changing the tie-breaking rule also changes the winner; a small detail of the rule can determine the outcome.
14.7Summary
- Software agents are now players: they have goals, knowledge, and strategies. The principal–agent problem, sensitivity to framing, prompt injection, and accountability are game-theoretic questions that regain importance with agents.
- Finite-horizon alternating-offers bargaining is solved by backward induction; the last word is power. With 100 TL, δ = 0.9, and four rounds, the first proposer gets only 18.1.
- In the infinite horizon the Rubinstein solution gives the first proposer the share (1 − δB)/(1 − δAδB); with symmetric patience, 1/(1 + δ). Patience is bargaining power.
- The grim trigger strategy sustains collusion if δ ≥ 1 − 1/n. Frequent price updates, transparent prices, and price-matching guarantees facilitate collusion; learning pricing algorithms can learn a high price without an explicit agreement.
- There is no universally best strategy: an agent's success depends on the game, the opponents, noise, and memory.
- Automated mechanism design finds the rule as the solution of an optimization with IC and IR constraints. In the two-type example the optimum is a vertex of the linear program and corresponds to a posted price.
- Empirical revenue maximization overstates its success because it is selected and measured on the same data (0.294 against a true 0.249). Sample complexity asks how many samples a good price requires; separate data is needed for selection and for measurement.
- The exponential mechanism selects candidates with probability proportional to exp(ε · R / 2Δ); it provides ε-differential privacy and approximate incentive compatibility.
- A smart contract provides commitment through code but makes pending transactions visible. The base fee + tip rule simplifies bidding for users; the base fee changes by at most 12.5% per block according to demand and is burned to make fake demand expensive.
- The three goals of user incentive compatibility, producer incentive compatibility, and collusion resistance cannot all be fully satisfied together when block space is scarce.
- In a constant-product market maker the price impact can be computed in advance; this makes the sandwich attack possible. MEV is the value of ordering power; countermeasures either reduce this value or price it explicitly. A tight slippage tolerance is the simplest protection.
- Winner determination in combinatorial auctions is NP-hard; greedy rules are approximate and the choice of key determines the result. In influence maximization, submodularity gives greedy selection a 1 − 1/e guarantee.
14.8Key terms
- principal–agent problem
- framing effect
- prompt injection
- backward induction
- subgame perfect equilibrium
- discount factor
- Rubinstein bargaining model
- stationary strategy
- collusion
- algorithmic collusion
- grim trigger strategy
- reinforcement learning
- automated mechanism design
- approximate incentive compatibility
- empirical revenue
- overfitting
- sample complexity
- cross-validation
- differential privacy
- exponential mechanism
- smart contract
- commitment
- mempool
- transaction fee mechanism
- base fee
- tip
- fee burning
- automated market maker
- slippage tolerance
- price impact
- maximal extractable value
- sandwich attack
- front-running
- back-running
- batch auction
- combinatorial auction
- winner determination problem
- NP-hard
- PPAD-complete
- influence maximization
- independent cascade model
- submodularity
- multi-agent reinforcement learning
- Pigouvian tax
- information design
- prediction market
- peer prediction
- reproducibility
- confidence interval
- Borda count
- Condorcet winner
14.9Test Yourself
Two agents will share 100 TL over three rounds: A proposes in rounds 1 and 3, B in round 2; δ = 0.8. What is the division in the equilibrium found by backward induction? In the infinite horizon, if A's patience were δA = 0.8 and B's were δB = 0.9, what would A's share be?
Answer
In round 3 the last word is A's: A gets 100. In round 2 B offers A its waiting value 0.8 · 100 = 80: A 80, B 20. In round 1 A offers B 0.8 · 20 = 16: A 84, B 16, and the proposal is accepted immediately. In the infinite horizon x* = (1 − 0.9)/(1 − 0.72) = 0.1/0.28 ≈ 0.357: A gets 35.7. The more impatient A gets the small share even though it is the first proposer.
Two firms each earn a profit of 50 per period at the monopoly price. A firm that undercuts gets 100 per period; however, the rival notices the undercutting only two periods later, so the deviator gets 100 for two periods and then 0 forever. For which δ does the grim trigger strategy sustain cooperation? How does the threshold change compared with immediate detection?
Answer
Cooperation is worth 50/(1 − δ) and deviation is worth 100 + 100δ. The condition is 50/(1 − δ) ≥ 100(1 + δ) ⟺ 50 ≥ 100(1 − δ)(1 + δ) = 100(1 − δ2) ⟺ δ2 ≥ 1/2 ⟺ δ ≥ 0.707. With immediate detection the threshold was 0.5. Delayed detection makes deviation more profitable and raises the required patience; this is why transparent prices facilitate collusion.
The 5 buyer values observed in the past are 0.8, 0.7, 0.3, 0.25, 0.1. Which price maximizes the empirical revenue, and what is that revenue? If the values actually come from U[0, 1], what is the true revenue of this price?
Answer
The revenues are 0.8 · 1/5 = 0.16, 0.7 · 2/5 = 0.28, 0.3 · 3/5 = 0.18, 0.25 · 4/5 = 0.2, 0.1 · 5/5 = 0.1. The best is p = 0.7, with empirical revenue 0.28. The true revenue is 0.7 · 0.3 = 0.21, below the best 0.25. Five samples have pushed the price away from the true best (0.5), and the empirical revenue is again optimistic.
In an exponential mechanism the scores of three candidate prices are 0, 1, and 2; ε = 1, Δ = 1. What are the selection probabilities? How many times the probability of the worst candidate is the probability of the best?
Answer
The weights are exp(R/2): e0 = 1, e0.5 ≈ 1.649, e1 ≈ 2.718; the total is ≈ 5.367. The probabilities are ≈ 0.186, 0.307, 0.506. The best candidate gets e1 ≈ 2.72 times the probability of the worst; this has nothing to do with the score ratio (2/0).
The base fee is 200. The next four blocks are 100%, 100%, 0%, 0% full. What is the base fee after the fourth block? Why does the fee not return to 200?
Answer
200 → 200 · 1.125 = 225 → 253.125 → 253.125 · 0.875 ≈ 221.48 → ≈ 193.80. The change is multiplicative and 1.125 · 0.875 ≈ 0.984 < 1; an equal number of full and empty blocks lowers the fee slightly.
The constant-product pool is (2000, 2000). A user sells 200 A. How much B does it receive and what is the slippage in percent? How does this compare with selling 100 A in the (1000, 1000) pool?
Answer
Δy = 2000 · 200 / 2200 ≈ 181.82 B; slippage 1 − 181.82/200 ≈ 9.1%. Selling 100 A in the (1000, 1000) pool also gives 9.1% slippage. Slippage depends on Δx/(x + Δx), that is, on the size of the trade relative to the pool; a deep pool carries the same trade with less slippage.
Four bundle bids: t1 = ({a, b}, 6), t2 = ({b, c}, 6), t3 = ({a}, 4), t4 = ({c}, 4). What totals do greedy selection by value and by value per item give? What is the optimum?
Answer
By value the order is t1, t2, t3, t4: t1 is taken (a, b); t2 is skipped because of b, t3 because of a; t4 is taken. Total 10. The value per item is 4 for t3 and t4 and 3 for t1 and t2: t3 and t4 are taken, and t1 (a) and t2 (c) overlap. Total 8. The optimum is 10 ({t1, t4} or {t2, t3}). This time value per item is fooled by the small bundles.
In an agent tournament a pairing is repeated 25 times; the mean score is 3.1 and the standard deviation 0.5. What is the approximate 95% confidence interval? How does the width of the interval change if the number of repetitions is raised to 100?
Answer
The half-width is 1.96 · 0.5 / √25 = 1.96 · 0.1 ≈ 0.196; the interval is about [2.90, 3.30]. With 100 repetitions √100 = 10 and the half-width falls to ≈ 0.098: four times the repetitions halve the interval.
14.10Further reading
- T. Roughgarden, Twenty Lectures on Algorithmic Game Theory (2016): covers mechanism design, combinatorial auctions, and learning dynamics from a computer science perspective, in short lectures.
- T. Roughgarden, "Transaction Fee Mechanism Design" (2021): defines the goals of transaction fee mechanisms formally (user and producer incentive compatibility, collusion resistance) and analyzes the base fee rule against these goals.
- E. Calvano, G. Calzolari, V. Denicolò, S. Pastorello, "Artificial Intelligence, Algorithmic Pricing, and Collusion" (2020): gives detailed simulations in which learning pricing agents learn a high price without communicating and punish deviations.
- D. Easley, J. Kleinberg, Networks, Crowds, and Markets (2010): explains spreading in networks, bargaining, and markets with little mathematics and many examples.
14.11References
- R. Axelrod, “Effective choice in the Prisoner's Dilemma”, Journal of Conflict Resolution 24(1), 1980.
- N. Brown, T. Sandholm, “Superhuman AI for multiplayer poker”, Science, 2019.
- E. Calvano, G. Calzolari, V. Denicolò, S. Pastorello, “Artificial Intelligence, Algorithmic Pricing, and Collusion”, American Economic Review, 2020.
- H. Chung, E. Shi, “Foundations of transaction fee mechanism design”, ACM-SIAM SODA, 2023.
- H. Chung, T. Roughgarden, E. Shi, “Collusion-resilience in transaction fee mechanism design”, ACM EC, 2024.
- R. Cole, T. Roughgarden, “The Sample Complexity of Revenue Maximization”, ACM STOC, 2014.
- V. Conitzer, T. Sandholm, “Complexity of Mechanism Design”, UAI, 2002.
- P. Daian et al., “Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability”, IEEE S&P, 2020.
- P. Dütting, Z. Feng, H. Narasimhan, D. Parkes, S. Ravindranath, “Optimal Auctions through Deep Learning”, ICML, 2019.
- D. Easley, J. Kleinberg, Networks, Crowds, and Markets, Cambridge University Press, 2010.
- R. A. Hearn, E. D. Demaine, Games, Puzzles, and Computation, A K Peters, 2009.
- A. R. Karlin, Y. Peres, Game Theory, Alive, AMS, 2017.
- D. Kempe, J. Kleinberg, É. Tardos, “Maximizing the Spread of Influence through a Social Network”, KDD, 2003.
- D. Lehmann, L. I. O'Callaghan, Y. Shoham, “Truth revelation in approximately efficient combinatorial auctions”, Journal of the ACM 49(5), 2002.
- F. McSherry, K. Talwar, “Mechanism Design via Differential Privacy”, IEEE FOCS, 2007.
- N. Nisan, T. Roughgarden, É. Tardos, V. Vazirani (ed.), Algorithmic Game Theory, Cambridge University Press, 2007.
- T. Roughgarden, Twenty Lectures on Algorithmic Game Theory, Cambridge University Press, 2016.
- T. Roughgarden, “Transaction Fee Mechanism Design”, ACM EC, 2021.
- A. Rubinstein, “Perfect Equilibrium in a Bargaining Model”, Econometrica 50(1), 1982.
Related pages: Chapter 14 slides · Course pages: Roughgarden CS364A, Shah CSC304 · Tools: Gambit, Nashpy · Networks, Crowds, and Markets · © Sercan Külcü. All rights reserved.