关于「实战:把一本十二条规则的定价小书蒸馏成定价试算器」,《专著蒸馏与技能包工程》给出的定量结论是什么?

结论:第八章把一本虚构的十二条规则定价书蒸馏成定价试算器:信号词扫描的精确率 0.714、召回率 0.833,漏掉的正是毛利的定义与一条拒绝条件;一次顺手的修改让回归通过率掉到 0.788、拒绝条件完整率掉到 0.833,覆盖率与可执行率却仍是 1;预先登记的三臂比较定为每臂 228 题、共 684 个回答,零违规时的上限是 0.0131。

数据口径:书中样本全部虚构,定价与成交规则只写一般框架,不是法律或合规意见。 全书按证据分级标注每一条说法,以《荀子·劝学》考辨工具与积累,所有计算由书中程序生成,作者的判断一律写进假说框并写明什么结果会推翻它。

English version

对照数据表

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

contrastratesalphapowern/armn/arm (x12)per rule
A vs C0.20 vs 0.050.0250.8092968
A vs C0.20 vs 0.050.0250.9011912010
B vs C0.15 vs 0.050.0250.8017018015
B vs C0.15 vs 0.050.0250.9022222819
A vs B0.20 vs 0.150.0500.8090691276
A vs B0.20 vs 0.150.0500.9012121212101
registered size: 228 questions per arm, 684 answers in total over 3 arms
if arm C shows 0 violations in 228: 95% upper bound 0.0131
questions needed for a zero-violation claim below 0.01: 299
查看完整验算程序
# Chapter 8. p83: Sample sizes for the pre-registered comparison of three ways to hand the book to an agent.
# Arms: A the whole book pasted as a long prompt; B the instruction file only (rules as prose);
# C the full pack (instruction file + validators + decision table + golden samples gating every answer).
# Primary outcome: share of answers to held-out pricing questions that break at least one of the 12
# rules, judged by the validators and by a blind reviewer. Planning rates are assumptions, not data:
# pA = 0.20, pB = 0.15, pC = 0.05. Two primary contrasts (A vs C, B vs C), each at two-sided alpha
# 0.025 (Bonferroni for 0.05 overall). n per arm for two independent proportions:
#   n = (z_a * sqrt(2 pbar qbar) + z_b * sqrt(pA qA + pC qC)) ** 2 / (pA - pC) ** 2
# Questions are drawn in equal numbers for each of the 12 rules, so n is rounded up to a multiple of 12.
from math import ceil, log, sqrt
from statistics import NormalDist

PLAN = {"A": 0.20, "B": 0.15, "C": 0.05}
RULES = 12


def n_two_prop(p1, p2, alpha, power):
    za = NormalDist().inv_cdf(1 - alpha / 2)
    zb = NormalDist().inv_cdf(power)
    pbar = (p1 + p2) / 2
    num = za * sqrt(2 * pbar * (1 - pbar)) + zb * sqrt(p1 * (1 - p1) + p2 * (1 - p2))
    return ceil(num ** 2 / (p1 - p2) ** 2)


def to_rules(n):
    return RULES * ceil(n / RULES)


if __name__ == "__main__":
    print("   contrast  rates          alpha  power  n/arm  n/arm (x12)  per rule")
    for a, b, alpha in (("A", "C", 0.025), ("B", "C", 0.025), ("A", "B", 0.05)):
        for power in (0.80, 0.90):
            n = n_two_prop(PLAN[a], PLAN[b], alpha, power)
            print("   {} vs {}    {:.2f} vs {:.2f}   {:.3f}  {:.2f} {:6d} {:12d} {:9d}".format(
                a, b, PLAN[a], PLAN[b], alpha, power, n, to_rules(n), to_rules(n) // RULES))
    n = max(to_rules(n_two_prop(PLAN[x], PLAN["C"], 0.025, 0.90)) for x in "AB")
    print("   registered size: {} questions per arm, {} answers in total over 3 arms".format(n, 3 * n))
    print("   if arm C shows 0 violations in {}: 95% upper bound {:.4f}".format(n, 1 - 0.05 ** (1 / n)))
    need = ceil(log(0.05) / log(0.99))
    print("   questions needed for a zero-violation claim below 0.01: {}".format(need))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《专著向智能体技能包无损蒸馏、规则可执行化编译与系统自进化工程》第 8 章「实战:把一本十二条规则的定价小书蒸馏成定价试算器」(版本 0.1.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-150 · v0.1.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026150,
  author    = {Fan, Yafu},
  title     = {Lossless Distillation of Monographs into Agent Skill Packs, Executable Rule Compilation and Self-Evolving Systems},
  year      = {2026},
  publisher = {5D Library},
  edition   = {0.1.0},
  note      = {DOI pending}
}

本书其他章节结论