UUnit Mechanism Learning

Mathematical reading note · UML-MATH-ASSUMPTIONS-001

一条公式不是一个真理

当前 Unit Mechanism 模型为什么长成 Cauchy–bilinear?哪些是假设,哪些是权重,还有哪些合理候选?

数学底层导读与当前代码逐项对照开放模型选择

先给短答案

当前公式是一条“最小可解析路线”,不是框架唯一允许的模型

世界侧先有固定的真实 token realization \(U=u^\star\),unit outcome 由 \(Y=f_\theta(x,E;u^\star)\) 生成。learner 只看到 predictors \(X=x\),所以先做 point、Gaussian 或 Cauchy abduction,再把同一个 \(x\) 作为 factual query 送入 generator。abduction uncertainty 是对同一个 actual token 的认识,不是把 identity 随机化。

Injective identity encoding 是 standing modeling assumption,不是 one-shot identification theorem,也不要求 \(u\mapsto[x\mapsto p_\theta(y\mid x,u)]\) injective。至于 Cauchy 与 bilinear,则是当前默认,并非框架唯一允许的模型:

  1. 01
    允许不同 unit 对输入有不同反应。

    不是只有 unit-specific intercept,还要允许 unit-specific slope。

  2. 02
    让 unit-specific mechanisms 在 shared family 中足够简单。

    把每个 unit 的 intercept 和 slope 写成低维 \(U\) 的 affine function。

  3. 03
    让 one-shot likelihood 可以精确计算。

    选择独立 Cauchy candidate coordinates 与 Cauchy event noise,使 affine propagation 保持闭式。

Where the equation comes from

从 unit-specific regression,自然走到 bilinear

先暂时不谈 Cauchy。候选 representation \(u\) 在共享 family 中配置一个 mechanism;假设给定 \(u\) 后,结果对 mechanism input \(X\) 是线性的。world-side actual \(u^\star\) 固定;sampled candidate \(\widetilde u\sim q_\phi(u\mid X=x)\) 只表达 learner-side uncertainty:

Step 1 · 每个 unit 有自己的 intercept 与 slope
\[Y=c(U)+b(U)^\top X+\sigma E.\]

如果 \(c(U)\) 和 \(b(U)\) 都是任意神经网络,这个 mechanism 很灵活,却很难解释其可观测限制。当前模型继续做一个最小选择:让它们对 \(U\) 都是 affine。

Step 2 · 用低维 \(U\) 调制系数
\[c(U)=\alpha+a^\top U,\qquad b(U)=\beta+BU.\]

代回第一式,就得到当前 outcome equation:

Step 3 · Cauchy–bilinear mechanism
\[Y=\alpha+\beta^\top X+a^\top U+X^\top BU+\sigma E.\]
\(\alpha\)global intercept

所有 unit 与 input 共享的基准。

\(\beta^\top X\)direct input effect

不经过 \(U\) 的平均 input slope。

\(a^\top U\)unit main effect

candidate unit representation 对 intercept 的调制。

\(X^\top BU\)unit–input interaction

不同 unit 对 \(X\) 有不同 slope。

\(\sigma E\)event noise

给定 unit 与 input 后仍发生的新事件随机性。

其中最有内容的是 \(B\)。它不是一张“每个 unit 一套回归系数”的表,而是共享的 slope directions。对 evidence \(O=o\),有效 slope 是

\[b(o)=\beta+B m_\phi(o).\]

因此所有 evidence-indexed slopes 都被限制在 affine subspace \(\beta+\operatorname{col}(B)\) 中。当 \(d=\dim(U)\ll p=\dim(X)\) 时,这才形成可检验的 low-rank geometry。

Why Cauchy appears

Cauchy 不是因为 unit “本质上重尾”,而是因为它让传播闭合

Evidence encoder 不输出一个确定的 physical identity,也不改变真实 unit;它输出 candidate-representation law 的 location 与 scale。以下随机变量写法比直接操作测度更容易读:

\[\widetilde u_j\mid O=o\sim\operatorname{Cauchy}\{m_{\phi,j}(o),\gamma_{\phi,j}(o)\},\qquad j=1,\ldots,d.\]

Cauchy 的 \(m_\phi\) 是 location,不是 mean;\(\gamma_\phi\) 是 scale,不是 standard deviation,而且该分布没有有限 mean / variance。再假设 coordinates 条件独立,且 \(E\sim\operatorname{Cauchy}(0,1)\),affine composition 保持 Cauchy:

