Evaluating output sequences using autoregressive language model neural networks
An autoregressive language model neural network functions as both generator and discriminator to address inefficiencies in existing neural networks, providing efficient and high-quality output sequence generation and evaluation on resource-constrained devices.
Patent Information
- Application Number
- JP2024505411
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-07-28
- Filing Date
- 2022-07-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-07-28
AI Technical Summary
Existing neural networks for generating output sequences face inefficiencies due to the need for separate generator and discriminator models, leading to high computational overhead and memory constraints, particularly in edge devices with limited resources.
Implementing an autoregressive language model neural network that serves as both a generator and a discriminator to evaluate output sequences, allowing for efficient on-device evaluation and fine-tuning for specific tasks, minimizing latency and memory usage.
This approach enables high-quality output sequence generation and evaluation with reduced computational overhead and memory consumption, suitable for devices with limited resources, while improving sequence quality through task-specific fine-tuning.
Smart Images

Figure 2024532679000001
Abstract
Description
[Technical field]
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims the benefit of U.S. Provisional Application No. 63 / 226,748, filed July 28, 2021. The disclosure of this prior application is considered part of the disclosure of this application and is incorporated by reference into the disclosure of this application.
[0002] This specification relates to using neural networks to process inputs to generate sequences of outputs. [Background technology]
[0003] 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 contain one or more hidden layers in addition to an output layer. The output of each hidden layer is used as the input to the next layer in the network, either another hidden layer or the output layer. Each layer of the network generates an output from the received input according to the current values of the respective set of parameters. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] 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 [Non-Patent Document 2] 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 [Non-Patent Document 3] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell and others. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020 [Non-Patent Document 4] Vaswani et al. "Attention is all you need", 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA Summary of the Invention [Means for solving the problem]
[0005] Described herein is a system, implemented as a computer program on one or more computers at one or more locations, that uses an autoregressive language model neural network to generate output sequences and then uses the same autoregressive language model neural network to evaluate the output sequences, i.e., to determine whether the output sequences are suitable for providing as the output of the system or to select which output sequences should be provided in response to a given request. Thus, the system uses the same autoregressive neural network to both generate the sequences and to "distinguish" between the generated sequences in order to determine which, if any, sequences should be provided in response to a given request.
[0006] The subject matter described herein, in particular embodiments, can be implemented to realize one or more of the following advantages.
[0007] The described techniques allow an autoregressive language model neural network to be used as both a generator and a discriminator, i.e., to both generate output sequences and to evaluate how well those output sequences satisfy one or more criteria.
[0008] Compared to having separate generator and discriminator models, having a single model that can function as both a generator and a discriminator allows candidate outputs to be accurately evaluated with minimal additional computational overhead compared to generating the candidates, i.e., the system can evaluate the generated sequences with much less additional latency and consuming much less additional memory compared to evaluating the sequences using a separate generator model.
[0009] For example, in some cases, the language model neural network may be deployed on devices with constrained memory space, i.e., significant constraints on available memory, or on devices where low decoding latency is required, such as edge devices, such as mobile devices, smart speakers, or other Internet of Things (IoT) devices, or embedded in robots or other physical systems. In these cases, the system may perform the evaluation of the sequences generated by the neural network on-device, without requiring additional data communication over the network, while at the same time performing the processing on-device and with minimal additional computational overhead, thereby improving the quality of the output sequences provided in response to a received request. That is, because the language model neural network is used as both a generator and a discriminator, the edge device may perform the evaluation locally on-device without exceeding memory or latency constraints.
[0010] Furthermore, this single model can be used to filter task-specific fine-tuning data and then use this filtered data to fine-tune the model to work well for a particular task. After fine-tuning, the quality of the output sequences generated by the language model neural network can be significantly improved because the language model has been fine-tuned on training data that has removed a significant amount of substandard outputs.
[0011] The details of one or more embodiments of the subject matter herein are set forth in the accompanying drawings and the description below.
[0012] Other features, aspects, and advantages of the present subject matter will become apparent from the description, the drawings, and the claims. [Brief description of the drawings]
[0013] [Figure 1] FIG. 1 is a diagram of an example neural network system. [Diagram 2] FIG. 1 is a diagram of an example of a benchmark evaluation system. [Diagram 3] 1 is a flow diagram of an example process for evaluating candidate output sequences. [Figure 4] FIG. 2 is a diagram of another example of a benchmark evaluation system. [Diagram 5] 11 is a flow diagram of another exemplary process for evaluating candidate output sequences. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Like reference numbers and designations in the various drawings represent like elements.
[0015] 1 is a diagram of an exemplary neural network system 100. Neural network system 100 is one example of a system implemented as a computer program on one or more computers at one or more locations in which the systems, components, and techniques described below may be implemented.
[0016] Neural network system 100 is a system that generates an output sequence 150 in response to a received request.
[0017] For example, system 100 can be an output sequence generation system that generates output sequences 150 unprompted, i.e., without conditioning on any user-specified contextual input. In these implementations, the output sequences generated by system 100 approximate samples of the distribution of training output sequences used during training of system 100.
[0018] As an example, system 100 may be a text generation system that generates text sequences, i.e., each output sequence 150 generated by system 100 is a sequence of text tokens from a vocabulary of text tokens including, for example, one or more of letters, subwords, words, punctuation marks, digits, or other symbols that occur in natural language text. For example, system 100 may generate a text sequence in response to a received request and provide the text sequence for presentation to a user.
[0019] As another example, system 100 may be an image generation system that generates an image as a sequence of pixels, i.e., each output sequence 150 generated by system 100 is a sequence of color values of the pixels in the output image arranged according to a specified order.
[0020] As another example, the system 100 may receive a context sequence 102 as part of a request and generate an output sequence 150 that is a response to the context sequence 102 .
[0021] As a particular example, the system 100 may be part of a dialogue system, and the context sequence 102 may include audio or text from the most recent conversational turn submitted during a dialogue by a user of the dialogue system, while the output sequence 150 is the next turn in the dialogue, e.g., text or audio that is a response to the most recent conversational turn. Optionally, the context sequence 102 may also include one or more historical conversational turns that occurred earlier in the dialogue.
[0022] As another specific example, the system 100 can be part of a machine translation system, where the context sequence 102 can include text written in a source language, while the output sequence 150 is text written in a target language that is a translation of the source text into the target language.
[0023] As another specific example, the system 100 may be part of a computer code generation system, the context sequence 102 may be a textual description of a desired piece of code or a computer code snippet written in a programming language, and the output sequence 150 may be computer code, e.g., a code fragment described by the context sequence 102 or a code fragment that follows the context sequence 102, within a computer program.
[0024] More specifically, the system 100 receives a request for an output sequence 150 and, in response, generates one or more candidate output sequences 120 using an autoregressive language model neural network 110, i.e., an autoregressive language model neural network 110 that is either unconditioned or conditioned on a context sequence 102.
[0025] Each candidate output sequence 120 includes, at each of a plurality of positions, a respective token from a vocabulary of tokens. The vocabulary of tokens may include any of a variety of tokens that represent textual or other symbols. For example, the vocabulary of tokens may include one or more of letters, subwords, words, punctuation marks, numbers, or other symbols that occur within a corpus of natural language text.
[0026] The language model neural network 110 is referred to as an autoregressive neural network because the neural network 110 generates the output sequence of tokens in an autoregressive manner by generating each particular token in the output sequence conditioned on the current input sequence, which includes any tokens preceding that particular text token in the output sequence, i.e., tokens already generated for any previous positions in the output sequence preceding the particular position of that particular token. When the system 100 also receives the context sequence 102, the current input sequence can also include the context sequence 102. For example, the current input sequence when generating a token at any given position in the output sequence can include the context sequence 102 and a token at any previous position preceding that given position in the output sequence. As a specific example, the current input sequence can include the context sequence 102, followed by a "sentinel" sequence representing a predetermined sequence of tokens that indicates to the neural network 110 that it should generate a response to the context sequence 102, followed by a token at any previous position preceding that given position in the output sequence. Optionally, within the current input sequence, subsequences may be separated by predefined tokens, for example the "<" and ">" tokens.
[0027] More specifically, to generate a particular token at a particular position in the candidate output sequence 120, the neural network 110 may process the current input sequence to generate a score distribution, e.g., a probability distribution, that assigns a respective score, e.g., a respective probability, to each token in the vocabulary of tokens. The neural network 110 may then use this score distribution to select a token from the vocabulary as the particular token. For example, the neural network 110 may greedily select the token with the highest score, or may sample the token from the distribution, e.g., using a kernel sampling technique or another sampling technique.
[0028] As a particular example, the language model neural network 110 may be an autoregressive Transformer-based neural network that includes (i) multiple attention blocks, each of which applies a self-attention operation, and (ii) an output sub-network that processes the output of the final attention block to generate a score distribution.
[0029] Neural network 110 can have any of a variety of Transformer-based neural network architectures. Examples of such architectures include those described in: Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019; 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; 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.
[0030] In general, however, a Transformer-based neural network includes a sequence of attention blocks, where during processing of a given input sequence, each attention block in the sequence receives a respective input hidden state for each input token in the given input sequence. The attention block then updates each hidden state, at least in part by applying self-attention, to generate a respective output hidden state for each input token. The input hidden state for the first attention block is an embedding of the input token in the input sequence, and the input hidden state for each subsequent attention block is the output hidden state generated by the preceding attention block.
[0031] In this example, the output sub-network processes the output hidden state for the last input token in the input sequence, generated by the last attention block in the sequence, to generate a score distribution.
[0032] In some implementations, system 100 or another training system pre-trains language model neural network 110 in training data for a language modeling task, such as a task that requires predicting the next token that follows a current sequence of text tokens given the current sequence. As a particular example, language model neural network 110 can be pre-trained on a large text dataset, such as publicly available text from the Internet or another text corpus, based on a maximum likelihood objective.
[0033] In general, because the neural network 110 is autoregressive, the system 100 can generate multiple different candidate output sequences 120 using the same neural network 110 in response to the same request, for example, by using beam search decoding from the score distribution generated by the neural network 110, by using a Sample-and-Rank decoding strategy, or by using another decoding strategy that exploits the autoregressive nature of the neural network.
[0034] When multiple candidate output sequences 120 are generated, the system 100 needs to determine which of the multiple sequences should be provided as the output sequence 150 in response to a request. Furthermore, even if only one output sequence is generated, some of the candidate output sequences 120 may not be suitable to be provided as the final output sequence 150.
[0035] In order to determine how to respond to a given request, i.e., which, if any, candidate output sequences 120 to provide in response to the request, system 100 maintains data that specifies a set of one or more criteria ("output sequence criteria"), each of which measures a corresponding characteristic of a given output sequence.
[0036] The set of criteria may include any of a variety of criteria that measure characteristics relevant to the quality of a given candidate output sequence in terms of the task that system 100 is configured to perform.
[0037] For example, the set of criteria may include a criterion corresponding to the sensibleness of the output sequence. The sensibleness criterion measures whether the model's response is conscious, i.e., whether a given candidate output sequence generated by the neural network 110 makes sense in the context of the current interaction, i.e., as a response to the context sequence 102, and does not contradict any information in the context sequence 102 or in previous sequences during the current interaction. Thus, if an output sequence is conscious, it satisfies this criterion.
[0038] As another example, the set of criteria can include a criterion corresponding to the specificity of the output sequence. The specificity criterion measures whether the model's response is specific, i.e., whether a given candidate output sequence generated by the neural network 110 is specific to the corresponding context sequence 102, rather than being a general response that may apply to any of a variety of context sequences. For example, if the context sequence 102 is "I like TV" and the model responds with "Me too," this response will get a low score for specificity, e.g., a score of 0, because this response can be used in many different contexts. If the model responds with "Me too. I like watching reality TV," this response will get a higher score for specificity.
[0039] As another example, the set of criteria can include a criterion corresponding to the interestingness of the output sequence. The interestingness criterion measures whether the model's response is interesting, i.e., whether a given candidate output sequence generated by the neural network 110 is interesting to the human who generated the corresponding context sequence 102. For example, a response to "How do you throw a ball?" could be "You can throw a ball by first picking it up and then tossing it." An alternative, more interesting answer could be "One way to toss a ball is to grasp it tightly with both hands, then swing your arms down and up again, extending your elbows, and then release the ball upward." The first response, while meaningful and specific to the question, may not be found interesting or informative to the person asking the question. On the other hand, the alternative response provides more information that answers the question and thus would score higher on the interestingness criterion than the first response.
[0040] Other criteria may be included instead of or in addition to the above criteria, for example, suitability criteria may be included that measure the degree to which a given output sequence is suitable for being provided in response to a request.
[0041] The system 100 uses the criteria evaluation system 130 to generate a respective rating score 140 for each of one or more criteria in the set. The rating score 140 for a given criterion measures the extent to which the candidate output sequence 120 generated by the autoregressive language model neural network 110 satisfies that criterion.
[0042] In general, the benchmarking system 130 uses the output from the language model neural network 110 to generate rating scores 140 in a computationally efficient yet accurate manner.
[0043] Exemplary techniques for using a neural network 110 to generate a rating score 140 for one or more criteria in a set are described below with reference to FIGS.
[0044] That is, rather than simply using a separately trained machine learning model to generate the rating score 140, the system 130 leverages the neural network 110 to improve both the accuracy of the rating score 140 and the computational efficiency of generating the rating score 140.
[0045] After the rating scores 140 are generated, the system 100 can use the rating scores 140 to determine whether to provide a candidate output sequence 120 in response to a request in any of a variety of ways.
[0046] For example, in an implementation in which the system 100 generates multiple candidate output sequences, the system 100 may generate, for each candidate output sequence, a respective quality score from that candidate output sequence's respective rating scores 140 for one or more of the criteria in the set. For example, the quality score for a given candidate output sequence may be a sum or a weighted sum of the rating scores 140 for one or more criteria.
[0047] The system 100 may then select the candidate output sequence 120 with the highest respective quality score as the sequence to provide in response to the request.
[0048] As another example, system 100 may maintain respective thresholds for at least a subset of the criteria. In this example, for each criterion in the subset, system 100 may determine, for a given candidate output sequence 120, whether the respective quality score of the given candidate output sequence for that criterion in the set satisfies, e.g., exceeds, the threshold for that criterion, and then determine that when the respective quality score of the given candidate output sequence for the first output criterion in the set does not satisfy the threshold, not to provide the given candidate output sequence in response to the request (even though the given candidate output sequence would otherwise have the highest quality score).
[0049] In addition to or instead of using system 130 to determine how to respond to a request, system 100 can also use system 130 to filter task-specific fine-tuning data and then use this filtered data to fine-tune neural network 110 to work well for a particular task.
[0050] Specifically, the system 100 may obtain task-specific fine-tuning data including a set of training output sequences and, optionally, a corresponding context sequence for each training output sequence. The system 130 may then generate a rating score for each training output sequence and then use the rating score to filter one or more training output sequences from the fine-tuning data. For example, the system 130 may determine to filter out any training output sequences having a quality score below a threshold. As another example, the system 130 may determine to filter out any training output sequences having a rating score that is below another threshold for each criterion in a specified subset of criteria. By filtering out these training output sequences, the system may improve the overall quality of the output sequences in the fine-tuning data, and thus the quality of the output sequences generated by the language model neural network 110 after fine-tuning may be significantly improved.
[0051] FIG. 2 is a diagram of an example of a benchmark evaluation system 130.
[0052] In the example of FIG. 2, the criteria evaluation system 130 includes a respective criteria engine 220A-N for each of one or more criteria.
[0053] Each criteria engine 220A-N receives a candidate output sequence 120 and generates a rating score 140 for the corresponding criteria. The rating score 140 represents the degree to which the candidate output sequence 120 generated by the autoregressive language model neural network 110 satisfies the criteria.
[0054] To generate the rating score 140, each criteria engine 220A-N receives the candidate output sequence 120 and generates an input sequence 230 based on the candidate output sequence 120 and a predefined sequence of one or more tokens from the vocabulary that specify the criteria, i.e., the sequence of tokens that indicates to the autoregressive neural network 110 which criteria are being evaluated. More specifically, prior to evaluating one or more criteria using the neural network 110, the system receives as input a respective sequence of tokens for each criterion. For example, the sequence of tokens may be a natural language name or other identifier of the corresponding criterion, e.g., the word "specificity" may represent a specificity criterion, while the word "interestingness" may represent an interest criterion.
[0055] Specifically, an input sequence 230 for a given criterion includes a candidate output sequence 120 followed by one or more tokens that specify the output sequence criterion. When the system 100 also receives a context sequence 102, the input sequence 230 may also include the context sequence.
[0056] As a particular example, the input sequence 230 may be of the following form: <context> <sentinel> <response> <attribute name>, where "context" represents the context sequence 102, "sentinel" represents a predefined sequence of tokens that indicates to the neural network 110 that it should generate a response to the context sequence 102, "response" is the candidate output sequence 120, and "attribute name" is the token that specifies the criteria.
[0057] The system 130 then processes the input sequence 230 using the neural network 110 to generate a respective score for each token in the vocabulary. Since the neural network 110 has already processed the context sequence 102 to generate the candidate output sequence 120, this process (also called "evaluating the classifier") simply processes one or more additional tokens "<attribute name>" that were added after the candidate output sequence 120 while reusing the hidden states generated during the generation of the candidate output sequence 120. This is in contrast to using a separate neural network for evaluation of the criteria, which would need to process all tokens in the context 102 and the candidate output sequence 120 in order to accurately score the candidate output sequence 102, and is significantly more computationally efficient.
[0058] Thus, each engine 220A-N generates a different input sequence 230 and uses the neural network 110 to generate a corresponding score distribution over the vocabulary of tokens.
[0059] Each engine 220A-N then determines a rating score 140 from the scores of each of the tokens in the corresponding proper subset of the tokens' vocabulary.
[0060] That is, each criterion has a corresponding proper subset of one or more tokens in the vocabulary.
[0061] When each rating score has the same range, the corresponding proper subsets may be the same.
[0062] When different rating scores have different ranges, the corresponding true subsets may be different. For example, when the rating scores range from 0 to 1, engines 220A-N may use a token's score of "1" as the rating score 140. More generally, engines 220A-N of a system may calculate the rating score 140 as equal to a weighted sum of each possible ground truth value of the rating scores, where the weight for each ground truth value is the score of the token that represents that ground truth value in the vocabulary.
[0063] Thus, as shown in FIG. 2, the system 130 uses the neural network 110 to generate a rating score 140 for one or more criteria in a computationally efficient manner, i.e., generating the rating score 140 only requires the neural network 110 to process a small number of additional tokens per criterion.
[0064] Before using neural network 110 to generate a rating score, and after neural network 110 has been pre-trained, system 130 or another training system fine-tunes neural network 110 to accurately generate a rating score, i.e., by repeatedly performing a training step on batches of training examples from a set of training data for fine-tuning.
[0065] Each training example includes (i) a training output sequence followed by (ii) a training input sequence that includes one or more tokens that specify a particular criterion from a set of criteria. Each training example also includes, for a corresponding output sequence criterion, a ground truth rating score that represents the degree to which the training output sequence satisfies the particular output sequence criterion. The ground truth rating score may be obtained, for example, as a result of a user manually labeling the output sequence or as the output of another automatic labeling system.
[0066] To perform the training step, the system, i.e., system 130 or another training system, obtains one or more batches of training examples. For example, the system can sample the batches from a larger set of training examples for the fine-tuning training process.
[0067] For each training example in the batch, the system uses an autoregressive language model neural network to process the training input sequences in the training example to generate a respective score for each token in the vocabulary.
[0068] The system then trains an autoregressive language model neural network to minimize, for each training example in the batch, a loss function that measures the error between (i) the score for each of the tokens in the vocabulary generated for that training example and (ii) a ground truth set of scores for the tokens in the vocabulary that results in a ground truth rating score for that training example. For example, the loss function can be a negative log-likelihood loss or a cross-entropy loss.
[0069] Specifically, the system may calculate gradients of the loss function with respect to the parameters of the neural network 110, for example by backpropagation. The system may then update the parameters of the neural network 110 by applying an optimizer to the calculated gradients to generate updates, and then adding the updates to or subtracting the updates from the current values of the parameters.
[0070] The system is able to perform this fine-tuning computationally efficiently because the loss is applied only to the error measured by the loss function, i.e., the predicted rating score, without applying the loss to any predictions at any previous positions in the training input sequence.
[0071] As described above, after fine-tuning is performed, system 130 or another training system may also use engines 210A-N to generate a filtered set of training data that is used to further fine-tune neural network 110.
[0072] 3 is a flow diagram of an exemplary process 300 for evaluating candidate output sequences. For convenience, process 300 is described as being performed by a system of one or more computers located at one or more locations. For example, a neural network system, such as neural network system 100 shown in FIG. 1 and suitably programmed in accordance with this specification, can perform process 300.
[0073] The system receives a request for an output sequence, step 302. In some implementations, the request includes a context sequence, and the request is for a response to the context sequence.
[0074] The system uses an autoregressive language model neural network to generate a first candidate output sequence including a plurality of tokens, each selected from a vocabulary of tokens (step 304). As described above, in some implementations, the system uses the neural network to generate a plurality of candidate output sequences, i.e., to generate the first candidate output sequence as well as one or more additional candidate output sequences.
[0075] For each output sequence criterion in the set of one or more output sequence criteria, the system uses an autoregressive language model neural network to process the input sequence including (i) a first candidate output sequence followed by (ii) one or more tokens that specify that output sequence criterion to generate a respective score for each token in the vocabulary (step 306). When the request also specifies a conditioning sequence, the input sequence also includes the conditioning sequence.
[0076] For each output sequence criterion, the system determines a rating score for each of the first candidate output sequences from the scores of each of the tokens in the corresponding proper subset of the tokens' vocabulary, the rating score representing the degree to which the first candidate output sequence generated by the autoregressive language model neural network satisfies the output sequence criterion (step 308).
[0077] The score may be generated in parallel, for example, by processing multiple input sequences with multiple copies of the autoregressive language model neural network, each comprising (i) a first candidate output sequence followed by (ii) one or more tokens specifying a respective output sequence criteria for deriving the score. Such parallelization may enable the rating score to be determined more quickly, thereby enabling an output based on the candidate output sequences to be provided more quickly.
[0078] As additional candidate output sequences are generated, the system also performs steps 306 and 308 to generate a respective rating score for each additional candidate output sequence.
[0079] The system then determines whether the first candidate output sequence should be provided in response to the request using the rating scores of each of the first candidate output sequences for one or more output sequence criteria (step 310). For example, the system may make this determination as described above with reference to FIG.
[0080] FIG. 4 is a diagram of another example of a benchmark evaluation system 130 .
[0081] In the example of FIG. 4, the criteria evaluation system 130 includes a classifier 460 that generates a respective rating score 140 for each of the one or more criteria.
[0082] Specifically, as shown in FIG. 2, the language model neural network 110 includes a first sub-network 430 and an output sub-network 450 .
[0083] The first sub-network 430 is configured to process an input sequence including multiple input tokens to generate a respective hidden state 440 for each input token.
[0084] The output sub-network 450 is configured to process each hidden state for the input token at the position immediately preceding the particular position to generate a respective score for each token in the vocabulary of tokens, and to use those respective scores to select one of the tokens in the vocabulary as the token at that particular position in the first candidate output sequence.
[0085] For example, as described above, the neural network 110 can be a Transformer-based neural network that includes multiple attention blocks, each of which applies a self-attention mechanism. More specifically, in this example, the Transformer-based neural network includes a sequence of attention blocks, such that during processing of a given input sequence, each attention block in the sequence receives a respective input hidden state for each input token in the given input sequence and updates each hidden state, at least in part, by applying self-attention, to generate a respective output hidden state for each input token. The input hidden state for the first attention block is an embedding of the input token, and the input hidden state for each subsequent attention block is the output hidden state generated by the preceding attention block.
[0086] In this example, the attention block is part of the first sub-network 410, and the hidden state 440 is the output hidden state produced by the last attention block in the sequence.
[0087] The output sub-network 450 may, for example, include one or more fully connected layers that process the hidden states 440 for the final input token in the input sequence to generate a respective score for each token in the vocabulary of tokens. As a particular example, the output sub-network 450 may include one or more linear neural network layers followed by a softmax output layer.
[0088] In the example of FIG. 4, to generate the rating score 140, the system 130 processes the input sequence 420 using a first sub-network 430 to generate a respective hidden state 440 for each input in the input sequence 420.
[0089] Specifically, the input sequence 420 includes a number of input tokens that include all tokens at all positions in the candidate output sequence 120. That is, the input sequence 420 includes the entire candidate output sequence 120. When the system 100 also receives a context sequence 102, the input tokens also include tokens from that context sequence 102.
[0090] For example, the input sequence 420 may be of the following form: <context> <sentinel> <response>, where “context” represents the context sequence 102, “sentinel” represents a predefined sequence of tokens that indicates to the neural network 110 that it should generate a response to the context sequence 102, and “response” is the candidate output sequence 120.
[0091] In many autoregressive neural networks 110 that generate variable length output sequences, a given output sequence ends when a given end of sequence token is selected at a given time step. That is, when an end of sequence token is selected, the system 100 determines that the output sequence is the token at each time step preceding the given time step during the generation of the output sequence. In these implementations, the system 130 does not need to perform any additional processing to generate a hidden state for the input sequence 410, since the input sequence 410 has already been processed to select an end of sequence token that terminated the generation of the candidate output sequence 120.
[0092] The system 130 then processes one or more of the hidden states 440 using a classifier 460 to generate a respective rating score 140 for each of the one or more criteria. For example, the one or more hidden states 440 processed by the classifier 460 can be the respective hidden states for a token at a final position in the first candidate output sequence generated by the first sub-network. As another example, the one or more hidden states 440 processed by the classifier 460 can be the respective hidden states for a specified input token at a specified position among the input tokens, e.g., the first input token in the input sequence, generated by the first sub-network 430. As yet another example, the one or more hidden states 440 can include all hidden states 440, and the classifier 460 can be configured to average the hidden states 440.
[0093] The classifier 460 is a neural network that includes one or more classifier layers and is configured to process one or more hidden states using the one or more classifier layers to generate a respective rating score 140 for each of the one or more criteria. For example, the classifier layers may include one or more fully connected layers, with a final layer having a respective node, e.g., a logistic regression or sigmoid node, corresponding to each criterion, each node configured to generate a respective rating score 140 for the corresponding criterion.
[0094] Thus, in the example of FIG. 4, system 130 can generate scores for all criteria by processing the hidden states (already generated as part of generating the candidate output sequences) using a small, computationally efficient classifier 460.
[0095] Before classifier 460 is used to generate a rating score, and after neural network 110 has been pre-trained, system 130 or another training system trains classifier 460 to accurately generate a rating score, i.e., by repeatedly performing a training step on batches of training examples from a set of training data for training.
[0096] To perform the training step, a system, i.e., system 130 or another training system, obtains one or more batches of training examples. For example, system 130 can sample the batches from a larger set of training examples for the fine-tuning training process.
[0097] For each training example in the batch, the system processes, using one or more classifier layers, one or more of the respective hidden states generated by processing an input including a plurality of input tokens including all tokens at all positions in the training output sequence in the training example by the first sub-network to generate a respective rating score for each output sequence criterion.
[0098] The system then trains one or more classifier layers to minimize, for each training example in the batch, a loss function that measures the error between (i) a respective rating score generated for that training example and (ii) a respective ground truth rating score for that training example.
[0099] Specifically, the system can calculate gradients of the loss function with respect to the parameters of the classifier layer. The system can then update the parameters of the classifier layer by applying an optimizer to the calculated gradients to generate updates, and then adding the updates to or subtracting the updates from the current values of the parameters.
[0100] The system can perform this training computationally efficiently because the classifier 460 has a relatively small number of parameters, i.e., compared to the neural network 110, and because the system keeps the input sub-network frozen while the classifier 460 is training.
[0101] As described above, after training of classifier 460 has been performed, system 130 or another training system may also use classifier 460 to generate a filtered set of training data that is used to further fine-tune neural network 110.
[0102] 3 is a flow diagram of another exemplary process 500 for evaluating candidate output sequences. For convenience, process 500 is described as being performed by a system of one or more computers located at one or more locations. For example, a neural network system, such as neural network system 100 shown in FIG. 1 and suitably programmed in accordance with this specification, can perform process 500.
[0103] The system receives a request for an output sequence, step 502. In some implementations, the request includes a context sequence, and the request is for a response to the context sequence.
[0104] The system uses an autoregressive language model neural network to generate a first candidate output sequence including a number of tokens, each selected from a vocabulary of tokens (step 504).
[0105] As described above, the language model neural network includes a first sub-network and an output sub-network.
[0106] The first sub-network is configured to process an input comprising a plurality of input tokens at each particular position of a plurality of positions in the candidate output sequence to generate a respective hidden state for each input token, the input tokens comprising a token at each position preceding the particular position in the candidate output sequence and optionally a token in the context sequence.
[0107] The output sub-network is configured, at each particular position of the plurality of positions, to process a respective hidden state for the input token at the position immediately preceding the particular position to generate a respective score for each token in the vocabulary of tokens, and to use the respective scores to select one of the tokens in the vocabulary as the token at that particular position in the first candidate output sequence.
[0108] As described above, in some implementations, the system uses a neural network to generate multiple candidate output sequences, i.e., generate a first candidate output sequence as well as one or more additional candidate output sequences.
[0109] The system processes one or more of the respective hidden states generated by the first sub-network processing an input including all tokens at all positions in the first candidate output sequence using one or more classifier layers to generate a respective rating score for each criterion in the set of one or more criteria (step 506).
[0110] As additional candidate output sequences are generated, the system also performs step 506 to generate a respective rating score for each additional candidate output sequence.
[0111] The system then determines whether the first candidate output sequence should be provided in response to the request using the rating scores of each of the first candidate output sequences for one or more output sequence criteria (step 508). For example, the system may make this determination as described above with reference to FIG.
[0112] An "embedding," as used herein, is a vector of numerical values, eg, floating point or other type of numerical values, having a given dimension, eg, a given number of values.
[0113] The self-attention block described above is a neural network layer that includes an attention mechanism that operates over the self-attention block inputs (or inputs derived from the layer inputs) to generate the self-attention block outputs. The self-attention mechanism may be causally masked, such that any given position in the input sequence does not attend over any positions after that given position in the input sequence (e.g., does not use data from any positions after that given position in the input sequence). There are many different attention mechanisms possible. Some examples of self-attention layers that include attention mechanisms can be found in the following references: Vaswani et al. "Attention is all you need", 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA; 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; 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.
[0114] In general, an attention mechanism maps a query and a set of key-value pairs to an output, where the query, key, and value are all vectors. The output is computed as a weighted sum of the values, where the weight assigned to each value is computed, for example, by a compatibility function between the query and the corresponding key, such as the dot product or scaled dot product.
[0115] In general, the self-attention mechanism is configured to associate different positions in the same sequence to determine a transformed version of the sequence as an output. For example, the attention layer input can comprise a vector for each element of the input sequence. These vectors provide inputs to the self-attention mechanism, which uses these vectors to determine a new representation of the same sequence for the attention layer output, which also comprises a vector for each element of the input sequence. The output of the self-attention mechanism can be used as the attention layer output, or the output of the self-attention mechanism can be processed by one or more of a feedforward layer, a skip connection, or a normalization operation to provide the attention layer output.
[0116] In some implementations, the attention mechanism may be, for example, a matrix W Q A query transformation defined by, say, the matrix W K and the key transformation defined by, for example, the matrix W V Each of the value transformations defined by the above is applied to the attention layer input, which is the input data X to the attention layer, to obtain a query matrix Q=XW Q , a key matrix K=XW that contains the respective keys for each vector in the input sequence. K, and a value matrix V=XW that contains the respective values for each vector in the input sequence. V These matrices are used to determine the attention sequence for output. For example, the attention mechanism can be a dot-product attention mechanism applied by applying each query vector to each key vector to determine a respective weight for each value vector, and then combining the value vectors using the respective weights to determine the self-attention layer output for each element of the input sequence. This self-attention layer output can be scaled by a scaling factor, e.g., by the square root of the dimensions of the query and key, to implement scaled dot-product attention. Thus, for example, the output of the attention mechanism can be a softmax
[0117]
number
[0118] where d is the dimension of the key (and value) vector. In another implementation, the attention mechanism comprises an "additive attention" mechanism that computes the fitness function using a feedforward network with one hidden layer. The output of the attention mechanism can be further processed by one or more fully connected feedforward neural network layers.
[0119] The attention mechanism can implement multi-headed attention, i.e., it can apply multiple different attention mechanisms in parallel. The outputs of these attention mechanisms can then be combined, e.g., concatenated, and if necessary, a learned linear transformation can be applied to reduce the original dimensionality.
[0120] The term "configured" is used herein in connection with systems and computer program components. A system of one or more computers is configured to perform certain operations or actions means that the system has installed thereon software, firmware, hardware, or a combination thereof that, when in operation, causes the system to perform those operations or actions. One or more computer programs are configured to perform certain operations or actions means that one or more programs contain instructions that, when executed by a data processing device, cause the device to perform those operations or actions.
[0121] The embodiments of the subject matter and the functional operations described herein can be implemented in digital electronic circuitry, in tangibly embodied computer software or firmware, in computer hardware including the structures disclosed herein and their structural equivalents, or in a combination of one or more of them. The embodiments of the subject matter described herein can be implemented as one or more computer programs, e.g., as one or more modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by or control of the operation of a data processing device. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random-access or serial-access memory device, or a combination of one or more of them. Alternatively or additionally, 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 an appropriate receiver device for execution by the data processing device.
[0122] The term "data processing apparatus" refers to data processing hardware and encompasses any kind of apparatus, device, and machine for processing data, including, by way of example, a programmable processor, a computer, or multiple processors or computers. The apparatus may also be or further include special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). In addition to hardware, the apparatus may also optionally include code that creates an execution environment for computer programs, such as code that constitutes a processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of these.
[0123] 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 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 as part of a file that holds other programs or data, for example in one or more scripts stored in a markup language document, in a single file dedicated to the program, or in multiple linked files, for example files that store one or more modules, subprograms, or portions of code. A computer program may be deployed to be executed on one computer or on multiple computers located at one site or distributed across multiple sites and interconnected by a data communications network.
[0124] The term "database" is used broadly herein to refer to any collection of data, which need not be structured in any particular manner, or at all, and which may be stored on storage devices in one or more locations. Thus, for example, an index database may contain multiple collections of data, each of which may be organized differently and each of which may be accessed differently.
[0125] Similarly, the term "engine" is used broadly herein to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions. Generally, an engine is implemented as one or more software modules or components installed on one or more computers at one or more locations. In some cases, one or more computers are dedicated to a particular engine, and in other cases, multiple engines may be installed and running on the same one or more computers.
[0126] The processes and logic flows described herein may be implemented 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 may also be implemented by special purpose logic circuitry, such as an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.
[0127] A computer suitable for executing a computer program may be based on a general-purpose or special-purpose microprocessor, or both, or any other type of central processing unit. In general, the central processing unit receives 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 implementing or executing instructions, and one or more memory devices for storing instructions and data. The central processing unit and memory may be supplemented by or incorporated in special-purpose logic circuitry. In general, a computer also includes one or more mass storage devices, such as magnetic disks, magneto-optical disks, or optical disks, for storing data, or is operatively coupled to receive data therefrom or transfer data thereto, or both. However, a computer need not have such devices. Furthermore, a computer may 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 just a few.
[0128] Suitable computer-readable media 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, such as EPROM, EEPROM, and flash memory devices; magnetic disks, such as internal hard disks or removable disks; magneto-optical disks; and CD ROM disks and DVD-ROM disks.
[0129] To enable interaction with a user, the embodiments of the subject matter described herein can be implemented on a computer having a display device, such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user, and a keyboard and pointing device, such as a mouse or trackball, by which the user can input to the computer. Other types of devices can also be used to enable interaction with the user, for example, feedback provided to the user can be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback, and input from the user can be received in any form, including acoustic input, speech input, or tactile input. In addition, the computer can interact with the user by sending documents to and receiving documents from a device being 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. The computer can also interact with the user by sending text messages or other forms of messages to a personal device, such as a smartphone running a messaging application, and receiving a response message in return from the user.
[0130] A data processing apparatus for implementing machine learning models may also include dedicated hardware accelerator units for handling common computationally intensive parts of, e.g., machine learning training workloads, or production, e.g., inference, workloads.
[0131] The machine learning model can be implemented and deployed using a machine learning framework, such as the TensorFlow framework.
[0132] The embodiments of the subject matter described herein may be implemented in a computing system that includes a back-end component, e.g., a data server, or a middleware component, e.g., an application server, or a front-end component, e.g., a client computer having a graphical user interface, web browser, or app through which a user may interact with an implementation of the subject matter described herein, 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 communications network. Examples of communications networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.
[0133] A computing system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communications 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., HTML pages, to a user device, e.g., for the purpose of displaying the data to and receiving input from a user interacting with the device acting as a client. Data generated at the user device, e.g., a result of a user interaction, can be received at the server from the device.
[0134] Although this specification contains many specific details of implementations, 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 a particular embodiment of a particular invention. Some features described in the context of separate embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, although features may be described above as acting in a particular combination, and may even be initially claimed as such, one or more features from a claimed combination may, in some cases, be deleted from the combination, and the claimed combination may be directed to a subcombination or a variation of the subcombination.
[0135] Similarly, although operations are illustrated in the figures and described in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order or sequence illustrated, or that all of the operations shown be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Furthermore, it should be understood that the separation of various system modules and system components in the above-described embodiments is not required for such separation in all embodiments, and that the described program components and systems may generally be integrated together in a single software product or packaged into multiple software products.
[0136] Specific embodiments of the present subject matter have been described above. Other embodiments are within the scope of the appended claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As an example, the processes depicted in the appended figures do not necessarily require the particular order depicted, or sequence, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. [Explanation of symbols]
[0137] 100 Neural Network System 102 Context sequence, candidate output sequence, context 110 Autoregressive Language Model Neural Network, Autoregressive Neural Network 120 candidate output series 130 Criteria Evaluation System 140 Rating Score 150 output series 220A~N Standard engine 230 Input Series 300 processes 410 First Sub-network, Input Sequence 420 Input Series 430 First Subnetwork 440 Hidden 450 output subnetworks 460 Classifier 500 processes
Claims
1. 1. A method implemented by one or more computers, comprising: receiving a request for an output sequence; generating a first candidate output sequence using an autoregressive language model neural network, the first candidate output sequence comprising a plurality of tokens each selected from a vocabulary of tokens; For each output sequence criterion in the set of one or more output sequence criterion: using the autoregressive language model neural network to process an input sequence comprising (i) the first candidate output sequence followed by (ii) one or more tokens specifying the output sequence criteria to generate a respective score for each token in the vocabulary; determining a rating score for each of the first candidate output sequences from the scores of the tokens in the corresponding proper subset of the vocabulary of tokens, the rating score representing the degree to which the first candidate output sequence generated by the autoregressive language model neural network satisfies the output sequence criteria; providing the first candidate output sequence in response to the request using the respective rating scores of the first candidate output sequences for the one or more output sequence criteria; A method comprising:
2. 2. The method of claim 1 , wherein the request is for an output sequence following a context sequence, and generating the first candidate output text sequence comprises conditioning the autoregressive language model neural network with an input comprising the context sequence, and the input sequence further comprises the context sequence, the input sequence comprising (i) the first candidate output sequence followed by (ii) one or more tokens specifying the output sequence criteria.
3. generating one or more additional candidate output sequences using the autoregressive language model neural network; For each additional candidate output sequence, For each output sequence criterion in said set of one or more output sequence criterion: using the autoregressive language model neural network to process an input sequence comprising (i) the additional candidate output sequences followed by (ii) the one or more tokens that specify the output sequence criteria to generate a respective score for each token in the vocabulary; determining, from the respective scores of tokens in the corresponding subset of the vocabulary of tokens, respective rating scores indicative of the degree to which the additional candidate output sequences generated by the autoregressive language model neural network satisfy the output sequence criteria; Further comprising: providing the first candidate output sequence in response to the request using the respective rating scores for the one or more output sequence criteria, using the respective rating scores of the first candidate output sequence and the one or more additional candidate output sequences to select one of the first candidate output sequence and the one or more additional candidate output sequences to provide in response to the request.
3. The method of claim 1 or claim 2, comprising:
4. using the respective rating scores of the first candidate output sequence and the one or more additional candidate output sequences to select one of the first candidate output sequence and the one or more additional candidate output sequences to provide in response to the request; generating, for each of the candidate output sequences, a respective quality score from the respective rating scores of the candidate output sequences for each of one or more output sequence criteria in the set; selecting the candidate output sequence having the highest respective quality score as the sequence to be provided in response to the request; 4. The method of claim 3, comprising:
5. providing the first candidate output sequence in response to the request using the respective rating scores for the one or more output sequence criteria, determining whether the respective quality scores of the first candidate output sequences for a first output criterion in the set satisfy a threshold; determining not to provide the first candidate output sequence in response to the request when the respective quality scores of the first candidate output sequence for the first output criterion in the set do not satisfy the threshold; 5. The method according to claim 1 , comprising:
6. A method for training an autoregressive language model neural network according to any one of claims 1 to 5, comprising the steps of: Obtaining one or more batches of training examples, each training example comprising: (i) a training input sequence comprising a training output sequence followed by (ii) one or more tokens specifying a particular output sequence criterion from said set of output sequence criteria; and For the corresponding output sequence criterion, a ground truth rating score that indicates the degree to which the training output sequence satisfies the particular output sequence criterion. and For each training example in the batch, processing the training input sequence in the training examples using the autoregressive language model neural network to generate a respective score for each token in the vocabulary; training the autoregressive language model neural network to minimize, for each training example in the batch, a loss function that measures the error between (i) the respective scores for the tokens in the vocabulary generated for the training example and (ii) a ground truth set of scores for the tokens in the vocabulary, resulting in the ground truth rating score for the training example; A method comprising:
7. training the autoregressive language model neural network to minimize a loss function, applying a loss only to the error without applying a loss to any previous positions in the training input sequence.
7. The method of claim 6, comprising:
8. 8. The method of claim 6 or claim 7, further comprising, prior to the step of training the autoregressive language model neural network to minimize a loss function, training the autoregressive language model neural network on a language modeling task that requires predicting a next token in a sequence of tokens given a previous token in the sequence.
9. 1. A method implemented by one or more computers, comprising: receiving a request for an output sequence; generating a first candidate output sequence using an autoregressive language model neural network, the first candidate output sequence comprising a respective token at each of a plurality of positions, the language model neural network comprising: a first sub-network, at each particular location of the plurality of locations, a first sub-network configured to process an input comprising a plurality of input tokens to generate a respective hidden state for each said input token, the input tokens comprising said token at each position preceding said particular position in said first candidate output sequence; and an output sub-network, at each particular location of the plurality of locations, processing the respective hidden states for the input tokens at a position immediately preceding the particular position to generate a respective score for each token in a vocabulary of tokens; using the respective scores to select one of the tokens in the vocabulary as the token at the particular position in the first candidate output sequence. The output subnetwork is configured as follows: and processing, using one or more classifier layers, one or more of the respective hidden states generated by processing an input comprising a plurality of input tokens including all of the tokens at all of the positions in the first candidate output sequence by the first sub-network to generate, for each output sequence criterion in a set of one or more output sequence criteria, a respective rating score representing the degree to which the first candidate output sequence generated by the autoregressive language model neural network satisfies the output sequence criterion; providing the first candidate output sequence in response to the request using the respective rating scores of the first candidate output sequences for the one or more output sequence criteria; A method comprising:
10. 10. The method of claim 9, wherein the request is for an output sequence following a context sequence, and generating the first candidate output text sequence includes conditioning the autoregressive language model neural network with an input comprising the context sequence, and for each particular position, the input tokens further comprise tokens from the context sequence.
11. generating one or more additional candidate output sequences using the autoregressive language model neural network; generating, for each additional candidate output sequence, a respective rating score for each output sequence criterion in the set of one or more output sequence criteria that represents the degree to which the additional candidate output sequence generated by the autoregressive language model neural network satisfies the output sequence criterion; Further comprising: providing the first candidate output sequence in response to the request using the respective rating scores for the one or more output sequence criteria, using the respective rating scores of the first candidate output sequence and the one or more additional candidate output sequences to select one of the first candidate output sequence and the one or more additional candidate output sequences to provide in response to the request. The method of claim 9 or claim 10, comprising:
12. using the respective rating scores of the first candidate output sequence and the one or more additional candidate output sequences to select one of the first candidate output sequence and the one or more additional candidate output sequences to provide in response to the request; generating, for each of the candidate output sequences, a respective quality score from the respective rating scores of the candidate output sequences for each of one or more output sequence criteria in the set; selecting the candidate output sequence having the highest respective quality score as the sequence to be provided in response to the request; 12. The method of claim 11, comprising:
13. providing the first candidate output sequence in response to the request using the respective rating scores for the one or more output sequence criteria, determining whether the respective quality scores of the first candidate output sequences for a first output criterion in the set satisfy a threshold; determining not to provide the first candidate output sequence in response to the request when the respective quality scores of the first candidate output sequence for the first output criterion in the set do not satisfy the threshold; The method according to any one of claims 9 to 12, comprising:
14. processing one or more of the respective hidden states generated by processing an input comprising a plurality of input tokens including all of the tokens at all of the positions in the first candidate output sequence by the first sub-network, processing the respective hidden states for the tokens in their final positions in the first candidate output sequence generated by the first sub-network; The method according to any one of claims 9 to 13, comprising:
15. processing one or more of the respective hidden states generated by processing an input comprising a plurality of input tokens including all of the tokens at all of the positions in the first candidate output sequence by the first sub-network, processing the respective hidden states generated by the first sub-network for a specified input token at a specified position among the input tokens; The method according to any one of claims 9 to 14, comprising:
16. during said generating of the first candidate output sequence, for one or more designated positions prior to a final position in the first candidate output sequence; processing one or more of the respective hidden states generated by the first sub-network at the designated position in the first candidate output sequence using the one or more classifier layers to generate, for each output sequence criterion in a set of one or more output sequence criteria, a respective rating score that represents the degree to which the portion of the first candidate output sequence generated at the designated position satisfies the output sequence criterion; determining whether (i) the first candidate output sequence should continue to be generated past the designated location, or (ii) whether any portion of the first candidate output sequence should not be provided in response to the request based on the respective rating scores for the output sequence criteria in the set generated at the designated location; The method according to any one of claims 9 to 15, further comprising:
17. A method for training an autoregressive language model neural network according to any one of claims 9 to 16, comprising: Obtaining one or more batches of training examples, each training example comprising: the training output sequence, and a respective ground truth rating score for each of one or more of the output sequence criteria, the ground truth rating score representing the degree to which the training output sequences satisfy the particular output sequence criterion; and For each training example in the batch, processing one or more of the respective hidden states generated by processing an input comprising a plurality of input tokens including all tokens at all positions in the training output sequences in the training examples by the first sub-network using the one or more classifier layers to generate a respective rating score for each output sequence criterion; training the one or more classifier layers to minimize, for each training example in the batch, a loss function that measures the error between (i) the respective rating score generated for the training example and (ii) the respective ground truth rating score for the training example; A method comprising:
18. training the one or more classifier layers to minimize a loss function, keeping the input sub-network frozen during the training of the one or more classifier layers.
20. The method of claim 17, comprising:
19. 19. The method of claim 17 or claim 18, further comprising, prior to the step of training the one or more classifier layers, training the autoregressive language model neural network on a language modeling task that requires predicting a next token in a sequence of tokens given a previous token in the sequence.
20. 20. The method of claim 1, wherein the output sequence is a text sequence and the vocabulary of tokens comprises a plurality of text tokens.
21. The method of claim 20 when also dependent on claim 2 or claim 10, wherein the context sequence is a text sequence.
22. One or more computers; one or more storage devices storing instructions that, when executed by said one or more computers, cause said one or more computers to perform the respective operations of any one of claims 1 to 21; A system comprising:
23. One or more computer readable storage media storing instructions that, when executed by one or more computers, cause the one or more computers to perform the respective operations of the method of any one of claims 1 to 21.
Citation Information
Patent Citations
Silicone-based release coating composition
JP2001064390A
Dependency-based query expansion alteration candidate scoring
US20120131031A1
Methods and apparatus for self-adaptive time series forecasting engine
US20180300737A1
Training neural networks using priority queues
US20190130267A1
Training sequence generation neural networks using quality scores
US20190362229A1
