Stepwise deployed denoising neural network

The non-autoregressive neural network system addresses AR limitations by generating sequences in parallel, achieving faster and more accurate results in tasks like machine translation.

JP2025170302APending Publication Date: 2025-11-18DEEPMIND TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025135168
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-10-06
Filing Date
2025-08-14
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Autoregressive (AR) neural networks face limitations in training speed, conditioning flexibility, and architecture restrictions, making them inefficient for generating sequences, especially in tasks like machine translation and text completion.

Method used

A non-autoregressive neural network system that generates output sequences in parallel using a decoder neural network, conditioned on context input, allowing for faster and more accurate sequence generation through iterative updates.

Benefits of technology

The system achieves state-of-the-art performance in non-AR models, significantly reducing generation delay and outperforming AR models in tasks such as machine translation, while maintaining high quality and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025170302000001_ABST
    Figure 2025170302000001_ABST
Patent Text Reader

Abstract

To provide a stepwise deployed denoising neural network.SOLUTION: The method, system, and device comprise a computer program encoded on a computer storage medium for generating an output sequence using a non-autoregressive neural network.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This specification relates to processing inputs using neural networks. [Background technology]

[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 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, i.e., the next hidden layer or the output layer. Each layer of the network generates an output from the received input according to the current values ​​of each set of parameters. [Prior art documents] [Non-patent literature]

[0003] [Non-Patent Document 1] Kudo et al., arXiv:1808.06226 [Non-patent document 2] Dosovitskiy et al., arXiv:2010.11929 [Non-patent document 3] Vaswani et al., arXiv:1706.03762 Summary of the Invention [Means for solving the problem]

[0004] This specification describes a system, implemented as a computer program on one or more computers at one or more locations, that uses a non-autoregressive neural network to generate an output sequence.

[0005] In particular, the neural network includes a decoder neural network configured to receive the current output sequence as an input.

[0006] The current output sequence includes a respective output token from the vocabulary of output tokens at each of a plurality of output positions.

[0007] The decoder neural network is configured to process the current output sequence while conditioned on the context input to generate, for each of a plurality of output positions, a decoder output including a respective score for each output token in the vocabulary of output tokens.

[0008] Thus, the system can use the neural network to iteratively generate new output sequences by, at each iteration, replacing one or more of the tokens in the current output sequence at the time of the iteration with tokens selected using the scores generated by the decoder neural network.

[0009] Particular embodiments of the subject matter described in this specification can be implemented to realize one or more of the following advantages.

[0010] Autoregressive (AR) models have shown excellent results in generating sequences of text and other tokens. However, while training scales very well, sampling is prohibitively slow for many practical applications. Furthermore, AR models are limited in the types of conditioning they can seamlessly handle, and their left-to-right restriction makes it difficult to "fill in the gaps" of partially written text drafts or other incomplete sequences. Finally, AR models require the network architecture to be causal, severely limiting the types of neural network architectures that can be used for text modeling.

[0011] This specification describes methods for training a non-autoregressive neural network to accurately generate output sequences and for using the trained neural network to decode the output sequences. Unlike other non-autoregressive approaches that lag behind AR benchmarks and require the distillation of large AR models in practice, the described techniques are faster than AR approaches and achieve results that match or exceed AR approaches in sequence generation tasks. For example, the described techniques can be used to achieve state-of-the-art performance among non-AR models in machine translation tasks.

[0012] The details of one or more embodiments of the subject matter herein 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 explanation of the drawings]

[0013] [Figure 1] FIG. 1 illustrates an exemplary sequence generation system. [Figure 2] 1 is a flow diagram of an exemplary process for training a neural network system. [Figure 3] FIG. 1 illustrates training of a neural network system when a single update iteration is performed. [Figure 4] 1 is a flow diagram of an example process for generating an output sequence. [Figure 5] 10 is a flow diagram of an exemplary process for performing subsequent generation iterations. DETAILED DESCRIPTION OF THE INVENTION

[0014] Like reference numbers and designations in the various drawings indicate like elements.

[0015] This specification describes a system, implemented as a computer program on one or more computers at one or more locations, that uses a non-autoregressive neural network to generate an output sequence.

[0016] The system can be configured to generate any of a variety of types of continuous output, such as, for example, text, audio, image data, etc.

[0017] As an example, the system may receive context input as part of a request and generate an output sequence that is a response to the request. As a particular example, the system may be part of a dialog system and the context data may be a prompt submitted by a user of the dialog system.

[0018] As another example, if the context input is a sequence of words, i.e., text in one language, e.g., a natural language, the output sequence produced by the neural network may be a translation of the input text into another language, e.g., a translation into a natural language, i.e., a sequence of words that is the translation.

[0019] As another example, if the context input is a sequence representing a spoken utterance (e.g., an audio waveform digitized using a time-frequency domain representation), the output sequence produced by the neural network may be a portion of text (i.e., a sequence of words) that is a transcript of the utterance.

[0020] As another example, the context data may be a prompt and the output sequence may be the text following the prompt, i.e., the neural network is made to perform a conditional text generation task.

[0021] As another example, the context input may be natural language text or features of natural language text, and the output sequence may be a spectrogram or other data defining the audio of the text spoken in the natural language (where tokens, as described below, may represent audio frames).

