关于「最优段长与接力阈值:读的损失与写的损失之间的拉锯」,《中段遗忘与接力阈值》给出的定量结论是什么?
结论:第五章求最优段长与接力阈值:对 2023 年的读者,每次摘要调用的保真度须高于约 0.911,段长须很短;读者损失低于原曲线的 0.413 倍时,保真度 0.97 的接力就输给整窗。
数据口径:书中任务、材料与参数均为示意,模型常数来自 2023 年的一个模型;全部计算由书中程序生成,不调用任何模型接口;本书是非个人化经营建议,不评测、不推荐任何模型或服务。 书中以标注框区分已发表的证据、可运行的 Python 计算(21 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.413, 0.911, 0.97
| lam | stuffed | relay q=.99 | q=.97 | q=.95 | winner at q=.97 |
| 1.00 | 0.476 | 0.923 | 0.784 | 0.663 | relay |
| 0.50 | 0.738 | 0.923 | 0.784 | 0.674 | relay |
| 0.25 | 0.869 | 0.923 | 0.806 | 0.764 | stuffed |
| 0.10 | 0.948 | 0.926 | 0.882 | 0.846 | stuffed |
| 0.05 | 0.974 | 0.949 | 0.911 | 0.874 | stuffed |
| 0.00 | 1.000 | 0.980 | 0.941 | 0.902 | stuffed |
| q = 0.99: relay wins only when lam exceeds 0.148 | |||||
| q = 0.97: relay wins only when lam exceeds 0.413 | |||||
| q = 0.95: relay wins only when lam exceeds 0.643 |
核心公式
\[R(s) = \big(q\, c(s)\big)^{L},\]
查看完整验算程序
# Chapter 5. p53: newer, flatter readers erase the relay's advantage.
# Later work flattens the curve (calibration, position-aware training,
# near-perfect single-needle scores). We shrink every loss of the p32
# reader by a factor lam: rho_lam = 1 - lam (1 - rho). lam = 1 is the
# 2023 GPT-3.5-Turbo shape, lam = 0 a perfectly flat reader. For
# D = 256 units and per-call fidelity q we compare the best tree relay
# (segment s from 2 to 64) with one stuffed window. Illustrative.
import math
TAU, M0, K, A, B = 2.4, 0.752, 0.0505, 0.251, 0.128
D = 256
def rho(i, n, lam):
v = (M0 - K * math.log(n) + A * math.exp(-(i - 1) / TAU)
+ B * math.exp(-(n - i) / TAU))
return 1.0 - lam * (1.0 - min(1.0, v))
def capture(n, lam):
return math.fsum(rho(i, n, lam) for i in range(1, n + 1)) / n
def layers(n, f):
depth, width = 0, n
while width > 1:
width = -(-width // f)
depth += 1
return max(depth, 1)
def best_relay(q, lam):
cap = {s: capture(s, lam) for s in range(2, 65)}
return max((q * cap[s]) ** layers(D, s) for s in cap)
print(" lam stuffed relay q=.99 q=.97 q=.95 winner at q=.97")
for lam in (1.0, 0.5, 0.25, 0.1, 0.05, 0.0):
st = capture(D, lam)
rs = [best_relay(q, lam) for q in (0.99, 0.97, 0.95)]
print("%5.2f %7.3f %10.3f %6.3f %6.3f %s"
% (lam, st, rs[0], rs[1], rs[2],
"relay" if rs[1] > st else "stuffed"))
for q in (0.99, 0.97, 0.95):
lo, hi = 0.0, 1.0
for _ in range(40):
mid = (lo + hi) / 2
if best_relay(q, mid) > capture(D, mid):
hi = mid
else:
lo = mid
print("q = %.2f: relay wins only when lam exceeds %.3f" % (q, hi))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《长上下文注意力中段遗忘曲线、位置偏置与零损耗分段摘要接力阈值母典》第 5 章「最优段长与接力阈值:读的损失与写的损失之间的拉锯」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-255 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026255,
author = {Fan, Yafu},
title = {Mid-Context Forgetting in Long-Context Attention: Positional Bias and the Threshold for Lossless Segment-Summary Relays},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}