IP Library Granted Patent US 12688517
Granted Patent B2
US 12688517 · App. 17/213,066 · Granted Jul 21, 2026

Method and apparatus for training online prediction model, device and storage medium

Inventors: Haocheng Liu (Beijing, CN); Yuan Li (Beijing, CN); Guobin Xie (Beijing, CN)
Assignee: Beijing Baidu Netcom Science and Technology Co., Ltd.
G06Q30/0256G06F18/213G06F18/214G06N5/04G06N20/00G06Q30/0201H04L67/535
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 12688517
App. No.
17/213,066
Granted
Jul 21, 2026
Kind
B2
Abstract

A method and apparatus for training an online prediction model are provided. The method may include: acquiring an offline sample feature and an online sample feature of a user, the offline sample feature including a user portrait feature; offline training to obtain an offline recommendation model, based on the offline sample feature and the online sample feature of the user; acquiring a latest online feature of the user, and online training to obtain an online learning model based on the latest online feature of the user, the online learning model being used to adapt the latest online feature for use as an online sample feature to be input into the trained offline recommendation model; and synchronizing the offline recommendation model to online, and inputting the latest online feature output by the online learning model into the offline recommendation model to generate an online prediction model.

Claims (62)

1 . A method for training an online prediction model, the method comprising:

acquiring an offline sample feature and an online sample feature of a user, the offline sample feature comprising a user portrait feature, the acquiring the online sample feature comprising determining the online sample feature of the user based on a user online real-time behavior, wherein the user online real-time behavior comprises a user online operation behavior;

offline training a Wide&Deep model based on both the offline sample feature and the online sample feature of the user, to obtain an offline recommendation model, the offline training the Wide&Deep model comprising:

inputting the offline sample feature of the user into a Deep layer of the Wide&Deep model to generate a Deep layer feature, wherein the Deep layer is a deep neural network;

inputting the online sample feature after feature engineering into a Wide layer of the Wide&Deep model to generate a Wide layer feature, wherein the Wide layer is a wide linear model; and

splicing the Wide layer feature and the Deep layer feature to obtain a spliced feature and inputting the spliced feature into a logic regression for prediction training, to obtain a trained offline recommendation model;

acquiring a latest online feature of the user, and online training the Wide&Deep model based on the latest online feature of the user to obtain an online learning model by: adjusting a Wide layer parameter of the Wide&Deep model, so that the latest online feature is adapted for use as the online sample feature to be input into the Wide layer, the online learning model being used to adapt the latest online feature for use as an online sample feature to be input into the trained offline recommendation model;

converting the offline recommendation model to an online recommendation model, and inputting the latest online feature output by the online learning model into the online recommendation model to generate an online prediction model; and

determining a recommended ranking or a click-through rate estimation in a recommendation system, based on an output of the online prediction model.

2 . The method according to claim 1 , wherein the method further comprises:

synchronizing the latest online feature of the user to an offline feature library, wherein the offline feature library stores the offline sample feature of the user.

3 . The method according to claim 2 , further comprising:

using the synchronized latest online feature as the online sample feature to continue offline training the offline recommendation model.

4 . The method according to claim 3 , further comprising:

synchronizing the online sample feature of the user to the offline feature library, and using the synchronized online sample feature as the offline sample feature.

5 . The method according to claim 1 , wherein the online training to obtain an online learning model based on the latest online feature of the user, comprises:

adjusting the latest online feature using an online machine learning algorithm (FTRL), so that the latest online feature is adapted to be used as the online sample feature for feature encoding.

6 . The method according to claim 1 , wherein:

the user portrait feature comprises at least one of: user income, user surfing online times, user search times, user search keyword, user clicked website address, or user interest tag; and

the online sample feature comprises a keyword on the internet searched by the user.

7 . The method according to claim 1 , wherein the latest online feature of the user comprises:

current real-time operation behavior of the user, which comprises current search keyword of the user, current clicked website address of the user, and feedback on current advertising display of the user.

8 . The method according to claim 1 , further comprising:

calculating, by programmed circuitry, a loss between the click-through estimation rate and an actual click-through rate, or between the recommended ranking output based on the offline recommendation model and actual recommended ranking, based on the loss, and

using, by programmed circuitry, a gradient descent method to iteratively optimize a parameter of the offline recommendation model.

9 . The method according to claim 1 , wherein the method is used in a recommendation system deployed in a cloud computing environment, which provides as real-time output the click through rate estimation, or the recommended ranking for products, for the user in an online e-commerce scenario.

10 . An electronic device, comprising:

one or more processors; and

a storage apparatus storing one or more programs,

wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform operations, the one or more programs comprising instructions which instruct the one or more processors to perform the operations, and the instructions comprising:

