# US 2025/0156765 A1 · Model training method and related apparatus

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

- Number: US 2025/0156765 A1
- Document ID: US20250156765A1
- Status: Published application
- Kind: A1
- Application number: 19/019,926
- Filed: 2025-01-14
- Published: 2025-05-15
- Earliest claimed: 2022-07-15
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Quanyu DAI; Peng WU; Haoxuan LI; Zhenhua DONG; Ruiming TANG
- Web page: https://patentgrep.com/patent/US20250156765A1

## CPC

- G06N 20/00: Machine learning
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Embodiments of this application disclose a model training method and a related apparatus, to improve a generalization capability of a prediction model. The method in embodiments of this application includes: calculating a loss function of an error imputation model based on a first error of a prediction result of a prediction model for first sample data, a first output of the error imputation model, and a probability that the first sample data is observed; and then updating a parameter of the error imputation model based on the loss function of the error imputation model, where the first output of the error imputation model represents a predicted value of the first error, the loss function of the error imputation model includes a bias term and a variance term.

## Claims

### Claim 1

A model training method, comprising:
calculating a loss function of an error imputation model based on a first error of a prediction result of a prediction model for first sample data, a first output of the error imputation model, and a probability that the first sample data is observed, wherein the first output of the error imputation model represents a predicted value of the first error, the loss function of the error imputation model comprises a bias term and a variance term, the bias term represents a bias between an actual loss function and a theoretical loss function of the prediction model, and the variance term represents a variance between the actual loss function and the theoretical loss function of the prediction model; and
updating a parameter of the error imputation model based on the loss function of the error imputation model.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the bias term is obtained based on the first error, the first output of the error imputation model, and the probability that the first sample data is observed; and/or
the variance term is obtained based on the first error, the first output of the error imputation model, and the probability that the first sample data is observed.

### Claim 3 (depends on 1)

The method according to claim 1, wherein
the loss function of the error imputation model is obtained by performing weighted summation on the bias term and the variance term based on a weight of the bias term and a weight of the variance term.

### Claim 4 (depends on 3)

The method according to claim 3, wherein at least one of the weight of the bias term or the weight of the variance term is obtained based on the first sample data.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the bias term is
∑
(
u
,
i
)
∈
D
o
u
,
i
(
e
^
u
,
i
-
e
u
,
i
)
2
p
ˆ
u
,
i
×
(
o
u
,
i
-
p
ˆ
u
,
i
)
2
p
ˆ
u
,
i
2
,
wherein D represents entire sample space, (u, i) represents the first sample data, u represents a user, i represents a target object, ou,i represents whether the first sample data is observed, êu,i represents the first output of the error imputation model, eu,i represents the first error, and {circumflex over (p)}u,i represents the probability that the first sample data is observed; and
when a value of ou,i is 1, ou,i represents that the first sample data is observed; or when a value of ou,i is 0, ou,i represents that the first sample data is not observed.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the variance term is
∑
(
u
,
i
)
∈
D
o
u
,
i
(
e
^
u
,
i
-
e
u
,
i
)
2
p
ˆ
u
,
i
×
(
1
-
p
ˆ
u
,
i
)
p
ˆ
u
,
i
,
wherein D represents entire sample space, (u, i) represents the first sample data, u represents a user, i represents a target object, ou,i represents whether the first sample data is observed, êu,i represents the first output of the error imputation model, eu,i represents the first error, and {circumflex over (p)}u,i represents the probability that the first sample data is observed; and
when a value of ou,i is 1, ou,i represents that the first sample data is observed; or when a value of ou,i is 0, ou,i represents that the first sample data is not observed.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the probability that the first sample data is observed is output by a target probability model based on an input of the first sample data.

### Claim 8 (depends on 1)

The method according to claim 1, wherein after the updating a parameter of the error imputation model based on the loss function of the error imputation model, the method further comprises:
calculating a loss function of the prediction model based on a second error of a prediction result of the prediction model for second sample data, a second output of the error imputation model, a probability that the second sample data is observed, and indication information of the second sample data, wherein the second output of the error imputation model represents a predicted value of the second error, and the indication information indicates whether the second sample data is observed; and
updating a parameter of the prediction model based on the loss function of the prediction model.

### Claim 9