Response location

\[m_Y(o,x)=\alpha+\beta^\top x+\{a+B^\top x\}^\top m_\phi(o).\]

location 使用普通带符号权重。
Response scale

\[s(o,x)=\sum_j|a_j+(B^\top x)_j|\gamma_j(o)+\sigma.\]

独立 Cauchy scale 按绝对权重相加。

这一步的预测含义是对 learner 的 candidate embeddings 调用同一个 generator,再综合 outcomes:

\[p_{\phi,\theta}(y\mid O,x)=\int p_\theta(y\mid x,u)q_\phi(u\mid O)\,du,\qquad Y^\star\mid O,x\sim\operatorname{Cauchy}\{m_Y(O,x),s(O,x)\}.\]

训练因此只需最小化 factual Cauchy negative log likelihood:

\[\ell(y;m,s)=\log(\pi s)+\log\!\left[1+\left\{\frac{y-m}{s}\right\}^{2}\right].\]

Assumption ledger

这条公式实际上承诺了八件事

A1Fixed actual token + injective identity encoding

world side 先有 \(U=u^\star\);token→embedding injective 是 assumption,不是 one-shot 已识别 latent coordinate,也不要求 response map injective。

A2Predictors-as-evidence abduction

ordinary prediction 先用 \(X=x\) 得到 \(\widehat u_\phi(x)\) 或 \(q_\phi(u\mid x)\);随机性表达 learner uncertainty,而非 identity resampling。

A3Shared generator

\(\alpha,\beta,a,B,\sigma\) 跨 token 共享;每个 candidate \(u\) 配置 \(f_\theta(x,E;u)\)。

A4Linear in \(X\), affine in \(U\)

当前 outcome location 没有 \(X^2\)、\(U^2\) 或更一般 nonlinear interaction。

A5Low-dimensional modulation

若 \(d<p\),evidence-dependent slope 只能在至多 \(d\) 维方向中变化。

A6Factorized candidate-representation law

给定 factual evidence 后,\(q_\phi(u\mid O)\) 的 latent coordinates 被建模为独立 Cauchy。

A7Independent Cauchy event noise

新事件噪声与 candidate \(U\) 独立,并使用全局共同的 \(\sigma\)。

A8One-shot predictive target boundary

每个 unit 一条 factual row 直接约束的是 composed prediction \(p_{\phi,\theta}(y\mid O,x)\),不是 unit identity、单条选中的 mechanism 或原生 function posterior。

What is actually learned

模型学习的是共享权重,不是给每个 unit 建一行自由参数

