# US 2025/0378331 A1 · Data processing method and apparatus, electronic device, and computer-readable storage medium

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

- Number: US 2025/0378331 A1
- Document ID: US20250378331A1
- Status: Published application
- Kind: A1
- Application number: 19/309,132
- Filed: 2025-08-25
- Published: 2025-12-11
- Earliest claimed: 2023-06-19
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Jing GONG
- Web page: https://patentgrep.com/patent/US20250378331A1

## CPC

- G06N 3/08: Learning methods
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/0475: Generative networks
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A data processing method includes: obtaining an initial generative model, and determining a target operator to be quantized from the initial generative model; determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator; performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained; and training the generative model by using a training input object to obtain a trained generative model.

## Claims

### Claim 1

A data processing method, applied to an electronic device, the method comprising:
obtaining an initial generative model, and determining a target operator to be quantized from the initial generative model;
determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator;
performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained; and
training the generative model by using a training input object to obtain a trained generative model.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator comprises:
determining, in response to the quantity of the target operator being one, that the preset quantization policy is to perform operator replacement processing on the target operator; and
the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
obtaining an operator combination of an input quantity direction of the target operator, and determining a quantized operator; and
replacing the operator combination by using the quantized operator, to obtain the generative model to be trained.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator comprises:
determining, in response to the quantity of the target operators being at least two and the target operators comprising a convolution operator or in response to the quantity of the target operator being one and the category of the target operator being a convolution operator, that the preset quantization policy is to insert a quantized operator combination into a target location, wherein the quantized operator combination is applied in the quantization processing, and the quantized operator combination comprises a quantized operator and a dequantized operator.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
in response to the quantity of the target operator being one and the category of the target operator being the convolution operator, inserting the quantized operator combination into a location between an input quantity and the convolution operator; and
adding, to the initial generative model, a quantized operator combination configured to quantize a weight of the convolution operator, and obtaining the generative model to be trained in response to an output location of the convolution operator being connected to a batch normalization operator.

### Claim 5 (depends on 4)

The method according to claim 4, further comprising:
inserting the quantized operator into the output location of the convolution operator to obtain the generative model to be trained, in response to the output location of the convolution operator not being connected to the batch normalization operator.

### Claim 6 (depends on 3)

The method according to claim 3, wherein the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
in response to the quantity of the target operators being at least two and the target operators comprising the convolution operator, inserting the quantized operator combination into a location between an input quantity and the convolution operator;
adding, to the initial generative model, a quantized operator combination configured to quantize a weight of the convolution operator; and
obtaining the generative model to be trained, in response to the target operators comprising a batch normalization operator and an activation function that are sequentially connected to an output location of the convolution operator.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
in response to: the quantity of the target operators being at least two, the target operators comprising the convolution operator, the target operators comprising the batch normalization operator that is sequentially connected to the output location of the convolution operator, and the batch normalization operator being further connected to a first input branch of the addition operator, skipping quantization on an output of the convolution operator, inserting the quantized operator combination into a second input branch of the addition operator, and inserting the quantized operator into an output location of the addition operator.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the training the generative model by using a training input object to obtain a trained generative model comprises:
performing sampling processing on the training input object through the generative model to be trained, to obtain a random vector;
performing generation processing on the random vector through the generative model to be trained, to obtain a target object;
determining a loss value based on the target object and the training input object; and
determining, in response to the loss value satisfying a goal requirement, that training of the generative model is completed, to obtain the trained generative model.

### Claim 9 (depends on 1)

The method according to claim 1, wherein the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
performing the quantization processing on the target operator by using the preset quantization policy to obtain the generative model to be trained, in response to a model structure to which the target operator belongs being not comprised in a target structure list; and
the method further comprises:
maintaining the target operator unchanged, in response to the model structure to which the target operator belongs being comprised in the target structure list.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the quantized operator combination comprises a quantized operator and a dequantized operator; and
the method further comprises:
obtaining a target generative model based on the trained generative model obtained after deleting the dequantized operator.

### Claim 11

