# US 2026/0087373 A1 · Method, apparatus, device, and medium for processing data of machine learning model

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

- Number: US 2026/0087373 A1
- Document ID: US20260087373A1
- Status: Published application
- Kind: A1
- Application number: 19/297,297
- Filed: 2025-08-12
- Published: 2026-03-26
- Earliest claimed: 2024-09-24
- Applicants: Beijing Zitiao Network Technology Co., Ltd.
- Inventors: Songwei Liu; Fangmin Chen
- Web page: https://patentgrep.com/patent/US20260087373A1

## CPC

- G06N 3/10: Interfaces, programming languages or software development kits, e.g. for simulating neural networks
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/063: using electronic means
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method, a device, and a medium for processing data of a machine learning model are provided. A set of data samples associated with a machine learning model is received. The machine learning model includes a plurality of network blocks, the data of the machine learning model includes first data and second data of a network block of the plurality of network blocks. A data sample of the set of data samples is input to the machine learning model to determine a first full-precision representation of the first data and a second full-precision representation of the second data of the network block respectively. A loss function is determined based on the first full-precision representation, the second full-precision representation, a first compressor having a first compression parameter, and a second compressor having a second compression parameter. Based on the loss function, the first and second compression parameters are updated.

## Claims

### Claim 1

A method for processing data of a machine learning model, comprising:
receiving a set of data samples associated with the machine learning model, the machine learning model comprising a plurality of network blocks, the data of the machine learning model comprising first data and second data of a network block of the plurality of network blocks, the first data comprising weight data of the network block, and the second data comprising activation data of the network block;
inputting a data sample of the set of data samples to the machine learning model to determine a first full-precision representation of the first data and a second full-precision representation of the second data of the network block, respectively;
determining a loss function based on the first full-precision representation, the second full-precision representation, a first compressor, and a second compressor, the first compressor having a first compression parameter and configured to compress the first full-precision representation, and the second compressor having a second compression parameter and configured to compress the second full-precision representation; and
updating the first compression parameter and the second compression parameter based on the loss function.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first compressor is determined based on the first compression parameter, a scaling factor, and a first width for indicating a first compressed representation of the first data, and the second compressor is determined based on the second compression parameter, the scaling factor, and a second width for indicating a second compressed representation of the second data.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining the loss function comprises:
determining the first compressed representation based on the first compressor and the first compression parameter, the first compression parameter representing a first clipping range of the first compressor;
determining the second compressed representation based on the second compressor and the second compression parameter, the second compression parameter representing a second clipping range of the second compressor; and
obtaining the loss function based on the first full-precision representation, the second full-precision representation, the first compressed representation, and the second compressed representation.

### Claim 4 (depends on 3)

The method of claim 3, wherein obtaining the loss function comprises:
determining a full-precision output of the network block based on the first full-precision representation and the second full-precision representation;
determining a compressed output of the network block based on the first compressed representation and the second compressed representation; and
obtaining the loss function based on a difference between the full-precision output and the compressed output.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
determining a similarity between a distribution of input data of the network block and a distribution of output data of the network block;
determining, in response to determining that the similarity satisfies a predetermined condition, a compensation vector for compensating the output; and
updating the output data based on the compensation vector.

### Claim 6 (depends on 5)

The method of claim 5, wherein updating the output comprises: updating, in response to determining that the network block is a network block of the plurality of network blocks at a head position or a tail position, the output of the network block based on the compensation vector.

### Claim 7 (depends on 5)

The method of claim 5, wherein updating the output with the compensation vector comprises:
updating the weight data of the network block with the compensation vector; and
determining the updated output based on the updated weight data.

### Claim 8 (depends on 1)

The method of claim 1, wherein updating the first compression parameter and the second compression parameter further comprises:
determining, for the network block, an attention-aware divergence associated with the network block; and
updating the first compression parameter and the second compression parameter based on the attention-aware divergence.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
setting the network block with the first compression parameter and the second compression parameter; and
performing an inference process with the set network block.

### Claim 10 (depends on 9)

The method of claim 9, wherein performing the inference process comprises:
determining input data of the network block based on a data item to be processed, the input data having a second width, and the weight data of the network block having a first width;
dividing the input data into a plurality of input matrices;
determining, based on a hardware multiplication instruction of a hardware device implementing the network block, a plurality of multiplication results associated with the plurality of input matrices by using a plurality of thread wraps provided by the hardware device respectively; and
determining a result of the inference process based on the plurality of multiplication results.

### Claim 11 (depends on 10)