[0022] As another example, the context input may be an image, i.e. intensity values ​​of image pixels or patches of image pixels, and the output sequence is a text sequence representing a caption for the image.

[0023] As another example, the context input can be any conditional input for generating an image, e.g., a text input or a representation of a conditional image, and the target or final output sequence represents the pixels of the image according to the conditional input (where tokens, as described below, can represent individual pixel values ​​or groups of pixels such as image patches). This can be used, for example, to generate an image similar to an image described by text or a conditional image, or to in-fill an image.

[0024] As another example, the context input may be computer code or a textual description of the function of the computer code, and the output sequence may be a sequence of computer code in a programming language that completes the input code in the context input or performs the function described in the context input.

[0025] As another example, the context input may be a sequence representing a molecule, e.g., as a graph or using SMILES (Simplified Molecular Input Line Entry System), or a DNA or RNA sequence, or a text description of one or more characteristics or properties of a molecule for synthesis, and the output sequence may be a sequence representing a molecule for synthesis that has, e.g., the desired characteristics or properties or resembles the context input. A molecule may be synthesized according to the output sequence.

[0026] 1 illustrates an exemplary sequence generation system 100. Sequence generation system 100 is an 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.

[0027] The sequence generation system 100 processes the context input 102 using a neural network system 110 to generate an output sequence 112 .

[0028] As noted above, the system may be configured to generate any suitable type of output sequence 112 conditioned on any suitable type of context input 102 .

[0029] Generally, each output sequence 112 includes a respective output token from a vocabulary of tokens at each of a plurality of output positions.

[0030] For example, when system 100 generates a text sequence, the tokens in the vocabulary may be any suitable text tokens that represent elements of text in one or more natural languages, such as words, word fragments, punctuation marks, and optionally numbers and other text symbols included in a corpus of text. For example, system 100 may tokenize a given word sequence by applying a tokenizer, such as the SentencePiece tokenizer (Kudo et al., arXiv:1808.06226) or another tokenizer, to divide the sequence into tokens from the vocabulary.

[0031] To allow system 100 to generate output sequences of variable length, the vocabulary may also contain "padding" tokens that indicate that a token should not be present in a given output position in the final output of system 100.

[0032] More specifically, the neural network system 110 includes a decoder neural network 120 .

[0033] The decoder neural network 120 is configured to receive as input a current output sequence including a respective output token from a vocabulary of output tokens at each of a plurality of output positions, and to process the current output sequence while conditioned on the context input to generate, for each of the plurality of output positions, a decoder output including a score distribution including a respective score, e.g., a logit value for each output token in the vocabulary of output tokens. As used herein, a "score" generated by a neural network can refer to either a logit value generated by the neural network or a probability generated by applying a softmax to a set of logit values ​​of the output tokens.

[0034] Generally, decoder neural network 120 is a non-autoregressive neural network that generates the entire decoder output in parallel, i.e., generates score distributions for all of the output positions in a single forward pass. However, decoder neural network 120 may also be an autoregressive neural network, e.g., a recurrent neural network.

[0035] For example, the decoder neural network 120 can be implemented as an acausal transformer decoder, or as another neural network that generates a score distribution for multiple output positions in a single forward pass. The transformer network can be a neural network characterized by a series of self-attention neural network layers. The self-attention neural network layers have an attention layer input for each element of the input and apply an attention mechanism to 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.

[0036] The system 100 can then use the decoder output to update the current output sequence.

[0037] After training, by iteratively updating the current output sequence using the decoder neural network 120, the system 100 can generate the output sequence 112 for a given received context input 102 in a non-autoregressive manner.

[0038] That is, the system 100 can update the current output sequence in each of multiple generation iterations while being conditioned on the context input 102, and then use the current output sequence after the final generation iteration to generate the output sequence 112.

[0039] Because the number of generation iterations is typically very small compared to the number of positions in the output sequence 112, e.g., equal to 6, 8, 10, 12, or 16, the system 100 can generate an output sequence with significantly reduced delay compared to systems using autoregressive models.

[0040] In some cases, the context input 102 is part of the output sequence 112, i.e., the system 100 is attempting to complete an output sequence that is missing a token or to generate a continuation of the output sequence 112. Tokens in the output sequence 112 that are not part of the context input may be randomly initialized from the vocabulary of output tokens.

[0041] In other cases, the neural network system 110 also includes an encoder neural network 130 configured to process the context input 102 to generate an encoded representation of the context input 102, which may include, for example, a sequence of one or more embeddings of the context input. The decoder neural network 120 is conditioned based on the encoded representation, for example, by focusing on the encoded representation. In such cases, all tokens in the output sequence may be randomly initialized before the first generation iteration.

[0042] For example, if the context input 102 is text, the encoder neural network 130 may be a transformer encoder that generates a sequence of embeddings, each representing a respective text token in the context input 102 .

[0043] As another example, if the context input 102 is an image, the encoder neural network 130 may be a vision transformer (e.g., Dosovitskiy et al., arXiv:2010.11929) or a convolutional neural network that generates a sequence of embeddings each representing a respective patch of the image.

[0044] When the neural network system 110 includes an encoder neural network 130, the decoder neural network 120 may be conditioned in any of a variety of ways based on the encoded representations produced by the encoder neural network 130. As a particular example, the decoder 120 may include one or more cross-attention layers that apply cross-attention to the encoded representations (e.g., Vaswani et al., arXiv:1706.03762).

