Inverted bottleneck architecture search and efficient attention mechanism for machine-learned models
By combining inverted bottleneck blocks and efficient multi-query attention blocks, the problems of efficiently constructing neural network architectures and low-latency execution are solved, enabling efficient search and training on different hardware and improving energy efficiency and model performance.
Patent Information
- Application Number
- CN202580014169.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-02-07
- Filing Date
- 2025-02-07
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies struggle to efficiently construct efficient neural network architectures and implement neural network execution on low-latency hardware, especially in edge computing devices where power consumption and heat dissipation are limited.
It adopts an inverted bottleneck block architecture, combining general inverted bottleneck blocks and efficient multi-query attention blocks (M-MQA), and optimizes the training process through data distillation technology to build a flexible neural network architecture search space, reduce transpose operations and memory costs, and adapt to different hardware environments.
It enables efficient search and training of neural networks on different hardware, reduces computational complexity, improves energy efficiency, reduces latency and computational overhead, and provides more efficient model training and inference performance.
Smart Images

Figure CN123165631A_ABST
Abstract
Description
[0001] priority
[0002] This application claims priority to U.S. Provisional Patent Application No. 63 / 550,970, filed February 7, 2024. U.S. Provisional Patent Application No. 63 / 550,970 is incorporated herein by reference in its entirety. Technical Field
[0003] This disclosure generally relates to machine learning processes and apparatuses and systems that utilize machine learning. More specifically, this disclosure relates to efficient neural network architectures, techniques for constructing new efficient neural networks, and methods for executing neural networks with low latency. Background Technology
[0004] A computer can receive input. It can execute instructions to process the input using a parameterized model to generate output. The computer can obtain feedback on its performance in generating output using that model. The computer can generate feedback by evaluating its performance. The computer can receive feedback from external sources. Based on this feedback, the computer can update the model's parameters to improve its performance. In this way, the computer can iteratively "learn" to generate the desired output. The resulting model is often referred to as a machine learning model. Summary of the Invention
[0005] Aspects and advantages of embodiments of this disclosure will be set forth in part in the description which follows, or may be learned from the description or by practice of the embodiments.
[0006] In one aspect, this disclosure provides a first example computer-implemented method. The first example computer-implemented method may include: receiving an input state of a neural network having a first channel depth at the input of a double-blended inverted bottleneck block. The first example computer-implemented method may include: convolving the input state using a first depthwise convolutional layer of the double-blended inverted bottleneck block to obtain a spatially blended input state. The first example computer-implemented method may include: expanding the spatially blended input state using an up-projection pointwise convolutional layer of the double-blended inverted bottleneck block to generate an expanded state having a second channel depth greater than the first channel depth. The first example computer-implemented method may include: convolving the expanded state using a second depthwise convolutional layer of the double-blended inverted bottleneck block to obtain a spatially blended expanded state. The first example computer-implemented method may include: projecting the spatially blended expanded state using a down-projection pointwise convolutional layer of the double-blended inverted bottleneck block to obtain a projected state having a third channel depth less than the second channel depth. The first example computer-implemented method may include: using the projected state to perform a prediction task using the neural network. For example, in one implementation, the input state represents image data, and the prediction task includes an image processing task.
[0007] In one aspect, this disclosure provides a second example computer-implemented method. The second example computer-implemented method may include: initializing a search space comprising a plurality of configurations including a general inverted bottleneck block. The general bottleneck block may include a first placeholder for a depthwise convolutional layer, the first placeholder being discretely activated during the search using a first parameter. The general bottleneck block may include an upprojective pointwise convolutional layer that follows the first placeholder and extends the channel depth of the network's internal state to an expanded state. The general bottleneck block may include a second placeholder for a depthwise convolutional layer, the second placeholder being discretely activated during the search using a second parameter, the second placeholder following the expanded pointwise convolutional layer. The general bottleneck block may include a downprojective pointwise convolutional layer that follows the second placeholder and reduces the channel depth of the network's internal state from the expanded state to a projected state. In one example, if not activated by the first or second parameter, the placeholder may perform a unit transformation or pass-through. The second example computer-implemented method may include: constructing a plurality of candidate models, wherein constructing the plurality of candidate models includes, for each candidate model: for each corresponding network block among a plurality of network blocks of a neural network architecture, selecting a corresponding value of the first parameter and a corresponding value of the second parameter to instantiate a corresponding inverted bottleneck block at that corresponding network block. The second example computer-implemented method may include: training the plurality of candidate models on a training dataset. The second example computer-implemented method may include: evaluating the performance of the plurality of candidate models. The second example computer-implemented method may include: selecting a candidate model based on the evaluation output.
[0008] In one aspect, this disclosure provides a third example computer-implemented method. The third example computer-implemented method may include: obtaining a current input tensor representing an input sequence of one or more elements. The third example computer-implemented method may include: computing attention values on the current input tensor using one or more tensor shrinkages, wherein at least a portion of a respective tensor shrinkage in the one or more tensor shrinkages includes an output tensor having non-shrinkage indices inherited from a first tensor and from a second tensor, wherein: the non-shrinkage indices inherited from the first tensor are consecutive and ordered in the first tensor; and the non-shrinkage indices inherited from the second tensor are consecutive and ordered in the second tensor. The third example computer-implemented method may include: generating the output of the machine learning-processed sequence processing model based on the attention values.
[0009] In one aspect, this disclosure provides a fourth example computer-implemented method. The fourth example computer-implemented method may include: obtaining an input tensor representing at least one input sequence of one or more elements, the input tensor having a sequence length dimension and an embedding dimension. The fourth example computer-implemented method may include: obtaining a query projection tensor configured to generate a projection of the input tensor using a plurality of learned weights, the query projection tensor having a query header dimension, an embedding dimension, and a projection dimension, wherein adjacent indices of the query projection tensor correspond to the query header dimension and the projection dimension, respectively. The fourth example computer-implemented method may include: shrinking the input tensor and the query projection tensor in the embedding dimension. Shrinking the input tensor and the query projection tensor in the embedding dimension may be performed by reshaping the query projection tensor into a query matrix by combining the query header dimension and the projection dimension into a single dimension. Shrinking the input tensor and the query projection tensor in the embedding dimension may be performed by obtaining an input matrix comprising at least a portion of the input tensor. Shrinking the input tensor and the query projection tensor in the embedding dimension can be performed by multiplying the input matrix with the query matrix to obtain the output. Shrinking the input tensor and the query projection tensor in the embedding dimension can also be performed by reshaping the output into a query tensor with a query head dimension, a sequence length dimension, and a projection dimension, where the neighbor indices of the query tensor correspond to the query head dimension and the projection dimension, respectively. The fourth example computer-implemented method may include computing an attention value on the at least one input sequence using the query tensor.
[0010] In one aspect, this disclosure provides a fifth example computer-implemented method. The fifth example computer-implemented method may include: obtaining a distillation dataset comprising a plurality of training examples labeled by a teacher model, wherein the plurality of training examples includes: a first plurality of training examples generated using a first set of augmentation routines; and a second plurality of training examples generated using a second set of augmentation routines different from the first set of augmentation routines. The fifth example computer-implemented method may include: generating a training batch for training a student model by combining one or more of the first plurality of training examples and one or more of the second plurality of training examples. The fifth example computer-implemented method may include: batch processing the training batch using the student model to obtain a batch output. The fifth example computer-implemented method may include: evaluating the batch output using corresponding labels generated by the teacher model for the training batch. The fifth example computer-implemented method may include: updating one or more learnable parameters of the student model based on the evaluation.
[0011] In one aspect, this disclosure provides one or more non-transitory computer-readable media storing instructions that can be executed by one or more processors to cause a computing system to perform operations, including one or more features of a first computer-implemented method, a second computer-implemented method, a third computer-implemented method, a fourth computer-implemented method, or a fifth computer-implemented method, or any combination thereof.
[0012] In one aspect, this disclosure provides a computing system including one or more processors and one or more non-transitory computer-readable media storing instructions executable by the one or more processors to cause the computing system to perform operations including one or more features of a first computer-implemented method, a second computer-implemented method, a third computer-implemented method, a fourth computer-implemented method, or a fifth computer-implemented method, or any combination thereof.
[0013] In one aspect, this disclosure provides a neural network configured to implement one or more features of a first computer-implemented method, a second computer-implemented method, a third computer-implemented method, a fourth computer-implemented method, or a fifth computer-implemented method, or any combination thereof.
[0014] Other exemplary aspects of this disclosure relate to other systems, methods, apparatuses, tangible non-transitory computer-readable media, and devices for performing the functions described herein. These and other features, aspects, and advantages of the various implementations will be better understood with reference to the following description and the appended claims. The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate implementations of this disclosure and, together with the description, help to explain the relevant principles. Attached Figure Description
[0015] Figure 1 This is a block diagram illustrating an example implementation of a bottleneck block according to various aspects of this disclosure;
[0016] Figure 2A This is a block diagram illustrating an example implementation of the bottleneck block search space according to various aspects of this disclosure;
[0017] Figure 2B This is a block diagram illustrating an example implementation of the bottleneck block search space according to various aspects of this disclosure;
[0018] Figure 3 This is a block diagram illustrating an example implementation of a bottleneck block search system according to various aspects of this disclosure;
[0019] Figure 4 This is a block diagram illustrating an example implementation of a Transformer encoder according to various aspects of this disclosure;
[0020] Figure 5 This is a block diagram illustrating an example implementation of a Transformer encoder according to various aspects of this disclosure;
[0021] Figure 6 This is a block diagram illustrating an example implementation of an attention block according to various aspects of this disclosure;
[0022] Figure 7 This is a block diagram illustrating the generation of a distillation training dataset according to example implementations of various aspects of this disclosure;
[0023] Figure 8 This is a block diagram illustrating an example implementation of generating input batches using a distillation training dataset according to various aspects of this disclosure;
[0024] Figure 9 It is a diagram illustrating the model results of example implementations according to various aspects of this disclosure;
[0025] Figure 10 This is a flowchart illustrating an example method for implementing an inverted bottleneck block with two-stage mixing, according to example implementations of various aspects of this disclosure;
[0026] Figure 11 This is a flowchart illustrating an example method for performing efficient neural network architecture search according to example implementations of various aspects of this disclosure;
[0027] Figure 12 This is a flowchart illustrating an example method for efficiently computing multi-query attention in a machine learning-based sequence processing model, according to example implementations of various aspects of this disclosure;
[0028] Figure 13 This is a flowchart illustrating an example method for efficiently computing multi-query attention in a machine learning-based sequence processing model, according to example implementations of various aspects of this disclosure;
[0029] Figure 14 This is a flowchart illustrating an example method for improving the training efficiency of a machine learning-based image processing model, according to example implementations of various aspects of this disclosure;
[0030] Figure 15 This is a flowchart illustrating an example method for training a machine learning-based model, according to example implementations of various aspects of this disclosure;
[0031] Figure 16It is a block diagram of an example processing flow for processing inputs to generate outputs using a machine learning-enabled model, based on example implementations of various aspects of this disclosure;
[0032] Figure 17 This is a block diagram of an example sequence processing model based on example implementations of various aspects of this disclosure;
[0033] Figure 18 This is a block diagram of an example technique for filling example input sequences for processing by a sequence processing model, based on example implementations of various aspects of this disclosure;
[0034] Figure 19 This is a block diagram of an example model development platform based on example implementations of various aspects of this disclosure;
[0035] Figure 20 This is a block diagram of an example training workflow for training a machine learning model, based on example implementations of various aspects of this disclosure.
[0036] Figure 21 It is a block diagram of an inference system for operating one or more machine learning-processed models to perform inference, based on example implementations of various aspects of this disclosure;
[0037] Figure 22 This is a block diagram of an example networked computing system based on exemplary implementations of various aspects of this disclosure;
[0038] Figure 23 This is a block diagram of an example computing device implementing various aspects of this disclosure; and
[0039] Figure 24 This is a block diagram of an example computing device that implements various aspects of this disclosure. Detailed Implementation
[0040] In general, this disclosure relates to efficient neural network architectures, techniques for constructing new efficient neural networks, and methods for low-latency execution of neural networks.
[0041] In one example aspect, this disclosure provides a more robust configuration of an inverted bottleneck block that maintains efficient execution characteristics. The bottleneck block can be part of a neural network (e.g., an image processing network) configured to compress rich feature information into a compressed, lower-dimensional representation. The inverted bottleneck block can use expansion and contraction layers within the block to perform nonlinear activations in an expanded state, where the block's inputs and outputs—and any associated residuals bypassing the block—operate in a lower-dimensional state. In some aspects, the compressed rich features (bottleneck tensor) in the lower-dimensional state can retain important information, where the expanded internal state operations help increase the expressive power of nonlinear transformations (e.g., making visual patterns more likely to be linearly separable).
[0042] In general, the framework of the inverted bottleneck block can include projecting features onto an extended pointwise layer in a higher dimension, followed by an activation layer that can act as a classifier. The projected pointwise layer can be applied to shrink the features back to the original dimension (or a different dimension). This compression can utilize the low-rank nature of the features and can facilitate the use of skip connections, enabling very deep networks.
[0043] To facilitate information transfer across spatial dimensions, the framework of the inverted bottleneck block can include spatial blending operators. For example, depthwise convolutions can be used to blend features across one or more spatial dimensions of the input state. Decomposing standard 2D convolutions into depthwise and pointwise convolutions reduces the number of parameters and operations while having a relatively small accuracy loss, advantageously leading to fast and efficient networks.
[0044] In an example implementation, this disclosure provides an inverted bottleneck block with two-stage mixing. In one example, a first depthwise convolution can be performed on the lower-dimensional “bottleneck” input state to perform spatial mixing on rich feature information. After expanding to the higher-dimensional internal state, a second depthwise convolution can be performed on the expanded features to take advantage of the additional expressive capacity of the higher-dimensional mixing operation.
[0045] The framework for efficient utilization in inverted bottleneck blocks with two-mixing provides a flexible lattice for constructing a wide variety of bottleneck blocks. This structure can be parameterized to construct a search space for performing neural architecture searches to identify particularly efficient combinations of different parameterizations of the bottleneck block. For example, using inverted bottleneck blocks with two-mixing can provide a low-cost increase in network depth and receptive field. Using spatial mixing only in higher dimensions or only in lower dimensions (e.g., inverted bottleneck blocks with single-mixing) can provide temporary tradeoffs between spatial and channel mixing. Inverted bottlenecks without spatial mixing can improve computational utilization due to efficient, accelerator-friendly subroutines used to compute pointwise convolutions.
[0046] In this way, for example, the inverted bottleneck framework presented in this paper can provide a generalized inverted bottleneck block that can be replicated across network stages, while allowing flexibility at each stage to tune the model's performance. Due to this high level of structural repetition, the example implementations can facilitate a network architecture search paradigm with a high level of weight sharing among candidate networks, thereby unlocking new levels of both search efficiency and the performance of the resulting model.
[0047] For example, an example search system can parameterize a generic inverted bottleneck block with a first parameter that classifies the spatial blending operation in the unexpanded state. The search system can then parameterize the generic inverted bottleneck block with a second parameter that classifies the spatial blending operation in the expanded state. The search system can construct multiple distinct sequences of candidate blocks. Each block in the candidate sequence can be assigned a value for both parameters. In this way, for example, a wide variety of network architectures can be explored using a relatively compact search space that allows for high-level parameter sharing.
[0048] This network architecture search can use several different optimization objectives. For example, the search can prioritize absolute result quality. The search can prioritize result generation speed (e.g., latency). The search can leverage a balance between quality and speed. A latency objective can be used, targeting the estimated execution latency on the target hardware, thus allowing for the optimization of different model architectures for different systems.
[0049] The inverted bottleneck block presented in this paper can also provide improved feedforward sublayers in Transformer blocks. For example, a Transformer block can include an attention block and a feedforward network that processes the attention output of that attention block. The advantages of the inverted bottleneck block presented in this paper can further improve the expressiveness of the attention block.
[0050] To further facilitate efficient execution of Transformer blocks, this disclosure introduces an efficiency-optimized multi-query attention block that can be combined with implementations that address common inversion bottlenecks (e.g., in neural architecture search). This efficiency-optimized multi-query attention block (referred to herein, “Mobile MQA” or “M-MQA”) includes carefully selected execution ordering to reduce memory costs and other computational overheads that can slow down computation and consume additional resources. For example, M-MQA may include reorganized weight matrices specifically adapted for performing tensor products with the input to the attention block without introducing pseudo-transposes. While transposes may not contain MACs, they can be very time-consuming because they may require reading the complete tensor from memory and then writing it back. By reducing the number of transpose operations, M-MQA achieves significant latency improvements relative to standard multi-query attention implementations, with example tests in this paper demonstrating speedups of up to approximately 3x during training and inference on some hardware.
[0051] Example implementations of M-MQA can also include spatial downsampling to reduce the dimensionality of the tensor product computed during attention operations. This can include downsampling at the input and upsampling at the output.
[0052] Example implementations of M-MQA can also include tuned tensor reshaping to reduce compiler overhead. For example, 3D tensors used in standard MQA can be decomposed into 4D tensors to improve accelerator or processor utilization. The example tests described in this paper show a nearly 30% improvement in processor utilization, which can provide a 3x speed gain.
[0053] To further facilitate efficient search and training of novel architectures, including generalized inverted bottleneck blocks, the example implementations of this disclosure also provide data-efficient distillation techniques that leverage dynamically mixing training datasets with varying augmentations into each training batch. Further implementations can utilize additional mixing of class-balanced training examples from a third dataset. Training batches can be associated with labels predicted by the teacher model. Using distillation to train a selected student model or architecture search supernet (e.g., instead of training directly on the original data) can yield models with better performance and greater robustness to minor hyperparameter tuning. This, in turn, can provide more efficient search and improved end results. For example, it is well known that the quality of ImageNet-trained models can be highly sensitive to data augmentation, regularization, and optimizer hyperparameters. This presents a particular challenge in the context of neural architecture search, as candidate architectures can vary significantly and change dynamically during the search and training process. This can make selecting optimal hyperparameters at each stage challenging. Advantageously, distillation can be robust to hyperparameter selection. Distilled datasets may require little or no additional augmentation and can be robust to regularization and optimization configurations. In this way, the search space of the example implementation of this disclosure can be simplified by avoiding excessive searching of the hyperparameter value space.
[0054] The example implementation disclosed herein can provide many technical effects and benefits.
[0055] In one aspect, this disclosure provides a technical solution that addresses the challenge of efficiently performing neural network architecture search to identify well-performing configurations for various hardware environments while maintaining high prediction quality. The technical benefits of this solution include reduced search space complexity, enhanced computational efficiency, and improved latency performance across different hardware configurations.
[0056] One of these technical effects is the introduction of a universal inverted bottleneck block, which can be parameterized and instantiated in multiple configurations within a neural network architecture. By parameterizing this flexible architecture into a search space that provides a wide range of complementary performance characteristics, the relatively compact search space allows for the exploration of a broad range of model performance tradeoffs for a given implementation. By constraining the width of the search space, more computation can be allocated to deeper searches, resulting in higher-performance models output from search routines for a given amount of search computation.
[0057] Another technical benefit is the ability to evaluate and optimize neural network architectures for different hardware configurations. This technique allows for the determination of execution latency on various processors (e.g., those with different performance capacities), enabling the selection of candidate models that are not only accurate but also tailored for efficient execution on the target hardware. This is particularly beneficial for edge computing devices, where power consumption and heat dissipation can be tightly constrained. By estimating the execution time and incorporating the latency target into the reward function used to learn the guided search policy, the example implementation can provide a resulting neural network architecture optimized for real-world deployment scenarios.
[0058] Another technical benefit is reduced memory and computational overhead when performing multi-query attention with a reduced number of transpose operations required during tensor shrinking. This is achieved by carefully rearranging the weight matrix to avoid spurious transposes, which are typically time-consuming due to reading the entire tensor out and writing it to memory. By reducing the number of these operations, M-MQA can significantly improve latency and energy costs, resulting in acceleration during training and inference on various hardware platforms.
[0059] Furthermore, the example implementation provides an efficient data distillation technique for training neural network models, offering a technical solution to the problems of limited training data and the energy costs of acquiring, processing, and storing such data. By dynamically mixing training datasets with different enhancements and utilizing additional class-balanced training examples, the example implementation can provide trained models with better performance and better generalization to unseen data. This, in turn, translates into a more efficient architecture search process and improved final model results.
[0060] The technical effect of the exemplary implementations disclosed herein is to improve the energy efficiency of performing operations using machine learning models, thereby improving the capabilities of computers implementing such models. For example, the exemplary implementations can provide more energy-efficient runtime execution or inference. In some scenarios, improved energy efficiency can reduce the energy consumed in performing a given task (e.g., reducing the energy consumed in maintaining the model in memory, reducing the energy consumed in performing computations within the model, etc.). In other scenarios, improved energy efficiency can accomplish more tasks within a given energy budget (e.g., a greater number of tasks, more complex tasks, or performing the same task with higher accuracy or precision, etc.).
[0061] In another example, the example implementations can provide more energy-efficient training operations or model updates. In some scenarios, improved energy efficiency can reduce the energy used to perform a given number of update iterations (e.g., reducing the energy consumed in maintaining the model in memory, reducing the energy consumed in performing computations within the model, such as calculating gradients, backpropagation loss, etc.). In some scenarios, improved energy efficiency can complete more update iterations for a given energy budget (e.g., a greater number of iterations, etc.). In some scenarios, the greater expressiveness provided by the model architecture and training techniques of this disclosure can enable a given level of functionality to be achieved in fewer training iterations, thus incurring a smaller energy budget. In some scenarios, the greater expressiveness provided by the model architecture and training techniques of this disclosure can enable a broader level of functionality to be achieved in a given number of training iterations, thus using a given energy budget more efficiently.
[0062] In this way, for example, the improved energy efficiency of the exemplary implementations of this disclosure can reduce the amount of pollution or other waste associated with implementing machine learning-based models and systems, thereby advancing the field of machine learning and artificial intelligence as a whole. The amount of pollution can be reduced overall (e.g., its absolute value) or on a normalized basis (e.g., energy per task, per model size, etc.). For example, by implementing more energy-efficient training or inference operations, CO2 emissions (e.g., emissions from power sources) associated with training and executing machine learning models can be reduced. By implementing more energy-efficient training or inference operations, the amount of thermal pollution in the environment (e.g., caused by processor / storage locations) can be reduced.
[0063] This article describes various example implementations with reference to the accompanying drawings.
[0064] Figure 1 This is a block diagram of an example machine learning model 100 with an architecture divided into multiple blocks. Overall, these blocks can perform processing on the input stream and pass the results downstream. Although in Figure 1 Although not shown in the diagram, it should be understood that other connections between these blocks (e.g., residuals, jumps, etc.) may be used.
[0065] An example block can be Figure 1The diagram shows an inverted bottleneck block with two blending operations, illustrated in a decomposed view. Input state 102 can receive input to this block. A first spatial blending operation (e.g., depthwise convolution) can generate a spatially blended input state 104 from input state 102. An expansion or upprojection operation (e.g., pointwise convolution) can expand the dimension (e.g., channel depth) of the spatially blended input state 104 to obtain an expanded state 106. A second spatial blending operation (e.g., depthwise convolution) can generate a spatially blended expanded state 108 from expanded state 106. A dimensionality reduction or downprojection operation (e.g., pointwise convolution) can generate an input state from the spatially blended expanded state 108 with a dimension lower than that of the next block.
[0066] In this way, the input state of each block can be a "bottleneck" for compressing rich feature information. Residual connections 112 can connect these feature-rich bottleneck tensors.
[0067] Nonlinear activations can be applied during the generation of one or more states of the block. Example nonlinear activations include ReLU, ReLU6, GeLU, swish, hard swish, etc.
[0068] One or more of these states can be generated using linear convolution. In one example, the downprojection from this expanded state can be performed using a linear operation to form a linear bottleneck. In another example, a nonlinear activation is applied for each operation other than the downprojection.
[0069] Input state 102 can be an input tensor or a multidimensional data array. Input state 102 can include multiple channels and spatial dimensions. For example, input state 102 can include a first spatial dimension (e.g., spatial width W) and a second spatial dimension (e.g., spatial height H). Input state 102 can also include the number of input channels. For example, the input tensor can be a three-dimensional tensor (e.g., W×H×C) with a first spatial dimension, a second spatial dimension, and the number of input channels. The input tensor can be a four-dimensional tensor (e.g., W×H×C×S) with a first spatial dimension, a second spatial dimension, the number of input channels, and a third spatial dimension. Input state 102 can include one or more spatial dimensions and / or other combinations of channel dimensions. Input state 102 can have a first channel depth (e.g., the number of channels).
[0070] Input state 102 can represent various types of data. In one example, input state 102 is pixel data of an image, or feature map data generated from the pixel data of an image. Input state 102 can also represent sensor data or other data structured as a multidimensional array.
[0071] Input state 102 can be processed by a depthwise convolution operator to generate spatially blended input state 104. The depthwise convolution operator can perform spatial blending by sliding the convolution window (e.g., kernel) of a filter across a first and second spatial dimension of input state 102 to generate spatially blended input state 104.
[0072] The spatially blended input state 104 can be a tensor or a multidimensional data array. The spatially blended input state 104 can include multiple channels and spatial dimensions. For example, the spatially blended input state 104 can include a first spatial dimension (e.g., spatial width W) and a second spatial dimension (e.g., spatial height H). The spatially blended input 104 can also include the number of input channels. For example, the input tensor can be a three-dimensional tensor (e.g., W×H×C) with a first spatial dimension, a second spatial dimension, and the number of input channels. The spatially blended input tensor can be a four-dimensional tensor (e.g., W×H×C×S) with a first spatial dimension, a second spatial dimension, the number of input channels, and a third spatial dimension. The spatially blended input state 104 can include one or more spatial dimensions and / or other combinations of channel dimensions. The spatially blended input state 104 can have the same channel depth (e.g., number of channels) as input state 102.
[0073] The spatially mixed input state 104 can be processed by an upprojection operator (e.g., pointwise convolution) to generate an expanded state 106 as output. Pointwise convolution can be performed by applying a separate 1x1 convolution kernel to each channel at each spatial location to generate a number of output channels corresponding to the number of filters in the pointwise convolution operator. In this way, for example, the pointwise convolution operator can perform upprojection to project a state having a first channel depth into an expanded state having a second channel depth higher than the first channel depth.
[0074] Extended state 106 can be a tensor or a multidimensional data array. Extended state 106 can include multiple channels and spatial dimensions. For example, extended state 106 can include a first spatial dimension (e.g., spatial width W) and a second spatial dimension (e.g., spatial height H). Extended state 106 can also include the number of output channels. For example, the output tensor can be a three-dimensional tensor (e.g., W×H×C) with a first spatial dimension, a second spatial dimension, and the number of output channels. Extended state 106 can be a four-dimensional tensor (e.g., W×H×C×S) with a first spatial dimension, a second spatial dimension, the number of output channels, and a third spatial dimension. Extended state 106 can include one or more spatial dimensions and / or other combinations of channel dimensions. Extended state 106 can have a channel depth (e.g., the number of channels) greater than that of input state 102. For example, the number of channels in extended state 106 can be greater than the number of channels in input state 102 by a ratio corresponding to an expansion factor.
[0075] The extended state 106 can be processed by a convolution operator (e.g., a depthwise convolution) to produce a spatially blended extended state 108 as output. This can be a second spatial blending in addition to the first spatial blending performed in the lower-dimensional state (e.g., at the first channel depth). In one example, spatial blending can also be performed by a second depthwise convolution in addition to the depthwise convolution performed on the input state 102 in that lower-dimensional state.
[0076] The spatially blended extended state 108 can be a tensor or a multidimensional data array. The spatially blended extended state 108 can include multiple channels and spatial dimensions. For example, the spatially blended extended state 108 can include a first spatial dimension (e.g., spatial width W) and a second spatial dimension (e.g., spatial height H). The spatially blended extended state 108 can also include the number of output channels. For example, the output tensor can be a three-dimensional tensor (e.g., W×H×C) having a first spatial dimension, a second spatial dimension, and the number of output channels. The spatially blended extended state 108 can be a four-dimensional tensor (e.g., W×H×C×S) having a first spatial dimension, a second spatial dimension, the number of output channels, and a third spatial dimension. The spatially blended extended state 108 can include one or more spatial dimensions and / or other combinations of channel dimensions.
[0077] The spatially blended extended state 108 can be processed by a downprojection operator (e.g., pointwise convolution) to generate a projected state, such as the input state 110 of the next network block. Pointwise convolution can perform downprojection by applying a separate 1x1 convolution kernel to each channel at each spatial location to generate a number of output channels corresponding to the number of filters in the pointwise convolution operator. In this way, for example, the pointwise convolution operator can perform downprojection to project a state having a second channel depth into an output state having a third channel depth (which may be the same as or different from the first channel depth) lower than the second channel depth. The third channel depth of this output state can correspond to the channel depth of the input state of a subsequent network block.
[0078] The output of this inverted bottleneck block can be used to perform a prediction task of the machine learning model 100 or some other task. This paper describes example prediction tasks for the machine learning model 100. For example, example prediction tasks may include image processing tasks such as object detection, object classification, object segmentation, image annotation, image embedding, etc.
[0079] Figure 2a is a block diagram showing that the spatial mixing component can be associated with and discretely activated by individual search parameters 202 and 204. Figure 2b is a diagram showing different configurations based on different Boolean values of the search parameters.
[0080] For example, the leftmost configuration in Figure 2b corresponds to the configuration in which the spatial mixing operator is applied before expansion (e.g., value 202 is True) and in the expanded state (e.g., value 204 is True). Referring to the next configuration to the right, this diagram corresponds to the configuration in which the spatial mixing operator is not applied before expansion (e.g., value 202 is False) and in the expanded state (e.g., value 204 is True). Referring to the next configuration to the right, this diagram corresponds to the configuration in which the spatial mixing operator is applied before expansion (e.g., value 202 is True) and in the expanded state (e.g., value 204 is False). Referring to the next configuration to the right, this diagram corresponds to the configuration in which the spatial mixing operator is not applied before expansion (e.g., value 202 is False) and in the expanded state (e.g., value 204 is False).
[0081] In one example, an additional configuration can be triggered using another search parameter value of 206, in which depth operations and pointwise operations are fused into a 2D convolution (conv2d) operation.
[0082] The various configurations shown in Figures 2a and 2b illustrate a flexible framework for building a wide variety of bottleneck blocks using highly shared infrastructure. This simplifies the search space for neural network architectures, allowing for efficient depth search.
[0083] Furthermore, such an adaptable framework offers the flexibility to achieve temporary spatial and channel mixing tradeoffs based on the number and arrangement of spatial mixing stages. Additionally, it provides the flexibility to expand the receptive field on demand by processing extended hidden states. Moreover, it offers the flexibility to maximize computational utilization by leveraging accelerator-friendly operations such as pointwise convolutions in FFN blocks.
[0084] Figure 3 This is a block diagram illustrating a search system 300 for performing neural architecture search in a constrained search space based on the general inverted bottleneck blocks introduced in this disclosure. A selection strategy 302 can guide the selection of candidate neural network architectures (e.g., search parameters 202, 204, 206 for one or more blocks in a block sequence) to form a candidate model configuration 304. Training input 306 can be input (e.g., batch-wise) to the candidate model configuration 304 to generate training output 308.
[0085] System 300 can compute one or more evaluation metrics 310 by comparing training output 308 with training labels 312 (which may be reference outputs associated with training input 306). Training labels 312 may be supervised labels or self-supervised or semi-supervised labels (e.g., generated using a teacher model). Evaluation metrics 310 may also process runtime metadata 314 to extract additional signals about the execution of candidate model configuration 304, such as execution duration or latency, memory usage, FLOPs, processor utilization, etc.
[0086] Evaluation metric 310 can generate feedback signal 316, which system 300 can use to update selection strategy 302, learnable parameters of candidate model configuration 304, or both (together, sequentially, etc.). Feedback signal 316 can characterize the performance of the candidate model configuration based on its output (e.g., the loss applied to its output). Feedback signal 316 can characterize the performance of the candidate model configuration based on runtime metadata attributes of the candidate model configuration (e.g., execution cost, execution latency or duration, memory usage, FLOPs, processor utilization, etc.). Feedback signal 316 can represent a joint or combined characterization of the performance of the candidate model configuration based on a combination of metrics on its output and metrics on its runtime attributes.
[0087] Evaluation metric 310 can provide purposes with multiple objectives, such as multiple latency targets or evaluations. For example, the latency of candidate models can be evaluated on multiple different hardware platforms to provide a diverse representation of the performance of candidate models across different hardware. In some implementations, providing a dual latency target leads to improvements in the MAC and parameter counts of the resulting model without measuring a decrease in accuracy.
[0088] In one example, candidate model configuration 304 is formed by components of a supernet. A supernet may include multiple distinct computational paths corresponding to subnets representing different candidate neural network architectures. For example, a supernet may include one or more types of blocks, including one or more types of bottleneck blocks (e.g., universal inverted bottleneck blocks). Different computational paths of the supernet may be activated and deactivated based on corresponding search parameters for each block (e.g., search parameters 202, 204, 206 for one or more blocks in that path). During the search, the values of these parameters may be sampled and combined to form candidate model configuration 304.
[0089] In some implementations, weights in the supernet can be shared across candidate architectures. For example, a given component that can be reused across some or all candidate architectures—or their sub-parts—can be implemented using the same set of learnable parameters. In this way, for example, the number of learnable parameters in the supernet can be decoupled from the size and diversity of the architecture search space.
[0090] For example, in one instance, the supernet can be initialized across all instances of a common inverted bottleneck block within the supernet using a shared set of parameters from one or both of the up-projection and down-projection operators (e.g., pointwise convolution operators). During the search process, different subnets are sampled from the supernet by activating or deactivating deep convolutional layers in various configurations. The shared parameters used for the up-projection and down-projection layers are learned during training, while the architecture of each sampled subnet is determined by the values of the first parameter 202 and the second parameter 204. This weight-sharing strategy allows for efficient exploration of a large search space because most parameters are shared across different candidate architectures.
[0091] In some implementations, this neural architecture search can train learnable parameters for various network components while also learning how to sample better subnetworks from the supernet. For example, the system can provide updates in a two-stage training approach.
[0092] In the first training phase, the learnable parameters of the supernet can be updated using gradient descent based on the gradient of the loss function computed on a batch of training examples from the training dataset. For example, the evaluation metric 310 can compute the loss based on the accuracy or other quality metric of the training output 308. This loss can be backpropagated into the supernet, to the activity parameters (e.g., in the activity block that forms the candidate model configuration 304).
[0093] In the second training phase, the subnet sampling policy can be updated using reinforcement learning. For example, a reward signal can be computed based on the performance of each sampled subnet (e.g., accuracy, inference cost on one or more target hardware platforms, or a combination thereof). This reward is then used to update the policy using a reinforcement learning algorithm (such as REINFORCE). The system can iteratively alternate between these two phases until a stopping criterion (e.g., maximum number of iterations or a convergence threshold) is met. Other purposes besides reinforcement learning can be used to update the sampling policy, such as evolutionary algorithms or other optimization techniques.
[0094] An example search can be divided into two search phases: a coarse first search phase and a fine second search phase. In the first search phase, the search system 300 can search across filter sizes while other searchable parameters (e.g., parameters 202, 204) are frozen. For example, the filter size can be searched while the expansion factor and kernel size are frozen (e.g., frozen to 4 and 3x3, respectively). During this coarse search phase, the type of the inverted bottleneck block can also be frozen (e.g., an inverted bottleneck with 202 as False and 204 as True, or another configuration).
[0095] In this refined second search phase, using the filter size selected in the coarse phase, the search system 300 can search for one or more of the parameters frozen in the coarse phase. For example, in this second search phase, the search system 300 can search for the configuration of a common inverted bottleneck block for each of a plurality of common inverted bottleneck blocks in the candidate network configurations, using different combinations of the first parameter 202 and the second parameter 204. Furthermore, in this second search phase, the search system 300 can search for the kernel size used within the common inverted bottleneck block. For example, a kernel size can be selected from a set of available kernel sizes (e.g., 3x3, 5x5). In some implementations, additional search parameters can be explored in these phases. In some implementations, some search parameters can be fixed in all or one or more search phases. For example, the expansion factor can be searched, or it can be frozen in both the first and second search phases.
[0096] Comparing the experimental results of the model obtained by single-stage search with those obtained by two-stage search, the two-stage search model has higher accuracy (+0.22% in the validation split and +3.6% in the training split) and lower latency (-0.18 ms execution time on the Pixel 6 EdgeTPU).
[0097] In one example, the search space of the search system 300 can be represented as a set of class decisions that control different aspects of the network architecture. For example, a single class decision might control whether to use 3×3, 5×5, or 7×7 convolutions at a specific location in the network. The architecture can be formed by assigning values to these class decisions for each of several available network blocks (the number of blocks and connections can be frozen or searched). During the search, a policy π can be learned. The policy can be a probability distribution from which values are sampled to determine the class decisions.
[0098] In one example, π can be defined as a set of independent multinomial variables, one for each decision in our search space. A set of shared weights W can be used to efficiently estimate the quality of candidate architectures in the search space. The system can alternate between learning the shared weights W using gradient descent and learning the policy π using REINFORCE. At each step, the search system 300 can first sample the network architecture α. Next, system 300 can use shared weights to estimate the quality Q(α) of the sampled architecture using a single batch of examples from the validation set. The search system 300 can then estimate the inference time T(α) of the sampled architecture. The accuracy Q(α) and inference time T(α) can be used to jointly determine the reward r(α), which is used to update the policy π using REINFORCE. Finally, system 300 can update the shared model weights W by computing gradient updates with respect to the architecture α on a single batch of examples from the training set. The above process can be repeated until the search is complete based on satisfying the stopping criterion. At the end of the search, the final architecture can be obtained by independently selecting the most probable value for each category decision in π.
[0099] In one example, a search space with defined properties can be constructed to limit the scope of the search. For instance, in one example, one or more initial layers of the network can be fixed. For example, an example search could start with a 2D convolutional (Conv2D) layer (3x3 kernel, stride 2), followed by one or more fused inverted bottleneck blocks with stride 2 (e.g., parameter 206 is True). Similarly, one or more output head layers can be fixed, such as to match the output head configuration in MobileNetV3.
[0100] Furthermore, different operation densities can be prioritized at different layers in the model. For example, the search space can prioritize operations with higher computational density in the initial layers to balance efficiency and accuracy.
[0101] Search system 300 was used to directly search models of different target sizes. For MNv4-Conv-L, the NAS search scheme described above was followed. The search was performed with 384 pixels as input and a dual objective of 2.3 ms latency on the Pixel 6 EdgeTPU simulator and 2.0 ms latency on the Pixel 7 EdgeTPU simulator. For MNv4-Conv-M, the fine-grained search was relaxed to include additional expansion factor search options of 2, 4, and 6. A target of 0.6 ms latency was set on the Pixel 6 EdgeTPU simulator using 256 pixels as input. MNv4-Conv-S was searched with a target of 0.212 ms at an input resolution of 224 pixels.
[0102] To create the MobileNet-V4 hybrid model, attention blocks were manually added to the MobileNet-V4 convolutional model. MNv4-Hybrid-L is built on top of MNv4-Conv-L. Four Mobile MQA blocks were added to the penultimate stage. These blocks have 8 heads and 48 projected dimensions, with asymmetric downsampling of stride = 2. Four more Mobile MQA blocks were added to the final stage. These attention blocks have 8 heads and 64 projected dimensions. MNv4-Hybrid-M is built on top of MNv4-Conv-M in a similar manner. The only difference is that for all MQA blocks, 64 is used as the projected dimension, and 4 heads are used instead of 8.
[0103] Table 1. Architecture specifications of MNv4-Conv-S.
[0104]
[0105] Table 2. Architecture specifications of MNv4-Conv-M.
[0106]
[0107] Table 3. Architecture specifications of MNv4-Hybrid-M.
[0108]
[0109] Table 4. Architecture specifications of MNv4-Conv-L.
[0110]
[0111] Table 5. Architecture specifications for MNv4-Hybrid-L.
[0112]
[0113] Table 6. Training hyperparameters used for ImageNet-1k classification.
[0114]
[0115] Table 7. Training hyperparameters used for distillation.
[0116]
[0117] Figure 4 This is a block diagram of an example implementation of a Transformer block that uses a generic inverted bottleneck block to process the attention output of a multi-head attention block as an improved feedforward network.
[0118] In one example, multi-head self-attention (MHSA) can include multiple attention layers (heads) in parallel, which have different linear transformations for queries, keys, values, and outputs.
[0119] Figure 5 This is a block diagram of an example implementation of the Transformer block, which uses a generic inverted bottleneck block to process the attention output of the Multi-Query Attention (MQA) block as an improved feedforward network.
[0120] In one example, MQA can be similar to MHSA, except that different heads share a single set of keys and values. Since the keys and values can be shared across all the different attention “heads,” the size of these tensors, and therefore the memory bandwidth requirements for incremental decoding, can be significantly reduced.
[0121] Figure 6 This is a block diagram illustrating the example implementation of M-MQA or mobile multi-query attention provided in this article. Figure 6 In attention, matrix projection operations have been expressed as 1x1 Conv2d and tensor reshaping. In some implementations, explicitly controlling the reshaping operation (e.g., instead of letting the compiler handle it implicitly) allows for fine-tuning of the low-level operations performed in the projection operation. For example, a particular reshaping operation could include decomposing a large dimension into multiple smaller dimensions to provide increased parallelism, higher processor utilization, lower memory usage, lower latency, and so on.
[0122] For example, the efficiency of a deep learning model running on an accelerator can be highly dependent on the shape of its tensors. Modern accelerator architectures, for instance, can be represented as a collection of parallel execution units and a multi-layered memory hierarchy. Higher efficiency is typically achieved when the shape of the data tiles is aligned with hardware characteristics, including memory banks, memory transaction lengths, and minimum schedulable units (e.g., warp size in a GPU).
[0123] To address efficiency issues at their source, using the 4D tensor shape used in MatMul to represent the model can reduce the compiler's burden. As a concrete example, consider the top portion of the M-MQA block, which corresponds to the matrix projection of the output tensor during attention. This operation can be implemented in three steps: matrix multiplication, reshaping, and convolution. The reshaping operation can significantly impact the performance of subsequent convolutions.
[0124] For example, consider the following execution graph as a baseline for comparison:
[0125]
[0126]
[0127] This reshaping operator can be adapted to decompose one of the dimensions into multiple smaller dimensions to provide increased parallelism across the additional dimension. For example, consider the following adapted execution graph:
[0128]
[0129]
[0130] Compared to the baseline, reshaping the tensor by decomposing the 144-dimensional tensor into two 12-dimensional tensors enables the convolution operator to achieve higher processing utilization (58.83% vs. 19.88%), resulting in faster runtime (11.19 µs vs. 33.11 µs). For example, a flattened tensor ([1][1]
[144]
[512] ) may have limited parallelization, while if the data is spatially reorganized (
[12]
[12]
[512] ), each tile (piece) can be processed in parallel, thus better utilizing the accelerator's capabilities.
[0131] In some implementations, spatial downsampling can be used. Spatial downsampling can be applied to one or more inputs. This can be achieved using depthwise convolution, where the stride parameter is chosen to control the amount of downsampling.
[0132] For example, the query input tensor can be downsampled using a depthwise convolution operator (e.g., a 3x3 with a stride of 2). Similarly, the key input tensor and value input tensor can be downsampled using a depthwise convolution operator (e.g., a 3x3 with a stride of 2). This downsampling can be asymmetric—for example, the key and value tensors can be downsampled while the query tensor remains at full resolution. This asymmetric downsampling can reduce the number of terms in stages with high spatial resolution while maintaining the term count in high-impact processing paths (e.g., the query tensor). In one example, asymmetric downsampling might reduce Top-1 accuracy by only 0.06% compared to no downsampling, while achieving a 3% reduction in MAC, a 23% reduction in CPU time, and a 25% reduction in GPU time (measured on a Samsung S23 using the MNv4-Hybrid-M base model. Downsampling with a stride of 2 was applied in the penultimate 16x16 stage).
[0133] Furthermore, careful control over the ordering of tensor product operations can yield additional improvements. For example, constructing the weight matrix in such a way that tensor shrinking can be performed without transposing the inputs can result in lower latency computations with fewer memory reads / writes. For instance, a tensor product with two inputs can be transformed into matrix multiplication if both the shrinking and non-shrinking indices from each input are adjacent to each other. This is because adjacent indices can be reshaped into a single index at very low cost for running low-level matrix multiplication, and then reshaped back at very low cost. If the indices are not cleanly partitioned into sets of shrinking and non-shrinking indices, transposition operations may be required to bring them into this form for matrix multiplication. Taking advantage of this, the example implementation of the M-MQA block is constructed from the ground up to store the weight matrix in a format specifically adapted for more efficient matrix reshaping, resulting in significant efficiency gains. Furthermore, the output of the tensor product can be requested / queried in a way that avoids unnecessary transposition (e.g., all transposes), such as by maintaining the index order between inputs and outputs.
[0134] In the example below, for the slow implementation, two transposes must be introduced: one for transposing O and one for transposing Po.
[0135] #Slow implementation: requires 2 transposes
[0136] Y = tf.einsum("bhnv,hdv->bnd", O, P_o)
[0137] #Quick implementation: No transposition required
[0138] Y = tf.einsum("bnhv,hvd->bnd", O, P_o)
[0139] In the slow implementation of the following example, the non-shrinking indices h and k from Pq are interleaved with the index n from X. As a result, two transposes are introduced, one used to transpose Pq before matrix multiplication, and another used afterwards to swap the indices in the output tensor.
[0140] #Slow implementation: requires 2 transposes
[0141] Q = tf.einsum("bnd,hdk->bhnk", X, P_q)
[0142] #Quick implementation: No transposition required
[0143] Q = tf.einsum("bnd,dhk->bnhk", X, P_q)
[0144] As an example, one way to implement multi-query attention can be expressed as the following pseudocode:
[0145]
[0146] An example implementation of M-MQA can be represented by the following pseudocode:
[0147]
[0148] Taken together, these improvements can provide significant computational gains relative to the baseline MQA. In some implementations, moving MQA can provide performance improvements relative to Multi-Head Self-Attention (MHSA) and relative to unmodified MQA. Table 8 records the results of a test in which additional attention blocks were added to the final stage of the base model of MNv4-Conv-L. The attention blocks were interleaved with UIB blocks, as shown below. Figure 4 and Figure 5 As shown, the model was trained for 400 epochs using distillation.
[0149] Table 8. Ablation studies of attention blocks.
[0150]
[0151] Figure 7This is a block diagram illustrating an example system for generating multiple training datasets, which can be dynamically mixed based on the output of a teacher model 700 to train a student model. A first dataset 702-1 may include a first plurality of training examples 704-1. Training examples 704-1 can be processed using a first set of augmentation operations 706-1 to generate a first augmented dataset 708-1 containing a first plurality of augmented training examples 710-1. These augmented training examples 710-1 can be input into the teacher model 700 to generate training labels 712-1 corresponding to the augmented training examples 710-1.
[0152] To generate diverse training example corpora, this process can be repeated with different configurations (e.g., different base datasets, different augmentations, etc.). For example, this process can be repeated N times to generate N datasets. For instance, the Nth dataset 702-N may include the Nth training example 704-N. The training example 704-N can be processed using the Nth set of augmentation operations 706-N to generate the Nth augmented dataset 708-N, which contains the Nth augmented training example 710-N. These augmented training examples 710-N can be fed into the teacher model 700 to generate training labels 712-N corresponding to the augmented training examples 710-N. The base dataset 702-N may be the same as or different from the base dataset 702-1.
[0153] In one example, N equals three, resulting in three augmented datasets. In another example, two of the three base datasets are identical. In one example described in the appendix, one base dataset is ImageNet-1K, and one base dataset is JFT-300M.
[0154] In one example, enhancement operations may include: random cropping, where portions of an image are randomly selected and cropped to focus on different regions of the image; rotation, where the image is rotated by random angles within a specified range; flipping, where the image is flipped horizontally or vertically to simulate different orientations; scaling, where the image is resized to different scales to simulate different distances from the object of interest; translation, where the image is shifted horizontally or vertically to simulate off-center positioning; color dithering, which alters the brightness, contrast, saturation, and hue of an image to simulate different lighting conditions; noise injection, where random pixel noise is added to the image to simulate sensor noise or environmental interference; perspective transformation, which distorts the image to simulate different camera angles and viewpoints; and elastic deformation, where the image is locally stretched or compressed to simulate non-rigid transformations. These operations can be applied individually or in combination and can be parameterized to control the intensity and frequency of the enhancement.
[0155] As an example, geometric transformations can alter the spatial arrangement of pixels in an image, effectively simulating changes in camera viewpoint, object orientation, or scene layout. Common geometric transformations include: rotation, where the image is rotated by random angles within a specified range; translation, where the image is shifted horizontally and / or vertically by random numbers of pixels; scaling, where the image is resized to different scale factors to simulate enlargement or reduction; and flipping, where the image is mirrored along a vertical or horizontal axis. More complex geometric transformations might involve shearing, which tilts the image along an axis, or elastic deformation, which applies a localized distortion effect to simulate non-rigid transformations.
[0156] As an example, photometric transformations can modify the visual appearance of an image in terms of color, brightness, contrast, and texture. Examples include brightness adjustment, where the intensity of all pixels is increased or decreased to simulate changes in lighting conditions; contrast adjustment, which alters the difference between the darkest and brightest parts of an image; saturation adjustment, which modifies the intensity of colors; and hue adjustment, which shifts colors along the color spectrum. Noise injection, such as adding Gaussian noise or salt-and-pepper noise, can simulate sensor noise or graininess in an image. Color dithering randomly alters the brightness, contrast, saturation, and hue of an image in a single enhancement step.
[0157] As an example, random erasure or occlusion can introduce information loss by masking random regions in an image. This can simulate occlusion that might occur in real-world scenes, such as an object being partially blocked by another object. The size, shape, and location of the occluded region can be randomly chosen, and the region can be filled with constant values (such as black or gray), random noise, or pixel values sampled from other parts of the image. Cutout enhancement is a specific type of random erasure where square regions can be removed from an image.
[0158] Perspective distortion can alter the apparent perspective of a scene, simulating the effect of photographs taken from different angles or heights. Barrel distortion and pincushion distortion can simulate optical distortions introduced by a camera lens, where the image appears to bulge outwards or contract inwards, respectively.
[0159] Composite composition can involve blending multiple images to create a composite image. This can be done, for example, through alpha blending (where two images are combined with different levels of transparency) or through mixup (where two images and their corresponding labels are linearly combined).
[0160] In some applications, domain-specific enhancements can be used to reflect specific aspects of downstream tasks. For example, in medical imaging, enhancements can include simulating artifacts specific to different imaging modalities or medical devices. In satellite imagery, enhancements can address changes in sunlight angle, cloud cover, or seasonal variations in vegetation.
[0161] Different combinations of enhancement operations can be used for any of the enhancement operations 706-1, ..., 706-N, etc.
[0162] Table 9 reports a set of example datasets. D1 applies InceptionCrop and RandAugument to 500 replicas of ImageNet-1k, with 2 layers and a magnitude of 9. D2 applies InceptionCrop and extreme Mixup to a dataset that is a 1000 replica of ImageNet-1K. D3 applies InceptionCrop and RandAugument to a resampled JFT-300M dataset. This resampled dataset was further resampled to create a new class-balanced dataset with 130,000 images per class, resulting in 130 million images.
[0163] EfficientNet-B0 (trained on ImageNet-1K) was used to select relevant images with a threshold of 0.3. For frequently occurring classes, the top 130,000 samples were selected. For rarely occurring classes, images were randomly selected and duplicated for upsampling. The dataset was duplicated 10 times for distillation.
[0164] Table 9. Distillation dataset created by the EfficientNet L2 instructor.
[0165]
[0166] Training batches can be dynamically mixed. Figure 8 This is a block diagram of an example system for dynamically mixing training inputs from batches used to train a student model. The dynamic batch generator 800 can receive training examples from augmented datasets 708-1, ..., 708-N to generate training input 306. The dynamic batch generator 800 can include examples from different datasets at different scales.
[0167] Batch mixing can occur at inference time. For example, batch generator 800 can generate batches on demand based on a configured proportion or ratio.
[0168] To perform distillation on some example experiments, the images were first enhanced and then compressed using JPEG encoding to create an offline distillation dataset. The images were then decoded, and inference was run using an instructor.
[0169] The teacher's predicted probabilities for 1000 classes (e.g., softmax output) are recorded and used later as soft labels for training students. EfficientNet L2 is used as the teacher model. This teacher model has 480 million parameters and 290 billion MACs. It achieves 87.5% Top-1 accuracy on ImageNet 1k. During student training, all data augmentations except for left-right flipping are disabled. Dropout in the final fully connected layer is also applied as the only regularization method. The cross-entropy between the teacher's soft labels and the student's predicted class probability vectors is used as the training loss. Students are trained using the AdamW optimizer. A cosine learning rate schedule with pre-warming is used.
[0170] Table 10. Distillation results using MNv4-Conv-L as students
[0171]
[0172] As shown in Table 10, the distillation results obtained using D1 are inferior to those using D2—83.8% vs. 84.1%. However, when D1 and D2 are dynamically mixed during student training, the performance improves to 84.4% (+0.3%). Training with dynamically mixed datasets outperforms training with the best single dataset. For example, the higher training accuracy for students using only D1 suggests that this set produces poor performance because the augmented images are too easy for students. However, since D1 contains a very different set of augmented images, combining it with images from D2 may help to expand the overall volume of the augmented image space, potentially leading to better results than using either dataset alone.
[0173] In one implementation of the full distillation scheme (shown in the last row of Table 3), datasets D1, D2, and D3 are dynamically mixed in training batches at a ratio of 1:1:2. Using this distillation scheme, MNv4-Conv-L achieved a Top-1 accuracy of 84.9% on ImageNet-1k with 400 training epochs. With 2000 training epochs, the Top-1 accuracy improved by another 1% to 85.9%. This student model has only 31 million parameters and 6 billion MACs, making it 1 / 15th the parameter size and 1 / 48th the MAC size of the teacher model. Despite this, it still achieved a Top-1 accuracy only 1.6% lower than the teacher model, demonstrating the effectiveness of the distillation method. In addition to the significant improvement in model accuracy, other benefits of training with distillation were observed. For example, distillation training was found to be 2.5 times faster than training on ImageNet-1k. With a batch size of 16,000 and 400 training rounds, distillation training on MNv4-Conv-Large took only 2.3 hours on 128 TPU v5s.
[0174] Further testing was conducted to evaluate the improvements that the distillation techniques described in this paper make to the existing architecture.
[0175] Table 11. Retraining Results – Various MobileNet versions, including Top-1 accuracy results originally reported in the literature, Top-1 accuracy results from the improved training scheme disclosed in this paper, and Top-1 accuracy results trained with more resources than ImageNet-1k alone (e.g., distillation and / or pre-training on JFT).
[0176]
[0177] Table 12. Top-1 accuracy comparison across training methods: This table compares baseline ImageNet-1k training, state-of-the-art distillation, and our distillation.
[0178]
[0179] The "Patient Teacher" method, proposed by Lucas Beyer, Xiaohua Zhai, Amélie Royer, Larisa Markeeva, Rohan Anil, and Alexander Kolesnikov, is discussed in "Knowledge Distillation: A Good Teacher Is Patient and Consistent," published in *Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition*, pp. 10925–10934, 2022.
[0180] Example Results
[0181] Example implementations of the searched models were evaluated on the ImageNet-1K dataset. Top-1 accuracy is reported for the validation split of the dataset. "Top-1 Open" is also reported, referring to ImageNet-1K results without restricting the training data. This includes models trained via distillation and on supplementary data outside the ImageNet-1K training set, which has been deduplicated for the ImageNet validation split. In the ImageNet-only setting, the models were trained for 500 epochs. In the Open setting, the models were trained for 2000 epochs using the distilled dataset. Furthermore, the largest model, MNv4-Hybrid-L, was pre-trained with JFT-300M prior to distillation. For fair comparison, MobileNet V1, V2, and V3 were retrained using the same ImageNet-only training scheme. These results are provided in Table 13.
[0182] Extended results are provided in Table 14. For these results, the latency analysis includes representative mobile hardware choices, including ARM Cortex CPU (Pixel 6, Samsung S23), Qualcomm Hexagon DSP (Pixel 4), ARM Mali GPU (Pixel 7), Qualcomm Snapdragon (S23 GPU), Apple Neural Engine, and Google EdgeTPU.
[0183] The effectiveness of the MNv4 backbone network for object detection was evaluated on the COCO 17 dataset. An M-sized MNv4 backbone network was compared with state-of-the-art (SOTA) efficient backbone networks with a similar number of Madds. For each backbone network, an object detector was built using the RetinaNet framework. A 256-dimensional FPN decoder was attached to the P3-P7 endpoints, along with a 256-dimensional prediction head consisting of four convolutional layers. Depthwise separable convolutions, as is common practice in motion detectors, were employed to reduce the computational complexity of both the FPN decoder and the bounding box prediction head. All models were trained for 600 epochs on the COCO17 training set. All images were resized to 384 pixels and augmented using random horizontal flipping, random scaling, and Randaug. Crop and rotation augmentations from Randaug were excluded because these deformations were found to degrade the detection AP for small objects. Training was performed using a batch size of 2048, Adam, and L2 weight decay of 0.00003. A cosine learning rate schedule with 24 warm-up epochs was used, and the learning rate for each model was individually tuned. For all baselines, the filter multipliers were set to make the MACs roughly comparable. Following the classification experiments, the MobileNetV4 backbone was trained with a random dropout rate of 0.2. All MobileNet baselines were trained using the official Tensorflow Model Garden implementation. EfficientFormer was reimplemented in Tensorflow.
[0184] A consistent benchmarking strategy was used across various mobile platforms, except for Apple Neural Engine. For efficiency, models were converted to TensorFlow Lite format and quantized to INT8 for mobile CPUs, Hexagon, and EdgeTPUs, and FP16 for mobile GPUs. Each model was run approximately 1000 times, and the average latency of all runs was captured. This process was repeated 5 times for each model, and the median of those averages was reported.
[0185] CPU affinity was set to the fastest core, and CPU evaluation was performed using the XNNPACK backend.
[0186] For benchmarking on Apple Neural Engine (analyzed on iPhone 13 using iOS 16.6.1, CoreMLTools 7.1, and Xcode 15.0.1), the PyTorch model was converted to CoreML's MLProgram format with Float16 precision and a float16 MultiArray input to minimize input duplication.
[0187] The experimental results are reported in Table 15. Parameters, MAC, and benchmarks were calculated using the entire detector at an input resolution of 384 pixels.
[0188] Table 13. ImageNet-1K classification results. Median latency is reported. †=GeLu, otherwise ReLU is used. The instruction uses additional data. Indicates additional pre-training using JFT.
[0189]
[0190] Table 14. Extended classification results on ImageNet-1K. Median latency is reported. A hyphen indicates that the model was not benchmarked due to a lack of corresponding model files for the platform. "Failed" indicates that the platform does not support the model.
[0191]
[0192] Table 15. Object detection results on the COCO-17 Val. set. Width multiplier reports are shown alongside the magnified MobileNet backbone.
[0193]
[0194] Figure 9 Further example results implemented by the example implementation of this disclosure are plotted. One example implementation of this disclosure is labeled "MobileNetV4" in this graph.
[0195] Example Method
[0196] Figure 10 A flowchart is depicted for a method 1000 for efficiently processing spatial features in an input data array using an inverted bottleneck block with two-stage mixing. One or more portions of the example method 1000 can be implemented by a computing system including one or more computing devices, such as, for example, the computing system described with reference to other figures. Each corresponding portion of the example method 1000 can be executed by any one (or any combination) of one or more computing devices. Furthermore, one or more portions of the example method 1000 can be implemented on hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 10 For illustrative and discussion purposes, the elements of the implementation are depicted in a specific order. Those skilled in the art will understand using the disclosure provided herein that the elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 10The elements / terms described with reference to other systems and figures are for illustrative purposes only and are not intended to be limiting. One or more parts of the example method 1000 may be additionally or alternatively performed by other systems.
[0197] In 1002, example method 1000 may include: receiving an input state (e.g., input state 102) of a neural network having a first channel depth at the input of the inverted bottleneck block of the two-mixed circuit.
[0198] In 1004, example method 1000 may include: convolving the input state using a first depth convolutional layer with a double-blended inverted bottleneck block to obtain a spatially blended input state (e.g., spatially blended input state 104).
[0199] In 1006, example method 1000 may include: using an upprojection pointwise convolutional layer of the inverted bottleneck block that has been blended twice to expand the spatially blended input state to generate an expanded state with a second channel depth greater than the first channel depth (e.g., expanded state 106).
[0200] In 1008, example method 1000 may include: convolving the extended state using a second depth convolutional layer of an inverted bottleneck block that has been mixed twice to obtain a spatially mixed extended state (e.g., spatially mixed extended state 108).
[0201] In 1010, example method 1000 may include: projecting the spatially blended extended state onto a pointwise convolutional layer with a downprojection of the inverted bottleneck block that has been blended twice, to obtain a projected state with a third channel depth that is less than the second channel depth (e.g., state 110).
[0202] In 1012, example method 1000 may include: using the projected state, performing a prediction task with the neural network. For example, in one implementation, the input state represents image data, and the prediction task includes an image processing task. Example prediction tasks may include any one or more of the tasks or outputs described herein with respect to machine learning model 1 or 4.
[0203] In some implementations of example method 1000, the neural network includes multiple instances of two mixed inverted bottleneck blocks arranged in a sequential order.
[0204] In some implementations of example method 1000, the first depthwise convolutional layer includes a first kernel size. In some implementations of example method 1000, the second depthwise convolutional layer includes a second kernel size, wherein the first kernel size is different from the second kernel size.
[0205] In some implementations of example method 1000, the first depthwise convolutional layer includes a first kernel size. In some implementations of example method 1000, the second depthwise convolutional layer includes a second kernel size, wherein the first kernel size is equal to the second kernel size.
[0206] In some implementations of example method 1000, the neural network may include inverted bottleneck blocks (e.g., single-mix blocks) with different configurations. In some implementations of example method 1000, processing the output of an inverted residual block that performs two mixtures can be done using an inverted residual bottleneck block that performs spatial mixing in a single mixture in an extended state.
[0207] In some implementations of Example Method 1000, the neural network uses a single-mixed inverted residual bottleneck block to process the output of a double-mixed inverted residual block. In some implementations, Example Method 1000 includes receiving a downstream input state with a fourth channel depth at the input of the single-mixed inverted bottleneck block. In some implementations, Example Method 1000 includes expanding the downstream input state using an up-projection pointwise convolutional layer of the single-mixed inverted bottleneck block to generate a downstream expanded state with a fifth channel depth greater than the fourth channel depth. In some implementations, Example Method 1000 includes convolving the downstream expanded state using a first and only depth convolutional layer of the single-mixed inverted bottleneck block to obtain a spatially mixed downstream expanded state. In some implementations, Example Method 1000 includes projecting the spatially mixed downstream expanded state using a down-projection pointwise convolutional layer of the single-mixed inverted bottleneck block to obtain a downstream projected state with a sixth channel depth less than the fifth channel depth.
[0208] In some implementations of Example Method 1000, the neural network uses a single-mixed inverted residual bottleneck block to process the output of a double-mixed inverted residual block. In some implementations, Example Method 1000 includes receiving a downstream input state with a fourth channel depth at the input of the single-mixed inverted bottleneck block. In some implementations, Example Method 1000 includes convolving the downstream input state using a first and only depthwise convolutional layer of the single-mixed inverted bottleneck block to obtain a spatially mixed downstream input state. In some implementations, Example Method 1000 includes expanding the spatially mixed downstream input state using an up-projection pointwise convolutional layer of the single-mixed inverted bottleneck block to generate a downstream expanded state with a fifth channel depth greater than the fourth channel depth. In some implementations, Example Method 1000 includes projecting the downstream expanded state using a down-projection pointwise convolutional layer of the single-mixed inverted bottleneck block to obtain a downstream projected state with a sixth channel depth less than the fifth channel depth.
[0209] In some implementations of example method 1000, the neural network includes a Transformer (e.g., a Transformer encoder, a Transformer block), and the inverted bottleneck block, which is a two-stage hybrid, processes the downstream output of the attention block. For example, Figure 4 and Figure 5 An example of such a configuration is shown.
[0210] In some implementations of example method 1000, the neural network includes a Transformer encoder, and the inverted bottleneck block of the two-stage mixing processes the downstream output of the multi-query attention block. For example, Figure 5 An example of such a configuration is shown.
[0211] In some implementations of example method 1000, the neural network includes a Transformer encoder, and the inverted bottleneck block of the two-stage mixing processes the downstream output of the moving multi-query attention block. For example, Figure 6 An example of such a configuration is shown. In some implementations of example method 1000, the moving multi-query attention block implements the processing techniques further described with respect to example methods 1200 and 1300.
[0212] In some implementations of example method 1000, the neural network includes at least one attention block that implements multi-query attention on the input to generate an array of attention values for generating the output. For example, the output of the attention block may correspond to an updated version of the input. For example, one or more positions in the input tensor X may be updated based on a combination of values corresponding to positions in M, these values being combined with appropriate amounts corresponding to the attention weights applied to those positions.
[0213] In some implementations of example method 1000, the neural network uses at least one attention block to process the output of the inverted residual block, which is mixed twice. This at least one attention block implements multi-query attention on the input to generate an array of attention values for generating the output. For example, the output of the attention block may correspond to an updated version of the input. For example, one or more positions in the input tensor X may be updated based on a combination of values corresponding to positions in M, which are combined with appropriate amounts corresponding to the attention weights applied to those positions.
[0214] In some implementations of example method 1000, at least one attention block projects the input to a projection dimension of at least 48. In some implementations of example method 1000, at least one attention block projects the input to a projection dimension of at least 64.
[0215] In some implementations of example method 1000, at least one dimension of the state is decomposed into two smaller dimensions for use as input to the convolution operator.
[0216] In some implementations of example method 1000, the neural network implementing this block is the search result of example method 1100.
[0217] Figure 11 A flowchart depicts a method 1100 for performing efficient neural network architecture search. One or more portions of the example method 1100 may be combined with or independent of any one or more example methods described above. One or more portions of the example method 1100 may be implemented by a computing system comprising one or more computing devices, such as, for example, the computing system described with reference to other figures. Each corresponding portion of the example method 1100 may be executed by any device (or any combination thereof) of the one or more computing devices. Furthermore, one or more portions of the example method 1100 may be implemented on hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 11 For illustrative and discussion purposes, the elements of the implementation are depicted in a specific order. Those skilled in the art will understand using the disclosure provided herein that the elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 11 The elements / terms described with reference to other systems and figures are for illustrative purposes only and are not intended to be limiting. One or more parts of example method 1100 may be additionally or alternatively performed by other systems.
[0218] In 1102, example method 1100 may include: initializing a search space comprising multiple configurations including a generic inverted bottleneck block. For example, search system 300 may initialize this search space. This search space may be as described herein... Figure 2A and Figure 2B Defined as described.
[0219] For example, the general bottleneck block may include a first placeholder for a depthwise convolutional layer, which is discretely activated during the search using a first parameter (e.g., parameter 202). The general bottleneck block may include an upprojective pointwise convolutional layer that follows the first placeholder and expands the channel depth of the network's internal state (e.g., state 104) to an expanded state (e.g., state 106). The general bottleneck block may include a second placeholder for a depthwise convolutional layer, which is discretely activated during the search using a second parameter (e.g., parameter 204) and follows the expanded pointwise convolutional layer. The general bottleneck block may include a downprojective pointwise convolutional layer that follows the second placeholder and reduces the channel depth of the network's internal state from the expanded state to a projected state (e.g., state 110). In one example, if not activated by the first or second parameter, the placeholder may perform a unit transformation or pass-through.
[0220] In 1104, example method 1100 may include: constructing a plurality of candidate models, wherein constructing the plurality of candidate models includes, for each of the plurality of candidate models: for each corresponding network block among a plurality of network blocks of a neural network architecture, selecting a corresponding value of the first parameter (e.g., parameter 202) and a corresponding value of the second parameter (e.g., parameter 204) to instantiate a corresponding inverted bottleneck block at that corresponding network block. For example, search system 300 may use a search strategy to select (e.g., sampled values based on the strategy) values for selectable parameters 202, 204, 206, etc., to configure the blocks of the candidate architecture using a general inverted bottleneck block framework.
[0221] In 1106, example method 1100 may include: training the plurality of candidate models on a training dataset. The training dataset may include labeled training examples. The training dataset may include a distillation dataset as described herein. The training dataset may be configured as described in further detail with respect to example method 1400.
[0222] In 1108, example method 1100 may include: evaluating the performance of the multiple candidate models. For example, search system 300 may calculate a loss or evaluate other evaluation metrics to characterize the performance of the candidates.
[0223] In 1110, example method 1100 may include: a candidate model selected based on the evaluation output.
[0224] In some implementations of example method 1100, the neural network architecture is configured for image processing tasks such as image classification or image segmentation, multimodal tasks such as image and audio processing tasks or image and text processing tasks.
[0225] In some implementations of example method 1100, the evaluation includes determining the prediction quality of the plurality of candidate models on the prediction task.
[0226] In some implementations of example method 1100, the evaluation includes determining a first latency for the execution of the plurality of candidate models on a first hardware configuration. In some implementations of example method 1100, the evaluation includes determining a second latency for the execution of the plurality of candidate models on a second hardware configuration.
[0227] In some implementations of example method 1100, the latency search can be extended to any number of latencies. The latency cost value can be taken as the geometric mean of these numbers of latencies. Other metrics can be used as proxies for latency, such as counting the total number of FLOPs. These proxies can be used alone or in combination with estimated or actual latency metrics.
[0228] In some implementations of example method 1100, the search strategy may be learned using a reward value calculated using a predicted quality term. This predicted quality term may be reduced using a first delay deviation term, which indicates a measure of deviation of the first delay from a first delay target (e.g., a magnitude of the difference between a unit value and the ratio of test time to target time). This predicted quality term may be reduced using a second delay deviation term, which indicates a measure of deviation of the second delay from a second delay target.
[0229] In some implementations, example method 1100 includes: using a strategy learned based on previous evaluations of the performance of the plurality of candidate models, probabilistically sampling the corresponding values of the first parameter and the corresponding values of the second parameter.
[0230] In some implementations of example method 1100, the policy is learned using a reward value calculated using a prediction quality term that is reduced by a delay deviation term, which indicates the deviation of the first delay or the second delay from the delay target.
[0231] In some implementations of example method 1100, the policy is learned using a reward value calculated using a prediction quality term with a reduced first delay deviation, which indicates the deviation of the first delay from a first delay target. In some implementations of example method 1100, the policy is learned using a reward value calculated using a prediction quality term with a reduced second delay deviation, which indicates the deviation of the second delay from a second delay target.
[0232] In some implementations of example method 1100, determining the first delay includes estimating the execution time on the first processor, and determining the second delay includes estimating the execution time on a second different processor.
[0233] In some implementations of example method 1100, different latency targets for different hardware can lead to search results for architectures that perform well on a wide range of hardware.
[0234] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) of less than 5 watts, and the second processor is a different processor with a TDP of less than 5 watts.
[0235] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) of less than 5 watts, and the second processor is a different processor with a TDP of greater than 5 watts.
[0236] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) of less than 5 watts, and the second processor is a different processor with a TDP of greater than 5 watts and less than 50 watts.
[0237] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) greater than 5 watts and less than 10 watts, and the second processor is a different processor with a TDP greater than 5 watts and less than 10 watts.
[0238] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) of less than 10 watts, and the second processor is a different processor with a TDP of greater than 10 watts.
[0239] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) of less than 10 watts, and the second processor is a different processor with a TDP of greater than 10 watts and less than 50 watts.
[0240] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) of less than 50 watts, and the second processor is a different processor with a TDP of less than 50 watts.
[0241] In some implementations of example method 1100, the first processor is a processor with a thermal design power (TDP) greater than 50 watts, and the second processor is a different processor with a TDP greater than 50 watts.
[0242] In some implementations of example method 1100, the first processor or the second processor is an accelerator device specifically adapted for parallelizing matrix multiplication and designed to work in conjunction with the central processing unit (CPU) of a computing system.
[0243] In some implementations of example method 1100, the latency target is less than 20 ms, such as less than 15 ms, such as less than 10 ms, such as less than 5 ms, such as less than 3 ms, such as less than 2 ms, such as less than 1 ms.
[0244] In some implementations of example method 1100, for an instance of a given network block across the multiple candidate models: a first shared parameter set is used for the corresponding up-projection pointwise convolutional layer; and a second shared parameter set is used for the corresponding down-projection pointwise convolutional layer.
[0245] In some implementations of example method 1100, for instances of all network blocks across the multiple candidate models: a first shared parameter set is used for the corresponding up-projection pointwise convolutional layer; and a second shared parameter set is used for the corresponding down-projection pointwise convolutional layer.
[0246] In some implementations of example method 1100, the multiple candidate models share more than 95% of the learnable network parameters.
[0247] In some implementations of example method 1100, the search space includes an attention block that implements multi-query attention on the input to generate an array of attention values for producing the output. For example, the output of the attention block may correspond to an updated version of the input. For example, one or more positions in the input tensor X may be updated based on a combination of values corresponding to positions in M, these values being combined with appropriate amounts corresponding to the attention weights applied to those positions.
[0248] Figure 12 A flowchart depicts a method 1200 for efficiently computing multi-query attention in a machine learning-based sequence processing model. One or more portions of the example method 1200 may be combined with or independent of any one or more example methods described above. One or more portions of the example method 1200 may be implemented by a computing system including one or more computing devices, such as, for example, the computing system described with reference to other figures. Each corresponding portion of the example method 1200 may be performed by any one (or any combination of) of one or more computing devices. Furthermore, one or more portions of the example method 1200 may be implemented on hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 12For illustrative and discussion purposes, the elements are depicted in a specific order. Those skilled in the art will understand using the disclosure provided herein that the elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 12 The description is for illustrative purposes only and with reference to elements / terms described with respect to other systems and diagrams, and is not intended to be limiting. One or more portions of example method 1200 may be additionally or alternatively performed by other systems.
[0249] In 1202, example method 1200 may include obtaining a current input tensor representing an input sequence of one or more elements. For example, the input tensor X may represent N elements, each corresponding to a d-dimensional embedding representation.
[0250] In 1204, example method 1200 may include: computing attention values on the current input tensor using one or more tensor contractions. As an example, attention can be performed between X and tensor M. M may represent M elements, each corresponding to a d-dimensional embedding representation. In self-attention, attention can be performed between X and itself.
[0251] In some implementations of example method 1200, at least a portion of the respective tensor shrinkage in the one or more tensor shrinkages includes an output tensor having non-shrinkage indices inherited from a first tensor and from a second tensor. The non-shrinkage indices inherited from the first tensor may be consecutive and ordered in the first tensor, and the non-shrinkage indices inherited from the second tensor may be consecutive and ordered in the second tensor.
[0252] For example, in tensor contraction
[0253] Q = tf.einsum("bnd,dhk->bnhk", X, P_q)
[0254] In the input tensor X, the non-shrinking indices b and n can be constructed such that they are continuous and ordered in the desired output Q (which has dimensions bnhk). Similarly, the projective tensor P_q can be constructed such that the non-shrinking indices h and k are continuous and ordered in the desired output Q.
[0255] In 1206, example method 1200 may include generating the output of the machine learning-based sequence processing model based on the attention value. Example outputs are described in this paper with respect to machine learning models 1 and 4.
[0256] In some implementations of example method 1200, the portion of a corresponding tensor shrinkage among the plurality of tensor shrinkages includes all tensor shrinkages among the plurality of tensor shrinkages. For example, all tensor shrinkages can be optimized according to example method 1200 to avoid unnecessary transposes that may cause unnecessary memory read costs.
[0257] In some implementations of example method 1200, the non-shrink index used for the first tensor is the adjacent index of the first tensor. In some implementations of example method 1200, the non-shrink index used for the second tensor is the adjacent index of the second tensor.
[0258] In some implementations, example method 1200 includes: reshaping the first tensor into a first matrix by transforming adjacent indices of the first tensor into individual indices without transposing it. In some implementations, example method 1200 includes: reshaping the second tensor into a second matrix by transforming adjacent indices of the second tensor into individual indices without transposing it.
[0259] In some implementations, example method 1200 includes: reshaping at least one dimension of a tensor into at least two smaller dimensions for performing a convolution operation.
[0260] Figure 13 A flowchart depicts a method 1300 for efficiently computing multi-query attention in a machine learning-based sequence processing model. One or more portions of the example method 1300 may be combined with or independent of any one or more example methods described above. One or more portions of the example method 1300 may be implemented by a computing system including one or more computing devices, such as, for example, the computing system described with reference to other figures. Each corresponding portion of the example method 1300 may be performed by any one (or any combination of) one or more computing devices. Furthermore, one or more portions of the example method 1300 may be implemented on hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 13 For illustrative and discussion purposes, the elements are depicted in a specific order. Those skilled in the art will understand using the disclosure provided herein that the elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 13 The descriptions of other systems and the elements / terms described in the diagrams are for illustrative purposes only and are not intended to be limiting. One or more portions of example method 1300 may be additionally or alternatively performed by other systems.
[0261] In 1302, example method 1300 includes: obtaining an input tensor representing at least one input sequence of one or more elements, the input tensor having a sequence length dimension and an embedding dimension. For example, the input tensor X may represent N elements, each corresponding to a d-dimensional embedding representation. For example, in einsum notation, X may correspond to an index bnd, which corresponds to the batch, sequence length, and embedding dimension, respectively. In some cases, the batch dimension may be unary, although multiple inputs may be batched.
[0262] In 1304, example method 1300 includes: obtaining a query projection tensor configured to generate a projection of the input tensor using multiple learned weights, the query projection tensor having a query head dimension, an embedding dimension, and a projection dimension, wherein adjacent indices of the query projection tensor correspond to the query head dimension and the projection dimension, respectively. For example, the query projection tensor P_q may have indices dhk corresponding to the embedding dimension, the head dimension, and the projection dimension.
[0263] In 1306, example method 1300 includes: shrinking the input tensor and the query projection tensor in the embedding dimension.
[0264] Shrinking the input tensor and the query projection tensor in this embedding dimension can be done as follows: In 1306-1, the query projection tensor is reshaped into a query matrix by combining the query header dimension and the projection dimension into a single dimension. For example, the query matrix can be represented by the non-shrinking index hk of the query projection tensor.
[0265] Shrinking the input tensor and the query projection tensor in this embedding dimension can be done as follows: in 1306-2, an input matrix including at least a portion of the input tensor is obtained.
[0266] Shrinking the input tensor and the query projection tensor in this embedding dimension can be done by multiplying the input matrix with the query matrix in 1306-3 to obtain the output.
[0267] Shrinking the input tensor and the query projection tensor in this embedding dimension can be performed as follows: In 1306-4, the output is reshaped into a query tensor with a query head dimension, a sequence length dimension, and a projection dimension, where the adjacent indices of the query tensor correspond to the query head dimension and the projection dimension, respectively. For example, a query tensor Q represented by the index bnhk can be generated, where h and k are adjacent.
[0268] In 1308, example method 1300 includes: computing attention values on the at least one input sequence using the query tensor. For example, attention values may include self-attention values that map the correlations between elements in the sequence represented by X and other elements in X. Attention values may also be cross-attention values that map the correlations between elements in X and elements in another sequence (such as M).
[0269] In some implementations of example method 1300, attention values can be used to perform prediction tasks. This paper describes example prediction tasks with respect to machine learning models 1 and 4.
[0270] For example, the output of an attention block can correspond to an updated version of the input. For instance, one or more positions in the input tensor X can be updated based on a combination of values corresponding to positions in M, with corresponding amounts applied to those attention weights. This updated version of X can be provided to downstream network components, such as a classification head, a language decoder, etc. In some implementations, the classification term positions in X are updated one or more times during the passage through the attention block, and these classification term values are used as input to downstream network components.
[0271] In some implementations of example method 1300, the shrinking of the input tensor and the query projection tensor is performed without transposing any part of the query projection tensor or any part of the query tensor.
[0272] In some implementations of example method 1300, the shrinking of the input tensor and the query projection tensor is performed without generating an intermediate array in memory. For example, data copying can be avoided, where reshaping uses only the changed mapping to memory addresses.
[0273] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes: obtaining an input tensor representing the input sequence of one or more elements, the input tensor having a sequence length dimension and an embedding dimension. For example, the input tensor X could represent N elements, each corresponding to a d-dimensional embedding representation. For example, in einsum notation, X could correspond to the index bnd, which corresponds to the batch, sequence length, and embedding dimension, respectively. In some cases, the batch dimension can be unary, although multiple inputs can be batched.
[0274] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes: obtaining a key projection tensor configured to generate a projection of the input tensor using multiple learned weights, the key projection tensor having an embedding dimension and a projection dimension. For example, the key projection tensor can be expressed as P_k using an einsum index dk.
[0275] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes shrinking the input tensor and the key projection tensor in the embedding dimension to obtain the key tensor. For example, the key tensor can be expressed as K using the einsum index bmk.
[0276] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes: obtaining a value projection tensor configured to generate a projection of the input tensor using multiple learned weights, the value projection tensor having an embedding dimension and a projection dimension. For example, the value projection tensor can be expressed as P_v using an einsum index dv.
[0277] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes shrinking the input tensor and the value projection tensor in the embedding dimension to obtain a value tensor. For example, the value tensor can be expressed as V using the einsum index bmv.
[0278] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes shrinking the query tensor and the key tensor along the projection dimension to obtain the logit tensor. For example, the logit tensor can be expressed as L using the einsum index bnhm.
[0279] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes applying a softmax operation to the logit tensor to obtain a weight tensor. For example, the weight tensor can be expressed as W using the einsum index bnhm. This weight tensor can represent the attention weights for a specific position in M from the perspective of a specific position in X.
[0280] In some implementations of example method 1300, using the query tensor to perform attention processing on the at least one input sequence involves obtaining an output tensor by shrinking the weight tensor and the value tensor along the sequence length dimension. For example, the output tensor can be expressed as O using the einsum index bnhv.
[0281] In some implementations of example method 1300, performing attention processing on the at least one input sequence using the query tensor includes: obtaining an updated tensor for the input sequence, and reprojecting the output tensor from the projection dimension to the embedding dimension using an output projection tensor. For example, each position in X is updated based on a value corresponding to a position in M, the amount of which corresponds to the attention weight applied to that position. This updated tensor can be represented as Y using the index bnd.
[0282] In some implementations, example method 1300 includes shrinking the output tensor and the output projection tensor along the projection dimension. In some implementations of example method 1300, the non-shrinkage indices of the output tensor are adjacent, and the non-shrinkage indices of the output projection tensor are adjacent.
[0283] In some implementations, example method 1300 includes: reshaping at least one dimension of a tensor into at least two smaller dimensions for performing a convolution operation.
[0284] In some implementations, example method 1300 includes: reshaping at least one dimension of the output tensor into at least two smaller dimensions, wherein the output projection tensor is defined to have at least two corresponding decomposition dimensions.
[0285] In some implementations of example method 1300, the output tensor is reshaped into a four-dimensional tensor, and the output projection tensor is defined as a four-dimensional tensor.
[0286] In some implementations, example method 1300 includes: computing the query tensor using the downsampled input state.
[0287] In some implementations, example method 1300 includes: computing the query tensor using a downsampled input state obtained by using a depthwise convolution with a first step amplitude parameter.
[0288] In some implementations, example method 1300 includes: computing the key tensor, the value tensor, or both using the downsampled input state.
[0289] In some implementations, example method 1300 includes: computing the key tensor, the value tensor, or both using a downsampled input state obtained by using a depthwise convolution with a second stride parameter.
[0290] In some implementations, example method 1300 includes: computing the query tensor using a first downsampled input state obtained by a depthwise convolution with a first stride parameter; and computing the key tensor, the value tensor, or both using a second downsampled input state obtained by a depthwise convolution with a second stride parameter. In some implementations of example method 1300, the first stride parameter may be different from the second stride parameter, or the first stride parameter may be equal to the second stride parameter.
[0291] Figure 14 A flowchart depicts a method 1400 for improving the training efficiency of a machine learning-based image processing model. One or more portions of the example method 1400 may be combined with or independent of any one or more example methods described above. One or more portions of the example method 1400 may be implemented by a computing system comprising one or more computing devices, such as, for example, the computing system described with reference to other figures. Each corresponding portion of the example method 1400 may be performed by any device (or any combination thereof) of the one or more computing devices. Furthermore, one or more portions of the example method 1400 may be implemented on hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 14 For illustrative and discussion purposes, the elements of the implementation are depicted in a specific order. Those skilled in the art will understand using the disclosure provided herein that the elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 14 The elements / terms described with reference to other systems and figures are for illustrative purposes only and are not intended to be limiting. One or more parts of example method 1400 may be additionally or alternatively performed by other systems.
[0292] At 1402, example method 1400 may include: obtaining a distillation dataset comprising multiple training examples labeled by a teacher model, wherein the multiple training examples comprise: a first set of multiple training examples generated using a first set of augmentation routines; and a second set of multiple training examples generated using a second set of augmentation routines different from the first set of augmentation routines.
[0293] In 1404, example method 1400 may include: generating training batches for training a student model by combining one or more of the first plurality of training examples and one or more of the second plurality of training examples.
[0294] In 1406, example method 1400 may include: using the student model to process the training batch in batches to obtain a batch of output.
[0295] In 1408, example method 1400 may include: evaluating the batch output using the corresponding labels generated by the teacher model for the training batch.
[0296] In 1410, example method 1400 may include updating one or more learnable parameters of the student model based on the evaluation.
[0297] In some implementations of example method 1400, the student model is implemented as a supernet through neural network architecture search, wherein the supernet includes multiple different computational paths corresponding to subnets representing different candidate neural network architectures.
[0298] In some implementations of example method 1400, the first set of enhancement routines and the second set of enhancement routines share a common enhancement routine.
[0299] In some implementations of example method 1400, this public enhancement routine implements random pruning.
[0300] In some implementations of example method 1400, the distortion caused by the first set of enhancement routines is less than the distortion caused by the second set of enhancement routines.
[0301] In some implementations of example method 1400, the plurality of training examples includes: a third plurality of training examples generated using a third set of augmentation routines, which are applied to a different base dataset than the base dataset used for the first plurality of training examples or the second plurality of training examples.
[0302] In some implementations of example method 1400, the third plurality of training examples are class-balanced by classifying the individual training examples using a labeling network.
[0303] In some implementations of example method 1400, the third plurality of training examples are class-balanced by classifying the individual training examples using a labeling network, wherein the third plurality of training examples includes an equal number of class samples for each class. In some implementations of example method 1400, for the first class, the equal number of class samples is less than the total number of training examples in that first class in the base dataset. In some implementations of example method 1400, for the second class, the equal number of class samples is greater than the total number of training examples in that second class in the base dataset, the total number of training examples in the second class being supplemented by replicating random training examples in the second class to achieve the equal number of class samples.
[0304] In some implementations of example method 1400, generating the training batch includes combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples.
[0305] In some implementations of example method 1400, generating the training batch includes combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples in equal proportions.
[0306] In some implementations of example method 1400, generating the training batch includes combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples. In some implementations of example method 1400, the batch includes more training examples in the third plurality of training examples than any one of the first plurality of training examples or the second plurality of training examples.
[0307] In some implementations of example method 1400, generating the training batch includes combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples. In some implementations of example method 1400, the number of the third plurality of training examples included in the batch is at least equal to the number of combinations of the first plurality of training examples and the second plurality of training examples.
[0308] In some implementations of example method 1400, generating the training batch includes combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples in a ratio of 1:1:2.
[0309] Figure 15 A flowchart is depicted for a method 1500 for training one or more machine learning-based models according to various aspects of this disclosure. For example, the example machine learning-based models may include machine learning model 100, teacher model 700, etc.
[0310] One or more portions of Example Method 1500 may be implemented by a computing system including one or more computing devices, such as, for example, the computing system described with reference to other figures. Each corresponding portion of Example Method 1500 may be performed by any one (or any combination) of one or more computing devices. Furthermore, one or more portions of Example Method 1500 may be implemented on hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 15For illustrative and discussion purposes, the elements are depicted in a specific order. Those skilled in the art will understand using the disclosure provided herein that the elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 15 The descriptions of other systems and the elements / terms described in the diagrams are for illustrative purposes and are not intended to be limiting. One or more parts of example method 1500 may be additionally or alternatively performed by other systems.
[0311] At 1502, example method 1500 may include obtaining training instances. The training dataset may include multiple training instances partitioned across multiple datasets (e.g., training datasets, validation datasets, or test datasets). Training instances may be labeled or unlabeled. Although referred to as "training" instances in example method 1500, it should be understood that runtime inference may form training instances when a model is trained (e.g., online training / learning) using an evaluation of the model's performance on that runtime instance. Example data types for training instances and various tasks associated with them are described throughout this disclosure.
[0312] At 1504, example method 1500 may include using one or more machine learning-based models to process training instances to generate output. The output may be obtained directly from one or more machine learning-based models, or it may be a downstream result of a processing operation chain that includes the output of one or more machine learning-based models.
[0313] At 1506, example method 1500 may include receiving an evaluation signal associated with the output. The evaluation signal can be obtained using a loss function. Various losses can be used, such as mean squared error, likelihood loss, cross-entropy loss, hinge loss, contrastive loss, or various other loss functions. The evaluation signal can be computed using known ground truth labels (e.g., supervised learning), predicted or estimated labels (e.g., semi-supervised or self-supervised learning), or in the absence of labels (e.g., unsupervised learning). The evaluation signal can be a reward (e.g., for reinforcement learning). The reward can be computed using a machine learning-based reward model configured to generate a reward based on the received output. The reward can also be computed using feedback data describing human feedback to the output.
[0314] At 1508, example method 1500 may include using an evaluation signal to update a machine learning-based model. For example, in some embodiments, various training or learning techniques (such as, for example, backpropagation) may be used to learn the values of the parameters of the machine learning-based model. For example, the evaluation signal may be backpropagated from the output (or another source of the evaluation signal) through the machine learning-based model to update one or more parameters of the model (e.g., based on the gradient of the evaluation signal relative to the parameter values). For example, a system containing one or more machine learning-based models may be trained in an end-to-end manner. Gradient descent techniques may be used to iteratively update the parameters over multiple training iterations. In some implementations, performing backpropagation of the error may include performing truncated backpropagation over time. Example method 1500 may include implementing various generalization techniques (e.g., weight decay, dropout, etc.) to improve the generalization ability of the model being trained.
[0315] In some implementations, example method 1500 can be implemented to train a machine learning model from an initial state to a fully trained state (e.g., when the model exhibits a desired performance profile, such as based on accuracy, precision, recall, etc.).
[0316] In some implementations, Example Method 1500 can be implemented for specific stages of the training process. For example, in some implementations, Example Method 1500 can be implemented for pre-training a machine learning model. Pre-training can include, for example, large-scale training on potentially noisy data to achieve a broad performance level base across multiple tasks / data types. In some implementations, Example Method 1500 can be implemented for fine-tuning a machine learning model. Fine-tuning can include, for example, smaller-scale training on higher-quality (e.g., labeled, curated, etc.) data. Fine-tuning can affect all or part of the parameters of the machine learning model. For example, parts of the machine learning model can be “frozen” for certain training stages. For example, parameters associated with the embedding space can be “frozen” during fine-tuning (e.g., to preserve information learned from a broader domain than that present in the fine-tuned dataset). Example fine-tuning methods include reinforcement learning. Reinforcement learning can be based on user feedback on model performance during use.
[0317] Example of a machine learning model
[0318] Figure 16 This is a block diagram of an example processing flow for using a machine learning-engineered model 1 to process input 2 to generate output 3.
[0319] The machine learning model 1 can be or includes one or more machine learning models or model components. Example machine learning models can include neural networks (e.g., deep neural networks). Example machine learning models can include non-linear or linear models. Example machine learning models can use other architectures to replace or supplement neural networks. Example machine learning models can include decision tree-based models, support vector machines, hidden Markov models, Bayesian networks, linear regression models, k-means clustering models, etc.
[0320] The machine learning model 1 can be or includes any or any part of the machine learning models (e.g., models 100, 700, etc.) referenced in the preceding figures. For example, any one or more of machine learning models 100, 700, etc., can be machine learning model 1. The features and variations described herein with respect to machine learning model 1 should be understood as describing the features and variations of any machine learning model described herein. Where machine learning model 1 is referenced in this specification, it should be understood that the implementation of each of the other models described herein is thereby implicitly referenced and indicated.
[0321] Example neural networks may include feedforward neural networks, recurrent neural networks (RNNs), including long short-term memory (LSTM) based RNNs, convolutional neural networks (CNNs), diffusion models, generative adversarial networks, or other forms of neural networks. Example neural networks may be deep neural networks. Some example machine learning models may utilize attention mechanisms, such as self-attention. For example, some example machine learning models may include multi-head self-attention components. For example, some example machine learning models may include multi-query self-attention components, such as the M-MQA block described herein.
[0322] The machine learning-based model 1 may include one or more instances of the same model configured to operate on data from input 2. The machine learning-based model 1 may also include an ensemble of different models capable of interacting collaboratively to process data from input 2. For example, the machine learning-based model 1 may employ a hybrid expert architecture. See, for example, Zhou et al. Mixture-of-Experts with Expert Choice Routing (Expert Hybrid of Expert-Selected Routing), arXiv:2202.09368v2 (October 14, 2022).
[0323] Input 2 can typically include or otherwise represent various types of data. Input 2 can include one type or many different types of data. Output 3 can be data of the same type or a different type compared to Input 2. Output 3 can include one type or many different types of data.
[0324] Example data types for input 2 or output 3 include natural language text data, software code data (e.g., source code, object code, machine code, or any other form of computer-readable instruction or programming language), machine code data (e.g., binary code, assembly code, or other forms of machine-readable instruction that can be executed directly by a computer's central processing unit), assembly code data (e.g., a low-level programming language that uses a symbolic representation of machine code instructions to program the processing unit), genetic data or other chemical or biochemical data, image data, audio data, audiovisual data, tactile data, biometric data, medical data, financial data, statistical data, geographic data, astronomical data, historical data, and generally sensor data (e.g., digital or analog values, such as voltage or other absolute or relative level measurements from real or artificial inputs, such as from audio sensors, light sensors, displacement sensors, etc.). Data can be raw or processed and can be in any format or mode.
[0325] In multimodal input 2 or output 3, example combinations of data types include image data and audio data, image data and natural language data, natural language data and software code data, image data and biometric data, sensor data and medical data, etc. It should be understood that any combination of data types in input 2 or output 3 can exist.
[0326] Example input 2 may include one or more data types, such as the example data types noted above. Example output 3 may include one or more data types, such as the example data types noted above. The data type of input 2 may be the same as or different from the data type of output 3. It should be understood that the example data types noted above are provided for illustrative purposes only. The data types contemplated within the scope of this disclosure are not limited to those examples noted above.
[0327] Example of a sequence processing model using machine learning
[0328] Figure 17 This is a block diagram illustrating an example implementation of a machine learning-based model configured to process information sequences. For example, an example implementation of machine learning model 1 could include a machine learning sequence processing model 4. The example system could pass input 2 to sequence processing model 4. Sequence processing model 4 could include one or more machine learning components. Sequence processing model 4 could process the data from input 2 to obtain input sequence 5. Input sequence 5 could include one or more input elements 5-1, 5-2, ..., 5- obtained from input 2. M The sequence processing model 4 can use the prediction layer 6 to process the input sequence 5 to generate the output sequence 7. The output sequence 7 may include one or more output elements 7-1, 7-2, ..., 7- generated based on the input sequence 5.N The system can generate output 3 based on output sequence 7.
[0329] Sequence processing models 4 may include one or more machine learning-based model components configured to ingest, generate, or otherwise reason about sequences of information. For example, some example sequence processing models in the text domain are referred to as “large language models” or LLMs. See, for example, the PaLM 2 technology report, Google, https: / / ai.google / static / documents / palm2techreport.pdf (nd). Other example sequence processing models can operate in other domains, for example, such as the image domain; see, for example, Dosovitskiy et al. An image is 16x16 Words: Transformers for Image Recognition at Scale (An image is worth 16x16 words: Transformers for large-scale image recognition), arXiv:2010.11929v2 (June 3, 2021); in the audio field, see, for example, Agostinelli et al. MusicLM: Generating Music From Text (MusicLM: Generating Music from Text), arXiv:2301.11325v1 (January 26, 2023); in the field of biochemistry, see, for example, Jumper et al., Highly accurate protein structure prediction with AlphaFold, 596 Nature 583 (August 26, 2021). Sequence processing model 4 can process one or more types of data simultaneously. Sequence processing model 4 can include relatively large models (e.g., more parameters, high computational cost), relatively small models (e.g., fewer parameters, computationally lightweight), or both.
[0330] Overall, sequence processing model 4 can obtain input sequence 5 using data from input 2. For example, input sequence 5 may include a representation of the data from input 2 in a format that sequence processing model 4 can understand. One or more machine learning components of sequence processing model 4 can ingest data from input 2, parse the data into fragments compatible with the processing architecture of sequence processing model 4 (e.g., via “word segmentation”), and project these fragments into the input space associated with prediction layer 6 (e.g., via “embedding”).
[0331] Sequence processing model 4 can ingest data from input 2 and parse that data into a sequence of elements to obtain input sequence 5. For example, a portion of the input data from input 2 can be decomposed into fragments that collectively represent that portion of the input data. These fragments can provide the elements of the sequence.
[0332] In some cases, elements 5-1, 5-2, ..., 5- M Elements can represent building blocks used to capture or express meaningful information within a specific data domain. For example, elements can describe "atomic units" across one or more domains. For instance, for a text input source, these elements could correspond to groups of one or more words or sub-word components, such as a set of one or more characters.
[0333] For example, elements 5-1, 5-2, ..., 5- M This can represent the tokens obtained using a tokenizer. For example, a tokenizer can process a given part of the input source and output a series of tokens (e.g., corresponding to input elements 5-1, 5-2, ..., 5-). M These tokens represent that portion of the input source. Various tokenization methods can be used. For example, a text input source can be tokenized using byte-pair encoding (BPE) techniques. See, for example, Kudo et al. SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing (SentencePiece: A Simple and Language-Independent Subtotal Segmenter and Desegmenter for Neural Text Processing), Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (System Demonstrations), pp. 66–71 (October 31–November 4, 2018), https: / / aclanthology.org / D18-2012.pdf. Image-based input sources can be segmented by extracting and serializing pieces from an image.
[0334] Generally speaking, any data type can be serialized and processed into the input sequence 5. It should be understood that... Figure 17 The elements depicted in the text are 5-1, 5-2, ..., 5- M It can be a word element or its embedded representation.
[0335] Prediction layer 6 can predict one or more output elements 7-1, 7-2, ..., 7- based on the input elements. NPrediction layer 6 may include one or more machine learning-based model architectures, such as one or more layers of learned parameters that manipulate and transform the inputs to adapt the input elements 5-1, 5-2, ..., 5- M Extracting higher-order meanings and relationships between them. In this way, for example, example prediction layer 6 can predict new output elements given the context provided by input sequence 5.
[0336] Prediction layer 6 can evaluate the associations between portions of the input sequence 5 and specific output elements. These associations can inform predictions about the likelihood that a particular output follows the input context. For example, consider the text snippet “The carpenter's toolbox was small and heavy. It was full of ___.” Example prediction layer 6 can identify that “It” refers back to “toolbox” by determining the relationships between the corresponding embeddings. Example prediction layer 6 can also associate “it” with attributes of the toolbox, such as “small” and “heavy”. Based on these associations, for example, prediction layer 6 can assign a higher probability to the word “nails” than to the word “sawdust”.
[0337] The Transformer is an example architecture that can be used in prediction layer 4. For example, see Vaswani et al. Attention is all you need. (All you need is attention), arXiv:1706.03762v7 (August 2, 2023). The Transformer is an example of a machine learning-based model architecture that uses an attention mechanism to compute associations between items within a context window. The context window can include a sequence containing an input sequence 5 and potentially one or more output elements 7-1, 7-2, ..., 7- N A Transformer block can include one or more attention layers and one or more post-attention layers (e.g., feedforward layers, such as multilayer perceptrons).
[0338] Example attention mechanisms may include the M-MQA block described in this paper.
[0339] In addition to or instead of Transformer-based architectures, prediction layer 6 can include other machine learning-based model architectures. For example, recurrent neural networks (RNNs) and long short-term memory (LSTM) models, as well as convolutional neural networks (CNNs) can also be used. In general, prediction layer 6 can leverage various artificial neural networks that can understand or generate sequences of information.
[0340] The output sequence 7 may include or otherwise represent the same or different data type as the input sequence 5. For example, the input sequence 5 may represent text data, and the output sequence 7 may represent text data. The input sequence 5 may represent image, audio, or audiovisual data, and the output sequence 7 may represent text data (e.g., describing image, audio, or audiovisual data). It should be understood that the prediction layer 6 and any other gap model components of the sequence processing model 4 can be configured to receive multiple data types from the input sequence 5 and output multiple data types in the output sequence 7.
[0341] Output sequence 7 can have various relationships with input sequence 5. Output sequence 7 can be a continuation of input sequence 5. Output sequence 7 can be a supplement to input sequence 5. Output sequence 7 can transform, alter, expand, or otherwise modify input sequence 5. Output sequence 7 can answer, evaluate, acknowledge, or otherwise respond to input sequence 5. Output sequence 7 can implement instructions provided via input sequence 5 (or describe instructions for implementing said instructions).
[0342] Output sequence 7 can be generated autoregressively. For example, for some applications, the output of one or more prediction layers 6 can be passed through one or more output layers (e.g., softmax layers) to obtain a probability distribution of an output vocabulary (e.g., a text or symbol vocabulary) conditioned on a set of input elements in a context window. In this way, output sequence 7 can be generated autoregressively, for example, by sampling possible next output elements; adding that element to the context window and regenerating the probability distribution based on the updated context window; and sampling possible next output elements, etc.
[0343] Output sequence 7 can also be generated non-autoregressively. For example, multiple output elements of output sequence 7 can be predicted together without explicit order conditions. See, for example, Saharia et al., Non-Autoregressive Machine Translation with Latent Alignments, arXiv:2004.07437v3 (November 16, 2020).
[0344] Output sequence 7 may include one or more parts or elements. In the example content generation configuration, output sequence 7 may include multiple elements corresponding to multiple parts of the generated output sequence (e.g., text sentences, values of discrete waveforms, computer code, etc.). In the example classification configuration, output sequence 7 may include a single element associated with the classification output. For example, the output "vocabulary" may include the set of classes to which the input sequence will be classified. For example, a visual Transformer block may pass latent state information to a multilayer perceptron, which outputs possible class values associated with the input image.
[0345] Figure 18 This is a block diagram of an example technique for populating example input sequence 8. Input sequence 8 may include various functional elements forming part of the model infrastructure, such as element 8-0 obtained from task indicator 9, which signals to any model processing input sequence 8 that a specific task is being performed (e.g., helping to adapt the model's performance to that specific task). Input sequence 8 may include various data elements from different data modalities. For example, input modality 10-1 may include one data modality. Data-to-sequence model 11-1 may process the data from input modality 10-1 to project the data into a format compatible with input sequence 8 (e.g., determining one or more vectors of dimensions based on the dimensions of input sequence 8) to obtain elements 8-1, 8-2, and 8-3. Another input modality 10-2 may include a different data modality. Data-to-sequence model 11-2 may project the data from input modality 10-2 into a format compatible with input sequence 8 to obtain elements 8-4, 8-5, and 8-6. Another input modality 10-3 may include yet another different data modality. The data to sequence model 11-3 can project the data from the input mode 10-3 into a format compatible with the input sequence 8 to obtain elements 8-7, 8-8, and 8-9.
[0346] Input sequence 8 may be the same as or different from input sequence 5. Input sequence 8 may be a multimodal input sequence containing elements representing data from different modalities using a common dimension representation. For example, the embedding space may have P The input sequence 8 can be configured to contain dimensions. P Multiple elements in one dimension. In this way, for example, the example implementation can facilitate information extraction and reasoning across different data modalities by projecting data onto elements in the same embedding space to compare, combine or otherwise compute between them.
[0347] For example, elements 8-0, ..., 8-9 can indicate specific locations within a multidimensional embedding space. Some elements can map to a discrete set of locations in the embedding space. For example, elements corresponding to discrete members in a predefined vocabulary can map to discrete locations in the embedding space associated with those lexics. Other elements can be continuously distributed across the embedding space. For example, some data types can be decomposed into continuously defined parts (e.g., image patches), which can be described using continuously distributed locations within the embedding space.
[0348] In some implementations, the expressive power of the embedding space may not be limited to meanings associated with any particular set of lexical units or other building blocks. For example, a continuous embedding space can encode a series of higher-order information. Individual fragments of information (e.g., lexical units) can be mapped to specific points in the space: for example, lexical units of the word "dog" can be projected to embedding values that point to specific locations in the embedding space associated with dog-related information. Similarly, image patches of a dog on grass can be projected into the embedding space. In some implementations, the projection of the dog image can resemble the projection of the word "dog" and also resemble the projection of the word "grass," but potentially differ from both. In some implementations, the projection of the image patch may not be perfectly aligned with any single projection of a single word. In some implementations, the projection of the image patch can be aligned with a combination of the projections of the words "dog" and "grass." In this way, for example, a higher-order embedding space can encode information that is independent of the data modality expressing the information.
[0349] Task indicator 9 may include a model or model component configured to identify the ongoing task and inject the input value represented by element 8-0 into input sequence 8, which signals which task is being performed. For example, the input value may be provided as a data type associated with an input modality and projected along with that modality (e.g., the input value may be a text task label embedded along with other text data in the input; the input value may be a pixel-based representation of the task embedded along with other image data in the input; etc.). The input value may be provided as a data type different from or at least independent of other inputs. For example, the input value represented by element 8-0 may be learned within a continuous embedding space.
[0350] Input modes 10⁻¹, 10⁻², and 10⁻³ can be associated with a variety of different data types (e.g., as described above with respect to input 2 and output 3).
[0351] Data-to-sequence models 11-1, 11-2, and 11-3 may be the same as or different from each other. Data-to-sequence models 11-1, 11-2, and 11-3 can be adapted to each corresponding input modality 10-1, 10-2, and 10-3. For example, a text data-to-sequence model can subdivide a portion of the input text and project the subdivisions onto elements in input sequence 8 (e.g., elements 8-1, 8-2, 8-3, etc.). An image data-to-sequence model can subdivide the input image and project the subdivisions onto elements in input sequence 8 (e.g., elements 8-4, 8-5, 8-6, etc.). An arbitrary data type data-to-sequence model can subdivide the input of that arbitrary data type and project the subdivisions onto elements in input sequence 8 (e.g., elements 8-7, 8-8, 8-9, etc.).
[0352] Data-to-sequence models 11-1, 11-2, and 11-3 can form part of the machine learning-based sequence processing model 4. Data-to-sequence models 11-1, 11-2, and 11-3 can be jointly trained with the machine learning-based sequence processing model 4 or trained independently of it. Data-to-sequence models 11-1, 11-2, and 11-3 can be trained end-to-end with the machine learning-based sequence processing model 4.
[0353] Example data to sequence models can include example configurations of general inverted bottleneck blocks, such as inverted bottleneck blocks that are mixed twice.
[0354] Example of a machine learning-based model development platform
[0355] Figure 19 This is a block diagram of an example model development platform 12, which facilitates the creation, adaptation, and refinement of example machine learning models (e.g., machine learning model 1, sequence processing model 4, etc.). The model development platform 12 can provide several different toolkits that developer systems can use to develop new or adapted machine learning models.
[0356] The model development platform 12 can provide one or more model libraries 13 containing building blocks for new models. Model libraries 13 can include one or more pre-trained base models 13-1, which can provide a backbone of processing power across a variety of tasks. Model libraries 13 can include one or more pre-trained expert models 13-2, which can focus on performance in a specific domain of expertise. Model libraries 13 can include various model primitives 13-3, which can provide low-level architectures or components (optionally pre-trained) that can be assembled in various arrangements as needed.
[0357] The model development platform 12 can receive selections of various model components 14. The model development platform 12 can transfer the selected model components 14 to the workbench 15, which combines the selected model components 14 into the development model 16.
[0358] Workbench 15 can facilitate further refinement and adaptation of the development model 16 by utilizing multiple different toolkits integrated with the model development platform 12. For example, workbench 15 can facilitate the use of model alignment toolkit 17 to align the development model 16 with expected performance profiles for various tasks.
[0359] The model alignment toolkit 17 can provide a variety of tools for enabling the development model 16 to generate outputs aligned with desired behavioral characteristics. Alignment can include increasing the accuracy, precision, recall, etc., of the model output. Alignment can include enforcing output styles, patterns, or other preferred characteristics of the model output. Alignment can be general or domain-specific. For example, the pre-trained base model 13-1 can start from an initial performance level across multiple domains. Alignment of the pre-trained base model 13-1 can include improving performance in a specific information or task domain (e.g., even at the expense of performance in another information or task domain).
[0360] The model alignment toolkit 17 can integrate one or more datasets 17-1 used to align development models 16. Selected datasets 17-1 may include labeled or unlabeled training data. Datasets 17-1 can be obtained from public domain datasets. Datasets 17-1 can also be obtained from private datasets associated with one or more developer systems used to align custom machine learning models tailored for private use cases.
[0361] The pre-training pipeline 17-2 may include a machine learning-based model training workflow configured to update the development model 16 on a large-scale, potentially noisy dataset. For example, pre-training may utilize unsupervised learning techniques (e.g., denoising, etc.) to process a large number of training instances to update model parameters from an initial state and achieve the desired baseline performance. The pre-training pipeline 17-2 may utilize the unlabeled dataset from dataset 17-1 to perform pre-training. Workbench 15 may implement the pre-training pipeline 17-2 to pre-train the development model 16.
[0362] The fine-tuning pipeline 17-3 may include a machine learning-based model training workflow configured to refine the model parameters of the development model 16 using higher-quality data. The fine-tuning pipeline 17-3 can update the development model 16 through supervised training using the labeled dataset from dataset 17-1. The fine-tuning pipeline 17-3 can also update the development model 16 through reinforcement learning using reward signals from user feedback. Workbench 15 enables the fine-tuning pipeline 17-3 to fine-tune the development model 16.
[0363] Hint library 17-4 may include a set of inputs configured to induce behavior aligned with desired performance criteria. Hint library 17-4 may include few-shot hints (e.g., inputs that provide examples of the desired model output to be added before the desired runtime query), thought chain hints (e.g., inputs that provide step-by-step reasoning within a paradigm to facilitate comprehensive reasoning by the model), and so on.
[0364] Sample hints can be retrieved from the available repository of hint library 17-4. Sample hints can be facilitated by one or more developer systems using workbench 15.
[0365] In some implementations, pre-trained or fine-tuned models can achieve satisfactory performance even when there are no paradigms in the input. For example, zero-shot hints can include inputs lacking paradigms. Zero-shot hints can be within the domain of the training dataset or outside the training domain.
[0366] Hint library 17-4 may include one or more hint engineering tools. Hint engineering tools can provide a workflow for retrieving or learning optimized hint values. Hint engineering tools can facilitate the direct learning of hint values (e.g., input element values) based on one or more training iterations. Workbench 15 can implement the hint engineering tools in development model 16.
[0367] Hint library 17-4 may include a pipeline for hint generation. For example, input can be generated using development model 16 itself or other machine learning-based models. In this way, for example, a first model can process information about the task and output input for a second model to process in order to perform the steps of the task. The second model may be the same as or different from the first model. Workbench 15 can implement the hint generation pipeline within development model 16.
[0368] Hint library 17-4 may include a pipeline for context injection. For example, if additional context is provided for performing a specific task, the performance of development model 16 on that task can be improved. Hint library 17-4 may include software components configured to identify desired context, retrieve context from external sources (e.g., databases, sensors, etc.), and add the context to input hints. Workbench 15 can implement the context injection pipeline in development model 16.
[0369] Although the various training examples described herein regarding model development platform 12 involve "pre-training" and "fine-tuning," it should be understood that the model alignment toolkit 17 generally supports a wide variety of training techniques adapted to train a wide variety of machine learning models. Example training techniques may correspond to the example training methods 1500 described above.
[0370] The model development platform 12 may include a model plug-in toolkit 18. The model plug-in toolkit 18 may include a variety of tools configured to enhance the functionality of the machine learning model by integrating it with other systems, devices, and software components. For example, the machine learning model can use tools to improve performance quality where appropriate. For instance, deterministic tasks can be offloaded to dedicated tools instead of performing tasks probabilistically when the risk of error increases. For example, instead of autoregressively predicting solutions to a system of equations, the machine learning model can identify the tools invoked to obtain solutions and pass the system of equations to the appropriate tool. This tool can be a conventional equation solver that operates deterministically to solve the system of equations. The tool's output can be returned in response to the original query. In this way, tool usage allows some example models to focus on the strengths of the machine learning model—e.g., understanding the intent in unstructured requests for a task—while enhancing model performance by offloading certain tasks to more focused tools to mechanically apply deterministic algorithms to well-defined problems.
[0371] The model plugin toolkit 18 may include a validation tool 18-1. The validation tool 18-1 may include tools that can parse and validate the output of the machine learning model. The validation tool 18-1 may include engineered heuristics that establish certain thresholds applied to the model output. For example, the validation tool 18-1 may base the output of the machine learning model on a structured data source (e.g., to mitigate "illusion").
[0372] The model plugin toolkit 18 may include a toolkit 18-2 for implementing one or more tools, which may include scripts or other executable code that can be executed with the development model 16. The toolkit 18-2 may include one or more inputs configured to enable the machine learning-based model to implement the tools (e.g., few-shot hints that induce the model to output tool calls with correct syntax). For example, the toolkit 18-2 may include fine-tuned training data for training the model to use the tools.
[0373] The model plugin toolkit 18 may include interfaces for calling external application programming interfaces (APIs) 18-3. For example, as a supplement or alternative to directly implementing tool calls or tool code using development model 16, development model 16 may be aligned with output instructions that initiate API calls to send or obtain data via external systems.
[0374] The model plugin toolkit 18 can be integrated with the hint library 17-4 to create a catalog of available tools for use with the development model 16. For example, the model can receive a catalog of available tools in its input, and the model can generate output that selects a tool from the available tools and initiates a tool call for using that tool.
[0375] The model development platform 12 may include a suite of computational optimization tools 19 for optimizing the computational performance of the development model 16. For example, tools for model compression 19-1 can reduce the size of the development model 16 while maintaining the desired performance level. For example, model compression 19-1 may include quantization workflows, weight pruning, and sparsification techniques. Tools for hardware acceleration 19-2 can facilitate the configuration of model storage and execution formats for optimal operation on different hardware resources. For example, hardware acceleration 19-2 may include tools for optimally sharding the model for distributed processing across multiple processing units to increase bandwidth, reduce uniform memory requirements, etc. Tools for refinement 19-3 can provide tools for training a lighter model based on the knowledge encoded in the development model 16. For example, the development model 16 may be a large, high-performance machine learning model optimized using the model development platform 12. To obtain a lightweight model for operation in resource-constrained environments, the smaller model may be a “student model” that learns from and imitates the development model 16, which acts as the “teacher model.” In this way, for example, the investment in learning and developing the parameters and configuration of model 16 can be efficiently transferred to a smaller model for more efficient inference.
[0376] Workbench 15 may implement one or more of the toolkits implemented in model development platform 12, or may not implement any toolkits. Workbench 15 may output output model 20 based on development model 16. Output model 20 may be a deployment version of development model 16. Output model 20 may be a development or training checkpoint of development model 16. Output model 20 may be a refined, compressed, or otherwise optimized version of development model 16.
[0377] Figure 20 This is a block diagram of an example training process for training a machine learning development model 16. One or more parts of the example training process can be implemented by a computing system (such as the computing system described, for example, with reference to other figures) that includes one or more computing devices. Each corresponding part of the example training process can be performed by any one (or any combination of) of the one or more computing devices. Furthermore, one or more parts of the example training process can be implemented on the hardware components of the apparatus described herein, for example, to train one or more systems or models. Figure 20 Elements executed in a particular order are depicted for illustrative and discussion purposes. Those skilled in the art will understand using the disclosure provided herein that elements of any method discussed herein can be adapted, rearranged, extended, omitted, combined, or modified in various ways without departing from the scope of this disclosure. Figure 20 The elements / terms described with reference to other systems and figures are for illustrative purposes only and are not intended to be limiting. Additionally or alternatively, one or more portions of the example training process may be performed by other systems.
[0378] Initially, development model 16 can be kept in its initial state as initialization model 21. Development model 16 can be initialized using weight values. The initial weight values can be random or based on an initialization pattern. The initial weight values can be based on previous pre-training for the same or different models.
[0379] The initialization model 21 can undergo pre-training in the pre-training phase 22. The pre-training phase 22 can be implemented using one or more pre-training pipelines 17-2 on data from dataset 17-1. For example, if the initialization model 21 has already been pre-trained (e.g., the development model 16 contains, is, or is based on a pre-trained base model or expert model), pre-training can be omitted.
[0380] The pre-trained model 23 can then be a new version of the development model 16, which can remain as the development model 16 or be a new development model. If the development model 16 has already been pre-trained, the pre-trained model 23 can be in its initial state. The pre-trained model 23 can undergo fine-tuning in the fine-tuning phase 24. The fine-tuning phase 24 can be implemented using one or more fine-tuning pipelines 17-3 on data from dataset 17-1. For example, fine-tuning can be omitted if the pre-trained model has satisfactory performance, if the model has already been fine-tuned, or if other tuning methods are preferred.
[0381] The fine-tuned model 29 can then be a new version of the development model 16, which can remain as the development model 16 or be a newly developed model. If the development model 16 has already been fine-tuned, the fine-tuned model 29 can be in its initial state. The fine-tuned model 29 can undergo refinement 26 using user feedback. For example, refinement 26 using user feedback can optionally include reinforcement learning based on human feedback from human users of the fine-tuned model 25. Since reinforcement learning can take the form of fine-tuning, it should be understood that the fine-tuning phase 24 can include a phase for refinement 26 using user feedback. Refinement 26 using user feedback can produce a refined model 27. The refined model 27 can be output to the downstream system 28 for deployment or further development.
[0382] In some implementations, computational optimization operations can be applied before, during, or after each stage. For example, initializing model 21 may undergo computational optimization 29-1 (e.g., using computational optimization toolkit 19) before pre-training stage 22. Pre-trained model 23 may undergo computational optimization 29-2 (e.g., using computational optimization toolkit 19) before fine-tuning stage 24. Fine-tuned model 25 may undergo computational optimization 29-3 (e.g., using computational optimization toolkit 19) before refining 26 using user feedback. Refined model 27 may undergo computational optimization 29-4 (e.g., using computational optimization toolkit 19) before outputting to downstream system 28. Computational optimizations 29-1, ..., 29-4 may all be the same, all be different, or include at least some different optimization techniques.
[0383] Example of a machine learning-based model inference system
[0384] Figure 21This is a block diagram of an inference system for operating one or more machine learning-processed models 1 to perform inference (e.g., for training, for deployment, etc.). Model host 31 can receive machine learning-processed models 1. Model host 31 can host one or more model instances 31-1, which can be one or more instances of one or more models. Model host 31 can use available computing resources 31-2 associated with model host 31 to host model instances 31-1.
[0385] Model host 31 can perform inference on behalf of one or more clients 32. Client 32 can transmit input request 33 to model host 31. Using input request 33, model host 31 can obtain input 2 to feed into machine learning model 1. Machine learning model 1 can process input 2 to generate output 3. Using output 3, model host 31 can return output payload 34 in response to input request 33 from client 32. Output payload 34 can include or be based on output 3.
[0386] Model host 31 can utilize various other resources and tools to enhance the inference task. For example, model host 31 can communicate with tool interface 35 to facilitate the use of tools by model instance 31-1. Tool interface 35 may include local or remote APIs. Tool interface 35 may include integrated scripts or other software functionality. Model host 31 can use online learning interface 36 to facilitate continuous improvement of the machine learning-based model 1. For example, online learning interface 36 can be used in reinforcement learning loops to retrieve user feedback on the inference served by model host 31. Model host 31 can access runtime data source 37 to enhance input 2 using additional contextual information. For example, runtime data source 37 may include knowledge graph 37-1 that facilitates structured information retrieval for information associated with input request 33 (e.g., search engine service). Runtime data source 37 may include public or private, external or local database 37-2 that can store information associated with input request 33 for enhancing input 2. The runtime data source 37 may include account data 37-3, which can be retrieved in association with the user account corresponding to the client 32 to customize the behavior of the model host 31 accordingly.
[0387] The model host 31 may be implemented by one or more computing devices or systems. The client 2 may be implemented by one or more computing devices or systems, which may include computing devices or systems shared with the model host 31.
[0388] For example, model host 31 can operate on a server system that provides machine learning services (e.g., via a local area network or wide area network) to client devices operating client 32. The client device can be an end-user device used by an individual. The client device can also be a server system that operates client 32 to provide various functionalities as services to downstream end-user devices.
[0389] In some implementations, model host 31 may operate on the same device or system as client 32. Model host 31 may be a machine learning service that runs on the device to provide machine learning functionality to one or more applications operating on the client device, which may include the application implementing client 32. Model host 31 and client 32 may be part of the same application. For example, model host 31 may be a subroutine or method implemented as part of the application, and client 32 may be another subroutine or method that uses model host 31 to perform inference functionality within the application. It should be understood that model host 31 and client 32 may have various different configurations.
[0390] Model instance 31-1 may include one or more machine learning models that can be used to perform inference. Model instance 31-1 may include weights or other model components stored in persistent storage, temporarily cached, or loaded into memory. Model instance 31-1 may include multiple instances of the same model (e.g., for parallel execution of more requests on the same model). Model instance 31-1 may include instances of different models. Model instance 31-1 may include cached intermediate states of active or inactive models, which are used to accelerate inference for those models. For example, an inference session with a particular model can generate a significant amount of computational results that can be reused for future inference runs (e.g., using a KV cache for a Transformer-based model). These computational results can be stored in association with the inference session, allowing for more efficient execution when the session resumes.
[0391] Computing resource 31-2 may include one or more processors (central processing unit, graphics processing unit, tensor processing unit, machine learning accelerator, etc.) connected to one or more memory devices. Computing resource 31-2 may include a dynamic pool of available resources shared with other processes. Computing resource 31-2 may include a memory device large enough to fit an entire model instance into a single memory instance. Computing resource 31-2 may also share model instances across multiple memory devices (e.g., using data parallelization or tensor parallelization). Doing so can increase parallelization or execute large models using multiple memory devices that, individually, may not be able to fit the entire model into memory.
[0392] Input request 33 may include data for input 2. Model host 31 can process input request 33 to obtain input 2. Input 2 can be obtained directly from input request 33 or retrieved using input request 33. Input request 33 can be submitted to model host 31 via API.
[0393] Model host 31 can infer multiple batches of input requests 33 in parallel. For example, model instance 31-1 can be configured with an input structure having a batch dimension. Individual inputs 2 can be distributed across batch dimensions (e.g., rows of an array). Individual inputs 2 can include completely different contexts. Individual inputs 2 can be multiple inference steps for the same task. Individual inputs 2 can be interleaved in the input structure, such that any given inference loop can operate on different parts of the corresponding inputs 2. In this way, for example, model host 31 can perform inference on batches in parallel, such that output 3 can also contain a batch dimension and return the inference results of the batched inputs 2 in parallel. In this way, for example, multiple batches of input requests 33 can be processed in parallel to achieve higher throughput of output payload 34.
[0394] The output payload 34 may include or be based on the output 3 from the machine learning model 1. The model host 31 may process the output 3 to obtain the output payload 34. This may include linking multiple rounds of inference (e.g., iteratively, recursively, across the same model or different models) to obtain the final output of the task to be returned in the output payload 34. The output payload 34 may be transferred to the client 32 via an API.
[0395] Online learning interface 36 can facilitate reinforcement learning of machine learning-based Model 1. Online learning interface 36 can facilitate reinforcement learning with human feedback (RLHF). Online learning interface 36 can facilitate federated learning of machine learning-based Model 1.
[0396] Model host 31 can execute machine learning-enabled model 1 to perform inference for various tasks using various types of data. For example, various inputs 2 and outputs 3 can be used for various different tasks. In some implementations, input 2 may be or otherwise represent image data. Machine learning-enabled model 1 can process image data to generate outputs. As an example, machine learning-enabled model 1 can process image data to generate image recognition outputs (e.g., image data recognition, latent embedding of image data, encoded representation of image data, hashing of image data, etc.). As another example, machine learning-enabled model 1 can process image data to generate image segmentation outputs. As another example, machine learning-enabled model 1 can process image data to generate image classification outputs. As another example, machine learning-enabled model 1 can process image data to generate image data modification outputs (e.g., image data alterations, etc.). As another example, machine learning-enabled model 1 can process image data to generate encoded image data outputs (e.g., encoded and / or compressed representations of image data, etc.). As another example, machine learning-enabled model 1 can process image data to generate expanded image data outputs. As another example, Model 1, which is processed by machine learning, can process image data to generate predictive output.
[0397] In some implementations, the task is a computer vision task. In some cases, input 2 includes pixel data from one or more images, and the task is an image processing task. For example, the image processing task could be image classification, where the output is a set of scores, each score corresponding to a different object class and representing the probability that the one or more images depict an object belonging to that object class. The image processing task could be object detection, where the image processing output identifies one or more regions in the one or more images, and for each region, identifies the probability that the region depicts an object of interest. As another example, the image processing task could be image segmentation, where the image processing output defines a corresponding probability for each class in a predetermined set of classes for each pixel in the one or more images. For example, the class set could be foreground and background. As another example, the class set could be object classes. As another example, the image processing task could 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 could be motion estimation, where the network input includes multiple images, and the image processing output defines the motion of the scene depicted at each pixel in one of the input images between the images in the network input.
[0398] In some implementations, input 2 may be or otherwise represent natural language data. The machine learning-enabled model 1 can process the natural language data to generate output. As an example, the machine learning-enabled model 1 can process natural language data to generate a language-encoded output. As another example, the machine learning-enabled model 1 can process natural language data to generate a latent text embedding output. As another example, the machine learning-enabled model 1 can process natural language data to generate a translation output. As another example, the machine learning-enabled model 1 can process natural language data to generate a classification output. As another example, the machine learning-enabled model 1 can process natural language data to generate a text segmentation output. As another example, the machine learning-enabled model 1 can process natural language data to generate a semantic intent output. As another example, the machine learning-enabled model 1 can process natural language data to generate an expanded text or natural language output (e.g., text or natural language data of higher quality than the input text or natural language). As another example, the machine learning-enabled model 1 can process natural language data to generate a predicted output (e.g., one or more predicted subsequent portions of the natural language content).
[0399] In some implementations, input 2 can be or otherwise represent speech data (e.g., data describing spoken natural language, such as audio data, text data, etc.). The machine learning-enabled model 1 can process the speech data to generate output. As an example, the machine learning-enabled model 1 can process speech data to generate speech recognition output. As another example, the machine learning-enabled model 1 can process speech data to generate speech translation output. As another example, the machine learning-enabled model 1 can process speech data to generate latent embedding output. As another example, the machine learning-enabled model 1 can process speech data to generate encoded speech output (e.g., encoded and / or compressed representations of speech data, etc.). As another example, the machine learning-enabled model 1 can process speech data to generate amplified speech output (e.g., speech data of higher quality than the input speech data, etc.). As another example, the machine learning-enabled model 1 can process speech data to generate text representation output (e.g., a text representation of the input speech data, etc.). As another example, the machine learning-enabled model 1 can process speech data to generate predictive output.
[0400] In some implementations, input 2 can be or otherwise represent latent encoded data (e.g., a latent space representation of the input). The machine learning-processed model 1 can process the latent encoded data to generate an output. As an example, the machine learning-processed model 1 can process the latent encoded data to generate a recognition output. As another example, the machine learning-processed model 1 can process the latent encoded data to generate a reconstruction output. As another example, the machine learning-processed model 1 can process the latent encoded data to generate a search output. As another example, the machine learning-processed model 1 can process the latent encoded data to generate a re-clustering output. As yet another example, the machine learning-processed model 1 can process the latent encoded data to generate a prediction output.
[0401] In some implementations, input 2 may be or otherwise represent statistical data. Statistical data may be, represent, or otherwise include data calculated and / or computed from another data source. The machine learning model 1 can process the statistical data to generate output. As an example, the machine learning model 1 can process the statistical data to generate a recognition output. As another example, the machine learning model 1 can process the statistical data to generate a prediction output. As another example, the machine learning model 1 can process the statistical data to generate a classification output. As another example, the machine learning model 1 can process the statistical data to generate a segmentation output. As another example, the machine learning model 1 can process the statistical data to generate a visualization output. As another example, the machine learning model 1 can process the statistical data to generate a diagnostic output.
[0402] In some implementations, input 2 can be or otherwise represent sensor data. The machine learning-based model 1 can process the sensor data to generate output. As an example, the machine learning-based model 1 can process sensor data to generate a recognition output. As another example, the machine learning-based model 1 can process sensor data to generate a prediction output. As another example, the machine learning-based model 1 can process sensor data to generate a classification output. As another example, the machine learning-based model 1 can process sensor data to generate a segmentation output. As another example, the machine learning-based model 1 can process sensor data to generate a visualization output. As another example, the machine learning-based model 1 can process sensor data to generate a diagnostic output. As another example, the machine learning-based model 1 can process sensor data to generate a detection output.
[0403] In some implementations, the machine learning-based Model 1 can be configured to perform a task that includes encoding input data to achieve reliable and / or efficient transmission or storage (and / or corresponding decoding). For example, the task could be an audio compression task. The input could include audio data, and the output could 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 could include generating embeddings for input data (e.g., input audio or visual data). In some cases, the input includes audio data representing spoken utterances, and the task is a speech recognition task. The output could include text output mapped to spoken utterances. In some cases, the task includes encrypting or decrypting the input data. In some cases, the task includes microprocessor performance tasks such as branch prediction or memory address translation.
[0404] In some implementations, the task is a generative task, and the machine learning-based model 1 can be configured to output content generated from input 2. For example, input 2 can be, or otherwise represent, data of one or more modalities, which encodes the context used to generate additional content.
[0405] In some implementations, the task can be a text completion task. A machine learning-based model 1 can be configured to process input 2 representing text data and generate output 3, whereby the output represents additional text data to the text sequence of input 2. For example, the machine learning-based model 1 can be configured to generate output 3 to complete a sentence, paragraph, or section of text following a portion of the text represented by input 2.
[0406] In some implementations, the task can be an instruction-following task. A machine learning model 1 can be configured to process input 2 representing instructions for performing a function and generate output 3 that advances towards a goal satisfying the function of the instructions (e.g., at least one step of a multi-step process for performing the function). Output 3 can represent data of the same or different modality as input 2. For example, input 2 can represent text data (e.g., natural language instructions for a task to be performed), and machine learning model 1 can process input 2 to generate output 3 representing text data in response to the instructions (e.g., a natural language response, a programming language response, a machine language response, etc.). Input 2 can represent image data (e.g., image-based instructions for a task to be performed, optionally accompanied by text instructions), and machine learning model 1 can process input 2 to generate output 3 representing text data in response to the instructions (e.g., a natural language response, a programming language response, a machine language response, etc.). One or more outputs 3 can be generated iteratively or recursively to sequentially process and complete steps tending towards completing the requested functionality. For example, the initial output can be executed by an external system or processed by a machine learning model 1 to complete the initial steps of the function. Multiple steps can be executed, in which the final output is obtained in response to the initial instructions.
[0407] In some implementations, the task can be a question-answering task. A machine learning model 1 can be configured to process input 2 representing a question to be answered and generate output 3 that advances towards the goal of returning an answer to the question (e.g., at least one step in a multi-step process for performing the function). Output 3 can represent data of the same or different modality as input 2. For example, input 2 can represent text data (e.g., natural language instructions for a task to be performed), and machine learning model 1 can process input 2 to generate output 3 representing text data in response to the question (e.g., a natural language response, a programming language response, a machine language response, etc.). Input 2 can represent image data (e.g., image-based instructions for a task to be performed, optionally accompanied by text instructions), and machine learning model 1 can process input 2 to generate output 3 representing text data in response to the question (e.g., a natural language response, a programming language response, a machine language response, etc.). One or more outputs 3 can be generated iteratively or recursively to process and complete the steps toward answering the question sequentially. For example, the initial output can be executed by an external system or processed by a machine learning model 1 to complete the initial steps to obtain an answer to the question (e.g., querying a database, performing calculations, executing scripts, etc.). Multiple steps can be performed, in which the final output in response to the question is obtained.
[0408] In some implementations, the task can be an image generation task. A machine learning model 1 can be configured to process input 2, which represents context regarding a desired portion of the image content. Context can include text data, image data, audio data, etc. The machine learning model 1 can be configured to generate output 3, which represents image data depicting the image in context. For example, the machine learning model 1 can be configured to generate pixel data of an image. The values of the channels associated with pixels in the pixel data can be selected based on context (e.g., based on probabilities determined according to the context).
[0409] In some implementations, the task can be an audio generation task. A machine learning model 1 can be configured to process input 2, which represents context regarding a desired portion of the audio content. Context can include text data, image data, audio data, etc. The machine learning model 1 can be configured to generate output 3, which represents context-dependent audio data. For example, the machine learning model 1 can be configured to generate waveform data in the form of an image (e.g., a spectrogram). The values of channels associated with pixels in the image can be selected based on the context. The machine learning model 1 can also be configured to generate waveform data in the form of a sequence of discrete samples of a continuous waveform. The values of the sequence can be selected based on the context (e.g., based on probabilities determined according to the context).
[0410] In some implementations, the task can be a data generation task. The machine learning-based model 1 can be configured to process input 2, which represents context regarding a desired portion of the data (e.g., data from various data domains, such as sensor data, image data, multimodal data, statistical data, etc.). For example, the desired data can be synthetic data used to train other machine learning models. The context can include any data type. The machine learning-based model 1 can be configured to generate output 3, which represents data aligned with the desired data. For example, the machine learning-based model 1 can be configured to generate data values to populate a dataset. The values of data objects can be selected based on context (e.g., based on probabilities determined according to the context).
[0411] Example computing systems and devices
[0412] Figure 22This is a block diagram of an example networked computing system capable of performing various aspects of the exemplary implementations of this disclosure. The system may include multiple computing devices and systems communicatively coupled via network 49. Example computing device 50 is described as an example of a computing device capable of performing any aspect of this disclosure (e.g., implementing model host 31, client 32, or both). Example server computing system 60 is described as an example of a server computing system capable of performing any aspect of this disclosure (e.g., implementing model host 31, client 32, or both). Computing device 50 and server computing system 60 may interact collaboratively (e.g., via network 49) to perform any aspect of this disclosure (e.g., implementing model host 31, client 32, or both). Model development platform system 70 is an example system that can host or provide a model development platform 12 for developing machine learning models. Third-party system 80 is an example system that any of computing device 50, server computing system 60, or model development platform system 70 can interact with in performing various aspects of this disclosure (e.g., using third-party tools, accessing third-party databases or other resources, etc.).
[0413] Network 49 can be any type of communication network, such as a local area network (e.g., intranet), a wide area network (e.g., the Internet), or some combination thereof, and can include any number of wired or wireless links. Generally, communication via network 49 can use a wide variety of communication protocols (e.g., TCP / IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), or protection schemes (e.g., VPN, Secure HTTP, SSL) via any type of wired or wireless connection. Network 49 can also be implemented via a system bus. For example, Figure 22 One or more devices or systems may be located in the same place as, contained in, or otherwise integrated into one or more other devices or systems.
[0414] Computing device 50 can be any type of computing device, such as, for example, a personal computing device (e.g., a laptop or desktop computer), a mobile computing device (e.g., a smartphone or tablet), a game console or controller, a wearable computing device, an embedded computing device, a server computing device, a virtual machine operating on a host device, or any other type of computing device. Computing device 50 can be a client computing device. Computing device 50 can be an end-user computing device. Computing device 50 can be a computing device that provides services to an end user (who may use another computing device to interact with computing device 50).
[0415] Computing device 50 may include one or more processors 51 and memory 52. Processor 51 may be any suitable processing device (e.g., processor core, microprocessor, ASIC, FPGA, controller, microcontroller, etc.) and may be a single processor or multiple processors operatively connected. Memory 52 may include one or more non-transitory computer-readable storage media, such as HBM, RAM, ROM, EEPROM, EPROM, flash memory devices, disks, etc., and combinations thereof. Memory 52 may store data 53 and instructions 54, which can be executed by processor 51 to cause computing device 50 to perform operations. These operations may implement any one or more of the functions described herein. These operations may implement the example methods and techniques described herein.
[0416] The computing device 50 may also include one or more input components for receiving user input. For example, the user input component 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 stylus). The touch-sensitive component can be used to implement a virtual keyboard. Other example user input components include a microphone, camera, LiDAR, physical keyboard or other buttons, or other components through which the user can provide input.
[0417] The computing device 50 may store or include one or more machine learning models 55. The machine learning models 55 may include one or more machine learning models 1, such as sequence processing model 4. The machine learning models 55 may include one or more model instances 31-1. The machine learning models 55 may be received from a server computing system 60, a model development platform system 70, a third-party system 80 (e.g., an application distribution platform), or developed locally on the computing device 50. The machine learning models 55 may be loaded into memory 52 and used by the processor 51 or otherwise implemented. The computing device 50 may implement multiple parallel instances of the machine learning models 55.
[0418] Server computing system 60 may include one or more processors 61 and memory 62. Processor 61 may be any suitable processing device (e.g., processor core, microprocessor, ASIC, FPGA, controller, microcontroller, etc.) and may be a single processor or multiple processors operatively connected. Memory 62 may include one or more non-transitory computer-readable storage media, such as HBM, RAM, ROM, EEPROM, EPROM, flash memory devices, disks, etc., and combinations thereof. Memory 62 may store data 63 and instructions 64, which can be executed by processor 61 to cause server computing system 60 to perform operations. These operations may implement any one or more of the functions described herein. These operations may implement the exemplary methods and techniques described herein.
[0419] In some implementations, server computing system 60 includes one or more server computing devices or is otherwise implemented by one or more server computing devices. In instances where server computing system 60 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.
[0420] Server computing system 60 may store or otherwise include one or more machine learning models 65. Machine learning models 65 may be the same as or different from machine learning models 55. Machine learning models 65 may include one or more machine learning models 1, such as sequence processing model 4. Machine learning models 65 may include one or more model instances 31-1. Machine learning models 65 may be received from computing device 50, model development platform system 70, third-party system 80, or developed locally on server computing system 60. Machine learning models 65 may be loaded into memory 62 and used by processor 61 or otherwise implemented. Server computing system 60 may implement multiple parallel instances of machine learning models 65.
[0421] In the example configuration, the machine learning model 65 may be included in or otherwise stored and implemented by the server computing system 60 to establish a client-server relationship with the computing device 50 for service model inference. For example, the server computing system 60 may implement the model host 31 on behalf of client 32 on the computing device 50. For example, the machine learning model 65 may be implemented by the server computing system 60 as part of a web service (e.g., a remote machine learning model hosting service, such as an online interface for performing machine learning model operations on the server computing system 60 over a network). For example, the server computing system 60 may communicate with the computing device 50 via a local intranet or internet connection. For example, the computing device 50 may be a workstation or endpoint communicating with the server computing system 60, where the implementation of the machine learning model 65 is managed by the server computing system 60 to remotely perform inference (e.g., for runtime or training operations), and where output is returned (e.g., projected, streamed, etc.) to the computing device 50. The machine learning model 65 can work collaboratively or interoperably with the machine learning model 55 on the computing device 50 to perform various tasks.
[0422] The model development platform system 70 may include one or more processors 71 and memory 72. Processor 71 may be any suitable processing device (e.g., processor core, microprocessor, ASIC, FPGA, controller, microcontroller, etc.) and may be a single processor or multiple processors operatively connected. Memory 72 may include one or more non-transitory computer-readable storage media, such as HBM, RAM, ROM, EEPROM, EPROM, flash memory devices, disks, etc., and combinations thereof. Memory 72 may store data 73 and instructions 74, which may be executed by processor 71 to cause the model development platform system 70 to perform operations. These operations may implement any one or more of the functions described herein. These operations may implement the example methods and techniques described herein. Example operations include the functionality described herein with respect to model development platform 12. This functionality and other functionalities may be implemented by developer tools 75.
[0423] The third-party system 80 may include one or more processors 81 and memory 82. Processor 81 may be any suitable processing device (e.g., processor core, microprocessor, ASIC, FPGA, controller, microcontroller, etc.) and may be a single processor or multiple processors operatively connected. Memory 82 may include one or more non-transitory computer-readable storage media, such as HBM, RAM, ROM, EEPROM, EPROM, flash memory devices, disks, etc., and combinations thereof. Memory 82 may store data 83 and instructions 84, which may be executed by processor 81 to cause the third-party system 80 to perform operations. These operations may implement any one or more of the functions described herein. These operations may implement the example methods and techniques described herein. Example operations include the functionality described herein with respect to tools and other external resources (e.g., third-party resource 85) invoked when training machine learning models 1, 4, 16, 20, 55, 65, etc., or performing inference using machine learning models.
[0424] Figure 22 An example arrangement of a computing system that can be used to implement the present disclosure is shown. Other computing system configurations may also be used. For example, in some implementations, one or both of computing system 50 or server computing system 60 may implement all or part of the operation of model development platform system 70. For example, computing system 50 or server computing system 60 may implement developer tool 75 (or extensions thereof) to develop, update / train, or refine machine learning models 1, 4, 16, 20, 55, 65, etc., using one or more techniques described herein with respect to model alignment toolkit 17. In this way, for example, computing system 50 or server computing system 60 may develop, update / train, or refine machine learning models based on local datasets (e.g., for model personalization / customization, as permitted by user data preference selection).
[0425] Figure 23 This is a block diagram of an example computing device 98 implemented according to an example embodiment of the present disclosure. The computing device 98 may be a user computing device or a server computing device (e.g., computing device 50, server computing system 60, etc.). The computing device 98 may implement model host 31. For example, the computing device 98 may include multiple applications (e.g., applications 1 to N). Each application may contain its own machine learning library and machine learning-enabled models. For example, each application may include machine learning-enabled models. Example applications include text messaging applications, email applications, dictation applications, virtual keyboard applications, browser applications, etc. Figure 23As 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, or additional components. In some implementations, each application can communicate with each device component using an API (e.g., a public API). In some implementations, the API used by each application is application-specific.
[0426] Figure 24 This is a block diagram of an example computing device 99 implemented according to an example embodiment of the present disclosure. Computing device 99 may be the same as or different from computing device 98. Computing device 99 may be a user computing device or a server computing device (e.g., computing device 50, server computing system 60, etc.). Computing device 98 may implement model host 31. For example, computing device 99 may include multiple applications (e.g., applications 1 to N). Each application may communicate with a central intelligence layer. Example applications include text messaging applications, email applications, dictation applications, virtual keyboard applications, browser applications, etc. In some implementations, each application may use an API (e.g., a common API across all applications) to communicate with the central intelligence layer (and the model stored therein).
[0427] The central intelligence layer can include multiple machine learning-engineered models. For example, such as... Figure 24 As shown, a corresponding machine learning model can be provided for each application, and the corresponding machine learning model is managed by a central intelligent layer. In other implementations, two or more applications can share a single machine learning model. For example, in some implementations, the central intelligent layer can provide a single model for all applications. In some implementations, the central intelligent layer is included within or otherwise implemented by the operating system of the computing device 99.
[0428] The central intelligence layer can communicate with the central device data layer. The central device data layer can be a centralized data storage repository for computing device 99. For example... Figure 24 As shown, the central device data layer 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, or additional components. In some implementations, the central device data layer can communicate with each device component using an API (e.g., a private API).
[0429] Additional Publication
[0430] The technologies discussed in this paper involve servers, databases, software applications, and other computer-based systems, as well as the actions taken and the information sent to and from such systems. The inherent flexibility of computer-based systems allows for a wide variety of possible configurations, combinations, and divisions of tasks and functionalities among and within components. For example, the processes discussed in this paper can be implemented using a single device or component, or multiple devices or components working collaboratively. Databases and applications can be implemented on a single system or distributed across multiple systems. Distributed components can operate sequentially or in parallel.
[0431] While the subject matter has been described in detail with respect to various specific exemplary embodiments, each example is provided by way of explanation rather than limitation. Those skilled in the art, upon gaining an understanding of the foregoing, will readily generate changes, variations, and equivalents to such embodiments. Therefore, this disclosure does not exclude such modifications, alterations, or additions to the subject matter that will be readily understood by those of ordinary skill in the art. For example, features shown or described as part of an embodiment may be used with another embodiment to produce yet another embodiment. Therefore, this disclosure is intended to cover such changes, alterations, and equivalents.
[0432] Various aspects of this disclosure have been described with reference to their illustrative embodiments. Any and all features of the appended claims can be combined or rearranged in any possible manner, including combinations of claims not expressly listed together, because the illustrative claims dependencies listed herein should not be construed as limiting the scope of possible combinations of features disclosed herein. Therefore, the scope of this disclosure is illustrative rather than limiting, and this disclosure does not exclude such modifications, alterations, and / or additions to the subject matter that will be readily understood by one of ordinary skill in the art. Furthermore, terms are described herein using a list of illustrative elements connected by conjunctions such as “and,” “or,” “however,” etc. It should be understood that such conjunctions are provided for illustrative purposes only. For example, a sequence of terms and other items connected by a specific conjunction such as “or” may refer to “and / or,” “at least one of,” “any combination,” etc., of the illustrative elements listed therein. Terms such as “based on” should be understood as “at least partially based on.”
[0433] The term "may" should be understood as referring to the possibility of a feature in various implementations, rather than a capability that must exist in every implementation. For example, the phrase "X can perform Y" should be understood as indicating that in various implementations, X may be configured to perform Y, rather than indicating that X must always be able to perform Y in every instance. It should be understood that in various implementations, X may not be able to perform Y and is still within the scope of this disclosure.
[0434] The term "may" should be understood as referring to the possibility of a feature in various implementations, rather than specifying a capability that must exist in every implementation. For example, the phrase "X can perform Y" should be understood as indicating that in various implementations, X may be configured to perform Y, rather than indicating that X must always be able to perform Y in every instance. It should be understood that in various implementations, X may not be able to perform Y and is still within the scope of this disclosure.
Claims
1. A computer-implemented method for efficiently processing spatial features in an array of input data using a double-mixed inverted bottleneck block, the method comprising: At the input of the inverted bottleneck block of the two mixtures, the input state of the neural network with a first channel depth is received; The input state is convolved using the first depth convolutional layer of the inverted bottleneck block that is mixed twice to obtain a spatially mixed input state. The spatially blended input state is expanded using the up-projection point-by-point convolutional layer of the inverted bottleneck block that has been blended twice, to generate an expanded state with a second channel depth greater than the first channel depth. The extended state is convolved using the second depth convolutional layer of the inverted bottleneck block that has been mixed twice, to obtain the spatially mixed extended state; The spatially blended extended state is projected using the down-projection point-by-point convolutional layer of the inverted bottleneck block that has been mixed twice, to obtain a projected state with a third channel depth that is less than the second channel depth. as well as Using the projection state, the neural network performs a prediction task.
2. The computer-implemented method as described in claim 1, wherein, The input state represents image data, and the prediction task includes an image processing task.
3. The computer-implemented method as described in any of the preceding claims, wherein, The neural network includes multiple instances of the inverted bottleneck blocks of the two mixtures in a sequential order.
4. The computer-implemented method as described in any of the preceding claims, wherein, The first deep convolutional layer includes a first kernel size, and the second deep convolutional layer includes a second kernel size, wherein the first kernel size is different from the second kernel size.
5. The computer-implemented method as described in any of the preceding claims, wherein, The first deep convolutional layer includes a first kernel size, and the second deep convolutional layer includes a second kernel size, wherein the first kernel size is equal to the second kernel size.
6. The computer-implemented method as described in any of the preceding claims, wherein, The neural network uses a single-mixed inverted residual bottleneck block to process the output of the two-mixed inverted residual block, wherein the method includes: At the input of the inverted bottleneck block of the single mixing, a downstream input state with a fourth channel depth is received; The downstream input state is expanded using the up-projection point-by-point convolutional layer of the single-mixed inverted bottleneck block to generate a downstream expanded state with a fifth channel depth greater than the fourth channel depth. The downstream extended state is convolved using the first and only depthwise convolutional layer of the single-mixed inverted bottleneck block to obtain a spatially mixed downstream extended state; and The spatially blended downstream extended state is projected using the downprojected point-by-point convolutional layer of the single-mixed inverted bottleneck block to obtain a downstream projected state with a sixth channel depth that is less than the fifth channel depth.
7. The computer-implemented method as described in any of the preceding claims, wherein, The neural network uses a single-mixed inverted residual bottleneck block to process the output of the two-mixed inverted residual block, wherein the method includes: At the input of the inverted bottleneck block of the single mixing, a downstream input state with a fourth channel depth is received; The downstream input state is convolved using the first and only depthwise convolutional layer of the single-mixed inverted bottleneck block to obtain a spatially mixed downstream input state; and The spatially blended downstream input state is expanded using the up-projected pointwise convolutional layer of the single-mixed inverted bottleneck block to generate a downstream expanded state with a fifth channel depth greater than the fourth channel depth; and The downstream extended state is projected using the downprojected point-by-point convolutional layer of the single-mixed inverted bottleneck block to obtain a downstream projected state with a sixth channel depth that is less than the fifth channel depth.
8. The computer-implemented method as described in any of the preceding claims, wherein, The neural network includes a Transformer encoder, and wherein the inverted bottleneck block, which is mixed twice, processes the downstream output of the attention block.
9. The computer-implemented method as described in any of the preceding claims, wherein, The neural network includes a Transformer encoder, and wherein the inverted bottleneck block of the two-stage hybrid process the downstream output of the multi-query attention block.
10. The computer-implemented method as described in any of the preceding claims, wherein, The neural network includes at least one attention block that implements multi-query attention on the input to generate the output.
11. The computer-implemented method as described in any of the preceding claims, wherein, The neural network uses at least one attention block to process the output of the two-mixed inverted residual blocks, the at least one attention block implementing multi-query attention on the input to generate the output.
12. The computer-implemented method as described in any of the preceding claims, wherein, At least one attention block projects the input to at least 48 projection dimensions.
13. The computer-implemented method as described in any of the preceding claims, wherein, At least one attention block projects the input to at least 64 projection dimensions.
14. A computer-implemented method for performing efficient neural network architecture search, comprising: Initialize a search space for multiple configurations including a generic inverted bottleneck block, wherein the generic bottleneck block includes: A first placeholder for a deep convolutional layer, wherein the first placeholder is discretely activated during the search using a first parameter; An up-projection pointwise convolutional layer follows the first placeholder and extends the channel depth of the network's internal state to the extended state; A second placeholder for a deep convolutional layer, the second placeholder being discretely activated during the search using a second parameter, the second placeholder following the extended pointwise convolutional layer; and A downward projection pointwise convolutional layer follows the second placeholder and reduces the channel depth of the network's internal state from the expanded state to the projected state; Constructing multiple candidate models, wherein constructing the multiple candidate models includes, for each of the multiple candidate models: For each corresponding network block among multiple network blocks in a neural network architecture, select a corresponding value for the first parameter and a corresponding value for the second parameter to instantiate a corresponding inverted bottleneck block at the corresponding network block; Train the multiple candidate models on the training dataset; Evaluate the performance of the multiple candidate models; and The candidate model selected based on the evaluation output.
15. The computer-implemented method as described in claim 14, wherein, The neural network architecture is configured for image processing tasks such as image classification or image segmentation, multimodal tasks such as image and audio processing tasks, or image and text processing tasks.
16. The computer-implemented method as described in any of the preceding claims, wherein, The assessment includes: Determine the prediction quality of the multiple candidate models on the prediction task; Determine the first latency for executing the plurality of candidate models on the first hardware configuration; and Determine the second delay for executing the plurality of candidate models on the second hardware configuration.
17. A computer-implemented method as described in any of the preceding claims, comprising: Using a strategy learned based on previous evaluations of the performance of the plurality of candidate models, the corresponding values of the first parameter and the corresponding values of the second parameter are sampled probabilistically.
18. The computer-implemented method as described in any of the preceding claims, wherein, The strategy is learned using a reward value, which is calculated using a prediction quality term with reduced latency deviation, the latency deviation indicating the deviation of the first or second latency from the latency target.
19. The computer-implemented method as described in any of the preceding claims, wherein, The strategy is learned using a reward value, which is calculated using a prediction quality term that has been reduced by the following: The first delay deviation term indicates the deviation measure of the first delay from the first delay target; as well as The second delay deviation term indicates the deviation measure of the second delay from the second delay target.
20. The computer-implemented method as described in any of the preceding claims, wherein, Determining the first delay includes estimating the execution time on the first processor, and wherein determining the second delay includes estimating the execution time on a second different processor.
21. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) of less than 5 watts, and the second processor is a different processor with a TDP of less than 5 watts.
22. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) of less than 5 watts, and the second processor is a different processor with a TDP of greater than 5 watts.
23. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) of less than 5 watts, and the second processor is a different processor with a TDP of greater than 5 watts and less than 50 watts.
24. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) greater than 5 watts and less than 10 watts, and the second processor is a different processor with a TDP greater than 5 watts and less than 10 watts.
25. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) of less than 10 watts, and the second processor is a different processor with a TDP of greater than 10 watts.
26. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) of less than 10 watts, and the second processor is a different processor with a TDP of greater than 10 watts and less than 50 watts.
27. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) of less than 50 watts, and the second processor is a different processor with a TDP of less than 50 watts.
28. The computer-implemented method as described in any of the preceding claims, wherein, The first processor is a processor with a thermal design power (TDP) greater than 50 watts, and the second processor is a different processor with a TDP greater than 50 watts.
29. The computer-implemented method as described in any of the preceding claims, wherein, The first processor or the second processor is an accelerator device specifically adapted for parallelizing matrix multiplication and designed to work in conjunction with the central processing unit (CPU) of a computing system.
30. The computer-implemented method as described in any of the preceding claims, wherein, The latency target is less than 20ms, such as less than 15ms, such as less than 10ms, such as less than 5ms, such as less than 3ms, such as less than 2ms, such as less than 1ms.
31. The computer-implemented method as described in any of the preceding claims, wherein, For an instance of a given network block across the multiple candidate models: The first shared parameter set is used for the corresponding upprojection pointwise convolutional layer; as well as The second shared parameter set is used for the corresponding downprojection pointwise convolutional layer.
32. The computer-implemented method as described in any of the preceding claims, wherein, For instances spanning all network blocks across the multiple candidate models: The first shared parameter set is used for the corresponding upprojection pointwise convolutional layer; as well as The second shared parameter set is used for the corresponding downprojection pointwise convolutional layer.
33. The computer-implemented method as described in any of the preceding claims, wherein, The multiple candidate models share more than 95% of the learnable network parameters.
34. The computer-implemented method as described in any of the preceding claims, wherein, The search space includes attention blocks, which implement multi-query attention on the input to generate the output.
35. A computer-implemented method for efficiently computing multi-query attention in a machine learning-based sequence processing model, comprising: Obtain the current input tensor representing the input sequence of one or more elements; Attention values are computed on the current input tensor using one or more tensor shrinkages, wherein at least a portion of a respective tensor shrinkage in the one or more tensor shrinkages includes an output tensor having non-shrinkage indices inherited from a first tensor and from a second tensor, wherein: The non-shrinking indices inherited from the first tensor are consecutive and arranged in the order they appear in the first tensor; and The non-shrinking indices inherited from the second tensor are continuous and arranged in the order they appear in the second tensor; and The output of the machine learning-based sequence processing model is generated based on the attention value.
36. The computer-implemented method as described in any of the preceding claims, wherein, The portion of a corresponding tensor contraction in the plurality of tensor contractions includes all tensor contractions in the plurality of tensor contractions.
37. The computer-implemented method as described in any of the preceding claims, wherein: The non-shrink index used for the first tensor is the adjacent index of the first tensor; and The non-shrink index used for the second tensor is the adjacent index of the second tensor.
38. A computer-implemented method as described in any of the preceding claims, comprising: Without transposing, the first tensor is reshaped into a first matrix by transforming the adjacent indices of the first tensor into a single index; as well as Without transposing, the second tensor is reshaped into a second matrix by transforming the adjacent indices of the second tensor into a single index.
39. A computer-implemented method for efficiently computing multi-query attention in a machine learning-based sequence processing model, comprising: Obtain an input tensor representing an input sequence of one or more elements, the input tensor having a sequence length dimension and an embedding dimension; A query projection tensor is obtained, which is configured to generate a projection of the input tensor using multiple learned weights. The query projection tensor has a query head dimension, an embedding dimension, and a projection dimension, wherein the adjacent indices of the query projection tensor correspond to the query head dimension and the projection dimension, respectively. The input tensor and the query projection tensor are shrunk along the embedding dimension in the following manner: The query projection tensor is reshaped into a query matrix by combining the query header dimension and the projection dimension into a single dimension; Obtain an input matrix that includes at least a portion of the input tensor; Multiply the input matrix by the query matrix to obtain the output; and The output is reshaped into a query tensor with a query header dimension, a sequence length dimension, and a projection dimension, wherein the adjacent indices of the query tensor correspond to the query header dimension and the projection dimension, respectively; and Attention processing is performed on the at least one input sequence using the query tensor.
40. The computer-implemented method as described in any of the preceding claims, wherein, The shrinking of the input tensor and the query projection tensor is performed without transposing any part of the query projection tensor or any part of the query tensor.
41. The computer-implemented method as described in any of the preceding claims, wherein, The shrinking of the input tensor and the query projection tensor is performed without generating an intermediate array in memory.
42. A computer-implemented method as described in any of the preceding claims, comprising: Obtain a second input tensor with sequence length dimension and embedding dimension; A key projection tensor is obtained, which is configured to generate a projection of the second input tensor using multiple learned weights, the key projection tensor having an embedding dimension and a projection dimension; The second input tensor and the key projection tensor are shrunk along the embedding dimension to obtain the key tensor; A value projection tensor is obtained, which is configured to generate a projection of the second input tensor using multiple learned weights, the value projection tensor having an embedding dimension and a projection dimension; Shrink the second input tensor and the value projection tensor along the embedding dimension to obtain the value tensor; Shrink the query tensor and the key tensor along the projection dimension to obtain the logit tensor; Apply the softmax operation to the logit tensor to obtain the weight tensor; The output tensor is obtained by shrinking the weight tensor and the value tensor along the sequence length dimension; and The output tensor is reprojected from the projection dimension to the embedding dimension using the output projection tensor.
43. The computer-implemented method as described in claim 42, wherein, The second input tensor is the first input tensor.
44. A computer-implemented method as described in any of the preceding claims, comprising: Shrink the output tensor and the output projection tensor along the projection dimension; in: The non-shrinking indices of the output tensor are adjacent, and The non-shrinkage indices of the output projection tensor are adjacent.
45. A computer-implemented method as described in any of the preceding claims, comprising: At least one dimension of the output tensor is reshaped into at least two smaller dimensions, wherein the output projection tensor is defined as having at least two corresponding decomposition dimensions.
46. The computer-implemented method as described in any of the preceding claims, wherein, The output tensor is reshaped into a four-dimensional tensor, wherein the output projection tensor is defined as a four-dimensional tensor.
47. A computer-implemented method as described in any of the preceding claims, comprising: The query tensor is computed using the downsampled input state.
48. A computer-implemented method as described in any of the preceding claims, comprising: The query tensor is computed using a downsampled input state obtained by a depthwise convolution with a first step amplitude parameter.
49. A computer-implemented method as described in any of the preceding claims, comprising: The key tensor, the value tensor, or both are computed using the downsampled input state.
50. A computer-implemented method as described in any of the preceding claims, comprising: The key tensor, the value tensor, or both are computed using a downsampled input state obtained using a depthwise convolution with a second stride parameter.
51. A computer-implemented method as described in any of the preceding claims, comprising: The query tensor is computed using a first downsampled input state, which is obtained using a depthwise convolution with a first step amplitude parameter. as well as The key tensor, the value tensor, or both are computed using a second downsampled input state, which is obtained using a depthwise convolution with a second stride parameter. in: The first step amplitude parameter is different from the second step amplitude parameter, or The first step amplitude parameter is equal to the second step amplitude parameter.
52. A computer-implemented method for improving the training efficiency of a machine learning-based image processing model, the method comprising: Obtain a distillation dataset, which includes multiple training examples labeled by a teacher model, wherein the multiple training examples include: The first set of enhancement routines generated the first plurality of training examples; and A second set of augmentation routines, different from the first set of augmentation routines, were used to generate a second plurality of training examples; Training batches for training student models are generated by combining one or more of the first plurality of training examples and one or more of the second plurality of training examples. The student model is used to process the training batches in batches to obtain a batch output. The batch output is evaluated using the corresponding labels generated by the teacher model for the training batch; and Based on the assessment, one or more learnable parameters of the student model are updated.
53. The computer-implemented method as described in any of the preceding claims, wherein, The student model is a supernet implemented through neural network architecture search, wherein the supernet includes multiple different computational paths corresponding to subnets representing different candidate neural network architectures.
54. The computer-implemented method as described in any of the preceding claims, wherein, The first set of enhancement routines and the second set of enhancement routines share common enhancement routines.
55. The computer-implemented method as described in any of the preceding claims, wherein, The public enhancement routines implement random pruning.
56. The computer-implemented method as described in any of the preceding claims, wherein, The distortion caused by the first set of enhancement routines is less than the distortion caused by the second set of enhancement routines.
57. The computer-implemented method as described in any of the preceding claims, wherein, The training examples include: A third set of augmentation routines is used to generate a third plurality of training examples, which are applied to a different base dataset than the base dataset used for the first plurality of training examples or the second plurality of training examples.
58. The computer-implemented method as described in any of the preceding claims, wherein, The third set of training examples is class-balanced by classifying each training example using a labeling network.
59. The computer-implemented method as described in any of the preceding claims, wherein, The third plurality of training examples are classified and balanced using a labeling network, wherein the third plurality of training examples include an equal number of class samples for each class; Wherein, for the first category, the number of samples of the same category is less than the total number of training examples in the first category in the base dataset; and Specifically, for the second category, the number of equal category samples is greater than the total number of training examples in the second category in the base dataset. The total number of training examples in the second category is supplemented by copying random training examples in the second category to reach the number of equal category samples.
60. The computer-implemented method as described in any of the preceding claims, wherein, Generating the training batch includes: Combine one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples.
61. The computer-implemented method as described in any of the preceding claims, wherein, Generating the training batch includes: One or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples are combined in equal proportions.
62. The computer-implemented method as described in any of the preceding claims, wherein, Generating the training batch includes: Combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples; The batch includes more training examples in the third plurality of training examples than any of the first plurality of training examples or the second plurality of training examples.
63. The computer-implemented method as described in any of the preceding claims, wherein, Generating the training batch includes: Combining one or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples; The number of the third plurality of training examples included in the batch is at least equal to the number of combinations of the first plurality of training examples and the second plurality of training examples.
64. The computer-implemented method as described in any of the preceding claims, wherein, Generating the training batch includes: One or more of the first plurality of training examples, one or more of the second plurality of training examples, and one or more of the third plurality of training examples are combined in a ratio of 1:1:
2.
65. One or more non-transitory computer-readable media storing instructions executable by one or more processors to cause a computing system to perform operations, said operations including: The computer-implemented method as described in any of the preceding claims.
66. A computing system, comprising: One or more processors; as well as One or more non-transitory computer-readable media storing instructions executable by the one or more processors to cause the computing system to perform operations, including: The computer-implemented method as described in any of the preceding claims.
67. A neural network configured to implement a computer-implemented method as described in any of the preceding claims.
