关于「《七略》的分类路由与《韩非子》的参验:检索与核验的两种古法」,《检索增强与多智能体的可靠性》给出的定量结论是什么?

结论:第七章把《七略》读作分类路由(路由准确率须高于 0.656 才胜过全库检索),把《韩非子》的「参验」读作多源核验(来源同出一源时多少个都只相当于一个)。

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

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.656

A. flat search over 60,000: top-1 0.286
search inside one division of 10,000: top-1 0.436
routing accuracy routed top-1 better than flat?
1.000.436 yes
0.950.414 yes
0.900.393 yes
0.800.349 yes
0.700.305 yes
0.600.262 no
break-even routing accuracy0.656
B. majority of k sources, each right with 0.8
k c0 c = 0.3 c = 0.6
10.8000 0.8000 0.8000
30.8960 0.8672 0.8384
50.9421 0.8995 0.8568
70.9667 0.9167 0.8667
C. two collators, each catching 0.7 of errors
shared misses c0.0: caught 0.910
shared misses c0.3: caught 0.847
shared misses c0.6: caught 0.784
Reading: a catalogue helps retrieval only when its routing is
more reliable than the break-even accuracy - a misfiled book is
lost however good the shelf search. More sources raise
accuracy only to the extent that they are independent; sources
that copy one another add confidence without adding evidence.
查看完整验算程序
# Chapter 7. p15: Liu Xin's catalogue as routing; Han Fei's canyan as voting.
# A. The Qilue sorted the imperial library into six substantive
#    divisions plus a summary. As retrieval: route a query to one of six
#    divisions (right with probability a), then search only that
#    division. Search uses the extreme-value model of p01 with
#    effective dimension 150 and a relevant cosine of 0.30: top-1 is right
#    when the relevant chunk beats the best of M distractors. Flat search
#    over 60,000 chunks against routed search over 10,000.
# B. Canyan, "checking against several sources": k sources each right
#    with 0.8, majority vote. With probability c all k merely repeat one
#    source (shared provenance) - then k sources are worth one.
# C. Jiaochou, collation by two readers: each catches an error with 0.7;
#    with probability c they miss the same errors together.
import math
import random

def erfinv(y):
    x = 0.0 if abs(y) < 0.7 else math.copysign(
        math.sqrt(-math.log((1 - abs(y)) / 2)), y)
    for _ in range(60):
        x -= (math.erf(x) - y) / (2 / math.sqrt(math.pi) * math.exp(-x * x))
    return x

def top1(rng, m, d=150, trials=4000):
    sd = 1 / math.sqrt(d)
    ok = 0
    for _ in range(trials):
        rel = 0.30 + rng.gauss(0, sd)
        u = rng.random() ** (1 / m)
        ok += math.sqrt(2) * erfinv(2 * u - 1) * sd < rel
    return ok / trials

def vote(k, p):
    return sum(math.comb(k, j) * p ** j * (1 - p) ** (k - j)
               for j in range(k // 2 + 1, k + 1))

if __name__ == "__main__":
    rng = random.Random(61015)
    flat = top1(rng, 60000)
    inner = top1(rng, 10000)
    print("A. flat search over 60,000: top-1 {:.3f}".format(flat))
    print("   search inside one division of 10,000: top-1 {:.3f}".format(
        inner))
    print("   routing accuracy   routed top-1   better than flat?")
    for a in (1.0, 0.95, 0.9, 0.8, 0.7, 0.6):
        r = a * inner
        print("        {:.2f}            {:.3f}          {}".format(
            a, r, "yes" if r > flat else "no"))
    print("   break-even routing accuracy: {:.3f}".format(flat / inner))
    print("\nB. majority of k sources, each right with 0.8")
    print("   k    c = 0    c = 0.3   c = 0.6")
    for k in (1, 3, 5, 7):
        print("   {}   {:.4f}   {:.4f}    {:.4f}".format(
            k, *[c * 0.8 + (1 - c) * vote(k, 0.8) for c in (0, 0.3, 0.6)]))
    print("\nC. two collators, each catching 0.7 of errors")
    for c in (0.0, 0.3, 0.6):
        print("   shared misses c = {}: caught {:.3f}".format(
            c, c * 0.7 + (1 - c) * (1 - 0.3 ** 2)))
    print("\nReading: a catalogue helps retrieval only when its routing is")
    print("more reliable than the break-even accuracy - a misfiled book is")
    print("lost however good the shelf search. More sources raise")
    print("accuracy only to the extent that they are independent; sources")
    print("that copy one another add confidence without adding evidence.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《检索增强生成几何、倒数秩融合与多智能体误差级联》第 7 章「《七略》的分类路由与《韩非子》的参验:检索与核验的两种古法」(版本 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}
}

本书其他章节结论