arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.28067cs.CVcs.AIcs.ITcs.LGmath.IT
收藏

通过压缩网络追踪误差:ViT-L/16中FFN权重压缩的角度度量

Following the Error Through a Compressed Network:An Angular Measure for FFN Weight Compression in ViT-L/16

Advanced Micro Devices, Inc.(超威半导体公司)

Paolo D'Alberto

AI总结:

该研究针对ViT-L/16的FFN权重压缩,提出角度度量评估四种压缩方案,发现旋转方案误差累积特性,引入层输出频谱角度度量解决方案排名不一致问题,相关方法可推广至其他模型。

摘要:

我们研究了Vision Transformer ViT-L/16的48个前馈网络(FFN)矩阵的压缩,压缩至2至8位,采用四种方案:逐token网格、固定高斯Lloyd-Max表、适配矩阵的表,以及随机符号哈达玛旋转后接固定表。我们在50000张图像上进行评估。在4位时,四种方案的top-1准确率与float32模型的差距在0.8个点以内,而与该模型预测结果的一致性范围为98.4%至94.4%。我们使用压缩后与float32残差流之间的角度误差(经各层传递)作为可移植度量,该度量对方案的排名与最终分类结果一致,并揭示了排名的形成位置:采用旋转时,角度增长接近层数的平方根,这是误差独立累积的特征,而其他方案在后续层中被放大。同一度量还表明,单独在某一层表现更好的方案,在整个网络中可能表现更差。为解决这种不一致性,我们引入了层输出频谱的角度度量,该度量在方案分歧最大的区域,单独对层的方案排名与整个网络的排名一致。我们用真实样本和统计生成的样本支持这些观察结果。研究范围为单个模型、仅FFN权重,以及压缩权重的float评估;未声称可加速。不过,这些误差度量和样本生成方法可应用于其他模型和精度。

英文摘要:

We study the compression of the 48 feed-forward network (FFN) matrices of the Vision Transformer ViT-L/16 to 2--8 bits with four schemes: a per-token grid, a fixed Gaussian Lloyd--Max table, a table fitted to the matrix, and a random-sign Hadamard rotation followed by the fixed table. We evaluate on 50,000 images. At 4 bits the top-1 accuracy of the four schemes lies within 0.8 points of the float32 model, while the agreement with its predictions ranges from 98.4\% to 94.4\%. We use the angular error between the compressed and the float32 residual stream, followed through the blocks, as a portable measure that ranks the schemes as the final classification does and shows where the ranking is built: with rotation the angle grows close to the square root of the number of blocks, the signature of independently accumulating errors, while the other schemes are amplified in the later blocks. The same measure shows that a scheme that is better on one block in isolation can be worse in the whole network. To address this inconsistency we introduce an angular measure of the spectrum of the output of a block, which in isolation orders the schemes as the whole network does where they diverge most. We support these observations with real samples and with statistically generated ones. The scope is one model, the FFN weights only, and float evaluation of compressed weights; no speed-up is claimed. The error measures and the sample generation, however, can be applied to other models and precisions.

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

↑