[0045] In some implementations, the neural network system 110 includes a length prediction neural network that processes embeddings of the context input 102 to generate length predictions that define a predicted target length representing the predicted number of output tokens in the final output sequence.

[0046] System 100 then includes an embedding of the predicted target length of the output sequence as part of the encoded representation used to condition decoder 120. Utilizing a length prediction neural network in this manner can help "guide" decoder neural network 120 in determining when to predict a padding token for a terminal position in the output sequence, without requiring decoder neural network 120 to generate a sequence that is the length predicted by the length prediction neural network.

[0047] The use of the neural network system 110 to generate output sequences during inference is described below with reference to FIGS.

[0048] Before using the neural network system 110 to generate the output sequence 112 , a training system 150 within the system 100 trains the neural network system 110 on training examples 160 .

[0049] Generally, each training example 160 includes a training context input and a training output sequence, i.e., a ground truth training output sequence to be generated by the neural network system 110 from the training context input.

[0050] Training the neural network system 110 is described in further detail below with reference to FIGS.

[0051] 2 is a flow diagram of an exemplary process 200 for training a neural network system. For convenience, process 200 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed sequence generation system, such as sequence generation system 100 of FIG. 1, can perform process 200.

[0052] The system can repeatedly perform iterations of process 200 on different batches of training examples to update the parameters of the neural network system, i.e., the decoder neural network and, optionally, the encoder neural network.

[0053] That is, for each iteration of process 200, the system obtains one or more batches of training examples, e.g., by sampling batches from a larger training dataset, and uses the one or more batches of training examples to update the parameters of the neural network system. If a given output sequence contains fewer than a maximum number of output tokens, the system may extend the given output sequence with padding tokens before using it for training.

[0054] The system may continue to perform iterations of process 200 until a termination criterion for training the neural network system is met, for example, until the parameters converge, until a threshold amount of real time has elapsed, or until a threshold number of iterations of process 200 have been performed.

[0055] Each training example includes a training context input and a target output sequence for the training context input.

[0056] In each iteration of process 200, the system performs steps 202-206 for each training example in the batch.

[0057] In particular, the system generates corrupted output sequences from the target output sequences in the batch (step 202).

[0058] For each of one or more tokens in the output sequence, the system generates a corrupted output sequence by replacing the output token in the output sequence with a token randomly selected from the vocabulary.

[0059] The system can use any of a variety of methods to determine which output token to replace with a randomly selected token.

[0060] For example, the system may sample expected corruption fraction values ​​from a distribution of expected corruption fraction values, each of which defines the fraction of output tokens in the output sequence that are expected to be corrupted by executing a corruption process.

[0061] The system can then use the expected corruption rate to determine for each output position whether to replace an output token at that output position in the target output sequence, i.e., by deciding to replace an output token with a probability equal to the expected corruption rate and deciding not to replace an output token with a probability equal to 1 minus the expected corruption rate.

[0062] For each output position where it is determined to replace an output token, the system may sample a random token from the vocabulary and replace the output token at the output position with the random token sampled from the vocabulary.

[0063] Therefore, the resulting corrupted output sequence typically contains some randomly selected tokens and some original tokens from the output sequence in the training examples.

[0064] The system then updates the corrupted output sequence in each of one or more update iterations (step 204).

[0065] The number of update iterations is typically fixed to the same number for each training example in a batch, and in some cases fixed throughout training. As a particular example, the system may perform only one update iteration per training example throughout training. As another particular example, the system may perform two update iterations per training example throughout training.

[0066] In particular, at each update iteration, the system uses a decoder neural network to process the corrupted output sequence at the time of the update iteration, while the decoder neural network is conditioned based on the training context input in the training examples, to generate a decoder output for the corrupted output sequence at the time of the update iteration. As described above, the decoder output includes a respective score for each output token in the vocabulary. Furthermore, as described above, the decoder neural network can be conditioned on the context input by including tokens from the context input in the output sequence (and preventing the system from corrupting the tokens) or by being conditioned on an encoded representation of the context input generated by the encoder neural network. If a length prediction neural network is used during inference, the system can also condition the decoder based on the ground truth length of the training output sequence (before the addition of padding tokens).

[0067] The system then updates the corrupted output sequence for each of the multiple output positions by selecting a token from the vocabulary of output tokens using the decoder output of the corrupted output sequence. For example, the system can sample tokens according to score and select the output token with the highest score.

[0068] Thus, each update iteration replaces a token in the output sequence at the start of the iteration with a token selected using the output of the decoder neural network.

[0069] After the last update iteration is performed, the system processes the updated corrupted output sequence after the last update iteration using the decoder neural network while the decoder neural network is conditioned based on the training context input to generate a decoder output for the updated corrupted output sequence (step 206), which also includes a respective score for each output token in the vocabulary.

[0070] Next, the system determines the gradient of the loss function with respect to the parameters of the decoder neural network (step 208).

[0071] The loss function includes a first term that measures, for each training example, the quality of the decoder output of the updated corrupted output sequence after the last update iteration for the target output sequence. The first term of the loss function term that measures the quality of the decoder output may represent the first term in the reconstruction loss of the target output sequence.

