Enhancing machine learning language models using search engine results
By using conditional search engine results on mobile devices as input, the problem of large-scale language model computing resource consumption and information staleness is solved, enabling efficient and accurate language processing and prediction, suitable for edge devices.
Patent Information
- Application Number
- CN202380019196.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-31
- Filing Date
- 2023-01-31
- Publication Date
- 2024-08-30
AI Technical Summary
Large-scale language models require significant computing resources and time when processing network input, especially on mobile devices, and existing systems rely on stale information resulting in inaccurate predictions and requiring frequent retraining to keep the information up to date.
By using search engine query results as conditional input, leverage smaller language models to process web input on mobile devices and generate more accurate predictions through multiple search engine results, reducing computational load and retraining requirements, suitable for edge devices .
It achieves efficient language processing on limited memory and computing resources, generates more accurate and timely predictions, reduces computing resource consumption and retraining frequency, and improves answer quality.
Smart Images

Figure CN118575173A
Abstract
Description
Background Art
[0001] This specification relates to processing input using a neural network.
[0002] A neural network is a machine learning model that uses one or more layers of nonlinear units to predict an output for a received input. Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to the next layer in the network (e.g., the next hidden layer or the output layer). Each layer of the network generates an output from the received input based on the current values of the corresponding set of parameters. Summary of the invention
[0003] This specification describes a system implemented as a computer program on one or more computers in one or more locations that executes a neural network configured to process a network input representing input text and generate a network output representing a prediction about the input text.
[0004] To generate the network output, the system is configured to generate a search engine query for a search engine from the input text, and obtain a set of results from the search engine in response to the query. The system can then include the results of the search engine query into the network input before processing the network input using the neural network. In this way, the system can utilize significantly fewer computing resources than would otherwise be required to perform language processing tasks, such as question answering, using neural networks, for example. Moreover, because the network output can contain information embedded in the search engine results, including up-to-date information that was not available during the training of the neural network, predictions about the input text can be improved.
[0005] The subject matter described in this specification can be implemented in specific embodiments to realize one or more of the following advantages.
[0006] Large-scale language models implemented as neural networks can produce excellent results on a range of natural language processing tasks, including question answering. However, implementations of some of these models (particularly Transformer-based models) can have over a billion parameters and can require a lot of computing resources, power, and time to process the network input to generate the network output. Sometimes, such models can have over 1 billion or over 10 billion parameters. If such models are used at scale to serve a large number of user requests, they will consume a lot of energy.
[0007] Additional considerations arise when implementing a neural network on a digital assistant device (e.g., a mobile device) implemented in a computing system that includes back-end components, particularly data servers, that communicate with the digital assistant device over a data communications network such as the Internet. It is then desirable to optimize the computational load between the digital assistant device and the back-end components. This need can be particularly acute for large-scale language models because of their substantial memory and computation requirements compared to those typically seen on mobile devices.
[0008] The techniques described herein address these problems. In some embodiments, the described techniques facilitate reduced computational load and improved load distribution, particularly when large-scale language models are implemented as neural networks in multi-tasking and parallel processing computer systems, distributed across multiple sites and interconnected by a data communications network.
[0009] In some embodiments, the described techniques enable beneficial distribution of computational loads between local mobile computing devices and backend servers in a network. More specifically, in embodiments, by conditioning a language model neural network on multiple conditioning inputs representing documents obtained from an Internet search based on a question and question data from the question, a smaller language model neural network can be used, which facilitates implementation of the neural network on mobile devices with limited memory and computational resources.
[0010] Furthermore, using the techniques described in this specification, the system can utilize search engine results to generate predictions about input text using the latest information included in the search engine results. Some existing systems use pre-trained neural networks without access to such search engine results to generate predictions, and therefore the predictions may be less reliable because the neural network can only encode information that was available to the neural network during training; that is, the predictions may rely on stale information and therefore be incorrect or at least out of date. Therefore, using the techniques described in this specification, the system can generate more accurate and timely predictions.
[0011] In addition, some existing systems must repeatedly retrain the neural network to ensure that the neural network encodes the latest information. Because the system described in this specification can repeatedly access new search engine results, the system does not need to retrain the neural network, thereby saving a lot of computing resources.
[0012] Using the techniques described in this specification, a system can generate predictions for input text using information encoded in multiple different documents provided by a search engine in response to processing a search engine query. Each of the multiple different documents can include corresponding different information related to the prediction. Therefore, the prediction generated by the system can be more accurate than a prediction generated using a single document.
[0013] Furthermore, by generating multiple answers using multiple retrieved evidence (i.e., multiple different conditioning inputs), followed by a re-ranking phase using scores generated by the same language model neural network that generated the answers, the described system improves the quality of the generated answers without requiring a larger, more difficult to train neural network. That is, by enhancing the generation process as described above, the system can generate answers that exceed the quality of those generated by a larger neural network that does not access a search engine or that generates only a single answer in response to an input that includes a single conditioning input. Thus, these enhancement techniques can alleviate the lower performance issues of smaller pre-trained neural networks and can be particularly suitable for deployment on devices with constrained memory space, such as on mobile devices, smart speakers, or other edge devices, which effectively prevents them from storing models with extremely large computational footprints, such as storing extremely large numbers of parameters.
[0014] 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, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a diagram of an example neural network system.
[0016] Figure 2 is a flow chart of an example process for generating a final answer to a received question.
[0017] Figure 3 is a flow chart of an example process for determining relevant conditioning inputs.
[0018] Figure 4 is a flow chart of an example process for re-ranking candidate answers.
[0019] Figure 5 Performance improvements achievable by examples of neural network systems are shown.
[0020] Like reference numbers and designations in the various drawings indicate like elements. DETAILED DESCRIPTION
[0021] Figure 1is a diagram of an example neural network system 100. Neural network system 100 is an example of a system implemented as a computer program on one or more computers in one or more locations in which the systems, components, and techniques described below may be implemented.
[0022] The system 100 receives input text 102 and generates network outputs 112 representing predictions about the input text 102 .
[0023] Specifically, system 100 uses a neural network 110 that is configured to process a network input 104 representing input text 102 and generate a network output 112 representing a prediction about input text 102. In embodiments, neural network 110 may be a pre-trained neural network.
[0024] To generate network output 112, system 100 is configured to generate a search engine query 114 for a search engine 120 from input text 102, and obtain a set of search results 122 from search engine 120 in response to query 114. Each search result 122 identifies a corresponding document.
[0025] Search engine 120 may be any suitable search engine that is accessible by system 100 and searches any suitable document corpus (e.g., web pages, books, or other documents). For example, search engine 120 may be an Internet search engine that searches and returns results 122 that reference documents available on the Internet. As another example, search engine 120 may be a different search engine that searches a private document corpus (e.g., documents available on an internal network or stored in a collection of one or more databases).
[0026] The system 100 can then include the results 122 of the search engine query 114 into the network input 104 before processing the network input 102 using the neural network 110. Thus, the network output 112 can include information embedded in the search engine results 122, including up-to-date information that was not available during the training of the neural network 110, thereby improving predictions about the input text 102.
[0027] The neural network 110 may have any suitable neural network architecture that allows the model to map an input sequence of text tokens from a vocabulary to an output sequence of text tokens from a vocabulary.
[0028] For example, the neural network 110 may have an encoder-decoder Transformer-based architecture.
[0029] As another example, the neural network 110 may have a decoder-only Transformer-based architecture, where an input sequence is provided to the neural network 110 as a “hint”.
[0030] In general, a Transformer-based architecture may be an architecture characterized by having a series of self-attention neural network layers. The self-attention neural network layer has an attention layer input for each element of the input and is configured to apply an attention mechanism on the attention layer input to generate an attention layer output for each element of the input. There are many different attention mechanisms that can be used.
[0031] Specifically, the neural network 110 can be an autoregressive neural network that autoregressively generates an output sequence by generating each particular text token in an output sequence of text tokens conditioned on a current input sequence, wherein the current input sequence includes (i) the input sequence followed by (ii) any text tokens preceding the particular text token in the output sequence.
[0032] More specifically, to generate a specific text word-gram, the neural network 110 may process the current input sequence to generate a score distribution (e.g., a probability distribution) that assigns a corresponding score (e.g., a corresponding probability) to each word-gram in the text word-gram vocabulary. The neural network 110 may then use the score distribution to select a text word-gram from the vocabulary as the specific text word-gram. For example, the neural network 110 may select the word-gram with the highest score in a greedy manner, or may sample a word-gram from the distribution, for example, using top-k sampling, nucleus sampling, or another sampling technique.
[0033] As a specific example, the neural network 110 can be an autoregressive Transformer-based neural network including multiple layers, each layer applying a self-attention operation. The neural network 110 can have any of a variety of Transformer-based neural network architectures. Examples of such architectures include J. Hoffmann, S. Borgeaud, A. Mensch, E.Buchatskaya, T. Cai, E. Rutherford, D. d. L. Casas, LA Hendricks, J.Welbl, A. Clark, et al. Training compute-optimal large language models, arXivpreprint arXiv:2203.15556, 2022; JW Rae, S. Borgeaud, T. Cai, K. Millican, J. Hoffmann, HF Song, J.Aslanides, S. Henderson, R. Ring, S. Young, E. Rutherford, T. Hennigan, J.Menick, A. Cassirer, R. Powell, G. van den Driessche, LA Hendricks, M.Rauh, P. Huang, A. Glaese, J. Welbl, S. Dathathri, S. Huang, J. Uesato, J.Mellor, I. Higgins, A. Creswell, N. McAleese, A.Wu, E. Elsen, SMJayakumar, E. Buchatskaya, D. Budden, E. Sutherland, K. Simonyan, M.Paganini, L. Sifre, L. Martens, XL Li, A. Kuncoro, A. Nematzadeh, E.Gribovskaya, D. Donato, A. Lazaridou, A. Mensch, J. Lespiau, M. Tsimpoukelli, N. Grigorev, D. Fritz, T. Sottiaux, M. Pajarskas, T. Pohlen, Z. Gong, D. Toyama, C. de Masson d'Autume, Y. Li, T. Terzi, V. Mikulik, I. Babuschkin, A. Clark, D. de Las Casas, A. Guy, C. Jones, J. Bradbury, M. Johnson, B. A. Hechtman, L. Weidinger, I. Gabriel, W. S. Isaac, E. Lockhart, S. Osindero, L. Rimell, C. Dyer, O. Vinyals, K. Ayoub, J. Stanway, L. Bennett, D. Hassabis, K. Kavukcuoglu, and G. Irving. Scaling language models: Methods, analysis & insights from training gopher. CoRR, abs / 2112.11446, 2021(JW Rae, S. Borgeaud, T. Cai, K. Millican, J. Hoffmann, HF Song, J. Aslanides, S. Henderson, R. Ring, S. Young, E. Rutherford, T. Hennigan, J. Menick, A. Cassirer, R. Powell, G. van den Driessche, LA Hendricks, M. Rauh, P. Huang, A. Glaese, J. Welbl, S. Dathathri, S. Huang, J. Uesato, J. Mellor, I. Higgins, A. Creswell, N. McAleese, A. Wu, E. Elsen, S. M. Jayakumar, E. Buchatskaya, D. Budden, E. Sutherland, K.Simonyan, M. Paganini, L. Sifre, L. Martens, XL Li, A. Kuncoro, A. Nematzadeh, E. Gribovskaya, D. Donato, A. Lazaridou, A. Mensch, J. Lespiau, M. Tsimpoukelli, N. Grigorev, D. Fritz, T. Sottiaux, M. Pajarskas, T. Pohlen, Z. Gong, D. Toyama, C. de Masson of Autumn,Y. Li, T. Terzi, V. Mikulik, I. Babuschkin, A. Clark, D. de Las Casas, A. Guy, C. Jones, J. Bradbury, M. Johnson, BA Hechtman, L. Weidinger, I. Gabriel, WS Isaac, E. Lockhart, S. Osindero, L. Rimell, C. Dyer, O. Vinyals, K. Ayoub, J. Stanway, L. Bennett, D. Hassabis, K. Kavukcuoglu, and G.Irving.Introduction to the development of the gopher squid. CoRR,abs / 2112.11446,2021): Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits oftransfer learning with a unified text-to-text transformer. arXiv preprintXiv:1910.10683, 2019 (Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019); Daniel Adiwardana, Minh-Thang Luong, David R. So, Jamie Hall, Noah Fiedel, Romal Thoppilan, Zi Yang, Apoorv Kulshreshtha, Gaurav Nemade, Yifeng Lu, and Quoc V. Le. Towards a human-like open-domain chatbot. CoRR, abs / 2001.09977, 2020 (Daniel Adiwardana, Minh-Thang Luong, David R. So, Jamie Hall, Noah Fiedel, Romal Thoppilan, Zi Yang, Apoorv Kulshreshtha, Gaurav Nemade, Yifeng Lu, and Quoc V. Le. Towards humanlike open-domain chatbots. CoRR, abs / 2001.09977, 2020); and Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020 (Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, PrafullaDhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020). .
[0034] A token in the vocabulary may be any suitable text token that represents a text element of one or more natural languages and optionally represents numbers and other text symbols present in a text corpus, such as a word, a wordpiece, a punctuation mark, a character, a byte, etc. For example, the system 100 may tokenize a given sequence of words by applying a tokenizer (e.g., the SentencePiece tokenizer (Kudo et al., arXiv:1808.06226) or another tokenizer) to divide the sequence into tokens from the vocabulary.
[0035] Before using neural network 110 to generate network output 112, neural network 110 is pre-trained, for example, by system 100 or by one or more other systems.
[0036] Specifically, the system 100 or other systems pre-train the neural network 110 on a language modeling task (e.g., a task that requires predicting the next token in the training data that follows the current sequence given a current text token sequence). Equivalently, for each given unlabeled text sequence in the training data set, the language modeling task may require predicting the text sequence that follows the given unlabeled text sequence in the corresponding document. As a specific example, the language model neural network 110 can be pre-trained on a maximum likelihood objective on a large text dataset (e.g., text publicly available from the Internet or another text corpus).
[0037] After training, system 100 may be configured to perform any suitable machine learning task using search engine results 122 and neural network 110 .
[0038] For example, system 100 may be configured to perform question answering, where input text 102 identifies a question and network output 112 represents an answer to the question.
[0039] For example, a question may be provided by a user of system 100, such as by providing input text 102 directly to the system or by providing audio data representing a verbalization of input text 102 to system 100. In these embodiments, search engine results 122 may include a collection of documents relevant to the question; thus, neural network 110 may utilize the search engine results to answer the question using information that was not available when neural network 110 was trained. In these embodiments, the data representing input text 102 is sometimes referred to as "question data."
[0040] As another example, system 100 may be configured to perform fact checking, where input text 102 represents a statement and network output 112 represents a prediction as to whether the statement is in fact true. Similarly, in these embodiments, search engine results 122 may include a collection of documents related to the statement.
[0041] In some implementations, system 100 uses neural network 110 to perform one of these downstream tasks, such as question answering, without further training neural network 110. For example, system 100 can use neural network 110 that has been trained only on language modeling tasks to perform question answering tasks.
[0042] Although the following description relates to implementations in which the system 100 is configured to perform question answering, it should be understood that in general the neural network 100 may be configured to perform any suitable task using input text.
[0043] Once the system 100 has generated the network output 112 , the system 100 may provide the network output 112 to a user.
[0044] For example, system 100 may be implemented as part of or may communicate with a digital assistant device (e.g., a mobile device, a smart watch or other wearable device, or a smart speaker device), and the digital assistant device may provide network output 112 to a user, for example, by generating speech representing network output 112 and playing the speech back to the user through a speaker.
[0045] As another example, system 100 can provide network output 112 for presentation in a user interface of a user device (eg, a user device through which a user submitted text input 102).
[0046] Figure 2 is a flow chart of an example process 200 for generating a network output. For convenience, process 200 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural network system (e.g., Figure 1The neural network system 100 depicted in FIG. 1 may perform process 200 .
[0047] The system obtains problem data representing a problem (step 202 ).
[0048] The system generates a search engine query for a search engine from the question data (step 204 ).
[0049] The system may generate a search engine query from the input text, i.e., from the question data, in any suitable manner. For example, the search engine query may be (or include) the input text itself, e.g., a question for the neural network to answer in an embodiment where the neural network is configured to perform question answering. That is, the search engine query may be equal to the input text as is. As another example, the system may process the input text, e.g., by processing the input text using one or more predetermined templates to generate updated text to serve as a search engine query. As another example, the system may process the input text using a machine learning model, e.g., by processing a sequence of tokens representing the input text using another neural network, to generate a network output of text representing the search engine query.
[0050] The system obtains a plurality of documents identified by the search engine in response to processing the search engine query (step 206).For example, the system may receive a set of search results from the search engine, each search result identifying a corresponding document from a corpus of documents searched by the search engine.
[0051] The system can submit a search engine query to a search engine and receive back multiple documents For example, the system may use an application programming interface (API) provided by a search engine to submit a search engine query. The system may be configured to obtain a predetermined number of Documentation , i.e., the search engine indexed pages that are ranked highest by the search engine in response to a submitted search engine query In some implementations, the system receives each document in HTML format and processes the HTML data to extract the clean text of the document.
[0052] The system generates a plurality of conditioned inputs from the plurality of documents, the plurality of conditioned inputs each representing at least a portion of one or more of the obtained documents (step 208 ).
[0053] Each conditional input represents some or all of the text of the corresponding document; for example, each conditional input may include a respective different subsequence of a sequence of tokens representing the corresponding text. At least some of can be represented by sequences longer than the maximum sequence length that can be processed by the neural network, so for a single document the system can generate multiple different conditioned inputs, where each conditioned input represents a corresponding different subset of the text of the document, such as a disjoint subset.
[0054] In some implementations, the system can generate conditional input from multiple different documents, for example, by concatenating corresponding subsets of the text of each document.
[0055] As a specific example, for each retrieved document, the system can segment the document into fixed-size segments. Such segments are sometimes referred to as "paragraphs," although they are not necessarily aligned with the original paragraphs of the document. For example, each segment can include a predetermined number of sentences from the original document (e.g., a predetermined number of sequences of text separated by periods or other specified punctuation marks). The system can then generate corresponding conditional inputs from each segment, for example, by generating a sequence of tokens representing the text of the segment.
[0056] For each of the plurality of generated conditioned inputs, the system processes a network input generated from (i) the question data and (ii) the conditioned input using a neural network to generate a network output representing a candidate answer to the question (step 210 ).
[0057] In some implementations, instead of generating a network input for each conditioned input, the system may determine which of the generated conditioned inputs are most relevant to the question represented by the input text, and generate corresponding network inputs only for the most relevant conditioned inputs.
[0058] Reference below Figure 3 Description Identify relevant conditional inputs.
[0059] The network input for a given conditional input may include or be generated from both the input text and the conditional input. For example, the system may concatenate the input text and the conditional input to generate a single sequence, e.g., where one or more delimiter tokens separate a subsequence representing the input text from a subsequence representing the conditional input.
[0060] In some embodiments, the system also uses prompt tuples to generate the network input corresponding to each corresponding conditioned input, . Each prompt tuple can correspond to a respective second question different from the question to be answered by the neural network. Each prompt tuple can include (i) second question data representing the respective second question (e.g., a sequence of tokens representing the second question), (ii) second answer data representing an answer to the second question (e.g., a sequence of tokens representing the answer), and (iii) a second conditioned input representing a document related to the second question (e.g., a sequence of tokens representing the document). For example, the system can obtain the prompt tuple from a predetermined training data set. Including a prompt tuple in the network input is sometimes referred to as a "k-shot prompt".
[0061] In some embodiments, the neural network is a pre-trained neural network that has been trained on a different machine learning task than the task for which the system is using the neural network, e.g., on a different task than the question answering task. Thus, in these embodiments, the neural network has not been trained to generate network outputs in an appropriate format for the machine learning task for which the system is using the neural network, e.g., has not been trained to generate network outputs in a desired format for question answering. Thus, a hint tuple may be included in the network input so that the neural network has access to examples of an appropriate format for the output of the neural network.
[0062] For example, for each conditioned input, the system can generate subsequences of network inputs, where The subsequences correspond to the corresponding second questions, and the The subsequences correspond to the questions that the neural network is to answer. Each of the subsequences may include corresponding second question data, second answer data, and second conditioned input, while the subsequence corresponding to the question to be answered by the neural network may include only input text representing the question and the conditioned input (i.e., without a corresponding answer to be generated by the neural network). The subsequences can represent the appropriate format for the network output of the neural network.
[0063] As a specific example, each subsequence corresponding to a respective second question may have the following format: [one or more "evidence" tokens] + [second conditional input] + [one or more "question" tokens] + [second question data] + [one or more "answer" tokens] + [second answer data] Wherein the "evidence" token, the "question" token and the "answer" token are any predetermined appropriate tokens. Then, the subsequence corresponding to the question to be answered by the neural network may have the following format: [one or more "evidence" tokens] + [conditional input] + [one or more "question" tokens] + [text input] + [one or more "answer" tokens] In some embodiments, the system generates multiple candidate answers for each network input. That is, the system can process each network input a fixed number of times (greater than once) using a neural network to generate multiple different candidate answers. As described above, because the system samples from a probability distribution to generate each token of a given output sequence, processing the same network input multiple different times will generally result in generating different candidate answers.
[0064] The system generates answer data representing a final answer to the question from the network outputs representing corresponding candidate answers (step 212 ).
[0065] Specifically, for each candidate answer, the system can generate a corresponding likelihood value for the candidate answer that indicates the likelihood that the candidate answer is the correct answer to the question. The system can then select the candidate answer with the highest corresponding likelihood value as the final answer. In other words, the system "re-ranks" the candidate answers and then selects the highest-ranked candidate answer as the final answer.
[0066] Reference below Figure 4 Describe the re-ranking candidate answers in more detail.
[0067] The system may then provide the answer data as output, for example, by providing the answer data as speech that is played back to the user or as text to be presented to the user in a user interface.
[0068] Alternatively, after determining the final answer to the question, the system can provide the final answer to one or more external systems for storage or further processing. For example, the system can provide the final answer to a user system implemented on the user's device to provide the final answer to the user, for example, by displaying the final answer on a display of the device or by generating spoken audio data representing the final answer and playing the audio data for the user. In some embodiments, the neural network is implemented on the user's device; in some other embodiments, the neural network is implemented on a different device; for example, the neural network can be deployed on the cloud.
[0069] Figure 3 is a flow chart of an example process 300 for determining relevant conditioned inputs. For convenience, process 300 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural network system (e.g., Figure 1 The neural network system 100 depicted in FIG. 1 may perform process 300 .
[0070] The system obtains a set of candidate conditional inputs (step 302). For example, as described above, the system can generate each conditional input using one or more documents identified in search results obtained from a search engine.
[0071] The system generates an embedding for the question data (step 304 ) and a corresponding embedding for each conditioned input (step 306 ).
[0072] In this specification, an embedding is an ordered collection of numerical values that represent an input in a specific embedding space. For example, an embedding can be a floating point vector or other numerical values with fixed dimensions.
[0073] The system can generate embeddings for text sequences in any suitable manner, such as embeddings for text sequences of conditioned inputs or question inputs.
[0074] For example, the system can use "term frequency-inverse document frequency" (tf-idf) embeddings to generate embeddings, for example, by combining the tf-idf embeddings of each token in the text sequence.
[0075] As another example, the system can map each token to a word embedding, such as a word2vec or GloVe embedding, and then combine the word embeddings, such as by averaging or summing them.
[0076] As another example, the system can process a network input representing input text using an embedding neural network (e.g., a self-attention based neural network) to generate an embedding of the input text. For example, the embedding neural network can have been trained by unsupervised learning, e.g., to minimize the BERT loss (Devlin et al., arXiv:1808.04805).
[0077] For each conditioned input, the system determines the similarity between the embedding of the conditioned input and the embedding of the question data (step 308). For example, the similarity can be measured according to any suitable similarity metric between two vectors (e.g., cosine similarity, Euclidean distance, etc.).
[0078] The system selects the conditioning input with the highest similarity as the most relevant conditioning input (step 310). For example, the system may select each conditioning input having at least a threshold similarity, or may select a threshold number of most similar conditioning inputs.
[0079] Figure 4 is a flow chart of an example process 400 for re-ranking candidate answers. For convenience, process 400 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural network system (e.g., Figure 1The neural network system 100 depicted in FIG. 4 may perform process 400 .
[0080] The system receives a set of candidate answers (step 402).
[0081] For each candidate answer, the system generates a corresponding likelihood value for the candidate answer that represents the likelihood that the candidate answer is a correct answer to the question (step 404 ).
[0082] For example, for the use of the network input generated from Conditional Input A generated problem in Each candidate answer , the system may generate predictions for one or more of the following: or , and use this prediction to generate a likelihood score. As a specific example, the likelihood score may be equal to ,equal Or equal to the combination of two probabilities using an expert product (PoE). For example, PoE can calculate the product or weighted sum of the probabilities. In some embodiments, PoE also considers in the product or weighted sum - for example, including - .
[0083] For example, the system could generate the following predictions:
[0084] Alternatively or additionally, the system may generate the following predictions: , in, Is used to generate Conditional input.
[0085] In some embodiments, the system may be used as described above with reference to Figure 3 The similarity (or normalized version of the similarity) is calculated as above Probability. In some other embodiments, the system calculates the probability using a neural network, as described below.
[0086] For probability ,element Sometimes called the "posterior element", the element and Sometimes called the "transcendental element".
[0087] The system can use the neural network or another neural network to predict corresponding probabilities, for example, such probabilities can be obtained from a smaller, pre-trained language model. For example, if the neural network is an autoregressive neural network, then to generate a prediction for a particular probability, the system can generate a network input that includes one or more prior elements for the particular probability, and use the trained parameter values of the neural network to determine the likelihood that the neural network will generate a network output that represents a posterior element for the particular probability.
[0088] As a specific example, to generate a The system can generate predictions including and network input, and determine that the neural network will generate recognition For example, in processing and The likelihood that the network input is The corresponding probability of each word of is determined, for example, The product of the probabilities of the word units.
[0089] In some such embodiments, the system uses k-sample hints to generate a network input that includes (i) one or more prior elements of a particular probability and (ii) one or more hint tuples. The system can then determine the probability that the neural network will generate a network output that identifies a posterior element of a particular probability by inferring the likelihood that such a network output will be generated autoregressively in response to processing the network input. For example, when predicting When the system can use The prompt tuple, and given Determine the generated Similarly, when predicting When the system can use The prompt tuple, and given and Determine the generated Similarly, when predicting When the system can use The hint tuple and determine the given and Generated in the case of Similarly, when predicting When the system can use The hint tuple and determine the given Generated in the case of Similarly, when predicting When the system can use The prompt tuple and determine the given generate possibility.
[0090] The system may then select the candidate answer with the highest corresponding likelihood value as the final answer (step 406 ).
[0091] As previously mentioned, in some embodiments, the system is implemented on a digital assistant device such as a mobile device. In such an embodiment, the neural network can be implemented (entirely) on the mobile device. A back-end data server can be used to process search engine queries, and the back-end data server can be implemented using parallel and distributed computing systems. Mobile devices typically have less working memory than back-end data servers, less computing power than back-end data servers, or both. Computational capacity can be measured in computing operations per second, such as FLOPS (floating point operations per second). In this way, the computational load can be optimized, especially in the case where the neural network includes an autoregressive, Transformer-based neural network, and in the case where the search engine includes an Internet search engine. This in turn can facilitate the use of a smaller language model, for example, a language model with less than 10bn parameters, such as 7bn parameters, 1bn parameters, or fewer parameters.
[0092] Figure 5 shows the exact match question answering performance (on the y-axis) with respect to FLOPS (on the x-axis). Figure 1 The performance of example neural network systems of the type shown (slashes) is compared to the performance of pre-trained language models that do not also use a search engine (dashed horizontal lines and stars). The example neural network systems are 1bn or 7bn parameter versions of the pre-trained Gopher language model (Rae et al., supra), and use various different techniques to determine the likelihood that a candidate answer is the correct answer. The star shows the performance of a pre-trained Gopher language model with 280bn parameters. In some cases, embodiments of the described techniques have more than 273bn parameters.
[0093] In some embodiments, the system can be used as part of a real-world control system, where the questions and answers are each related to the operation of a machine or tool in the real world. The method can then include obtaining a natural language question related to the operation of the machine, processing the question using a neural network system as described above to generate a final answer to the question, and then using the answer to control the machine or tool. For example, the machine or tool can be a robot, and the question can be "What is the maximum safe load for a Model 123.45 robot? "; or the machine or tool can be an oven, and the question can be "At what temperatures should I cook a cake? ".
[0094] This specification uses the term "configuration" in conjunction with system and computer program components. For a system of one or more computers to be configured to perform a particular operation or action, it means that the system has installed thereon software, firmware, hardware, or a combination thereof, which, in operation, causes the system to perform the operation or action. For one or more computer programs to be configured to perform a particular operation or action, it means that the one or more programs include instructions that, when executed by a data processing device, cause the device to perform the operation or action.
[0095] The embodiments of the subject matter and functional operations described in this specification may be implemented in digital electronic circuits, in tangibly embodied computer software or firmware, in computer hardware (including the structures disclosed in this specification and their structural equivalents), or in a combination of one or more of them. The embodiments of the subject matter described in this specification may be implemented as one or more computer programs, for example, one or more modules of computer program instructions encoded on a tangible non-transitory storage medium, for execution by a data processing device or for controlling the operation of a data processing device. The computer storage medium may 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 additionally, the program instructions may be encoded on an artificially generated propagation signal (e.g., a machine-generated electrical signal, optical signal, or electromagnetic signal) that is generated to encode information for transmission to a suitable receiver device for execution by a data processing device.
[0096] The term "data processing apparatus" refers to data processing hardware and covers all kinds of apparatus, devices and machines for processing data, including, for example, a programmable processor, a computer or multiple processors or computers. The apparatus may also be or further include special-purpose logic circuits, such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). In addition to the hardware, the apparatus may optionally include code that creates an execution environment for a computer program, for example, code constituting processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
[0097] A computer program, which may also be referred to or described as a program, software, software application, app, module, software module, script, or code, may be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages; and it may 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 may be stored in a portion of a file that holds other programs or data, such as one or more scripts stored in a meta-language document, in a single file dedicated to the program in question, or in multiple coordinated files, such as files storing one or more modules, subroutines, or code portions. A computer program may be deployed to execute on one or more computers located at one site or distributed over multiple sites and interconnected by a data communications network.
[0098] In this specification, the term "database" is used broadly to refer to any collection of data: the data need not be structured in any particular way, or at all, and it may be stored on storage devices in one or more locations. Thus, for example, an index database may include multiple collections of data, each of which may be organized and accessed differently.
[0099] Similarly, 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. Typically, 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 specific engine; in other cases, multiple engines can be installed and run on the same computer or multiple computers.
[0100] 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 a special purpose logic circuit (e.g., an FPGA or ASIC) or by a combination of a special purpose logic circuit and one or more programmed computers.
[0101] Computers suitable for executing computer programs can be based on general or special microprocessors or both, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The basic elements of a computer are a central processing unit for executing 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 incorporated into a special logic circuit. Typically, the computer will also include or be operably coupled to receive data from or transmit data to or both of one or more large-capacity storage devices (e.g., magnetic disks, magneto-optical disks, or optical disks) for storing data. However, the computer does not need to have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, 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, such as a universal serial bus (USB) flash drive, to name a few.
[0102] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including, for example, semiconductor memory devices, such as EPROM, EEPROM, and flash memory devices; magnetic disks, such as internal hard disks or removable disks; magneto-optical disks; and CD ROM and DVD-ROM disks.
[0103] To provide interaction with a user, embodiments of the subject matter described in this specification may be implemented on a computer having a display device for displaying information to the user, such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, and a keyboard and pointing device, such as a mouse or trackball, through which the user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback; and input from the user may be received in any form, including acoustic, voice, or tactile input. In addition, the computer may interact with the user by sending documents to and receiving documents from the device used by the user; for example, by sending a web page to a web browser on the user's device in response to a request received from the web browser. In addition, the computer may interact with the user by sending a text message or other form of message to a personal device (e.g., a smart phone running a messaging application) and then receiving a response message from the user.
[0104] The data processing apparatus for implementing a machine learning model may also include, for example, dedicated hardware accelerator units for processing common and computationally intensive parts of machine learning training or production, such as inference, workloads.
[0105] Machine learning models can be implemented and deployed using a machine learning framework (e.g., the TensorFlow framework or the Jax framework).
[0106] Embodiments of the subject matter described in this specification may be implemented in a computing system that includes a back-end component (e.g., as a data server), or includes a middleware component (e.g., an application server), or includes a front-end component (e.g., a client computer with 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 may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks (LANs) and wide area networks (WANs), such as the Internet.
[0107] The computing system may include a client and a server. The client and the server are usually remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. In some embodiments, the server transmits data (e.g., an HTML page) to a user device, for example, to display data to a user interacting with the device acting as a client and to receive user input from it. Data generated at the user device, such as the result of the user interaction, can be received from the device at the server.
[0108] Although this specification contains many specific implementation details, these should not be interpreted as limitations on the scope of any invention or on the scope that can be claimed, but as descriptions of features that can be specific to a particular embodiment of a particular invention. Certain features described in the context of a separate embodiment in this specification may also be implemented in combination in a single embodiment. On the contrary, the various features described in the context of a single embodiment may also be implemented in multiple embodiments individually or in any suitable sub-combination. In addition, although features may be described above as working in certain combinations and even initially claimed as such, in some cases, one or more features from the claimed combination may be removed from the combination, and the claimed combination may involve a sub-combination or a variation of the sub-combination.
[0109] Similarly, although operations are depicted in a particular order in the drawings and recited in the claims, this should not be understood as requiring that such operations be performed in the particular order or sequence shown, or that all of the operations shown be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments 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.
[0110] Specific 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 the desired results. As an example, the processes depicted in the accompanying drawings do not necessarily require the particular order or sequence shown to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous.
Claims
1. A method, include: obtaining problem data representing the problem; generating a search engine query for a search engine from the question data; obtaining a plurality of documents identified by the search engine in response to processing the search engine query; generating a plurality of conditioned inputs from the plurality of documents, the plurality of conditioned inputs each representing at least a portion of one or more of the obtained documents; For each of the plurality of generated conditioned inputs, processing a network input generated from (i) the question data and (ii) the conditioned input using a neural network to generate a network output representing a candidate answer to the question; as well as Answer data representing a final answer to the question is generated from the network outputs representing corresponding candidate answers.
2. The method according to claim 1, in, Generating a plurality of conditional inputs from the plurality of documents comprises, for each document in the plurality of documents: extracting a text sequence from each obtained document; and A corresponding conditional input is determined from each of the one or more subsequences of the extracted text sequence.
3. The method according to any one of claim 1 or claim 2, further comprising: include: generating, for each conditioned input representing at least a portion of one or more corresponding documents, a relevance score representing a predicted relevance of the portion of the one or more corresponding documents to the question; as well as determining a ranking of the conditioned input according to the corresponding relevance scores, wherein the subset of the conditioned inputs includes The highest ranked conditionalized inputs, .
4. The method according to claim 3, in, Generating the relevance score for the conditioned input includes: generating an embedding of the problem data; Generate a corresponding embedding for each conditioned input; and For each conditioned input, the similarity between the embedding of the conditioned input and the embedding of the question data is determined.
5. The method according to any one of claims 1 to 4, in, For each network input generated from a corresponding conditioned input, the network input is further generated from one or more prompt tuples, each of which includes (i) second question data representing a different second question, (ii) second answer data representing an answer to the corresponding second question, and (iii) a second conditioned input representing a document related to the corresponding second question.
6. The method according to claim 5, in, The neural network has been pre-trained on a language modeling task and has not yet been trained on a question answering task.
7. The method according to any one of claims 1 to 6, in, Generating answer data representing a final answer to the question from the network outputs representing corresponding candidate answers comprises: For each candidate answer, generating a corresponding likelihood value representing the likelihood that the candidate answer is a correct answer to the question; and The final answer is determined as the candidate answer corresponding to the highest likelihood value.
8. The method according to claim 7, in, For the corresponding conditional input Corresponding questions Each candidate answer , generating the candidate answer The corresponding likelihood values include: Generate one or more initial likelihood values, the one or more initial likelihood values comprising one or more of the following: a first initial likelihood value, the first initial likelihood value representing the probability of the candidate answer given the conditioned input and the question The estimate, A second initial likelihood value, which represents the probability of the candidate answer given the question The estimate, a third initial likelihood value, the third initial likelihood value representing the probability of the conditioned input given the problem The estimate, a fourth initial likelihood value, the fourth initial likelihood value representing the probability of the problem given the conditioned input An estimate of a fifth initial likelihood value, the fifth initial likelihood value representing the probability of answering the question given the candidate answer and the conditional input estimates of The likelihood value is generated from the one or more initial likelihood values.
9. The method according to claim 8, in, For at least one of the initial likelihood values representing an estimate of a probability of a corresponding a posteriori element given one or more corresponding prior elements, the initial likelihood value is generated using the neural network.
10. The method according to claim 9, in, Using the neural network to generate a particular initial likelihood value representing an estimate of the probability of a particular posterior element given one or more particular prior elements includes: The set of trained parameter values for the neural network is used to determine a likelihood that the neural network will generate a second network output representing the particular posterior element in response to processing a second network input generated from the one or more particular prior elements.
11. The method according to claim 10, in, The second network input has further been generated from one or more prompt tuples having a particular posterior element and one or more particular prior elements that are the same as the particular initial likelihood value.
12. A method according to any preceding claim, in, The neural network comprises an autoregressive, Transformer-based neural network, and wherein the search engine comprises an Internet search engine.
13. A method according to any preceding claim, in, The neural network is implemented on a mobile device, and the method further comprises: Processing the search engine query using a backend data server; and The mobile device has one or both of the following: smaller working memory or smaller computing power than the backend data server.
14. A system comprising one or more computers and one or more storage devices storing instructions, wherein when the instructions are executed by the one or more computers, the one or more computers are caused to perform the operations of the corresponding method according to any one of claims 1-13.
15. One or more computer storage media storing instructions that, when executed by one or more computers, cause the one or more computers to perform the operations of the corresponding method of any one of claims 1-13.
