IP Library › Granted Patent US 12,124,950
Granted Patent B2
US 12,124,950 · App. 17/401,154 · Granted Oct 22, 2024

Method and apparatus for optimizing quantization model, electronic device, and computer storage medium

Inventors: Yi Yuan (Shenzhen, CN); Zhicheng Mao (Shenzhen, CN); Yongzhuang Wang (Shenzhen, CN); Yuhui Xu (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06N3/08G06N10/00G06V40/20
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,124,950
App. No.
17/401,154
Granted
Oct 22, 2024
Kind
B2
Abstract

An optimization method comprises determining jump ratios of embedding layer parameters of a trained quantization model in a predetermined time range. The quantization model comprises a neural network model obtained after quantization processing on the embedding layer parameters. The method also comprises determining a jump curve in the predetermined time range according to the jump ratios, and fitting the jump curve to obtain a corresponding time scaling parameter. The method also comprises optimizing an initial algorithm of the quantization model based on the time scaling parameter to obtain an optimized target optimization algorithm, and training the quantization model based on the target optimization algorithm.

Claims (75)

1. An optimization method applicable to an electronic device, the method comprising:

determining jump ratios of embedding layer parameters of a trained quantization model in a first predetermined time range, each jump ratio corresponding to a parameter jump of the embedding layer parameters of the trained quantization model in each predetermined time interval within the first predetermined time range, the quantization model being a neural network model obtained after quantization processing on the embedding layer parameters;

determining a jump curve in the first predetermined time range according to the jump ratios;

fitting the jump curve to obtain a corresponding time scaling parameter;

optimizing an initial algorithm of the quantization model based on the time scaling parameter to obtain an optimized target optimization algorithm;

training the quantization model based on the target optimization algorithm to obtain an optimized quantization model, wherein the time scaling parameter is configured to adjust a convergence speed and a precision of the quantization model;

acquiring user behavior data associated with a user at a terminal in a second predetermined time range;

learning the user behavior data using the optimized quantization model;

determining a user behavior feature corresponding to the user behavior data;

determining target recommendation information based on the user behavior feature; and;

providing the target recommendation information to the user at the terminal.

2. The method according to claim 1 , wherein the quantization processing comprises N-valued quantization processing on the embedding layer parameters, wherein N is an integer greater than one.

3. The method according to claim 1 , wherein:

a respective jump ratio of a parameter jump of the embedding layer parameters in any predetermined time interval is determined by:

determining a quantity of parameters that jump in the embedding layer parameters in the any predetermined time interval, relative to the embedding layer parameters in a previous predetermined time interval of the any predetermined time interval; and

determining the jump ratio of the parameter jump of the embedding layer parameters in the any predetermined time interval according to the quantity of parameters and a total quantity of embedding layer parameters.

4. The method according to claim 1 , wherein fitting the jump curve further comprises:

determining a curve type of the jump curve, and determining a fitting function corresponding to the curve type; and

fitting the jump curve according to the fitting function to obtain the corresponding time scaling parameter.

5. The method according to claim 1 , wherein optimizing the initial algorithm of the quantization model further comprises:

optimizing a learning rate parameter in the initial algorithm according to the time scaling parameter.

6. The method according to claim 5 , wherein optimizing the learning rate parameter in the initial algorithm further comprises:

updating the learning rate parameter in the initial algorithm to a product of the learning rate parameter and the time scaling parameter.

7. The method according to claim 1 , wherein training the quantization model further comprises:

increasing the time scaling parameter when the convergence speed of the quantization model is less than a predetermined speed threshold; and

decreasing the time scaling parameter when the precision of the quantization model is less than a predetermined precision threshold.

8. An electronic device, comprising:

one or more processors; and

memory storing one or more programs that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:

determining jump ratios of embedding layer parameters of a trained quantization model in a first predetermined time range, each jump ratio corresponding to a parameter jump of the embedding layer parameters of the trained quantization model in each predetermined time interval within the first predetermined time range, the quantization model being a neural network model obtained after quantization processing on the embedding layer parameters;

determining a jump curve in the first predetermined time range according to the jump ratios;

fitting the jump curve to obtain a corresponding time scaling parameter;

optimizing an initial algorithm of the quantization model based on the time scaling parameter to obtain an optimized target optimization algorithm;

training the quantization model based on the target optimization algorithm to obtain an optimized quantization model, wherein the time scaling parameter is configured to adjust a convergence speed and a precision of the quantization model;

acquiring user behavior data associated with a user at a terminal in a second predetermined time range;

learning the user behavior data using the optimized quantization model;

determining a user behavior feature corresponding to the user behavior data;

determining target recommendation information based on the user behavior feature; and;

providing the target recommendation information to the user at the terminal.

9. The electronic device according to claim 8 , wherein the quantization processing comprises N-valued quantization processing on the embedding layer parameters, wherein N is an integer greater than one.

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

a respective jump ratio of a parameter jump of the embedding layer parameters in any predetermined time interval is determined by:

determining a quantity of parameters that jump in the embedding layer parameters in the any predetermined time interval, relative to the embedding layer parameters in a previous predetermined time interval of the any predetermined time interval; and

determining the jump ratio of the parameter jump of the embedding layer parameters in the any predetermined time interval according to the quantity of parameters and a total quantity of embedding layer parameters.

11. The electronic device according to claim 8 , wherein fitting the jump curve further comprises:

determining a curve type of the jump curve, and determining a fitting function corresponding to the curve type; and

fitting the jump curve according to the fitting function to obtain the corresponding time scaling parameter.

12. The electronic device according to claim 8 , wherein optimizing the initial algorithm of the quantization model further comprises:

optimizing a learning rate parameter in the initial algorithm according to the time scaling parameter.

13. The electronic device according to claim 12 , wherein optimizing the learning rate parameter in the initial algorithm further comprises:

updating the learning rate parameter in the initial algorithm to a product of the learning rate parameter and the time scaling parameter.

14. The electronic device according to claim 8 , wherein training the quantization model further comprises:

increasing the time scaling parameter when the convergence speed of the quantization model is less than a predetermined speed threshold; and

decreasing the time scaling parameter when the precision of the quantization model is less than a predetermined precision threshold.

15. A non-transitory computer readable storage medium storing instructions that, when executed by one or more processors of an electronic device, cause the one or more processors to perform operations comprising:

determining jump ratios of embedding layer parameters of a trained quantization model in a first predetermined time range, each jump ratio corresponding to a parameter jump of the embedding layer parameters of the trained quantization model in each predetermined time interval within the first predetermined time range, the quantization model being a neural network model obtained after quantization processing on the embedding layer parameters;

determining a jump curve in the first predetermined time range according to the jump ratios;

fitting the jump curve to obtain a corresponding time scaling parameter;

optimizing an initial algorithm of the quantization model based on the time scaling parameter to obtain an optimized target optimization algorithm;

training the quantization model based on the target optimization algorithm to obtain an optimized quantization model, wherein the time scaling parameter is configured to adjust a convergence speed and a precision of the quantization model;

acquiring user behavior data associated with a user at a terminal in a second predetermined time range;

learning the user behavior data using the optimized quantization model:

determining a user behavior feature corresponding to the user behavior data;

determining target recommendation information based on the user behavior feature; and;

providing the target recommendation information to the user at the terminal.

16. The non-transitory computer readable storage medium according to claim 15 , wherein the quantization processing comprises N-valued quantization processing on the embedding layer parameters, wherein N is an integer greater than one.

17. The non-transitory computer readable storage medium according to claim 15 , wherein:

a respective jump ratio of a parameter jump of the embedding layer parameters in any predetermined time interval is determined by:

determining a quantity of parameters that jump in the embedding layer parameters in the any predetermined time interval, relative to the embedding layer parameters in a previous predetermined time interval of the any predetermined time interval; and

determining the jump ratio of the parameter jump of the embedding layer parameters in the any predetermined time interval according to the quantity of parameters and a total quantity of embedding layer parameters.

18. The non-transitory computer readable storage medium according to claim 15 , wherein fitting the jump curve further comprises:

determining a curve type of the jump curve, and determining a fitting function corresponding to the curve type; and

fitting the jump curve according to the fitting function to obtain the corresponding time scaling parameter.

19. The non-transitory computer readable storage medium according to claim 15 , wherein optimizing the initial algorithm of the quantization model further comprises:

optimizing a learning rate parameter in the initial algorithm according to the time scaling parameter.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 4, 2022
From: YUAN, YI; MAO, ZHICHENG; WANG, YONGZHUANG; XU, YUHUI
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 059813/0697 →
Priority Claims (1)
CN 201910390616.7 · May 10, 2019 · national
Continuity (2)
Continuation PCTCN2020089543 · May 11, 2020
Related Publication 20210374540A1 · Dec 2, 2021