arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.02117cs.LGstat.ML
收藏

在结构化矩阵的连续空间中搜索高效线性层

Searching for Efficient Linear Layers over a Continuous Space of Structured Matrices

New York University(纽约大学);Carnegie Mellon University(卡内基梅隆大学);Capital One(第一资本金融公司);Columbia University(哥伦比亚大学);Cornell University(康奈尔大学)

Andres Potapczynski, Shikai Qiu, Marc Finzi, Christopher Ferri, Zixi Chen, Micah Goldblum, Bayan Bruss, Christopher De Sa, Andrew Gordon Wilson

AI总结:

针对大型神经网络中稠密线性层的计算瓶颈,研究提出可搜索所有爱因斯坦求和表示线性算子的统一框架,基于分类分析得出缩放规律关键变量,进而提出BTT-MoE架构,实现了比稠密层和标准MoE更优的计算效率。

摘要:

稠密线性层是大型神经网络中主要的计算瓶颈,因此迫切需要更高效的替代方案。以往的研究聚焦于少量手工设计的结构化矩阵,且未探究当模型规模和训练样本均得到最优分配时,这些结构能否在计算最优缩放定律方面超越稠密层。在本研究中,我们提出了一个统一框架,可在所有能通过爱因斯坦求和表示的线性算子中进行搜索。该框架涵盖了许多先前提出的结构,例如低秩(low-rank)、克罗内克(Kronecker)、张量列(Tensor-Train)、块张量列(Block Tensor-Train, BTT)和Monarch结构,还包含许多新颖结构。为分析该框架,我们基于计算和代数性质对所有此类算子建立了分类体系,并表明计算最优缩放定律的差异主要由我们引入的少量变量决定。具体而言,较小的$ω$(用于衡量参数共享程度)和较大的$ψ$(用于衡量秩)始终能带来更优的缩放定律。基于“每单位计算量下参数最大化的满秩结构性能最佳”这一洞见,我们提出了BTT-MoE,这是一种通过对BTT结构中的计算进行稀疏化得到的新型混合专家(Mixture-of-Experts, MoE)架构。与针对整个前馈网络的标准稀疏MoE不同,BTT-MoE在模型的每一个线性层(包括注意力块中的投影矩阵)中都学习一个MoE。我们发现,相较于稠密层和标准MoE,BTT-MoE能带来显著的计算效率提升。

英文摘要:

Dense linear layers are the dominant computational bottleneck in large neural networks, presenting a critical need for more efficient alternatives. Previous efforts focused on a small number of hand-crafted structured matrices and neglected to investigate whether these structures can surpass dense layers in terms of compute-optimal scaling laws when both the model size and training examples are optimally allocated. In this work, we present a unifying framework that enables searching among all linear operators expressible via an Einstein summation. This framework encompasses many previously proposed structures, such as low-rank, Kronecker, Tensor-Train, Block Tensor-Train (BTT), and Monarch, along with many novel structures. To analyze the framework, we develop a taxonomy of all such operators based on their computational and algebraic properties and show that differences in the compute-optimal scaling laws are mostly governed by a small number of variables that we introduce. Namely, a small $ω$ (which measures parameter sharing) and large $ψ$ (which measures the rank) reliably led to better scaling laws. Guided by the insight that full-rank structures that maximize parameters per unit of compute perform the best, we propose BTT-MoE, a novel Mixture-of-Experts (MoE) architecture obtained by sparsifying computation in the BTT structure. In contrast to the standard sparse MoE for each entire feed-forward network, BTT-MoE learns an MoE in every single linear layer of the model, including the projection matrices in the attention blocks. We find BTT-MoE provides a substantial compute-efficiency gain over dense layers and standard MoE.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