IP Library Granted Patent US 12,675,635
Granted Patent B1
US 12,675,635 · App. 18/402,135 · Granted Jul 7, 2026

Training natural language processing network based on existing network

Inventors: Steven L. Teig (Menlo Park, CA); Eric A. Sather (Palo Alto, CA); Evgeny Sorkin (Vancouver, CA)
Assignee: AMAZON TECHNOLOGIES, INC.
G06F40/284G06F40/00G06F40/10G06F40/20G06F40/279G06N3/02G06N3/045G06N3/0455G06N3/08G06N3/096G06N20/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,675,635
App. No.
18/402,135
Filed
Jan 2, 2024
Granted
Jul 7, 2026
Kind
B1
Examiner
WONG, LINDA
Art Unit
2655
USPC
704/9
Abstract

Some embodiments provide a method for training a first NLP network based on a previously-trained second NLP network. The method propagates text inputs through the first network to generate a first set of output vectors and the second network to generate a second set of output vectors. Each first-set vector generated based on a text input has a corresponding second-set vector generated based on the same text input and each vector of the first and second sets has a same number of vector components. The method computes a value for a loss function that emphasizes a maximum disparity between components of first-set vectors and corresponding components of second-set vectors. The method trains the first network using the computed loss function value to minimize the maximum disparity between the first-set vector components and corresponding second-set vector components so that the first network produces outputs similar to outputs of the second network.

Claims (42)

1 . A method for training a first natural language processing (NLP) network based on a previously-trained second NLP network, the method comprising:

propagating a plurality of text inputs through (1) the first NLP network to generate a first set of output vectors and (2) the previously-trained second NLP network to generate a second set of output vectors, each respective output vector of the first set of output vectors generated based on a respective text input having a corresponding output vector of the second set of output vectors generated based on the respective text input, each respective output vector of the first and second sets of output vectors comprising a same number of respective vector components, each respective output vector for use by a post-processor to select a next word to append to a corresponding text input;

determining, by comparing respective components of a first output vector of the first set of output vectors to corresponding components of a first output vector of the second set of output vectors, a set of per-component disparity values between the first output vector of the first set of output vectors and the first output vector of the second set of output vectors, wherein the first output vector of the first set of output vectors and the first output vector of the second set of output vectors are generated using the same text input;

computing a value for a loss function based on a determination of a maximum disparity among the set of per-component disparity values; and

training the first NLP network using the computed value for the loss function to minimize the maximum disparity so that the first NLP network produces outputs similar to outputs of the previously-trained second NLP network.

2 . The method of claim 1 , wherein, after training, the first NLP network operates to generate output vectors based on input text.

3 . The method of claim 2 , wherein the trained first NLP network:

receives a first text input;

deterministically generates a first output vector; and

provides the first output vector to a non-deterministic token selection function that selects a first token based on the first output vector, wherein the first token is appended to the first text input as a second text input and provided as a second text input to the trained first NLP network.

4 . The method of claim 3 , wherein, until a stopping condition is reached, the trained first NLP network iteratively:

receives a current text input;

deterministically generates an output vector based on the received current text input; and

provides the generated output vector to a non-deterministic token selection function that selects a token based on the first output vector, wherein the token is appended to the current text input as a next text input for the trained first NLP network.

5 . The method of claim 2 , wherein the output vectors represent probability distributions over potential next tokens to append to the input text.

6 . The method of claim 1 , wherein the loss function nests continuously-differentiable functions that estimate a maximum disparity among maximum disparities identified for each output vector of the first set of output vectors and corresponding output vectors of the second set of output vectors.

7 . The method of claim 1 , wherein:

each respective text input comprises a respective plurality of time steps;

each of the first and second NLP networks generates a separate output vector for each time step; and

the loss function nests continuously-differentiable functions that estimate a maximum disparity among the maximum disparities identified for each text input, said maximum disparities each corresponding to a respective time step, and (ii) estimate a maximum disparity among the maximum disparities identified for each output vector of the first set of output vectors and corresponding output vectors of the second set of output vectors.

8 . The method of claim 1 , wherein training the first NLP network to minimize the maximum disparity improves accuracy of the first NLP network for inputs for which the generated first set of output vectors are furthest from expected network outputs.