模块可学习对象形状作用
Evidence backbone\(\phi_{\mathrm{backbone}}\)MLP weights/biases把 \(O\) 转换为共享 hidden representation。
Location head\(\phi_m\)(implementation may call it mu输出 \(d\) 维产生 Cauchy location \(m_\phi(O)\),不是 mean。
Scale head\(\phi_\gamma\)输出 \(d\) 维经 softplus 产生正的 \(\gamma(O)\)。
Mechanism baseline\(\alpha,\beta\)\(1\) 与 \(p\)global intercept 与 direct input slope。
Unit modulation\(a\)\(d\)unit-dependent intercept directions。
Interaction basis\(B\)\(p\times d\)unit-dependent slope directions。
Event scale\(\rho_\sigma\)\(1\)经 softplus 变成正的 \(\sigma\)。

不是独立学习参数的东西

  • world-side actual token realization \(U=u^\star\):不是 embedding table 中的一行。
  • \(m_\phi(O),\gamma_\phi(O)\):是 encoder 输出的 Cauchy location / scale,不是 mean / standard deviation。
  • \(m_Y(o,x),s(o,x)\):由共享权重计算出来。

训练前固定的 hyperparameters

  • latent dimension \(d\);当前主要实现默认 \(d=4\)。
  • encoder widths;当前默认 \(64,64\) 与 GELU。
  • Cauchy family、coordinate independence、\(\gamma_{\min}=10^{-3}\)。
  • one-shot protocol 与优化配置。

在 synthetic 默认维度 \(q=8,p=1,d=4\) 下,当前模型共有 5,267 个可学习参数:5,256 个属于 evidence encoder,11 个属于 mechanism head。所有参数都只通过 factual response likelihood 接受梯度,没有 latent-\(U\) supervision。

Candidate hypothesis space

至少有九类值得认真比较的候选模型

M0 · Direct

Direct conditional law

\[q_\psi(Y\mid O,X)\]

不引入 \(U\),直接预测 location/scale 或完整 density。

回答:factorization 是否真的增加价值?
M0b · Function neighbor

Direct function generator

\[G_\eta(O)\longmapsto \widehat f_O(\cdot)\]

由 evidence 直接生成一条 response function,不先表达候选 unit representations。

这是竞争性邻近方案,不是当前“abduct candidate \(u\) → 调用 \(f_\theta\) → 合成 \(p_{\phi,\theta}\)”的另一种写法。
M1 · Evidence-only

Causal Regression branch

\[\widetilde u\sim q_\phi(u\mid O),\quad Y=f(\widetilde u,E)\]

Observed features 只作为 abduction evidence。

回答:explicit input 是否真的必要?
M2 · Additive

No unit-specific slope

\[Y=\alpha+\beta^\top X+a^\top U+\sigma E\]

保留 unit intercept heterogeneity,但令 \(B=0\)。

回答:真正有用的是 \(U\),还是 \(X\times U\)?
M3 · Current

Cauchy–bilinear Unit

\[Y=\alpha+\beta^\top X+a^\top U+X^\top BU+\sigma E\]

当前最小的 closed-form unit-specific slope model。

优势:解析;风险:linear/affine/Cauchy 限制同时存在。
M4 · Observable rival

Varying coefficient

\[m(o,x)=b_0(o)+b(o)^\top x\]

直接学习 observable intercept/slope,不解释为 latent \(U\)。

回答:latent factorization 是否超过 observable reduction?
M5 · Critical control

Low-rank direct slope

\[b(o)=\beta+Lr_\eta(o),\quad \operatorname{rank}(L)=r\]

保留 low-rank slope geometry,但不建立 unit distribution。

若它追平 M3,证据支持 low rank,不支持 latent-unit story。
M6 · Discrete heterogeneity

Mixture / latent types

\[Z\mid O\sim\operatorname{Cat}\{\pi(O)\}\]

把 continuous \(U\) 换成有限 latent types 或 mixture of experts。

回答:异质性是否更像少数 response regimes?
M7 · Flexible mechanism

Nonlinear unit mechanism

\[Y=f_\theta(X,U)+s_\theta(X,U)E\]

允许 nonlinear interaction、heteroscedasticity、flow 或 implicit noise。

代价:失去闭式传播和清晰 slope geometry。

Axes, not a single ladder

候选模型不是一条升级路线,而是四个可独立替换的轴

当前选择主要候选改变后在问什么
Abduction lawpoint / factorized Cauchy \(q_\phi(u\mid x)\)Gaussian、full-covariance、mixture、flowlearner 对同一 actual token 的 uncertainty 需要什么形状与 tails?
Outcome mechanismbilinear \(X,U\)evidence-only、additive、varying coefficient、nonlinear neural异质性只改变 level,还是也改变 response slope?
Event lawglobal Cauchy scaleGaussian、Laplace、Student-\(t\)、heteroscedastic、mixturerobustness 来自 unit structure,还是 likelihood family?
Query semanticsprediction \(p_{\phi,\theta}(y\mid O,x)\)treatment heads、continuous dose、multi-context transport改变 \(X\) 是预测查询、介入,还是跨 context 外推?

Current scientific judgment

现在最诚实的定位:M3 是工作假设,不是胜出的最终模型

Current Cauchy–bilinear Unit Mechanism is a minimal analytically tractable hypothesis for low-dimensional unit-modulated response geometry. Its value must be established against direct, varying-coefficient, low-rank-direct, and alternative-noise models.

下一轮最重要的比较是在 high-dimensional \(X\)、low-rank response slope 和 held-out input support 下同时比较 M0、M3、M4、M5。这样才能判断收益究竟来自 Unit factorization、low-rank geometry,还是 Cauchy objective。

Review loop

沿着数学假设继续追问

可以直接指出你最不相信的 assumption 编号,或指定候选模型展开。例如:“A5 为什么独立?”、“M5 与 M3 在可观测层面是否等价?”