[0072] For example, the first term may be a negative log-likelihood term that measures, for each training example and for each output position, the logarithm of the score assigned to an output token at an output position in the target output sequence by the decoder output for the updated corrupted output sequence. For example, the first term may be the negative of the average of the sum, for each output position, of the logarithms of the scores assigned to an output token at an output position in the target output sequence by the decoder output for the updated corrupted output sequence, for each training example.

[0073] Optionally, the loss function may also include a respective second term for each update iteration. The second term for a given update iteration measures, for each training example, the quality of the decoder output for the corrupted output sequence at the time of the update iteration for the target output sequence (i.e., instead of the corrupted output sequence updated after the last update iteration). The second term of the loss function term measuring the quality of the decoder output may represent the second term in the reconstruction loss of the target output sequence.

[0074] For example, each second term may be a negative log-likelihood term that measures, for each training example and for each output position, the logarithm of the score assigned by the decoder output to an output token at an output position in the target output sequence for a corrupted output sequence at the time of the update iteration. For example, the second term may be the negative of the average of the sum, for each training example, of the logarithm of the score assigned by the decoder output to an output token at an output position in the target output sequence for a corrupted output sequence at the time of the update iteration.

[0075] Generally, the system does not backpropagate through a sampling operation, i.e., using the decoder output to select tokens during an update iteration, when calculating the gradients of the first term and, if included, the second term. That is, the system applies a "stop gradient" after each update iteration when calculating each of the gradient terms.

[0076] If the loss function has multiple terms, the overall loss function can be the sum or weighted sum of the individual terms.

[0077] The system uses the gradients to update the parameters of the decoder neural network (step 210). For example, the system can apply an appropriate optimizer, such as an Adam optimizer, an rmsProp optimizer, an Adafactor optimizer, or another machine learning optimizer, to the gradients and parameters to update the parameters.

[0078] If the neural network system also includes an encoder neural network, the system may also compute gradients with respect to a loss function with respect to the encoder parameters, i.e., by backpropagating the gradients through the decoder neural network to the encoder neural network, and then use the gradients to update the parameters of the encoder neural network, e.g., using the optimizer described above.

[0079] If the neural network system also includes a length prediction neural network, this can be trained separately (but with the same training examples) using supervised training, for example based on cross-entropy loss.

[0080] Thus, by repeatedly performing process 200, the system can efficiently train the neural network to generate accurate output sequences. In particular, the system can use a smaller number of update iterations than those used during subsequent inference, thereby improving the computational efficiency of training. To compensate, i.e., to ensure that the neural network continues to be trained to maximize inference accuracy, the system starts with a corrupted output sequence rather than with output sequences sampled from a prior or noise distribution, as is done during inference. In this way, the model learns how to denoise samples that may be encountered during full deployment to be used during inference.

[0081] This efficient training is illustrated in Figure 3.

[0082] Figure 3 shows an example of the training process for training examples when a single update iteration is performed. In the example of Figure 3, the tokens are word fragments generated by tokenizing the training data using a word fragment model, such as a SentencePiece model or another suitable word fragment tokenizer.

[0083] As shown in FIG. 3, the training example includes a training output sequence 310: "A sundae is an ice cream dessert that typically consists of one or more."

[0084] The system then performs corruption 320 to generate a corrupted training sequence 330 that replaces word fragments with randomly selected word fragments to produce "A sund loop Ga genes ice greatly photograp that76fen $30 oneFrench."

[0085] The system then performs "generate and expand" 340, i.e., performs a single update iteration as described above, to generate updated corrupted sequence 350, "Sundae is an optical cream piece that is good as one p." As can be seen from this example, although the neural network cannot correctly reconstruct output sequence 310 in a single update iteration, updated corrupted sequence 350 is much closer to output sequence 310 than corrupted output sequence 330.

[0086] The system then calculates a loss that includes a denoising term 360 (the “first term” above) that measures the decoder output generated from the corrupted output sequence 330 relative to the training output sequence 310, and an expanded denoising term 370 (the “second term” of the single update iteration above) that measures the decoder output generated from the updated corrupted output sequence 350 relative to the training output sequence 310.

[0087] Thus, even if only a single update iteration is performed, the loss still measures the performance of the neural network in predicting from both sequences that are significantly different from the target output, i.e., sequences that are likely to be seen in early update iterations during inference, and sequences that are somewhat similar to the target output, i.e., sequences that are likely to be seen in later update iterations during inference.

[0088] 4 is a flow diagram of an exemplary process 400 for generating a final output sequence from context inputs. For convenience, process 400 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed neural network system, such as sequence generation system 100 of FIG. 1, can perform process 400.

[0089] The system receives a (new) context input (step 402).

[0090] The system generates a (new) output sequence containing a respective output token at each of a plurality of output positions (step 404).

[0091] For example, the system can randomly sample each token from the vocabulary, or it can randomly sample each token from a prior distribution over tokens in the vocabulary.

[0092] As another example, if the task is to complete a partial output sequence, i.e., a sequence that includes some of the tokens in the output sequence but has missing tokens in one or more positions, and the context input includes the partial output sequence, the system can generate a new output sequence based on the context input, i.e., by generating an output sequence that has tokens from the context input in the appropriate positions and replaces the missing tokens with tokens sampled randomly or from a prior distribution.

[0093] For example, the context input may include one or more initial tokens in the output sequence if the task requires completion of the input sequence, or it may include one or more tokens in place of the entire output sequence if the task requires "filling in" a partial input sequence.