A data processing apparatus, comprising:
a processor and a memory, the memory storing a plurality of instructions, and the processor loading the instructions from the memory, to execute operations comprising:
obtaining an initial generative model, and determining a target operator to be quantized from the initial generative model;
determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator;
performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained; and
training the generative model by using a training input object to obtain a trained generative model.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein the determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator comprises:
determining, in response to the quantity of the target operator being one, that the preset quantization policy is to perform operator replacement processing on the target operator; and
the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
obtaining an operator combination of an input quantity direction of the target operator, and determining a quantized operator; and
replacing the operator combination by using the quantized operator, to obtain the generative model to be trained.

### Claim 13 (depends on 11)

The apparatus according to claim 11, wherein the determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator comprises:
determining, in response to the quantity of the target operators being at least two and the target operators comprising a convolution operator or in response to the quantity of the target operator being one and the category of the target operator being a convolution operator, that the preset quantization policy is to insert a quantized operator combination into a target location, wherein the quantized operator combination is applied in the quantization processing, and the quantized operator combination comprises a quantized operator and a dequantized operator.

### Claim 14 (depends on 13)

The apparatus according to claim 13, wherein the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
in response to the quantity of the target operator being one and the category of the target operator being the convolution operator, inserting the quantized operator combination into a location between an input quantity and the convolution operator; and
adding, to the initial generative model, a quantized operator combination configured to quantize a weight of the convolution operator, and obtaining the generative model to be trained in response to an output location of the convolution operator being connected to a batch normalization operator.

### Claim 15 (depends on 14)

The apparatus according to claim 14, wherein the processor is further configured to perform:
inserting the quantized operator into the output location of the convolution operator to obtain the generative model to be trained, in response to the output location of the convolution operator not being connected to the batch normalization operator.

### Claim 16 (depends on 13)

The apparatus according to claim 13, wherein the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
in response to the quantity of the target operators being at least two and the target operators comprising the convolution operator, inserting the quantized operator combination into a location between an input quantity and the convolution operator;
adding, to the initial generative model, a quantized operator combination configured to quantize a weight of the convolution operator; and
obtaining the generative model to be trained, in response to the target operators comprising a batch normalization operator and an activation function that are sequentially connected to an output location of the convolution operator.

### Claim 17 (depends on 16)

The apparatus according to claim 16, wherein the processor is further configured to perform:
in response to: the quantity of the target operators being at least two, the target operators comprising the convolution operator, the target operators comprising the batch normalization operator that is sequentially connected to the output location of the convolution operator, and the batch normalization operator being further connected to a first input branch of the addition operator, skipping quantization on an output of the convolution operator, inserting the quantized operator combination into a second input branch of the addition operator, and inserting the quantized operator into an output location of the addition operator.

### Claim 18 (depends on 11)

The apparatus according to claim 11, wherein the training the generative model by using a training input object to obtain a trained generative model comprises:
performing sampling processing on the training input object through the generative model to be trained, to obtain a random vector;
performing generation processing on the random vector through the generative model to be trained, to obtain a target object;
determining a loss value based on the target object and the training input object; and
determining, in response to the loss value satisfying a goal requirement, that training of the generative model is completed, to obtain the trained generative model.

### Claim 19 (depends on 11)

The apparatus according to claim 11, wherein the performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained comprises:
performing the quantization processing on the target operator by using the preset quantization policy to obtain the generative model to be trained, in response to a model structure to which the target operator belongs being not comprised in a target structure list; and
the processor is further configured to perform:
maintaining the target operator unchanged, in response to the model structure to which the target operator belongs being comprised in the target structure list.

### Claim 20

A non-transitory computer-readable storage medium, having a plurality of instructions stored therein, the instructions being loaded by a processor to execute operations comprising:
obtaining an initial generative model, and determining a target operator to be quantized from the initial generative model;
determining, based on a category and a quantity of the target operator, a preset quantization policy for performing quantization processing on the target operator;
performing the quantization processing on the target operator by using the preset quantization policy to obtain a generative model to be trained; and
training the generative model by using a training input object to obtain a trained generative model.
