Generating image-augmented query responses using generative neural networks
The system enhances generative neural network responses by integrating relevant figures and quotes inline with textual data, leveraging text-chunk associations and neural network optimization for improved interpretability and context in user query responses.
Patent Information
- Application Number
- PCT/US2026/030249
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-10-02
- Filing Date
- 2026-05-28
- Publication Date
- 2026-12-03
AI Technical Summary
Generative neural networks struggle to generate accurate and informative figures that complement textual data in responses to user queries, particularly for complex queries, and often select loosely related figures or duplicative text chunks that fail to provide complete context.
A system that processes user queries with a generative neural network using a network input including relevant text chunks and candidate figures, leveraging associations between text and figures to select and integrate effective inline figures and quotes, utilizing reward and policy neural networks for optimal chunk selection, and employing retrieval augmented generation techniques to enhance response quality.
Improves the interpretability and information content of responses by integrating well-chosen figures and quotes inline with textual data, addressing the challenges of figure selection and context completeness in generative neural network responses.
Smart Images

Figure US2026030249_03122026_PF_FP_ABST
Abstract
Description
Attorney Docket No. 49220-0064WO1GENERATING IMAGE-AUGMENTED QUERY RESPONSES USING GENERATIVE NEURAL NETWORKSCROSS-REFERENCE TO RELATED APPLICATION
[0001] This application claims priority to U.S. Provisional Application No. 63 / 813,560, filed on May 28, 2025, and U.S. Non-Provisional Application No. 19 / 348,677, filed on October 2, 2025. The disclosure of the prior applications is considered part of and is incorporated by reference in the disclosure of this application.BACKGROUND
[0002] This specification relates to processing data using machine learning models.
[0003] Machine learning models receive an input and generate an output, e.g., a predicted output, based on the received input. Some machine learning models are parametric models and generate the output based on the received input and on values of the parameters of the model.
[0004] Some machine learning models are deep models that employ multiple layers of models to generate an output for a received input. For example, a deep neural network is a deep machine learning model that includes an output layer and one or more hidden layers that each apply a non-linear transformation to a received input to generate an output.SUMMARY
[0005] This specification generally describes a system implemented as computer programs on one or more computers in one or more locations that can generate a response to a user query that includes figures and, optionally, quotes shown inline with textual data.
[0006] According to an aspect, there is provided a method performed by one or more computers, the method comprising: receiving a user query from a user; generating a response to the user query, comprising: processing the user query’ to identify a collection of text chunks that are predicted to be relevant to the user query; generating a pool of candidate figures for inclusion in the response to the user query; and processing a network input that comprises: (i) the user query, (ii) the collection of text chunks that are predicted to be relevant to the query', and (iii) data identifying the pool of candidate figures, using a generative neural network and in accordance with trained values of a set of generative neural network parameters, to generate a network output, wherein the network output comprises textual data defining a response to the user query'Attorney Docket No. 49220-0064W01and also selects one or more figures from the pool of candidate figures; and presenting the response to the user query on a display of a user device, wherein the response displays a visual representation of the one or more figures selected by the generative neural network inline with the textual data generated by the generative neural network.
[0007] The network input that is processed by the generative neural network may comprise, for each candidate figure in the pool of candidate figures, a textual description of the candidate figure.
[0008] The network input that is processed by the generative neural network may include a unique identifier for each figure in the pool of candidate figures; and wherein to select a figure from the pool of candidate figures, the network output generated by the generative neural network may include a sentinel string that comprises the unique identifier for the figure,
[0009] Generating the pool of candidate figures for inclusion in the response to the user query may comprise, for each of a plurality of text chunks from the collection of text chunks: processing the text chunk to determine that the text chunk references a figure; and in response, including the figure in the pool of candidate figures for inclusion in the response to the user query.
[0010] The method may further comprise, prior to processing the network input that comprises data identifying the pool of candidate figures using the generative neural network, filtering the pool of candidate figures by performing operations comprising: determining, for each figure in the pool of candidate figures, a predicted relevance of the figure to the user query, comprising: processing a network input that comprises: (i) a textual description of the figure, and (li) the user query, using a figure filtering generative neural network to generate a network output that defines the predicted relevance of the figure to the user query; and filtering a plurality of figures from the pool of candidate figures based on the predicted relevance of each figure in the pool of candidate figures to the user query.
[0011] Generating the response to the user query may further comprise: generating a pool of candidate quotes for inclusion in the response to the user query, wherein each candidate quote is extracted from a respective text chunk from the collection of text chunks; wherein the network input to the generative neural network further comprises: (iv) data identifying the pool of candidate quotes; and wherein the network output generated by the generative neural network also selects one or more quotes from the pool of candidate quotes; and wherein the responseAttorney Docket No. 49220-0064W01displays the one or more quotes selected by the generative neural network as block quotes inline with the textual data generated by the generative neural network.
[0012] The network input that is processed by the generative neural network may include a unique identifier for each quote from the pool of candidate quotes; and wherein to select a quote from the pool of candidate quotes, the network output generated by the generative neural network may include a sentinel string that comprises the unique identifier for the quote.
[0013] Generating the pool of candidate quotes for inclusion in the response to the user query may comprise, for each of a plurality of text chunks from the collection of text chunks: processing a network input comprising: (i) the text chunk, and (ii) an instruction to identify a quote from the text chunk that is relevant to the user query, using an extraction generative neural network to generate a network output that identifies a quote from the text chunk, wherein the quote comprises less than all of the text chunk; and including the quote from the text chunk in the pool of candidate quotes,
[0014] The method may further comprise, prior to processing the network input that comprises data identifying the pool of candidate quotes using the generative neural network, filtering the pool of candidate quotes by performing operations comprising: determining, for each quote in the pool of candidate quotes, a predicted relevance of the candidate quote to the user query, comprising: processing a network input that comprises: (i) the quote, and (ii) the user query, using a text filtering generative neural network to generate a network output that defines the predicted relevance of the quote to the user query; and filtering a plurality of quotes from the pool of candidate quotes based on the predicted relevance of each quote in the pool of candidate quotes to the user query.
[0015] Generating the response to the user query may further comprise, for each of one or more text chunks from the collection of text chunks: determining that the text chunk satisfies one or more selection criteria; in response, retrieving a full document from which the text chunk was extracted; and generating a supplemental response to the user query based on the full document from which the text chunk was extracted, comprising: processing a network input that comprises: (i) the full document from which the text chunk was extracted, and (ii) user query, using an auxiliary' generative neural network to generate a network output that summarizes the full document from which the text chunk was extracted in view of the user query'; wherein the supplemental response to the user query is displayed inline with the response to the user query.Attorney Docket No. 49220-0064W01
[0016] According to another aspect, there is provided a method performed by one or more computers, the method comprising: obtaining a set of training examples, wherein each training example comprises: (i) a training query, (li) a first set of text chunks, (iii) a second set of text chunks, and (iv) a label designating either the first set of text chunks or the second set of text chunks as being more relevant to the training query; and training a reward neural network on the set of training examples, wherein the reward neural network is configured to: receive a network input that comprises an input query and an input set of text chunks; and process the network input in accordance with values of a set of reward neural network parameters to generate a reward that characterizes a relevance of the input set of text chunks to input query.
[0017] Training the reward neural network on the set of training examples may comprise, for each training example: processing a network input comprising: (i) the training query, and (ii) the first set of text chunks using the reward neural network to generate a relevance score for the first set of text chunks; processing a network input comprising: (i) the training query, and (ii) the second set of text chunks using the reward neural network to generate a relevance score for the second set of text chunks; and training the reward neural network to optimize an objective function that measures a consistency between: (i) the relevance scores for the first set of text chunks and the second set of text chunks, and (ii) the label designating either the first set of text chunks or the second set of text chunks as being more relevant to the training query.
[0018] The method may further comprise: receiving a user query from a user; generating a response to the user query, comprising: processing the user query to identify a collection of text chunks that are predicted to be relevant to the query; selecting a subset of the collection of text chunks for inclusion in a network input to be processed by a generative neural network using the reward neural network; and processing a network input that comprises: (i) the user query, and (ii) the selected subset of the collection of text chunks, using a generative neural network to generate a network output that defines a response to the user query; and presenting the response to the user query on a display of a user device.
[0019] Selecting the subset of the collection of text chunks for inclusion in the network input to be processed by the generative neural network using the reward neural network may comprise: selecting the subset of the collection of text chunks as a result of a numerical optimization that aims to identify a subset of the collection of text chunks having: (i) fewer than a maximumAttorney Docket No. 49220-0064W01threshold number of text chunks, and (ii) a highest relevance to the user query as measured using the reward neural network.
[0020] The numerical optimization may be implemented using a beam search algorithm.
[0021] The method may further comprise: receiving a user query from a user; generating a response to the user query, comprising: processing the user query to identify a collection of text chunks that are predicted to be relevant to the query; selecting a subset of the collection of text chunks for inclusion in a network input to be processed by a generative neural network, comprising, at each of a plurality of iterations: process a network input that identifies the user query and a current subset of the collection of text chunks using a policy neural network to generate a score distribution over text chunks that are not included in the current subset of the collection of text chunks; and selecting a text chunk in accordance with the score distribution; and adding the selected text chunk to the current subset of the collection of text chunks; wherein the policy neural network has been trained using rewards generated by the reward neural network by a reinforcement learning training technique; processing a network input that comprises: (i) the user query, and (ii) the selected subset of the collection of text chunks, using a generative neural network to generate a network output that defines a response to the user query; and presenting the response to the user query on a display of a user device.
[0022] Training the policy neural network using rewards generated by the reward neural network by the reinforcement learning training technique may comprise, at each of a plurality of training episodes: selecting a subset of a training collection of text chunks in view of a training query using the policy neural network; processing a network input comprising: (i) the training query, and (ii) the selected subset of the training collection of text chunks, using the reward neural network to generate a reward; and training the policy neural network using the reward by the reinforcement learning training technique.
[0023] Selecting a text chunk in accordance with the score distribution may comprise: selecting a text chunk associated with a highest score under the score distribution.
[0024] According to another aspect, there is provided a method performed by one or more computers, the method comprising: receiving a user query from a user; generating a response to the user query, comprising: performing an automated retrieval process to obtain a set of text chunks that are predicted to be relevant to the user query; processing a network input comprising the set of text chunks using a switching generative neural network to generate a classificationAttorney Docket No. 49220-0064WO1output which classifies whether the set of text chunks are collectively responsive to the user query’; determining, based on the classification output, that the set of text chunks are not collectively responsive to the user query'; and in response, performing an additional automated retrieval process to obtain an additional set of text chunks that are predicted to be relevant to the query; and processing a network input that comprises: (i) at least some of the set of text chunks, and (ii) at least some of the additional set of text chunks, using a synthesis generative neural network to generate a network output that defines a response to the user query.
[0025] Performing the additional automated retrieval process to obtain the additional set of text chunks may comprise: processing a network input comprising the user query using a planner generative neural network to generate a network output that defines a plurality of internal queries, wherein each internal query requests information that is predicted to be relevant to the user query; and performing, for each of the plurality of internal queries, an automated retrieval process to obtain new text chunks that are predicted to be relevant to the internal query'; wherein the new text chunks that obtained based on the plurality of internal queries collectively define the additional set of text chunks,
[0026] The method may further comprise: processing a network input that comprises: (i) at least some of the set of text chunks, and (ii) at least some of the additional set of text chunks, and (ili) an instruction to generate a compressed version of a response to the user query, using a compression generative neural network to generate a network output that defines a compressed version of (i) the at least some of the set of text chunks and ( ii) the at least some of the additional set of text chunks; wherein the network input to the synthesis generative neural network further comprises the compressed version.
[0027] According to another aspect, there is provided one or more computer-readable storage media encoded with instructions that, when executed by one or more computers, cause the one or more computers to perform the operations of the above method aspects.
[0028] According to a further aspect, there is provided a system comprising one or more computers and one or more storage devices storing instructions that when executed by one or more computers cause the one or more computers to perform the respective operations of the above method aspects.
[0029] The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages.Attorney Docket No. 49220-0064W01
[0030] Some techniques described in this specification allow a generative neural network to generate more informative responses that represent more effective answers to user queries.Generative neural networks such as auto-regressive large language models excel at generating textual responses to user queries. In some cases, a textual response to a user query can be dramatically improved (e.g., in interpretability and information content) by inclusion of well chosen figures (e.g., images or tables) that are shown inline with the textual response. However, generative neural networks often struggle to generate accurate, informative figures that add value and information content complementary to textual data.
[0031] The system described in this specification addresses these issues. More specifically, to generate a response to a user query, the system prompts a generative neural network with a network input that includes: (i) the user query, (ii) a collection of text chunks that are predicted to be relevant to the user query, and (hi) data identifying a pool of candidate figures. The generative neural network generates a network output that includes textual data defining a response to the user query and also selects one or more figures from the pool of candidate figures. The selected figures can then be shown inline with the textual data generated by the generative neural network.
[0032] Instead of requiring the generative neural network to generate figures to accompany the textual response to the user query, the system allows the generative neural network to select one or more figures from a pool of candidate figures, which is a task that the generative neural network can perform much more effectively. The system thus provides a technical solution to the problem of generating effective responses to user queries, where the response integrates both text and inline figures, which is a challenging technical problem that arises in the technical field of machine learning.
[0033] One approach for generating a pool of candidate figures for augmenting a textual response that is generated by generative neural networks is to perform an auxiliary search of a figure database to identify potentially relevant figures which can be shown alongside the textual response. However, figures identified in this manner may be only loosely related to the content of the underlying textual response, particularly when the textual response is generated in response to complex user queries such as: “For a 55-year-old man with type 2 diabetes and stage 3 chronic kidney disease, which GLP-1 receptor agonist offers the best cardiovascular benefit without worsening renal function or interacting with ticagrelor?”.Attorney Docket No. 49220-0064W01
[0034] The system described in this specification addresses these issues. More specifically, as part of preparing the prompt that is processed by the generative neural network to generate a response to a user query, the system retrieves a collection of text chunks that are predicted to be relevant to the user query. Some or all of the text chunks may be extracted from larger documents that include figures which are referenced in the text chunks. Further, at least some of the figures referenced in the text chunks are likely to be integral to the textual response generated by the generative neural network by processing the text chunks. The system leverages this association between text chunks and figures referenced in the text chunks to automatically construct a pool of candidate figures for inclusion in the response to the user query.
[0035] In particular, the system can generate a pool of candidate figures that includes any figure that is referenced in a text chunk and that is included as part of a larger document from which the text chunk is extracted. The system thus provides a technical solution to the problem of identifying candidate figures to be shown alongside textual data that is generated by a generative machine learning model, which is another challenging technical problem that arises in the technical field of machine learning.
[0036] Some techniques described in this specification improve the effectiveness of retrieval augmented generation. In the paradigm of retrieval augmented generation (RAG), to generate a response to a user query, an initial step of retrieving a collection of text chunks relevant to the user query is performed. A subset of the collection of text chunks can then be included in a prompt that is processed by a generative machine learning model to generate a response to the user query.
[0037] One approach to selecting the subset of text chunks to be included in the prompt is to score each text chunk based on its relevance to the user query, and then select the text chunks having the highest relevance to the user query for inclusion in the prompt. However, this approach may result in selecting text chunks that, while relevant to the user query, are highly duplicative of one another and that fail to provide all the context required to fully answer the user query.
[0038] The system described in this specification addresses these issues. More specifically, the system can train a reward neural network that can process an input query and an input set of text chunks to generate a reward that characterizes the relevance of the input set of text chunks to the input query’. Crucially, the reward neural network can assess the joint relevance of the input setAttorney Docket No. 49220-0064W01of text chunks to the input query, rather than considering each individual text chunk in isolation. The system can use the reward neural network in any of a variety of possible ways.
[0039] For instance, the system can use the reward neural network to select a subset of text chunks for inclusion in the prompt as the result of a numerical optimization that aims to identify a subset of the collection of text chunks having: (i) fewer than a maximum threshold number of text chunks, and (li) a highest relevance to the user query’ as measured by the reward neural network. As another example, the system can use the reward neural network to train a policy neural network by a reinforcement learning technique, where the policy neural network iteratively selects text chunks for inclusion in the prompt. The system thus provides a technical solution to a technical problem that arises in the technical field of retrieval augmented generation.
[0040] 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
[0041] FIG. 1 is a diagram of an example system.
[0042] FIG, 2 is a diagram of a generative machine learning system.
[0043] FIG. 3 is an illustration of example operations performed by a system to generate a response to a user query.
[0044] FIG. 4 is a flow diagram of an example process for generating a response to a user query.
[0045] FIG. 5 is a diagram of an example training system.
[0046] FIG. 6 is a flow diagram of an example process for training a reward neural network.
[0047] FIG. 7 is a flow diagram of an example process for training a policy neural network.
[0048] FIG. 8 is a flow diagram of another example process for generating a response to a user query.
[0049] FIG. 9 is a flow diagram of another example process for generating a response to a user query.
[0050] FIG. 10 is an illustration of example operations performed by the system to generate a response to a user query.Attorney Docket No. 49220-0064W01
[0051] FIG. 11 is a flow diagram of another example process for generating a response to a user query.
[0052] Like reference numbers and designations in the various drawings indicate like elements.DETAILED DESCRIPTION
[0053] FIG. 1 shows an example system 100. The system 100 is an example of a system implemented as computer programs on one or more computers in one or more locations that receives a user query 102 and then processes the user query 102 to generate a response 126 to the user query 102.
[0054] The system 100 can obtain data representing the user query 102 in any of a variety of ways. In some cases, the data representing the user query 102 is also called “query data.” In some cases, the user query 102 is also called a “query,” a “prompt,” or a “question.”
[0055] In some cases, the query data includes text data, and the system 100 receives the query data as a text query from a user submitted through a user interface of a user device. For example, the user query 102 may be entered by the user by typing using a data input device, e.g., a keyboard, a touch screen, a wearable device (such as a smartwatch), a smart home device (such as a smart speaker), or another handheld or desktop input device.
[0056] In some other cases, the query data includes audio data, and the system 100 receives the query data as a natural language speech query from the user and converts the speech into the user query 102 by applying a speech recognition engine to the speech. For example, the user query 102 may be received in the form of a sound (speech) signal, captured by a microphone of the user computer, which is converted by a speech recognition engine, i.e., a speech-to-text converter to form the user query 102.
[0057] Having generated the response 126, the system 100 can provide the response 126 to the user. For example, the system 100 can provide the response 126 for presentation within a user interface on a display device of a user device, e.g., the user device through which the user submitted the user query 102.
[0058] In some implementations, the system 100 is implemented as part of or can be in communication with a mobile computing device, e.g., a mobile device, a smartwatch or other wearable device, a digital assistant device, or a smart speaker device, and the mobile computingAttorney Docket No. 49220-0064W01device can provide the response 126 to the user for presentation in a display device of the mobile computing device.
[0059] Additionally or alternatively, the system 100 can provide the response 126 to another system for further processing, or store the response 126 in a storage device for some future purpose.
[0060] The system 100 has access to one or more external data sources 150. The one or more external data sources 150 can be any database or any combination of databases that stores a corpus of electronic documents. Examples of electronic documents include webpages, word processing documents, spreadsheet documents, presentation documents, portable document format (PDF) documents and so on.
[0061] An external data source 150 may include vast numbers of electronic documents, e.g., at least 100,000 electronic documents, or at least 1,000,000 electronic documents, or at least 10,000,000 electronic documents. An external data source 150 may dynamically change over time, e.g,, as new electronic documents are added, or as existing electronic documents are updated or removed, etc.
[0062] In some implementations, the one or more external data sources 150 include one or more curated databases of medical literature. For example, the system 100 can have access to an external data source 150 that is a medical database that stores a corpus of medical documents. A medical document is an electronic document that includes medical-related content.
[0063] The corpus of medical documents stored in the medical database may for example include webpages and other electronic documents accessible through the Internet. / Additionally or alternatively, the corpus of medical documents may, for example, be part of a proprietary medical database, e.g., of a scientific content publisher (e.g., a physical science content publisher, a life science content publisher, a health science content publisher, or a social science content publisher), a technical content publisher, a medical content publisher, or other organization.
[0064] An electronic document may include both textual data and non-textual data. Textual data is any information that’s conveyed through written, printed, or typed words. In a medical document, this includes all the language-based content. Non-textual data refers to any information that isn’t primarily conveyed through written language. In medical documents, this data is used to visually represent complex information, data sets, or concepts that would beAttorney Docket No. 49220-0064W01difficult to explain in words alone. Whilst the meaning of textual data may be derived from the linguistic rules and syntax of a language, the meaning of non-textual data may be derived from visual interpretation, patterns, and direct relationships between data points.
[0065] Figures are a broad category of non-textual data that encompasses all different types of visual representations, such as graphs, maps, diagrams, illustrations, tables, and charts. For ease of discussion, this specification will refer to non-textual data as figures, despite those specific forms of non-textual data may also be referred to.
[0066] For example, diagrams and illustrations are a form of non-textual data that depict relationships, structures, or systems. They can be conceptual diagrams showing a theoretical model or technical drawings of an apparatus used in an experiment.
[0067] As another example, tables are a form of non-textual data that organize data into rows and columns, providing a structured way to present quantitative or qualitative information. They are highly efficient for displaying a large number of specific values.
[0068] As another example, charts, such as pie charts and line charts, are a form of non-textual data that visualizes data to show trends, comparisons, or distributions. For example, a medical document might use a bar chart to show experimental results or a flowchart to explain a process.
[0069] As illustrated in FIG. 1, to process the user query 102 to generate the response 126, the system 100 includes a generative machine learning system 110 and, in some implementations, a reward neural network 120, a policy neural network 130, or both.
[0070] FIG. 2 is a diagram of the generative machine learning system 110. In various implementations, the generative machine learning system 110 includes one or more of: a generative neural network 210, a figure filtering generative neural network 220, a text filtering generative neural network 230, an extraction generative neural network 240, a selection generative neural network 245, an auxiliary generative neural network 250, a synthesis generative neural network 260, a planner generative neural network 270, a compression generative neural network 280, or switching generative neural network 290.
[0071] The generative neural network 210 is configured to receive a network input that includes at least the user query 102 and process the network input in accordance with the trained values of the parameters of the generative neural network 210 to generate a network output that can be used to generate the response 126 to the user query 102.Attorney Docket No. 49220-0064W01
[0072] Optionally, the network input also includes an instruction to generate the response 126 to the user query 102. In general the instruction can include text in some natural language that, when processed by the generative neural network 210, will cause the generative neural network 210 to generate the network output that can be used to generate the response 126 to the user query 102.
[0073] The figure filtering generative neural network 220 is configured to receive, for a figure, a network input that includes (i) a textual description of the figure and (ii) the user query' 102, and process the network input in accordance with the trained values of the parameters of the figure filtering generative neural network 220 to generate a network output that defines the predicted relevance of the figure to the user query 102. The figure can be any figure included m any electronic document stored in the external data source 150.
[0074] Optionally, the network input also includes an instruction to predict the relevance of the figure to the user query 102, where the figure is described by the textual description. In general the instruction can include text in some natural language that, when processed by the figure filtering generative neural network 220, will cause the figure filtering generative neural network 220 to generate the predicted relevance of the figure to the user query 102.
[0075] The text filtering generative neural network 230 is configured to receive a network input that includes (i) a quote and (ii) the user query 102, and process the network input in accordance with the trained values of the parameters of the text filtering generative neural network 230 to generate a network output that defines the predicted relevance of the quote to the user query 102.
[0076] Optionally, the network input also includes an instruction to predict the relevance of the quote to the user query 102. In general the instruction can include text in some natural language that, when processed by the text filtering generative neural network 230, will cause the text filtering generative neural network 230 to generate the predicted relevance of the quote to the user query 102.
[0077] The extraction generative neural network 240 is configured to receive a network input that includes a text chunk, and process the network input in accordance with the trained values of the parameters of the extraction generative neural network 240 to generate a network output that identifies a quote from the text chunk.
[0078] Optionally, the network input also includes the user query 102. Optionally, the network input also includes an instruction to identify a quote from the text chunk in view of the userAttorney Docket No. 49220-0064W01query 102. In general the instruction can include text in some natural language that, when processed by the extraction generative neural network 240, will cause the extraction generative neural network 240 to identify the quote from the text chunk.
[0079] A “text chunk” includes a subset of the textual data of a full electronic document stored in the external data source 150. In some implementations, the lengths of the text chunks can vary. For example, each text chunk can correspond to a paragraph, a page, or a chapter of an electronic document.
[0080] In some implementations, the plurality of text chunks can each have about equal length. For example, each text chunk can have about 100 words, 300 words, or 500 words, or the like. As another example, each text chunk can have about 100 sub-words, 300 sub-words, or 500 subwords, or the like, A sub-word is generally an incomplete word, although there may also be subwords corresponding to complete words in a vocabulary. For example, the word “certainly” may include a sub- word “certain” and a sub-word “ly”.
[0081] A “quote” is a proper subset of a text chunk, i.e., the quote includes less than all of the content of the text chunk. For example, whilst a text chunk includes a full page of an electronic document, a quote may include a single sentence on that page.
[0082] The selection generative neural network 245 is configured to receive a network input that includes (i) one or more text chunk and (ii) the user query 102, and process the network input in accordance with the trained values of the parameters of the selection generative neural network 245 to generate a network output that specifies whether the text chunks satisfy the one or more selection criteria in view of the user query 102. For example, the network output can include a score (e.g., a binary score) or another indicator assigned to each of the one or more text chunks that specifies whether or not text chunk satisfies the one or more selection criteria m view of the user query 102.
[0083] Optionally, the network input also includes an instruction to determine whether or not the text chunks satisfy one or more selection criteria in view of the user query 102. In general the instruction can include text in some natural language that, when processed by the selection generative neural network 245, will cause the selection generative neural network 245 to classify whether or not each text chunk in the one or more text chunks satisfies the one or more selection criteria in view of the user query’ 102. The instruction can directly define the one or moreAttorney Docket No. 49220-0064WO1selection criteria. A few examples of those will be discussed further below with reference to FIG. 4.
[0084] The auxiliary generative neural network 250 is configured to receive a network input that includes (i) a full electronic document and (ii) user query’ 102, and process the network input in accordance with the trained values of the parameters of the auxiliary’ generative neural network 250 to generate a network output that defines a query-focused summary' that summarizes the full electronic document in view’ of the user query 102.
[0085] Optionally, the network input also includes an instruction to summarize the full electronic document in view of the user query' 102. In general the instruction can include text m some natural language that, when processed by the auxiliary generative neural network 250, will cause the auxiliary generative neural network 250 to generate the query-focused summary.
[0086] The query-focused summary is shorter than, i.e,, includes fewer words than, the full electronic document. Thus, the query-focused summary' requires fewer computational resources than the full electronic document, e.g., less memory to store and less compute to process. Unlike a general summary which may extract or generate the most important aspects of the electronic document as a whole, the query-focused summary focuses on identifying only the aspects of the electronic document that are related to the user query 102.
[0087] The synthesis generative neural network 260 is configured to receive a network input that includes one or more text chunks, and process the network input in accordance with the trained values of the parameters of the synthesis generative neural network 260 to generate a network output that can be used to generate the response 126 to the user query 102.
[0088] Optionally, the network input also includes an instruction to generate the response 126 to the user query 102. In general the instruction can include text in some natural language that, when processed by the synthesis generative neural network 260, will cause the synthesis generative neural network 260 to generate the network output that can be used to generate the response 126 to the user query' 102. The instruction for the synthesis generative neural network 260 may or may not be the same as the instruction for the generative neural network 210.
[0089] The planner generative neural network 270 is configured to receive a network input that includes the user query' 102, and process the network input in accordance with the trained values of the parameters of the planner generative neural network 270 to generate a network output that defines a plurality of internal queries. Each internal query' requests additional information fromAttorney Docket No. 49220-0064WO1the user that is predicted by the planner generative neural network 270 to be relevant to the user query’ 102, but that is not yet included in the user query 102.
[0090] Optionally, the network input also includes an instruction to generate the plurality of internal queries based on the user query' 102. In general the instruction can include text in some natural language that, when processed by the synthesis generative neural network 260, will cause the planner generative neural network 270 to generate the plurality of internal queries.[0091 J The compression generative neural network 280 is configured to receive a network input that includes one or more text chunks, and process the network input in accordance with the trained values of the parameters of the compression generative neural network 280 to generate a network output that defines a compressed version of the one or more text chunks.
[0092] Optionally, the network input also includes an instruction to compress, e.g., summarize, the one or more text chunks to reduce their lengths. In general the instruction can include text in some natural language that, when processed by the compression generative neural network 280, will cause the compression generative neural network 280 to generate a compressed version of the one or more text chunks.
[0093] The compressed version of the response is shorter than the response but summarizes the response, i.e., represents the most important or relevant information within the response. Thus, the compressed version of the response requires fewer computational resources than the original response, e.g., less memory to store and less compute to process.
[0094] The switching generative neural network 290 is configured to receive a network input that includes (i) the user query 102 and (ii) a set of text chunks, and process the network input in accordance with the trained values of the parameters of the switching generative neural network 290 to generate a classification output which classifies whether or not the set of text chunks is collectively responsive to the user query 102.
[0095] Optionally, the network input also includes an instruction to classify whether or not the set of text chunks are collectively responsive to the user query' 102. In general the instruction can include text in some natural language that, when processed by the switching generative neural network 290, will cause the switching generative neural network 290 to generate the classification output. The instruction can directly define one or more responsiveness criteria in accordance with which the switching generative neural network 290 generates this classification output. A few examples of those will be discussed further below with reference to FIG. 11.Attorney Docket No. 49220-0064W01
[0096] A neural network is called a “generative” neural network when it has the capability to generate new content that is previously unseen during the training of the neural network. For example, a generative neural network can generate sequences of tokens that were previously unseen in the training data that was used to train the generative neural network.
[0097] Each generative neural network described in this specification can be a large language model that has been configured through training to enable it to receive an input sequence made up of tokens selected from a vocabulary and auto-regressively generates an output sequence made up of tokens from the vocabulary. Thus, each network input mentioned above can be represented in the form of an input sequence; similarly, each network output mentioned above can be represented in the form of an output sequence.
[0098] For example, in the case of the generative neural network 210, the network input received by the neural network can be an input sequence that represents at least the user query 102, while the network output generated by the neural network can be an output sequence that represents at least the textual data to be included in the response 126 to the user query 102.
[0099] 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.
[0100] More specifically, the auto-regressively generated output sequence is created by generating each particular token in the output sequence conditioned on a current input sequence that includes any tokens that precede the particular text token in the output sequence, i.e., the tokens that have already been generated for any previous positions in the output sequence that precede the particular position of the particular token, and the tokens included in the input sequence.
[0101] To generate a particular token at a particular position within an output sequence, a generative 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 m the vocabulary of tokens. The generative neural network can then select, as the particular token, a token from the vocabulary’ using the score distribution. For example, the generative neural network can greedily select the highest-scoring token or can sample, e.g., using nucleus sampling or another sampling technique, a token from the distribution.Attorney Docket No. 49220-0064W01
[0102] Each generative neural network can include a respective set of neural network parameters, e.g., defining the weights and, optionally, biases associated with the layers of the neural network, and the set of neural network parameters can have values learned through training to cause the generative neural network to perform its described functions.
[0103] A large language model (LLM) is a neural network that includes many neural network parameters. For example, each generative neural network can include, e.g., at least one million parameters, or at least one billion parameters, or at least one trillion parameters.
[0104] Each generative neural network described in this specification can have any appropriate language model architecture which enables the neural network to perform its described functions. In particular, each generative neural network can include any appropriate types of neural network layers (e.g., fully-connected layers, attention layers, embedding layers, activation layers, etc.) in any appropriate number (e.g., 5 layers, 10 layers, or 50 layers) and connected in any appropriate configuration (e.g., as a linear sequence of layers).
[0105] For example, each generative neural network can have any of a variety of Transformerbased neural network architectures, e.g., encoder-only Transformer architectures, encoderdecoder Transformer architectures, decoder-only Transformer architectures, mixture-of-experts (MoE) Transformer architectures, other attention-based architectures, and so on.
[0106] A Transformer-based neural network is characterized by having a sequence of attention layers. Each attention layer has an attention mechanism. There are many different attention mechanisms that may be used. For example, a self-attention layer has a self-attention mechanism, and a cross-attention layer has a cross-attention mechanism.
[0107] Examples of the Transformer-based neural network architectures include those described in Brown, Tom, et al. “Language models are few-shot learners.” Advances in neural information processing systems 33 (2020): 1877-1901; Raffel, Colin, et al. “Exploring the limits of transfer learning with a unified text-to-text transformer.” journal of machine learning research 21.140 (2020): 1-67; Anil, Rohan, et al. “Palm 2 technical report.” arXiv preprint arXiv: 2305.10403 (2023); Grattafiori, Aaron, et al. “The llama 3 herd of models.” arXiv preprint arXiv:2407.21783 (2024); and Jiang, Albert Q., et al. “Mixtral of experts.” arXiv preprint arXiv:2401.04088 (2024).
[0108] Prior to being used to generate responses to user queries, the generative neural networks are trained, e.g., by the system 100 or another training system, on training data to determine theAttorney Docket No. 49220-0064W01trained values of the respective sets of neural network parameters of the generative neural networks.
[0109] In some implementations, the system 100 or the other training system pre-trains each of the generative neural networks based on optimizing an unsupervised objective function or a self-supervised function.
[0110] For example, the system 100 or the other training system can train each of the generative neural networks on a language modeling task, e.g., a task that requires predicting, given a current sequence of text tokens, the next token that follows the current sequence in a training data set. Equivalently, the language modeling task requires, for each given text sequence in the training data set, predicting a second portion of the given text sequence that followed a first portion of the given text sequence. As a particular example, a generative neural network can be pre-trained on a maximum-likelihood objective function on a large dataset of text, e.g., text that is publicly available from the Internet or another text corpus.
[0111] During the pre-training, each generative neural network can have been trained on text sequences that collectively include many tokens, e.g., at least one million, or at least one billion, or at least one trillion tokens. In some implementations, the tokens on which the generative neural network has been trained exclude, i.e., does not include, tokens that represent data other than text. For example, the vocabulary of tokens excludes image tokens that represent image data, e.g., image patch embeddings.
[0112] In some implementations, the system 100 or the other training system fine-tunes, i.e., further trains, each of the generative neural networks compared to a baseline generative neural network, e.g., after the generative neural network is pre-trained to determine trained values of neural network parameters, in order to determine further updates to some or all of the trained values.
[0113] For example, the system 100 or the other training system can further train each of the generative neural network on a set of fine-tuning training examples based at least in part on using a reinforcement learning with human feedback (RLHF) technique, a supervised fine-tuning (SFT) technique, or the like.
[0114] For example, each fine-tuning training example used by the system 100 or the other training system to fine-tune the generative neural network 210 can include a training network input that includes a user query and a collection of text chunks (e.g., extractions of electronicAttorney Docket No. 49220-0064W01documents stored in the one or more external data sources 150) and, optionally, a target network output that includes a target response to be generated based on the collection of text chunks in response to the user query.
[0115] While described as being performed by separate neural networks for clarity of discussion, the respective functions of the various generative neural networks mentioned in this specification, including those included in the generative machine learning system 110, may be combined into a single generative neural network.
[0116] For example, the system 100 can, for the same user query 102, process a network input that includes (i) a textual description of a figure included in any electronic document stored in the external data source 150 and (ii) the user query 102 using a generative neural network to generate a network output that defines a predicted relevance of the figure to the user query 102; and process a network input that includes (i) a quote and (ii) the user query 102 using the same generati ve neural network to generate a network output that defines a predicted relevance of the quote to the user query 102.
[0117] Thus, in this example, the figure filtering generative neural network 220 and the text filtering generative neural network 230 are the same generative neural network, and the system 100 uses the same generative neural network both to predict the relevance of the figure to the user query 102, as well as to predict relevance of the quote to the user query 102.
[0118] Relative to having separate neural networks, having a single generative neural network that can function as both the figure filtering generative neural network 220 and the text filtering generative neural network 230 allows for the generative machine learning process to be executed with minimal additional computational overhead. That is, the system 100 can generate response to the user queries with much less additional latency and while consuming much less additional memory relative to generating response to the user queries using separate generative neural networks.
[0119] As an analogous example, the generative neural network 210 and the synthesis generative neural network 260 can be the same generative neural network, and the system 100 uses the same generative neural network to generate different responses 126 based on different data that is generated based on the same user query 102.Attorney Docket No. 49220-0064W01
[0120] There are many ways in which the system 100 can do this. One example way is to provide a generative neural network with a description of network output as part of the network input to the generative neural network.
[0121] Such a description is typically represented in the form of an instruction that includes text in some natural language, e.g., “Here’s a query [user query]. Here’s a collection of text chucks that are relevant to the query. Generate a correct and comprehensive response to the query using the concepts described in the collection of text chucks.”
[0122] Thus, by providing different natural language text instructions as part of the network inputs to the generative neural network, the system 100 can cause the same generative neural network to perform different functions, e.g., to function as both the text filtering generative neural network 230 and the extraction generative neural network 240.
[0123] Another example way is to leverage the in-context learning capability of a generative neural network. When trained at sufficient scale, generative neural networks, e.g., language models, can be made to perform a task by providing a “few-shot prompt” as part of the network input. The few-shot prompt includes a few, e.g., 1 to 10, pairs of example network input and example network output for the task.
[0124] For example, to cause the generative neural network to function as the compression generative neural network 280, the system can provide, for processing by the generative neural network, a network input that includes: (i) a text chunk, (ii) an instruction to generate a compressed version of the a text chunk, and (iii) one or more example text chunk - compressed text chunk pairs; and, to cause the same generative neural network to instead function as the switching generative neural network 290, the system can provide, for processing by the generative neural network, a network input that includes: (i) a user query, (ii) a set of text chunks, (iii) an instruction to classify whether or not the set of text chunks are collectively responsive to the user query, and (iv) one or more positive example pairs of user query, one or more negative example pairs of user query, or both.
[0125] A positive example pair includes a user query and a set of text chunks where the set of text chunks is collectively responsive to the user query. A negative example pair includes a user query’ and a set of text chunks where the set of text chunks is collectively unresponsive to the user query.Attorney Docket No. 49220-0064WO1
[0126] FIG. 3 is an illustration of example operations performed by the system 100 to generate the response 126 to the user query 102 in accordance with some implementations.
[0127] The system 100 receives the user query' 102 from the user and then executes an automated retrieval process based on the user query 102 to identify, from the corpus of electronic documents stored in the one or more external data sources 150, a collection of text chunks 106 that are predicted to be relevant to the user query 102. For example, the collection of text chunks 106 can include text chunks that satisfy a similarity criterion with the user query 102.
[0128] At least some of the collection of text chunks 106 include direct or indirect references to figures which are part of the non-textual data included in the same source electronic documents from which these text chunks have been identified. For example, FIG. 3 illustrates that, among the total of five text chunks that are predicted to be relevant to the user query' 102, text chunk 1 includes a reference to figure 1, and text chunk 2 includes a reference to figure 2.
[0129] A text chunk may reference a figure in any of a variety of ways. For example, a text chunk might include an in-text citation to a figure. This could be the most direct way to reference a figure. That is, the text chunk explicitly mentions the figure number, often in parentheses or as part of a sentence, e.g., “A schematic of the experimental setup can be seen in Figure 1.”
[0130] As another example, a text chunk might include a descriptive explanation of a figure, e.g., “The flowchart presented in Figure 2 illustrates the sequential steps of the algorithm, from data input to final output.” / Authors of medical documents often use textual data to provide a summary' or interpretation of a figure’s content, explaining what the reader should look for or what key insight the figure provides.
[0131] As another example, a text chunk might use figure references to create a cohesive narrative by' linking the introduction or literature review to the results section, e.g., “We compare the efficiency of our new method with the previous benchmark, as detailed in Table 1 and further visualized in Figure 3.”
[0132] The system 100 obtains, based on the collection of text chunks 106, an initial pool of candidate figures for potential inclusion as part of the response 126 to the user query' 102. The initial pool of candidate figures can be obtained by adding (copies of) the figures that have been directly or indirectly referenced to in the collection of text chunks 106 to the initial pool of candidate figures. The initial pool of candidate figures can thus include all of the figures that have been directly or indirectly referenced to in the collection of text chunks 106.Attorney Docket No. 49220-0064WO1
[0133] Despite being referenced to in the collection of text chunks 106, not all of these figures depict contents that possess the same level of relevance to the user query’ 102. A figure may be mentioned in a text chunk without being particularly relevant to the user query' 102 for many reasons.
[0134] For example, a figure might merely contain supporting information, e.g., it may be a validation figure that proves the reliability of an instrument but does not present the main experiments results, or it could be contain preliminary data such as pilot studies or exploratory analyses. As another example, a figure might be included in an electronic document merely to provide ancillary' context, e.g., a map or a diagram illustrating the study location or a known biological pathway.
[0135] Thus, the system 100 executes a figure filtering process by determining, for each figure m the initial pool of candidate figures, a predicted relevance of the figure to the user query' 102 and then filtering the initial pool of candidate figures based on the predicted relevance of each figure in the initial pool of candidate figures to the user query 102 to obtain a filtered pool of candidate figures 221, The filtered pool of candidate figures 221 includes a smaller number of candidate figures compared to the initial pool of candidate figures.
[0136] An example way of obtaining the initial pool of candidate figures based on the collection of text chunks 106 and an example way of executing the figure filtering process by using the figure filtering generative neural network 220 will be described below with reference to step 404 of FIG. 4.
[0137] In some implementations, the system 100 obtains, based on the collection of text chunks 106, an initial pool of candidate quotes for potential inclusion as part of the response 126 to the user query 102. Each candidate quote is extracted from a respective text chunk from the collection of text chunks 106. Each candidate quote includes less than all of the content of the respective text chunk, e.g., a candidate quote can include at least one, but fewer than all, of the words from a text chunk.
[0138] Just like the figures in the initial pool of candidate figures, not all of these quotes represent contents that possess the same level of relevance to the user query 102. In many cases a quote might be identified from a text chunk without being particularly relevant to the user query' 102.Attorney Docket No. 49220-0064W01
[0139] Thus, the system 100 executes a quote filtering process by determining, for each quote in the initial pool of candidate quotes, a predicted relevance of the quote to the user query' 102 and then filtering the initial pool of candidate quotes based on the predicted relevance of each quote in the initial pool of candidate quotes to the user query 102 to obtain a filtered pool of candidate quotes 241. The filtered pool of candidate quotes 241 includes a smaller number of candidate quotes compared to the initial pool of candidate quotes.
[0140] An example way of obtaining the initial pool of candidate quotes based on the collection of text chunks 106 by using the extraction generative neural network 240 and an example way of executing the quote filtering process by using the text filtering generative neural network 230 will be described below with reference to step 406 of FIG. 4.
[0141] In some implementations, the system 100 obtains, based on the collection of text chunks 106, a set of full electronic documents 251. Each full electronic document in the set can be a source electronic document stored in the one or more external data sources 150 that includes at least one of the text chunks in the collection of text chunks 106.
[0142] The system 100 obtains the set of full electronic documents 251 by identifying, from the collection of text chunks 106, one or more text chunks that satisfy one or more selection criteria and, for each text chunk that satisfies the one or more selection criteria, retrieving, from the one or more external data sources 150, the full electronic document from which the text chunk was extracted.
[0143] An example way of obtaining the set of full electronic documents based on the collection of text chunks by using the selection generative neural network 245 will be described below with reference to step 408 of FIG. 4.
[0144] One of the reasons to obtain a full electronic document in addition to just a text chunk is to alleviate the problem of “loss of context” of the generative neural network 210 when generating the response 126. This happens when crucial information needed to answer the user query 102 is spread across the electronic document and not contained within a single, isolated text chunk.
[0145] Having obtained the filtered pool of candidate figures 221 and, in some implementations, the filtered pool of candidate quotes 241, the system 100 proceeds to use the generative neural network 210 to generate the response 126 to the user query 102.Attorney Docket No. 49220-0064W01
[0146] The system 100 generates a network input that includes (i) the user query 102, (ii) the collection of text chunks 106 that are obtained as a result of the automated retrieval process and that are predicted to be relevant to the user query, and (iii) data identifying the filtered pool of candidate figures 221.
[0147] In some implementations, the data identifying the filtered pool of candidate figures 221 can include, for each candidate figure in the filtered pool of candidate figures 221, a textual description of the candidate figure.
[0148] In some implementations, the data identifying the filtered pool of candidate figures 221 can include a unique identifier for each candidate figure in the filtered pool of candidate figures 221. The identifier can be any appropriate type of identifier, e.g., a numerical value or an alphanumeric value that corresponds to the candidate figure.
[0149] In some implementations, the data identifying the filtered pool of candidate figures 221 can include, for each candidate figure in the filtered pool of candidate figures 221, both a textual description of the candidate figure and a unique identifier for the candidate figure. In some implementations, the network input excludes, i.e., does not include, the actual candidate figures themselves.
[0150] In some implementations where the filtered pool of candidate quotes 241 is also obtained, the network input also includes the filtered pool of candidate quotes 241, data identifying the filtered pool of candidate quotes 241, or both. For example, the data identifying the filtered pool of candidate quotes 241 can include a unique identifier for each quote from the filtered pool of candidate quotes 241. The identifier can be any appropriate type of identifier, e.g., a numerical value or an alphanumeric value that corresponds to the candidate quote.
[0151] The system 100 processes the network input using the generative neural network 210 to generate a network output that can be used to generate the response 126 to the user query 102. In particular, the network output includes textual data to be included m the response 126 to the user query 102.
[0152] The network output includes data that represents a selection by the generative neural network 210 of one or more figures from the filtered pool of candidate figures 221. For example, to select a figure from the filtered pool of candidate figures 221, the network output generated by the generative neural network 210 can include a sentinel string that includes the unique identifier for the figure. The sentinel string can be included in the network output at any appropriate place,Attorney Docket No. 49220-0064W01e.g., before the textual data defining the response 126, after the textual data defining the response 126, or anywhere in between.
[0153] In some implementations where the network input also includes the filtered pool of candidate quotes 241, data identifying the filtered pool of candidate quotes 241, or both, the network output also includes data that represents a selection by the generative neural network 210 of one or more quotes from the filtered pool of candidate quotes 241.
[0154] For example, to select a quote from the filtered pool of candidate quotes 241, the network output generated by the generative neural network 210 can include a sentinel string that includes the unique identifier for the quote. The sentinel string can be included in the network output at any appropriate place, e.g., before the textual data defining the response 126, after the textual data defining the response 126, or anywhere in between,
[0155] In some implementations where the set of full electronic documents 251 is also obtained, the system 100 use the auxiliary generative neural network 250 to process, for each full electronic document in the set of full electronic documents 251, a network input that includes the full electronic document and the user query 102 to generate a network output that defines a query-focused summary that summarizes the full electronic document in view of the user query 102.
[0156] The query-focused summary generated by the auxiliary generative neural network 250 for each full electronic document in the set of full electronic documents 251 collectively represent a supplemental response 127 to the user query 102. The supplemental response 127 can be displayed as part of, e.g., inline with or otherwise approximate to, the response 126 to the user query 102 that is generated by using the generative neural network 210.
[0157] FIG. 4 is a flow diagram of an example process 400 for generating a response to a user query. For convenience, the process 400 will be described as being performed by one or more systems of one or more computers located in one or more locations. For example, a system, e.g., the system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 400.
[0158] The system can perform the process 400 in response to receiving the user query, e.g., from a user through a user interface of a user device of the user, to generate a response to the user query. Once generated, the system can provide the response for presentation to the user, e.g., within the user interface on a display device of the user device.Attorney Docket No. 49220-0064W01
[0159] The system executes an automated retrieval process based on the user query to identify, from the corpus of electronic documents stored in the one or more external data sources, a collection of text chunks that are predicted to be relevant to the user query’ (step 402). For example, the collection of text chunks can include text chunks that satisfy a similarity criterion with the user query. There are many ways in which the automated retrieval process can be performed.
[0160] In some implementations, the system utilizes a textual (e.g., non-semantic) search algorithm to perform the automated retrieval process. The system identifies, as a text chunk in the collection of text chunks, a portion of an electronic document, that contains certain keywords or phrases.
[0161] In some implementations, the system performs an embedding-based search process based on an exact (i.e., brute-force) or approximate comparison of (i) an embedding of the user query that is generated by using an embedding neural network to process the user query, and (n) an embedding of each of one or more portions of each electronic document stored in the one or more external data sources that is generated by using the embedding neural network that includes one or more neural network layers of any appropriate type (e.g., embedding layers, fully- connected layers, attention layers, and so on), to process the portion. A portion an electronic document that has been identified as being similar, e.g., when an embedding distance therebetween satisfies a distance threshold, to the user query is then extracted as a text chunk in the collection of text chunks.
[0162] An embedding is an ordered collection of numeric values in an embedding space. For example, an embedding can include one or more vectors of floating point or other numeric values that has a fixed dimensionality. The embeddings generally have the same dimensionality, i.e., the user query embeddings and the electronic document embeddings have the same number of numeric values.
[0163] Such an embedding neural network can be trained on unlabeled training data based on optimizing a self-supervised or unsupervised loss function to generate vectors in an embedding space that have a fixed dimensionality. In some implementations, the embedding neural network can be trained as part of another neural network (that e.g. has a larger architecture) on tasks that involve generating embedding space representations, e.g., text classification or semantic analysis tasks.Attorney Docket No. 49220-0064W01
[0164] In some implementations, the system performs a two-stage retrieval process to retrieve the collection of text chunks form the one or more external data sources in a computationally effective and accurate manner. An example of such a two-stage retrieval process is described m U. S. Patent Application No. 18 / 975,621, titled “MEDICAL QUESTION ANSWERING SYSTEM”, which is incorporated by reference herein in its entirety.
[0165] The system generates, based on the collection of text chunks, an initial pool of candidate figures and then executes a figure filtering process on the initial pool of candidate figures to generate a filtered pool of candidate figures (step 404).
[0166] The initial pool of candidate figures can be obtained by adding (copies of) the figures that have been directly or indirectly referenced to in the collection of text chunks to the initial pool of candidate figures. The initial pool of candidate figures includes figures for potential inclusion as part of the response to the user query. The filtered pool of candidate figures includes a smaller number of candidate figures compared to the initial pool of candidate figures.
[0167] To obtain the initial pool of candidate figures, the system processes each text chunk in the collection of text chunks to determine whether the text chunk references a figure and, in response to a positive determination that the text chunk references a figure, the system includes (a copy of) the referenced figure in the pool of candidate figures for inclusion in the response to the user query. There are many ways in which the system can process a text chunk to make this determination.
[0168] In some implementations, pattern matching techniques can be used to determine whether a text chunk references a figure. For example, the system can use regular expressions to search for common patterns of figure references in the text chunk. Examples of common patterns to look for include: “Figure [number]” or “Fig. [number]” (e.g., “Figure 1”, “Fig. 3A”).
[0169] In some implementations, contextual analysis techniques can be used to determine whether a text chunk references a figure. For example, the system can search for the surrounding words. A reference like “as shown in” or “as illustrated in” may suggest a figure reference.
[0170] In some implementations, part-of-speech (POS) tagging techniques can be used to determine whether a text chunk references a figure. For example, the system can a natural language processing (NLP) model that has been configured through training to recognize when words like “Figure” or “Table” are being used as a noun and followed by a number, indicating a figure reference.Attorney Docket No. 49220-0064W01
[0171] In some implementations, machine learning techniques can be used to determine whether a text chunk references a figure. For example, the system can train a classification model on a dataset of electronic documents. The classification can be configured through training to identify the linguistic features and patterns that distinguish figure references from other parts of the text.[0172 J The figure filtering process involves determining, for each figure in the initial pool of candidate figures, a predicted relevance of the figure to the user query and then filtering the initial pool of candidate figures based on the predicted relevance of each figure in the initial pool of candidate figures to the user query to obtain the filtered pool of candidate figures.
[0173] To determine the predicted relevance of a figure, the system processes a network input that includes (i) a textual description of the figure and (ii) the user query using the figure filtering generative neural network to generate a network output that defines the predicted relevance of the figure to the user query. For example, the textual description of the figure can be a text chunk that includes a reference to the figure, or a portion of the text chunk, or another pertinent portion of the same electronic document that includes both the text chunk and the figure.
[0174] In some implementations, any candidate figure that has a predicted relevance that fails to satisfy a relevance criterion can be filtered out, i.e., excluded from the filtered pool of candidate figures. For example, candidate figures that have the lowest predicted relevance among the predicted relevance of all figures in the pool of candidate figures, or have a predicted relevance lower than a threshold relevance, may be filtered out.
[0175] Optionally, in some implementations, the system generates, based on the collection of text chunks, an initial pool of candidate quotes and then executes a quote filtering process on the initial pool of candidate quotes to generate a filtered pool of candidate quotes (step 406). The initial pool of candidate quotes includes quotes for potential inclusion as part of the response to the user query. The filtered pool of candidate quotes includes a smaller number of candidate quotes compared to the initial pool of candidate quotes.
[0176] To obtain the initial pool of candidate quotes, the system processes, for each text chunk in the collection of text chunks, a network input that includes the text chunk using the extraction generative neural network to generate a network output that identifies a quote from the text chunk. The quote is a proper subset of the text chunk. The quote is then included in the initial pool of candidate quotes.Attorney’ Docket No. 49220-0064W01
[0177] The quote filtering process involves determining, for each quote in the initial pool of candidate quote, a predicted relevance of the quote to the user query and then filtering the initial pool of candidate quotes based on the predicted relevance of each quote in the initial pool of candidate quotes to the user query’ to obtain the filtered pool of candidate quotes.
[0178] To determine the predicted relevance of a quote, the system processes a network input that includes (i) the quote and (ii) the user query using the text filtering generative neural network to generate a network output that defines the predicted relevance of the quote to the user query’.
[0179] In some implementations, any candidate quote that has a predicted relevance that fails to satisfy a relevance criterion can be filtered out, i.e., excluded from the filtered pool of candidate quotes. For example, candidate quotes that have the lowest predicted relevance among the predicted relevance of all quotes in the pool of candidate quotes, or have a predicted relevance lower than a threshold relevance, may be filtered out.
[0180] Optionally, in some implementations, the system generates, based on the collection of text chunks, a set of full electronic documents (step 408). Each full electronic document m the set can be a source electronic document stored in the one or more external data sources that includes at least one of the text chunks in the collection of text chunks.
[0181] The system obtains the set of full electronic documents by identifying, from the collection of text chunks, one or more text chunks that satisfy one or more selection criteria and, for each text chunk that satisfies the one or more selection criteria, retrieving, from the one or more external data sources, (a copy of) the full electronic document from which the text chunk was extracted.
[0182] To identify the one or more text chunks that satisfy one or more selection criteria, the system processes a network input that includes (i) the collection of text chunks, (ii) the user query, and, optionally, (iii ) an instruction to determine whether each text chunk in the collection of text chunks satisfies the one or more selection criteria in view of the user query, using the selection generative neural network to generate a network output that specifies whether or not each text chunk m the collection of text chunks satisfies the one or more selection criteria in view of the user query.
[0183] As mentioned previously the instruction can directly define the one or more selection criteria. An example selection criterion can specify that, if greater than a threshold number ofAttorney Docket No. 49220-0064W01text chunks is obtained from a single electronic document based on same user query, then each of these text chunks satisfies the selection criterion and, correspondingly, the electronic document should be obtained.
[0184] Another example selection criterion can specify that, if two text chunks that are obtained from a single electronic document based on same user query do not satisfy a similarity criterion with other (e.g., because they relate to two different concepts discussed in separate sections of a long electronic document), then each of these text chunks satisfies the selection criterion and, correspondingly, the electronic document should be obtained.[0185 J Another example selection criterion can specify that, if a text chunk is obtained from an electronic document that satisfies a length criterion (e.g., the electronic document is a short one that fits within the context window), then the text chunk satisfies the selection criterion and, correspondingly, the electronic document should be obtained.
[0186] The system processes a network input using the generative neural network to generate a network output that can be used to generate the response to the user query (step 410).
[0187] The network input includes (i) the user query, (li) the collection of text chunks that are obtained as a result of the automated retrieval process and that are predicted to be relevant to the user query, and (iii) data identifying the filtered pool of candidate figures. In some implementations where the filtered pool of candidate quotes is also obtained, the network input also includes the filtered pool of candidate quotes, data identifying the filtered pool of candidate quotes, or both.
[0188] The network output includes textual data to be included in the response to the user query. The network output also includes data that represents a selection by the generative neural network of one or more figures from the filtered pool of candidate figures. In some implementations where the network input also includes the filtered pool of candidate quotes, data identifying the filtered pool of candidate quotes, or both, the network output also includes data that represents a selection by the generative neural network of one or more quotes from the filtered pool of candidate quotes.
[0189] Thus, the response includes the textual data generated by the generative neural network. Moreover, the response includes a visual representation of the one or more figures that have been selected by the generative neural network. For example, the response can display the visual representations inline with or otherwise proximate to the textual data generated by the generativeAttorney Docket No. 49220-0064W01neural network. The visual representation of a selected figure can be in the form of a verbatim reproduction of the selected figure.
[0190] Optionally, the response includes the one or more quotes that have been selected by the generative neural network. For example, the response can display each of the one or more quotes in the form of a verbatim reproduction of the quote, e.g., as block quotes, enclosed in quotation marks, and / or attributed to the source electronic document from which the quote was identified, inline with or otherwise approximate to the textual data generated by the generative neural network.[0191 J In some implementations where the set of full electronic documents is also obtained, the system use the auxiliary generative neural network to process, for each full electronic document in the set of full electronic documents, a network input that includes the full electronic document and the user query to generate a network output that defines a query-focused summary that summarizes the full electronic document in view of the user query. The query-focused summary generated by the auxiliary generative neural network for each full electronic document in the set of full electronic documents collectively represent a supplemental response to the user query.
[0192] Having generated the supplemental response, the system provides it for presentation to the user. In some implementations, the query-focused summary for each full electronic document in the set of full electronic documents can be included as part of the response to the user query. For example, the query-focused summary for each full electronic document can be displayed as part of, e.g., inline with or otherwise approximate to, the response to the user query that is generated by using the generative neural network.
[0193] Generating a response in this way leverages the reasoning and semantic understanding capability of the generative neural network, which can be configured as a large language model (LLM), without the immense computational burden of training a full-fledged multi-modal neural network. This approach allows a text-based LLM to provide visually enriched responses by functioning as a high-level manager, obviating the need for it to process the image data itself.
[0194] Training a multi-modal neural network that can both process text and images is extraordinarily expensive and complex. It requires massive data, as the model must be trained on a huge, aligned dataset of images and their corresponding text descriptions, a costly and labor- intensive process.Attorney Docket No. 49220-0064W01
[0195] It also requires a complex architecture, as the model needs specialized architectures, such as a vision Transformer (ViT) or a convolutional neural network (CNN) architecture, e.g., a ResNet, to process the image data and a separate mechanism to fuse this with the text data before the final output layer. This fusion oftentimes requires alignment layers and cross-attention layers that are hard to train due to the intricacy of the alignment and cross-attention operations that they are configured to perform respectively.[0196 J It further requires a high computational cost, as the training process for a multi-modal neural network is far more resource- intensive than for a text-only LLM. Each training step involves processing both text and high-dimensional image data, leading to significantly a greater number of processor cycles and a higher energy consumption.
[0197] By contrast, the described approach, which uses a text-only LLM that functions as a semantic selector to select figures from the electronic documents stored in the one or more external data sources, is far more computationally efficient because the LLM is not required to perform resource-intensive image generation. It avoids the heavy lifting of pixel -by-pixel computation. This significantly reduces the processor cycles and energy costs associated with training a multi-modal neural network.
[0198] This approach also reduces hallucinations, as the generative neural network is not generating new images, and hence reduces the likelihood of hallucination while generating new images. For example, the generative neural network has reduced likelihood of the generating misleading or incorrect visual data compared to the multi-modal neural network.
[0199] FIG. 5 is a block diagram of an example training system 500. The training system 500 is an example of a system implemented as computer programs on one or more computers in one or more locations that trains the reward neural network 120 and the policy neural network 130 for deployment in the system 100 of FIG. 1.
[0200] The reward neural network 120 is configured to receive a network input that includes (i) the user query 102 and (ii) a set of text chunks and process the network input to generate a reward that characterizes a relevance of the set of text chunks to input query 102. Crucially, the reward neural network 120 is configured to assess the joint relevance of the set of text chunks to the user query 102 as a whole, rather than considering each individual text chunk in isolation.Attorney Docket No. 49220-0064W01
[0201] The training system 500 trains the reward neural network 120 to determine the trained values of the parameters of the reward neural network 120 on a reward neural network training dataset 510 based on optimizing a supervised learning objective function.
[0202] The reward neural network training dataset 510 includes a set of training examples. Each training example includes (i) a training query, (ii) a first set of text chunks, (iii) a second set of text chunks, and (iv) a label or another score designating either the first set of text chunks or the second set of text chunks as being more relevant to the training query. The first set of text chunks includes at least one text chunk that is not in the second set of text chunks.
[0203] For example, the label can be a binary label, e.g., where 0 indicates that the first set is more relevant and 1 indicates that the second set is more relevant. In various implementations, the labels can be generated by a human annotator, by another trained neural network, and so on,
[0204] The policy neural network 130 is configured to receive a network input that identifies the user query 102 and a current subset of a collection of text chunks, and process the network input to generate a score distribution over remaining text chunks that are in the collection of text chunks but are excluded from, i.e., are not included in, the current subset of the collection of text chunks.
[0205] The training system 500 trains the policy neural network 130 to determine the trained values of the parameters of the policy neural network 130 on a training collection of text chunks 520 using the rewards generated by the reward neural network 120 by the reinforcement learning training technique. The training collection of text chunks 620 includes a plurality of text chunks. For example, the plurality of text chunks can include text chunks that are obtained from the electronic document stored in the one or more external data sources 150.
[0206] Once trained, the training system 500 outputs data defining the trained reward neural network 120 and the trained policy neural network 130 to the system 100 of FIG. 1 or another question answering system for deployment.
[0207] For example, the data defining the trained reward neural network 120 (or, analogously, the policy neural network 130) can include weight data that defines the trained values of the parameters of the reward neural network 120 (or, analogously, the policy neural network 130) and, optionally, architecture data that defines the architecture of the reward neural network 120 (or, analogously, the policy neural network 130).Attorney Docket No. 49220-0064W01
[0208] The reward neural network 120 and the policy neural network 130 can have any appropriate architectures that enable them to perform their described functions. For example, the reward neural network 120 and the policy neural network 130 can each include any appropriate types of neural networks layers (e.g., fully-connected layers, embedding layers, attention layers, etc.) in any appropriate number (e.g., 5 layers, 10 layers, or 20 layers) and connected in any appropriate configuration (e.g., as a linear sequence of layers).
[0209] In some implementations, the reward neural network 120 (or, analogously, the policy neural network 130) can be initialized using a base language model that has been pre-trained using unsupervised learning. That is, the reward neural network 120 (or, analogously, the policy- neural network 130) can start with the same architecture and weights as (at least some part of) the base language model which has been trained on a corpus of text to perform one or more language modeling tasks that do not require labeled training examples.
[0210] For example, the reward neural network 120 (or, analogously, the policy neural network 130) can be initialized using one of the base language models described in Brown, Tom, et al. “Language models are few-shot learners.” Advances in neural information processing systems 33 (2020): 1877-1901; Raffel, Colin, et al. “Exploring the limits of transfer learning with a unified text-to-text transformer.” Journal of machine learning research 21.140 (2020): 1-67; Anil, Rohan, et al. “Palm 2 technical report.” arXiv preprint arXiv:2305.10403 (2023); Grattafiori, Aaron, et al. “The llama 3 herd of models.” arXiv preprint arXiv: 2407.21783 (2024); and Jiang, Albert Q., et al. “Mixtral of experts.” arXiv preprint arXiv: 2401.04088 (2024).
[0211] After the initialization, the reward neural network 120 can then be trained by using a fine-tuning technique, e.g., a low- rank adaptation (LoRA) fine-tuning technique, on the reward neural network training dataset 510 based on optimizing the supervised learning objective function. Analogously, after the initialization, the policy neural network 130 can then be trained by using the fine-tuning technique together with the reinforcement learning training technique on the training collection of text chunks 520 using the rewards generated by the reward neural network 120.
[0212] FIG. 6 is a flow diagram of an example process 600 for training the reward neural network. For convenience, the process 600 will be described as being performed by a system of one or more computers located in one or more locations. For example, a training system, e.g., theAttorney Docket No. 49220-0064W01training system 500 of FIG. 5, appropriately programmed in accordance with this specification can perform the process 600.
[0213] The system can repeatedly perform iterations of the process 600 on different sets of training examples to update the parameters of the reward neural network. The system can continue performing iterations of the process 600 until termination criteria for the training of the reward neural network have been satisfied, e.g., until the values of the parameters have converged, until a threshold amount of wall clock time has elapsed, or until a threshold number of iterations of the process 600 have been performed,
[0214] The system obtains a set of training examples from the reward neural network training dataset (step 602). The system will generally obtain different training examples at different iterations, e.g., by sampling a fixed number of inputs from a larger number of training examples stored in the reward neural network training dataset at each iteration.
[0215] For each training example in the set, the system processes a network input that includes (i) the training query and (ii) the first set of text chunks using the reward neural network to generate a reward for the first set of text chunks that characterizes a relevance of the first set of text chunks to training query (step 604). For example, the reward can be in the form of a score, e.g., between 0 and 1 (inclusive on both ends).
[0216] For each training example in the set, the system processes a network input that includes (i) the training query and (ii) the second set of text chunks using the reward neural network to generate a reward for the second set of text chunks that characterizes a relevance of the second set of text chunks to training query (step 606). For example, the reward can be in the form of a score (a relevance score), e.g., a score between 0 and 1 (inclusive on both ends).
[0217] Thus, for each training example, the system uses the reward neural network to generate two different rewards, one for the first set of text chunks and another for the second set of text chunks.
[0218] The system determines an update to current values of the parameters of the reward neural network based on optimizing a supervised learning objective function that measures a consistency between (i) the rewards for the first set of text chunks and the second set of text chunks and (ii) the label designating either the first set of text chunks or the second set of text chunks as being more relevant to the training query (step 608).Attorney Docket No. 49220-0064W01
[0219] The system can do this by computing, for each training example in the set, respective gradients of the supervised learning objective function with respect to the parameters of the reward neural network by backpropagation through the parameters of the reward neural network. The system can then determine the updates by applying an update rule, e.g., an Adam update rule, an Rmsprop update rule, or a stochastic gradient descent (SGD) update rule, to the respective gradients.
[0220] For example, the supervised learning objective function can be a Bradley-Terry logistic loss function:represents the first set of text chunks,represents the second set of text chunks, represents the training query’, a represents the sigmoid function, and represents the reward neural network (with 9 representing the parameters of the reward neural network).
[0221] In some implementations, all of the parameters of the reward neural network are updated whereas, in other implementations, only a subset of the parameters of the reward neural network are updated. For example, where a fine-tuning technique is used, the system will only update the current values of the parameters of the trainable low-rank adapters, while holding the values of the original parameters of the reward neural network fixed to their pre-trained values.
[0222] FIG. 7 is a flow diagram of an example process 700 for training the policy neural network. For convenience, the process 700 will be described as being performed by a system of one or more computers located in one or more locations. For example, a training system, e.g., the training system 500 of FIG. 5, appropriately programmed in accordance with this specification can perform the process 700.
[0223] The system can repeatedly perform iterations of the process 700 to update the parameters of the policy neural network. The system can continue performing iterations of the process 700 until termination criteria for the training of the policy neural network have been satisfied, e.g., until the values of the parameters have converged, until a threshold amount of wall clock time has elapsed, or until a threshold number of iterations of the process 700 have been performed.
[0224] In some implementations, iterations of the process 700 can be grouped into different training episodes, where a “training episode” refers to a plurality of iterations of the process 700 performed based on the same training query. Thus, iterations of the process 700 across differentAttorney’ Docket No. 49220-0064W01training episodes use different training queries, but all iterations of the process 700 in a single training episode use the same training query.
[0225] The system selects a subset of the training collection of text chunks in view of a training query’ using the policy neural network (step 702). The policy neural network is configured to process a network input that identifies the training query’ and a current subset of the collection of text chunks to generate a score distribution over remaining text chunks that are not included in the current subset of the collection of text chunks.
[0226] For the first (beginning) iteration in each episode, the current subset of the collection of text chunks can be a predetermined initial subset, e.g,, an empty subset or a subset of text chunks that are randomly selected or selected in accordance with some fixed selection logic. For any subsequent iteration m each episode, the current subset of the collection of text chunks can include the text chunks that have been selected using the policy neural network in any preceding iterations in the episode.
[0227] The score distribution assigns a respective score to each remaining text chunk that is not included in the current subset of the collection of text chunks. For example, the score distribution can be a probability distribution and each score assigned to a remaining text chunk can be a probability score.
[0228] The system can then select, as the subset of the training collection of text chunks, one or more text chunks from the remaining text chunks in accordance with the score distribution. For example, the system can greedily select the highest-scoring text chunks, i.e., select one or more text chunks associated with the highest scores under the score distribution, or can sample one or more text chunks in accordance with the distribution.
[0229] The system processes a network input that includes (i) the training query and (ii) the selected subset of the training collection of text chunks using the reward neural network to generate a reward that characterizes a relevance of the selected subset of the training collection of text chunks to the training query (step 704).
[0230] The system determines an update to current values of the parameters of the policy neural network based on backpropagation by using a reinforcement learning training technique that uses the reward generated by the reward neural network as an optimization target (step 706).
[0231] In some implementations, all of the parameters of the policy neural network are updated whereas, in other implementations, only a subset of the parameters of the policy neural networkAttorney Docket No. 49220-0064W01are updated. For example, where a fine-tuning technique is used, the system will only update the current values of the parameters of the trainable low-rank adapters, while holding the values of the original parameters of the policy neural network fixed to their pre-trained values.
[0232] The reinforcement learning training technique can be any reinforcement learning training technique that can train the policy neural network to generate a score distribution that, when used to select a subset of the training collection of text chunks, can increase the reward to be generated by the reward neural network, i.e., can result in the selection of a subset of the training collection of text chunks that has improved relevance to the training query.
[0233] For example, the reinforcement learning training technique can be a proximal policy optimization (PPO) technique, as described in Schulman, John, et al. “Proximal policy optimization algorithms.” arXiv preprint arXiv: 1707.06347 (2017).
[0234] As another example, the reinforcement learning training technique can be a group relative policy optimization (GRPO) technique, as described in Shao, Zhihong, et al. “Deepseekmath: Pushing the limits of mathematical reasoning in open language models.” arXiv preprint arXiv:2402.03300 (2024).
[0235] As another, the reinforcement learning training technique can be a direct preference optimization (DPO) technique, as described in Rafailov, Rafael, et al. “Direct preference optimization: Your language model is secretly a reward model.” Advances in neural information processing systems 36 (2023): 53728-53741.
[0236] FIG. 8 is a flow diagram of another example process 800 for generating a response to a user query. For convenience, the process 800 will be described as being performed by one or more systems of one or more computers located in one or more locations. For example, a system, e.g., the system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 800.
[0237] The system can perform the process 800 in response to receiving the user query, e.g., from a user through a user interface of a user device of the user, to generate a response to the user query. Once generated, the system can provide the response for presentation to the user, e.g., within the user interface on a display device of the user device.
[0238] The system executes an automated retrieval process based on the user query to identify, from the corpus of electronic documents stored in the one or more external data sources, a collection of text chunks that are predicted to be relevant to the user query (step 802). ForAttorney Docket No. 49220-0064W01example, the collection of text chunks can include text chunks that satisfy a similarity criterion with the user query. There are many ways in which the automated retrieval process can be performed, as similarly discussed above with reference to step 402 of FIG. 4.
[0239] The system selects, for inclusion in a network input to be processed by the generative neural network, a subset of the collection of text chunks using the reward neural network (step 804). There are many ways in which the reward neural network can be used to facilitate this selection.
[0240] In some implementations, the system partitions the collection of text chunks into smaller subsets that can more practically fit within the context window of the reward neural network. Each smaller subset includes a different subset of the text chunks included in the collection of text chunks.
[0241] For each smaller subset, the system processes a network input that includes (i) the user query and (ii) the smaller subset of text chunks using the reward neural network to generate a reward that characterizes a relevance of the smaller subset of text chunks to input query as a whole, i.e., rather than characterizing an individual relevance of each text chunk in the smaller subset to input query.
[0242] In these implementations, the system selects, as the subset of the collection of text chunks for inclusion in the network input to be processed by the generative neural network, one or more smaller subsets that each have a reward generated by using the reward neural network that satisfies a relevance threshold, e.g., that is greater than a threshold score where the reward is in the form of a score.
[0243] In some implementations, the system executes the selection step by way of a performing numerical optimization process. The numerical optimization process involves maximizing a numerical optimization objective that is defined based on (i) a total number of selected text chunks, and ( ii) a relevance to the user query as measured using the reward neural network, with the aim to identify a subset of the collection of text chunks that includes fewer than a maximum threshold number of text chunks, while having a highest relevance as a whole to the user query as measured using the reward neural network.
[0244] For example, the system can use a beam search algorithm or another heuristic search algorithm together with the reward neural network to improve computational resource efficiency when implementing the numerical optimization process, e.g., to avoid incurring significantAttorney Docket No. 49220-0064W01computational resource overhead when the size of the collection of text chunks is too vast to explore exhaustively.
[0245] For example, where the beam search algorithm is used, the system performs an initial step to identify K text chunks (where K refers to the “beam width,” which is a tunable hyperparameter), and then repeatedly performs an expansion step to identify additional text chunks using the rewards generated by the reward neural network, followed by a pruning step to discard some of the selected text chunks using those rewards, until an termination criterion of the numerical optimization process is satisfied.
[0246] The system processes a network input that includes (i) the user query and (ii) the selected subset of the collection of text chunks using the generative neural network to generate a network output that can be used to generate the response to the user query (step 806). The network output includes at least textual data to be included in the response to the user query.
[0247] FIG. 9 is a flow diagram of another example process 900 for generating a response to a user query. For convenience, the process 900 will be described as being performed by one or more systems of one or more computers located in one or more locations. For example, a system, e.g., the system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 900.
[0248] The system can perform the process 900 in response to receiving the user query, e.g., from a user through a user interface of a user device of the user, to generate a response to the user query. Once generated, the system can provide the response for presentation to the user, e.g., within the user interface on a display device of the user device.
[0249] The system executes an automated retrieval process based on the user query to identify, from the corpus of electronic documents stored in the one or more external data sources, a collection of text chunks that are predicted to be relevant to the user query (step 902). For example, the collection of text chunks can include text chunks that satisfy a similarity criterion with the user query. There are many ways in which the automated retrieval process can be performed, as similarly discussed above with reference to step 402 of FIG. 4.
[0250] The system then repeatedly performs a plurality of iterations of steps 904-908 to select a subset of the collection of text chunks for inclusion in a network input to be processed by the generative neural network. The system can continue performing iterations of the steps 904-908 until termination criteria for the selection of the text chunks have been satisfied, e.g., until aAttorney Docket No. 49220-0064W01threshold number of text chunks have been selected, until a threshold amount of wall clock time has elapsed, or until a threshold number of iterations of the steps 904-908 have been performed.
[0251] At each iteration, the system selects at least a text chunk using the policy neural network from the collection of text chunks. The final subset of the collection of text chunks to be processed as part of the network input includes all of the text chunks selected across the plurality of iterations, but includes fewer than all of the text chunks included in the collection that is identified in step 902.
[0252] The system processes a network input that identifies the user query and a current subset of the collection of text chunks using the policy neural network to generate a score distribution over remaining text chunks that are in the collection of text chunks but are excluded from, i.e., are not included in, the current subset of the collection of text chunks (step 904).
[0253] The score distribution assigns a respective score to each remaining text chunk that is not included in the current subset of the collection of text chunks. For example, the score distribution can be a probability distribution and each score assigned to a remaining text chunk can be a probability score.
[0254] For the first (beginning) iteration, the current subset of the collection of text chunks can be a predetermined initial subset, e.g., an empty subset or a subset of text chunks that are randomly selected or selected in accordance with some fixed selection logic. For any subsequent iteration, the current subset of the collection of text chunks can include the text chunks that have been selected using the policy neural network in any preceding iterations.
[0255] The system selects one or more text chunks from the remaining text chunks in accordance with the score distribution (step 906). For example, the system can greedily select the highest- scoring text chunks, i.e., select one or more text chunks associated with the highest scores under the score distribution, or can sample one or more text chunks in accordance with the distribution.
[0256] The system adds the one or more selected text chunks to the current subset of the collection of text chunks (step 908).
[0257] The system processes a network input that includes (i) the user query and (ii) the selected subset of the collection of text chunks using the generative neural network to generate a network output that can be used to generate the response to the user query (step 910). The network output includes at least textual data to be included in the response to the user query.Attorney Docket No. 49220-0064WO1
[0258] FIG. 10 is an illustration of example operations performed by the system 100 to generate the response 126 to the user query 102 in accordance with some implementations.
[0259] The system 100 receives the user query' 102 from the user and then executes a plurality of iterations of a machine learning process to identify, from the corpus of electronic documents stored in the one or more external data sources 150, a final set of text chunks 281 that are predicted to be relevant to the user query 102. For example, the final set of text chunks 281 can include text chunks that satisfy a similarity criterion with the user query 102.
[0260] At each iteration of the machine learning process, the system 100 processes a network input that includes at least the user query 102 the using the planner generative neural network 270 to generate a network output. The network output defines a plurality of internal queries, e.g., Q_l, Q_2, and so on, up to Q_N.
[0261] Each internal query' requests additional information that is predicted by the planner generative neural network 270 to be relevant to the user query / 102, but that is not yet included in the user query 102, For example, the additional information can include plausible explanations of an ambiguous symptom description contained in the user query / 102, As another example, the additional information can include predictions of missing context that is unspecified in the user query 102.
[0262] For each of the plurality of internal queries, the system 100 performs an automated retrieval process to obtain, from the one or more external data sources 150, one or more text chunks that are predicted to be relevant to the internal query, e.g., one or more text chunks that are predicted to be relevant to Q_1, one or more text chunks that are predicted to be relevant to Q_2, and so on.
[0263] The one or more text chunks that obtained based on each of the plurality of internal queries are then added to a current set of text chunks 271 that corresponds to the iteration of the machine learning process.
[0264] In some implementations, the system 100 processes the plurality of internal queries substantially in parallel to reduce the overall time needed to obtain the respective text chunks relevant to the plurality of internal queries. For example, the system 100 can execute a first automated retrieval process independently of and substantially in parallel with a second automated retrieval process, where the first automated retrieval process obtains one or more text chunks that are predicted to be relevant to the first internal query Q_1 and the second automatedAttorney Docket No. 49220-0064W01retrieval process obtains one or more text chunks that are predicted to be relevant to the second internal query Q_2
[0265] Having performed the automated retrieval processes to obtain the current set of text chunks 271 that corresponds to the iteration of the machine learning process, the system 100 processes a network input that includes the current set of text chunks 271 that corresponds to the iteration of the machine learning process using the switching generative neural network 290 to generate a classification output which classifies whether the current set of text chunks 271 is collectively responsive to the user query 102.
[0266] When the classification output classifies that the current set of text chunks 271 is collectively unresponsive to the user query, the system 100 proceeds to perform another iteration of the machine learning process to obtain additional text chunks that are predicted to be relevant to the query 102. That is, the iterative machine learning process continues.
[0267] Alternatively, when the classification output classifies that the current set of text chunks 271 is collectively responsive to the user query, the system 100 terminates the iterative machine learning process, such that the iteration of the machine learning process during which the current set of text chunks 271 is obtained becomes the last iteration of the machine learning process.
[0268] The system 100 proceeds to generate the response 126 based on a final set of text chunks 281 by using the synthesis generative neural network 260 after having executed the iterative machine learning process. The final set of text chunks 281 is the current set of text chunks 271 obtained in the last iteration of the machine learning process.
[0269] The system 100 processes a network input that includes the final set of text chunks 281, data derived from the final set of text chunks 281, or both using the synthesis generative neural network 260 to generate a network output that defines the response 126 to the user query 102.
[0270] Several technical issues may nevertheless arise when the final set 281 includes a large number of text chunks, e.g., as a result of a large number of iterations of the machine learning process, each having a large number of internal queries. For example, excessive size of the final set of text chunks 281 can increase the risk of hallucinations in generating the response 126 to the user query 102, e.g., as the synthesis generative neural network 260 that processes the final set of text chunks 281 may become overwhelmed by potentially irrelevant content and noise included therein.Attorney Docket No. 49220-0064W01
[0271] Thus, in some implementations, the network input to the synthesis generative neural network 260 includes a compressed version of the final set of text chunks 281, either in place of or in addition to the final set of text chunks 281. The compressed version of the final set of text chunks 281 includes, for each text chunk in the final set, a compressed version of text chunk that is shorter than the text chunk itself.
[0272] In some implementations where the compressed version is used to replace the final set of text chunks 281, the system 100 further conserves computational resource consumption by the synthesis generative neural network 260 when generating the response 126 because the compressed version of the response requires fewer computational resources than the original response, e.g., less memory to store and less compute to process,[0273 J To generate compressed version of the final set of text chunks 281, the system 100 processes a network input that includes the final set of text chunks 281 using the compression generative neural network 280 to generate a network output that defines the compressed version of the final set of text chunks 281.
[0274] FIG. 11 is a flow diagram of another example process 1100 for generating a response to a user query. For convenience, the process 1100 will be described as being performed by one or more systems of one or more computers located in one or more locations. For example, a system, e.g., the system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 1100.
[0275] The system can perform the process 1100 in response to receiving the user query, e.g., from a user through a user interface of a user device of the user, to generate a response to the user query. Once generated, the system can provide the response for presentation to the user, e.g., within the user interface on a display device of the user device.
[0276] To generate the response to the user query, the system performs a plurality of iterations of a machine learning process to identify, from the corpus of electronic documents stored in the one or more external data sources, a final set of text chunks that are predicted to be relevant to the user query. Each iteration of the machine learning process includes steps 1102-1110. That is, the final set of text chunks is obtained in the last iteration of a plurality of iterations of steps 1102-1110.
[0277] At each iteration of the machine learning process, the system processes a network input that includes at least the user query the using the planner generative neural network to generate aAttorney Docket No. 49220-0064W01network output (step 1102). The network output defines a plurality of internal queries. Each internal query requests additional information that is predicted by the planner generative neural network to be relevant to the user query, but that is not yet included in the user query.
[0278] When the iteration is not the first (beginning) iteration, the network input can also include the internal queries generated in any preceding iterations, the text chunks selected based on the internal queries generated in any preceding iterations, or both.
[0279] Suppose that the user query is a medical question: “treatments for psoriasis.” By virtue of processing the user query, the planner generative neural network can generate internal queries that request more information about psoriasis treatments. Examples of such internal queries that can be generated by the planner generative neural network include:o “What are topical therapies for psoriasis?”o “What is phototherapy for psoriasis?”o “What are systemic non-biologics for psoriasis?”o “What are biologic therapies for psoriasis?”o “What are treatment selection factors for psoriasis?”o “What are pediatric / geriatric treatment options for psoriasis?”o “What are emerging therapies for psoriasis?”o “What are long-term management strategies for psoriasis?”o “What are non-pharmacologic interventions for psoriasis?”
[0280] For each of the plurality of internal queries, the system performs an automated retrieval process to obtain, from the one or more external data sources, one or more text chunks that are predicted to be relevant to the internal query (step 1104). For example, for each internal query, performing the automated retrieval process can obtain one or more text chunks that satisfy a similarity criterion with the internal query.
[0281] There are many ways in which the automated retrieval process can be performed, as similarly discussed above with reference to step 402 of FIG. 4. In some implementations, the system processes the plurality of internal queries substantially in parallel to reduce the overall time needed to obtain the respective text chunks relevant to the plurality of internal queries.
[0282] For example, the system can execute a first automated retrieval process independently of and substantially in parallel with a second automated retrieval process, e.g., on different computing units, where the first automated retrieval process retrieves text chunks that areAttorney Docket No. 49220-0064W01relevant to the internal query “What are topical therapies for psoriasis?” and the second automated retrieval process retrieves text chunks that are relevant to the internal query “What is phototherapy for psoriasis?”
[0283] Throughout this specification, a “computing unit” may be, e.g., a computer, a core within a computer having multiple cores, or other hardware or software, e.g., a dedicated thread, within a computer capable of independently perform operations. The computing units may include processor cores, processors, microprocessors, special-purpose logic circuitry, e.g., an FPGA (field-programmable gate array) or an ASIC (application-specific integrated circuit), or any other appropriate computing units. In some examples, the computing units are all the same type of computing unit. In other examples, the computing units may be different types of computing units. For example, one computing unit may be a CPU while other computing units may be GPUs.
[0284] The system adds the one or more selected text chunks that are obtained based on each of the plurality of internal queries to a current set of text chunks that correspond to the iteration of the machine learning process (step 1106).
[0285] For the first (beginning) iteration, the current set of text chunks can be initialized as a predetermined initial subset, e.g., an empty subset or a subset of text chunks that are randomly selected or selected in accordance with some fixed selection logic. Thus, the current subset of the collection of text chunks includes the one or more selected text chunks that are obtained based on each of the plurality of internal queries generated in the iteration.
[0286] For any subsequent iteration, the current set of text chunks can include the text chunks that have been selected based on the internal queries generated in any preceding iterations. Thus, the current subset of the collection of text chunks includes the one or more selected text chunks that are obtained based on each of the plurality of internal queries generated in the iteration, in addition to one or more selected text chunks that are obtained based on each of a plurality of internal queries generated in at least a preceding iteration.
[0287] The system processes a network input that includes (i) the user query, (ii) the current set of text chunks that correspond to the iteration of the machine learning process, and, optionally, (iii) an instruction to classify whether or not the current set of text chunks are collectively responsive to the user query using the switching generative neural network to generate a classification output (step 1108).Attorney Docket No. 49220-0064W01
[0288] The classification output classifies whether or not the current set of text chunks is collectively responsive to the user query. As mentioned previously the instruction can directly define one or more responsiveness criteria in accordance with which the switching generative neural network generates this classification output.[0289 J An example responsiveness criterion can specify that the current set of text chunks should have an information density with respect to the user query that satisfies an information density criterion. Examples of measures of information density include lexical richness / diversity, extractive fragment density, and so on. Another example responsiveness criterion can specify that the current set of text chunks should satisfy a relevance criterion with respect to the user query'. Another example responsiveness criterion can specify that the current set of text chunks satisfy a completeness criterion with respect to the user query.
[0290] The system determines, from the classification output, whether or not the current set of text chunks is collectively responsive to the user query (step 1110).
[0291] In response to determining that the current set of text chunks is not collectively responsive to the user query, the process 1100 returns from step 1110 to step 1102, and an additional iteration of steps 1102-1110 is performed. That is, the iterative machine learning process continues.
[0292] In response to determining that the current set of text chunks are collectively responsive to the user query, the process 1100 proceeds from step 1110 to step 1112, and no further iteration of steps 1102-1108 is performed. That is, the iterative machine learning process terminates.
[0293] The system processes a network input that includes (i) the final set of text chunks, (ii) data derived from the final set of text chunks, e.g., the compressed version of the final set of text chunks, or both (i) and (ii) using the synthesis generative neural network to generate a network output that can be used to generate the response to the user query (step 1112). The final set of text chunks is the current set of text chunks obtained in the last iteration of the plurality of iterations of steps 1102-1108. The network output includes at least textual data to be included in the response to the user query.
[0294] Suppose that, during a first iteration of the machine learning process, the system obtains a first set of text chunks which is collectively unresponsive to the user query', as classified by the switching generative neural network.Attorney Docket No. 49220-0064W01
[0295] Thus, the system moves on to perform a second iteration of the machine learning process, during which the system obtains a second set of text chunks which is collectively responsive to the user query, as classified by the switching generative neural network. The second set of text chunks that is obtained based on a plurality of internal queries generated during the second iteration collectively define an additional set of text chunks to be retrieved from the one or more external data sources.
[0296] In this example, the network input to be processed by the synthesis generative neural network for generating the network output includes (i) the first set of text chunks obtained during the first iteration of the machine learning process and (li) the second set of text chunks obtained during the second iteration of the machine learning process,
[0297] Leveraging the switching generative neural network, the system has the capability to control the “deepness” of iterative machine learning process, measured by the number of internal queries the planner generative neural network generates. This capability is technically advantageous because it allows for a dynamic trade-off between computational cost and response quality.
[0298] In the iterative machine learning process, both using the planner generative neural network to generate the plurality of internal queries as well as the follow-on automated retrieval processes consume a significant amount of computational resources (significant memory and processor cycles).
[0299] This fine-grained control capability is critical for optimizing resource allocation, especially in large-scale deployments of the system. It allows the system to optimize for different responses because not all responses require the same level of depth. A quick fact-check user query needs minimal clarification, while a complex technical diagnosis user query might require several rounds. The ability to dynamically set the “deepness” allows the system to operate in different modes to achieve optimal resource allocation.
[0300] On the one hand, the system can operate in “shallow mode” (where a small number of internal queries are generated) in response to common, well-defined user queries. In this mode, the system generates a quick response with no noticeable latency, even if the response isn’t perfectly comprehensive. This is ideal for user queries where speed is prioritized over exhaustiveness. This also saves computational resources for responses that genuinely require more intensive processing.Attorney Docket No. 49220-0064W01
[0301] On the other hand, the system can operate in “deep mode” (where a large number of internal queries are generated) in response to complex, ambiguous user queries. In this mode, the system can generate multiple internal queries in an iterative manner to ensure accuracy and thoroughness in the responses. The system can be configured to operate in this mode when the computational cost is justified by the required quality of the responses.
[0302] This specification uses the term “configured” in connection with systems and computer program components. For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that m operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.
[0303] Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them.Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus.
[0304] The term “data processing apparatus” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further include, special purpose logic circuitry’, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment forAttorney Docket No. 49220-0064W01computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
[0305] A computer program, which may also be referred to or described as a program, software, a software application, an app, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages; and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code, A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network.
[0306] In this specification the term “engine” is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions. Generally, an engine will be implemented as one or more software modules or components, installed on one or more computers in one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines can be installed and running on the same computer or computers.
[0307] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.
[0308] Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporatedAttorney Docket No. 49220-0064WO1in, special purpose logic circuitry'. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.
[0309] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; andCD-ROM and DVD-ROM disks.
[0310] To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user’s device in response to requests received from the web browser. Also, a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone that is running a messaging application, and receiving responsive messages from the user in return.
[0311] Data processing apparatus for implementing machine learning models can also include, for example, special-purpose hardware accelerator units for processing common and compute¬ intensive parts of machine learning training or production, i.e., inference, workloads.
[0312] Machine learning models can be implemented and deployed using a machine learning framework, e g., a TensorFlow’ framework, or a Jax framework.Attorney Docket No. 49220-0064W01
[0313] Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification, or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.
[0314] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, a server transmits data, e.g., an HTML page, to a user device, e.g., for purposes of displaying data to and receiving user input from a user interacting with the device, which acts as a client. Data generated at the user device, e.g., a result of the user interaction, can be received at the server from the device.
[0315] 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.
[0316] 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,Attorney Docket No. 49220-0064W01to 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.
[0317] 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
Attorney Docket No. 49220-0064WO1CLAIMS1. A method performed by one or more computers, the method comprising:receiving a user query from a user;generating a response to the user query, comprising:processing the user query to identify a collection of text chunks that are predicted to be relevant to the user query;generating a pool of candidate figures for inclusion in the response to the user query’; andprocessing a network input that comprises: (i) the user query, (ii) the collection of text chunks that are predicted to be relevant to the query, and (iii) data identifying the pool of candidate figures, using a generative neural network and in accordance with trained values of a set of generative neural network parameters, to generate a network output,wherein the network output comprises textual data defining a response to the user query' and also selects one or more figures from the pool of candidate figures; and presenting the response to the user query on a display of a user device, wherein the response displays a visual representation of the one or more figures selected by the generative neural network inline with the textual data generated by the generative neural network.
2. The method of claim 1, wherein the network input that is processed by the generative neural network comprises, for each candidate figure in the pool of candidate figures, a textual description of the candidate figure.
3. The method of claim 1, wherein the network input that is processed by the generative neural network includes a unique identifier for each figure in the pool of candidate figures; and wherein to select a figure from the pool of candidate figures, the network output generated by the generative neural network includes a sentinel string that comprises the unique identifier for the figure.
4. The method of claim 1, wherein generating the pool of candidate figures for inclusion in the response to the user query comprises, for each of a plurality of text chunks from the collection of text chunks:processing the text chunk to determine that the text chunk references a figure; andAttorney Docket No. 49220-0064W01in response, including the figure in the pool of candidate figures for inclusion in the response to the user query.
5. The method of claim 1, further comprising, prior to processing the network input that comprises data identifying the pool of candidate figures using the generative neural network, filtering the pool of candidate figures by performing operations comprising:determining, for each figure in the pool of candidate figures, a predicted relevance of the figure to the user query, comprising:processing a network input that comprises: (i) a textual description of the figure, and (ii) the user query, using a figure filtering generative neural network to generate a network output that defines the predicted relevance of the figure to the user query; andfiltering a plurality of figures from the pool of candidate figures based on the predicted relevance of each figure in the pool of candidate figures to the user query.
6. The method of claim 1, wherein generating the response to the user query further comprises:generating a pool of candidate quotes for inclusion in the response to the user query, wherein each candidate quote is extracted from a respective text chunk from the collection of text chunks;wherein the network input to the generative neural network further comprises: (iv) data identifying the pool of candidate quotes; andwherein the network output generated by the generative neural network also selects one or more quotes from the pool of candidate quotes; andwherein the response displays the one or more quotes selected by the generative neural network as block quotes inline with the textual data generated by the generative neural network.
7. The method of claim 6, wherein the network input that is processed by the generative neural network includes a unique identifier for each quote from the pool of candidate quotes; and wherein to select a quote from the pool of candidate quotes, the network output generated by the generative neural network includes a sentinel string that comprises the unique identifier for the quote.Attorney Docket No. 49220-0064W018. The method of claim 6, wherein generating the pool of candidate quotes for inclusion in the response to the user query comprises, for each of a plurality of text chunks from the collection of text chunks:processing a network input comprising: (i) the text chunk, and (ii) an instruction to identify a quote from the text chunk that is relevant to the user query, using an extraction generative neural network to generate a network output that identifies a quote from the text chunk, wherein the quote comprises less than all of the text chunk; andincluding the quote from the text chunk in the pool of candidate quotes.
9. The method of claim 6, further comprising, prior to processing the network input that comprises data identifying the pool of candidate quotes using the generative neural network, filtering the pool of candidate quotes by performing operations comprising:determining, for each quote in the pool of candidate quotes, a predicted relevance of the candidate quote to the user query, comprising:processing a network input that comprises: (i) the quote, and (ii) the user query, using a text filtering generative neural network to generate a network output that defines the predicted relevance of the quote to the user query; andfiltering a plurality of quotes from the pool of candidate quotes based on the predicted relevance of each quote in the pool of candidate quotes to the user query,10. The method of claim 1, wherein generating the response to the user query further comprises, for each of one or more text chunks from the collection of text chunks:determining that the text chunk satisfies one or more selection criteria;in response, retrieving a full document from which the text chunk w'as extracted; and generating a supplemental response to the user query based on the full document from which the text chunk was extracted, comprising:processing a network input that comprises: (i) the full document from which the text chunk was extracted, and (ii) user query, using an auxiliary generative neural network to generate a network output that summarizes the full document from which the text chunk was extracted in view of the user query;wherein the supplemental response to the user query is displayed inline with the response to the user query.Attorney Docket No. 49220-0064W0111. A method performed by one or more computers, the method comprising:obtaining a set of training examples, wherein each training example comprises: (i) a training query, (ii) a first set of text chunks, (iii) a second set of text chunks, and (iv) a label designating either the first set of text chunks or the second set of text chunks as being more relevant to the training query; andtraining a reward neural network on the set of training examples, w’herein the reward neural network is configured to:receive a network input that comprises an input query and an input set of text chunks; andprocess the network input in accordance with values of a set of reward neural network parameters to generate a reward that characterizes a relevance of the input set of text chunks to input query,12. The method of claim 11, wherein training the reward neural network on the set of training examples comprises, for each training example:processing a network input comprising: (i) the training query, and (ii) the first set of text chunks using the reward neural network to generate a relevance score for the first set of text chunks;processing a network input comprising: (i) the training query, and (ii) the second set of text chunks using the reward neural network to generate a relevance score for the second set of text chunks; andtraining the reward neural network to optimize an objective function that measures a consistency between: (i) the relevance scores for the first set of text chunks and the second set of text chunks, and (ii) the label designating either the first set of text chunks or the second set of text chunks as being more relevant to the training query.
13. The method of claim 11, further comprising:receiving a user query from a user;generating a response to the user query, comprising:processing the user query to identify a collection of text chunks that are predicted to be relevant to the query;selecting a subset of the collection of text chunks for inclusion in a network inputAttorney Docket No. 49220-0064WO1to be processed by a generative neural network using the reward neural network; and processing a network input that comprises: (i) the user query’, and (h) the selected subset of the collection of text chunks, using a generative neural network to generate a network output that defines a response to the user query; andpresenting the response to the user query on a display of a user device.
14. The method of claim 13, wherein selecting the subset of the collection of text chunks for inclusion in the network input to be processed by the generative neural network using the reward neural network comprises:selecting the subset of the collection of text chunks as a result of a numerical optimization that aims to identify a subset of the collection of text chunks having:(i) fewer than a maximum threshold number of text chunks, and(ii) a highest relevance to the user query as measured using the reward neural network.
15. The method of claim 14, wherein the numerical optimization is implemented using a beam search algorithm.
16. The method of claim 11, further comprising:receiving a user query from a user;generating a response to the user query, comprising:processing the user query to identify a collection of text chunks that are predicted to be relevant to the query';selecting a subset of the collection of text chunks for inclusion in a network input to be processed by a generative neural network, comprising, at each of a plurality of iterations:processing a network input that identifies the user query and a current subset of the collection of text chunks using a policy neural network to generate a score distribution over text chunks that are not included in the current subset of the collection of text chunks; and selecting a text chunk in accordance with the score distribution; and adding the selected text chunk to the current subset of the collection of text chunks;wherein the policy neural network has been trained using rewards generated byAttorney Docket No. 49220-0064WO1the reward neural network by a reinforcement learning training technique;processing a network input that comprises: (i) the user query, and (li) the selected subset of the collection of text chunks, using a generative neural network to generate a network output that defines a response to the user query; andpresenting the response to the user query on a display of a user device.
17. The method of claim 16, wherein training the policy neural network using rewards generated by the reward neural network by the reinforcement learning training technique comprises, at each of a plurality' of training episodes:selecting a subset of a training collection of text chunks in view of a training query using the policy neural network;processing a network input comprising: (i) the training query’, and (li) the selected subset of the training collection of text chunks, using the reward neural network to generate a reward; andtraining the policy neural network using the reward by the reinforcement learning training technique.
18. The method of claim 16, wherein selecting a text chunk in accordance w’ith the score distribution comprises:selecting a text chunk associated with a highest score under the score distribution.
19. A method performed by one or more computers, the method comprising:receiving a user query from a user;generating a response to the user query, comprising:performing an automated retrieval process to obtain a set of text chunks that are predicted to be relevant to the user query;processing a network input comprising the set of text chunks using a switching generative neural network to generate a classification output which classifies whether the set of text chunks are collectively responsive to the user query;determining, based on the classification output, that the set of text chunks are not collectively responsive to the user query; andin response, performing an additional automated retrieval process to obtain anAttorney Docket No. 49220-0064W01additional set of text chunks that are predicted to be relevant to the query; andprocessing a network input that comprises: (i) at least some of the set of text chunks, and (ii) at least some of the additional set of text chunks, using a synthesis generative neural network to generate a network output that defines a response to the user query.
20. The method of claim 19, wherein performing the additional automated retrieval process to obtain the additional set of text chunks comprises:processing a network input comprising the user query using a planner generative neural network to generate a network output that defines a plurality of internal queries, wherein each internal query requests information that is predicted to be relevant to the user query; and performing, for each of the plurality of internal queries, an automated retrieval process to obtain new text chunks that are predicted to be relevant to the internal query';wherein the new text chunks that obtained based on the plurality' of internal queries collectively define the additional set of text chunks.
21. The method of claim 19, further comprising:processing a network input that comprises: (i) at least some of the set of text chunks, and (ii) at least some of the additional set of text chunks, and (hi) an instruction to generate a compressed version of a response to the user query, using a compression generative neural network to generate a network output that defines a compressed version of (i) the at least some of the set of text chunks and (ii) the at least some of the additional set of text chunks;wherein the network input to the synthesis generative neural network further comprises the compressed version.
22. 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 user query from a user;generating a response to the user query, comprising:processing the user query to identify a collection of text chunks that are predictedAttorney Docket No. 49220-0064W01to be relevant to the query;generating a pool of candidate figures for inclusion in the response to the user query; andprocessing a network input that comprises: (i) the user query, (ii) the collection of text chunks that are predicted to be relevant to the query, and (iii) data identifying the pool of candidate figures, using a generative neural network and in accordance with trained values of a set of generative neural network parameters, to generate a network output,wherein the network output comprises textual data defining a response to the user query / and also selects one or more figures from the pool of candidate figures; and presenting the response to the user query on a display of a user device, wherein the response displays a visual representation of the one or more figures selected by the generative neural network inline with the textual data generated by the generative neural network.
