Compute Better Spent: Replacing Dense Layers with Structured Matrices

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Qiu, Shikai, Potapczynski, Andres, Finzi, Marc, Goldblum, Micah, Wilson, Andrew Gordon
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910479832580096
author Qiu, Shikai
Potapczynski, Andres
Finzi, Marc
Goldblum, Micah
Wilson, Andrew Gordon
author_facet Qiu, Shikai
Potapczynski, Andres
Finzi, Marc
Goldblum, Micah
Wilson, Andrew Gordon
contents Dense linear layers are the dominant computational bottleneck in foundation models. Identifying more efficient alternatives to dense matrices has enormous potential for building more compute-efficient models, as exemplified by the success of convolutional networks in the image domain. In this work, we systematically explore structured matrices as replacements for dense matrices. We show that different structures often require drastically different initialization scales and learning rates, which are crucial to performance, especially as models scale. Using insights from the Maximal Update Parameterization, we determine the optimal scaling for initialization and learning rates of these unconventional layers. Finally, we measure the scaling laws of different structures to compare how quickly their performance improves with compute. We propose a novel matrix family containing Monarch matrices, the Block Tensor-Train (BTT), which we show performs better than dense matrices for the same compute on multiple tasks. On CIFAR-10/100 with augmentation, BTT achieves exponentially lower training loss than dense when training MLPs and ViTs. BTT matches dense ViT-S/32 performance on ImageNet-1k with 3.8 times less compute and is more efficient than dense for training small GPT-2 language models.
format Preprint
id arxiv_https___arxiv_org_abs_2406_06248
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Compute Better Spent: Replacing Dense Layers with Structured Matrices
Qiu, Shikai
Potapczynski, Andres
Finzi, Marc
Goldblum, Micah
Wilson, Andrew Gordon
Machine Learning
Dense linear layers are the dominant computational bottleneck in foundation models. Identifying more efficient alternatives to dense matrices has enormous potential for building more compute-efficient models, as exemplified by the success of convolutional networks in the image domain. In this work, we systematically explore structured matrices as replacements for dense matrices. We show that different structures often require drastically different initialization scales and learning rates, which are crucial to performance, especially as models scale. Using insights from the Maximal Update Parameterization, we determine the optimal scaling for initialization and learning rates of these unconventional layers. Finally, we measure the scaling laws of different structures to compare how quickly their performance improves with compute. We propose a novel matrix family containing Monarch matrices, the Block Tensor-Train (BTT), which we show performs better than dense matrices for the same compute on multiple tasks. On CIFAR-10/100 with augmentation, BTT achieves exponentially lower training loss than dense when training MLPs and ViTs. BTT matches dense ViT-S/32 performance on ImageNet-1k with 3.8 times less compute and is more efficient than dense for training small GPT-2 language models.
title Compute Better Spent: Replacing Dense Layers with Structured Matrices
topic Machine Learning
url https://arxiv.org/abs/2406.06248