A computer device, wherein the computer device comprises a memory and a processor, wherein
the processor is configured to execute a computer program or instructions stored in the memory, to enable the computer device to perform operations comprising:
calculating a loss function of an error imputation model based on a first error of a prediction result of a prediction model for first sample data, a first output of the error imputation model, and a probability that the first sample data is observed, wherein the first output of the error imputation model represents a predicted value of the first error, the loss function of the error imputation model comprises a bias term and a variance term, the bias term represents a bias between an actual loss function and a theoretical loss function of the prediction model, and the variance term represents a variance between the actual loss function and the theoretical loss function of the prediction model; and
updating a parameter of the error imputation model based on the loss function of the error imputation model.

### Claim 10 (depends on 9)

The computer device according to claim 9, the computer device is further configured to obtain the bias term based on the first error, the first output of the error imputation model, and the probability that the first sample data is observed; and/or
obtain the variance term based on the first error, the first output of the error imputation model, and the probability that the first sample data is observed.

### Claim 11 (depends on 9)

The computer device according to claim 9, wherein the loss function of the error imputation model is obtained by performing weighted summation on the bias term and the variance term based on a weight of the bias term and a weight of the variance term.

### Claim 12 (depends on 11)

The computer device according to claim 11, wherein at least one of the weight of the bias term or the weight of the variance term is obtained based on the first sample data.

### Claim 13 (depends on 9)

The computer device according to claim 9, wherein the bias term is
∑
(
u
,
i
)
∈
D
o
u
,
i
(
e
^
u
,
i
-
e
u
,
i
)
2
p
ˆ
u
,
i
×
(
o
u
,
i
-
p
ˆ
u
,
i
)
2
p
ˆ
u
,
i
2
,
wherein D represents entire sample space, (u, i) represents the first sample data, u represents a user, i represents a target object, ou,i represents whether the first sample data is observed, êu,i represents the first output of the error imputation model, eu,i represents the first error, and {circumflex over (p)}u,i represents the probability that the first sample data is observed; and
when a value of ou,i is 1, ou,i represents that the first sample data is observed; or when a value of ou,i is 0, ou,i represents that the first sample data is not observed.

### Claim 14 (depends on 9)

The computer device according to claim 9, wherein the variance term is
∑
(
u
,
i
)
∈
D
o
u
,
i
(
e
^
u
,
i
-
e
u
,
i
)
2
p
ˆ
u
,
i
×
(
1
-
p
ˆ
u
,
i
)
p
ˆ
u
,
i
,
wherein D represents entire sample space, (u, i) represents the first sample data, u represents a user, i represents a target object, ou,i represents whether the first sample data is observed, êu,i represents the first output of the error imputation model, eu,i represents the first error, and {circumflex over (p)}u,i represents the probability that the first sample data is observed; and
when a value of ou,i is 1, ou,i represents that the first sample data is observed; or when a value of ou,i is 0, ou,i represents that the first sample data is not observed.

### Claim 15 (depends on 9)

The computer device according to claim 9, wherein the probability that the first sample data is observed is output by a target probability model based on an input of the first sample data.

### Claim 16 (depends on 9)

The computer device according to claim 9, wherein the computer device is further configured to perform operations comprising:
calculating a loss function of the prediction model based on a second error of a prediction result of the prediction model for second sample data, a second output of the error imputation model, a probability that the second sample data is observed, and indication information of the second sample data, wherein the second output of the error imputation model represents a predicted value of the second error, and the indication information indicates whether the second sample data is observed; and
updating a parameter of the prediction model based on the loss function of the prediction model.

### Claim 17

A non-transitory computer-readable storage medium, wherein the computer-readable storage medium has program instructions, and when the program instructions are directly or indirectly executed by one or more processors, the one or more processors is to perform operations comprising:
calculating a loss function of an error imputation model based on a first error of a prediction result of a prediction model for first sample data, a first output of the error imputation model, and a probability that the first sample data is observed, wherein the first output of the error imputation model represents a predicted value of the first error, the loss function of the error imputation model comprises a bias term and a variance term, the bias term represents a bias between an actual loss function and a theoretical loss function of the prediction model, and the variance term represents a variance between the actual loss function and the theoretical loss function of the prediction model; and
updating a parameter of the error imputation model based on the loss function of the error imputation model.