[0094] If the neural network system includes an encoder neural network, the system also processes the context input using the encoder neural network to generate an encoded representation of the context input that includes a sequence of one or more embeddings of the context input.

[0095] If the neural network system also includes a length prediction neural network, the system processes one or more embeddings of the context input using the length prediction neural network to generate a length prediction that defines a predicted target length representing a predicted number of output tokens in the final output sequence. The system then includes the predicted target length as part of the encoded representation, for example, by concatenating an embedding of the predicted target length onto the sequence of one or more embeddings generated by the encoder.

[0096] Next, the system updates the new output sequence in each of multiple generation iterations (step 406).

[0097] In particular, the system typically performs a fixed number of generation iterations, e.g., 4, 8, 12, or 16 update iterations. As noted above, the number of generation iterations is typically greater than the number of update iterations used during training.

[0098] At each update iteration, the system uses the decoder neural network to update a new output sequence, and the decoder neural network is conditioned based on the new context input.

[0099] In particular, at each generation iteration, the system processes a new output sequence at the time of the generation iteration using a decoder neural network, which is conditioned based on new context inputs to generate decoder outputs for the new output sequence.

[0100] If the neural network system includes an encoder neural network, the decoder neural network is conditioned based on the encoded representation (optionally including an embedding of the output of the length prediction neural network).

[0101] The system then selects tokens from the vocabulary of output tokens using the decoder output for the new output sequence for a subset of the plurality of output positions. The subset may be, but need not be, a proper subset of output positions is one that does not include all output positions. Mathematically, and as used herein, a subset can include all output positions within the plurality of output positions (i.e., it includes an "improper subset"). In other words, the system selects tokens from the vocabulary of output tokens using the decoder output for the new output sequence for a proper subset of the plurality of output positions or all of the plurality of output positions.

[0102] In some implementations, the system selects tokens for all output positions, i.e., the subset is not a proper subset.

[0103] In some other implementations, the system selects tokens for only a proper subset of the output positions. For example, the system can randomly select a proper subset of the output positions and then select new tokens only for positions within the proper subset. Updating only a proper subset of the output positions can help the system generate diverse final output sequences for tasks that require diversity, such as conditional or unconditional text generation.

[0104] In some implementations, to select a token for a given output position, the system can sample the tokens using the decoder output. As a particular example, the system can apply a temperature value τ to each score in the decoder output to generate a temperature-adjusted score and sample the tokens using the temperature-adjusted score. Applying a temperature value τ to the score score produces a modified score score τ and thus determining

[0105]

number

[0106] That is, the system can process token scores ("logits") for each output position using a tempered softmax, i.e., a temperature between 0 and 1, to generate a distribution of temperature-adjusted scores (probabilities), and then sample tokens using the temperature-adjusted scores. Lowering the temperature can help the system converge to a high-quality output sequence in fewer generation iterations.

[0107] In another implementation, the system uses argmax-unrolled decoding to select tokens in each generation iteration.

[0108] When performing argmax-expanded decoding, in the first generation iteration, the system selects each token for each output position by sampling from the score distribution, for example, with or without temperature reduction.

[0109] The system then passes the decoder output from the previous iteration, in addition to the updated output sequence, to each subsequent generation iteration, and uses the decoder output from the previous iteration to update the output sequence in the subsequent iteration. Updating the output sequence in subsequent generation iterations when the system uses argmax-expanded decoding is described in more detail below with reference to Figure 5.

[0110] The system generates a final output sequence for the new context input from the new output sequence after the last generation iteration of the multiple update iterations (step 408).

[0111] In some implementations, the system directly uses the new output sequence to generate the final output sequence, for example, by removing padding tokens from the new output sequence and providing the resulting sequence as the final output sequence.

[0112] In some other implementations, the system performs multiple iterations of process 400 in parallel to generate multiple new output sequences, and then directly uses only the new output sequences with the highest scores, e.g., highest log-likelihoods, to generate the final output sequences.

[0113] 5 is a flow diagram of an exemplary process 500 for updating the output sequence in subsequent generation iterations when the system uses argmax-expanded decoding. For convenience, process 500 is described as being performed by one or more computer systems located at one or more locations. For example, a neural network system, such as sequence generation system 100 of FIG. 1, can perform process 500 when appropriately programmed.

[0114] As described above, in the first generation iteration, the system processes the output sequence using a decoder neural network conditioned on context inputs to generate decoder outputs, and uses the decoder outputs to update the output sequence by selecting a respective token from a vocabulary of tokens for each output position.

[0115] The system then executes process 500 in each subsequent generation iteration.

[0116] The system uses the decoder output at the time of the update iteration to select an appropriate subset of output positions (step 502). In particular, the system may select an appropriate subset by selecting a threshold number of the most uncertain output positions. For example, the system may select a threshold number of output positions whose output tokens received the lowest scores in the decoder output.

[0117] The system processes the output sequence at the time of the generation iteration using a decoder neural network that is conditioned based on the context input to update the decoder output (step 504).

[0118] After updating the decoder output, the system generates a temporary output sequence by sampling tokens using the decoder output for each of the output positions in the appropriate subset (step 506).

[0119] For each output position that is not in the proper subset, the system selects a token using the decoder output or using the token at the output position at the time of the update iteration as the token at the output position.

