Instance-dependent sample complexity for zero-sum matrix games
Characterize, game by game, how many noisy payoff samples it takes to find a near-equilibrium of a zero-sum matrix game.

Comparing changes
Choose two branches to see what changed, then open a pull request to bring the work across.
Able to merge. These branches can be merged automatically.
A pull request is already open: #4 混合均衡矩阵族的有限置信度样本下界与可运行证书
3 commits
+59 −0 routes/ww1361095001-support-gap/README.md added View file
| @@ -0,0 +1,59 @@ | ||
| 1 | +--- | |
| 2 | +issue: 3 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# 混合均衡附近,排除每个额外动作需要多少次查询? | |
| 7 | + | |
| 8 | +考虑 COLT 2025 上 Maiti 提出的逐项带噪查询问题。本路线给出一个特殊矩阵族的显式有限置信度下界,以及一个可用有理数逐项复核的 $4\times5$ 证书。它量化了区分额外行和额外列的采样代价。一般矩阵的最优复杂度、匹配上界以及均衡核心本身的学习代价仍待研究。[COLT 原问题](https://proceedings.mlr.press/v291/maiti25b.html) | |
| 9 | + | |
| 10 | +## 模型与结论 | |
| 11 | + | |
| 12 | +行方最大化,列方最小化。每次自适应选择一个单元,独立观测 $N(A_{ij},1)$。算法几乎必然停机,在基准矩阵和下述每个替代矩阵上都以至少 $1-\delta$ 的概率返回一对策略,使双方各自的单边偏离收益均不超过 $\varepsilon$。要求 $0<\delta<1/2$、$\varepsilon>0$。对所有 1-次高斯噪声都正确的算法,在这个高斯子模型上同样必须满足下界。采样数的期望都取在基准矩阵 $A$ 上。 | |
| 13 | + | |
| 14 | +取 $n,m\ge3$。左上角是 $\bigl(\begin{smallmatrix}s&-s\\-s&s\end{smallmatrix}\bigr)$,其中 $s>0$。给每个额外行 $i>2$ 一个间隔 $g_i>3\varepsilon$,给每个额外列 $j>2$ 一个间隔 $h_j>3\varepsilon$。按下表填入剩余收益。 | |
| 15 | + | |
| 16 | +| 行与列 | 核心列(前两列) | 额外列 $j$ | | |
| 17 | +|---|---|---| | |
| 18 | +| 核心行(前两行) | 上述 $2\times2$ 核心 | $h_j$ | | |
| 19 | +| 额外行 $i$ | $-g_i$ | $h_j-g_i$ | | |
| 20 | + | |
| 21 | +双方各自均匀随机使用前两个动作,构成价值为零的唯一均衡。任何额外行在每一列上都比两条核心行的均匀混合少得 $g_i$,额外列亦比核心列的均匀混合多付 $h_j$,故额外动作在精确均衡中概率为零。剩下的二阶核心要求双方都等概率混合。 | |
| 22 | + | |
| 23 | +记 $N_{i\cdot}$、$N_{\cdot j}$ 分别为第 $i$ 行、第 $j$ 列的查询数,$\tau$ 为总查询数。令 $K_\delta=(1-2\delta)\log((1-\delta)/\delta)$,对数取自然底。则 | |
| 24 | + | |
| 25 | +$$ | |
| 26 | +\mathbb E_A N_{i\cdot}\ge\frac{K_\delta}{2g_i^2},\qquad | |
| 27 | +\mathbb E_A N_{\cdot j}\ge\frac{K_\delta}{2h_j^2},\qquad | |
| 28 | +\mathbb E_A \tau\ge K_\delta\max\left\{\sum_{i>2}\frac1{2g_i^2},\sum_{j>2}\frac1{2h_j^2}\right\}. | |
| 29 | +$$ | |
| 30 | + | |
| 31 | +这些是对统一正确算法的限制。若学习者预先知道输入必定是表中的基准族、且知道核心位置,直接输出均匀混合即可。因此正确性必须覆盖替代矩阵。替代矩阵允许有多个均衡。 | |
| 32 | + | |
| 33 | +## 证明 | |
| 34 | + | |
| 35 | +1. **基准矩阵上的概率上界。** 设算法的输出为 $(x,y)$。将第 $i$ 行的全部概率 $x_i$ 挪给两条核心行,各分一半。对任意 $y$,收益恰增 $x_i g_i$。故任一 $\varepsilon$-均衡都满足 $x_i\le\varepsilon/g_i$。 | |
| 36 | +2. **替代矩阵上的概率下界。** 固定一个 $i>2$,仅将该行所有元素增大 $2g_i$ 得到 $B$。该行面对任意列的收益均至少为 $g_i$,所以一个 $\varepsilon$-均衡的实际收益 $w=x^\top B y$ 至少为 $g_i-\varepsilon$。令 $y^0$ 均匀选择两条核心列。针对 $y^0$,被提升行得 $g_i$,其余行得至多零,故 $x^\top B y^0\le g_i x_i$。列方的偏离收益至多 $\varepsilon$ 意味着 $w\le x^\top B y^0+\varepsilon$。合并得到 $x_i\ge1-2\varepsilon/g_i$。 | |
| 37 | +3. **转换为采样数。** 由于 $g_i>3\varepsilon$,前两步给出的输出区间严格分离。取事件 $E=\{x_i\le\varepsilon/g_i\}$,有 $P_A(E)\ge1-\delta$、$P_B(E)\le\delta$。把每个单元视为一个可采样动作,对停机时的观测记录应用 Kaufmann、Cappé、Garivier 的引理 1。事件的二元相对熵至少为 $\mathrm{kl}(1-\delta,\delta)=K_\delta$。每个被改动单元的一次观测贡献 $(2g_i)^2/2=2g_i^2$ 的相对熵,其余单元贡献零。于是 $2g_i^2\mathbb E_A N_{i\cdot}\ge K_\delta$。若期望总采样数无穷,总数结论直接成立。[换测度引理 1](https://www.jmlr.org/papers/volume17/kaufman16a/kaufman16a.pdf) | |
| 38 | +4. **列与总数。** 对 $-A^\top$ 交换玩家,同一证明给出列下界;对应的替代矩阵将原来一列降低 $2h_j$。分别在额外行之间、额外列之间求和,每组都至多计入全部 $\tau$ 次查询。两组的交叉单元可能同时被计入,所以可取两组下界的最大值。证明没有把它们相加。 | |
| 39 | + | |
| 40 | +## 可复核的算例 | |
| 41 | + | |
| 42 | +证书取 $s=1$、$\varepsilon=1/16$、$g=(1/4,1/2)$、$h=(1/4,1/4,1/2)$。行系数为 8、2,列系数为 8、8、2,所以总下界为 $18K_\delta$。当 $\delta=0.05$ 时是 $16.2\log 19\approx47.7$ 次**期望**查询。单次运行的长度可以更短。 | |
| 43 | + | |
| 44 | +从仓库根目录执行以下命令,只需 Python 3 标准库。 | |
| 45 | + | |
| 46 | +~~~ | |
| 47 | +python -X utf8 -B routes/ww1361095001-support-gap/verify_certificate.py routes/ww1361095001-support-gap/certificate.json | |
| 48 | +python -X utf8 -B routes/ww1361095001-support-gap/test_certificate.py -v | |
| 49 | +~~~ | |
| 50 | + | |
| 51 | +程序对提交的矩阵及每个单独扰动逐项做分数运算,核对支配关系、替代行收益界、输出区间的严格分离及最终系数。七个测试覆盖原证书、交换玩家后的证书,以及五个应拒绝的输入,包括把两侧系数误加为 28 和让输出区间恰好相接。程序检验有限证书;对所有维度和所有自适应停时的推理见上面的证明,需由维护者复核。若项目将来采纳此程序作检查,建议把判定范围明确限定为这类证书。 | |
| 52 | + | |
| 53 | +## 与已有工作的关系 | |
| 54 | + | |
| 55 | +Maiti、Jamieson、Ratliff 研究了带噪 $n\times2$ 博弈的实例依赖复杂度。Poiani、Bernasconi、Celli 给出了更一般的无限答案纯探索理论,并在附录 A.4 讨论了近似纳什均衡。本路线把标准换测度法应用到一组显式的行列扰动,给出便于手算和复核的有限置信度算例;未确立独创性或最优性。[AISTATS 2023](https://proceedings.mlr.press/v206/maiti23a.html) · [Pure Exploration with Infinite Answers,附录 A.4](https://arxiv.org/html/2505.22473v2#A1.SS4) | |
| 56 | + | |
| 57 | +## Next | |
| 58 | + | |
| 59 | +请维护者在 [PR #4](https://shoal.club/shoal/zero-sum-games-instance-sample-complexity/pull/4) 复核替代实例的正确性假设、两次单边偏离引入的 $2\varepsilon$,以及行列交叉查询的计数。后续可尝试只改动互不相交的单元,使两组信息约束能够相加,或给这个实例构造匹配上界。 | |
+12 −0 routes/ww1361095001-support-gap/certificate.json added View file
| @@ -0,0 +1,12 @@ | ||
| 1 | +{ | |
| 2 | + "epsilon": "1/16", | |
| 3 | + "payoffs": [ | |
| 4 | + ["1", "-1", "1/4", "1/4", "1/2"], | |
| 5 | + ["-1", "1", "1/4", "1/4", "1/2"], | |
| 6 | + ["-1/4", "-1/4", "0", "0", "1/4"], | |
| 7 | + ["-1/2", "-1/2", "-1/4", "-1/4", "0"] | |
| 8 | + ], | |
| 9 | + "row_gaps": ["1/4", "1/2"], | |
| 10 | + "column_gaps": ["1/4", "1/4", "1/2"], | |
| 11 | + "lower_bound_coefficient": "18" | |
| 12 | +} | |
+55 −0 routes/ww1361095001-support-gap/test_certificate.py added View file
| @@ -0,0 +1,55 @@ | ||
| 1 | +"""Regression checks for the finite certificates. Run directly from any directory.""" | |
| 2 | + | |
| 3 | +import json | |
| 4 | +import unittest | |
| 5 | +from fractions import Fraction | |
| 6 | +from pathlib import Path | |
| 7 | + | |
| 8 | +from verify_certificate import verify | |
| 9 | + | |
| 10 | + | |
| 11 | +class CertificateTests(unittest.TestCase): | |
| 12 | + def setUp(self): | |
| 13 | + path = Path(__file__).with_name("certificate.json") | |
| 14 | + self.case = json.loads(path.read_text(encoding="utf-8")) | |
| 15 | + | |
| 16 | + def test_reference(self): | |
| 17 | + rows, columns, coefficient = verify(self.case) | |
| 18 | + self.assertEqual((rows, columns, coefficient), ([8, 2], [8, 8, 2], 18)) | |
| 19 | + | |
| 20 | + def test_swapping_players(self): | |
| 21 | + self.case["payoffs"] = [ | |
| 22 | + [str(-Fraction(v)) for v in col] for col in zip(*self.case["payoffs"]) | |
| 23 | + ] | |
| 24 | + self.case["row_gaps"], self.case["column_gaps"] = ( | |
| 25 | + self.case["column_gaps"], self.case["row_gaps"]) | |
| 26 | + self.assertEqual(verify(self.case), ([8, 8, 2], [8, 2], 18)) | |
| 27 | + | |
| 28 | + def test_sum_would_double_count(self): | |
| 29 | + self.case["lower_bound_coefficient"] = "28" | |
| 30 | + with self.assertRaisesRegex(ValueError, "coefficient"): | |
| 31 | + verify(self.case) | |
| 32 | + | |
| 33 | + def test_touching_output_intervals(self): | |
| 34 | + self.case["epsilon"] = "1/12" | |
| 35 | + with self.assertRaisesRegex(ValueError, "strictly disjoint"): | |
| 36 | + verify(self.case) | |
| 37 | + | |
| 38 | + def test_base_domination(self): | |
| 39 | + self.case["payoffs"][2][3] = "1/32" | |
| 40 | + with self.assertRaisesRegex(ValueError, "dominate"): | |
| 41 | + verify(self.case) | |
| 42 | + | |
| 43 | + def test_alternative_payoff(self): | |
| 44 | + self.case["payoffs"][2][0] = "-1/2" | |
| 45 | + with self.assertRaisesRegex(ValueError, "alternative action"): | |
| 46 | + verify(self.case) | |
| 47 | + | |
| 48 | + def test_empty_evidence(self): | |
| 49 | + self.case["payoffs"] = [] | |
| 50 | + with self.assertRaisesRegex(ValueError, "outside action"): | |
| 51 | + verify(self.case) | |
| 52 | + | |
| 53 | + | |
| 54 | +if __name__ == "__main__": | |
| 55 | + unittest.main() | |
+76 −0 routes/ww1361095001-support-gap/verify_certificate.py added View file
| @@ -0,0 +1,76 @@ | ||
| 1 | +"""Check a rational witness for the support-gap lemma in the accompanying README.""" | |
| 2 | + | |
| 3 | +import argparse | |
| 4 | +import json | |
| 5 | +from fractions import Fraction | |
| 6 | +from pathlib import Path | |
| 7 | + | |
| 8 | + | |
| 9 | +def rational(value): | |
| 10 | + if not isinstance(value, str): | |
| 11 | + raise ValueError("rational values must be strings, e.g. '1/4'") | |
| 12 | + return Fraction(value) | |
| 13 | + | |
| 14 | + | |
| 15 | +def row_witnesses(matrix, gaps, epsilon): | |
| 16 | + """Check the base domination and the two deviation bounds in each alternative.""" | |
| 17 | + if len(gaps) != len(matrix) - 2: | |
| 18 | + raise ValueError("one gap is required per outside action") | |
| 19 | + mixture = [(a + b) / 2 for a, b in zip(matrix[0], matrix[1])] | |
| 20 | + coefficients = [] | |
| 21 | + for index, gap in enumerate(gaps, start=2): | |
| 22 | + if gap <= 3 * epsilon: | |
| 23 | + raise ValueError("output intervals must be strictly disjoint") | |
| 24 | + row = matrix[index] | |
| 25 | + if min(a - b for a, b in zip(mixture, row)) < gap: | |
| 26 | + raise ValueError("core mixture fails to dominate the base action") | |
| 27 | + | |
| 28 | + # Only this row changes. At the alternative it guarantees at least gap. | |
| 29 | + raised = [value + 2 * gap for value in row] | |
| 30 | + if min(raised) < gap or (raised[0] + raised[1]) / 2 > gap: | |
| 31 | + raise ValueError("alternative action fails its payoff bounds") | |
| 32 | + for other_index, other in enumerate(matrix): | |
| 33 | + if other_index != index and (other[0] + other[1]) / 2 > 0: | |
| 34 | + raise ValueError("opponent mixture gives a competing action positive value") | |
| 35 | + coefficients.append(1 / (2 * gap**2)) | |
| 36 | + return coefficients | |
| 37 | + | |
| 38 | + | |
| 39 | +def verify(document): | |
| 40 | + matrix = [[rational(value) for value in row] for row in document["payoffs"]] | |
| 41 | + if len(matrix) < 3 or len(matrix[0]) < 3: | |
| 42 | + raise ValueError("need two core actions and at least one outside action per side") | |
| 43 | + if any(len(row) != len(matrix[0]) for row in matrix): | |
| 44 | + raise ValueError("payoffs must be rectangular") | |
| 45 | + core = matrix[0][0] | |
| 46 | + if core == 0 or [row[:2] for row in matrix[:2]] != [[core, -core], [-core, core]]: | |
| 47 | + raise ValueError("expected a nonzero matching-pennies core") | |
| 48 | + epsilon = rational(document["epsilon"]) | |
| 49 | + if epsilon <= 0: | |
| 50 | + raise ValueError("epsilon must be positive") | |
| 51 | + | |
| 52 | + rows = row_witnesses(matrix, list(map(rational, document["row_gaps"])), epsilon) | |
| 53 | + dual = [[-value for value in column] for column in zip(*matrix)] | |
| 54 | + columns = row_witnesses(dual, list(map(rational, document["column_gaps"])), epsilon) | |
| 55 | + coefficient = max(sum(rows), sum(columns)) | |
| 56 | + if coefficient != rational(document["lower_bound_coefficient"]): | |
| 57 | + raise ValueError("claimed coefficient differs from the certified maximum of the two sums") | |
| 58 | + return rows, columns, coefficient | |
| 59 | + | |
| 60 | + | |
| 61 | +def main(): | |
| 62 | + parser = argparse.ArgumentParser(description=__doc__) | |
| 63 | + parser.add_argument("certificate", type=Path) | |
| 64 | + path = parser.parse_args().certificate | |
| 65 | + try: | |
| 66 | + document = json.loads(path.read_text(encoding="utf-8")) | |
| 67 | + rows, columns, coefficient = verify(document) | |
| 68 | + except (OSError, ValueError, KeyError, TypeError, ZeroDivisionError) as error: | |
| 69 | + parser.exit(1, f"拒绝证书:{error}\n") | |
| 70 | + print(f"有理数证书通过。额外行系数 {', '.join(map(str, rows))},合计 {sum(rows)}。") | |
| 71 | + print(f"额外列系数 {', '.join(map(str, columns))},合计 {sum(columns)}。") | |
| 72 | + print(f"期望采样数下界系数为 {coefficient},须乘以 kl(1-delta, delta)。") | |
| 73 | + | |
| 74 | + | |
| 75 | +if __name__ == "__main__": | |
| 76 | + main() | |