A system and method for model parameter compression
By optimizing the bit allocation and mapping function of model parameters, the problems of wasted storage resources and loss of precision in model parameter compression are solved, achieving efficient storage and transmission compression while maintaining the accuracy of parameters.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI SHENGWANG TECH CO LTD
- Filing Date
- 2025-06-10
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies suffer from wasted storage resources and loss of precision during model parameter compression, especially when converting 32-bit floating-point numbers to 16-bit floating-point numbers. The range of model parameters is unsuitable, the original range is wasted, and parameters that do not require high precision are not optimized.
By selecting the number of bits in the signal bit set, exponent bit set, and fraction bit set, and combining them with a mapping function, the model parameters are converted into transformed values, optimizing storage requirements while maintaining accuracy. Simplified or enhanced compression methods are used to adapt to different parameter ranges, and binary coding units and zero padding are used to improve storage efficiency.
It effectively reduces the storage and transmission requirements of model parameters while maintaining parameter accuracy, improving storage and bandwidth utilization, and reducing errors in the compression process.
Smart Images

Figure CN122092877A_ABST
Abstract
Description
Cross-reference to related applications
[0001] This application claims priority to U.S. Patent Application No. 18 / 961,083, filed November 26, 2024. Technical Field
[0002] This invention generally relates to the field of video compression, and more specifically, to methods, computer programs, and systems for compressing model parameters. Machine learning and deep learning models are increasingly widely used across various industries and even in our personal lives. These models rely on parameters for training and operation. As the number of parameters associated with these complex models increases, the overall size of each model increases dramatically. This results in models becoming large and cumbersome, requiring significant data storage and bandwidth for transmission. Background Technology
[0003] Currently, there are various standards for computer number formats. For example, the Institute of Electrical and Electronics Engineers (IEEE) has proposed several computer number formats for storing parameters. These formats include int8, float16, float32, double, etc. These number formats all attempt to strike a balance between precision and range.
[0004] For example, Float32 (32-bit floating-point number), also known as single-precision floating-point format, occupies 32 bits in computer memory. It has a floating-point base and a large dynamic range. The maximum value of a signed 32-bit integer variable is 2^32. 31 -1 = 2,147,483,647. In comparison, the maximum value of a 32-bit base-2 floating-point variable is (2^3 - 2^3)^3. -23 )x2 127 ≈3.4028235x10 38 All integers with fewer than 7 decimal places can be precisely converted to Float32 values.
[0005] A 32-bit floating-point number specifies a sign bit, 8 bits for the exponent width, and 23 bits for the significant digits precision, which can be used to represent 6 to 9 significant decimal places. The sign bit determines the sign of the number. The exponent field is an 8-bit unsigned integer between 0 and 255. Offset exponent values between 0 and 255 are reserved for special numbers. The actual significant digits of a regular number consist of 23 decimal places to the right of the binary decimal point and an implicit leading bit with a value of 1.
[0006] In contrast, Float16, or 16-bit floating-point number (or half-precision floating-point number), is a number format that occupies 16 bits of computer memory. A 16-bit floating-point number includes one sign bit, five exponent bits, and ten significant digits of precision, with a maximum value of 6.55 x 10^6. 4Obviously, 16-bit floating-point numbers can achieve lower precision than 32-bit floating-point numbers, but their advantage is that they require only half the computer storage space.
[0007] Currently, it is recognized that there is a need to compress model parameters, which can usually be achieved by simply converting 32-bit precision floating-point numbers to 16-bit precision floating-point format. However, this leads to some problems: 1) The range of 16-bit floating-point numbers is from 2... 16 to 2 -24 1) The original range of model parameters may not be suitable for this range, and pruning is required to avoid overflow; 2) The original range of model parameters may only be a variation of (0,1), and it is a serious waste to use floating-point 16 to represent the parameters; 3) Some model parameters that do not require high precision do not need 10 decimal places in 16-bit floating-point numbers.
[0008] Given the importance of compressing model parameters while avoiding data pruning or wasting storage resources, this invention provides an enhanced model parameter compression scheme. Summary of the Invention
[0009] This system and method involve the processing of machine learning model parameters, primarily focusing on improving model parameter compression methods. This system and method can reduce the storage and bandwidth requirements for storing and transmitting model parameters while maintaining parameter accuracy.
[0010] For example, in some embodiments, methods and systems for model parameter compression include: selecting a total number of bits for storing multiple parameters, wherein the total number of bits is divided into a signal bit set, an exponent bit set, and a fractional bit set. Additionally, the system receives the maximum and minimum parameters among the multiple parameters. The system and method can maximize the number of bits in the fractional bit set under the following two constraints: 1) the number of bits in the fractional bit set and the number of bits in the exponent bit set are less than or equal to the total number of bits minus 1, and 2) in a model relating the number of bits in the exponent bit set to the parameter range, the range of parameters depends on the maximum and minimum parameters among the multiple parameters. After determining the number of bits in the fractional bit set and the exponent bit set, the system can use a mapping function to convert the multiple parameters into multiple transformed values.
[0011] In some cases, the system may determine that the smallest parameter among multiple parameters is below a threshold. In this case, the relationship between the number of bits in the exponent bit set and the parameter range is modeled as follows: the number of bits in the exponent bit set minus 1 is greater than or equal to the base-2 logarithm of the largest parameter, and the mapping function is: Where p is the parameter value, a is the maximum parameter, x is the number of bits in the exponent set, and y is the number of bits in the fraction set, and:
[0012] Furthermore, when the minimum parameter is negative, the system may shift the parameter range to be centered at zero. In this case, the relationship between the number of bits in the exponent bit set and the parameter range becomes: Where a p For the maximum parameter, a n The minimum parameter is used. At this point, the mapping function is:
[0013] Furthermore, if the smallest parameter among multiple parameters is equal to or greater than the threshold, the relationship between the number of bits in the exponential bit set and the parameter range becomes: Where a is the maximum parameter and b is the minimum parameter. And so on, the mapping function is: in
[0014] Furthermore, the total number of bits can be increased if the conversion error exceeds a threshold. Additionally, the system can receive the number of multiple parameters, the total number of bits, combine the binary code of each parameter with other parameters to form an 8-bit encoding unit, and fill any unused bits with 0.
[0015] It should be noted that the various functions of the present invention described above can be implemented individually or in combination. The functions of the present invention will be described in more detail below with reference to the accompanying drawings. Attached Figure Description
[0016] To more clearly illustrate the present invention, some embodiments of the present invention will be described below with reference to the accompanying drawings, wherein:
[0017] Figure 1 This is a system example block diagram for compressing model parameters, drawn according to an embodiment of the present invention;
[0018] Figure 2 This is an example process flowchart of model parameter processing drawn according to an embodiment of the present invention;
[0019] Figure 3 This is an example process flowchart of model parameter compression drawn according to an embodiment of the present invention;
[0020] Figure 4 This is an example sub-process flowchart of an enhanced compression method according to an embodiment of the present invention;
[0021] Figure 5 This is a simplified example sub-process flowchart of a compression method according to an embodiment of the present invention;
[0022] Figure 6 This is a flowchart illustrating an example process for storing compression parameters according to an embodiment of the present invention;
[0023] Figure 7A and 7B This is a schematic diagram of a computer system capable of compressing model parameters according to an embodiment of the present invention. Detailed Implementation
[0024] The present invention will be described in detail below with reference to several embodiments shown in the accompanying drawings, wherein some technical details will be described to facilitate a comprehensive understanding of the embodiments of the present invention. However, those skilled in the art can also implement the embodiments of the present invention without these specific details. On the other hand, well-known technical steps and / or structures will not be described in detail to avoid unnecessarily obscuring the present invention. The functionality and advantages of the embodiments can be better understood with reference to the following drawings and descriptions.
[0025] The accompanying drawings and descriptions below will help to understand the various aspects, functions, and advantages of exemplary embodiments of the present invention. Those skilled in the art should understand that the embodiments of the present invention described herein are presented by way of example only and are not intended to limit. All functions disclosed herein can be replaced by other functions having the same or similar purpose unless explicitly stated otherwise. Therefore, other modified embodiments also fall within the scope of the invention and its equivalents as defined herein. Therefore, the imperative and / or sequential terms used in this article, such as “will,” “will not,” “should,” “should not,” “must,” “must not,” “first,” “initially,” “next,” “subsequently,” “before,” “after,” “finally,” and “end,” etc., are not intended to limit the scope of the invention, as the embodiments disclosed herein are merely illustrative examples.
[0026] This invention relates to a system and method for model parameter compression. As shown in the figure... Figure 1 This is a schematic diagram of a model parameter processing system, represented by 100. Initially, the model trainer 120 uses training data 110. These model trainer systems are typically large GPU clusters or other supercomputing clusters. Model training is usually a demanding task, consuming significant computing power and electricity. The output of the model trainer is a trained model composed of model parameters. These model parameters are typically stored in a high-precision format (e.g., 32-bit floating-point numbers), which can be considered as uncompressed model parameters 130. These uncompressed model parameters 130 can consume substantial storage resources. Similarly, transmitting model parameters over a network (e.g., the Internet) can require significant bandwidth and time. Therefore, compression of the model parameters is urgently needed.
[0027] Model compressor 140 employs one or more compression techniques to minimize storage requirements while maintaining the required accuracy of model parameters. Furthermore, model compressor 140 can also compress model parameters and compress and store the resulting values to generate a set of compressed model parameters 150.
[0028] Figure 2 An overview flowchart of an example method for processing model parameters is provided, generally represented by flow 200. First, the process begins at step 210 with training a machine learning model to generate model parameters. Then, at step 220, the model parameters are compressed. Finally, at step 230, the compressed parameters are transmitted or otherwise stored for later retrieval and model manipulation.
[0029] Figure 3 The model compression process is illustrated in more detail. For a fixed model, the range of all parameters is known. Since the model parameters are fixed, the expected accuracy of the input data is known. Furthermore, the model parameters should not contain non-numeric (NaN) or infinite (inf) values.
[0030] First, at step 310, the maximum and minimum values of the parameter are determined. The maximum and minimum values can be calculated using the following formula, thus yielding the range of values for the parameter: Formula 1: Calculation of floating-point range values Formula 2: Calculation of floating-point range values
[0031] Where x is the exponent of the floating-point number, and y is the decimal place. Therefore, the maximum value m of a given parameter can be calculated using the following formula: Formula 3: Calculation of maximum value Formula 4: Minimum Value Calculation
[0032] At step 320, parameters whose minimum value is below a given threshold are identified. In this case, a simplified compression method is allowed, as shown at step 340. However, if the minimum value is greater than the threshold, an enhanced compression method can be applied, as shown at step 330. Figure 4 The enhanced compression method will be described in detail. The enhanced compression method involves determining the range of parameters, as shown in step 420. The range of floating-point values is derived from the following formula: Formula 5: Floating-point range
[0033] Since the model parameters will not be NaN or inf, and the exponent value will not be 1, this special case does not need to be considered.
[0034] For example, suppose the maximum parameter is 'a' and the minimum parameter is 'b'. In this example, it is also assumed that all parameters are positive. The range 'r' of these parameters will be derived by the following formula: Formula 6: Example of parameter range
[0035] After determining the parameter range, parameters x and y can be set in step 430 according to the requirements. Using formulas 1 and 2 above, x and y parameters that satisfy the following conditions can be set: x+y≤bits-1 Formula 7: Length Definition
[0036] Where bits is the total number of bits used to store the model parameters. And it also satisfies the following condition: 2 x +y-1≥r Formula 8: Range Definition
[0037] Based on the above definitions, x and y can be solved for a given set of bits. Initially, a lower number of bits can be used, such as 6 bits. At step 440, the system determines whether suitable x and y can be set given the requirements. If no x and y values satisfying the constraints can be found, a larger number of bits can be used. This process iteratively checks the expanded number of bits until suitable x and y values can be found at step 450.
[0038] After determining the appropriate number of bits and solving for the appropriate x and y, at step 460, for each model parameter p, the following function can be solved: Formula 9: Mapping Function
[0039] The largest parameter 'a' will be mapped to 'm(x,y)', and the smallest parameter 'b' will be mapped to 'n(x,y)'. At step 470, all other parameters between 'a' and 'b' will be mapped to values between 'm(x,y)' and 'n(x,y)'. This process scales all parameters to fully representable floating-point numbers. Since 'a', 'b', 'x', 'y', and 'f(p)' are all known, reconstructing parameter 'p' using Equation 9 is straightforward, as shown at step 480. This concludes the enhanced compression method. The enhanced compression method described above will be illustrated below with an example. For instance, suppose the model training provided the following parameter values: 392.13, 113.22, 3.21, 82.3, and 1.2. Also suppose the system is prepared to use 8 bits to store these parameters. Using Equations 7 and 8, we can derive: x+y≤7 Formula 10: Example 1.1 Formula 11: Example 1.2
[0040] The values of x and y can have multiple choices. For example, (x, y) could be any set of values from (3, 4), (4, 3), (5, 2), (6, 1), or (7, 0). Taking (3, 4) as an example, combining formulas 9, 3, and 4, we can calculate: Formula 12: Example 1.3
[0041] Therefore, all parameters can be transformed using the following linear relationship: Original value Conversion value Position code Mapping error 392.13 15.5 01111111 15.5 0.0% 113.22 4.4470595 01100010 4.5 1.2% 3.21 0.0874669 00001100 0.09375 7.2% 82.3 3.2217291 01011001 3.125 3.0% 1.2 0.0078125 00000001 0.0078125 0.0% Table 1
[0042] For example, a similar analysis can be performed when (x,y) = (4,3), (5,2), (6,1), or (7,0). In the table below, taking (5,2) as an example, the following parameter transformations can be obtained: Original value Conversion value Position code Mapping error 392.13 57344 01111111 57344 0.0% 113.22 16431.778 01111000 16384 -0.3% 3.21 294.83909 01100001 320 8.5% 82.3 11896.243 01110110 12288 3.3% 1.2 0.0000076 00000001 0.0000076 0.0% Table 2
[0043] Finally, the selected x and y values are analyzed. Comparing the results in Tables 1 and 2, the maximum compression error of (5,2) is greater than that of (3,4). Generally, the larger the y value, the more accurate the compression. Therefore, to obtain the optimal choice of (x,y), the maximum y value that satisfies Equations 7 and 8 should be used.
[0044] This method can store four additional parameters, a, b, x, and y. The system can then convert the compressed parameters back to their original values with minimal rounding error. For negative parameters, the system can find four more "extra" parameters and can jointly optimize both negative and positive values by taking the absolute value of the negative parameters or by finding a, b, x, and y together.
[0045] The above method is particularly useful when the value of b is large and the overall bit range is not fully utilized. If the minimum value of b has been found to be below the threshold, a simplified compression method can be used. Figure 5 The general will elaborate on the simplified compression method. When b is sufficiently small, the entire range is almost fully utilized. If the maximum value of the parameter is a, then (x,y) should satisfy the following condition when maximizing y: x+y≤bits-1 Formula 13: Definition of Length 2 x-1 ≥log2a Formula Formula 14
[0046] After obtaining the values of x and y in step 510, it is determined whether to shift the centroid of the function to near 0, as shown in step 520. This approach is ideal when the minimum parameter value is negative. In this case, the maximum value is given as a. p The smallest negative value is given as a. n In these cases, the maximum positive value is reset to: Formula 15: Maximum shift value
[0047] Therefore, the range is centered at step 530, and the x and y values (not shown) can be recalculated by maximizing y under the following condition: x+y≤bits-1 Formula 16: Length Definition Formula 17
[0048] Subsequently, the shifted mapping function is generated at step 540, as shown below: Formula 18: Shift Mapping Function
[0049] Conversely, if the minimum value is not negative, there is no need to shift the range to 0-centered. In this case, a simplified mapping function can be generated at step 550. This simplified mapping function is shown below: Formula 19: Simplified mapping function
[0050] Regardless of whether a simplified mapping function or a shift mapping function is used, the system can then map each parameter in binary format at step 560, as described above. The parameters can then be reconstructed at step 570.
[0051] Regardless of whether a simplified or enhanced compression method is used, the system can check the reconstructed values to determine the compression error (not shown). This check may include analyzing whether the compression error of one or a set of parameters exceeds a maximum threshold, and / or whether the average error value exceeds an acceptable threshold. If one or more values exceed the threshold, the system can determine that the number of bits used is too low (although the required conditions are met), and thus use a larger number of bits.
[0052] In addition to performing the enhanced compression described above, the system can further improve storage efficiency by storing compression parameters, such as... Figure 6As shown in step 600. In this example process, the system receives information about the floating-point size Q and the total number of parameters R at step 610. Computer storage typically operates in 8-bit processing units, so the system can combine the array of Q floating-point numbers and R parameters into a set of 8-bit processing units S at step 620. For example, suppose there are 7 parameters (R = 7), compressed into 6 floating-point numbers (Q = 6). In this example, 3 bytes, or 24 bits, can be used to store 4 of the 6 floating-point parameters. The remaining 3 of the 6 floating-point parameters can be stored in the next 3 bytes, and then the system fills the remaining bits with 0s at step 630. At step 640, the compressed parameters can be stored in a manner that allows for retrieval and individual separation of the parameters.
[0053] The above has described the systems and methods used for improved model parameter processing. Now let's look at the devices used to run these functions in real time. For ease of discussion, Figure 7A and Figure 7B Each system is shown as computer system 700, which can be used to implement the embodiments of the present invention. Figure 7A This diagram illustrates one possible physical form of the computer system 700. Of course, the computer system 700 can have various physical forms, ranging from printed circuit boards, integrated circuits, small handheld devices to large supercomputers. The computer system 700 may include a monitor 702, a display 704, a stand 706, a blade server containing one or more storage drives 708, a keyboard 710, and a mouse 712, etc. Medium 714 is a computer-readable medium used for transmitting data to the computer system 700. Figure 7B This is an example block diagram of computer system 700. System bus 720 connects to a variety of subsystems. Processor 722 (also called central processing unit or CPU) is adapted to storage devices (including memory 724). Memory 724 includes random access memory (RAM) and read-only memory (ROM). As is well known to those skilled in the art, ROM is used for unidirectional transfer of data and instructions to the CPU, while RAM is typically used for bidirectional transfer of data and instructions. Both types of memory can include any suitable form of computer-readable medium described below. Fixed medium 726 can also be bidirectionally adapted to processor 722 to provide additional data storage capacity and can also include any computer-readable medium described below. Fixed medium 726 is an auxiliary storage medium (e.g., hard disk) for storing programs, data, etc., and typically operates slower than main memory. It should be noted that, where appropriate, information retained in fixed medium 726 can be incorporated into virtual memory in memory 724 in a standard manner. Removable medium 714 can take the form of any computer-readable medium described below.
[0054] Processor 722 is also compatible with various input / output devices, such as display 704, keyboard 710, mouse 712, and speaker 730. Generally, input / output devices can be any of the following: video display, trackball, mouse, keyboard, microphone, touch-sensitive display, sensor card reader, tape or paper tape reader, tablet computer, stylus, voice or handwriting recognition device, biometric reader, motion sensor, EEG reader, or other computer, etc. Processor 722 can also interconnect with another computer or telecommunications network using network interface 740. It is conceivable that processor 722 uses network interface 740 to receive information from the network, or may output information to the network during the execution of the enhanced image patch prediction method described above. Furthermore, embodiments of the method of the present invention can run independently on processor 722, or can also operate collaboratively with a remote CPU sharing partial processing via a network such as the Internet.
[0055] Software is typically stored in non-volatile memory and / or drive units. In fact, for large programs, it may not even be possible to store the entire program in a single memory. However, it is understood that during software execution, it can be moved to a computer-readable location suitable for processing, which, for ease of explanation, is referred to as memory, if necessary. Even when the software is moved to memory for execution, the processor typically uses hardware registers and caches to store software-related values, ideally for speeding up execution. In this document, when a software program is stated to be “implemented in a computer-readable medium,” it is assumed that the software program is stored in any known or convenient location (non-volatile memory or hardware registers, etc.). A processor is considered “configured to run a program” when at least one value related to the program is stored in a processor-readable register.
[0056] During operation, the computer system 700 can be controlled by operating system software (such as a media operating system) that includes a file management system. For example, Microsoft Corporation in Redmond, Washington... An operating system series and its associated file management system is essentially operating system software with a file management system. For example, the Linux operating system and its associated file management system are also operating system software with a file management system. File management systems are typically stored in non-volatile memory and / or drive units, allowing the processor to perform various operations required by the operating system, input and output data, and store data in memory, including storing files in non-volatile memory and / or drive units.
[0057] Some parts described in detail in this document may be presented in the form of algorithms and symbolic representations of operations on data bits within computer memory. These algorithmic descriptions and representations are the means by which those skilled in the art of data processing most effectively communicate their work to others skilled in the art. As defined herein, an algorithm is a series of self-consistent operational steps designed to achieve a desired result. These operations require physical manipulation of physical quantities. Typically, these physical quantities are represented as electrical or magnetic signals that can be stored, transmitted, combined, compared, or otherwise manipulated, but this is not always necessary. For common use and ease of interpretation, these signals are often referred to as bits, values, elements, symbols, characters, items, numbers, etc.
[0058] The algorithms and representations described herein are inherently independent of any particular computer or device. The procedural methods described herein can be implemented using various general-purpose systems, or more convenient dedicated devices can be designed to run specific embodiments. The architectures required for these systems will be detailed below. Furthermore, the techniques described herein are not referred to in any particular programming language, and therefore various embodiments can be implemented using various programming languages.
[0059] In other embodiments, the machine may operate as a standalone device or may be interconnected (e.g., networked) with other machines. In a networked deployment, the machine may operate as a server or client machine in a client-server network environment, or as a peer machine in a peer-to-peer (or distributed) network environment.
[0060] The aforementioned machines can be server computers, client computers, personal computers (PCs), tablets, laptops, set-top boxes (STBs), personal digital assistants (PDAs), cellular phones, iPhones, BlackBerry phones, glasses with processors, headsets with processors, virtual reality devices, processors, distributed processors working together, telephones, network devices, network routers, switches or bridges, or any machine capable of running a set of instructions (whether sequentially or otherwise) that specify the operations that the machine needs to perform.
[0061] Although machine-readable media or machine-readable storage media are shown as a single medium in exemplary embodiments, "machine-readable media" and "machine-readable storage media" should be understood to include a single medium or multiple media (e.g., a centralized or distributed database and / or associated caches and servers) that store one or more sets of instructions. "Machine-readable media" and "machine-readable storage media" should also be understood to include any medium capable of storing, encoding, or carrying a set of instructions for machine execution and enabling the machine to perform any one or more methods of the currently disclosed technical solutions.
[0062] Generally, routines that run to implement embodiments of the present invention may be implemented as part of an operating system or a particular application, component, program, object, module, or sequence of instructions (referred to as a "computer program"). A computer program typically includes one or more instructions written at different times in various memories and storage devices within a computer (or distributed across computers), and when one or more processing units or processors within (or across computers) read and execute these instructions, the computer can perform operations to implement the functions disclosed in the present invention.
[0063] Furthermore, while the embodiments described herein are set in the context of fully functional computers and computer systems, those skilled in the art will understand that various embodiments can be distributed in various forms of program products, and the disclosure of this invention applies equally to any particular type of machine or computer-readable medium in which the distribution is actually implemented.
[0064] While the present invention has been described through several embodiments, variations, modifications, substitutions, and equivalents that fall within the scope of the invention are still possible. Although subsection headings have been used herein to aid in the description of the invention, these headings are illustrative only and are not intended to limit the scope of the invention. It should also be noted that many alternatives can be used to implement the methods and apparatus of the present invention. Therefore, the appended claims should be considered to encompass all such variations, modifications, substitutions, and equivalents within the spirit and scope of the invention.
Claims
1. A computerized method for compressing model parameters, comprising: Select the total number of bits (bits) used to store multiple parameters, wherein the total number of bits is divided into signal bits, exponent set, and fraction set; It can accept the maximum and minimum parameters from a set of arguments. Maximize the number of digits in the fractional digit set while satisfying two constraints: the number of digits in the fractional digit set and the number of digits in the exponential digit set are less than or equal to the total number of digits minus 1, and in the relationship model between the number of digits in the exponential digit set and the parameter range, the parameter range depends on the maximum and minimum parameters among multiple parameters. as well as Use mapping functions to convert multiple parameters into multiple transformed values.
2. The method according to claim 1 further includes determining whether the smallest parameter among the plurality of parameters is lower than a threshold.
3. The method according to claim 2, wherein the relationship model between the number of bits in the exponent bit set and the parameter range is: the number of bits in the exponent bit set of 2 minus 1 is greater than or equal to the base-2 logarithm of the maximum parameter.
4. The method according to claim 3, wherein the mapping function is given by the following formula: in, p is the parameter value, a is the maximum parameter, x is the number of bits in the exponent set, y is the number of bits in the decimal set, and:
5. The method according to claim 2, further comprising: When the minimum parameter is negative, the parameter range is shifted to be centered at 0.
6. The method according to claim 5, wherein the relationship model between the number of bits in the exponent bit set and the parameter range becomes: Where a p It is the largest parameter, a n It is the smallest parameter, and x is the number of bits in the exponent bit set.
7. The method according to claim 6, wherein the mapping function is as follows: in, p is the parameter value, x is the number of bits in the exponent set, y is the number of bits in the decimal set, and:
8. The method according to claim 1 further includes determining whether the smallest parameter among the plurality of parameters is equal to or higher than a threshold.
9. The method according to claim 8, wherein the relationship model between the number of bits in the exponent bit set and the parameter range becomes: Where a is the largest parameter, b is the smallest parameter, x is the number of bits in the exponent set, and y is the number of bits in the decimal set.
10. The method according to claim 9, wherein the mapping function is as follows: in, p is a parameter value, and:
11. The method according to claim 1, further comprising: Increase the total number of bits when the conversion error exceeds the threshold.
12. The method of claim 1, further comprising receiving the number of multiple parameters, receiving the total number of bits, combining the binary code of each parameter with other parameters to form a set of 8-bit encoding units, and filling any unused bits with 0.
13. A computer system for compressing model parameters, comprising: A computer interface for receiving the total number of bits of multiple parameters, wherein the total number of bits is divided into signal bits, exponent set and fraction set, and for receiving the maximum and minimum parameters among the multiple parameters; The processing unit is used to maximize the number of digits in the fractional digit set under two constraints, wherein the two constraints are: the number of digits in the fractional digit set and the number of digits in the exponential digit set are less than or equal to the total number of digits minus 1, and in the relationship model between the number of digits in the exponential digit set and the parameter range, the parameter range depends on the maximum and minimum parameters among multiple parameters. And using mapping functions to convert multiple parameters into multiple corresponding transformation values; as well as A database is used to store multiple transformation values.
14. The system of claim 13, wherein the processing unit further determines whether the smallest parameter among the plurality of parameters is below a threshold.
15. The system according to claim 14, wherein the relationship model between the number of bits in the exponent bit set and the parameter range is: the number of bits in the exponent bit set of 2 minus 1 is greater than or equal to the base-2 logarithm of the maximum parameter.
16. The system according to claim 15, wherein the mapping function is as follows: in, p is the parameter value, a is the maximum parameter, x is the number of bits in the exponent set, y is the number of bits in the decimal set, and:
17. The system of claim 13, wherein the processing unit further determines whether the smallest parameter among the plurality of parameters is equal to or higher than a threshold.
18. The system according to claim 17, wherein the relationship model between the number of bits in the exponent bit set and the parameter range becomes: Where a is the largest parameter, b is the smallest parameter, x is the number of bits in the exponent set, and y is the number of bits in the decimal set.
19. The system according to claim 18, wherein the mapping function is as follows: in, p is a parameter value, and:
20. The system according to claim 13, wherein: Increase the total number of bits when the conversion error exceeds the threshold.
21. The system of claim 13, wherein the database further receives the number of multiple parameters, receives the total number of bits, combines the binary code of each parameter with other parameters to form a set of 8-bit encoding units, and fills any unused bits with 0.