[0120] The system processes the temporary output sequence using a decoder neural network that is conditioned based on the context input to generate a temporary decoder output (step 508).

[0121] The system then updates the output sequence (step 510).

[0122] In particular, the system updates the output sequence by using the decoder output to select a token from the vocabulary for each output position that is not in the proper subset. More specifically, the system selects the argmax token (i.e., the token with the highest score) for that position according to the decoder output.

[0123] For each output position in the appropriate subset, the system selects a token from the vocabulary using the temporary decoder output. More specifically, the system selects the argmax tokens for that position according to the temporary decoder output.

[0124] Therefore, tokens in the proper subset that are most uncertain are selected using an additional "expansion" step for tokens that are not in the proper subset. That is, subsequent generation iterations are performed by resampling tokens with low certainty according to the expanded logits, rather than just the predicted logits of a single step. This allows the sampling rate to be improved while maintaining the quality of the output sequence, i.e., by running fewer generation iterations.

[0125] [Table 1]

[0126] Table 1 shows the performance of various systems on two machine translation tasks: English to German (EN → DE) and German to English (DE → EN). In particular, the table shows the performance of each system on each task in terms of raw BLEU scores. The other systems include both autoregressive (AR) systems and other non-AR systems. The table shows the performance of the described technique (SANDEA) both with ("deterministic") and without ("stochastic") argmax expansion decoding, and with various generation steps T.

[0127] As can be seen in Table 1, the described technique is competitive with AR systems despite the reduced delay and achieves better performance than other non-AR systems. Furthermore, as can be seen in Table 1, the deterministic variant achieves better performance than the stochastic variant with fewer generation steps.

[0128] [Table 2]

[0129] Table 2 shows the improvement achieved by the described technique for the EN → DE translation task compared to the AR model (the transformer-based model mentioned above) using various numbers of generation steps T. As can be seen from the table, the described technique achieves significant speedup compared to the AR model even with 16 generation steps, and for fewer generation steps it is possible to achieve speedups of up to 4.7x while still maintaining reasonable quality.

[0130] This specification uses the term "configured" in connection with systems and computer program components. A system of one or more computers configured to perform a particular operation or action means that the system has installed thereon software, firmware, hardware, or a combination thereof, which, when in operation, causes the system to perform the operation or action. A computer program or programs configured to perform a particular operation or action means that the program or programs contain instructions that, when executed by a data processing device, cause the device to perform the operation or action.

[0131] Embodiments and functional operations of the subject matter described herein can be implemented in digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed herein and their structural equivalents, or one or more combinations thereof. Embodiments of the subject matter described herein can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory storage medium for execution by or control of the operation of a data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random-access memory device, or a serial-access memory device, or one or more combinations thereof. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to a suitable receiver device for execution by the data processing apparatus.

[0132] The term "data processing apparatus" refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including, by way of example, a programmable processor, a computer, or multiple processors or computers. The apparatus may be or even include special-purpose logic circuitry, such as a field programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). In addition to hardware, the apparatus may optionally include code that creates the execution environment for a computer program, such as code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or one or more combinations thereof.

[0133] A computer program, which may also be referred to or written as a program, software, software application, app, module, software module, script, or code, can be written in any style of programming language, including compiled or interpreted, or declarative or procedural, and can be deployed in any form, such as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored as part of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files storing one or more modules, subprograms, or portions of code. A computer program can be deployed to be executed on a single computer or on multiple computers located at one site or distributed across multiple sites and interconnected by a data communications network.

[0134] As used herein, the term "database" is used broadly to refer to any collection of data, which need not be structured in any particular way, 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 data collections, each of which may be organized and accessed in a different way.

[0135] Similarly, the term "engine" is used broadly herein to refer to a software-based system, subsystem, or process programmed to perform one or more specific functions. Generally, an engine is implemented as one or more software modules or components and installed on one or more computers in one or more locations. In some cases, one or more computers may be dedicated to a particular engine, and in some cases, multiple engines may be installed and running on the same computer.

[0136] The processes and logic flows described herein may be performed by one or more programmable computers executing one or more computer programs that perform functions by manipulating input data to generate output. The processes and logic flows may also be performed by special purpose logic circuitry, such as an FPGA or ASIC, or a combination of special purpose logic circuitry and one or more programmed computers.

[0137] A computer suitable for executing a computer program can be based on a general-purpose or special-purpose microprocessor or both, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from a read-only memory, a random-access memory, or both. The essential elements of a computer are a central processing unit for executing or carrying out 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. Typically, a computer also includes one or more mass storage devices, e.g., magnetic, magneto-optical, or optical disks, for storing data, or is operatively coupled to receive data from or transfer data to them. However, a computer need not include such devices. Furthermore, a computer may be incorporated 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, e.g., a universal serial bus (USB) flash drive, to name just a few.

[0138] Computer-readable media suitable for storing computer program instructions and data include, by way of example, all forms of non-volatile memory, media and memory devices, including semiconductor memory devices, e.g., EPROM, EEPROM, flash memory devices, magnetic disks, e.g., internal hard disks or removable disks, magneto-optical disks, and CD-ROM and DVD-ROM disks.

