通过黑盒二阶观测,破解了Transformer中平滑前馈网络的隐藏结构。
Curvature Cryptanalysis of Smooth Transformer Feed-Forward Networks

- 利用输入的海森矩阵混合特征,从输出反推网络隐藏结构。
- 仅需8193次查询,即可恢复超过94%的隐藏方向,准确率超90%。
- 适用于独立训练模型,可实现高保真功能替代。
我们发现,在选定输入的原始输出访问下,平滑的两层前馈网络(FFNs)暴露了一个额外的结构提取通道;以GELU或SiLU激活的Transformer FFN分支为例,在无法访问参数、梯度或内部激活的情况下,利用二阶泄漏通道——投影输入海森矩阵会形成由输入权重诱导的相同隐藏对称秩一因子的不同混合。我们将所得海森矩阵集合形式化为部分对称分解,建立了局部可识别性和稳定性条件,并通过向量输出模板复用将结构查询成本降低16倍。在独立训练的CIFAR-10视觉Transformer上,仅需16个投影海森矩阵(对应8193次黑盒查询),即可恢复隐藏的FFN方向,平均绝对余弦对齐度超过0.94,其中95.1%的GELU和91.9%的SiLU方向对齐度超过0.90。该恢复结果在不同模型、重复实验和所有变压器块中均保持稳定。恢复的结构支持功能提取:固定恢复方向,仅拟合剩余参数,即可获得高保真替代模型,其top-1准确率与目标模型相差不超过0.90%(GELU)和0.62%(SiLU)。输出截断和高斯噪声会显著降低恢复精度,但调整有限差分步长后,平均对齐度仍可恢复至0.9603(GELU)和0.9398(SiLU)。这是一条从黑盒二阶观测到隐藏结构恢复与功能替换的端到端路径。在所述的查询模型下,平滑FFN的曲率揭示了行为保真度无法捕捉的内部参数几何结构。
原文摘要 · Abstract (English)
We show that smooth two-layer feed-forward networks (FFNs) expose an additional structural model extraction channel under a chosen-input raw-output oracle at the FFN branch; consider transformer FFN branches with GELU or SiLU activations under chosen-input raw-output access, without access to parameters, gradients, or internal activations; exploit a second-order leakage channel in which projected input Hessians form different mixtures of the same hidden symmetric rank-one factors induced by the FFN input weights. We formalize resulting Hessian collection as a partially symmetric decomposition to establish conditions for local identifiability and stability to exploit vector-output stencil reuse to reduce the structural query cost by a factor of 16. On independently trained CIFAR-10 vision transformers, only 16 projected Hessians, corresponding to 8193 black-box queries, recover the hidden FFN directions with average absolute cosine alignment above 0.94, with 95.1 % of GELU and 91.9 % of SiLU directions exceeding 0.90 alignment. Recovery remains high across independently trained models, repeated extraction runs, and all transformer blocks. The recovered structure supports functional extraction too. Keeping the recovered directions fixed and fitting only the remaining FFN parameters yields high-fidelity substitutes with more than 93 % top-1 agreement, while test accuracy remains within 0.90% and 0.62% of the GELU and SiLU targets. Output rounding and Gaussian noise substantially reduce recovery under a fixed attack configuration, but adapting the finite-difference step restores average alignment to 0.9603 and 0.9398. This is an end-to-end path from black-box second-order observations to hidden FFN-structure recovery and functional replacement. Under the stated oracle model, smooth FFN curvature exposes internal parameter geometry that behavioral fidelity alone cannot reveal.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。