The method of claim 10, wherein determining the plurality of multiplication results respectively comprises: for an input matrix of the plurality of input matrices, executing the hardware multiplication instruction with a thread wrap of the plurality of thread wraps to determine a multiplication result associated with the input matrix; and
writing the multiplication result into a storage area of the hardware device corresponding to the thread wrap.

### Claim 12 (depends on 11)

The method of claim 11, wherein determining the result of the inference process based on the plurality of multiplication results comprises:
obtaining the plurality of multiplication results from a plurality of storage areas corresponding to the plurality of thread wraps respectively; and
determining the result of the inference process based on the plurality of multiplication results.

### Claim 13 (depends on 11)

The method of claim 11, wherein dividing the input data into the plurality of input matrices comprises:
dividing test input data into a first plurality of input matrices and a second plurality of input matrices, respectively, based on parallel configuration information of the hardware device;
determining a first performance indicator for performing the inference process based on the first plurality of input matrices, and a second performance indicator for performing the inference process based on the second plurality of input matrices, respectively; and
dividing, in response to determining that the first performance indicator is higher than the second performance indicator, the input data into the plurality of input matrices based on a quantity of the first plurality of input matrices.

### Claim 14 (depends on 11)

The method of claim 11, wherein the plurality of thread wraps share a plurality of banks in the storage area of the hardware device, and the method further comprises:
writing a first input matrix associated with a first thread wrap of the plurality of thread wraps into a first bank of the plurality of banks;
padding a bank following the first bank;
writing a second input matrix associated with a second thread wrap of the plurality of thread wraps into a second bank following the bank, no access conflict existing between the first bank and the second bank.

### Claim 15

An electronic device, comprising:
at least one processor; and
at least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions, when executed by the at least one processor, causing the electronic device to perform acts comprising:
receiving a set of data samples associated with the machine learning model, the machine learning model comprising a plurality of network blocks, the data of the machine learning model comprising first data and second data of a network block of the plurality of network blocks, the first data comprising weight data of the network block, and the second data comprising activation data of the network block;
inputting a data sample of the set of data samples to the machine learning model to determine a first full-precision representation of the first data and a second full-precision representation of the second data of the network block, respectively;
determining a loss function based on the first full-precision representation, the second full-precision representation, a first compressor, and a second compressor, the first compressor having a first compression parameter and configured to compress the first full-precision representation, and the second compressor having a second compression parameter and configured to compress the second full-precision representation; and
updating the first compression parameter and the second compression parameter based on the loss function.

### Claim 16 (depends on 15)

The electronic device of claim 15, wherein the first compressor is determined based on the first compression parameter, a scaling factor, and a first width for indicating a first compressed representation of the first data, and the second compressor is determined based on the second compression parameter, the scaling factor, and a second width for indicating a second compressed representation of the second data.

### Claim 17 (depends on 15)

The electronic device of claim 15, wherein the acts further comprise:
setting the network block with the first compression parameter and the second compression parameter; and
performing an inference process with the set network block.

### Claim 18 (depends on 17)

The electronic device of claim 17, wherein performing the inference process comprises:
determining input data of the network block based on a data item to be processed, the input data having a second width, and the weight data of the network block having a first width;
dividing the input data into a plurality of input matrices;
determining, based on a hardware multiplication instruction of a hardware device implementing the network block, a plurality of multiplication results associated with the plurality of input matrices by using a plurality of thread wraps provided by the hardware device respectively; and
determining a result of the inference process based on the plurality of multiplication results.

### Claim 19 (depends on 18)

The electronic device of claim 18, wherein determining the plurality of multiplication results respectively comprises: for an input matrix of the plurality of input matrices, executing the hardware multiplication instruction with a thread wrap of the plurality of thread wraps to determine a multiplication result associated with the input matrix; and
writing the multiplication result into a storage area of the hardware device corresponding to the thread wrap.

### Claim 20

A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, causes the processor to perform acts comprising:
receiving a set of data samples associated with the machine learning model, the machine learning model comprising a plurality of network blocks, the data of the machine learning model comprising first data and second data of a network block of the plurality of network blocks, the first data comprising weight data of the network block, and the second data comprising activation data of the network block;
inputting a data sample of the set of data samples to the machine learning model to determine a first full-precision representation of the first data and a second full-precision representation of the second data of the network block, respectively;
determining a loss function based on the first full-precision representation, the second full-precision representation, a first compressor, and a second compressor, the first compressor having a first compression parameter and configured to compress the first full-precision representation, and the second compressor having a second compression parameter and configured to compress the second full-precision representation; and
updating the first compression parameter and the second compression parameter based on the loss function.
