# US 2025/0148357 A1 · Flexible machine learning model compression

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0148357 A1
- Document ID: US20250148357A1
- Status: Published application
- Kind: A1
- Application number: 18/504,016
- Filed: 2023-11-07
- Published: 2025-05-08
- Earliest claimed: 2023-11-07
- Applicants: Google LLC
- Inventors: Aditya Binodkumar Agrawal; Blake Alan Hechtman; Matthew Leever Hedlund; David Alexander Majnemer; Marissa Karen Ikonomidis
- Web page: https://patentgrep.com/patent/US20250148357A1

## CPC

- G06N 3/045: Combinations of networks
- G06N 20/00: Machine learning
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 20/10: using kernel methods, e.g. support vector machines [SVM]
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for compresses a machine learning model having a plurality of parameters. In one aspect, one of the methods includes obtaining trained values of a set of parameters for at least a portion of a machine learning model; identifying one or more dense ranges for the trained values; determining a least number of bits required to represent each trained value within the one or more dense ranges; identifying a second format having a range that is smaller than a range of the first format; and generating a compressed version of the at least a portion of the machine learning model.

## Claims

### Claim 1

A computed-implemented method comprising:
obtaining trained values of a set of parameters for at least a portion of a machine learning model, the trained values represented in a first format;
identifying one or more dense ranges for the trained values, the one or more dense ranges collectively defining a range of values for which a density of the trained values within the range meets a minimum density criterion;
determining a least number of bits required to represent each trained value within the one or more dense ranges;
identifying, based at least on the determined least number of bits required to represent each trained value within the one or more dense ranges, a second format having a range that is smaller than a range of the first format; and
generating a compressed version of the at least a portion of the machine learning model by:
(i) converting the trained values of the set of parameters within the one or more dense ranges from the first format to compressed values represented by the second format, and
(ii) assigning predetermined values to each of the parameters in the compressed version of the at least a portion of the machine learning model whose trained values were not within the one or more dense ranges.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first format is a floating-point format.

### Claim 3 (depends on 1)

The method of claim 1, wherein determining the least number of bits required to uniquely represent each value within the one or more dense ranges comprises:
determining a number of exponent bits required for uniquely representing represent each value within the one or more dense ranges.

### Claim 4 (depends on 1)

The method of claim 1, determining the least number of bits required to uniquely represent each value within the one or more dense ranges comprises:
determining a number of mantissa bits required for representing represent each value within the one or more dense ranges.

### Claim 5 (depends on 1)

The method of claim 1, wherein identifying the second format having the second level of precision comprises:
selecting, from among multiple candidate formats that correspond respectively to different numbers of bits, a candidate format that corresponds to the determined least number of bits as the second format.

### Claim 6 (depends on 1)

The method of claim 1, wherein converting the trained values of the set of parameters comprises:
generating a mapping from the trained values that each have the first format to the compressed values that each have the second format; and
converting the trained values in accordance with the mapping.

### Claim 7 (depends on 6)

The method of claim 6, wherein generating the mapping comprises generating a scale factor for each dense range.

### Claim 8 (depends on 1)

The method of claim 1, wherein the minimum density criterion requires that at least a particular percentage of the set of parameters are within the one or more dense ranges.

### Claim 9 (depends on 1)

The method of claim 1, wherein the neural network is a Transformer neural network, and wherein the first layer is one of an embedding layer, an attention layer, or a feed-forward layer of the Transformer neural network.

### Claim 10

One or more non-transitory computer-readable storage media storing instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:
obtaining trained values of a set of parameters for at least a portion of a machine learning model, the trained values represented in a first format;
identifying one or more dense ranges for the trained values, the one or more dense ranges collectively defining a range of values for which a density of the trained values within the range meets a minimum density criterion;
determining a least number of bits required to represent each trained value within the one or more dense ranges;
identifying, based at least on the determined least number of bits required to represent each trained value within the one or more dense ranges, a second format having a range that is smaller than a range of the first format; and
generating a compressed version of the at least a portion of the machine learning model by:
(i) converting the trained values of the set of parameters within the one or more dense ranges from the first format to compressed values represented by the second format, and
(ii) assigning predetermined values to each of the parameters in the compressed version of the at least a portion of the machine learning model whose trained values were not within the one or more dense ranges.

### Claim 11 (depends on 10)

The computer-readable storage media of claim 10, wherein the neural network is a Transformer neural network, and wherein the first layer is one of an embedding layer, an attention layer, or a feed-forward layer of the Transformer neural network.

### Claim 12

A system comprising:
one or more computers; and
one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to perform operations comprising:
obtaining trained values of a set of parameters for at least a portion of a machine learning model, the trained values represented in a first format;
identifying one or more dense ranges for the trained values, the one or more dense ranges collectively defining a range of values for which a density of the trained values within the range meets a minimum density criterion;
determining a least number of bits required to represent each trained value within the one or more dense ranges;
identifying, based at least on the determined least number of bits required to represent each trained value within the one or more dense ranges, a second format having a range that is smaller than a range of the first format; and
generating a compressed version of the at least a portion of the machine learning model by:
(i) converting the trained values of the set of parameters within the one or more dense ranges from the first format to compressed values represented by the second format, and
(ii) assigning predetermined values to each of the parameters in the compressed version of the at least a portion of the machine learning model whose trained values were not within the one or more dense ranges.

### Claim 13 (depends on 12)

The system of claim 12, wherein the first format is a floating-point format.

### Claim 14 (depends on 12)

The system of claim 12, wherein determining the least number of bits required to uniquely represent each value within the one or more dense ranges comprises:
determining a number of exponent bits required for uniquely representing represent each value within the one or more dense ranges.

### Claim 15 (depends on 12)

The system of claim 12, determining the least number of bits required to uniquely represent each value within the one or more dense ranges comprises:
determining a number of mantissa bits required for representing represent each value within the one or more dense ranges.

### Claim 16 (depends on 12)

The system of claim 12, wherein identifying the second format having the second level of precision comprises:
selecting, from among multiple candidate formats that correspond respectively to different numbers of bits, a candidate format that corresponds to the determined least number of bits as the second format.

### Claim 17 (depends on 12)

The system of claim 12, wherein converting the trained values of the set of parameters comprises:
generating a mapping from the trained values that each have the first format to the compressed values that each have the second format; and
converting the trained values in accordance with the mapping.

### Claim 18 (depends on 17)

The system of claim 17, wherein generating the mapping comprises generating a scale factor for each dense range.

### Claim 19 (depends on 12)

The system of claim 12, wherein the minimum density criterion requires that at least a particular percentage of the set of parameters are within the one or more dense ranges.

### Claim 20 (depends on 12)

The system of claim 12, wherein the neural network is a Transformer neural network, and wherein the first layer is one of an embedding layer, an attention layer, or a feed-forward layer of the Transformer neural network.