9 . The method of claim 1 , wherein the loss function uses a log-sum-exponent formulation to estimate the maximum disparity between the components of the first output vector of the first set of output vectors and the corresponding components of the first output vector of the second set of output vectors.

10 . The method of claim 1 , wherein the loss function uses a p-norm function to estimate the maximum disparity between the components of the first output vector of the first set of output vectors and the corresponding components of the first output vector of the second set of output vectors.

11 . The method of claim 1 , wherein the loss function uses a Boltzmann expected energy formulation to estimate the maximum disparity between the components of the first output vector of the first set of output vectors and the corresponding components of the first output vector of the second set of output vectors.

12 . The method of claim 1 , wherein the first NLP network has a first number of transformer decoders and the second NLP network has a second, larger number of transformer decoders.

13 . The method of claim 1 , wherein the first NLP network has a first number of parameters and the second NLP network has a second, larger number of parameters.

14 . A non-transitory machine-readable medium storing a program which when executed by at least one processing unit trains a first natural language processing (NLP) network based on a previously-trained second NLP network, the program comprising sets of instructions for:

propagating a plurality of text inputs through (1) the first NLP network to generate a first set of output vectors and (2) the previously-trained second NLP network to generate a second set of output vectors, each respective output vector of the first set of output vectors generated based on a respective text input having a corresponding output vector of the second set of output vectors generated based on the respective text input, each respective output vector of the first and second sets of output vectors comprising a same number of respective vector components, each respective output vector for use by a post-processor to select a next word to append to a corresponding text input;

determining, by comparing respective components of a first output vector of the first set of output vectors to corresponding components of a first output vector of the second set of output vectors, a set of per-component disparity values between the first output vector of the first set of output vectors and the first output vector of the second set of output vectors, wherein the first output vector of the first set of output vectors and the first output vector of the second set of output vectors are generated using the same text input;

computing a value for a loss function based on an determination of a maximum disparity among the set of per-component disparity values; and

training the first NLP network using the computed value for the loss function to minimize the maximum disparity so that the first NLP network produces outputs similar to outputs of the previously-trained second NLP network.

15 . The non-transitory machine-readable medium of claim 14 , wherein, after training, the first NLP network operates to generate output vectors based on input text.

16 . The non-transitory machine-readable medium of claim 15 , wherein, until a stopping condition is reached, the trained first NLP network iteratively:

receives a current text input;

deterministically generates an output vector based on the received current text input; and

provides the generated output vector to a non-deterministic token selection function that selects a token based on the first output vector, wherein the token is appended to the current text input as a next text input for the trained first NLP network.

17 . The non-transitory machine-readable medium of claim 15 , wherein the output vectors represent probability distributions over potential next tokens to append to the input text.

18 . The non-transitory machine-readable medium of claim 14 , wherein the loss function nests continuously-differentiable functions that estimate a maximum disparity among maximum disparities identified for each output vector of the first set of output vectors and corresponding output vectors of the second set of output vectors.

19 . The non-transitory machine-readable medium of claim 14 , wherein:

each respective text input comprises a respective plurality of time steps;

each of the first and second NLP networks generates a separate output vector for each time step; and

the loss function nests continuously-differentiable functions that estimate a maximum disparity among the maximum disparities identified for each text input, said maximum disparities each corresponding to a respective time step, and (ii) estimate a maximum disparity among the maximum disparities identified for each output vector of the first set of output vectors and corresponding output vectors of the second set of output vectors.

