IP Library Granted Patent US 12,481,834
Granted Patent B2
US 12,481,834 · App. 18/603,756 · Granted Nov 25, 2025

Machine-learned language models which generate intermediate textual analysis in service of contextual text generation

Inventors: Noam Shazeer (Palo Alto, CA); Daniel De Freitas Adiwardana (Mountain View, CA)
Assignee: GOOGLE LLC
G06F40/35G06F8/38G06F16/90332G06F16/90335G06F16/9038G06F40/20G06F40/279G06F40/284G06N3/045G06N3/092G06N20/00G10L13/02
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,481,834
App. No.
18/603,756
Granted
Nov 25, 2025
Kind
B2
Abstract

The present disclosure is directed to systems and methods that include and/or leverage one or more machine-learned language models that generate intermediate textual analysis (e.g., including usage of structural tools such as APIs) in service of contextual text generation. For example, a computing system can obtain a contextual text string that includes one or more contextual text tokens. The computing system can process the contextual text string with the machine-learned language model to generate one or more intermediate text strings that include one or more intermediate text tokens. The computing system can process the one or more intermediate text strings with the machine-learned language model to generate an output text string comprising one or more output text tokens. The one or more intermediate text strings can include textual analysis of the contextual text string that supports the output text string.

Claims (56)

1 . A computer-implemented method for training a machine-learned model to generate intermediate tokens for processing by an attention mechanism of the machine-learned model to improve subsequent outputs of the machine-learned model, the method comprising:

obtaining, by a computing system comprising one or more computing devices, a training example for training the machine-learned model to perform a contextual content generation task, wherein the training example comprises:

an initial portion comprising a context sequence;

an intermediate portion comprising an intermediate sequence; and

a response portion comprising a response sequence;

processing, by the computing system, the initial portion using the machine-learned model, wherein the machine-learned model uses the attention mechanism to perform attention over the initial portion;

generating, by the computing system and based on performing attention over the initial portion with the attention mechanism, one or more intermediate token predictions;

determining, by the computing system and using the intermediate sequence, one or more first loss values for the one or more intermediate token predictions;

generating, by the computing system and based on performing attention over the initial portion and the intermediate portion with the attention mechanism, one or more response token predictions;

determining, by the computing system and using the response sequence, one or more second loss values for the one or more response token predictions; and

training, by the computing system, the machine-learned model based on the one or more first loss values and the one or more second loss values.

2 . The method of claim 1 , wherein the one or more intermediate token predictions correspond to one or more tool tokens.

3 . The method of claim 1 , wherein the one or more intermediate token predictions correspond to step-by-step logic associated with the initial portion.

4 . The method of claim 1 , wherein the initial portion is marked with a first tag that indicates an entity associated with the context sequence.

5 . The method of claim 4 , wherein the first tag indicates that the context sequence is associated with a user.

6 . The method of claim 5 , wherein the first tag comprises the textual string, “user”.

7 . The method of claim 2 , wherein the intermediate portion is marked with one or more second tags that indicate an input to a tool associated with the one or more tool tokens.

8 . The method of claim 7 , wherein the one or more second tags comprise:

an input tag that indicates an input to the tool; and

an output tag that indicates an output of the tool.

9 . The method of claim 1 , wherein the response portion is marked with a third tag that indicates an entity associated with the response sequence.

10 . The method of claim 9 , wherein the third tag indicates that the response sequence is associated with an agent or assistant.

11 . The method of claim 10 , wherein the third tag comprises the textual string, “assistant”.

12 . The method of claim 1 , wherein the machine-learned model is a left-to-right language model configured to predict a next token based on one or more preceding tokens.

13 . The method of claim 1 , wherein the machine-learned model is implemented by a dialog agent configured to conduct a dialogue responsive to user inputs.

14 . The method of claim 13 , wherein the training example comprises a dialogue between a user and an assistant, wherein assistant portions of the dialogue are generated by the machine-learned model.

15 . A computing system for training a machine-learned model to generate intermediate tokens for processing by an attention mechanism of the machine-learned model to improve subsequent outputs of the machine-learned model, the computing system comprising:

one or more processors; and

one or more non-transitory computer-readable media that collectively store instructions that, when executed by the one or more processors, cause the computing system to perform operations, the operations comprising:

