Skip to content

charlieviettq/awesome-agent-skill / .claude/skills/algo-ad-vcg

"algo-ad-vcg"

Verified

"Implement VCG mechanism for incentive-compatible ad slot allocation with truthful bidding. Use this skill when the user needs to design a truthful auction mechanism, compute externality-based payments, or understand why platforms may prefer GSP over VCG — even if they say 'truthful auction design', 'VCG payments', or 'incentive-compatible mechanism'.".

FileKindSize
SKILL.mdskill md3.8 KB
examples/sample_scenario.mdmarkdown4.0 KB
references/combinatorial-vcg.mdmarkdown11.7 KB
references/revenue-comparison.mdmarkdown7.9 KB

examples/sample_scenario.md

View on GitHub
# Example: TaipeiMart 搜尋廣告版位競標

## Scenario

TaipeiMart 是一個台灣中型電商平台,搜尋結果頁有 2 個贊助廣告版位。產品經理 Vivian 正在評估是否將目前的 GSP 拍賣換成 VCG,理由是「VCG 保證誠實出價,能讓廣告主更放心」。她提供了本週一場競標的數據,想知道 VCG 機制下的分配結果、各家付款金額,以及與 GSP 的收益差異。

**輸入數據:**

| 廣告主 | 品牌 | 每次點擊出價(真實估值) |
|--------|------|------------------------|
| A | 3C 旗艦館 | $12 |
| B | 美妝優選 | $9 |
| C | 戶外運動館 | $4 |

版位 CTR:
- Slot 1(頂部):0.6
- Slot 2(次位):0.3

---

## Analysis

### Phase 1: Input Validation

- 所有估值非負:$12, $9, $4 ✓
- CTR 遞減:0.6 > 0.3 ✓
- 通過 Gate,進入分配計算。

---

### Phase 2: 福利最大化分配

**計算所有可能分配的社會福利 Σ(value_i × CTR_slot_j):**

| 分配方式 | 計算 | 社會福利 |
|----------|------|---------|
| A→S1, B→S2 | 12×0.6 + 9×0.3 | 7.20 + 2.70 = **9.90** |
| A→S1, C→S2 | 12×0.6 + 4×0.3 | 7.20 + 1.20 = 8.40 |
| B→S1, A→S2 | 9×0.6 + 12×0.3 | 5.40 + 3.60 = 9.00 |
| B→S1, C→S2 | 9×0.6 + 4×0.3 | 5.40 + 1.20 = 6.60 |

**最優分配:A→Slot1, B→Slot2(福利 = 9.90)**

---

### Phase 3: 計算 VCG 付款(外部性定價)

**廣告主 A 的付款:**

移除 A 後,剩下 B($9) 和 C($4):
- 最優分配:B→Slot1, C→Slot2 → 他人福利 = 9×0.6 + 4×0.3 = 5.40 + 1.20 = **6.60**

有 A 在場時,他人(B 在 Slot2, C 未得標)的福利 = 9×0.3 + 0 = **2.70**

**Payment_A = 6.60 − 2.70 = $3.90**

---

**廣告主 B 的付款:**

移除 B 後,剩下 A($12) 和 C($4):
- 最優分配:A→Slot1, C→Slot2 → 他人福利 = 12×0.6 + 4×0.3 = 7.20 + 1.20 = **8.40**

有 B 在場時,他人(A 在 Slot1, C 未得標)的福利 = 12×0.6 + 0 = **7.20**

**Payment_B = 8.40 − 7.20 = $1.20**

---

**公式驗證(逐位差法):**

Payment_A = value_{B} × (CTR_1 − CTR_2) + value_{C} × CTR_2
           = 9 × (0.6 − 0.3) + 4 × 0.3
           = 2.70 + 1.20 = **$3.90** ✓

Payment_B = value_{C} × CTR_2
           = 4 × 0.3 = **$1.20** ✓

---

### Phase 3: IR 驗證

| 廣告主 | 估值 | VCG 付款 | 剩餘利潤 |
|--------|------|----------|---------|
| A | $12 | $3.90 | $8.10 ✓ |
| B | $9 | $1.20 | $7.80 ✓ |

個別理性 (IR) 滿足,所有付款 ≤ 估值。

---

### GSP 對比(現行機制)

GSP 規則:贏家付下一名出價 × 對應 CTR 差:

| 廣告主 | GSP 付款 | VCG 付款 |
|--------|---------|---------|
| A | 9 × 0.6 = $5.40 | $3.90 |
| B | 4 × 0.3 = $1.20 | $1.20 |
| **平台總收益** | **$6.60** | **$5.10** |

> VCG 平台收益比 GSP **少 23%**,但對廣告主而言誠實出價是優勢策略。

---

## Result

```json
{
  "allocation": [
    {
      "advertiser": "A(3C 旗艦館)",
      "slot": 1,
      "ctr": 0.6,
      "vcg_payment_per_click": 3.90,
      "total_welfare_contribution": 7.20
    },
    {
      "advertiser": "B(美妝優選)",
      "slot": 2,
      "ctr": 0.3,
      "vcg_payment_per_click": 1.20,
      "total_welfare_contribution": 2.70
    }
  ],
  "metadata": {
    "total_welfare": 9.90,
    "total_vcg_revenue": 5.10,
    "total_gsp_revenue": 6.60,
    "revenue_gap": -1.50,
    "mechanism": "vcg"
  }
}
```

**給 Vivian 的建議:**

VCG 在理論上確保誠實出價,但在本場競標中平台收益比 GSP 少 $1.50(約 23%)。這不是異常——而是 VCG 的結構性特徵。外部性定價讓廣告主付的是「他們對他人的傷害」,不是出價競爭的壓力,因此付款普遍偏低。

- **若目標是廣告主信任度與生態健康**:VCG 有優勢,避免廣告主的策略性出價疲勞。
- **若目標是短期平台收益**:維持 GSP,VCG 在此案例損失約 23% 收益。
- **實務注意**:廣告主 C 若與 A 或 B 聯合壓低出價,可以降低對方的付款金額(VCG 的合謀弱點),TaipeiMart 規模下需評估此風險。
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall