关于「多智能体流水线:误差级联与验证器门控的吸收马尔可夫链」,《检索增强与多智能体的可靠性》给出的定量结论是什么?

结论:第四章证实 0.92 的十次方等于 0.4344,三票表决只在错误独立时有效,并把验证器门控写成吸收马尔可夫链:确定、独立的检查把十步链提到 0.9949,只需 10.84 次尝试。

数据口径:全部数据为程序生成的合成数据,数字说明机制与量级,不是对任何产品的测量。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 与结论吻合的打印值: 0.4344, 0.9949, 10.84

   verifier          s     f     n   success   escalated  attempts
   none            0.00  0.00    1   0.4344    0.0000     10.00
   code check      1.00  0.00    3   0.9949    0.0051     10.84
   code check      1.00  0.00   10   1.0000    0.0000     10.87
   good judge      0.80  0.05    3   0.8231    0.0132     11.15
   weak judge      0.50  0.10    3   0.6097    0.0228     11.38
   strict judge    0.80  0.30    3   0.5239    0.3303     12.23
   largest gap, closed form vs fundamental matrix: 7.1e-15
   exact checker, n = 3: escalation per step 0.08^3 = 5.12e-04
Reading: an exact, independent checker turns 43 % into
better than 99 % for under 11 attempts over ten steps: errors are
caught and retried instead of propagated, and the residual
risk falls geometrically with each allowed retry. A judge that
misses a fifth of errors keeps silent failures in the chain;
one that rejects too much spends attempts and escalates.

核心公式

\[a = p(1-f),\quad b = (1-p)(1-s),\quad r = pf + (1-p)s ,\]
查看完整验算程序
# Chapter 4. p09: A verifier in the loop as an absorbing Markov chain.
# L = 10 steps, each attempt right with p = 0.92. After every attempt a
# verifier passes or rejects it: it catches a wrong attempt with
# sensitivity s and wrongly rejects a right one with false-alarm rate f.
# A rejected attempt is retried, up to n attempts per step; if all n are
# rejected the run stops and is escalated to a person. A wrong attempt
# that passes is a silent failure: the run goes on, but its result is
# wrong. Per attempt:
#     accept right a = p (1 - f), accept wrong b = (1 - p)(1 - s),
#     retry r = p f + (1 - p) s,   G = (1 - r^n) / (1 - r).
# Closed form: success (a G)^L, escalation 1 - (1 - r^n)^L, expected
# attempts sum_i (1 - r^n)^i G. The same numbers are recomputed from the
# fundamental matrix N = (I - Q)^(-1) of the absorbing chain whose
# transient states are (step, attempt, already wrong?).
L, P = 10, 0.92

def closed(s, f, n):
    a, r = P * (1 - f), P * f + (1 - P) * s
    g = (1 - r ** n) / (1 - r) if r < 1 else n
    esc = r ** n
    return ((a * g) ** L, 1 - (1 - esc) ** L,
            sum((1 - esc) ** i * g for i in range(L)))

def fundamental(s, f, n):
    a, b = P * (1 - f), (1 - P) * (1 - s)
    r = P * f + (1 - P) * s
    states = [(i, j, t) for i in range(L) for j in range(n) for t in (0, 1)]
    ix = {st: k for k, st in enumerate(states)}
    m = len(states)
    q = [[0.0] * m for _ in range(m)]
    win = [0.0] * m
    for (i, j, t), k in ix.items():
        if j + 1 < n:
            q[k][ix[(i, j + 1, t)]] += r
        if i + 1 < L:
            q[k][ix[(i + 1, 0, t)]] += a
            q[k][ix[(i + 1, 0, 1)]] += b
        elif t == 0:
            win[k] += a
    def solve(rhs):
        mat = [[(1.0 if x == y else 0.0) - q[x][y] for y in range(m)]
               + [rhs[x]] for x in range(m)]
        for c in range(m):
            piv = max(range(c, m), key=lambda z: abs(mat[z][c]))
            mat[c], mat[piv] = mat[piv], mat[c]
            for z in range(m):
                if z != c and mat[z][c]:
                    fct = mat[z][c] / mat[c][c]
                    mat[z] = [u - fct * v for u, v in zip(mat[z], mat[c])]
        return [mat[z][m] / mat[z][z] for z in range(m)]
    start = ix[(0, 0, 0)]
    return solve(win)[start], solve([1.0] * m)[start]

if __name__ == "__main__":
    print("   verifier          s     f     n   success   escalated"
          "  attempts")
    cases = (("none", 0.0, 0.0, 1), ("code check", 1.0, 0.0, 3),
             ("code check", 1.0, 0.0, 10), ("good judge", 0.8, 0.05, 3),
             ("weak judge", 0.5, 0.10, 3), ("strict judge", 0.8, 0.30, 3))
    worst = 0.0
    for name, s, f, n in cases:
        succ, esc, tot = closed(s, f, n)
        fs, ft = fundamental(s, f, n)
        worst = max(worst, abs(fs - succ), abs(ft - tot))
        print("   {:<15} {:4.2f}  {:4.2f}  {:3d}   {:.4f}    {:.4f}"
              "    {:6.2f}".format(name, s, f, n, succ, esc, tot))
    print("   largest gap, closed form vs fundamental matrix: {:.1e}"
          .format(worst))
    print("   exact checker, n = 3: escalation per step 0.08^3 = {:.2e}"
          .format(0.08 ** 3))
    print("\nReading: an exact, independent checker turns 43 % into")
    print("better than 99 % for under 11 attempts over ten steps: errors are")
    print("caught and retried instead of propagated, and the residual")
    print("risk falls geometrically with each allowed retry. A judge that")
    print("misses a fifth of errors keeps silent failures in the chain;")
    print("one that rejects too much spends attempts and escalates.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《检索增强生成几何、倒数秩融合与多智能体误差级联》第 4 章「多智能体流水线:误差级联与验证器门控的吸收马尔可夫链」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090170

DOI: 10.5281/zenodo.24090170 · 阅读本章所在专著 · 5DL-B-061 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026061,
  author    = {Fan, Yafu},
  title     = {Retrieval-Augmented Generation Geometry, Reciprocal Rank Fusion and Multi-Agent Error Cascades},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090170},
  url       = {https://doi.org/10.5281/zenodo.24090170}
}

本书其他章节结论