Neural Parameter Compression with Shorter Codeword Tables
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional data compression algorithms for neural network parameters result in excessive storage space due to long maximum codeword lengths, which is not optimally managed, especially in edge computing scenarios where storage space is limited.
Innovation Solution
A data compression method that divides parameter values into two sets based on occurrence probabilities, preprocesses the lower probability set, and applies variable length encoding to both sets, reducing the maximum codeword length and storage requirements by forming a balanced code table.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If conventional lossless compression encoding algorithms (e.g., Huffman encoding) are applied to quantized parameters, then the average codeword length is reduced and encoding efficiency is improved, but the maximum codeword length becomes longer than the original quantized code, requiring excessive storage space for the decoding table
Solution Approach 1:
The patent segments the code table into two parts: a first code table for storing original quantized codes and a second code table for storing encoded codes. This segmentation allows the system to handle different codeword lengths separately, reducing the maximum storage requirement by not extending the table to accommodate the longest possible encoded codeword.
Solution Approach 2:
The patent introduces a new dimension by adding a mark bit to distinguish between original codes and encoded codes. This dimensional change allows the system to store both types of codes in a unified structure without requiring the table to be extended to the maximum codeword length, thereby reducing storage space while maintaining decoding capability.
2Ease of operation
If the code table is extended to accommodate the longest codeword length for hardware implementation of lookup table, then decoding can be facilitated, but the storage space required becomes excessively large
Solution Approach 1:
The patent divides the code table into two separate tables: the first code table stores original quantized codes with their corresponding values, and the second code table stores encoded codes. This segmentation allows hardware implementation without extending the table to maximum codeword length, as each table only needs to accommodate its specific code type.
Solution Approach 2:
The patent introduces a mark bit as an intermediary to indicate whether a codeword is an original code or an encoded code. This mediator allows the decoding system to handle variable-length codes without requiring a uniformly extended lookup table, thus reducing storage space while maintaining ease of decoding.
3Loss of substance
If quantized parameters are compressed using variable-length encoding, then compression ratio is improved, but the decoding process becomes more difficult and requires larger lookup tables
Solution Approach 1:
The patent segments the encoding process into two distinct code tables, allowing the decoder to efficiently handle both original and encoded codes without complex processing. The first code table handles original quantized codes directly, while the second code table handles compressed encoded codes, simplifying the overall decoding logic.
Solution Approach 2:
The patent incorporates a mark bit that provides feedback information to the decoder about the type of code being processed. This feedback mechanism allows the decoder to quickly determine whether to use the first or second code table, reducing decoding complexity while maintaining high compression ratios.
Data Source
AI summary
A data compression method, comprising: obtaining a plurality of values of a parameter and an occurrence probability of each of the plurality of values (S101) comparing the occurrence probability with a predetermined threshold, wherein values with the occurrence probability less than the predetermined threshold are first set of values, and values with the occurrence probability greater than or equal to the predetermined threshold are second set of values (S102), performing pretreatment on the first set of values (S103), and encoding the second set of values and the pretreated first set of values (S104). By means of the data compression method, the maximum codeword length can be effectively reduced, so as to reduce the requirements of a code table to the storage space.