[0139] To provide for user interaction, embodiments of the subject matter described herein can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user, and a keyboard and pointing device, e.g., a mouse or trackball, by which the user can provide input to the computer. Other types of devices can also be used to provide for user interaction; 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, such as acoustic, speech, or tactile input. Furthermore, a computer can interact with a user by sending and receiving documents to and from a device used by the user, e.g., by sending a web page to a web browser on the user's device in response to a request received from the web browser. A computer can also interact with a user by sending text messages or other forms of messages to a personal device, e.g., a smartphone running a messaging application, and receiving a reply message from the user in return.

[0140] A data processing device for implementing machine learning models may also include dedicated hardware accelerator units, for example, for handling the typical computationally intensive part of machine learning training or production, i.e., inference, workloads.

[0141] The machine learning model can be implemented and deployed using a machine learning framework such as, for example, the TensorFlow framework, the Microsoft Cognitive Toolkit framework, the Apache Singa framework, or the Apache MXNet framework.

[0142] Embodiments of the subject matter described herein can be implemented in a computing system that includes a back-end component, e.g., a data server, or includes a middleware component, e.g., an application server, or includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described herein, or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, such as a communication network. Examples of communication networks include local area networks (LANs) and wide area networks (WANs), e.g., the Internet.

[0143] A computing system may include clients and servers. Clients and servers are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, a server sends data, e.g., HTML pages, to a user device, e.g., for the purpose of displaying the data to and receiving user input from a user interacting with the device acting as a client. Data generated at the user device, e.g., results of user interaction, can be received from the device at the server.

[0144] While this specification contains details of many specific implementations, these should not be construed as limitations on the scope of the invention or the claims, but rather as descriptions of features that may be specific to particular embodiments of a particular invention. Certain features described herein in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable subcombination. Furthermore, while features may be described above as acting in a particular combination and 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.

[0145] Similarly, while operations are illustrated in the figures and claimed in a particular order, this should not be understood as requiring that such operations be performed in the particular order or sequential order shown, or that all of the illustrated operations be performed, to achieve desirable results. In certain situations, multitasking and parallel processing may be advantageous. Furthermore, 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 may generally be integrated into a single software product or packaged into multiple software products.

[0146] 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 may be performed in a different order and still achieve desirable results. By way of example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. [Explanation of symbols]

[0147] 100 Sequence Generation System 102 Context Input 110 Neural Network System 112 Output Sequence 120 Decoder Neural Network 130 Encoder Neural Network 150 Training System 160 training examples 200 processes 310 Training Output Sequence 320 Damaged 330 Training Sequences 340 Generation Expansion 350 sequences 360 Noise Reduction Term 370 Expanded denoising terms 400 processes 500 processes

Claims

1. 1. A method of training a neural network system comprising a decoder neural network configured to receive as input a current output sequence comprising respective output tokens from a vocabulary of output tokens at each of a plurality of output positions, and to process the current output sequence while conditioned on a context input to generate, for each of the plurality of output positions, a decoder output comprising a respective score for each output token in the vocabulary of output tokens, the method comprising: obtaining a batch of one or more training examples, each training example comprising a training context input and a target output sequence for said training context input; For each training example in the batch, generating a corrupted output sequence from the target output sequence by, for each of one or more tokens in the output sequence, replacing the output token in the output sequence with a token randomly selected from the vocabulary; In each of the one or more update iterations, processing the corrupted output sequence at the time of the update iteration using the decoder neural network while the decoder neural network is conditioned based on the training context input to generate a decoder output for the corrupted output sequence at the time of the update iteration; updating the corrupted output sequence by selecting a token from the vocabulary of output tokens using the decoder output of the corrupted output sequence for each of the plurality of output positions; updating the corrupted output sequence by processing the updated corrupted output sequence after the last update iteration using the decoder neural network while the decoder neural network is conditioned based on the training context input to generate a decoder output for the updated corrupted output sequence; determining, for each training example, a gradient with respect to the parameters of the decoder neural network of a loss function that includes a first term that measures the quality of the decoder output of the updated corrupted output sequence after the last update iteration relative to the target output sequence; updating the parameters of the decoder neural network using the gradients; A method comprising:

2. The method of claim 1 , wherein only one update iteration is performed.

3. 3. The method of claim 1 or 2, wherein the first term measures, for each training example and for each output position, the logarithm of the score assigned by the decoder output to the output token at the output position in the target output sequence for the updated corrupted output sequence.

4. 4. The method of claim 1, wherein the loss function includes, for each update iteration, a respective second term that measures, for each training example, the quality of the decoder output relative to the corrupted output sequence at the time of the update iteration relative to the target output sequence.

5. 5. The method of claim 4, wherein the second term measures, for each training example and for each output position, the logarithm of the score assigned to the output token at the output position in the target output sequence by the decoder output for the corrupted output sequence at the time of the update iteration.

6. generating a corrupted output sequence from the target output sequence by, for each of one or more tokens in the output sequence, replacing the output token in the output sequence with a token randomly selected from the vocabulary; sampling expected failure fraction values ​​from a first distribution; for each output position, using the expected corruption percentage to determine whether to replace the output token at that output position in the target output sequence; For each output position determined to replace said output token, sampling a random token from the vocabulary; replacing the output token at the output location with the sampled random token from the vocabulary; 6. The method of claim 1, comprising:

7. for each output location, using the expected corruption percentage to determine whether to replace the output token at the output location; The method of claim 6 comprising sampling the output location variable from a Bernoulli distribution parameterized by the expected corruption value.

