IP Library Granted Patent US 11,893,483
Granted Patent B2
US 11,893,483 · App. 16/988,547 · Granted Feb 6, 2024

Attention-based sequence transduction neural networks

Inventors: Noam M. Shazeer (Palo Alto, CA); Aidan Nicholas Gomez (Toronto, CA); Lukasz Mieczyslaw Kaiser (Mountain View, CA); Jakob D. Uszkoreit (Portola Valley, CA); Llion Owen Jones (San Francisco, CA); Niki J. Parmar (Sunnyvale, CA); Illia Polosukhin (Mountain View, CA); Ashish Teku Vaswani (San Francisco, CA)
Assignee: Google LLC
G06N3/08G06N3/04G06N3/045G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,893,483
App. No.
16/988,547
Granted
Feb 6, 2024
Kind
B2
Abstract

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for generating an output sequence from an input sequence. In one aspect, one of the systems includes an encoder neural network configured to receive the input sequence and generate encoded representations of the network inputs, the encoder neural network comprising a sequence of one or more encoder subnetworks, each encoder subnetwork configured to receive a respective encoder subnetwork input for each of the input positions and to generate a respective subnetwork output for each of the input positions, and each encoder subnetwork comprising: an encoder self-attention sub-layer that is configured to receive the subnetwork input for each of the input positions and, for each particular input position in the input order: apply an attention mechanism over the encoder subnetwork inputs using one or more queries derived from the encoder subnetwork input at the particular input position.

Claims (77)

1. A system comprising one or more computers and one or more storage devices storing instructions that when executed by the one or more computers cause the one or more computers to implement a neural network for generating a network output by processing an input sequence having a respective network input at each of a plurality of input positions, the neural network comprising:

a first neural network comprising a sequence of one or more subnetworks, each subnetwork configured to (i) receive a respective subnetwork input for each of a plurality of preceding input positions that precede a current input position in an ordering of the input positions, and (ii) generate a respective subnetwork output for each preceding input position, and wherein each subnetwork comprises:

a self-attention sub-layer that is configured to receive the respective subnetwork input for each of the plurality of preceding input positions in the ordering of the input positions and, for each particular input position of the preceding input positions:

apply a self-attention mechanism over the subnetwork inputs at the preceding input positions to generate a respective output for the particular input position, wherein applying a self-attention mechanism comprises: determining a query according to the subnetwork input at the particular input position, determining keys derived from the subnetwork inputs at the preceding input positions, determining values derived from the subnetwork inputs at the preceding input positions, and using the determined query, keys, and values to generate the respective output for the particular input position.

2. The system of claim 1 , wherein:

the network output is an output sequence having a respective network output at each of a plurality of output positions in an output order; and

the first neural network auto-regressively generates the output sequence, by at each of a plurality of time steps, generating a network output at an output position corresponding to the time step conditioned on the subnetwork inputs and network outputs at output positions preceding the output position in the output order.

3. The system of claim 1 , wherein the first neural network further comprises:

an embedding layer configured to:

for the network input at each of the plurality of preceding input positions in the ordering of the input positions:

map the network input to an embedded representation of the network input, and

combine the embedded representation of the network input with a positional embedding of the corresponding input position of the network input in the input order to generate a combined embedded representation of the network input; and

provide the combined embedded representations of the network input as input to a first subnetwork in the sequence of subnetworks.

4. The system of claim 1 , wherein at least one of the subnetworks comprises:

a position-wise feed-forward layer that is configured to, for each particular input position of the plurality of preceding input positions in the ordering of the input positions:

receive an input at the particular input position, and

apply a sequence of transformations to the input at the particular input position to generate an output for the particular input position.

5. The system of claim 4 , wherein the sequence of transformations comprises two learned linear transformations separated by an activation function.

6. The system of claim 4 , wherein the at least one subnetwork further comprises:

a residual connection layer that combines the outputs of the position-wise feed-forward layer with the inputs to the position-wise feed-forward layer to generate a residual output, and

a layer normalization layer that applies layer normalization to the residual output.

7. The system of claim 1 , wherein each subnetwork comprises:

a self-attention sub-layer that is configured to:

receive an input for each of the plurality of preceding input positions and, for each particular input position of the plurality of preceding input positions in the ordering of the input positions:

apply an attention mechanism over the inputs at each of the plurality of preceding input positions in the ordering of the input positions using one or more queries determined according to the input at the particular input position to generate an updated representation for the particular input position.

8. The system of claim 7 , wherein each self-attention sub-layer comprises a plurality of self-attention layers, and wherein each self-attention layer is configured to:

apply a learned query linear transformation to the input at each particular input position of the plurality of preceding input positions in the ordering of the input positions to generate a respective query for each particular input position,

apply a learned key linear transformation to each input at each particular input position of the plurality of preceding input positions in the ordering of the input positions to generate a respective key for each particular input position,

apply a learned value linear transformation to each input at each particular input position of the plurality of preceding input positions in the ordering of the input positions to generate a respective key for each particular input position, and

for each of the particular input positions of the plurality of preceding input positions in the ordering of the input positions,

determine a respective input-position specific weight for the particular input position by applying a comparison function between the query for the particular input position and the keys, and

determine an initial attention output for the particular input position by determining a weighted sum of the values weighted by the corresponding input-position specific weights for the particular input position.

9. The system of claim 8 , wherein the self-attention sub-layer is configured to combine the attention outputs generated by the self-attention layers to generate the output for the self-attention sub-layer.

10. The system of claim 8 , wherein the attention layers operate in parallel.

11. The system of claim 7 , wherein each subnetwork further comprises:

a residual connection layer that combines the outputs of the self-attention sub-layer with the inputs to the self-attention sub-layer to generate a residual output, and

