Generating responses to queries using generative neural networks by reconstructing queries
The system uses generative neural networks to iteratively reconstruct and optimize response trajectories, addressing inaccuracies in conventional systems by ensuring accurate reasoning and query reconstruction, thus producing high-quality responses efficiently.
Patent Information
- Application Number
- US19/215932
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2026-11-26
AI Technical Summary
Conventional systems for generating responses to queries often produce inaccurate response trajectories due to incorrect reasoning steps, even if the response is legible, and lack optimization for accuracy and reconstruction of queries.
A system utilizing generative neural networks to iteratively generate and reconstruct response trajectories, incorporating reconstructor outputs to ensure accuracy by comparing reconstructed queries with original queries, and employing multiple specialized reconstructor networks for improved annotation and optimization.
The system generates high-quality, accurate response trajectories by selecting optimal intermediate trajectories based on reconstructed query similarity, reducing computational latency and resource consumption while enhancing generalization and accuracy.
Smart Images

Figure US20260377696A1-D00000_ABST
Abstract
Description
BACKGROUND
[0001] This specification relates to processing inputs using neural networks to generate responses.
[0002] Neural networks are machine learning models that employ one or more layers of nonlinear units to predict an output for a received input. Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to the next layer in the network, i.e., another hidden layer or the output layer. Each layer of the network generates an output from a received input in accordance with current values of a respective set of parameters.SUMMARY
[0003] This specification describes a system implemented as computer programs on one or more computers in one or more locations that generates responses to queries using generative neural networks. In particular, the system can use a generative neural network to generate a response to a query based on a response trajectory for the query.
[0004] In general, one innovative aspect of the subject matter described in this specification can be embodied in methods that include the actions of receiving a query; generating a final response trajectory for the query, comprising, at each iteration of a sequence of one or more iterations: generating a respective task input for the iteration from the query; processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the query, wherein the intermediate response trajectory comprises (i) an intermediate response to the query and (ii) a sequence of reasoning steps for generating the intermediate response to the query; processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the query; and determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory; and generating a response for the query based on the final response trajectory.
[0005] In some implementations, the reconstructor output comprises a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response.
[0006] In some implementations, generating the respective task input comprises, for each iteration after a first iteration of the sequence of iterations: generating one or more annotations for the reconstructor output for a preceding iteration; and including the one or more annotations in the respective task input for the iteration.
[0007] In some implementations, each of the one or more annotations describe an error in the reconstructor output for the preceding iteration.
[0008] In some implementations, each of the one or more annotations describe an error in one or more of the reasoning steps of the reconstructor output for the preceding iteration.
[0009] In some implementations, the method further comprises: processing (i) the query, (ii) the intermediate response trajectory for the preceding iteration, (iii) the reconstructor output for the preceding iteration, and (iv) an instruction to identify one or more errors in the reconstructor output using the task generative neural network to generate the one or more annotations.
[0010] In some implementations, determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises: processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query; and in response to determining that the similarity meets a threshold similarity, determining to select the intermediate response trajectory as the final response trajectory.
[0011] In some implementations, processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query comprises: processing the query using an embedding model to generate a query embedding; processing the reconstructed query using the embedding model to generate a reconstructed query embedding; and determining a distance between the query embedding and the reconstructed query embedding.
[0012] In some implementations, processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query comprises: determining an edit distance between the query and the reconstructed query.
[0013] In some implementations, the reconstructor output comprises a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response, and wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises: processing the sequence of reasoning steps for generating the reconstructed query to determine whether the sequence of reasoning steps includes one or more errors; and in response to determining that the sequence of reasoning steps does not include one or more errors, determining to select the intermediate response trajectory as the final response trajectory.
[0014] In some implementations, the reconstructor generative neural network is one of a plurality of reconstructor generative neural networks, and wherein processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output comprises processing the reconstructor input using each of two or more of the plurality of reconstructor generative neural networks to generate a respective reconstructor output.
[0015] In some implementations, determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises determining from the query and the reconstructed query of each respective reconstructor output, whether to select the intermediate response trajectory as the final response trajectory.
[0016] In some implementations, determining from the query and the reconstructed query of each respective reconstructor output, whether to select the intermediate response trajectory as the final response trajectory comprises: generating a combined reconstructor output using each respective reconstructor output, wherein the combined reconstructor output comprises at least a combined reconstructed query that is a prediction of the query; and processing the query and the combined reconstructed query of the combined reconstructor output to determine a similarity between the query and the combined reconstructed query.
[0017] In some implementations, the reconstructor generative neural network is one of a plurality of reconstructor generative neural networks, and wherein the method further comprises selecting the reconstructor generative neural network from the plurality of reconstructor generative neural networks.
[0018] In general, another innovative aspect of the subject matter described in this specification can be embodied in methods that include the actions of obtaining a plurality of training examples, each comprising a training query and a target response for the training query; training a task generative neural network using the training examples, comprising, for each training example: generating a final response trajectory for the training query, comprising, at each iteration of a sequence of one or more iterations: generating a respective task input for the iteration from the training query; processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the training query, wherein the intermediate response trajectory comprises (i) an intermediate response to the training query and (ii) a sequence of reasoning steps for generating the intermediate response to the training query; processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the training query; and determining, from at least the training query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory; generating a response based on the final response trajectory; and training the task generative neural network based on at least the response and the target response.
[0019] In some implementations, determining, from at least the training query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises: determining whether a number of iterations in the sequence of iterations meets a threshold number of iterations; and determining to select the intermediate response trajectory as the final response trajectory in response to determining that the number of iterations in the sequence of iterations meets the threshold number of iterations.
[0020] In some implementations, training the task generative neural network comprises training the task generative neural network to optimize a loss function that is based on a reward that measures whether the response to the training query is similar to the target response and whether the reconstructed query is similar to the training query.
[0021] In some implementations, the loss function is further based on an error between the target response and the intermediate response of the final response trajectory.
[0022] In some implementations, the method further comprises: prior to processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network, processing at least the intermediate response trajectory using a verifier neural network to generate a verifier output that identifies whether the intermediate response trajectory contains more than a threshold amount of information about the training query; and determining whether the intermediate response trajectory contains more than the threshold amount of information based on the verifier output.
[0023] In some implementations, the method further comprises in response to determining that the intermediate response trajectory comprises the threshold amount of information: at each of one or more verifier iterations: generating a respective input for the verifier iteration; processing the respective input using the task generative neural network to generate a candidate intermediate response trajectory for the training query; and determining, from the training query and the candidate intermediate response trajectory, whether to update the intermediate response trajectory to include the candidate intermediate response trajectory.
[0024] Other implementations of these aspects include corresponding systems, apparatus, and computer programs, configured to perform the actions of the methods, encoded on computer storage devices.
[0025] The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages.
[0026] The system described in this specification can generate accurate responses to queries for a variety of tasks. For example, the system can generate responses to queries for tasks such as natural language processing, planning, or multi-hop reasoning tasks based on a response trajectory for the query. The response trajectory can include a sequence of reasoning steps for generating a response to the query. By generating a response to a query based on a response trajectory for the query, the system can leverage the reasoning and task decomposition capabilities of the generative neural network in order to more effectively respond to user queries.
[0027] Some conventional systems for generating responses to queries generate a single response trajectory from which the response is generated. In some cases, the single response trajectory may be inaccurate. By contrast, the system described in this specification can select the response trajectory from multiple intermediate response trajectories. For example, the system can generate an intermediate response trajectory for the query at each of a sequence of iterations. The system can generate a different intermediate response trajectory at each iteration. For example, the system can use one or more annotations that each describe an error in one or more of the reasoning steps of a reconstructed query trajectory for a preceding iteration to generate the intermediate response trajectory for a particular iteration.
[0028] The system can select a high-quality or accurate intermediate response trajectory as the response trajectory to use for generating the response. For example, the system can verify that an intermediate response trajectory is high-quality or accurate based on a reconstructed query for the intermediate response trajectory. For example, at each iteration, the system can process a reconstructor input that includes at least the intermediate response for the iteration using a reconstructor generative neural network to generate a reconstructor output. The reconstructor output can include a reconstructed query that is a prediction of the query. The system can determine that the intermediate response trajectory is high-quality or accurate in response to determining that the reconstructed query is similar to the query. The system can thus generate improved intermediate response trajectories over the sequence of iterations, allowing for the generation of a high-quality or accurate response trajectory from which the response is generated.
[0029] Some conventional systems that generate response trajectories are optimized for the legibility of the response trajectory. In some cases, even if the response trajectory is legible, the legible response trajectory may have incorrect reasoning steps, or a response generated using the legible response trajectory may be incorrect. The system described in this specification generates response trajectories that are optimized for the accuracy of the reasoning steps of the response trajectory. For example, the system can determine the accuracy of the reasoning steps of the response trajectory based on whether the query can be reconstructed from the reasoning steps using a reconstructor generative neural network. For example, the system can generate a reconstructor output that includes at least the reconstructed query using the reconstructor generative neural network. Thus, the system can determine that a response trajectory for a query is accurate if the query can be reconstructed from the sequence of reasoning steps, e.g., if the system determines that a reconstructed query that is a prediction of the query is similar to the query.
[0030] In some implementations, the system can generate a reconstructor output using multiple reconstructor generative neural networks. For example, the system can generate a combined reconstructor output from multiple reconstructor outputs generated using multiple reconstructor generative neural networks. In some examples, at each iteration, each of the reconstructor outputs can include a reconstructed query trajectory that includes a reconstructed query and a sequence of steps for generating the reconstructed query. The combined reconstructor output can include a combined reconstructed query and a sequence of steps for generating the combined reconstructed query. The system can obtain more information about the intermediate response trajectory from multiple reconstructor generative neural networks compared to using a single reconstructor generative neural network. At a current iteration, the system can use the combined reconstructor output for a preceding iteration to generate annotations that describe errors in the combined sequence of steps for generating the reconstructed query. The system can thus generate more accurate or effective annotations for improving the response trajectory, compared to using a single reconstructor output.
[0031] In some examples, the system can process the intermediate response trajectory using the multiple reconstructor generative neural networks in parallel, so that latency is not increased compared to using a single reconstructor generative neural network. For example, the system can deploy the multiple reconstructor generative neural networks on parallel processing hardware. Thus the system is optimized for deployment on parallel computing hardware such as hardware accelerators. Hardware accelerators perform matrix multiplications using dedicated circuitry, e.g., ASICs, FPGAs, graphic processing units (GPUs), or tensor processing units (TPUs), and more particularly on distributed machine learning systems comprising multiple TPUs and / or GPUs.
[0032] In some implementations, the system can generate a reconstructor output for an intermediate response trajectory using a reconstructor generative neural network that is one of multiple reconstructor generative neural networks. Each of the multiple reconstructor generative neural networks can be specialized for a particular type of query. In some cases, the system can thus generate more accurate reconstructor outputs compared to using a more general reconstructor generative neural network. In some examples, at each iteration, each reconstructor output can include a reconstructed query and a sequence of steps for generating the reconstructed query. At a current iteration, the system can use the reconstructor output for a preceding iteration to generate annotations that describe errors in the sequence of steps for generating the reconstructed query of the reconstructor output for the preceding iteration. The system can thus use reconstructor outputs that are specialized for particular types of queries to generate more accurate or effective annotations for improving the response trajectory. In some examples, the reconstructor generative neural networks can be smaller neural networks than a more general reconstructor generative neural network, so that fewer computing resources are required to perform inference compared to using the more general reconstructor generative neural network.
[0033] In some implementations, the system can generate a response trajectory for a query using a task generative neural network that has been trained using a reconstructor generative neural network. For example, at inference, rather than generating a response trajectory at each of a sequence of iterations and processing the response trajectory at each iteration using a reconstructor generative neural network, the system can generate one response trajectory using the task generative neural network. The system can thus reduce the computational cost of generating the response to the query, and reduce the latency to generate the response to the query, compared to generating a response trajectory at each of a sequence of iterations and processing the response trajectory at each iteration using a reconstructor generative neural network.
[0034] In some implementations, the system described in this specification can train the task generative neural network using a verifier neural network. The verifier neural network can be configured to generate a verifier output describing whether the response trajectory contains more than a threshold amount of information about a training query. In some cases, an inaccurate response trajectory can contain a large amount of information that allows the reconstructor generative neural network to reconstruct the query, even though the response trajectory includes inaccurate reasoning steps, an inaccurate response, or both. The system can thus ensure that performance improvements during training of the task generative neural network are not due to the task generative neural network generating response trajectories that contain a large amount of information about the query. The system can thus ensure that the task generative neural network learns to generate accurate response trajectories that are understandable so that the reconstructor generative neural network can reconstruct the queries, rather than response trajectories that contain a large amount of information that allow the reconstructor generative neural network to reconstruct the queries. The system can thus improve the generalization of the reconstruction process by the reconstructor generative neural network, resulting in more accurate reconstructor outputs, and in some examples, more accurate annotations, for generating response trajectories at inference.
[0035] The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.BRIEF DESCRIPTION OF THE DRAWINGS
[0036] FIG. 1A shows an example system for generating responses.
[0037] FIG. 1B shows another example system for generating responses.
[0038] FIG. 2 is a flow diagram of an example process for generating a response to a query.
[0039] FIG. 3 shows an example training system for training a task generative neural network.
[0040] FIG. 4 is a flow diagram of an example process for training a task generative neural network.
[0041] FIG. 5 is a flow diagram of an example process for processing a response trajectory using a verifier neural network.
[0042] Like reference numbers and designations in the various drawings indicate like elements.DETAILED DESCRIPTION
[0043] FIG. 1A shows an example system 100 for generating responses. The system 100 is an example of a system implemented as computer programs on one or more computers in one or more locations in which the systems, components, and techniques described below are implemented.
[0044] The system 100 generates a response 152 for a given query 102. The response 152 can include, for example, text, audio data, image data, or video data that is responsive to the query 102.
[0045] To generate the response 152, the system 100 receives the query 102. The query 102 can specify a task to be performed. For example, the query 102 can include text that includes a question or an instruction to perform any of a variety of tasks. In some examples, the query 102 can include input data such as audio data, image data, or video data, and text that includes a question or an instruction about the input data.
[0046] In some examples, an output for a task can be generated by performing a sequence of actions. In some examples, the sequence of actions can include actions performed by calling an external tool or by calling a generative neural network. In some examples, the sequence of actions can include reasoning steps. Each reasoning step includes an intermediate thought or logical step that contributes to generating the output for the task.
[0047] Some example tasks include a language processing, inference, or understanding task. For example, the input can include text and the task can include generating a sequence of text responsive to the input data. Example natural language processing, inference, or understanding tasks include an entailment task, a paraphrase task, a textual similarity task, a sentiment task, a sentence completion task, a grammaticality task, a commonsense task, a question answering task, a reading comprehension task, a reading comprehension with commonsense task, a coreference resolution task, a miscellaneous task, and the like. In some examples, the sequence of actions for generating the output can include identifying the task, analyzing the input, extracting relevant information from the input, evaluating context from the input, or generating an output for the task. For example, for a question answering task, the sequence of actions for generating the output can include retrieving information, e.g., from the input or from an external database. As another example, for a sentiment task, the sequence of actions for generating the output can include identifying phrases of the input that have positive or negative sentiment, or determining the overall tone of the input using the identified phrases.
[0048] In some examples, the input can include reasoning problems such as math problems or multi-hop reasoning problems. For example, for a math problem, the sequence of actions for generating the output can include identifying the mathematical operations, determining the order of operations, evaluating expressions according to the order of operations, etc. As another example, for a multi-hop reasoning problem, the sequence of actions for generating the output can include identifying the task, identifying relevant information from the input, assigning variables to information from the input, setting up a mathematical representation for the task, e.g., setting up an equation or system of equations, evaluating the mathematical representation for the task, etc.
[0049] As another example, the task can be a code generation task. For example, the input can include a text description of a desired piece of code or a snippet of computer code in a programming language. The output can include computer code, e.g., a snippet of code that is described by the input or a snippet of code that follows the input in a computer program. For example the input may represent words, wordpieces or characters in a first natural language and the output may represent instructions in a computer programming or markup language, or instructions for controlling an application program to perform a task e.g. build a data item such as an image or web page. In some examples, the sequence of actions for generating the output can include identifying the task, identifying operations for performing the task, generating code, e.g., conditions or variable assignments, for performing the operations, identifying existing functions, e.g., sorting functions, for performing the operations, combining the generated code and existing function into the snippet of code, etc.
[0050] As another example, the task can be a summarization task in which the outputs can include text summaries of, e.g., text, images, video, audio, etc. specified by the input. For example, for a summarization of text, the sequence of actions for generating the output can include identifying key information from the text, selecting important elements to include in the summary, identifying information that is less important, and generating the summary, e.g., combining the important elements and omitting less important information, processing the important elements using a language model neural network to generate the summary, etc. As another example, for a summarization of a video, the sequence of actions for generating the output can include obtaining a text description of content depicted in the video, e.g., using a video processing model, obtaining a transcript of speech in the video, e.g., using a speech processing model, obtaining a text description of audio depicted in the video, e.g., using an audio processing model, processing the text descriptions and transcript to identify scenes or segments of the video, generating a summary of each scene using the text descriptions and the transcript, e.g., using a language model neural network, combining the description of each scene in the summary, etc. As another example, for a summarization of an image, the sequence of actions for generating the output can include obtaining a text description of content depicted in the image, e.g., using an image processing model, processing the text description to identify important information, generating a summary of the important information, e.g., using a language model neural network, etc. As another example, for a summarization of an audio signal, the sequence of actions for generating the output can include obtaining a text description of the audio signal, e.g., using an audio processing model, obtaining a transcript of speech represented by the audio signal, e.g., using a speech processing model, processing the text description or transcript to identify important information, generating a summary of the important information, e.g., using a language model neural network, etc.
[0051] In some cases, the machine learning task is a multi-modal processing task that requires processing multi-modal data. In general, multi-modal data is a combination of two or more different types of data, e.g., two or more of audio data, image data, text data, or graph data. As another example the multi-modal data may comprise a combination of i) text data representing text in a natural language and ii) pixels of an image or of video or audio data representing values of an audio waveform. For example, the multi-modal processing task may correspond to any of the tasks previously described for any of the types of data making up the multi-modal combination. Examples of such tasks include image captioning, image generation, and so on.
[0052] For example, for an image generation task, the query 102 can include an instruction to generate an image of a cat playing with a ball. The task generative neural network 110 can generate a response trajectory that includes an image according to the query 102. The response trajectory can include reasoning steps for generating the image in more details, e.g., a cat in a specific color, or a specific cat breed, a ball in a red color, the cat playing with the ball indoors, what the background looks like, etc. The reconstructor generative neural network 120 can generate a reconstructor output that includes a prediction of the query 102 by generating a description of the image content of the generated image. For example, the reconstructor generative neural network 120 can be configured to perform image captioning. In cases where the image is inaccurate, the prediction of the query 102 may be inaccurate, e.g., an image of a cat playing with yarn, or an image of a dog playing with a ball. The system can repeatedly generate images using the task generative neural network 110 until the reconstructor generative neural network 120 can accurately describe the image.
[0053] As another example, for an image captioning task, the query 102 can include an input image and an instruction to generate a caption for the input image. The task generative neural network 110 can generate a response trajectory that includes a caption for the image. The response trajectory can include reasoning steps for generating the caption. For example, for an image of a cat playing with a ball, the steps can include identifying the subjects, analyzing the attributes of the subjects, analyzing the relationships of the subjects, analyzing the background, etc. The reconstructor generative neural network 120 can generate a reconstructor output that includes a prediction of the image by generating an image given the generated caption. For example, the reconstructor generative neural network 120 can be configured to perform text-conditioned image generation. In cases where the caption is inaccurate, the generated image may be inaccurate, e.g., a difference between the generated image and the input image meets a threshold difference. The system can repeatedly generate captions of the input image using the task generative neural network 110 until the reconstructor generative neural network 120 can accurately generate the input image.
[0054] As a particular example, the query 102 can include the text “Jenny goes to the florist to buy some flowers. Roses cost $2 each and $15 for a dozen. If she bought 15 roses and arrived with five 5 dollar bills and they only have quarters for change, how many quarters does she leave with?”
[0055] In some examples, the system 100 receives the query 102 from a user. For example, the system 100 can receive the query 102 from a user through a user interface of a user device.
[0056] The system generates one or more response trajectories for the query 102 using a task generative neural network 110. A response trajectory includes, for each action in a sequence of actions for generating a response to a query, natural language text describing the action.
[0057] The system 100 selects a response trajectory as a final response trajectory 150 as described below with reference to FIG. 1B and FIG. 2.
[0058] In some implementations, the system generates one or more response trajectories using the task generative neural network 110 and a reconstructor generative neural network 120. Generating a response trajectory is described below in further detail with reference to FIG. 1B and FIG. 2.
[0059] In some implementations, the system generates a response trajectory using only the task generative neural network 110. The task generative neural network 110 can have been trained as described below with reference to FIGS. 3-5. In these implementations, the system selects the response trajectory for the first iteration as the final response trajectory 150.
[0060] The system generates the response 152 based on the final response trajectory 150. In some examples, the response 152 can include one or more reasoning steps of the final response trajectory 150. In some examples, the system can process the final response trajectory 150 to generate the response 152.
[0061] In the example of FIG. 1A, the response 152 for the query 102 includes an answer to the question of the query 102. For example, the response 152 can include the text “16 quarters.”
[0062] In some examples, the system 100 can provide the response 152 for presentation to a user. For example, the system 100 can provide data representing the response 152 to a user device of the user.
[0063] FIG. 1B shows the example response generation system 100 described above with FIG. 1A. In the example of FIG. 1B, the system 100 generates the response 152 using the task generative neural network 110 and the reconstructor generative neural network 120.
[0064] At each iteration of a sequence of one or more iterations, the system 100 generates a respective task input 108 for the iteration from the query 102. For example, the system 100 can generate the task input 108 to include the query 102. In some examples, the system 100 can generate the task input 108 to include an instruction to generate a response trajectory for responding to the query 102. For example, the task input 108 can include an instruction to generate, for each action in a sequence of actions for generating a response to the query 102, natural language text describing the action.
[0065] In some examples, at each iteration other than the first iteration in the sequence, the system 100 can include one or more annotations 132 in the task input 108. In these examples, the system 100 can include an instruction in the task input 108 to generate a response trajectory for responding to the query 102 that addresses the one or more annotations 132. For example, the instruction can describe the one or more annotations 132 as errors to be avoided when generating the response trajectory. In some examples, the system 100 can include the intermediate response trajectory for the preceding iteration in the task input 108. For example, the system 100 can include an instruction in the task input 108 to generate a response trajectory for responding to the query 102 that addresses the one or more annotations 132. For example, the instruction can describe the one or more annotations 132 as errors to be addressed when modifying the intermediate response trajectory for the preceding iteration. The one or more annotations 132 are described in further detail below.
[0066] The system 100 can process the task input 108 using the task generative neural network 110 to generate an intermediate response trajectory 112 for the query 102. The task generative neural network 110 is described in further detail below. In some examples, the task generative neural network 110 can be trained as described with reference to FIGS. 3-4.
[0067] The intermediate response trajectory 112 includes an intermediate response 114 to the query 102 and a sequence of reasoning steps 116 for generating the intermediate response 114 to the query 102. Each reasoning step for generating the intermediate response 114 can be described by text. Example intermediate response trajectories for two iterations are described below.
[0068] The system can process a reconstructor input 118 using the reconstructor generative neural network 120 to generate a reconstructor output 122.
[0069] The reconstructor input 118 can include at least the intermediate response 114. In some examples, the reconstructor input 118 can include an instruction to reconstruct the original query or the original problem statement for the intermediate response 114. In some examples, the reconstructor input 118 can include an instruction to generate a response trajectory for reconstructing the original query or the original problem statement for the intermediate response 114.
[0070] In some examples, the reconstructor input 118 can include the intermediate response trajectory 112. In some of these examples, the reconstructor input 118 can include an instruction to reconstruct the original query or the original problem statement for the intermediate response trajectory 112. In some examples, the reconstructor input 118 can include an instruction to generate a response trajectory for reconstructing the original query or the original problem statement for the intermediate response trajectory 112.
[0071] The reconstructor output 122 includes a reconstructed query 124 that is a prediction of the query 102. In some examples, the reconstructor output 122 can include a reconstructed query trajectory, e.g., that includes the reconstructed query 124 and a sequence of reasoning steps 126 for generating the reconstructed query 124 from the intermediate response 114 or the intermediate response trajectory 112.
[0072] Each reasoning step includes an intermediate thought or logical step that contributes to generating the reconstructed query 124. Each reasoning step for generating the reconstructed query 124 can be described by text. For example, the reasoning steps include identifying relevant information, analyzing operations performed, determining context, and determining missing information. Example reconstructor outputs that include reconstructed query trajectories for two iterations are described below.
[0073] In some examples, the system can select the reconstructor output 122 from multiple candidate reconstructor outputs. For example, the system can sample from the reconstructor generative neural network 120 n times given the reconstructor input 118 to generate n candidate reconstructor outputs. For example, the system can sample from the reconstructor generative neural network 120 using different parameters such as temperature or top-k. In some examples, the system can select the reconstructor output 122 from the n candidate reconstructor outputs randomly. In some examples, the system can select the reconstructor output 122 as the best of the n candidate reconstructor outputs, e.g., the candidate reconstructor output that has a reconstructed query that is most similar to the query 102.
[0074] In some implementations, the reconstructor generative neural network 120 is one of multiple reconstructor generative neural networks. In some examples, each of the multiple reconstructor generative neural networks can be configured to generate reconstructor outputs for different types of queries, e.g., arithmetic, logical reasoning, etc. For example, each of the reconstructor generative neural networks can have been trained, e.g., fine-tuned, for a different type of query. Thus each reconstructor generative neural network can be specialized for a different type of query. In some cases, each reconstructor generative neural network can generate reconstructor outputs of higher quality for the type of query.
[0075] In some examples, the system can select the reconstructor generative neural network 120 from the multiple reconstructor generative neural networks based on the query 102. In some examples, the system can use a query classifier to classify the query 102 as one of K pre-defined categories, e.g., types of queries. The system can assign the query 102 to the reconstructor generative neural network 120 associated with the category. Each of the reconstructor generative neural networks can be associated with a different category of the K pre-defined categories. As an example, a reconstructor generative neural network that is specialized for a sport-related query can be associated with the sport category.
[0076] In some examples, the multiple reconstructor generative neural networks can be part of a mixture of experts (MoE) system. For example, the system can be trained to route the query 102 during training of the system, e.g., of the task generative neural networks, the reconstructor generative neural networks, or both.
[0077] The system can process the reconstructor input 118 using the selected reconstructor generative neural network 120. The system can thus use specialized reconstructor generative neural networks to generate high quality reconstructor outputs.
[0078] In some implementations, each of the specialized reconstructor generative neural networks can be a smaller neural network than a single reconstructor generative neural network that generates reconstructor outputs for multiple types of queries. By processing the reconstructor input 118 using a smaller neural network, the system can reduce the consumption of computing resources, e.g., computing time and power, compared to processing the reconstructor input 118 using a larger neural network.
[0079] In some examples, each of the multiple reconstructor generative neural networks can be configured to generate reconstructor outputs according to different reconstruction strategies. Each reconstruction strategy can provide a different perspective for generating an output given an input. Example reconstruction strategies can include design thinking, systems thinking, analytic reasoning, etc. In some examples, the system can include an instruction in the reconstructor input 118 that describes a particular reconstruction strategy to be applied for the reconstructor generative neural network. In some examples, each of the reconstructor generative neural networks can have been trained, e.g., fine-tuned, on training data that reflects a particular reconstruction strategy. For example, each training example can include a training input that includes at least a training response trajectory, and a target output that includes a reconstructed query trajectory according to a particular reconstruction strategy.
[0080] In some examples, the system can process the reconstructor input 118 using each of two or more of the multiple reconstructor generative neural networks. The system can thus generate a respective reconstructor outputs using each of the two or more reconstructor generative neural networks. The system can generate a combined reconstructor output using each respective reconstructor outputs.
[0081] The reconstructor generative neural network 120 is described in further detail below. In some examples, the reconstructor generative neural network 120 can be trained as described with reference to FIGS. 3-4.
[0082] The system 100 determines, from at least the query 102 and the reconstructed query 124, whether to select the intermediate response trajectory 112 as the final response trajectory. For example, the system can determine whether to select the intermediate response trajectory 112 as the final response trajectory based on the similarity between the query 102 and the reconstructed query 124. For example, the system 100 can determine whether the similarity between the query 102 and the reconstructed query 124 meets a threshold similarity. Examples of determining the similarity are described in further detail below with reference to FIG. 2.
[0083] In some examples, the system 100 can determine whether to select the intermediate response trajectory 112 as the final response trajectory based on whether there are any errors in the reconstructed query trajectory of the reconstructor output 122. For example, the system 100 can determine to select the intermediate response trajectory 112 as the final response trajectory in response to determining that there are no errors in the reconstructed query trajectory of the reconstructor output 122.
[0084] Thus, the system 100 can determine that the intermediate response trajectory 112 is accurate based on whether the reconstructor generative neural network 120 is able to reconstruct the query 102 from the intermediate response trajectory 112. The system 100 guides the task generative neural network 110 to generate response trajectories that include details that can be understood and reconstructed by another generative neural network. For example, by including details from the query 102 in the intermediate response trajectory 112 that can be understood by another generative neural network, the task generative neural network 110 can generate more accurate response trajectories.
[0085] If the system 100 determines to select the intermediate response trajectory 112 as the final response trajectory, the system 100 can generate the response 152 based on the final response trajectory.
[0086] If the system 100 determines not to select the intermediate response trajectory 112 as the final response trajectory, the system 100 generates an intermediate response trajectory 112 for a next iteration and a reconstructor output 122 for the next iteration.
[0087] At each iteration other than the first iteration, the system 100 can generate the intermediate response trajectory 112 for the iteration using the reconstructor output 122 for a previous iteration. For example, the system 100 can include one or more annotations generated using the reconstructor output 122 for the previous iteration in the task input 108 for the iteration. In these examples, the reconstructor output 122 for the preceding iteration can include a sequence of reasoning steps 126. Each annotation can describe an error in a reconstructor output 122 for the preceding iteration, e.g., in one or more of the reasoning steps of the reconstructor output 122 for the preceding iteration.
[0088] In some examples, the system can update the reconstructor output 122 for a previous iteration to include the sequence of reasoning steps 126. The system can generate the sequence of reasoning steps 126. For example, the system can provide the reconstructed query 124 for the previous iteration, the intermediate response trajectory 112 for the previous iteration, and an instruction to generate a response trajectory for generating the reconstructed query 124 from the intermediate response trajectory 112.
[0089] For example, the system 100 can generate the one or more annotations 132 using the task generative neural network 110. For example, the system 100 can process (i) the query 102, (ii) the intermediate response trajectory 112 for the preceding iteration, (iii) the reconstructor output 122 for the preceding iteration, and (iv)an instruction to identify one or more errors in the reconstructor output 122 using the task generative neural network 110 to generate the one or more annotations 132.
[0090] For each iteration, the system can include an instruction to generate a response trajectory for responding to the query 102 that addresses the one or more annotations 132 in the task input 108. The inclusion of the annotations 132 generated for a previous iteration in the task input 108 for the iteration can provide the task generative neural network 110 with context that allows the task generative neural network 110 to generate an improved intermediate response trajectory 112 for the iteration. The system 100 can thus iteratively improve the intermediate response trajectory 112 over the sequence of iterations.
[0091] The system 100 continues generating an intermediate response trajectory 112 for a next iteration and a reconstructor output 122 for the next iteration until the system 100 determines to select the intermediate response trajectory 112 as the final response trajectory.
[0092] The system 100 can generate the response 152 using the final response trajectory. In some examples, the response 152 can include the final response trajectory. In some examples, the response 152 can include data derived from the final response trajectory that is responsive to the query 102. For example, the system 100 can extract the response 152, “16 quarters,” from the final response trajectory.
[0093] In some examples, the system 100 can process the final response trajectory using a generative neural network, e.g., the task generative neural network 110, to generate the response 152. For example, the system can provide the final response trajectory and an instruction to summarize the final response trajectory, or an instruction to extract an answer for the query from the final response trajectory, as input to the generative neural network to generate the response 152.
[0094] As an example, for the query 102, the task generative neural network 110 can generate an intermediate response trajectory 112 for a first iteration that includes:
[0095] First find the total cost of the roses: 15 roses*$2 / rose=$30
[0096] Then subtract the cost of the roses from the amount Jenny paid with to find the total change: $50−$30=$20
[0097] Then multiply that number by 4 to find out how many quarters are in that amount: $20*4 quarters / $1=80 quarters
[0098] Answer: 80
[0099] In the above example intermediate response trajectory 112 for the first iteration, the intermediate response 114 is “80” and the steps listed prior to “Answer” are the reasoning steps for generating the intermediate response 114. For example, the reasoning steps include identifying relevant information, setting up expressions, and evaluating expressions.
[0100] In the example of FIG. 1B, the reconstructor generative neural network 120 can process a reconstructor input that includes at least the intermediate response trajectory 112 for the first iteration to generate a reconstructor output 122 that includes:
[0101] To reconstruct the original problem, I followed these logical steps:
[0102] 1. Identified the key elements:
[0103] Initial amount Jenny paid with: $50
[0104] Cost of roses: $30
[0105] Amount of change Jenny received: $20
[0106] Division of the change by 4 quarters per dollar
[0107] 2. Analyzed the operations performed:
[0108] Subtraction of $30 from $50 to find the change
[0109] Multiplication of the change by 4 to find the number of quarters
[0110] 3. Determined the context and missing information:
[0111] The problem should involve Jenny paying for roses and receiving change
[0112] The problem should include the number of quarters in the change
[0113] Based on these steps, I reconstructed the problem as follows:
[0114] Reasoning: Jenny paid $50 for roses and received $20 in change, which she then divided into quarters.
[0115] Reconstructed problem: Jenny paid $50 for roses. If she received $20 in change and divided it into quarters, how many quarters did she get?
[0116] In the above example reconstructor output 122 for the first iteration, “Jenny paid $50 for roses. If she received $20 in change and divided it into quarters, how many quarters did she get?” is the reconstructed query 124, and the steps listed other than the reconstructed query 124 are the reasoning steps 126. For example, the reasoning steps include identifying relevant information, analyzing operations performed, determining context, determining missing information for the query, and reconstructing the query.
[0117] The system 100 determines whether to select the intermediate response trajectory 112 for the first iteration as the final response trajectory. For example, the system 100 determines whether the reconstructed query 124 for the first iteration matches the query 102.
[0118] In the example of FIG. 1B, the system 100 can determine not to select the intermediate response trajectory 112 as the final response trajectory. For example, the system 100 can determine that the query 102 and the reconstructed query 124 for the first iteration are not similar, e.g., using an embedding distance, an edit distance, a semantic similarity, etc. Examples of determining whether the query 102 and the reconstructed query 124 are similar are described in further detail below with reference to FIG. 2.
[0119] In the example of FIG. 1B, the system 100 can determine that the query 102 and the reconstructed query 124 for the first iteration are not similar in response to processing the query 102 and the reconstructed query 124 using a generative neural network, e.g., the task generative neural network 110, and generating an output that identifies that the query 102 and the reconstructed query 124 are not similar. In response, the system 100 proceeds to the second iteration.
[0120] At the second iteration, the system 100 can generate the intermediate response trajectory 112 for the second iteration using the reconstructor output 122 for the first iteration. For example, the system 100 can generate the one or more annotations 132 using the task generative neural network 110.
[0121] In the example of FIG. 1B, the system 100 can generate the annotations 132 for the reconstructor output 122 for the first iteration:
[0122] The reconstructed problem skips some steps needed to find the solution. It assumes the total cost of roses and the amount of change are already known, which is not how the original problem is set up. It also lacks the context of buying roses individually and paying with five-dollar bills.
[0123] Correctness: false
[0124] The above example annotations 132 describe multiple errors in one or more of the reasoning steps of the reconstructor output 122 for the first iteration described above. For example, the annotations 132 describe that the reconstructor output 122 assumes that the total cost of roses is known (“Cost of roses: $30”), which is not given in query 102. As another example, the annotations 132 describe that the reconstructor output 122 assumes that the amount of change is known (“Amount of change Jenny received: $20”), which is not given in query 102. As another example, the annotations 132 describe that the reconstructor output 122 is missing context that is given in the query 102, such as buying roses individually and paying with five-dollar bills.
[0125] The system 100 can include the annotations 132 in the task input 108 for the second iteration.
[0126] The task generative neural network 110 can process the task input 108 for the second iteration to generate an intermediate response trajectory 112 for the second iteration that includes:
[0127] Since Jenny wants to buy 15 roses, a dozen would cost $15 and the remaining 3 would cost $6 (3 roses*$2 / rose). This is a total of $21.
[0128] Next, calculate the change she receives. She paid $25 (5 bills*$5 / bill) and the roses cost $21, so her change is $4.
[0129] Finally, since the florist only has quarters, we need to calculate how many quarters are in $4. There are 4 quarters in every dollar, so Jenny receives 16 quarters ($4*4 quarters / dollar).
[0130] In the above example intermediate response trajectory 112 for the second iteration, the intermediate response 114 is “16 quarters” and the steps listed other than the intermediate response 114 are the reasoning steps for generating the intermediate response 114. For example, the reasoning steps include identifying relevant information, setting up expressions, and evaluating expressions.
[0131] In the example of FIG. 1B, the reconstructor generative neural network 120 can process a reconstructor input that includes at least the intermediate response trajectory 112 for the second iteration to generate a reconstructor output 122 for the second iteration that includes:
[0132] To reconstruct the original problem, I followed these logical steps:
[0133] 1. Identified the key elements:
[0134] Number of roses Jenny wants to buy: 15
[0135] Price per rose: $2
[0136] Number of five-dollar bills Jenny paid with: 5
[0137] The florist only has quarters for change
[0138] 2. Analyzed the operations performed:
[0139] Calculation of the total cost of buying a dozen roses and the remaining roses separately
[0140] Calculation of the change Jenny receives after paying the florist
[0141] Multiply the change by 4 quarters per dollar
[0142] 3. Determined the context and missing information:
[0143] Jenny is buying roses from a florist
[0144] The problem involves comparing the cost of buying a dozen roses and the remaining roses separately to buying 15 individual roses
[0145] The florist only has quarters for change, so the problem revolves around calculating the number of quarters in the change
[0146] Based on these steps, I reconstructed the problem as follows:
[0147] Reasoning: Jenny wants to buy 15 roses at $2 each. She has $50 in five-dollar bills and is considering buying a dozen roses and the remaining roses separately. However, buying a dozen is cheaper. She pays with five-dollar bills and receives the change in quarters. How many quarters does she receive as change?
[0148] Reconstructed problem: Jenny wants to buy 15 roses at $2 each. She has $50 in five-dollar bills. If buying a dozen roses and the remaining roses separately is cheaper, how many quarters will she receive as change after paying for the roses?
[0149] In the above example reconstructor output 122 for the second iteration, “Jenny wants to buy 15 roses at $2 each. She has $50 in five-dollar bills. If buying a dozen roses and the remaining roses separately is cheaper, how many quarters will she receive as change after paying for the roses?” is the reconstructed query 124, and the steps other than the reconstructed query 124 are the reasoning steps 126. For example, the reasoning steps include identifying relevant information, analyzing operations performed, determining context, determining missing information, and reconstructing the query.
[0150] The system 100 determines whether to select the intermediate response trajectory 112 for the second iteration as the final response trajectory. For example, the system 100 determines whether the reconstructed query 124 matches the query 102.
[0151] In the example of FIG. 1B, the system 100 can determine to select the intermediate response trajectory 112 as the final response trajectory. For example, the system 100 determines that the reconstructed query 124 and the query 102 are similar. For example, the system 100 can process the reconstructed query 124 and the query 102 using a generative neural network, e.g., the task generative neural network 110, to generate an output that identifies whether the reconstructed query 124 and the query102 are similar. As a particular example, the output can include:
[0152] The reconstructed problem is correct. It accurately captures all the necessary information and the logical steps to solve the original problem.
[0153] The system generates the response 152, “16 quarters,” using the intermediate response trajectory 112 for the second iteration. For example, the system can process the intermediate response trajectory 112 for the second iteration, the query 102, and an instruction to extract a response for the query from the intermediate response trajectory 112 to generate the response 152.
[0154] The task generative neural network 110 and the reconstructor generative neural network 120 can have any appropriate architecture for generating an output responsive to an input. For example, the task generative neural network 110 and the reconstructor generative neural network 120 can each include a language model neural network or a visual language model neural network. Each language model neural network can have any of a variety of Transformer-based neural network architectures, e.g., encoder-only Transformer architectures, encoder-decoder Transformer architectures, decoder-only Transformer architectures, other attention-based architectures, and so on.
[0155] In general a Transformer-based architecture can be one which is characterized by having a succession of self-attention neural network layers. A self-attention neural network layer has an attention layer input for each element of the input and is configured to apply an attention mechanism over attention layer inputs to generate an attention layer output for each element of the input. There are many different attention mechanisms that may be used.
[0156] Examples of such architectures include those described in Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv: 1910.10683, 2019; Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv: 2005.14165, 2020; Aakanksha Chowdhery, et al. PaLM: Scaling Language Modeling with Pathways, arXiv preprint arXiv: 2204.02311; Rohan Anil, et al. Palm 2 technical report. arXiv preprint arXiv: 2305.10403, 2023,and Gemini Team, et al., Gemini: a family of highly capable multimodal models. arXiv preprint arXiv: 2312.11805, 2023.
[0157] Each language model neural network can be configured to generate output sequences made up of tokens from a vocabulary. In some examples, the vocabulary of tokens can include any of a variety of tokens that represent text symbols or other symbols. For example, the vocabulary of tokens can include one or more of characters, sub-words, words, punctuation marks, numbers, or other symbols that appear in a corpus of natural language text and / or computer code.
[0158] Additionally, or alternatively, the vocabulary of tokens can include tokens that can represent data other than text, such as images, videos, or audio. For example, the vocabulary of tokens can include image tokens that represent a discrete set of image patch embeddings of an image that can be generated by an image encoder neural network based on processing the image patches of the image. As another example, the vocabulary of tokens can include audio tokens that represent code vectors in a codebook of a quantizer, e.g., a residual vector quantizer.
[0159] As a particular example, each language model neural network can be an auto-regressive Transformer-based neural network that includes a plurality of layers that each apply a self-attention operation.
[0160] In particular, each language model neural network can be an auto-regressive neural network that auto-regressively generates the output sequence of tokens by generating each particular token in the output sequence conditioned on a current input sequence that includes (i) the input sequence followed by (ii) any tokens that precede the particular token in the output sequence.
[0161] More specifically, to generate a particular token, each language model neural network can process the current input sequence to generate a score distribution, e.g., a probability distribution, that assigns a respective score, e.g., a respective probability, to each token in the vocabulary of tokens. The language model neural network can then select, as the particular token, a token from the vocabulary using the score distribution. For example, the language model neural network can greedily select the highest-scoring token or can sample, e.g., using top-k sampling, nucleus sampling or another sampling technique, a token from the distribution.
[0162] Prior to being used for inference or being further trained as described in this specification, one or more of the generative neural networks can have been trained to determine trained values of parameters, e.g., as a baseline generative neural network. In some examples, the system 100 or the other system(s) trains the generative neural network on a next token prediction task, e.g., a task that requires predicting, given a current sequence of tokens, the next token that follows the current sequence in the training data. In some examples, the system 100 or the other system(s) trains the generative neural network on a task that requires, for each given unlabeled text sequence in a training data set, predicting a text sequence that followed the given unlabeled text sequence in a corresponding document. As a particular example, the generative neural network can be trained on a maximum-likelihood objective on a large dataset of text, e.g., text that is publicly available from the Internet or another text corpus.
[0163] In some examples, the system 100 further trains the task generative neural network 110, as described below with reference to FIGS. 3-4, after the generative neural network 110 is trained to determine trained values of parameters. In some examples, the system 100 further trains the reconstructor generative neural network 120 as described below with reference to FIGS. 3-4.
[0164] In some implementations, the reconstructor generative neural network 120 can be a smaller neural network, e.g., having a smaller number of parameters, than the task generative neural network 110, which can lead to improvements in computational efficiency as fewer computational resources are required to process inputs using a smaller neural network.
[0165] Furthermore, in some cases, a smaller neural network is less powerful than a larger neural network. If the intermediate response trajectory 112 is understandable such that a less powerful neural network can understand and reconstruct the query 102, the intermediate response trajectory 112 has a higher likelihood of being accurate compared to the intermediate response trajectory 112 being understandable to a larger neural network. For example, using a less powerful neural network as the reconstructor generative neural network 120 guides the task generative neural network 110 to generate response trajectories with more accurate or more detailed reasoning so that the less powerful neural network is more likely to be able to understand and reconstruct the query. As particular examples, the task generative neural network 110 can include a Gemini model (Gemini Team, et al., Gemini: a family of highly capable multimodal models. arXiv preprint arXiv:2312.11805, 2023), and the reconstructor generative neural network 120 can include a Gemma model (Gemma Team, et al., Gemma: Open Models Based on Gemini Research and Technology. arXiv preprint arXiv:2403:08295).
[0166] In some examples, a larger task generative neural network 110 can generate more accurate response trajectories than would be generated using a smaller neural network. The task generative neural network 110 can generate response trajectories that have a higher likelihood of being understood and reconstructed by the reconstructor generative neural network 120.
[0167] In some implementations, the reconstructor generative neural network 120 can be a larger neural network, e.g., having a larger number of parameters, than the task generative neural network 110. In some examples, the reconstructor generative neural network 120 can generate more accurate reconstructor outputs than would be generated using a smaller neural network.
[0168] In some implementations, the reconstructor generative neural network 120 can be a neural network of a similar size, e.g., having a similar number of parameters, as the task generative neural network 110.
[0169] In some implementations, the reconstructor generative neural network 120 can be the same neural network as the task generative neural network 110. In some examples, the reconstructor generative neural network 120 can be a prior checkpoint of the task generative neural network 110 or another instance of the task generative neural network 110. A prior checkpoint of the generative neural network 110 has trained values of parameters, e.g., for the baseline generative neural network 110, or at a previous training step than the current generative neural network 110.
[0170] FIG. 2 is a flow diagram of an example process 200 for generating a response to a query. For convenience, the process 200 will be described as being performed by a system of one or more computers located in one or more locations. For example, a system for generating responses, e.g., the system 100 of FIGS. 1A-1B, appropriately programmed, can perform the process 200.
[0171] The system receives a query (step 202). The query can include text that includes a question or an instruction to perform any of a variety of tasks. In some examples, the query can include input data such as audio data, image data, or video data, and text that includes a question or an instruction about the input data.
[0172] In some implementations, the system can receive the query from a user.
[0173] The system generates a final response trajectory for the query (step 204). The final response trajectory for the query includes (i) a response to the query and (ii) a sequence of reasoning steps for generating the response to the query.
[0174] To generate the final response trajectory for the query, the system performs the steps 206-212 at each iteration of a sequence of one or more iterations. For example, the system can perform the steps 206-212 at each iteration of a sequence of one or more iterations until a termination condition is met, e.g., until the system determines to select the intermediate response trajectory as the final response trajectory.
[0175] The system generates a respective task input for the iteration from the query (step 206). For example, the system can generate the respective task input for the iteration to include the query. In some examples, the system can generate the respective task input for the iteration to include an instruction to generate a response and a response trajectory for responding to the query.
[0176] In some examples, for each iteration after a first iteration of the sequence of iterations, the respective task input for the iteration can include one or more annotations. Each of the one or more annotations can describe an error in the reconstructor output, e.g., in one or more of the reasoning steps of the reconstructor output, for the preceding iteration. For example, the system can generate one or more annotations for the reconstructor output for the preceding iteration. The system can include the one or more annotations in the respective task input for the iteration.
[0177] In some examples, to generate the one or more annotations, the system can process (i) the query, (ii) the intermediate response trajectory for the preceding iteration, (iii) the reconstructor output for the preceding iteration, and (iv) an instruction to identify one or more errors in the reconstructor output using the task generative neural network. For example, the instruction can include to analyze the intermediate response trajectory for the preceding iteration, the query, and the reconstructor output for the preceding iteration to identify errors in the reconstructor output for the preceding iteration, or errors in the intermediate response trajectory for the preceding iteration that may have resulted in errors in the reconstructor output.
[0178] In these examples, for each iteration after a first iteration of the sequence of iterations, the respective task input for the iteration can include an instruction to generate a response trajectory for responding to the query that addresses the one or more annotations. In some examples, the system can include the intermediate response trajectory for the preceding iteration in the task input For example, the system can include an instruction in the task input to generate a response trajectory for responding to the query that addresses the one or more annotations. For example, the instruction can describe the one or more annotations as errors to be addressed when modifying the intermediate response trajectory for the preceding iteration.
[0179] The system generates an intermediate response trajectory for the query (step 208). The intermediate response trajectory includes (i) an intermediate response to the query and (ii) a sequence of reasoning steps for generating the intermediate response to the query.
[0180] For example, the system can process the respective task input using a task generative neural network to generate the intermediate response trajectory for the query. In some examples, the task generative neural network can have been trained to generate response trajectories as described below with reference to FIGS. 3-4.
[0181] In some examples, prior to performing step 210, the system updates the intermediate response trajectory for the query. In some cases, the response trajectory can include the query, allowing the reconstructor generative neural network to reconstruct the query directly. The system can determine whether the intermediate response trajectory contains more than a threshold amount of information about the query. In response to determining that the intermediate response trajectory contains more than a threshold amount of information, the system can generate a new intermediate response trajectory for the query using the task generative neural network. The system can use the new intermediate response trajectory as the intermediate response trajectory. The system can continue generating new intermediate response trajectories until the system determines that the intermediate response trajectory contains less than the threshold amount of information.
[0182] The system can determine whether the intermediate response trajectory contains more than the threshold amount of information in any appropriate manner. For example, the system can determine that the intermediate response trajectory contains more than the threshold amount of information if the length of the intermediate response trajectory is greater than the length of the query. As another example, the system can determine that the intermediate response trajectory contains more than the threshold amount of information if the intermediate response trajectory and the query meet a threshold similarity, e.g., based on edit distance, embedding distance, or Jaccard similarity. For example, the system can determine the similarity between the intermediate response trajectory and the query similarly to determining the similarity between the query and the reconstructed query as described below.
[0183] The system generates a reconstructor output (step 210). The reconstructor output includes at least a reconstructed query that is a prediction of the query. In some examples, the reconstructor output includes a sequence of reasoning steps for generating the reconstructed query.
[0184] For example, the system can process a reconstructor input that includes at least the intermediate response using a reconstructor generative neural network to generate the reconstructor output. In some examples, the reconstructor input can include at least the intermediate response trajectory. In some examples, the reconstructor generative neural network can have been trained to generate reconstructor outputs as described below with reference to FIG. 4.
[0185] In some examples, the reconstructor input can include an instruction to reconstruct the original query or the original problem statement for the intermediate response trajectory, e.g., given the intermediate response or the intermediate response trajectory. In some examples, the reconstructor input can include an instruction to generate a sequence of reasoning steps for reconstructing the original query. In some examples where the reconstructor input includes the intermediate response trajectory, the reconstructor input can include an instruction to generate a sequence of reasoning steps for reconstructing the original query according to the sequence of reasoning steps of the intermediate response trajectory.
[0186] In some examples, the reconstructor generative neural network is one of multiple reconstructor generative neural networks. In these examples, the system can select the reconstructor generative neural network to be used to process the reconstructor input from the multiple reconstructor generative neural networks. For example, each reconstructor generative neural network can have been trained to specialize for a different type of task. For example, each training example for a particular reconstructor generative neural network can include a training input that includes at least a training response trajectory for a particular type of task, and a target output that includes a reconstructor output for the type of task.
[0187] The system determines whether to select the intermediate response trajectory as the final response trajectory (step 212). For example, the system can determine whether to select the intermediate response trajectory as the final response trajectory from at least the query and the reconstructed query.
[0188] In some examples, the system can determine whether to select the intermediate response trajectory as the final response trajectory based on whether the query and the reconstructed query are similar. In some examples, the system can process the query and the reconstructed query using a generative neural network, e.g., using the task generative neural network, to generate an output that identifies whether the query and the reconstructed query are similar. For example, the system can provide the query, the reconstructed query, and an instruction to determine whether the query and the reconstructed query are semantically similar as input to the task generative neural network. The system can determine that the query and the reconstructed query are similar if the output identifies that the query and the reconstructed query are similar.
[0189] In some examples, the system can process the query and the reconstructed query to determine a similarity between the query and the reconstructed query. The system can determine to select the intermediate response trajectory based on whether the similarity meets a threshold similarity. For example, in response to determining that the similarity meets the threshold similarity, the system can determine to select the intermediate response trajectory as the final response trajectory. In response to determining that the similarity does not meet the threshold similarity, the system can determine to not select the intermediate response trajectory as the final response trajectory.
[0190] The system can determine the similarity between the query and the reconstructed query in any appropriate manner. For example, the system can determine the similarity based on any one or more of embedding distance, edit distance, or Jaccard similarity.
[0191] In some examples, the system can determine the similarity based on embedding distance. For example, the system can process the query using an embedding model to generate a query embedding. The system can process the reconstructed query using the embedding model to generate a reconstructed query embedding. The system can determine a distance between the query embedding and the reconstructed query embedding. The system can determine the similarity based on the distance between the query embedding and the reconstructed query embedding. An example suitable embedding model includes a BERT model. An embedding refers to an ordered collection of numerical values, e.g., a vector, matrix, or other tensor of numerical values.
[0192] In some examples, the system can determine the similarity by determining an edit distance between the query and the reconstructed query, e.g., a Levenshtein distance, that measures a number of operations needed to transform the query into the reconstructed query. Operations can include, e.g., deletion, insertion, or replacement, of a character.
[0193] In some examples, the system can determine whether to select the intermediate response trajectory as the final response trajectory from the query and the reconstructed query of multiple reconstructor outputs. For example, the reconstructor generative neural network can be one of multiple reconstructor generative neural networks. The system can process the reconstructor input using each of two or more of the multiple reconstructor generative neural networks to generate a respective reconstructor output. The system can determine whether to select the intermediate response trajectory as the final response trajectory from the query and the reconstructed query of each respective reconstructor output.
[0194] For example, the system can generate a combined reconstructor output using each respective reconstructor output. The combined reconstructor output can include a combined reconstructed query that is a prediction of the query. In some examples, the combined reconstructor output can include a sequence of reasoning steps for generating the combined reconstructed query from the intermediate response trajectory. For example, the system can generate the combined reconstructor output by processing the respective reconstructor outputs and an instruction to combine the reconstructor output using a generative neural network, e.g., one of the reconstructor generative neural networks or another generative neural network. The system can determine whether to select the intermediate response trajectory based on the combined reconstructor output. For example, the system can process the query and the combined reconstructed query of the combined reconstructor output to determine a similarity between the query and the combined reconstructed query as described above.
[0195] Alternatively or in addition, the system can determine whether to select the intermediate response trajectory as the final response trajectory based on whether any errors are present in the reconstructed query trajectory of the reconstructor output. The system can determine whether the reconstructed query trajectory includes one or more errors by processing at least the reconstructed query trajectory using a generative neural network, e.g., the task generative neural network. For example, the system can process (i) the query, (ii) the intermediate response trajectory, (iii) the reconstructed query trajectory, and (iv) an instruction to identify any errors in the reconstructed query trajectory using the task generative neural network. The output can include, for example, one or more annotations that describe an error in one or more of the reasoning steps of the reconstructed query trajectory. In some examples, the system can use the one or more annotations of the output for the next iteration, e.g., as the one or more annotations that describe errors in one or more of the reasoning steps of the reconstructed query trajectory for the preceding iteration. The system can determine to select the intermediate response trajectory as the final response trajectory in response to determining that there are no errors in the reconstructed query trajectory of the reconstructor output based on the output. The system can determine not to select the intermediate response trajectory as the final response trajectory in response to determining that there are one or more errors in the reconstructed query trajectory of the reconstructor output based on the output.
[0196] In some examples, the system can determine whether to select the intermediate response trajectory as the final response trajectory based on the similarity between the reconstructed query and the query, and based on whether any errors are present in the reconstructed query trajectory, using a single call to the task generative neural network. For example, the system can provide the query, the intermediate response trajectory, the reconstructor output, and an instruction to determine whether the query and the reconstructed query of the reconstructor output are semantically similar as input to the task generative neural network. The instruction can include to identify any errors in the reconstructed query trajectory. In some examples, the system can further generate the one or more annotations for the next iteration using the single call. For example, the system can use the one or more annotations generated using the single call during the next iteration as the annotations that describe an error in one or more of the reasoning steps of the reconstructed query trajectory for the preceding iteration.
[0197] Alternatively or in addition, the system can determine whether to select the intermediate response trajectory as the final response trajectory based on the number of iterations in the sequence of iterations. In some examples, if the system does not determine to select the intermediate response trajectory as the final response trajectory based on the similarity between the query and the reconstructed query, the system can determine whether to select the intermediate response trajectory as the final response trajectory based on the number of iterations in the sequence of iterations. For example, if the number of iterations meets a threshold number of iterations, the system can determine to select the intermediate response trajectory as the final response trajectory. If the number of iterations does not meet the threshold number of iterations, the system can determine not to select the intermediate response trajectory as the final response trajectory.
[0198] If the system does not determine to select the intermediate response trajectory as the final response trajectory, the system proceeds to perform steps 206-212 for a next iteration.
[0199] If the system determines to select the intermediate response trajectory for the iteration as the final response trajectory, the system generates a response for the query based on the final response trajectory (step 214).
[0200] In some examples, the response for the query can include the final response trajectory. In some examples, the response for the query can include the intermediate response of the final response trajectory, one or more reasoning steps of the final response trajectory, or both. In some examples, the system can process the final response trajectory to generate the response, e.g., use a generative neural network to extract the response from the final response trajectory. For example, the system can process the final response trajectory, the query, and an instruction to extract a response for the query from the final response trajectory to generate the response. In some examples, the system can process the final response trajectory according to a specified mapping that maps outputs of final response trajectories to natural language or structured responses. In some examples, the system can provide the final response trajectory and an instruction to summarize the final response trajectory, or an instruction to extract an answer for the query from the final response trajectory, as input to the generative neural network to generate the response.
[0201] FIG. 3 shows an example neural network training system 300. The system 300 is an example of a system implemented as computer programs on one or more computers in one or more locations in which the systems, components, and techniques described below are implemented.
[0202] The training system 300 is a system that trains neural networks such as the task generative neural network 110, the reconstructor generative neural network 120, and in some examples, the verifier neural network 330.
[0203] The task generative neural network 110 and the reconstructor generative neural network 120 can have been trained on a next token prediction task as described above with reference to FIG. 1B. The system 300 can further train, e.g., fine-tune, the task generative neural network 110, the reconstructor generative neural network 120, or both.
[0204] In some examples, the system 300 updates all parameters of the task generative neural network 110, the reconstructor generative neural network 120, or both. In some examples, the system 300 updates some of the parameters of the task generative neural network 110, the reconstructor generative neural network 120, or both.
[0205] To train the task generative neural network 110, the reconstructor generative neural network 120, or both, the system 300 obtains a training example that includes a training query 302 and a target response 304 for the training query 302. In some examples, the system 300 can obtain the training query 302 and the target response 304 from a labeled training dataset, e.g., a question-answer dataset.
[0206] The system 300 processes the training query 302 using the task generative neural network 110 in accordance with current values of parameters of the task generative neural network 110 to generate the intermediate response trajectory 312. The system 300 generates a response 352 for the training query 302 using the final response trajectory as described above with reference to FIGS. 1-2.
[0207] In some examples, the system 300 updates the intermediate response trajectory 312 prior to processing the intermediate response trajectory 312 using the reconstructor generative neural network 120 to generate the reconstructor output 322. For example, the system can update the intermediate response trajectory 312 to contain less information about the training query 302.
[0208] In some examples, the system 300 can determine whether intermediate response trajectory 312 contains more than the threshold amount of information about the training query 302. In response, the system can update the intermediate response trajectory 312 as described below with reference to FIGS. 4-5.
[0209] In some examples, the system can determine that the intermediate response trajectory 312 contains more than the threshold amount of information using a verifier neural network 330. The verifier neural network 330 is configured to generate a verifier output identifying whether the intermediate response trajectory 312 contains more than a threshold amount of information about the training query 302.
[0210] The verifier neural network 330 can have any appropriate architecture for generating the verifier output. For example, the verifier neural network 330 can include a language model neural network or a visual language model neural network as described above with reference to FIG. 1. Training the verifier neural network is described in further detail below with reference to FIG. 5.
[0211] The system 300 uses the training engine 340 to train the task generative neural network 110, reconstructor generative neural network 120, or both, based on at least the response 352 and the target response 304. In some examples, the system can further train the task generative neural network 110, the reconstructor generative neural network 120, or both, using reinforcement learning. For example, the training engine 340 can train the task generative neural network, reconstructor generative neural network 120, or both, to optimize a respective loss function that is based on a reward. In some examples, the reward measures whether the response 352 is similar to the target response 304.
[0212] For example, the training engine 340 updates the values for the task generative neural network 110, the reconstructor generative neural network 120, or both, using a machine learning training technique, e.g., a gradient descent with backpropagation training technique that uses a suitable optimizer, e.g., stochastic gradient descent, RMSprop, Adam optimizer, or Adafactor optimizer, to optimize the respective loss function.
[0213] The training engine 340 can then determine, based on computing the gradients of the loss function with respect to the parameters of the task generative neural network 110 or the reconstructor generative neural network 120, one or more updates to the values of the parameters of the task generative neural network 110 or the reconstructor generative neural network 120. In some examples, the training engine 340 can determine updates to the values of the parameters of the task generative neural network 110 or the reconstructor generative neural network 120 for multiple training examples.
[0214] Training the task generative neural network 110, the reconstructor generative neural network 120, or both, is described in further detail below with reference to FIG. 4.
[0215] FIG. 4 is a flow diagram of an example process 400 for training a generative neural network. For convenience, the process 400 will be described as being performed by a system of one or more computers located in one or more locations. For example, a system for training neural networks, e.g., the system 300 of FIG. 3, appropriately programmed, can perform the process 400. The system can perform the process 400 to train a generative neural network such as the task generative neural network, the reconstructor generative neural network, or both.
[0216] The system obtains multiple training examples (step 402). Each training example can include a training query and a target response for the training query.
[0217] The system trains a task generative neural network using the training examples. The system performs the steps 404-414 for each training example.
[0218] The system generates a final response trajectory for the training query (step 404).
[0219] To generate the final response trajectory for the training query, the system performs the steps 406-412 at each iteration of a sequence of one or more iterations. For example, the system can perform the steps 406-412 at each iteration of a sequence of one or more iterations until a termination condition is met, e.g., until the system determines to select the intermediate response trajectory for the iteration as the final response trajectory. The steps 406-412 are similar to the steps 206-212 described above for generating a final response trajectory for a query.
[0220] The system generates a respective task input for the iteration from the training query (step 406). For example, the system can generate the respective task input for the iteration to include the training query. In some examples, the system can generate the respective task input for the iteration to include an instruction to generate a response trajectory for responding to the training query.
[0221] In some examples, for each iteration after a first iteration of the sequence of iterations, the respective task input for the iteration can include one or more annotations. A similar process for generating the respective task input for the iteration is described in further detail above with reference to FIG. 2.
[0222] The system generates an intermediate response trajectory for the training query (step 408). The intermediate response trajectory includes (i) a response to the training query and (ii) a sequence of reasoning steps for generating the response to the training query.
[0223] For example, the system can process the respective task input using a task generative neural network to generate the intermediate response trajectory for the training query.
[0224] In some examples, the system updates the intermediate response trajectory for the training query prior to performing step 410. In some cases, the response trajectory can include the query, allowing the reconstructor generative neural network to reconstruct the query directly. The system can determine whether the intermediate response trajectory contains more than a threshold amount of information.
[0225] In some examples, the system can determine that the intermediate response trajectory contains more than a threshold amount of information if the length of the intermediate response trajectory is greater than the length of the training query. In some examples, the system can determine that the intermediate response trajectory contains more than a threshold amount of information if the intermediate response trajectory and the training query meet a threshold similarity, e.g., based on edit distance, Jaccard similarity, or embedding distance. In some examples, the system can determine that the intermediate response trajectory contains more than a threshold amount of information if a verifier neural network generates an output identifying whether the intermediate response trajectory contains more than a threshold amount of information.
[0226] In response to determining that the intermediate response trajectory contains more than the threshold amount of information, the system can update the intermediate response trajectory. For example, the system can generate a new intermediate response trajectory for the training query by performing step 408 with adjusted sampling parameters. The system can use the new intermediate response trajectory as the intermediate response trajectory. The system can continue performing step 408 until the system determines that the intermediate response trajectory contains less than the threshold amount of information.
[0227] In some examples, the system can update the intermediate response trajectory at each of one or more verifier iterations based on the verifier output, as described below with reference to FIG. 5.
[0228] The system generates a reconstructor output (step 410). The reconstructor output includes at least a reconstructed query that is a prediction of the training query. In some examples, the reconstructor output includes a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response.
[0229] For example, the system can process a reconstructor input that includes at least the intermediate response using a reconstructor generative neural network to generate the reconstructor output. In some examples, the reconstructor input can include at least the intermediate response trajectory. A similar process for generating the reconstructor output for the iteration is described in further detail above with reference to FIG. 2.
[0230] In some examples, the reconstructor generative neural network is one of multiple reconstructor generative neural networks. In these examples, the system can select the reconstructor generative neural network to be used to process the reconstructor input from the multiple reconstructor generative neural networks as described above with reference to FIG. 2.
[0231] The system determines whether to select the intermediate response trajectory as the final response trajectory (step 412). For example, the system can determine whether to select the intermediate response trajectory as the final response trajectory from at least the training query and the reconstructed query.
[0232] The system can determine whether to select the intermediate response trajectory as the final response trajectory similarly to step 212 of FIG. 2. For example, the system can determine whether to select the intermediate response trajectory as the final response trajectory based on whether the query and the reconstructed query are similar, the number of iterations in the sequence of iterations, or both. For example, the system can determine whether a number of iterations in the sequence of iterations meets a threshold number of iterations. The system can determine to select the intermediate response trajectory as the final response trajectory in response to determining that the number of iterations in the sequence of iterations meets the threshold number of iterations.
[0233] In some examples, the system can determine whether to select the intermediate response trajectory as the final response trajectory from the training query and the reconstructed query of multiple reconstructor outputs, as described in more detail above with reference to FIG. 2.
[0234] If the system does not determine to select the intermediate response trajectory as the final response trajectory, the system proceeds to perform steps 406-412 for a next iteration.
[0235] If the system determines to select the intermediate response trajectory for the iteration as the final response trajectory, the system generates a response for the training query based on the final response trajectory (step 414). The system can generate the response based on the final response trajectory as described above with reference to FIG. 2. In some examples, the response can include the intermediate response of the final response trajectory.
[0236] The system trains the task generative neural network based on at least the response and the target response (step 416).
[0237] For example, the system can train the task generative neural network to optimize a loss function that is based on a reward that measures whether the response is similar to the target response, and whether the reconstructed query is similar to the training query. For example, the reward can be 1 when the task generative neural network successfully responds to the training query and when the reconstructor generative neural network successfully reconstructs the training query. As another example, the reward can be 0 if the task generative neural network does not successfully respond to the training query, or the reconstructor generative neural network does not successfully reconstruct the training query, or both.
[0238] In some examples, the reward can measure whether the response is similar to the target response, and whether the reconstructed query is similar to the training query, within a target number of iterations N. For example, the reward can be 1 when the task generative neural network successfully responds to the training query and when the reconstructor generative neural network successfully reconstructs the training query within N iterations. As another example, the reward can be 0 if the task generative neural network does not successfully respond to the training query, or the reconstructor generative neural network does not successfully reconstruct the training query, or both, within N iterations.
[0239] In some examples, the reward can be a variable reward that measures how similar the response is to the target response, or how similar the reconstructed query is to the training query, or both.
[0240] In some examples where the response includes the intermediate response of the final response trajectory, the reward can further measure whether a final response is similar to the target response. For example, the system can further process the final response trajectory to generate the final response as described above with reference to FIG. 2. In some examples, the reward can measure how similar the final response is to the target response.
[0241] In some examples, the reward can be normalized by the target number of iterations N. The system can thus encourage the task generative neural network to successfully respond to queries in fewer iterations, reducing computing time and the amount of computing resources that would otherwise be required for a larger number of iterations.
[0242] In some examples, the system can encourage the task generative neural network to generate an accurate response for the training query. In some examples, the loss function can further be based on an error (e.g., cross-entropy loss) between tokens of the target response and a final response generated based on the final response trajectory. In some examples, the loss function can further be based on a similarity between the intermediate response of the final response trajectory and the target response. For example, the similarity can be a semantic similarity, e.g., computed as an embedding cosine similarity of vectors representing the intermediate response and the target response. For example, the system can generate the vectors using a BERT model.
[0243] In some implementations, the system can train the reconstructor generative neural network. In some examples, the system can train the reconstructor generative neural network together with the task generative neural network. In some examples, the system can alternate training the task generative neural network and the reconstructor generative neural network for different training examples.
[0244] In some examples, the system can train the reconstructor generative neural network to optimize a reconstructor loss function that is based on the reward. The system can thus encourage the reconstructor generative neural network to successfully reconstruct the training query.
[0245] In some examples where the reconstructor output includes a sequence of reasoning steps, the reconstructor loss function can further be based on a similarity (e.g., edit distance, embedding distance, or Jaccard similarity) between the sequence of reasoning steps of the reconstructor output and the sequence of reasoning steps of the intermediate response trajectory. The system can thus encourage the reconstructor generative neural network to successfully reconstruct the sequence of reasoning steps of the intermediate response trajectory.
[0246] In some examples, the system can determine a combined similarity between the reasoning steps of the reconstructor output and the reasoning steps of the intermediate response trajectory. In some examples, the system can determine the similarity between each reasoning step of the reconstructor output and each reasoning step of the intermediate response trajectory. In some examples, the system can determine the similarity between each reasoning step of the reconstructor output and the intermediate response trajectory at intervals, e.g., every other step, every two steps, etc.
[0247] In some examples, the system can determine the similarity between each reasoning step based on a measure of difficulty for the query. For example, the measure of difficulty can be based on the length of the query, the type of query, the length of the intermediate response trajectory, the number of steps in the sequence of reasoning steps of the intermediate response trajectory, etc.
[0248] FIG. 5 is a flow diagram of an example process 500 for processing a response trajectory using a verifier neural network. For convenience, the process 500 will be described as being performed by a system of one or more computers located in one or more locations. For example, a system for training neural networks, e.g., the system 300 of FIG. 3, appropriately programmed, can perform the process 500.
[0249] The system can perform the process 500 prior to processing a reconstructor input using a reconstructor generative neural network as described above with reference to step 412 of FIG. 4, at each iteration of the sequence of one or more iterations, and for each training example.
[0250] The system generates a verifier output for the intermediate response trajectory (step 502). The verifier output identifies whether the intermediate response trajectory contains more than a threshold amount of information about the training query. In some examples, the verifier output can include feedback about the information about the training query contained in the intermediate response trajectory.
[0251] For example, the system can process at least the intermediate response trajectory using a verifier neural network to generate the verifier output. As a particular example, the verifier neural network can include a language model neural network. The system can provide the intermediate response trajectory, the query, and an instruction to determine whether the intermediate response trajectory reveals the query directly. In some examples, the instruction can include to generate feedback about the information about the training query contained in the intermediate response trajectory.
[0252] The system determines whether the intermediate response trajectory contains more than a threshold amount of information based on the verifier output (step 504).
[0253] In response to determining that the intermediate response trajectory does not contain more than a threshold amount of information, the system proceeds to perform step 410 of FIG. 4.
[0254] In response to determining that the intermediate response trajectory contains more than a threshold amount of information, the system performs the steps 506-510 at each of one or more verifier iterations to update the intermediate response trajectory.
[0255] The system generates a respective input for the verifier iteration (step 506).
[0256] At the first verifier iteration, the system can generate the respective input for the verifier iteration to include (i) the intermediate response trajectory, (ii) the verifier output, and (iii) an instruction to modify the intermediate response trajectory according to the verifier output. For example, the instruction can include to modify the intermediate response trajectory according to the feedback of the verifier output.
[0257] At each verifier iteration after the first verifier iteration, the system can generate the respective input for the verifier iteration to include i) the candidate intermediate response trajectory for a preceding iteration, (ii) the verifier output, and (iii) an instruction to modify the candidate intermediate response trajectory according to the verifier output. For example, the instruction can include to modify the intermediate response trajectory according to the feedback of the verifier output.
[0258] The system generates a candidate intermediate response trajectory for the training query (step 508). For example, the system can process the respective input using the task generative neural network to generate the candidate intermediate response trajectory.
[0259] The system determines whether to update the intermediate response trajectory to include the candidate intermediate response trajectory (step 510). For example, the system can determine whether to update the intermediate response trajectory from the training query and the candidate intermediate response trajectory.
[0260] The system can determine to update the intermediate response trajectory using the verifier neural network. For example, the system can process at least the candidate intermediate response trajectory using the verifier neural network to generate a candidate verifier output. The system can determine to update the intermediate response trajectory in response to determining that the candidate intermediate response trajectory contains less than the threshold amount of information.
[0261] In response to determining to update the intermediate response trajectory, the system can update the intermediate response trajectory to include the candidate intermediate response trajectory (step 512). For example, the system can replace the intermediate response trajectory with the candidate intermediate response trajectory. The system can proceed to perform step 412 described above with reference to FIG. 4.
[0262] In response to determining not to update the intermediate response trajectory, the system can proceed to a next verifier iteration. For example, the system can proceed to perform steps 506-510 for the next verifier iteration.
[0263] In some implementations, the verifier neural network can have been trained to generate a verifier output on training data that includes a training input that includes a query and a response trajectory for the query, and a target output that identifies whether the response trajectory contains more than a threshold amount of information about the query. In some examples, the training data can include negative training examples. For example, the system can generate a negative training example by generating a response trajectory for the training input that includes the query.
[0264] In some examples, the verifier neural network can include a classifier. In some examples, the verifier neural network can include a language model neural network. For example, the system can train the verifier neural network to optimize an objective function that, for each training example, measures a difference between (i) the output specified by the training example and (ii) the output generated by the verifier neural network for the training input specified by the training example. For example, the objective function can be a cross-entropy objective function. As a particular example, the cross-entropy objective function can be a combination, e.g., sum or average, of cross-entropy losses between the tokens in (i) the output specified by the training example and (ii) the output generated by the verifier neural network for the training input specified by the training example.
[0265] In some implementations, the verifier neural network can have been trained prior to training the task generative neural network, the reconstructor generative neural network, or both. For example, the parameters of the verifier neural network can be held fixed during training of the task generative neural network, the reconstructor generative neural network, or both.
[0266] In some implementations, the system can alternate training the task generative neural network, the reconstructor generative neural network, and the verifier neural network. For example, the system can hold the task generative neural network and the reconstructor generative neural network fixed while training the verifier neural network for one or more iterations. For one or more other iterations, the system can hold the verifier neural network fixed while training the task generative neural network and the reconstructor generative neural network.
[0267] In this specification, the term “configured” is used in relation to computing systems and environments, as well as computer program components. A computing system or environment is considered “configured” to perform specific operations or actions when it possesses the necessary software, firmware, hardware, or a combination thereof, enabling it to carry out those operations or actions during operation. For instance, configuring a system might involve installing a software library with specific algorithms, updating firmware with new instructions for handling data, or adding a hardware component for enhanced processing capabilities. Similarly, one or more computer programs are “configured” to perform particular operations or actions when they contain instructions that, upon execution by a computing device or hardware, cause the device to perform those intended operations or actions.
[0268] The embodiments and functional operations described in this specification can be implemented in various forms, including digital electronic circuitry, software, firmware, computer hardware (encompassing the disclosed structures and their structural equivalents), or any combination thereof. The subject matter can be realized as one or more computer programs, essentially modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by or to control the operation of a computing device or hardware. The storage medium can be a storage device such as a hard drive or solid-state drive (SSD), a storage medium, a random or serial access memory device, or a combination of these. Additionally or alternatively, the program instructions can be encoded on a transmitted signal, such as a machine-generated electrical, optical, or electromagnetic signal, designed to carry information for transmission to a receiving device or system for execution by a computing device or hardware. Furthermore, implementations may leverage emerging technologies like quantum computing or neuromorphic computing for specific applications, and may be deployed in distributed or cloud-based environments where components reside on different machines or within a cloud infrastructure.
[0269] The term “computing device or hardware” refers to the physical components involved in data processing and encompasses all types of devices and machines used for this purpose. Examples include processors or processing units, computers, multiple processors or computers working together, graphics processing units (GPUs), tensor processing units (TPUs), and specialized processing hardware such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs). In addition to hardware, a computing device or hardware may also include code that creates an execution environment for computer programs. This code can take the form of processor firmware, a protocol stack, a database management system, an operating system, or a combination of these elements. Embodiments may particularly benefit from utilizing the parallel processing capabilities of GPUs, in a General-Purpose computing on Graphics Processing Units (GPGPU) context, where code specifically designed for GPU execution, often called kernels or shaders, is employed. Similarly, TPUs excel at running optimized tensor operations crucial for many machine learning algorithms. By leveraging these accelerators and their specialized programming models, the system can achieve significant speedups and efficiency gains for tasks involving artificial intelligence and machine learning, particularly in areas such as computer vision, natural language processing, and robotics.
[0270] A computer program, also referred to as software, an application, a module, a script, code, or simply a program, can be written in any programming language, including compiled or interpreted languages, and declarative or procedural languages. It can be deployed in various forms, such as a standalone program, a module, a component, a subroutine, or any other unit suitable for use within a computing environment. A program may or may not correspond to a single file in a file system and can be stored in various ways. This includes being embedded within a file containing other programs or data (e.g., scripts within a markup language document), residing in a dedicated file, or distributed across multiple coordinated files (e.g., files storing modules, subprograms, or code segments). A computer program can be executed on a single computer or across multiple computers, whether located at a single site or distributed across multiple sites and interconnected through a data communication network. The specific implementation of the computer programs may involve a combination of traditional programming languages and specialized languages or libraries designed for GPGPU programming or TPU utilization, depending on the chosen hardware platform and desired performance characteristics.
[0271] In this specification, the term “engine” broadly refers to a software-based system, subsystem, or process designed to perform one or more specific functions. An engine is typically implemented as one or more software modules or components installed on one or more computers, which can be located at a single site or distributed across multiple locations. In some instances, one or more dedicated computers may be used for a particular engine, while in other cases, multiple engines may operate concurrently on the same one or more computers. Examples of engine functions within the context of AI and machine learning could include data pre-processing and cleaning, feature engineering and extraction, model training and optimization, inference and prediction generation, and post-processing of results. The specific design and implementation of engines will depend on the overall architecture and the distribution of computational tasks across various hardware components, including CPUs, GPUs, TPUs, and other specialized processors.
[0272] The processes and logic flows described in this specification can be executed by one or more programmable computers running one or more computer programs to perform functions by operating on input data and generating output. Additionally, graphics processing units (GPUs) and tensor processing units (TPUs) can be utilized to enable concurrent execution of aspects of these processes and logic flows, significantly accelerating performance. This approach offers significant advantages for computationally intensive tasks often found in AI and machine learning applications, such as matrix multiplications, convolutions, and other operations that exhibit a high degree of parallelism. By leveraging the parallel processing capabilities of GPUs and TPUs, significant speedups and efficiency gains compared to relying solely on CPUs can be achieved. Alternatively or in combination with programmable computers and specialized processors, these processes and logic flows can also be implemented using specialized processing hardware, such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), for even greater performance or energy efficiency in specific use cases.
[0273] Computers capable of executing a computer program can be based on general-purpose microprocessors, special-purpose microprocessors, or a combination of both. They can also utilize any other type of central processing unit (CPU). Additionally, graphics processing units (GPUs), tensor processing units (TPUs), and other machine learning accelerators can be employed to enhance performance, particularly for tasks involving artificial intelligence and machine learning. These accelerators often work in conjunction with CPUs, handling specialized computations while the CPU manages overall system operations and other tasks. Typically, a CPU receives instructions and data from read-only memory (ROM), random access memory (RAM), or both. The elements of a computer include a CPU for executing instructions and one or more memory devices for storing instructions and data. The specific configuration of processing units and memory will depend on factors like the complexity of the AI model, the volume of data being processed, and the desired performance and latency requirements. Embodiments can be implemented on a wide range of computing platforms, from small embedded devices with limited resources to large-scale data center systems with high-performance computing capabilities. The system may include storage devices like hard drives, SSDs, or flash memory for persistent data storage.
[0274] Computer-readable media suitable for storing computer program instructions and data encompass all forms of non-volatile memory, media, and memory devices. Examples include semiconductor memory devices such as read-only memory (ROM), solid-state drives (SSDs), and flash memory devices; hard disk drives (HDDs); optical media; and optical discs such as CDs, DVDs, and Blu-ray discs. The specific type of computer-readable media used will depend on factors such as the size of the data, access speed requirements, cost considerations, and the desired level of portability or permanence.
[0275] To facilitate user interaction, embodiments of the subject matter described in this specification can be implemented on a computing device equipped with a display device, such as a liquid crystal display (LCD) or an organic light-emitting diode (OLED) display, for presenting information to the user. Input can be provided by the user through various means, including a keyboard), touchscreens, voice commands, gesture recognition, or other input modalities depending on the specific device and application. Additional input methods can include acoustic, speech, or tactile input, while feedback to the user can take the form of visual, auditory, or tactile feedback. Furthermore, computers can interact with users by exchanging documents with a user's device or application. This can involve sending web content or data in response to requests or sending and receiving text messages or other forms of messages through mobile devices or messaging platforms. The selection of input and output modalities will depend on the specific application and the desired form of user interaction.
[0276] Machine learning models can be implemented and deployed using machine learning frameworks, such as TensorFlow or JAX. These frameworks offer comprehensive tools and libraries that facilitate the development, training, and deployment of machine learning models.
[0277] Embodiments of the subject matter described in this specification can be implemented within a computing system comprising one or more components, depending on the specific application and requirements. These may include a back-end component, such as a back-end server or cloud-based infrastructure; an optional middleware component, such as a middleware server or application programming interface (API), to facilitate communication and data exchange; and a front-end component, such as a client device with a user interface, a web browser, or an app, through which a user can interact with the implemented subject matter. For instance, the described functionality could be implemented solely on a client device (e.g., for on-device machine learning) or deployed as a combination of front-end and back-end components for more complex applications. These components, when present, can be interconnected using any form or medium of digital data communication, such as a communication network like a local area network (LAN) or a wide area network (WAN) including the Internet. The specific system architecture and choice of components will depend on factors such as the scale of the application, the need for real-time processing, data security requirements, and the desired user experience.
[0278] The computing system can include clients and servers that may be geographically separated and interact through a communication network. The specific type of network, such as a local area network (LAN), a wide area network (WAN), or the Internet, will depend on the reach and scale of the application. The client-server relationship is established through computer programs running on the respective computers and designed to communicate with each other using appropriate protocols. These protocols may include HTTP, TCP / IP, or other specialized protocols depending on the nature of the data being exchanged and the security requirements of the system. In certain embodiments, a server transmits data or instructions to a user's device, such as a computer, smartphone, or tablet, acting as a client. The client device can then process the received information, display results to the user, and potentially send data or feedback back to the server for further processing or storage. This allows for dynamic interactions between the user and the system, enabling a wide range of applications and functionalities.
[0279] While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
[0280] Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0281] In addition to the embodiments described above, the following embodiments are also innovative:
[0282] Embodiment 1 is a computer-implemented method comprising: receiving a query; generating a final response trajectory for the query, comprising, at each iteration of a sequence of one or more iterations: generating a respective task input for the iteration from the query; processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the query, wherein the intermediate response trajectory comprises (i) an intermediate response to the query and (ii) a sequence of reasoning steps for generating the intermediate response to the query; processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the query; and determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory; and generating a response for the query based on the final response trajectory.
[0283] Embodiment 2 is the method of embodiment 1, wherein the reconstructor output comprises a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response.
[0284] Embodiment 3 is the method of embodiment 2, wherein generating the respective task input comprises, for each iteration after a first iteration of the sequence of iterations: one or more annotations for the reconstructor output for a preceding iteration; and including the one or more annotations in the respective task input for the iteration.
[0285] Embodiment 4 is the method of embodiment 3, wherein each of the one or more annotations describe an error in one or more of the reasoning steps of the reconstructor output for the preceding iteration.
[0286] Embodiment 5 is the method of any one of embodiments 3-4, further comprising: processing (i) the query, (ii) the intermediate response trajectory for the preceding iteration, (iii) the reconstructor output for the preceding iteration, and (iv) an instruction to identify one or more errors in the reconstructor output using the task generative neural network to generate the one or more annotations.
[0287] Embodiment 6 is the method of any one of embodiments 1-5, wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises: processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query; and in response to determining that the similarity meets a threshold similarity, determining to select the intermediate response trajectory as the final response trajectory.
[0288] Embodiment 7 is the method of embodiment 6, wherein processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query comprises: processing the query using an embedding model to generate a query embedding; processing the reconstructed query using the embedding model to generate a reconstructed query embedding; and determining a distance between the query embedding and the reconstructed query embedding.
[0289] Embodiment 8 is the method of embodiment 6, wherein processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query comprises: determining an edit distance between the query and the reconstructed query.
[0290] Embodiment 9 is the method of any one of embodiments 1-8, wherein the reconstructor output comprises a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response, and wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises: processing the sequence of reasoning steps for generating the reconstructed query to determine whether the sequence of reasoning steps includes one or more errors; and in response to determining that the sequence of reasoning steps does not include one or more errors, determining to select the intermediate response trajectory as the final response trajectory.
[0291] Embodiment 10 is the method of any one of embodiments 1-9, wherein the reconstructor generative neural network is one of a plurality of reconstructor generative neural networks, and wherein processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output comprises processing the reconstructor input using each of two or more of the plurality of reconstructor generative neural networks to generate a respective reconstructor output.
[0292] Embodiment 11 is the method of embodiment 10, wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises determining from the query and the reconstructed query of each respective reconstructor output, whether to select the intermediate response trajectory as the final response trajectory.
[0293] Embodiment 12 is the method of embodiment 11, wherein determining from the query and the reconstructed query of each respective reconstructor output, whether to select the intermediate response trajectory as the final response trajectory comprises: generating a combined reconstructor output using each respective reconstructor output, wherein the combined reconstructor output comprises at least a combined reconstructed query that is a prediction of the query; and processing the query and the combined reconstructed query of the combined reconstructor output to determine a similarity between the query and the combined reconstructed query.
[0294] Embodiment 13 is the method of any one of embodiments 1-12, wherein the reconstructor generative neural network is one of a plurality of reconstructor generative neural networks, and wherein the method further comprises selecting the reconstructor generative neural network from the plurality of reconstructor generative neural networks.
[0295] Embodiment 15 is a computer-implemented method comprising: obtaining a plurality of training examples, each comprising a training query and a target response for the training query; training a task generative neural network using the training examples, comprising, for each training example: generating a final response trajectory for the training query, comprising, at each iteration of a sequence of one or more iterations: generating a respective task input for the iteration from the training query; processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the training query, wherein the intermediate response trajectory comprises (i) an intermediate response to the training query and (ii) a sequence of reasoning steps for generating the intermediate response to the training query; processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the training query; and determining, from at least the training query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory; generating a response based on the final response trajectory; and training the task generative neural network based on at least the response and the target response.
[0296] Embodiment 15 is the method of embodiment 14, wherein determining, from at least the training query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises: determining whether a number of iterations in the sequence of iterations meets a threshold number of iterations; and determining to select the intermediate response trajectory as the final response trajectory in response to determining that the number of iterations in the sequence of iterations meets the threshold number of iterations.
[0297] Embodiment 16 is the method of any one of embodiments 14-15, wherein training the task generative neural network comprises training the task generative neural network to optimize a loss function that is based on a reward that measures whether the response to the training query is similar to the target response and whether the reconstructed query is similar to the training query.
[0298] Embodiment 17 is the method of embodiment 16, wherein the loss function is further based on an error between the target response and the intermediate response of the final response trajectory.
[0299] Embodiment 18 is the method of any one of embodiments 14-17, further comprising: prior to processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network, processing at least the intermediate response trajectory using a verifier neural network to generate a verifier output that identifies whether the intermediate response trajectory contains more than a threshold amount of information about the training query; and determining whether the intermediate response trajectory contains more than the threshold amount of information based on the verifier output.
[0300] Embodiment 19 is the method of embodiment 18, further comprising in response to determining that the intermediate response trajectory comprises the threshold amount of information: at each of one or more verifier iterations: generating a respective input for the verifier iteration; processing the respective input using the task generative neural network to generate a candidate intermediate response trajectory for the training query; and determining, from the training query and the candidate intermediate response trajectory, whether to update the intermediate response trajectory to include the candidate intermediate response trajectory.
[0301] Embodiment 20 is a system comprising one or more computers and one or more storage devices communicatively coupled to the one or more computers, wherein the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations of the respective method of any of embodiments 1-19.
[0302] Embodiment 21 is one or more non-transitory computer storage media encoded with computer program instructions that when executed by one or more computers cause the one or more computers to perform operations of the respective method of any of embodiments 1-19.
[0303] Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.
Claims
1. A computer-implemented method comprising:receiving a query;generating a final response trajectory for the query, comprising, at each iteration of a sequence of one or more iterations:generating a respective task input for the iteration from the query;processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the query, wherein the intermediate response trajectory comprises (i) an intermediate response to the query and (ii) a sequence of reasoning steps for generating the intermediate response to the query;processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the query; anddetermining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory; andgenerating a response for the query based on the final response trajectory.
2. The method of claim 1, wherein the reconstructor output comprises a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response.
3. The method of claim 2, wherein generating the respective task input comprises, for each iteration after a first iteration of the sequence of iterations:generating one or more annotations for the reconstructor output for a preceding iteration; andincluding the one or more annotations in the respective task input for the iteration.
4. The method of claim 3, wherein each of the one or more annotations describe an error in one or more of the reasoning steps of the reconstructor output for the preceding iteration.
5. The method of claim 3, further comprising:processing (i) the query, (ii) the intermediate response trajectory for the preceding iteration, (iii) the reconstructor output for the preceding iteration, and (iv) an instruction to identify one or more errors in the reconstructor output using the task generative neural network to generate the one or more annotations.
6. The method of claim 1, wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises:processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query; andin response to determining that the similarity meets a threshold similarity, determining to select the intermediate response trajectory as the final response trajectory.
7. The method of claim 6, wherein processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query comprises:processing the query using an embedding model to generate a query embedding;processing the reconstructed query using the embedding model to generate a reconstructed query embedding; anddetermining a distance between the query embedding and the reconstructed query embedding.
8. The method of claim 6, wherein processing the query and the reconstructed query to determine a similarity between the query and the reconstructed query comprises:determining an edit distance between the query and the reconstructed query.
9. The method of claim 1, wherein the reconstructor output comprises a sequence of reasoning steps for generating the reconstructed query from at least the intermediate response, and wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises:processing the sequence of reasoning steps for generating the reconstructed query to determine whether the sequence of reasoning steps includes one or more errors; andin response to determining that the sequence of reasoning steps does not include one or more errors, determining to select the intermediate response trajectory as the final response trajectory.
10. The method of claim 1, wherein the reconstructor generative neural network is one of a plurality of reconstructor generative neural networks, and wherein processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output comprises processing the reconstructor input using each of two or more of the plurality of reconstructor generative neural networks to generate a respective reconstructor output.
11. The method of claim 10, wherein determining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises determining from the query and the reconstructed query of each respective reconstructor output, whether to select the intermediate response trajectory as the final response trajectory.
12. The method of claim 11, wherein determining from the query and the reconstructed query of each respective reconstructor output, whether to select the intermediate response trajectory as the final response trajectory comprises:generating a combined reconstructor output using each respective reconstructor output, wherein the combined reconstructor output comprises at least a combined reconstructed query that is a prediction of the query; andprocessing the query and the combined reconstructed query of the combined reconstructor output to determine a similarity between the query and the combined reconstructed query.
13. The method of claim 1, wherein the reconstructor generative neural network is one of a plurality of reconstructor generative neural networks, and wherein the method further comprises selecting the reconstructor generative neural network from the plurality of reconstructor generative neural networks.
14. A computer-implemented method comprising:obtaining a plurality of training examples, each comprising a training query and a target response for the training query;training a task generative neural network using the training examples, comprising, for each training example:generating a final response trajectory for the training query, comprising, at each iteration of a sequence of one or more iterations:generating a respective task input for the iteration from the training query;processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the training query, wherein the intermediate response trajectory comprises (i) an intermediate response to the training query and (ii) a sequence of reasoning steps for generating the intermediate response to the training query;processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the training query; anddetermining, from at least the training query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory;generating a response based on the final response trajectory; andtraining the task generative neural network based on at least the response and the target response.
15. The method of claim 14, wherein determining, from at least the training query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory comprises:determining whether a number of iterations in the sequence of iterations meets a threshold number of iterations; anddetermining to select the intermediate response trajectory as the final response trajectory in response to determining that the number of iterations in the sequence of iterations meets the threshold number of iterations.
16. The method of claim 14, wherein training the task generative neural network comprises training the task generative neural network to optimize a loss function that is based on a reward that measures whether the response to the training query is similar to the target response and whether the reconstructed query is similar to the training query.
17. The method of claim 16, wherein the loss function is further based on an error between the target response and the intermediate response of the final response trajectory.
18. The method of claim 14, further comprising:prior to processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network, processing at least the intermediate response trajectory using a verifier neural network to generate a verifier output that identifies whether the intermediate response trajectory contains more than a threshold amount of information about the training query; anddetermining whether the intermediate response trajectory contains more than the threshold amount of information based on the verifier output.
19. The method of claim 18, further comprising in response to determining that the intermediate response trajectory comprises the threshold amount of information:at each of one or more verifier iterations:generating a respective input for the verifier iteration;processing the respective input using the task generative neural network to generate a candidate intermediate response trajectory for the training query; anddetermining, from the training query and the candidate intermediate response trajectory, whether to update the intermediate response trajectory to include the candidate intermediate response trajectory.
20. A system comprising:one or more computers; andone or more storage devices communicatively coupled to the one or more computers, wherein the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations comprising:receiving a query;generating a final response trajectory for the query, comprising, at each iteration of a sequence of one or more iterations:generating a respective task input for the iteration from the query;processing the respective task input using a task generative neural network to generate an intermediate response trajectory for the query, wherein the intermediate response trajectory comprises (i) an intermediate response to the query and (ii) a sequence of reasoning steps for generating the intermediate response to the query;processing a reconstructor input comprising at least the intermediate response using a reconstructor generative neural network to generate a reconstructor output, wherein the reconstructor output comprises at least a reconstructed query that is a prediction of the query; anddetermining, from at least the query and the reconstructed query, whether to select the intermediate response trajectory as the final response trajectory; andgenerating a response for the query based on the final response trajectory.