obtaining a training example for training the machine-learned model to perform a contextual content generation task, wherein the training example comprises:

an initial portion comprising a context sequence;

an intermediate portion comprising an intermediate sequence; and

a response portion comprising a response sequence;

processing the initial portion using the machine-learned model, wherein the machine-learned model uses the attention mechanism to perform attention over the initial portion;

generating, based on performing attention over the initial portion with the attention mechanism, one or more intermediate token predictions;

determining, using the intermediate sequence, one or more first loss values for the one or more intermediate token predictions;

generating, based on performing attention over the initial portion and the intermediate portion with the attention mechanism, one or more response token predictions;

determining, using the response sequence, one or more second loss values for the one or more response token predictions; and

training the machine-learned model based on the one or more first loss values and the one or more second loss values.

16 . The computing system of claim 15 , wherein the one or more intermediate token predictions correspond to one or more tool tokens.

17 . The computing system of claim 15 , wherein the one or more intermediate token predictions correspond to step-by-step logic associated with the initial portion.

18 . The computing system of claim 15 , wherein:

the initial portion is marked with a first tag that indicates an entity associated with the context sequence, wherein the first tag indicates that the context sequence is associated with a user; and

the response portion is marked with a third tag that indicates an entity associated with the response sequence, wherein the third tag indicates that the response sequence is associated with an agent or assistant.

19 . The computing system of claim 18 , wherein the first tag comprises the textual string, “user,” and the third tag comprises the textual string, “assistant”.

20 . One or more non-transitory computer-readable media that collectively store instructions that, when executed by one or more processors, cause a computing system to perform operations for training a machine-learned model to generate intermediate tokens for processing by an attention mechanism of the machine-learned model to improve subsequent outputs of the machine-learned model, the operations comprising:

obtaining a training example for training the machine-learned model to perform a contextual content generation task, wherein the training example comprises:

an initial portion comprising a context sequence;

an intermediate portion comprising an intermediate sequence; and

a response portion comprising a response sequence;

processing the initial portion using the machine-learned model, wherein the machine-learned model uses the attention mechanism to perform attention over the initial portion;

generating, based on performing attention over the initial portion with the attention mechanism, one or more intermediate token predictions;

determining, using the intermediate sequence, one or more first loss values for the one or more intermediate token predictions;

generating, based on performing attention over the initial portion and the intermediate portion with the attention mechanism, one or more response token predictions;

determining, using the response sequence, one or more second loss values for the one or more response token predictions; and