an instruction to acquire an offline sample feature and an online sample feature of a user, the offline sample feature comprising a user portrait feature, and the instruction to acquire the online sample feature comprising an instruction to determine the online sample feature of the user based on a user online real-time behavior, wherein the user online real-time behavior comprises a user online operation behavior;

an instruction to offline train a Wide&Deep model based on both the offline sample feature and the online sample feature of the user, to obtain an offline recommendation model, wherein the instruction to offline train the Wide&Deep model comprises:

an instruction to input the offline sample feature of the user into a Deep layer of the Wide&Deep model to generate a Deep layer feature, wherein the Deep layer is a deep neural network;

an instruction to input the online sample feature after feature engineering into a Wide layer of the Wide&Deep model to generate a Wide layer feature, wherein the Wide layer is a wide linear model; and

an instruction to splice the Wide layer feature and the Deep layer feature to obtain a spliced feature and input the spliced feature into a logic regression for prediction training, to obtain a trained offline recommendation model;

an instruction to acquire a latest online feature of the user, and online train the Wide&Deep model based on the latest online feature of the user to obtain an online learning model by: adjusting a Wide layer parameter of the Wide&Deep model, so that the latest online feature is adapted for use as the online sample feature to be input into the Wide layer, the online learning model being used to adapt the latest online feature for use as an online sample feature to be input into the trained offline recommendation model,

an instruction to convert the offline recommendation model to an online recommendation model, and input the latest online feature output by the online learning model into the online recommendation model to generate an online prediction model;

and

an instruction to determine a recommended ranking or a click-through rate estimation in a recommendation system, based on an output of the online prediction model.

11 . The electronic device according to claim 10 , wherein the instructions further comprise:

an instruction to synchronize the latest online feature of the user to an offline feature library, wherein the offline feature library stores the offline sample feature of the user.

12 . The electronic device according to claim 11 , wherein the instructions further comprise:

an instruction to use the synchronized latest online feature as the online sample feature to continue offline training the offline recommendation model.

13 . The electronic device according to claim 12 , wherein the instructions further comprise:

an instruction to synchronize the online sample feature of the user to the offline feature library, and use the synchronized online sample feature as the offline sample feature.

14 . The electronic device according to claim 10 , wherein:

the user portrait feature comprises at least one of: user income, user surfing online times, user search times, user search keyword, user clicked website address, or user interest tag; and

the online sample feature comprises a keyword on the internet searched by the user.

15 . The electronic device according to claim 10 , wherein the latest online feature of the user comprises:

current real-time operation behavior of the user, which comprises current search keyword of the user, current clicked website address of the user, and feedback on current advertising display of the user.

16 . The method according to claim 10 , wherein the instruction to input the offline sample feature of the user into a Deep layer comprises:

an instruction to input the offline sample feature without performing feature engineering on the offline sample feature.

17 . The electronic device according to claim 10 , wherein the electronic device is used in a recommendation system deployed in a cloud computing environment, which provides as real-time output the click through rate estimation, or the recommended ranking for products, for the user in an online e-commerce scenario, wherein inputting the offline sample feature into the deep layer uses a horizontal splicing to obtain a multi thousand dimension feature.

18 . A non-transitory computer readable storage medium, storing a computer program thereon, wherein the program, when executed by a processor, cause the processor to perform operations, the one or more programs comprising instructions which instruct the one or more processors to perform the operations, and the instructions comprising:

an instruction to acquire an offline sample feature and an online sample feature of a user, the offline sample feature comprising a user portrait feature, the acquiring the online sample feature comprising determining the online sample feature of the user based on a user online real-time behavior, wherein the user online real-time behavior comprises a user online operation behavior;

an instruction to offline train a Wide&Deep model based on both the offline sample feature and the online sample feature of the user, to obtain an offline recommendation model, wherein the instruction to offline train the Wide&Deep model comprises:

an instruction to input the offline sample feature of the user into a Deep layer of the Wide&Deep model to generate a Deep layer feature, wherein the Deep layer is a deep neural network;

an instruction to input the online sample feature after feature engineering into a Wide layer of the Wide&Deep model to generate a Wide layer feature, wherein the Wide layer is a wide linear model; and

an instruction to splice the Wide layer feature and the Deep layer feature to obtain a spliced feature and input the spliced feature into a logic regression for prediction training, to obtain a trained offline recommendation model;

an instruction to acquire a latest online feature of the user, and online training the Wide&Deep model based on the latest online feature of the user to obtain an online learning model by: adjusting a Wide layer parameter of the Wide&Deep model, so that the latest online feature is adapted for use as the online sample feature to be input into the Wide layer, the online learning model being used to adapt the latest online feature for use as an online sample feature to be input into the trained offline recommendation model;

an instruction to convert the offline recommendation model to an online recommendation model, and inputting the latest online feature output by the online learning model into the online recommendation model to generate an online prediction model; and

an instruction to determine a recommended ranking or a click-through rate estimation in a recommendation system, based on an output of the online prediction model.