用0和1的二值参数替代浮点数,实现32倍内存压缩且性能相当
1 bit is all we need: binary normalized neural networks
- 所有层参数仅用0或1表示,采用二值归一化层设计
- 图像分类与语言建模任务上,性能接近32位浮点模型
- 可在普通硬件上用1比特数组实现,无需专用芯片
大型神经网络模型(如语言模型和基础图像模型)规模持续增长,带来部署难题,亟需降低内存占用并提升计算效率。本文提出一种新型神经网络层——二值归一化层(binary normalized layer),所有层的参数(包括卷积核权重和偏置)仅取0或1。该层可应用于全连接、卷积、注意力等多种结构,为传统层的微小变体。实验中构建了用于多分类图像识别的模型(含卷积与全连接层)及基于Transformer的序列语言解码器(含多头注意力)。结果表明,使用二值归一化层的模型在性能上几乎与对应32位实数参数模型持平。该方法使模型内存需求降低32倍,且可在现有计算机上通过1比特数组轻松实现,无需专用电子硬件。该技术为低内存大型模型部署开辟新路径,适用于移动设备或仅含CPU的场景。
原文摘要 · Abstract (English)
The increasing size of large neural network models, specifically language models and foundational image models, poses deployment challenges, prompting efforts to reduce memory requirements and enhance computational efficiency. These efforts are critical to ensure practical deployment and effective utilization of these models across various applications. In this work, a novel type of neural network layers and models is developed that uses only single-bit parameters. In this novel type of models all parameters of all layers, including kernel weights and biases, only have values equal to zero or one. This novel type of models uses layers named as binary normalized layer. These binary normalized layers can be of any type, such as fully connected, convolutional, attention, etc., and they consist of slight variations of the corresponding conventional layers. To show the effectiveness of the binary normalized layers, two different models are configured to solve a multiclass image classification problem and a language decoder to predict the next token of a sequence. The model to solve the image classification has convolutional and fully connected layers, and the language model is composed of transformer blocks with multi-head attention. The results show that models with binary normalized layers present almost the same results obtained by equivalent models with real 32-bit parameters. The binary normalized layers allow to develop models that use 32 times less memory than current models and have equivalent performance. Besides, the binary normalized layers can be easily implemented on current computers using 1-bit arrays, and do not require the development of dedicated electronic hardware. This novel type of layers opens a new era for large neural network models with reduced memory requirements that can be deployed using simple and cheap hardware, such as mobile devices or only cpus.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。