The invention provides a quantization method and a quantization device, which can perform
singular value decomposition on a first matrix formed by
word embedding vectors to obtain the maximum characteristic value of each
block matrix in M block matrixes, and can determine the quantity of quantization bits of each
block matrix according to the maximum characteristic value of each
block matrix. The method comprises the following steps of: dividing each block matrix into a plurality of block matrixes, quantifying each block matrix to obtain each quantized block matrix, combining each quantized block matrix to obtain a quantized first matrix, and representing the amount of
semantic information carried in each block matrix by a maximum characteristic value of each block matrix to a certain extent, according to the embodiment of the invention, the quantized bit number can be allocated to each block matrix according to the amount of
semantic information carried by each block matrix, so that different bit numbers can be allocated to the block matrixes carrying different
semantic information, differential bit number allocation can be realized, semantic
information loss can be reduced, and user experience can be improved.