Machine learning attention model featuring omnidirectional processing
The omnidirectional attention model (OmniNet) solves the computational complexity problem of global context processing through a meta-learner and an efficient self-attention model, improves model performance and reduces resource consumption, and is suitable for image and natural language processing tasks.
Patent Information
- Application Number
- CN202210115892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-02-04
- Filing Date
- 2022-02-07
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-02-07
AI Technical Summary
Existing machine learning models have high computational complexity when processing global context and are prone to degradation of representation capabilities, making it difficult to effectively utilize the omnidirectional attention mechanism.
The omnidirectional attention model (OmniNet) is adopted to reduce the number of parameters and optimize computing resources through meta-learners such as efficient self-attention models, utilize omnidirectional receptive fields for information refinement and gradient flow, and combine pooling operators and causal mask processing.
The model's performance in image processing and natural language processing tasks is improved, while the model size and computing resource consumption are reduced, achieving a more efficient computing system.
Smart Images

Figure CN114548423B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to and the benefit of U.S. Provisional Patent Application No. 63 / 145,920, which is incorporated herein by reference in its entirety. Technical Field
[0003] The present disclosure relates generally to machine learning and, more particularly, to a machine learning attention model featuring omnidirectional processing. Background Art
[0004] Various forms of machine learning models utilize attention mechanisms. Attention is a technique that mimics cognitive attention and can enhance important parts of input data while downplaying the influence of parts less relevant to the task at hand. In this way, attention mechanisms enable computing systems to devote more computing power to small, yet significant, parts of the data. Which parts of the data are more important than others depends on the context and, in some cases, can be learned from the training data using gradient descent.
[0005] Attention mechanisms are widely used in various machine learning models, including natural language processing and computer vision. As an example, the Transformer model (see Vaswani et al., Attention is all you need, Advances in neural information processing systems, pp. 5998–6008, 2017) extensively utilizes attention mechanisms to achieve their expressive power. Computer vision systems based on convolutional neural networks can also benefit from attention mechanisms.
[0006] A key defining property of the self-attention mechanism is the global receptive field, where every token is accessible to every other token in the sequence, serving as an enabler for learning global contextual representations. Summary of the Invention
[0007] Aspects and advantages of the embodiments of the present disclosure will be set forth in part in the following description, or may be learned from the description, or may be learned through practice of the embodiments.
[0008] An exemplary aspect of the present disclosure is directed to a computing system for omnidirectional attention-based processing. The computing system includes: one or more processors; and one or more non-transitory computer-readable media that collectively store: a machine learning multi-layer attention model, the machine learning multi-layer attention model including multiple self-attention layers, wherein the multi-layer attention model is configured to process a first input to generate a first output; a machine learning omnidirectional model configured to: receive multiple intermediate layer representations generated at two or more of the multiple self-attention layers of the machine learning multi-layer attention model when processing the first input to generate the first output; and process the multiple intermediate layer representations to generate a second output; and instructions that, when executed by the one or more processors, cause the computing system to perform operations. The operations include: providing a first input to the machine learning multi-layer attention model so that a first output is generated; and providing multiple intermediate layer representations generated at two or more of the multiple self-attention layers of the machine learning multi-layer attention model as input to the machine learning omnidirectional model so that a second output is generated.
[0009] Another example aspect of the present disclosure is directed to one or more non-transitory computer-readable media that collectively store: a multi-layer attention model comprising a plurality of self-attention layers, wherein the multi-layer attention model is configured to process a first input to generate a first output; an omnidirectional model configured to: receive a plurality of intermediate layer representations generated at two or more of the plurality of self-attention layers of the multi-layer attention model when processing the first input to generate the first output; and process the plurality of intermediate layer representations to generate a second output; and instructions that, when executed, cause a computing system to perform operations. The operations include: providing the first input to the multi-layer attention model so as to generate the first output; providing the plurality of intermediate layer representations generated at two or more of the plurality of self-attention layers of the multi-layer attention model as input to a machine learning omnidirectional model so as to generate a second output; evaluating a loss function based at least in part on the second output to determine a loss value; and training at least the omnidirectional model based at least in part on the loss function.
[0010] Other aspects of the present disclosure are directed to various systems, apparatus, methods, non-transitory computer-readable media, user interfaces, and electronic devices.
[0011] These and other features, aspects and advantages of various embodiments of the present disclosure will become better understood with reference to the following description and appended claims.The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the present disclosure and, together with the description, serve to explain the relevant principles. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] A detailed discussion of embodiments for those of ordinary skill in the art is set forth in the specification with reference to the accompanying drawings, in which:
[0013] Figure 1 A graphical overview of an example omnidirectional attention model according to an example embodiment of the present disclosure is provided.
[0014] Figure 2A Depicted is a block diagram of an example computing system according to an example embodiment of the present disclosure.
[0015] Figure 2B A block diagram of an example computing device is depicted, according to example embodiments of the present disclosure.
[0016] Figure 2C A block diagram of an example computing device is depicted, according to example embodiments of the present disclosure.
[0017] Reference numerals repeated across the various figures are intended to identify like features in the various embodiments. DETAILED DESCRIPTION
[0018] Overview
[0019] In general, this disclosure is directed to machine learning attention models featuring omnidirectional processing, example implementations of which may be referred to as Omnidirectional Representations from Transformers (OMNINET). In the example models described in this disclosure, each token is allowed to attend to all tokens in some or all other tokens in the entire network, rather than maintaining a strict level of receptive field.
[0020] In some cases, this process can be interpreted as a form of extreme or dense attention mechanism, which has a receptive field of the entire width and depth of the network. To this end, according to one aspect of the present disclosure, omnidirectional attention is learned via a meta-learner, which in some embodiments can be another self-attention based model. According to another aspect of the present disclosure, in order to alleviate the computationally expensive cost of full receptive field attention, some example embodiments of the present disclosure utilize efficient self-attention models (such as kernel-based (Choromanski et al., 2020), low-rank attention (Wang et al., 2020) and / or Big Bird (Zaheer et al., 2020)) as a meta-learner.
[0021] In addition, extensive experiments were conducted on autoregressive language modeling (LM1B, C4), machine translation, long range arena (LRA), and image recognition, showing that the example implementation of OmniNet achieves considerable improvements not only when equipped with a sequence-based (1D) transformer, but also on image recognition (visual transformer) tasks. The example implementation of OmniNet also achieves state-of-the-art performance on LM1B, WMT'14 En-De / En-Fr, and long range arena.
[0022] More specifically, this paper proposes learning omnidirectional representations from attention-based models (such as transformers) or omnidirectional representations of attention-based models. Therefore, the systems and methods provided herein go beyond horizontal global receptive fields and explore the possibility of omnidirectional receptive fields. In other words, some example embodiments allow each token to pay attention not only to all other tokens in the same hierarchy, but also to some or all other tokens in the network (e.g., including at different levels or layers). This omnidirectional (e.g., global) access enables the token to have not only a better (e.g., full) view of the network (e.g., across different levels or layers), but also access to the knowledge and intermediate representations of every token at each stage. By modeling the relationships between tokens at different hierarchical levels, the example models described herein are also able to capture patterns related to the propagation of representations across time. Finally, this can also be interpreted as a form of dense residual connections, which have been shown to be beneficial by assisting gradient flow.
[0023] Intuitively, learning an omnidirectional receptive field is non-trivial for two key reasons. First, given the quadratic complexity of scaled dot-product attention, the complexity of designing such a receptive field increases from N 2 L increases to (NL) 2 , where L is the depth of the network and N is the sequence length. This challenge has prevented this type of architecture from being explored in the past. Second, simply enabling omnidirectional attention from the beginning will easily cause the base model to degenerate into a flat network, thereby losing most of its representational power, which is achieved by sequentially refining its representations at the network level.
[0024] To mitigate the above issues, some example omnidirectional attention models proposed in this paper can be implemented as a meta-learner acting on a standard transformer model. As an example, the meta-learner can itself be a self-attention model that accepts as input all hidden representations across some or all layers of the base model and refines them based on all available information. To mitigate the prohibitive memory and computational costs of omnidirectional attention, some example embodiments utilize one or more efficient alternatives to parameterized meta-learners, for example, including fast attention via generalizable kernel attention (Choromanski et al., 2020), low-rank self-attention (Wang et al., 2020), and / or block-based sparsity (Zaheer et al., 2020). In addition, adopting methods that attempt to learn a low-rank decomposition structure of the entire network may lead to improved generalization capabilities.
[0025] In addition to changing the parameterization of the meta-learner, some example embodiments of the present disclosure may also include a partitioned variant of OmniNet, in which the meta-learner is applied to a subset of layers, such as every consecutive p layers. For example, this partitioning strategy groups a full network of L layers into L / p partitions. After computing each partition, the meta-learner can learn omnidirectional attention across some or all nodes of some or all layers in the partition.
[0026] Furthermore, extensive experiments empirically demonstrate that OmniNet achieves highly promising results on numerous language, vision, and synthesis tasks. Specifically, strong experimental results are obtained on autoregressive language modeling, five sets of WMT machine translation, Long Range Arena (Tay et al., 2020), and image recognition using visual transformers (both few-shot learning and fine-tuning approaches) (Dosovitskiy et al., 2020). In machine translation, OmniNet outperforms ADMIN (Liu et al., 2020), the current state-of-the-art 60-layer deep transformer model, on two well-established machine translation sets (WMT'14 English-German and WMT'14 English-French). On the Billion Language Modeling benchmark, OmniNet outperforms existing state-of-the-art models, such as Transformer-XL. In LRA, OmniNet improves Performer by +8.9% and vanilla Transformer by +2.6%.
[0027] The systems and methods of the present disclosure provide a number of technical effects and advantages. As one example, the omnidirectional attention mechanisms described herein can result in improved performance (e.g., greater accuracy) of machine learning models on a variety of tasks, including, for example, image processing or analysis tasks and / or natural language processing or analysis tasks. Thus, the proposed omnidirectional attention mechanisms can enable improvements in performance of computing systems.
[0028] As another example technical effect, the omnidirectional attention mechanisms described herein can enable machine learning models to maintain the same level of performance while reducing the number of parameters included in the model. Reducing the number of parameters can result in improved conservation of computing resources, such as processor usage, memory usage, network bandwidth, and the like. For example, a model with the omnidirectional attention mechanisms described herein can achieve the same performance as a larger model that does not have the omnidirectional attention mechanisms described herein. Thus, less memory consumption can be used to store the model with the omnidirectional attention mechanisms described herein.
[0029] As another example technical effect, the omnidirectional attention mechanisms described herein can enable the size of a machine learning multi-layer model (e.g., in terms of the number of parameters, layers, and the like) to be reduced (e.g., relative to the same style model trained without using the omnidirectional attention mechanisms described herein). The reduction in size can result in less memory consumption, faster runtimes, and / or other computational advantages.
[0030] Example omnidirectional attention model
[0031] Figure 1 A graphical overview of an example omnidirectional attention model in accordance with example embodiments of the present disclosure is provided. Figure 1 A machine learning multi-layer model 12 is depicted that includes a plurality of layers. As one example, the machine learning multi-layer model 12 can be a multi-layer attention model, and one or more of the plurality of layers of the model 12 can be attention-based layers, such as self-attention layers, such as multi-head self-attention layers. In one example, the machine learning multi-layer model 12 is a transformer model. In another example, the machine learning multi-layer model 12 is a multi-layer neural network. Although four layers are shown, any number of layers can be included in the model 12.
[0032] The multi-layer model 12 can be configured to process a first input 16 to generate a first output 17. The first input 16 can be sequential in nature, for example. The first output 17 can be sequential in nature, or can be a single output. As an example, the first input 16 can include natural language input (e.g., tokens of text) and / or image input.
[0033] Furthermore, as a result of processing the first input 16 to generate the first output 17 , the machine learning multi-layer model 12 may generate a plurality of intermediate layer representations (e.g., 18 , 20 , and 22 ) at a plurality of layers of the machine learning multi-layer model 12 .
[0034] Figure 1 Also depicted is the machine learning omnidirectional model 14, which is configured to receive intermediate layer representations (e.g., 18, 20, and 22) from two or more of the multiple layers of the machine learning multi-layer model 12. The machine learning omnidirectional model 14 may process the multiple intermediate layer representations (e.g., 18, 20, and 22) to generate a second output 24. The second output 24 may be sequential in nature or may be a single output.
[0035] In some embodiments, for example, Figure 1 As shown, omnidirectional model 14 may receive all of the intermediate layer representations 18, 20, and 22. However, in other examples, only some of the representations are provided from model 12 to model 14. In some examples, the intermediate representations of model 12 may be divided into one or more batches or partitions and provided separately to model 14 for separate processing by model 14.
[0036] As an example, the machine learning omnidirectional model 14 itself can be a multi-layer attention model, and one or more of the multiple layers of the model 14 can be an attention-based layer, such as a self-attention layer, such as a multi-head self-attention layer. In one example, the machine learning omnidirectional model 14 is a transformer model. In another example, the machine learning omnidirectional model 14 is a multi-layer neural network. Although two layers are shown, any number of layers can be included in the model 14.
[0037] In some embodiments, at least one of the one or more self-attention layers of the machine learning omnidirectional model 14 performs kernel-based attention. In some embodiments, at least one of the one or more self-attention layers of the machine learning omnidirectional model 14 performs low-rank attention, where the low-rank projection transformation is shared across multiple heads or multiple key and value parameters. In some embodiments, at least one of the one or more self-attention layers of the machine learning omnidirectional model 14 performs block- and memory-based attention, where attention is performed within a neighborhood.
[0038] In some embodiments, providing multiple intermediate layer representations (e.g., 18, 20, 22) as input to the machine learning omnidirectional model 14 may include performing an index sort operation to sort the tokens within each intermediate layer representation according to an index (e.g., a token index). As described above, in some embodiments, providing multiple intermediate layer representations (e.g., 18, 20, 22) as input to the machine learning omnidirectional model 14 may include obtaining corresponding intermediate layer representations from multiple different partitions of two or more self-attention layers in multiple self-attention layers of the machine learning multi-layer attention model, and inputting the corresponding intermediate layer representations from the multiple different partitions into the machine learning omnidirectional model.
[0039] In some embodiments, the final output can be determined at least in part based on the first output 17 and the second output 24. For example, the first output 17 and the second output 24 can be summed to produce the final output. In some embodiments, a pooling function (e.g., max pooling) can be applied to the second output.
[0040] In some embodiments, the computing system may evaluate the loss function to determine a loss value based at least in part on the first output 17, the second output 24, and / or the final output generated from the first output 17 and / or the second output 24. The computing system may train the multi-layer model 12 and / or the omnidirectional model 24 based at least in part on the loss function. For example, the computing system may jointly train both the multi-layer model 12 and the omnidirectional model 14 based at least in part on the loss function (e.g., via joint backpropagation of the gradient of the loss function).
[0041] In some embodiments, at inference time, both models 12 and 14 can be run jointly to produce inferences or predictions (e.g., as final output). In other embodiments, after being jointly trained with model 14, model 12 can be used alone at inference time (e.g., without model 14). However, because it has been jointly trained with model 14, model 12 can still provide improved inferences or predictions (e.g., relative to a model that has not been so jointly trained).
[0042] Example omnidirectional model
[0043] This section introduces an example implementation of OmniNet. This section begins by reviewing the standard transformer architecture.
[0044] Example Transformer Architecture
[0045] This section provides a brief background on the Transformer architecture. A Transformer block accepts N×d inputs, where N is the number of tokens in the sequence and d is the size of the representation. Each Transformer block is represented by a self-attention block and a two-layer feed-forward network with positionally applied ReLU activations between them.
[0046] Example self-attention
[0047] The self-attention mechanism first uses a linear transformation to project each input X into Q, K, V representations corresponding to the query, key, and value. The self-attention mechanism is usually multi-headed, where multiple similar linear projections are performed in parallel. The output of each self-attention head h at layer l is written as:
[0048]
[0049] where y h,l is the output of head h at layer l, and d k is the size of each head. Then, the outputs from multiple heads are concatenated and then passed through W o,l By another linear transformation, W o,l Project the concatenation of all heads down to d m This is wrapped via layer normalization followed by residual connections and can be written as:
[0050] LayerNorm(W o,l concat([y 1,l …y H,l )))+x l-1
[0051] As the final output of the self-attention module. Feedforward layer
[0052] The FFN block of the transformer block performs a two-layer transform, which is defined as follows:
[0053] z l =LayerNorm(W 1,l ReLU(W 2,l (Y)))+z l-1 , (2)
[0054] Where W1 and W2 are the trainable parameters (weight transformations) of the FFN layer. For clarity, the bias parameters are omitted.
[0055] Example OmniNet
[0056] The proposed OmniNet method can operate on any multi-layer architecture that accepts sequential input. In our description, this generally refers to the stacked X-former architecture in this section. Note that while this is typically a Transformer model, it can also be any variant.
[0057] Example omnidirectional representation
[0058] In a stacked network of L layers, each layer exposes a sequence of N vectors of d dimensions. Specifically, OmniNet operates across all layers and connects multiple layers of the network architecture in a grid-like manner. We describe the network as an xformer that accepts X as input and returns a tensor of L×N×d dimensions.
[0059] xformer(X)=X1,X2…X L , (3)
[0060] in make is the representation of X at layer i and position j of the sequence. The OmniNet mechanism can be written as:
[0061] O=Attend(IndexSort(X1,X2,…X L )), (4)
[0062] Where Attend refers to any self-attention block. The IndexSort operation takes X1, X2, X L , and the tokens within each matrix are sorted by index such that the neighbors of the i-th token in layer l are the i-th tokens from l-1 and l+1, respectively. Since attention is permutation invariant, this ordering simply makes it easier to (1) compute the causal mask and (2) aggregate representations by index. Next, given an input sequence of length LN, it is advantageous for Attend to be as efficient as possible. In the following sections, we describe three example variants of the linear-time self-attention mechanism at the heart of OmniNet.
[0063] Given the output of omnidirectional attention The model may perform a pooling operator P(.). While there are many choices of pooling operators, parameterized or otherwise, some example embodiments employ a simple pooling function - max pooling with a stride of L.
[0064] O′=MaxPool1D(O), (5)
[0065] in
[0066] Given O′, the final representation of the OmniNet enhanced network is defined as:
[0067] OmniNet(X)=xformer(X) L +O′ (6)
[0068] In some embodiments, the OmniNet and the main transformer model can be trained together in an end-to-end manner, i.e., gradients flow to both networks simultaneously at each backward pass.
[0069] Examples for maintaining causality and autoregressive decoding
[0070] The key point to note about IndexSort is that this ordering enables us to apply a causal mask to the Attend function, i.e., if we sort the tokens by sequence index first, rather than by layer first, then we can easily apply a causal mask M where M[i, j] = 0 when i ≤ j and M[i, j] is -inf when i > j. This enables OmniNet to be used in an autoregressive setting.
[0071] Example High-Efficiency Converter
[0072] The following subsections describe several choices for linear-time self-attention mechanisms that can be used for OmniNet’s omnidirectional attention. Attend generally refers to an attention block with an attention function and two layers of positional FFNs, similar to the transformer backbone structure.
[0073] Kernel-based:
[0074] This variant uses kernel attention, which is generalizable. Specifically, this is written as:
[0075]
[0076] in And φ(.) is the Projection to Random feature maps of .
[0077] Low rank:
[0078] In this example, Attend can be set as follows:
[0079]
[0080] in is a low-rank projection transformation shared across heads and across keys and values. The complexity of this self-attention mechanism is Nk, not N 2 , where k<<N.
[0081] Block and memory based:
[0082] Another example includes a block-based and memory-based variant of the efficient transformer. In short, this is a combination of window attention, global attention, and sparse attention. The output of token i is defined as:
[0083]
[0084] Where N(i) is the neighborhood function representing the outer neighbors of node i, H is the total number of heads, and h represents a head. The neighborhood function mainly depends on the width of the window attention.
[0085] Example partitioning OmniNet
[0086] This section describes example types of partitioning variations that can be used in OmniNet. When L is large, the final representation of the OmniNet input can be extremely large. For example, when using an omnidirectional layer as the last layer, a sequence length of 1K will result in an input sequence length of 11K for a 12-layer Transformer model.
[0087] Let P be an integer-valued hyperparameter that determines the partition size. For an L-layer Transformer network, when lmodP is 0, we insert a meta-learner block.
[0088]
[0089] In short, whenever lmodP = 0, the omnidirectional attention layer can be activated to aggregate the representation from the previous partition lP layer all the way up to l-1. In this case, the original xformer layer can be skipped, thus roughly maintaining the same parameter size of the network.
[0090] Example devices and systems
[0091] Figure 2A A block diagram of an example computing system 100 is depicted, according to an example embodiment of the present disclosure. System 100 includes a user computing device 102, a server computing system 130, and a training computing system 150 communicatively coupled via a network 180.
[0092] The user computing device 102 may be any type of computing device, such as, for example, a personal computing device (e.g., a laptop or desktop), a mobile computing device (e.g., a smartphone or tablet), a gaming console or controller, a wearable computing device, an embedded computing device, or any other type of computing device.
[0093] The user computing device 102 includes one or more processors 112 and memory 114. The one or more processors 112 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.), and can be a single processor or multiple processors operatively connected. The memory 114 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 114 can store data 116 and instructions 118, which are executed by the processor 112 to cause the user computing device 102 to perform operations.
[0094] In some implementations, the user computing device 102 may store or include one or more machine learning models 120. For example, the machine learning model 120 may be or may otherwise include various machine learning models, such as a neural network (e.g., a deep neural network) or other types of machine learning models, including nonlinear models and / or linear models. The neural network may include a feedforward neural network, a recurrent neural network (e.g., a long short-term memory recurrent neural network), a convolutional neural network, or other forms of neural networks. Some example machine learning models may utilize an attention mechanism, such as self-attention. For example, some example machine learning models may include a multi-headed self-attention model (e.g., a transformer model). Reference Figure 1 An example machine learning model 120 is discussed.
[0095] In some implementations, one or more machine learning models 120 may be received from the server computing system 130 via the network 180, stored in the user computing device memory 114, and then used or otherwise implemented by the one or more processors 112. In some implementations, the user computing device 102 may implement multiple parallel instances of a single machine learning model 120.
[0096] Additionally or alternatively, one or more machine learning models 140 can be included in, or otherwise stored and implemented by, a server computing system 130 that communicates with the user computing device 102 according to a client-server relationship. For example, the machine learning models 140 can be implemented as part of a network service by the server computing system 140. Thus, one or more models 120 can be stored and implemented at the user computing device 102, and / or one or more models 140 can be stored and implemented at the server computing system 130.
[0097] The user computing device 102 may also include one or more user input components 122 for receiving user input. For example, the user input component 122 may be a touch-sensitive component (e.g., a touch-sensitive display or touchpad) that is sensitive to the touch of a user input object (e.g., a finger or an electronic stylus). The touch-sensitive component may be used to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other means by which a user can provide user input.
[0098] The server computing system 130 includes one or more processors 132 and memory 134. The one or more processors 132 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.), and can be a single processor or multiple processors operatively connected. The memory 134 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 134 can store data 136 and instructions 138, which are executed by the processor 132 to cause the server computing system 130 to perform operations.
[0099] In some embodiments, server computing system 130 includes or is otherwise implemented by one or more server computing devices. Where server computing system 130 includes multiple server computing devices, such server computing devices may operate according to a sequential computing architecture, a parallel computing architecture, or some combination thereof.
[0100] As described above, the server computing system 130 may store or otherwise include one or more machine learning models 140. For example, the model 140 may be or may otherwise include various machine learning models. Example machine learning models include neural networks or other multi-layer nonlinear models. Example neural networks include feedforward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks. Some example machine learning models may utilize attention mechanisms, such as self-attention. For example, some example machine learning models may include a multi-head self-attention model (e.g., a transformer model).
[0101] User computing device 102 and / or server computing system 130 may train model 120 and / or model 140 via interaction with training computing system 150 communicatively coupled via network 180. Training computing system 150 may be separate from server computing system 130 or may be part of server computing system 130.
[0102] The training computing system 150 includes one or more processors 152 and memory 154. The one or more processors 152 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.), and can be a single processor or multiple processors operatively connected. The memory 154 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 154 can store data 156 and instructions 158, which are executed by the processor 152 to cause the training computing system 150 to perform operations. In some embodiments, the training computing system 150 includes one or more server computing devices or is otherwise implemented by one or more server computing devices.
[0103] The training computing system 150 may include a model trainer 160 that trains the machine learning model 120 and / or the machine learning model 140 stored at the user computing device 102 and / or the server computing system 130 using various training or learning techniques (such as, for example, backpropagation of errors). For example, a loss function may be backpropagated through the model(s) to update one or more parameters of the model(s) (e.g., based on the gradient of the loss function). Various loss functions may be used, such as mean squared error, likelihood loss, cross entropy loss, hinge loss, and / or various other loss functions. Gradient descent techniques may be used to iteratively update the parameters over multiple training iterations.
[0104] In some implementations, performing back propagation of the error may include performing truncated back propagation through time.The model trainer 160 may perform various generalization techniques (eg, weight decay, dropout, etc.) to improve the generalization ability of the trained model.
[0105] Specifically, model trainer 160 can train machine learning model 120 and / or machine learning model 140 based on a collection of training data 162. In some embodiments, if the user has provided consent, the training examples can be provided by user computing device 102. Thus, in such embodiments, model 120 provided to user computing device 102 can be trained by training computing system 150 on user-specific data received from user computing device 102. In some cases, this process can be referred to as personalizing the model.
[0106] The model trainer 160 includes computer logic for providing the desired functionality. The model trainer 160 can be implemented using hardware, firmware, and / or software that controls a general-purpose processor. For example, in some embodiments, the model trainer 160 includes a program file stored on a storage device, loaded into memory, and executed by one or more processors. In other embodiments, the model trainer 160 includes one or more sets of computer-executable instructions that are stored in a tangible computer-readable storage medium (such as RAM, a hard disk, or optical or magnetic media).
[0107] Network 180 can be any type of communication network, such as a local area network (e.g., an intranet), a wide area network (e.g., the Internet), or some combination thereof, and can include any number of wired or wireless links. In general, communications on network 180 can be carried via any type of wired and / or wireless connection using a variety of communication protocols (e.g., TCP / IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), and / or protection schemes (e.g., VPN, secure HTTP, SSL).
[0108] The machine learning models described in this specification can be used for a variety of tasks, applications, and / or use cases.
[0109] In some embodiments, the input to the (multiple) machine learning models of the present disclosure may be image data. The (multiple) machine learning models may process the image data to generate an output. As an example, the (multiple) machine learning models may process the image data to generate an image recognition output (e.g., recognition of the image data, potential embedding of the image data, an encoded representation of the image data, a hash of the image data, etc.). As another example, the (multiple) machine learning models may process the image data to generate an image segmentation output. As another example, the (multiple) machine learning models may process the image data to generate an image classification output. As another example, the (multiple) machine learning models may process the image data to generate an image data modification output (e.g., a change to the image data, etc.). As another example, the (multiple) machine learning models may process the image data to generate an encoded image data output (e.g., an encoded representation and / or compressed representation of the image data, etc.). As another example, the (multiple) machine learning models may process the image data to generate an upscaled image data output. As another example, the (multiple) machine learning models may process the image data to generate a prediction output.
[0110] In some embodiments, the input to the (multiple) machine learning models of the present disclosure may be text or natural language data. The (multiple) machine learning models may process the text or natural language data to generate an output. As an example, the (multiple) machine learning models may process the natural language data to generate a language encoding output. As another example, the (multiple) machine learning models may process the text or natural language data to generate a latent text embedding output. As another example, the (multiple) machine learning models may process the text or natural language data to generate a translation output. As another example, the (multiple) machine learning models may process the text or natural language data to generate a classification output. As another example, the (multiple) machine learning models may process the text or natural language data to generate a text segmentation output. As another example, the (multiple) machine learning models may process the text or natural language data to generate a semantic intent output. As another example, the (multiple) machine learning models may process the text or natural language data to generate an upgraded text or natural language output (e.g., text or natural language data of higher quality than the input text or natural language, etc.). As another example, the (multiple) machine learning models may process the text or natural language data to generate a prediction output.
[0111] In some embodiments, the input to the (multiple) machine learning models of the present disclosure may be speech data. The (multiple) machine learning models may process the speech data to generate an output. As an example, the (multiple) machine learning models may process the speech data to generate a speech recognition output. As another example, the (multiple) machine learning models may process the speech data to generate a speech translation output. As another example, the (multiple) machine learning models may process the speech data to generate a potential embedding output. As another example, the (multiple) machine learning models may process the speech data to generate an encoded speech output (e.g., an encoded representation and / or compressed representation of the speech data, etc.). As another example, the (multiple) machine learning models may process the speech data to generate an upgraded speech output (e.g., speech data of higher quality than the input speech data, etc.). As another example, the (multiple) machine learning models may process the speech data to generate a text representation output (e.g., a text representation of the input speech data, etc.). As another example, the (multiple) machine learning models may process the speech data to generate a prediction output.
[0112] In some embodiments, the input to the (multiple) machine learning models of the present disclosure may be latently coded data (e.g., a latent space representation of the input, etc.). The (multiple) machine learning models may process the latently coded data to generate an output. As an example, the (multiple) machine learning models may process the latently coded data to generate a recognition output. As another example, the (multiple) machine learning models may process the latently coded data to generate a reconstruction output. As another example, the (multiple) machine learning models may process the latently coded data to generate a search output. As another example, the (multiple) machine learning models may process the latently coded data to generate a re-clustering output. As another example, the (multiple) machine learning models may process the latently coded data to generate a prediction output.
[0113] In some embodiments, the input to the (multiple) machine learning models of the present disclosure may be statistical data. The (multiple) machine learning models may process the statistical data to generate an output. As an example, the (multiple) machine learning models may process the statistical data to generate a recognition output. As another example, the (multiple) machine learning models may process the statistical data to generate a prediction output. As another example, the (multiple) machine learning models may process the statistical data to generate a classification output. As another example, the (multiple) machine learning models may process the statistical data to generate a segmentation output. As another example, the (multiple) machine learning models may process the statistical data to generate a visualization output. As another example, the (multiple) machine learning models may process the statistical data to generate a diagnostic output.
[0114] In some embodiments, the input to the (multiple) machine learning models of the present disclosure may be sensor data. The (multiple) machine learning models may process the sensor data to generate an output. As an example, the (multiple) machine learning models may process the sensor data to generate a recognition output. As another example, the (multiple) machine learning models may process the sensor data to generate a prediction output. As another example, the (multiple) machine learning models may process the sensor data to generate a classification output. As another example, the (multiple) machine learning models may process the sensor data to generate a segmentation output. As another example, the (multiple) machine learning models may process the sensor data to generate a visualization output. As another example, the (multiple) machine learning models may process the sensor data to generate a diagnostic output. As another example, the (multiple) machine learning models may process the sensor data to generate a detection output.
[0115] In some cases, (multiple) machine learning models can be configured to perform a task that includes encoding input data for reliable and / or efficient transmission or storage (and / or corresponding decoding). For example, the task can be an audio compression task. The input can include audio data, and the output can include compressed audio data. In another example, the input includes visual data (e.g., one or more images or videos), the output includes compressed visual data, and the task is a visual data compression task. In another example, the task can include generating an embedding of the input data (e.g., input audio or video data).
[0116] In some cases, the input includes visual data, and the task is a computer vision task. In some cases, the input includes pixel data from one or more images, and the task is an image processing task. For example, the image processing task may be image classification, where the output is a set of scores, each score corresponding to a different object class and representing the likelihood that the one or more images depict an object belonging to that object class. The image processing task may be object detection, where the image processing output identifies one or more regions in one or more images and, for each region, identifies the likelihood that the region depicts an object of interest. As another example, the image processing task may be image segmentation, where the image processing output defines, for each pixel in one or more images, the corresponding likelihood of each class in a predetermined set of classes. For example, the set of classes may be foreground and background. As another example, the set of classes may be object classes. As another example, the image processing task may be depth estimation, where the image processing output defines a corresponding depth value for each pixel in one or more images. As another example, the image processing task may be motion estimation, where the network input includes multiple images, and the image processing output, for each pixel of one of the input images, defines the motion of the scene depicted at that pixel between the images in the network input.
[0117] In some cases, the input includes audio data representing a spoken utterance, and the task is a speech recognition task. The output may include a text output mapped to the spoken utterance. In some cases, the task includes encrypting or decrypting the input data. In some cases, the task includes a microprocessor performance task such as branch prediction or memory address translation.
[0118] Figure 2A An example computing system that can be used to implement the present disclosure is shown. Other computing systems may also be used. For example, in some embodiments, the user computing device 102 may include a model trainer 160 and a training dataset 162. In such embodiments, the model 120 may be trained and used locally at the user computing device 102. In some such embodiments, the user computing device 102 may implement the model trainer 160 to personalize the model 120 based on user-specific data.
[0119] Figure 2B Depicted is a block diagram of an example computing device 10 performing in accordance with an example embodiment of the present disclosure. Computing device 10 may be a user computing device or a server computing device.
[0120] Computing device 10 includes multiple applications (e.g., Application 1 to Application N). Each application contains its own machine learning library and (multiple) machine learning models. For example, each application can include a machine learning model. Example applications include text messaging applications, email applications, dictation applications, virtual keyboard applications, browser applications, etc.
[0121] like Figure 2B As shown, each application can communicate with multiple other components of the computing device (such as, for example, one or more sensors, a context manager, a device state component, and / or additional components). In some embodiments, each application can communicate with each device component using an API (e.g., a public API). In some embodiments, the API used by each application is specific to that application.
[0122] Figure 2C Depicted is a block diagram of an example computing device 50 performing in accordance with an example embodiment of the present disclosure. Computing device 50 may be a user computing device or a server computing device.
[0123] The computing device 50 includes a plurality of applications (e.g., Application 1 through Application N). Each application communicates with a central intelligence layer. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, and the like. In some embodiments, each application can communicate with the central intelligence layer (and the model(s) stored therein) using an API (e.g., a common API across all applications).
[0124] The central intelligence layer includes multiple machine learning models. For example, Figure 2C As shown, a corresponding machine learning model can be provided for each application and managed by a central intelligence layer. In other embodiments, two or more applications can share a single machine learning model. For example, in some embodiments, the central intelligence layer can provide a single model for all applications. In some embodiments, the central intelligence layer is included in the operating system of the computing device 50 or is otherwise implemented by the operating system of the computing device 50.
[0125] The central intelligence layer can communicate with the central device data layer. The central device data layer can be a centralized data repository for the computing device 50. Figure 2CAs shown, the central device data layer can communicate with multiple other components of the computing device (such as, for example, one or more sensors, context managers, device state components, and / or additional components). In some embodiments, the central device data layer can communicate with each device component using an API (e.g., a private API).
[0126] Additional Disclosure
[0127] The technology discussed herein relates to servers, databases, software applications, and other computer-based systems, as well as the actions taken and the information sent to and from these systems. The inherent flexibility of computer-based systems allows for a wide variety of possible configurations, combinations, and partitioning of tasks and functions between and within components. For example, the processes discussed herein can be implemented using a single device or component or multiple devices or components working in combination. Databases and applications can be implemented on a single system or can be distributed across multiple systems. Distributed components can operate sequentially or in parallel.
[0128] Although the present invention has been described in detail with reference to various specific example embodiments of the present invention, each example is provided by way of explanation, not limitation of the present invention. Those skilled in the art, after understanding the foregoing, can easily make changes, variations, and equivalents to these embodiments. Accordingly, the present invention discloses and does not exclude the inclusion of these modifications, variations, and / or additions to the present invention, which will be apparent to those of ordinary skill in the art. For example, a feature shown or described as part of one embodiment can be used together with another embodiment to produce yet another embodiment. Therefore, the present invention is intended to cover these changes, variations, and equivalents.
Claims
1. A computing system for omnidirectional attention-based processing, the computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media that collectively store: a machine learning multi-layer attention model comprising a plurality of self-attention layers, wherein the multi-layer attention model is configured to process a first input to generate a first output, wherein the first input comprises a natural language input or an image input; The machine learning omnidirectional model is configured as follows: receiving a plurality of intermediate layer representations generated at two or more of a plurality of self-attention layers of the machine learning multi-layer attention model, respectively, when processing the first input to generate the first output; and processing the plurality of intermediate layer representations to generate a second output; and instructions that, when executed by the one or more processors, cause the computing system to perform operations comprising: providing the first input to the machine learning multi-layer attention model so as to generate the first output; Providing multiple intermediate layer representations generated at two or more of the multiple self-attention layers of the machine learning multi-layer attention model as input to the machine learning omnidirectional model so as to generate the second output.
2. The computing system of claim 1, wherein: The machine learning omnidirectional model includes one or more self-attention layers.
3. The computing system of claim 2, wherein: At least one of the one or more self-attention layers of the machine learning omnidirectional model performs kernel-based attention.
4. The computing system of claim 2, wherein: At least one of the one or more self-attention layers of the machine learning omnidirectional model performs low-rank attention, wherein the low-rank projection transformation is shared across multiple heads or multiple key and value parameters.
5. The computing system of claim 2, wherein: At least one of the one or more self-attention layers of the machine learning omnidirectional model performs block and memory based attention, wherein attention is performed within a neighborhood. The computing system according to claim 1 , wherein: Providing the plurality of intermediate layer representations as input to the machine learning omnidirectional model includes: An index sort operation is performed to sort the tokens within each intermediate layer representation according to the index.
7. The computing system of claim 1, wherein: Providing the plurality of intermediate layer representations as input to the machine learning omnidirectional model includes: Obtaining corresponding intermediate layer representations from multiple different partitions of two or more self-attention layers in the multiple self-attention layers of the machine learning multi-layer attention model; and The corresponding intermediate layer representations from the multiple different partitions are respectively input into the machine learning omnidirectional model.
8. The computing system of claim 1, wherein: The operations also include applying a pooling function to the second output.
9. The computing system of claim 1, wherein: The operations also include determining a final output based at least in part on the first output and the second output.
10. The computing system of claim 1, wherein: The machine learning multi-layer attention model includes a transformer model.
11. One or more non-transitory computer-readable media that collectively store: A multi-layer attention model, comprising multiple self-attention layers, wherein The multi-layer attention model is configured to process a first input to generate a first output, wherein the first input comprises a natural language input or an image input; Omnidirectional model, configured as: receiving a plurality of intermediate layer representations respectively generated at two or more of a plurality of self-attention layers of the multi-layer attention model when processing the first input to generate the first output; and processing the plurality of intermediate layer representations to generate a second output; and Instructions that, when executed, cause a computing system to perform operations comprising: providing the first input to the multi-layer attention model so as to generate the first output; providing a plurality of intermediate layer representations generated at two or more of the plurality of self-attention layers of the multi-layer attention model as input to a machine learning omnidirectional model, so as to generate the second output; evaluating a loss function based at least in part on the second output to determine a loss value; and At least the omnidirectional model is trained based at least in part on the loss function.
12. The one or more non-transitory computer-readable media of claim 11, wherein: Training at least the omnidirectional model based at least in part on the loss function includes jointly training both the multi-layer attention model and the omnidirectional model based at least in part on the loss function.
13. The one or more non-transitory computer-readable media of claim 11, wherein: The omnidirectional model includes one or more self-attention layers.
14. A computing system for omnidirectional attention-based processing, the computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media that collectively store: The machine learning omnidirectional model is configured as follows: receiving a plurality of intermediate layer representations respectively generated by two or more of a plurality of self-attention layers of a machine learning multi-layer attention model when processing a first input to generate a first output, wherein the first input comprises a natural language input or an image input; and processing the plurality of intermediate layer representations to generate a second output; and instructions that, when executed by the one or more processors, cause the computing system to perform operations comprising: providing a first input to the machine learning multi-layer attention model so as to generate the first output; Providing multiple intermediate layer representations generated at two or more of the multiple self-attention layers of the machine learning multi-layer attention model as input to the machine learning omnidirectional model so as to generate the second output.
15. The computing system of claim 14, wherein: The machine learning omnidirectional model includes one or more self-attention layers.
16. The computing system of claim 15, wherein: At least one of the one or more self-attention layers of the machine learning omnidirectional model performs kernel-based attention.
17. The computing system of claim 15, wherein: At least one of the one or more self-attention layers of the machine learning omnidirectional model performs low-rank attention, wherein the low-rank projection transformation is shared across multiple heads or multiple key and value parameters.
18. The computing system of claim 15, wherein: At least one of the one or more self-attention layers of the machine learning omnidirectional model performs block and memory based attention, wherein attention is performed within a neighborhood.
Citation Information
Patent Citations
Resource recommendation method, device and equipment and storage medium
CN111737573A
Modeling dependencies with global self-attention neural networks
WO2020257812A2