training the machine-learned model based on the one or more first loss values and the one or more second loss values.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 4, 2024
From: ADIWARDANA, DANIEL DE FREITAS; SHAZEER, NOAM
To: GOOGLE LLC
Reel/Frame 066999/0720 →
Continuity (4)
Continuation 18164216 · Feb 3, 2023
Continuation 17749844 · May 20, 2022
Provisional Application 63191563 · May 21, 2021
Related Publication 20240256786A1 · Aug 1, 2024
References Cited (74)
US 10769295B2 · Loza · 2020 [cited by examiner]
US 10817650B2 · McCann et al. · 2020 [cited by applicant]
US 10877735B1 · Buck · 2020 [cited by examiner]
US 10977711B1 · Verma · 2021 [cited by examiner]
US 11194815B1 · Kumar · 2021 [cited by examiner]
US 11222627B1 · Qian · 2022 [cited by examiner]
US 11256866B2 · Lao et al. · 2022 [cited by applicant]
US 11269907B1 · Martino · 2022 [cited by examiner]
US 11367074B2 · Zoldi · 2022 [cited by examiner]
US 11386259B2 · Heckel · 2022 [cited by examiner]
US 11574131B2 · Shazeer · 2023 [cited by examiner]
US 11600194B2 · McCann · 2023 [cited by examiner]
US 11960848B2 · Shazeer · 2024 [cited by examiner]
US 20040243554A1 · Broder · 2004 [cited by examiner]
US 20040243556A1 · Ferrucci · 2004 [cited by examiner]
US 20040243557A1 · Broder · 2004 [cited by examiner]
US 20040243645A1 · Broder · 2004 [cited by examiner]
US 20050038644A1 · Napper · 2005 [cited by examiner]
US 20110196864A1 · Mason · 2011 [cited by examiner]
US 20140129227A1 · Hagg · 2014 [cited by examiner]
US 20170075877A1 · Lepeltier · 2017 [cited by examiner]
US 20180276525A1 · Jiang · 2018 [cited by examiner]
US 20180285386A1 · Liu · 2018 [cited by examiner]
US 20190108273A1 · Li · 2019 [cited by examiner]
US 20190114549A1 · Olsher · 2019 [cited by examiner]
US 20190130305A1 · Sivertson · 2019 [cited by examiner]
US 20190138576A1 · Bolle · 2019 [cited by examiner]
US 20190197109A1 · Peters · 2019 [cited by examiner]
US 20190220619A1 · Loza · 2019 [cited by examiner]
US 20190228336A1 · Kanagawa · 2019 [cited by examiner]
US 20190251178A1 · Tu · 2019 [cited by examiner]
US 20200110803A1 · Djalali · 2020 [cited by examiner]
US 20200143247A1 · Jonnalagadda · 2020 [cited by examiner]
US 20200320411A1 · Hebenthal · 2020 [cited by examiner]
US 20200364408A1 · Lao · 2020 [cited by examiner]
US 20200394260A1 · Wu · 2020 [cited by examiner]
US 20210073465A1 · Duong · 2021 [cited by examiner]
US 20210110258A1 · Lee · 2021 [cited by examiner]
US 20210158789A1 · Wu · 2021 [cited by examiner]
US 20210201147A1 · Tu et al. · 2021 [cited by applicant]
US 20210279235A1 · He · 2021 [cited by examiner]
US 20210319338A1 · Lui · 2021 [cited by examiner]
US 20220051654A1 · Finkelstein · 2022 [cited by examiner]
US 20220067281A1 · Hu · 2022 [cited by examiner]
US 20220139384A1 · Wu · 2022 [cited by examiner]
US 20220206785A1 · Singh · 2022 [cited by examiner]
US 20220207308A1 · Parikh · 2022 [cited by examiner]
US 20220223037A1 · Xu · 2022 [cited by examiner]
US 20220374608A1 · Shazeer · 2022 [cited by examiner]
US 20230009370A1 · Moriya · 2023 [cited by examiner]
US 20230029590A1 · De Freitas Adiwardana · 2023 [cited by examiner]
US 20230036020A1 · Flynn · 2023 [cited by examiner]
US 20230074406A1 · Baeuml · 2023 [cited by examiner]
US 20230177276A1 · Shazeer · 2023 [cited by examiner]
US 20240256786A1 · Shazeer · 2024 [cited by examiner]
CN 109271878A · 2019 [cited by examiner]
CN 110415022A · 2019 [cited by examiner]
CN 110678881A · 2020 [cited by examiner]
CN 110781312A · 2020 [cited by examiner]
CN 111095259A · 2020 [cited by examiner]
CN 111382582 · 2020 [cited by applicant]
CN 111428470 · 2020 [cited by applicant]
CN 111860785 · 2020 [cited by applicant]
CN 111967224 · 2020 [cited by applicant]
CN 112347780 · 2021 [cited by applicant]
CN 113052246A · 2021 [cited by examiner]
CN 114973393A · 2022 [cited by examiner]
CN 112818671B · 2024 [cited by examiner]
International Search Report and Written Opinion for Application No. PCT/US2022/030249, mailed Sep. 8, 2022, 10 pages. [cited by applicant]
International Preliminary Report on Patentability for Application No. PCT/US2022/030249, mailed Nov. 30, 2023, 6 pages. [cited by applicant]
Machine Translated Chinese Search Report Corresponding to Application No. 2022800276029 on Apr. 28, 2024. [cited by applicant]
Kuribayashi et al., “An Empirical Study of Span Representations in Argumentation Structure Parsing”, Journal of Natural Language Processing, Dec. 2020, vol. 27, No. 4, 24 pages. [cited by applicant]
Lu et al., “Goal-Oriented End-to-End Conversational Models with Profile Features in a Real-World Setting”, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistic… [cited by applicant]
Tsuboi et al., “Natural Language Processing Using Deep Learning”, Japan, Kodansha Co., Ltd. Tetsu Suzuki, May 24, 2017, pp. 91-99. [cited by applicant]