IP Library › Granted Patent US 12,411,897
Granted Patent B2
US 12,411,897 · App. 17/360,581 · Granted Sep 9, 2025

Recommendation model training method and related apparatus

Inventors: Hong Zhu (Shenzhen, CN); Zhenhua Dong (Shenzhen, CN); Ruiming Tang (Shenzhen, CN); Yuzhou Zhang (Shenzhen, CN); Li Qian (Shenzhen, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06F16/9535G06N5/04G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,411,897
App. No.
17/360,581
Filed
Jun 28, 2021
Granted
Sep 9, 2025
Kind
B2
Art Unit
2129
USPC
706/12
Abstract

A recommendation model training method includes selecting a positive sample in a sample set, and adding the positive sample to a training set, where the sample set includes the positive sample and negative samples, each sample includes n sample features, n≥1, and the sample features of each sample include a feature used to represent whether the sample is a positive sample or a negative sample, calculating sampling probabilities of the negative samples in the sample set by using a preset algorithm, selecting a negative sample from the sample set based on the sampling probability, and adding the negative sample to the training set, and performing training by using the samples in the training set, to obtain a recommendation model.

Claims (284)

1. A method comprising:

selecting a positive sample in a sample set, wherein the sample set comprises the positive sample and negative samples, wherein each of the positive sample and the negative samples comprises n sample features, wherein n>1, and wherein a first feature of each of the n sample features indicates whether a corresponding sample is the positive sample or one of the negative samples;

adding the positive sample to a training set;

calculating sampling probabilities of the negative samples using a preset algorithm based on a first rule, a second rule, or a third rule, wherein the first rule indicates that a sampling probability is negatively correlated with a score difference, wherein the score difference is between a first estimated score of the positive sample and a second estimated score of a current negative sample, wherein the first estimated score represents a positive tendency of the positive sample, and wherein the second estimated score represents a negative tendency of the negative sample, wherein the second rule indicates that the sampling probability is negatively correlated with a vector distance, wherein the vector distance is between a first eigenvector of the positive sample and a second eigenvector of the negative sample, and wherein the first eigenvector is an n-dimensional vector comprising the n sample features of the positive sample, wherein the third rule indicates that the sampling probability is positively correlated with a variation of an indicator, wherein the variation is based on exchanging a first ranking of the positive sample and a second ranking of the negative sample, wherein the first ranking and the second ranking are based on the first estimated score and the second estimated score, and wherein the indicator is a ranking indicator of the positive sample and the negative sample;

selecting a negative sample from the negative samples based on the sampling probabilities by:

dividing the sampling probabilities by a reference value to obtain corrected sampling probabilities of the negative samples, wherein the reference value is a maximum value in the sampling probabilities; and

successively comparing the corrected sampling probabilities with a random number ranging from 0 to 1;

adding the negative sample comprising a corrected sampling probability greater than the random number to the training set;

performing training using the training set to obtain a first recommendation model;

obtaining a recommendation result using the first recommendation model; and

providing, using an input/output (I/O) interface, the recommendation result to a client device for presenting the recommendation result to a user.

2. The method of claim 1 , wherein each of the n sample features comprises an object feature and a user feature, and wherein the method further comprises:

inputting a feature of a target user and features of a plurality of to-be-recommended objects to the first recommendation model during recommendation; and

obtaining, from the first recommendation model, one or more to-be-recommended objects in the to-be-recommended objects that are recommended to the target user.

3. The method of claim 1 , further comprising generating, using the first recommendation model, a third estimated score of a sample that is needed for training a second recommendation model.

4. The method of claim 1 , wherein the n sample features describe objects presented in a second recommendation result at a same time.

5. The method of claim 1 , further comprising:

selecting all remaining positive samples in the sample set; and

adding the remaining positive samples to the training set.

6. The method of claim 1 , wherein the preset algorithm is:

p

j

∝

∑

i

⁢

❘

"\[LeftBracketingBar]"

Δ

⁢

z

ij

❘

"\[RightBracketingBar]"

1

+

exp

⁡

(

s

i

-

s

j

)

⁢

x

i

-

x

j

;

p

j

∝

∑

i

⁢

❘

"\[LeftBracketingBar]"

Δ

⁢

z

ij

❘

"\[RightBracketingBar]"

1

+

exp

⁡

(

s

i

-

s

j

)

;

p

j

∝

∑

i

⁢

x

i

-

x

j

1

+

exp

⁡

(

s

i

-

s

j

)

;

or

p

j

∝

∑

i

⁢

❘

"\[LeftBracketingBar]"

Δ

⁢

z

ij

❘

"\[RightBracketingBar]"

*

(

s

j

-

s

i

)

,

wherein p j is a sampling probability of a j th negative sample in a first sample set, wherein s i is an estimated score of an i th positive sample in the first sample set, wherein s j is an estimated score of the j th negative sample, wherein x i is an eigenvector of the i th positive sample, wherein x j is an eigenvector of the j th negative sample, wherein |Δz ij | is a variation, of an indicator, generated after rankings of the i th positive sample and the j th negative sample are exchanged, wherein the first sample set is one of a plurality of sample sets, and wherein both i and j are positive integers.

7. The method of claim 1 , further comprising storing the recommendation result in a data storage system.

8. A recommendation model training apparatus comprising:

a memory configured to store instructions; and

a processor coupled to the memory, wherein the instructions cause the processor to be configured to:

select a positive sample in a sample set, wherein the sample set comprises the positive sample and negative samples, wherein each of the positive sample and the negative samples comprises n sample features, wherein n>1, and wherein a first feature of each of the n sample features indicates whether a corresponding sample is the positive sample or one of the negative samples;

add the positive sample to a training set;

calculate sampling probabilities of the negative samples using a preset algorithm based on a first rule, a second rule, or a third rule, wherein the first rule indicates that a sampling probability is negatively correlated with a score difference, wherein the score difference is between a first estimated score of the positive sample and a second estimated score of a current negative sample, wherein the first estimated score represents a positive tendency of the positive sample, and wherein the second estimated score represents a negative tendency of the negative sample, wherein the second rule indicates that the sampling probability is negatively correlated with a vector distance, wherein the vector distance is between a first eigenvector of the positive sample and a second eigenvector of the negative sample, and wherein the first eigenvector is an n-dimensional vector comprising the n sample features of the positive sample, wherein the third rule indicates that the sampling probability is positively correlated with a variation of an indicator, wherein the variation is based on exchanging a first ranking of the positive sample and a second ranking of the negative sample, wherein the first ranking and the second ranking are based on the first estimated score and the second estimated score, and wherein the indicator is a ranking indicator of the positive sample and the negative sample;

select a negative sample from the negative samples based on the sampling probabilities by:

dividing the sampling probabilities by a reference value to obtain corrected sampling probabilities of the negative samples, wherein the reference value is a maximum value in the sampling probabilities; and

successively comparing the corrected sampling probabilities with a random number ranging from 0 to 1;

add the negative sample comprising a corrected sampling probability greater than the random number to the training set;

perform training using the training set to obtain a first recommendation model;

obtain a recommendation result using the first recommendation model; and

provide, using an input/output (I/O) interface, the recommendation result to a client device for presenting the recommendation result to a user.

9. The recommendation model training apparatus of claim 8 , wherein each of the n sample features further comprises an object feature and a user feature, and wherein the instructions further cause the processor to be configured to:

input, to the first recommendation model during recommendation, a feature of a target user and features of a plurality of to-be-recommended objects; and

obtain, from the first recommendation model, one or more to-be-recommended objects in the to-be-recommended objects that are recommended to the target user.

10. The recommendation model training apparatus of claim 8 , wherein the instructions further cause the processor to be configured to generate, using the first recommendation model, a third estimated score of a sample that is needed for training a second recommendation model.

11. The recommendation model training apparatus of claim 8 , wherein the n sample features describe objects presented in a second recommendation result at a same time.

12. The recommendation model training apparatus of claim 8 , wherein the instructions further cause the processor to be configured to:

select all remaining positive samples in the sample set; and

add the remaining positive samples to the training set.

13. The recommendation model training apparatus according to claim 8 , wherein the preset algorithm is:

p

j

∝

∑

i

⁢

❘

"\[LeftBracketingBar]"

Δ

⁢

z

ij

❘

"\[RightBracketingBar]"

1

+

exp

⁡

(

s

i

-

s

j

)

⁢

x

i

-

x

j

;

p

j

∝

∑

i

⁢

❘

"\[LeftBracketingBar]"

Δ

⁢

z

ij

❘

"\[RightBracketingBar]"

1

+

exp

⁡

(

s

i

-

s

j

)

;

p

j

∝

∑

i

⁢

x

i

-

x

j

1

+

exp

⁡

(

s

i

-

s

j

)

;

or

p

j

∝

∑

i

⁢

❘

"\[LeftBracketingBar]"

Δ

⁢

z

ij

❘

"\[RightBracketingBar]"

*

(

s

j

-

s

i

)

,

wherein p j is a sampling probability of a j th negative sample in a first sample set, wherein s i is an estimated score of an i th positive sample in the first sample set, wherein s j is an estimated score of the j th negative sample, wherein x i is an eigenvector of the i th positive sample, wherein x j is an eigenvector of the j th negative sample, wherein |Δz ij | is a variation, of an indicator, generated after rankings of the i th positive sample and the j th negative sample are exchanged, wherein the first sample set is one of a plurality of sample sets, and wherein both i and j are positive integers.

14. A computer program product comprising computer-executable instructions stored on a non-transitory computer-readable storage medium that, when executed by a processor, cause an apparatus to:

select a positive sample in a sample set, wherein the sample set comprises the positive sample and negative samples, wherein each of the positive sample and the negative samples comprises n sample features, wherein n>1, and wherein a first feature of each of the n sample features indicates whether a corresponding sample is the positive sample or one of the negative samples;

add the positive sample to a training set;

calculate sampling probabilities of the negative samples using a preset algorithm, wherein the preset algorithm is based on one or more of a first rule, a second rule, or a third rule, wherein the first rule indicates that a sampling probability is negatively correlated with a score difference, wherein the score difference is between a first estimated score of the positive sample and a second estimated score of a current negative sample, wherein the first estimated score represents a positive tendency of the positive sample, wherein the second estimated score represents a negative tendency of the negative sample wherein the second rule indicates that the sampling probability is negatively correlated with a vector distance, wherein the vector distance is between a first eigenvector of the positive sample and a second eigenvector of the negative sample, wherein the first eigenvector is an n-dimensional vector comprising the n sample features of the positive sample, wherein the third rule indicates that the sampling probability is positively correlated with a variation of an indicator, wherein the variation is based on exchanging a first ranking of the positive sample and a second ranking of the negative sample, wherein the first ranking and the second ranking are based on the first estimated score and the second estimated score, and wherein the indicator is a ranking indicator of the positive sample and the negative sample;

select a negative sample from the negative samples based on the sampling probabilities by:

dividing the sampling probabilities by a reference value to obtain corrected sampling probabilities of the negative samples, wherein the reference value is a maximum value in the sampling probabilities; and

successively comparing the corrected sampling probabilities with a random number ranging from 0 to 1;

add the negative sample comprising a corrected sampling probability greater than the random number to the training set;

perform training using the training set to obtain a first recommendation model;

obtain a recommendation result using the first recommendation model; and

provide, using an input/output (I/O) interface, the recommendation result to a client device for presenting the recommendation result to a user.

15. The recommendation model training apparatus of claim 8 , wherein the instructions further cause the processor to be configured to store the recommendation result in a data storage system.

16. The computer program product of claim 14 , wherein each of the n sample features further comprises an object feature and a user feature, and wherein the computer-executable instructions further cause the apparatus to:

input, to the first recommendation model during recommendation, a feature of a target user and features of a plurality of to-be-recommended objects; and

obtain, using the first recommendation model, one or more to-be-recommended objects in the to-be-recommended objects that are recommended to the target user.

17. The computer program product of claim 14 , wherein the computer-executable instructions further cause the apparatus to generate, using the first recommendation model, a third estimated score of a sample that is needed for training a second recommendation model.

18. The computer program product of claim 14 , wherein the n sample features describe objects presented in a second recommendation result at a same time.

19. The computer program product of claim 14 , wherein the computer-executable instructions further cause the apparatus to:

select all remaining positive samples in the sample set; and

add the remaining positive samples to the training set.

20. The computer program product of claim 14 , wherein the computer-executable instructions further cause the apparatus to store the recommendation result in a data storage system.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 11, 2025
From: ZHU, HONG; DONG, ZHENHUA; TANG, RUIMING; QIAN, LI
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 071384/0412 →
EMPLOYMENT AGREEMENT Recorded Jun 11, 2025
From: ZHANG, YUZHOU
To: BEIJING HUAWEI DIGITAL TECHNOLOGIES CO., LTD.
Reel/Frame 071557/0691 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 11, 2025
From: BEIJING HUAWEI DIGITAL TECHNOLOGIES CO., LTD.
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 072306/0479 →
Priority Claims (1)
CN 201811653380.3 · Dec 29, 2018 · national
Continuity (2)
Continuation PCTCN2019128475 · Dec 25, 2019
Related Publication 20210326729A1 · Oct 21, 2021
References Cited (12)
US 20110106817A1 · Pan · 2011 [cited by examiner]
US 20160196534A1 · Jarrett et al. · 2016 [cited by applicant]
CN 107133262A · 2017 [cited by applicant]
CN 107491444A · 2017 [cited by applicant]
CN 107578332A · 2018 [cited by applicant]
CN 107729488A · 2018 [cited by applicant]
CN 108268900A · 2018 [cited by applicant]
CN 109902708A · 2019 [cited by applicant]
Zhang, Weinan, et al. “Optimizing top-n collaborative filtering via dynamic negative item sampling.” Proceedings of the 36th international ACM SIGIR conference on Research and development in information retrieval. 2013.… [cited by examiner]
Zhang, W., et al, “Optimizing Top-N Collaborative Filtering via Dynamic Negative Item Samplin,” SIGIR 13, Jul. 28 Aug. 1, 2013, 4 pages. [cited by applicant]
Juan, Y., et al, “Field-aware Factorization Machines for CTR Prediction,” RecSys 16, Sep. 15-19, 2016, 8 pages. [cited by applicant]
Ricci, F., et al., “Recommender Systems Handbook,” In: “Recommender Systems Handbook,” Oct. 28, 2010, Springer, XP055260525, 278 pages. [cited by applicant]