a layer normalization layer that applies layer normalization to the residual output.

12. One or more non-transitory computer storage media storing instructions that when executed by one or more computers cause the one or more computers to implement a neural network for generating a network output by processing an input sequence having a respective network input at each of a plurality of input positions, the neural network comprising:

a first neural network comprising a sequence of one or more subnetworks, each subnetwork configured to (i) receive a respective subnetwork input for each of a plurality of preceding input positions that precede a current input position in an ordering of the input positions, and (ii) generate a respective subnetwork output for each preceding input position, and wherein each subnetwork comprises:

a self-attention sub-layer that is configured to receive the respective subnetwork input for each of the plurality of preceding input positions in the ordering of the input positions and, for each particular input position of the preceding input positions:

apply a self-attention mechanism over the subnetwork inputs at the preceding input positions to generate a respective output for the particular input position, wherein applying a self-attention mechanism comprises: determining a query according to the subnetwork input at the particular input position, determining keys derived from the subnetwork inputs at the preceding input positions, determining values derived from the subnetwork inputs at the preceding input positions, and using the determined query, keys, and values to generate the respective output for the particular input position.

13. The non-transitory computer storage media of claim 12 , wherein:

the network output is an output sequence having a respective network output at each of a plurality of output positions in an output order; and

the first neural network auto-regressively generates the output sequence, by at each of a plurality of time steps, generating a network output at an output position corresponding to the time step conditioned on the subnetwork inputs and network outputs at output positions preceding the output position in the output order.

14. The non-transitory computer storage media of claim 12 , wherein the first neural network further comprises:

an embedding layer configured to:

for the network input at each of the plurality of preceding input positions in the ordering of the input positions:

map the network input to an embedded representation of the network input, and

combine the embedded representation of the network input with a positional embedding of the corresponding input position of the network input in the input order to generate a combined embedded representation of the network input; and

provide the combined embedded representations of the network input as input to a first subnetwork in the sequence of subnetworks.

15. The non-transitory computer storage media of claim 12 , wherein at least one of the subnetworks comprises:

a position-wise feed-forward layer that is configured to, for each particular input position of the plurality of preceding input positions in the ordering of the input positions:

receive an input at the particular input position, and

apply a sequence of transformations to the input at the particular input position to generate an output for the particular input position.

16. The non-transitory computer storage media of claim 12 , wherein each subnetwork comprises:

a self-attention sub-layer that is configured to:

receive an input for each of the plurality of preceding input positions and, for each particular input position of the plurality of preceding input positions in the ordering of the input positions:

apply an attention mechanism over the inputs at each of the plurality of preceding input positions in the ordering of the input positions using one or more queries determined according to the input at the particular input position to generate an updated representation for the particular input position.

17. A method comprising:

receiving an input sequence having a respective input at each of a plurality of input positions;

processing the input sequence through a first neural network to generate a network output, the first neural network comprising a sequence of one or more subnetworks,

wherein each subnetwork is configured to (i) receive a respective subnetwork input for each of a plurality of preceding input positions that precede a current input position in an ordering of the input positions, and (ii) generate a respective subnetwork output for each preceding input position, and wherein each subnetwork comprises:

a self-attention sub-layer that is configured to receive the respective subnetwork input for each of the plurality of preceding input positions in the ordering of the input positions and, for each particular input position of the preceding input positions:

apply a self-attention mechanism over the subnetwork inputs at the preceding input positions to generate a respective output for the particular input position, wherein applying a self-attention mechanism comprises: determining a query according to the subnetwork input at the particular input position, determining keys derived from the subnetwork inputs at the preceding input positions, determining values derived from the subnetwork inputs at the preceding input positions, and using the determined query, keys, and values to generate the respective output for the particular input position.

18. The method of claim 17 , wherein:

the network output is an output sequence having a respective network output at each of a plurality of output positions in an output order; and

the first neural network auto-regressively generates the output sequence, by at each of a plurality of time steps, generating a network output at an output position corresponding to the time step conditioned on the subnetwork inputs and network outputs at output positions preceding the output position in the output order.

19. The method of claim 17 , wherein the first neural network further comprises:

an embedding layer configured to:

for the network input at each of the plurality of preceding input positions in the ordering of the input positions:

map the network input to an embedded representation of the network input, and

combine the embedded representation of the network input with a positional embedding of the corresponding input position of the network input in the input order to generate a combined embedded representation of the network input; and

provide the combined embedded representations of the network input as input to a first subnetwork in the sequence of subnetworks.

20. The method of claim 17 , wherein at least one of the subnetworks comprises:

a position-wise feed-forward layer that is configured to, for each particular input position of the plurality of preceding input positions in the ordering of the input positions:

receive an input at the particular input position, and

apply a sequence of transformations to the input at the particular input position to generate an output for the particular input position.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 13, 2020
From: SHAZEER, NOAM M.; GOMEZ, AIDAN NICHOLAS; KAISER, LUKASZ MIECZYSLAW; USZKOREIT, JAKOB D.; JONES, LLION OWEN; PARMAR, NIKI J.; POLOSUKHIN, ILLIA; VASWANI, ASHISH TEKU
To: GOOGLE INC.
Reel/Frame 053488/0566 →
CHANGE OF NAME Recorded Aug 13, 2020
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 053490/0023 →
Continuity (7)
Continuation 16932422 · Jul 17, 2020
Continuation 16559392 · Sep 3, 2019
Continuation 16021971 · Jun 28, 2018
Continuation PCTUS2018034224 · May 23, 2018
Provisional Application 62541594 · Aug 4, 2017
Provisional Application 62510256 · May 23, 2017
Related Publication 20200372358A1 · Nov 26, 2020
Cited By (2)
US 12,646,130 US 12,651,286