Neural network quantization: separate scaling of rows and columns in weight matrix
摘要
Quantization methods for neural networks use low-precision fixed-point representations of weight matrices and activation vectors to reduce memory requirements and increase inference speed. However, this reduction in the precision of the numerical representation also leads to a reduction in prediction accuracy. Existing methods aim to mitigate this effect either by approximating the fixed-point representation to the original values or by directly training the quantized network parameters. In this study, we propose a novel approach that involves separately scaling each row and column of the weight matrix before quantization. By considering the error distribution assumptions, we derive the expected error and develop an algorithm to determine the scaling ratio that minimizes this error. This approach effectively reduces the degradation of prediction accuracy in quantized networks. Furthermore, our method is applicable to various commonly used network structures and demonstrates strong performance.