Assignments (2)
BILL OF SALE Recorded Oct 31, 2024
From: AMAZON.COM SERVICES LLC
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 069288/0490 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 31, 2024
From: PERCEIVE CORPORATION
To: AMAZON.COM SERVICES LLC
Reel/Frame 069288/0731 →
Continuity (3)
Provisional Application 63464334 · May 5, 2023
Provisional Application 63438630 · Jan 12, 2023
Provisional Application 63437098 · Jan 4, 2023
References Cited (80)
US 4866634A · Reboh et al. · 1989 [cited by applicant]
US 5255347A · Matsuba et al. · 1993 [cited by applicant]
US 5579436A · Chou et al. · 1996 [cited by applicant]
US 6601052B1 · Lee et al. · 2003 [cited by applicant]
US 6985781B2 · Keeler et al. · 2006 [cited by applicant]
US 7333923B1 · Yamanishi et al. · 2008 [cited by applicant]
US 8000538B2 · Sarkar · 2011 [cited by applicant]
US 8145662B2 · Chen et al. · 2012 [cited by applicant]
US 9373087B2 · Nowozin · 2016 [cited by applicant]
US 10019654B1 · Pisoni · 2018 [cited by applicant]
US 10586151B1 · Teig · 2020 [cited by applicant]
US 11475310B1 · Teig et al. · 2022 [cited by applicant]
US 20030033263A1 · Cleary · 2003 [cited by applicant]
US 20040243954A1 · Devgan et al. · 2004 [cited by applicant]
US 20060010093A1 · Fan et al. · 2006 [cited by applicant]
US 20070078630A1 · Filatov et al. · 2007 [cited by applicant]
US 20070239642A1 · Sindhwani et al. · 2007 [cited by applicant]
US 20070271287A1 · Acharya et al. · 2007 [cited by applicant]
US 20080256011A1 · Rice · 2008 [cited by applicant]
US 20090106173A1 · Andrew et al. · 2009 [cited by applicant]
US 20100082639A1 · Li et al. · 2010 [cited by applicant]
US 20110105346A1 · Beattie et al. · 2011 [cited by applicant]
US 20110120718A1 · Craig · 2011 [cited by applicant]
US 20110182345A1 · Lei et al. · 2011 [cited by applicant]
US 20120271791A1 · Laan et al. · 2012 [cited by applicant]
US 20120283992A1 · Ji et al. · 2012 [cited by applicant]
US 20120331025A1 · Gemulla et al. · 2012 [cited by applicant]
US 20130257873A1 · Isozaki · 2013 [cited by applicant]
US 20140124265A1 · Al-Yami et al. · 2014 [cited by applicant]
US 20140207837A1 · Taniguchi et al. · 2014 [cited by applicant]
US 20140222747A1 · Zhou et al. · 2014 [cited by applicant]
US 20150100530A1 · Winih et al. · 2015 [cited by applicant]
US 20150161995A1 · Sainath et al. · 2015 [cited by applicant]
US 20150262083A1 · Xu et al. · 2015 [cited by applicant]
US 20160132786A1 · Balan et al. · 2016 [cited by applicant]
US 20160260222A1 · Paglieroni et al. · 2016 [cited by applicant]
US 20170061326A1 · Talathi et al. · 2017 [cited by applicant]
US 20170068844A1 · Friedland · 2017 [cited by applicant]
US 20170091615A1 · Liu et al. · 2017 [cited by applicant]
US 20170140298A1 · Wabnig et al. · 2017 [cited by applicant]
US 20170154425A1 · Pierce et al. · 2017 [cited by applicant]
US 20170161640A1 · Shamir · 2017 [cited by applicant]
US 20170183836A1 · Ahmed et al. · 2017 [cited by applicant]
US 20170262735A1 · Sanchez et al. · 2017 [cited by applicant]
US 20180033024A1 · Latapie et al. · 2018 [cited by applicant]
US 20180068221A1 · Brennan et al. · 2018 [cited by applicant]
US 20180101783A1 · Savkli · 2018 [cited by applicant]
US 20180174041A1 · Imam et al. · 2018 [cited by applicant]
US 20180219888A1 · Apostolopoulos · 2018 [cited by applicant]
US 20180336465A1 · Kim et al. · 2018 [cited by applicant]
US 20190005358A1 · Pisoni · 2019 [cited by applicant]
US 20190230913A1 · Chen et al. · 2019 [cited by applicant]
US 20190286970A1 · Karaletsos et al. · 2019 [cited by applicant]
US 20200007934A1 · Ortiz et al. · 2020 [cited by applicant]
US 20200202218A1 · Csefalvay · 2020 [cited by applicant]
US 20200249996A1 · Addepalli et al. · 2020 [cited by applicant]
US 20210182662A1 · Lai · 2021 [cited by examiner]
US 20210264272A1 · Luo et al. · 2021 [cited by applicant]
US 20230040889A1 · Teig et al. · 2023 [cited by applicant]
US 20230222353A1 · Lioutas · 2023 [cited by examiner]
US 20240371500A1 · Rubin · 2024 [cited by examiner]
CN 111062489A · 2020 [cited by examiner]
CN 112183670A · 2021 [cited by examiner]
Chen, Minghua, et al., “Markov Approximation for Combinatorial Network Optimization,” IEEE Transactions on Information Theory, Oct. 2013, 27 pages, vol. 59, No. 10, IEEE. [cited by applicant]
Duda, Jarek, “Asymmetric Numeral Systems: Entropy Coding Combining Speed of Huffman Coding with Compression Rate of Arithmetic Coding,” Jan. 6, 2014, 24 pages, arXiv:1311.2540v2, Computer Research Repository (CoRR)—Corn… [cited by applicant]
Eisele, Robert, “The log-sum-exp trick in Machine Learning,” Computer Science & Machine Learning, Jun. 22, 2016, 3 pages. [cited by applicant]
Emer, Joel, et al., “Hardware Architectures for Deep Neural Networks,” CICS/MTL Tutorial, Mar. 27, 2017, 258 pages, Massachusetts Institute of Technology, Cambridge, MA, USA, retrieved from http://www.rle.mit.edu/eems/w… [cited by applicant]
Guo, Jianping, et al., “Knowledge Distillation: A Survey,” May 20, 2021, 36 pages, retrieved from https://arxiv.org/abs/2006.05525. [cited by applicant]
Hinton, Geoffrey, et al., “Distilling the Knowledge in a Neural Network,” Mar. 9, 2015, 9 pages, retrieved from https://arxiv.org/abs/1503.02531. [cited by applicant]
Huang, Gao, et al., “Multi-Scale Dense Networks for Resource Efficient Image Classification,” Proceedings of the 6th International Conference on Learning Representations (ICLR 2018), Apr. 30-May 3, 2018, 14 pages, ICLR,… [cited by applicant]
Jain, Anil K., et al., “Artificial Neural Networks: A Tutorial,” Computer, Mar. 1996, 14 pages, vol. 29, Issue 3, IEEE. [cited by applicant]
Li, Hong-Xing, et al., “Interpolation Functions of Feedforward Neural Networks,” Computers & Mathematics with Applications, Dec. 2003, 14 pages, vol. 46, Issue 12, Elsevier Ltd. [cited by applicant]
Mandelbaum, Amit et al., “Distance-based Confidence Score for Neural Network Classifiers,” Sep. 28, 2017, 10 pages, arXiv:1709.09844v1, Computer Research Repository (CoRR) , Cornell University, Ithaca, NY, USA. [cited by applicant]
Non-published Commonly Owned U.S. Appl. No. 18/115,616, filed Feb. 28, 2023, 54 pages, Perceive Corporation. [cited by applicant]
Non-published Commonly Owned U.S. Appl. No. 18/115,618, filed Feb. 28, 2023, 55 pages, Perceive Corporation. [cited by applicant]
Non-published Commonly Owned U.S. Appl. No. 18/115,622, filed Feb. 28, 2023, 55 pages, Perceive Corporation. [cited by applicant]
Polino, Antonio, et al., “Model Compression via Distillation and Quantization,” ICLR 2018 Conference Paper, Feb. 15, 2018, 21 pages, retrieved https://arxiv.org/abs/1802.05668. [cited by applicant]
Shalev-Shwartz, Shai, et al., “Minimizing the Maximal Loss: How and Why,” Proceedings of the 33rd International Conference on Machine Learning, Jun. 19-24, 2016, 13 pages, JMLR, New York, NY, USA. [cited by applicant]
Srivastava, Nitish, et al., “Dropout: A Simple Way to Prevent Neural Networks from Overfitting,” Journal of Machine Learning Research, Jun. 2014, 30 pages, vol. 15, JMLR.org. [cited by applicant]
Sze, Vivienne, et al., “Efficient Processing of Deep Neural Networks: A Tutorial and Survey,” Aug. 13, 2017, 32 pages, arXiv:1703.09039v2, Computer Research Repository (CoRR)—Cornell University, Ithaca, NY, USA. [cited by applicant]