Transformer的MLP层用二元开关路由连续信号,揭示了隐藏的计算结构。
The Discrete Charm of the MLP: Binary Routing of Continuous Signals in Transformer Feed-Forward Layers
- MLP层通过少数神经元实现二元路由决策,如7个默认开启+1个例外处理单元
- 晚期层形成完整共识架构,移除共识层时困惑度上升43.3%,远超早期层
- 二值化路由几乎无信息损失,但连续激活包含额外幅度信息,适合模型优化
我们发现Transformer语言模型中的MLP层对连续信号执行二元路由:是否需要非线性处理的判断可由二元神经元激活准确捕捉,尽管信号本身是连续的。在GPT-2 Small(124M参数)中,特定神经元构成共识架构——7个“默认开启”神经元和一个例外处理单元(第11层的N2123),其互斥率高达93%-98%,形成二元路由开关。跨层分析显示演化轨迹:早期层(L1-3)使用单网关神经元路由异常;中层(L4-6)为弥散处理,无网关也无共识;晚期层(L7-11)发展出完整共识/例外架构,共识神经元数量从1到3再到7递增。因果验证确认该路由功能有效:在共识崩溃处移除MLP导致困惑度上升43.3%,而在完全共识处仅上升10.1%,超过4倍差异。对比二值与连续特征用于路由决策,发现二值化仅损失极小信息(79.2% vs. 78.8%准确率),而连续激活携带更多幅度信息(R²=0.36 vs. 0.22)。这一二元路由结构解释了为何平滑多项式逼近失败:交叉验证的多项式拟合(2-7次)在高度非线性层中R²从未超过0.06。我们提出,深度网络的经典分段线性表征可补充路由表征:在自然数据流形上,分段边界实现了关于哪些令牌需非线性处理的二元决策,将连续信号引导至质异的计算路径。
原文摘要 · Abstract (English)
We show that MLP layers in transformer language models perform binary routing of continuous signals: the decision of whether a token needs nonlinear processing is well-captured by binary neuron activations, even though the signals being routed are continuous. In GPT-2 Small (124M parameters), we find that specific neurons implement a consensus architecture -- seven "default-ON" neurons and one exception handler (N2123 in Layer 11) that are 93-98% mutually exclusive -- creating a binary routing switch. A cross-layer analysis reveals a developmental arc: early layers (L1-3) use single gateway neurons to route exceptions without consensus quorums; middle layers (L4-6) show diffuse processing with neither gateway nor consensus; and late layers (L7-11) crystallize full consensus/exception architectures with increasing quorum size (1 to 3 to 7 consensus neurons). Causal validation confirms the routing is functional: removing the MLP at consensus breakdown costs 43.3% perplexity, while at full consensus removing it costs only 10.1% -- exceeding a 4x difference. Comparing binary vs. continuous features for the routing decision confirms that binarization loses essentially no information (79.2% vs. 78.8% accuracy), while continuous activations carry additional magnitude information (R^2 = 0.36 vs. 0.22). This binary routing structure explains why smooth polynomial approximation fails: cross-validated polynomial fits (degrees 2-7) never exceed R^2 = 0.06 for highly nonlinear layers. We propose that the well-established piecewise-affine characterization of deep networks can be complemented by a routing characterization: along the natural data manifold, the piecewise boundaries implement binary decisions about which tokens need nonlinear processing, routing continuous signals through qualitatively different computational paths.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。