8. For each of the plurality of output positions, updating the corrupted output sequence by selecting a token from the vocabulary of output tokens using the decoder output of the corrupted output sequence includes, for each output position:

8. The method of claim 1, comprising sampling output tokens from the vocabulary according to the respective scores of the output positions.

9. the neural network system comprises an encoder neural network configured to process the context input to generate an encoded representation of the context input, and for each training example, the decoder neural network is conditioned on the encoded representation of the training context input generated by the encoder neural network, and the method comprises: determining a gradient of the loss function with respect to the parameters of the encoder neural network; updating the parameters of the encoder neural network using the gradients; 9. The method of claim 1, further comprising:

10. receiving new context input after training; generating a new output sequence comprising a respective output token at each of the plurality of output locations; updating the new output sequence in each of a plurality of generation iterations, wherein in each generation iteration: using the decoder neural network to update the new output sequence while the decoder neural network is conditioned based on the new context input; generating a final output sequence for the new context input from the new output sequence after a final generation iteration of the plurality of update iterations; 10. The method of claim 1, further comprising:

11. updating the new output sequence using the decoder neural network while the decoder neural network is conditioned based on the new context input; processing the new output sequence at the generation iteration using the decoder neural network while the decoder neural network is conditioned based on the new context input to generate a decoder output for the new output sequence; for a subset of the plurality of output positions, selecting a token from the vocabulary of output tokens using the decoder output for the new output sequence; The method of claim 10, comprising:

12. The method of claim 11 , wherein the subset is a proper subset, the method further comprising randomly selecting the plurality of output locations within the subset.

13. The method of claim 11 , wherein the subset is not a proper subset.

14. 14. The method of claim 11, wherein selecting tokens from the vocabulary of output tokens using the decoder output for the new output sequence comprises applying a temperature value to each score in the decoder output to generate a temperature-adjusted score and sampling the tokens using the temperature-adjusted score.

15. A method implemented by one or more computers, comprising: receiving a context input; generating an output sequence at each of a plurality of output locations, the output sequence comprising a respective output token, each output token selected from a vocabulary of output tokens; processing the output sequence using a decoder neural network conditioned on the context input to generate, for each output position, a decoder output comprising a respective score distribution comprising a respective score for each output token in the vocabulary of output tokens; updating the output sequence by using the decoder output to select a respective token from the vocabulary of tokens for each output position; In each of a plurality of generating iterations, using the decoder output at the time of the generation iteration to select an appropriate subset of the output positions; processing the output sequence at the generation iteration using the decoder neural network conditioned based on the context input to update the decoder output; after updating the decoder output, generating a temporary output sequence for each of the output positions in the appropriate subset, comprising sampling a token using the decoder output; processing the temporary output sequence using the decoder neural network conditioned based on the context input to generate a temporary decoder output; for each output position not in the proper subset, selecting a token from the vocabulary using the decoder output; for each output position in the appropriate subset, selecting a token from the vocabulary using the temporary decoder output; updating the output sequence by generating a final output sequence from the output sequence after a last update iteration of the plurality of update iterations; A method comprising:

16. 16. The method of claim 15, wherein the decoder neural network is a non-autoregressive model that generates the respective score distributions for the output positions in parallel.

17. processing the context input using an encoder neural network to generate an encoded representation of the context input, the encoded representation comprising a sequence of one or more embeddings of the context input; 17. The method of claim 15 or 16, wherein the decoder neural network is conditioned based on the encoded representation.

18. 18. The method of claim 17, further comprising: processing the one or more embeddings of the context inputs using a length prediction neural network to generate a length prediction defining a predicted target length representing a predicted number of output tokens in the final output sequence, wherein the encoded representation includes an embedding of the predicted target length.

19. 19. The method of any one of claims 15 to 18, wherein generating an output sequence comprises randomly sampling tokens from the vocabulary of tokens in one or more of the output positions.

20. 20. A method according to any one of claims 15 to 19, wherein generating a temporary output sequence comprises, for each of the output positions not in the suitable subset, selecting a token using the decoder output or using the token at the output position at the time of the update iteration as the token at the output position.

21. 21. A method according to any one of claims 15 to 20, wherein for each output position not in the proper subset, selecting a token from the vocabulary using the decoder output comprises selecting an argmax token for the position in accordance with the decoder output.

22. 22. A method according to any one of claims 15 to 21, wherein for each output position in the appropriate subset, selecting a token from the vocabulary using the temporary decoder output comprises selecting an argmax token for the position in accordance with the temporary decoder output.

23. a) the training context input or context input is a sequence defining a text in one language, and the target or final output sequence represents a translation of the text into another language; b) the training context input or context input is a sequence representing a spoken utterance and the target or final output sequence represents a portion of text that is a transcription of the utterance; c) the training context input or context input is a sequence representing text or features of text in a natural language, and the target or final output sequence is data defining audio of the text spoken in the natural language; d) the training context input or context input is a sequence representing pixels of an image and the target or final output sequence is a text sequence representing a caption of the image; e) the training context input or context input is a sequence representing a conditional input for generating an image, and the target or final output sequence represents pixels of the image depending on the conditional input; 23. The method of any one of claims 1 to 22.

24. one or more computers; one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to perform each of the operations recited in any one of claims 1 to 23; A system comprising:

25. 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 23.