改变乘积,保留参数:Transformer的关联代数层

·

研究论文 · 2026/09/29

快速矩阵乘法算法保持乘积不变,寻找更廉价的求值方式。我们转而探讨Transformer的学习投影能否使用一种完全不同且更廉价的乘积。基于一种结合代数构造,用更稀疏的交互表替代普通矩阵乘法,在相同权重块上,我们构建了一族在矩阵维度上具有二次算术复杂度的方案(当物理块大小固定时),并推导了GPU执行的有限形状约束。该构造根据Alder-Strassen界可证明在其双线性秩上最优,并可实现为行类型矩形投影,兼容因果掩码和KV缓存解码。我们通过训练两个约1.1亿参数的仅解码器Transformer语言模型进行实证测试,使用相同配方和123亿token预算,仅前馈层不同:一个使用普通稠密矩阵乘法,另一个使用结合代数乘积。在四个提示域上,代数模型实现了端到端生成吞吐量6.2-7.8%的提升,但在所有三个报告的下游指标上得分较低。我们将这些结果视为所提方法在小规模下的可行性和可训练性检验,未来工作留待进一步研究。

该研究探索了用结合代数乘积替代Transformer中矩阵乘法的可能性,在保持参数不变的情况下提升生成吞吐量,为高效Transformer架构提供了新思路,尽管下游性能有所下降,但为未来优化指明了方向。

Fast matrix multiplication algorithms keep the product fixed and search for a cheaper way to evaluate it. We instead ask whether a Transformer's learned projections can use a different, cheaper product altogether. Building on an associative-algebra construction that replaces ordinary matrix multiplication with a sparser interaction table over the same weight blocks, we construct a family with quadratic arithmetic in the matrix dimension when the physical block size remains fixed, and derive finite-shape constraints for GPU execution. The construction is provably optimal for its bilinear rank by the Alder--Strassen bound and can be realized as row-typed rectangular projections compatible with causal masking and KV-cached decoding. We provide an empirical test of this approach by training two approximately 110M-parameter decoder-only Transformer LMs from the same recipe and 12.3B-token budget, differing only in their feed-forward layer: one uses ordinary dense matrix multiplication and the other uses the associative-algebra product. Across four prompt domains, the algebraic model achieves a 6.2--7.8\% increase in end-to-end generation throughput, while obtaining lower scores on all three reported downstream metrics. We treat these results as a feasibility and trainability check for the proposed approach at small scale, leaving further investigation to future work.

阅读原文

参与讨论