Optimizing machine learning models using a floating-point adapter

The floating-point adapter optimizes large language models by adjusting weights and activations to maintain performance during quantization, addressing resource constraints and noise issues, thus enhancing efficiency and accuracy.

WO2026036317A1PCT designated stage Publication Date: 2026-02-19QUALCOMM INC +6
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/112282
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

Large language models (LLMs) are resource-intensive, and existing quantization techniques often result in reduced task performance due to unequal resilience of neural network elements to quantization, particularly affecting normalization functions like SoftMax, leading to noise and degradation.

Method used

Applying a floating-point adapter to adjust weights and activations of machine learning models, using trainable adapter parameters to maintain output equivalence during quantization, especially for sensitive elements like SoftMax, thereby optimizing the model for reduced resource usage.

Benefits of technology

The floating-point adapter enhances quantized models' accuracy and efficiency by minimizing noise and maintaining performance, enabling deployment on resource-constrained devices while preserving predictive capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024112282_19022026_PF_FP_ABST
    Figure CN2024112282_19022026_PF_FP_ABST
Patent Text Reader

Abstract

Systems and techniques are described herein for optimizing a machine learning model. For instance, a method for optimizing a machine learning model is provided. The method can include applying a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; applying the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantizing the first updated weight, the second updated weight, and the third updated weight of the machine learning model.
Need to check novelty before this filing date? Find Prior Art

Description

OPTIMIZING MACHINE LEARNING MODELS USING A FLOATING-POINT ADAPTER

[0001] The present disclosure generally relates to optimizing machine learning models. For example, aspects of the present disclosure include systems and techniques for optimizing machine learning models using a floating-point adapter.BACKGROUND

[0002] Large language models (LLMs) are artificial intelligence / machine learning (AI / ML) models that can be implemented using a subclass of neural networks designed to process textual content to learn to recognize and classify textual elements, such as words, punctuation, phrases, and so forth. LLMs are further designed to generate text based on the textual content. As an example, an LLM can be trained to perform natural language processing tasks, such as generating, predicting, translating, etc. text.

[0003] In some cases, LLMs can be implemented using neural networks (NN) , such as transformer models. A transformer model can be a type of ML model (e.g., a NN) that includes an encoder and decoder and can be used to tokenize inputs, learn relationships between the tokens, and then generate predictions using the tokens. As implied by the name, LLMs can be relatively large models that can be resource intensive to execute. In some cases, techniques to reduce resource use from existing LLM (e.g., reducing resources used in quantization) while maintaining the predictive capability of these LLM can be useful.SUMMARY

[0004] The following presents a simplified summary relating to one or more aspects disclosed herein. Thus, the following summary should not be considered an extensive overview relating to all contemplated aspects, nor should the following summary be considered to identify key or critical elements relating to all contemplated aspects or to delineate the scope associated with any particular aspect. Accordingly, the following summary presents certain concepts relating to one or more aspects relating to the mechanisms disclosed herein in a simplified form to precede the detailed description presented below.

[0005] Disclosed are systems and techniques for optimizing a machine learning model. According to at least one example, an apparatus for optimizing a machine learning model is  provided. The apparatus includes at least one memory and at least one processor coupled to the at least one memory and configured to: apply a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; apply the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantize the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0006] In some aspects, a method for optimizing a machine learning model is provided. The method can include: applying a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; applying the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantizing the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0007] In some aspects, a non-transitory computer readable medium is provided that has stored thereon instructions that, when executed by one or more processors, cause the one or more processors to: apply a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; apply the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantize the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0008] In another aspect, an apparatus for optimizing a machine learning model is provided. The apparatus includes: means for applying a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; means for applying the floating-point adapter to the machine learning model to generate a second updated weight and  a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and means for quantizing the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0009] Some aspects include a device having a processor configured to perform one or more operations of any of the methods summarized above. Further aspects include processing devices for use in a device configured with processor-executable instructions to perform operations of any of the methods summarized above. Further aspects include a non-transitory processor-readable storage medium having stored thereon processor-executable instructions configured to cause a processor of a device to perform operations of any of the methods summarized above. Further aspects include a device having means for performing functions of any of the methods summarized above.

[0010] The foregoing has outlined rather broadly the features and technical advantages of examples according to the disclosure in order that the detailed description that follows may be better understood. Additional features and advantages will be described hereinafter. The conception and specific examples disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present disclosure. Such equivalent constructions do not depart from the scope of the appended claims. Characteristics of the concepts disclosed herein, both their organization and method of operation, together with associated advantages will be better understood from the following description when considered in connection with the accompanying figures. Each of the figures is provided for the purposes of illustration and description, and not as a definition of the limits of the claims. The foregoing, together with other features and aspects, will become more apparent upon referring to the following specification, claims, and accompanying drawings.

[0011] This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used in isolation to determine the scope of the claimed subject matter. The subject matter should be understood by reference to appropriate portions of the entire specification of this patent, any or all drawings, and each claim.

[0012] The foregoing, together with other features and embodiments, will become more apparent upon referring to the following specification, claims, and accompanying drawings.BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Illustrative embodiments of the present application are described in detail below with reference to the following figures:

[0014] FIG. 1 illustrates an example implementation of a system, which may include a central processing unit (CPU) , configured to perform one or more of the functions described herein and in accordance with some aspects;

[0015] FIG. 2 is a diagram illustrating an example transformer, in accordance with some aspects;

[0016] FIG. 3 is a block diagram illustrating an example floating-point adapter as applied to a transformer using group query attention (GQA) , in accordance with some aspects;

[0017] FIG. 4 is a block diagram illustrating an example floating-point adapter as applied to a Llama-variant machine learning model, in accordance with some aspects;

[0018] FIG. 5 is a block diagram illustrating an example floating-point adapter as applied to a Phi-2 machine learning model, in accordance with some aspects;

[0019] FIG. 6 is a block diagram illustrating an example of block-wise optimization using a floating-point adapter, in accordance with some aspects;

[0020] FIG. 7 is a flow diagram illustrating an example of applying an FP adapter to a machine learning model, in accordance with some aspects;

[0021] FIG. 8 is a block diagram illustrating an example of a deep learning network, in accordance with some examples;

[0022] FIG. 9 is a block diagram illustrating an example of a convolutional neural network, in accordance with some examples;

[0023] FIG. 10 is a block diagram illustrating an example system architecture for implementing certain aspects described herein.DETAILED DESCRIPTION

[0024] Certain aspects of this disclosure are provided below. Some of these aspects can be applied independently and some of them can be applied in combination as would be apparent  to those of skill in the art. In the following description, for the purposes of explanation, specific details are set forth in order to provide a thorough understanding of aspects of the application. However, it will be apparent that various aspects can be practiced without these specific details. The figures and description are not intended to be restrictive.

[0025] The ensuing description provides example aspects only, and is not intended to limit the scope, applicability, or configuration of the disclosure. Rather, the ensuing description of the exemplary aspects will provide those skilled in the art with an enabling description for implementing an exemplary aspect. It should be understood that various changes can be made in the function and arrangement of elements without departing from the spirit and scope of the application as set forth in the appended claims.

[0026] The terms “exemplary” and / or “example” are used herein to mean “serving as an example, instance, or illustration. ” Any aspect described herein as “exemplary” and / or “example” is not necessarily to be construed as preferred or advantageous over other aspects. Likewise, the term “aspects of the disclosure” does not require that all aspects of the disclosure include the discussed feature, advantage, or mode of operation.

[0027] Machine learning models can be trained to perform various operations. For example, during training, a machine learning model can be provided with a training data set and can perform operations based on the training data set. Conditions can also be input to the model to describe successful performance of the operations. The model can iteratively adapt internal parameters (e.g., weights) of the model to minimize a difference (e.g., an “error” ) between the model’s performance of the operations and the described successful performance. After being trained (at a phase of operation that can be referred to as “inference” ) , the model can perform the operations based on the parameters (e.g., the weights) which were adapted through the training to perform the operations. In some examples, generative machine learning models (e.g., stable diffusion models, language transformers, etc. ) can be trained to generate content.

[0028] A neural network is generally a collection of nodes connected by weighted edges that transmit data signals between the nodes. The nodes are commonly organized into layers, with one layer’s output (e.g., a lower layer) feeding the next layer’s input (e.g., a higher layer) . Different  layers can generally be configured to perform different types of transformations on their inputs, such as convolutional transformations. A node in a layer can receive one or more data signals from inbound edges connected to other nodes, and those data signals can be adjusted by the edge weights. Further, a node can have a bias as an independent input data signal. The node processes the input data signals, for example, with a linear or non-linear function and then “activates” based on the output of the function. In some cases, the activation of a node can cause the transmission of further data signals to further connected nodes. The output of the neural network is often referred to as an inference, and can take many forms, such as a numerical output, a classification output, and others. Training a neural network, often referred to as deep learning, generally involves adjusting the values of the edge weights and biases until the output of the neural network meets some task performance objective.

[0029] While neural networks are powerful machine learning model architectures capable of a wide range of useful tasks, such as providing LLMs, they are likewise highly resource dependent. For example, neural networks can require significant compute, memory, power, and time resources for training and / or for inferencing. These resource requirements can significantly limit the ability to train and deploy neural networks to certain types of devices and for certain use cases. Thus, there is typically a significant trade-off between neural network task performance and resource usage associated with training and using the neural network.

[0030] As described above, machine-learning models can be trained to perform various operations. Training of machine-learning models can be a computationally intensive process that can take a relatively long time, a large quantity of training data, and many operations. For example, it can take hundreds of hours to train a machine-learning model.

[0031] Quantization is a method of mapping continuous values to a smaller set of discrete finite values. For example, quantization approximates real-world values (e.g., floating point values) with representative values (e.g., integer values) that limit the precision and range of the original input. When applied to machine learning, such as to a neural network, quantization can significantly reduce resource usage for both training and inferencing. For example, performing massive numbers of integer operations during training of or inferencing with a quantized (e.g., reduced-precision) neural network can be significantly more efficient  in terms of resource usage as compared to performing floating point operations with an unquantized (e.g., full-precision) neural network processing the same input data.

[0032] Quantization of trained machine-learning models allows quantized trained machine-learning models to be efficiently deployed on various devices. Quantization can allow a quantized trained machine-learning model to perform operations (e.g., at the inference phase of operation) on a device relatively quickly. Quantization can include changing a format of parameters (e.g., weights and activations) of a machine-learning model from the format in which the machine-learning model was trained to a different format. Post-Training Quantization (PTQ) is a process by which a trained machine-learning model is quantized. For example, during training, a machine-learning model can store parameters (e.g., weights) according to a first format that can allow a high degree of precision. For example, during training, the model can store parameters as floating-point numbers, such as 16-bit floating point numbers, which can be referred to as float16 or FP16, or 32-bit floating point numbers, which can be referred to as float32 or FP32. According to PTQ, after training, before a model is deployed onto a device for use by a device, the model can be quantized by, in part, changing the format used to store the parameters of the model from the first format to a second format. The second format can use less memory and / or be less computational expensive to use. For example, after quantization, the model can store parameters as integer numbers such as 16-bit integer numbers, which can be referred to as Int16, or 8-bit integer numbers, which can be referred to as Int8. It can be less computationally expensive to store and / or operate using integers than floating point numbers. Thus, a device can conserve power and / or processing time when using a quantized trained machine-learning model as compared with using an unquantized trained machine-learning model. Accordingly, it can be advantageous to quantize machine-learning models.

[0033] Not all elements of a neural network are equally resilient to quantization. For example, certain elements of a neural network can be more sensitive to quantization than others. Consequently, quantizing an entire neural network to a uniform bit-width (referred to a fixed-precision quantization (FPQ) ) can result in reduced resource usage, but can also reduce task performance to an unacceptable level. To resolve such an issue, mixed-precision quantization (MPQ) seeks to quantize different elements of a neural network at varying  quantization rates, which results in reduced resource usage while maintaining task performance. The various elements of a neural network that can be quantized with MPQ include, for example, individual layers, groups of layers, sub-layers, weight channels, and others. Generally, MPQ can achieve higher accuracy for the same computational budget because it allocates higher precision to elements (e.g., layers) that are more sensitive to quantization and reduces bit-width for elements more robust to quantization.

[0034] In various aspects of the present disclosure, the term “quantize, ” “quantizing, ” and like terms can be used as a verb and can be applied to machine-learning models, and / or layers of a trained machine-learning model. In such cases the term “quantize, ” “quantizing, ” and like terms can refer to quantizing parameters (e.g., weights and / or activations) of the respective machine-learning models and / or layers. For example, a trained machine-learning model can include weights (e.g., numerical values) . During training, and after training, the weights can be stored in the trained machine-learning model in a first format (e.g., float16) . Quantizing the trained machine-learning model can include changing the weights from the first format to a second format (e.g., Int8) .

[0035] Further, the machine-learning model can include activations. Activations can refer to values used as inputs and / or outputs of various functions, operations, and / or layers of the machine-learning model. Activations can also be referred to as feature outputs. The activations can have a format. For example, a function can expect to receive values formatted according to a certain format. For instance, the function can read the values from memory according to the certain format. Further, the function can output other values (e.g., processed by the function) according to a particular format (which may or may not be the same as the certain format) . For instance, the function can write the other values to memory in the particular format. For example, an unquantized trained machine-learning model can use FP16 to pass values between functions (e.g., outputting values from one function and reading the values by another function) . After quantization, the quantized trained machine-learning model can use Int8 to pass the values between functions. The term “quantize, ” “quantizing, ” and like terms can refer to changing how activations are stored and / or used in a quantized machine-learning model.

[0036] Quantizing numbers can result in a loss of precision. Quantizing a trained machine-learning model can result in degradation of the model. In the present disclosure, the term “noise” is used to describe a degree of difference between outputs of an unquantized trained machine-learning model and the trained machine-learning model after being quantized (given the same inputs) . For example, a trained machine-learning model can be quantized. The unquantized trained machine-learning model can be provided an input, the quantized trained machine-learning model can be provided the same input. Outputs of the models can be compared. A degree of difference between the outputs can be described as noise. Noise can be a way to describe degradation of a quantized machine-learning model.

[0037] Quantizing normalization functions of a trained machine-learning model can result in degradation of the model (e.g., as evidenced by noise) . A normalization function can generate results that sum to a certain number. For instance, a normalization function can generate a probability distribution including a number of outputs that sum to 1. The probability distribution can represent the probability of each of outputs. Examples of normalization functions include: SoftMax, batch normalization (BatchNorm) , layer normalization (LayerNorm) , group normalization (GroupNorm) , and instance normalization (InstanceNorm) . Quantizing a normalization function of a trained machine-learning model can cause the quantized trained machine-learning model to exhibit more noise than quantizing other functions, operations, and / or layers of the trained machine-learning model. For example, quantizing a SoftMax operation (e.g., quantizing the activations, such as the output, of the SoftMax function) of a trained machine-learning model can result in more noise than quantizing inputs to the SoftMax function, queries of a transformer including the SoftMax function, keys of the transformer, and / or values of the transformer. In some cases, small values (e.g., small relative to the resolution of the output data format and / or characteristics output distribution) output by a quantized normalization function can be rounded to zero. If the SoftMax function is quantized, many of those outputs can be rounded to 0. For example, if the outputs of a SoftMax function are stored as int8 in 255 steps between 0 and 1, values less than 0.001953 can be rounded to zero. If many outputs of a SoftMax function are rounded to 0, it is possible that the sum of the outputs of the SoftMax function is not 1. The sum of the outputs of the quantized SoftMax function not being 1 can be a cause of degradation in the quantized machine-learning model.

[0038] Floating-point (FP) adapters are systems designed to optimize the handling of floating-point arithmetic in machine learning model computations. FP adapters, executed using a processor or other computing device, can adjust weights of a machine learning model so that the weights are easier (e.g., less resource intensive) to quantize. By reducing resource usage during quantization, FP adapters can be used to facilitate the use of machine learning models on devices that otherwise would lack sufficient resources to execute the machine learning model.

[0039] Systems, apparatuses, methods (also referred to as processes) , and computer-readable media (collectively referred to herein as “systems and techniques” ) are described herein for optimizing a machine learning model, such as neural network model. The machine learning model can include any type of model, such as a large language model, a classification model, etc. The systems and techniques described herein can apply a floating-point (FP) adapter to the machine learning model to optimize the machine learning model for quantization (e.g., place the parameters, such as weights and / or activations, in better condition for quantization) . In some cases, the systems and techniques can obtain a machine-learning model, apply the FP adapter to the machine-learning model, and quantize the machine-learning model (e.g., the weights and activations of the machine-learning model) after the machine-learning model is optimized using the FP adapter.

[0040] In some cases, the systems can apply various training techniques to adjust weights of the machine learning model and / or to adjust adapter parameters (e.g., a scaling vector associated with the FP adapter) of the FP adapter such that, when provided with equivalent inputs, the machine learning model with an applied FP adapter produces equivalent outputs as the machine learning model without the FP adapter. In further cases, the machine learning model, such as the weights and activations of the machine learning model, can be quantized using block-wise optimization. In some cases, the machine learning model or FP adapter can be trained using per-batch dynamic activation quantization. For example, during an optimization phase of the machine learning model or FP adapter, the systems and techniques can provide weights and weight quantization encodings with on-site activation encodings from the device for per-batch dynamic activation quantization. In some examples, the weight, weight quantization encodings, and activation encodings can be from simulation tools.

[0041] In some aspects, the FP adapters can be an exact preserving adapter. For example, the FP adapter can be an FP-preserving adapter that is multiplied and divided to two consecutive layers while keeping equivalency of the adapters output. The FP adapter or a computing device executing the FP adapter can perform the multiplication and division. By way of a non-limiting example, equations representing a two consecutive layers of a machine learning model can be represented by the equation: y=W2 (W1x+b1) +b2 with W1 and W2 representing weights of a machine learning model, x representing an input to the consecutive layers, and y representing an output of the consecutive layers. Constants b1 and b2 represent constants associated with one of the consecutive layers. When applying an FP adapter, the equation can be changed to: y= W2A-1 (AW1x+Ab1) +b2. The term A from the equation represents the FP adapter as a learnable parameter (e.g., parameters of the FP adapter can be tuned / learned during training) . In some aspects, the FP adapter is a diagonal matrix. The transformation resulting from applying the FP adapter generates quantization friendly (e.g., less resource intensive) weights W′1, W′2. The machine learning model with the updated weights can then be quantized.

[0042] The systems and techniques can include FP adapters for various machine learning models, such as machine learning models using group query attention (GQA) , rope functions, and low rank adapters (LoRA) .

[0043] For example, modern transformer architectures can use low rank adapters (LoRA) for agile downstream task tuning. In order to keep equivalency of the transformer, the low rank can be transformed with a corresponding base weight. For example, a low rank adapted weight W can be represented by the equation: W=W0+BA where A and B are both lower ranked matrices (e.g., smaller sizes compared to an original weight matrix of the transformer) , and W0 represents a base model weight of the transformer. Without the low rank adapter, the scaled weight W’ can be represented as the following equation: W0′=p⊙W0⊙s where p represents an inverse of scaling vector s. Using such an equation, the transformer can perform fan-in and fan-out transformations of the lower ranked matrices A and B. For example, the equation can be rewritten to be: W′=p⊙ (W0+BA) ⊙s= p⊙W0⊙s+p⊙ (BA) ⊙ s=W0′+ (p⊙B) (A⊙s) . Operator ⊙ represents Hadamard multiplication (e.g., element-wise multiplication, entry-wise multiplication, or Schur products) .

[0044] The quantization process can include weight quantization encoding training. For example, the training quantization parameters for the weight quantization encoding training can be equivalent to quantization-aware training techniques (e.g., QAT 2.0) . The weight quantization encoding training can include using learnable quantization parameters for the weights of the machine learning model, and the quantization parameters can be initialized to the maximum and minimum of the weights. Quantization parameters can include the constraints the placed by the system or device on the quantized machine learning model. For example, quantization parameters can include scaling factors to set a range of values to which floating-point values can be mapped. Quantization parameters can further include bit width of the quantized machine learning model (e.g., resolution of weights in bits such as 16 bits and 32 bits) .

[0045] As mentioned above, the systems and techniques can include training machine learning models and FP adapters using per-batch dynamic activation quantization. Per-batch activation quantization includes computing quantization parameters based on a received batch of training data. Activations and weights are quantized using the quantization parameters computed using the received batch. Per-batch dynamic activation quantization can be used to simulate a device environment when constraints of the device executing the machine learning model are not known. For example, a device may not support per token dynamic quantization, so by using per-batch dynamic activation quantization, the machine learning model can adjust the quantization techniques to match compatibility requirements or resources of the device performing the quantization.

[0046] For example, device providers can adjust backend architecture and functions. Changes in the backend architecture and functions can result in changes to quantizers of functions. Per-batch dynamic activation quantization can include setting quantization parameters based on received activations associated with the received batch of training data (e.g., min and max of the quantization parameters can be set based on a min and max of the activations received in the batch) . The per-batch dynamic activation quantization can include receiving a sequence of tokens and setting quantization parameters based on the sequence of tokens. For example, when the machine learning model is a large language model (LLM) , the sequence of tokens can be a sentence or a paragraph of sentences.

[0047] Various aspects of the application will be described with respect to the figures.

[0048] FIG. 1 illustrates an example implementation of a system 100, which can include a central processing unit (CPU 102) (which can be a multi-core CPU) , configured to perform one or more of the functions described herein. Parameters or variables (e.g., neural signals and synaptic weights) , system parameters associated with a computational device (e.g., neural network with weights) , task information, among other information can be stored in a memory block associated with a neural processing unit (NPU 108) , in a memory block associated with a CPU 102, in a memory block associated with a graphics processing unit (GPU 104) , in a memory block associated with a digital signal processor (DSP 106) , in a memory 116, and / or can be distributed across multiple blocks. Instructions executed at the CPU 102 can be loaded from a program memory associated with the CPU 102 or can be loaded from memory 116.

[0049] The system 100 can also include additional processing blocks tailored to specific functions, such as the GPU 104, the DSP 106, a connectivity engine 118, which can include fifth generation (5G) connectivity, fourth generation long term evolution (4G LTE) connectivity, Wi-Fi connectivity, USB connectivity, Bluetooth connectivity, and the like, and a multimedia processor 112 that may, for example, detect and recognize gestures. In one implementation, the NPU is implemented in the CPU 102, the DSP 106, and / or the GPU 104. The system 100 can also include one or more sensor processor (s) 114, one or more image signal processors (ISP (s) 110) , and / or navigation engine 120, which can include a global positioning system. In some examples, the sensor processor (s) 114 can be associated with or connected to one or more sensors for providing sensor input (s) to the sensor processor (s) 114. For example, the one or more sensors and sensor processor (s) 114 can be provided in, coupled to, or otherwise associated with a same computing device.

[0050] The system 100 can be implemented as a system on a chip (SoC) . The system 100 can be based on an Advanced Reduced Instruction Set Computer (RISC) Machine (ARM) instruction set. The system 100 and / or components thereof can be configured to perform machine learning techniques according to aspects of the present disclosure discussed herein. For example, the system 100 and / or components thereof can be configured to implement a machine learning model (e.g., a quantized trained machine learning model) as described herein and / or according to aspects of the  present disclosure. Machine learning (ML) can be considered a subset of artificial intelligence (AI) . ML systems can include algorithms and statistical models that computer systems can use to perform various tasks by relying on patterns and inference, without the use of explicit instructions. An example of a ML system is a neural network (also referred to as an artificial neural network) , which can include an interconnected group of artificial neurons (e.g., neuron models) . Neural networks can be used for various applications and / or devices, such as image and / or video coding, image analysis and / or computer vision applications, Internet Protocol (IP) cameras, Internet of Things (IoT) devices, autonomous vehicles, service robots, among others.

[0051] Individual nodes in a neural network can emulate biological neurons by taking input data and performing simple operations on the data. The results of the simple operations performed on the input data are selectively passed on to other neurons. Weight values are associated with each vector and node in the network, and these values constrain how input data is related to output data. For example, the input data of each node can be multiplied by a corresponding weight value, and the products can be summed. The sum of the products can be adjusted by an optional bias, and an activation function can be applied to the result, yielding the node’s output signal or “output activation” (sometimes referred to as a feature map or an activation map) . The weight values can initially be determined by an iterative flow of training data through the network (e.g., weight values are established during a training phase in which the network learns how to identify particular classes by their typical input data characteristics) .

[0052] Different types of neural networks exist, such as convolutional neural networks (CNNs) , recurrent neural networks (RNNs) , generative adversarial networks (GANs) , multilayer perceptron (MLP) neural networks, transformer neural networks, among others. For instance, convolutional neural networks (CNNs) are a type of feed-forward artificial neural network. Convolutional neural networks can include collections of artificial neurons that each have a receptive field (e.g., a spatially localized region of an input space) and that collectively tile an input space. RNNs work on the principle of saving the output of a layer and feeding the output back to the input to help in predicting an outcome of the layer. A GAN is a form of generative neural network that can learn patterns in input data so that the neural network model can generate new synthetic outputs that reasonably could have been from the original dataset. A GAN can include two neural networks that operate together, including a generative neural network that generates a synthesized output  and a discriminative neural network that evaluates the output for authenticity. In MLP neural networks, data can be fed into an input layer, and one or more hidden layers provide levels of abstraction to the data. Predictions can then be made on an output layer based on the abstracted data.

[0053] Deep learning (DL) is an example of a machine learning technique and can be considered a subset of ML. Many DL approaches are based on a neural network, such as an RNN or a CNN, and utilize multiple layers. The use of multiple layers in deep neural networks can permit progressively higher-level features to be extracted from a given input of raw data. For example, the output of a first layer of artificial neurons becomes an input to a second layer of artificial neurons, the output of a second layer of artificial neurons becomes an input to a third layer of artificial neurons, and so on. Layers that are located between the input and output of the overall deep neural network are often referred to as hidden layers. The hidden layers learn (e.g., are trained) to transform an intermediate input from a preceding layer into a slightly more abstract and composite representation that can be provided to a subsequent layer, until a final or desired representation is obtained as the final output of the deep neural network.

[0054] As noted above, a neural network is an example of a machine learning system, and can include an input layer, one or more hidden layers, and an output layer. Data is provided from input nodes of the input layer, processing is performed by hidden nodes of the one or more hidden layers, and an output is produced through output nodes of the output layer. Deep learning networks typically include multiple hidden layers. Each layer of the neural network can include feature maps or activation maps that can include artificial neurons (or nodes) . A feature map can include a filter, a kernel, or the like. The nodes can include one or more weights used to indicate an importance of the nodes of one or more of the layers. In some cases, a deep learning network can have a series of many hidden layers, with early layers being used to determine simple and low-level characteristics of an input, and later layers building up a hierarchy of more complex and abstract characteristics.

[0055] A deep learning architecture can learn a hierarchy of features. If presented with visual data, for example, the first layer can learn to recognize relatively simple features, such as edges, in the input stream. In another example, if presented with auditory data, the first layer can learn to recognize spectral power in specific frequencies. The second layer, taking the output of the first  layer as input, can learn to recognize combinations of features, such as simple shapes for visual data or combinations of sounds for auditory data. For instance, higher layers can learn to represent complex shapes in visual data or words in auditory data. Still higher layers can learn to recognize common visual objects or spoken phrases. Deep learning architectures can perform especially well when applied to problems that have a natural hierarchical structure. For example, the classification of motorized vehicles can benefit from first learning to recognize wheels, windshields, and other features. These features can be combined at higher layers in different ways to recognize cars, trucks, and airplanes.

[0056] Neural networks can be designed with a variety of connectivity patterns. In feed-forward networks, information is passed from lower to higher layers, with each neuron in a given layer communicating to neurons in higher layers. A hierarchical representation can be built up in successive layers of a feed-forward network, as described above. Neural networks can also have recurrent or feedback (also called top-down) connections. In a recurrent connection, the output from a neuron in a given layer can be communicated to another neuron in the same layer. A recurrent architecture can be helpful in recognizing patterns that span more than one of the input data chunks that are delivered to the neural network in a sequence. A connection from a neuron in a given layer to a neuron in a lower layer is called a feedback (or top-down) connection. A network with many feedback connections can be helpful when the recognition of a high-level concept can aid in discriminating the particular low-level features of an input.

[0057] Large language models (LLMs) are artificial intelligence / machine learning (AI / ML) models can be implemented using a subclass of neural networks designed to process textual content to learn to recognize and classify textual elements, such as words, punctuation, phrases, and so forth. The LLMs are further designed to generate text based on the textual content. As an example, an LLM can be trained to perform natural language processing tasks, such as generating, predicting, translating, etc. text.

[0058] In some cases, LLMs can be implemented using neural networks (NN) , such as transformer models. A transformer model can be a type of ML model (e.g., a NN) that includes an encoder and decoder and can be used to tokenize inputs, learn relationships between the tokens, and then generate predictions using the tokens. As implied by the name, LLMs can be relatively large models that can be resource intensive to execute. In some cases, techniques to reduce resource use  from existing LLM (e.g., pretrained LLM) while obtaining the predictive capability of these LLM can be useful.

[0059] FIG. 2 is a block diagram of an example transformer in accordance with some aspects of the disclosure. In a convolutional neural network (CNN) model, the number of operations required to relate signals from two arbitrary input or output positions grows in the distance between positions, which makes learning dependencies at different distant positions challenging for a CNN model. A transformer 200 reduces the operations of learning dependencies by using an encoder 210 and a decoder 220 that implement an attention mechanism at different positions of a single sequence to compute a representation of that sequence. An attention function can be described as mapping a query and a set of key-value pairs to an output, where the query, keys, values, and output are all vectors. The output is computed as a weighted sum of the values, where the weight assigned to each value is computed by a compatibility function of the query with the corresponding key.

[0060] In some examples of a transformer, the encoder 210 is composed of a stack of six identical layers and each layer has two sub-layers. The first sub-layer is a group query attention engine 212, and the second sub-layer is a fully connected feed-forward network 214. A residual connection (not shown) connects around each of the sub-layers followed by normalization.

[0061] The decoder 220 of the transformer 200 is also composed of a stack of six 6 identical layers. The decoder also includes a masked group query attention engine 222, a group query attention engine 224 over the output of the encoder 210, and a fully connected feed-forward network 226. Each layer includes a residual connection (not shown) around the layer, which is followed by layer normalization. The masked group query attention engine 222 is masked to prevent positions from attending to subsequent positions and ensures that the predictions at position i can depend only on the known outputs at positions less than i (e.g., auto-regression) .

[0062] In the transformer, the queries, keys, and values are linearly projected by a group query attention engine into learned linear projects, and then attention is performed in parallel on each of the learned linear projects, which are concatenated and then projected into final values.

[0063] The transformer also includes a positional encoder 240 to encode positions because the model does not contain recurrence and convolution and relative or absolute position of the tokens  is needed. In the transformer 200, the positional encodings are added to the input embeddings at the bottom layer of the encoder 210 and the decoder 220. The positional encodings are summed with the embeddings because the positional encodings and embeddings have the same dimensions. A corresponding position decoder 250 is configured to decode the positions of the embeddings for the decoder 220.

[0064] In some aspects, the transformer 200 uses self-attention mechanisms to selectively weigh the importance of different parts of an input sequence during processing and allows the model to attend to different parts of the input sequence while generating the output. The input sequence is first embedded into vectors and then passed through multiple layers of self-attention and feed-forward networks. The transformer 200 can process input sequences of variable length, making the transformer 200 well-suited for natural language processing tasks where input lengths can vary greatly. Additionally, the self-attention mechanism allows the transformer 200 to capture long-range dependencies between words in the input sequence, which is difficult for RNNs and CNNs. The transformer with self-attention has achieved results in several natural language processing tasks that are beyond the capabilities of other neural networks and has become a popular choice for language and text applications. For example, the various large language models, such as a generative pretrained transformer (e.g., ChatGPT, etc. ) and other current models are types of transformer networks.

[0065] As previously mentioned, quantization of trained machine-learning models allows quantized trained machine-learning models to be efficiently deployed on various devices. Quantization can include changing a format of machine learning model parameters, such as weights or activation outputs, to allow for more efficient processing on a device. Quantization however generally results in loss in resolution of data, such as adjusting the format of the data from 32-bit to 16-bit representations. The loss in resolution can cause machine learning models to be less accurate resulting in errors or noise in the machine learning model’s outputs. A floating-point adapter with trainable adapter parameters can be applied to the machine learning model to adjust the machine learning model parameters. The trainable adapter parameters of the floating-point adapter can adjust machine learning model parameters such that the output of the machine learning model is not changed from quantization of the machine learning model.

[0066] FIG. 3 is a block diagram illustrating an example scenario 300 of a floating-point (FP) adapter applied to a machine learning model (e.g., a transformer using group query attention (GQA) ) . FIG. 3 includes a set of values 302 forming key-value pairs with a set of keys 304. The set of keys 304 are associated with a first layer of the machine learning model. FIG. 3 further includes a set of queries 306 associated with a second layer of the machine learning model, and a scaling vector 308 associated with adapter parameters of the FP adapter.

[0067] In FIG. 3, the FP adapter is applied to the machine learning model by multiplying and dividing weights associated with different layers of the machine learning model. For example, in scenario 300, the FP adapter multiplies a first key from the set of keys 304 of the machine learning model by a first element of the scaling vector 308 (e.g., a first value of the scaling vector representing learnable adapter parameters of the FP adapter) . The scaling vector 308 can be multi-dimensional and can include multiple values. The FP adapter divides two or more queries of the set of queries 306 by the first element of the scaling vector 308. The two or more queries can be associated with the first key from the set of keys 304. For example, as shown in the example scenario 300, a pair of queries is associated with the first element. In some examples, the first element of the scaling vector 308 is shared across individual queries from the set of queries 306. For example, when the first element is 0.75, and the first element is applied to a pair of queries from the set of queries 306, each of the queries from the pair of queries can be divided by 0.75. In such an example, the key associated with the pair of queries is multiplied by the first element. For example, the scaling vector can be [0.75, 0.25] , key values (e.g., also referred to as key weights) are [1, 4] , and query values are [9, 8] and [6, 1] . In such an example, the scaling vector [0.75, 0.25] are multiplied to the key values [1, 4] resulting in scaled key values (e.g., also referred to as updated key weights) [0.75, 1] . The query values (e.g., also referred to as query weights) are divided by the scaling vector [0.75, 0.25] resulting in scaled query weights (e.g., also referred to as updated query weights) [12, 32] and [8, 4] .

[0068] The scaling vector 308 can be a floating-point number of the same resolution (e.g., float16 or FP16, float 32 or FP32, etc. ) as the set of keys 304 and the set of queries 306. Queries are the output of projection layers of the machine learning model (e.g., an activation feature) . The FP adapter and machine learning model can perform matrix multiplication of matrices representing the keys and queries (e.g., query-key (QK) matrix multiplication (matmul) ) . FP adapter and machine  learning model can further perform matrix multiplication between the set of values 302 and an output of a Softmax layer.

[0069] The scaling vector 308 is configured to include elements which when multiplied with the keys and used to divide queries, are more quantization friendly (e.g., requires fewer computing resources to quantize) . Applying the FP adapter to the different layers of the machine learning model can adjust the activation outputs and weights of the machine learning model.

[0070] FIG. 4 is a block diagram illustrating an example scenario 400 of a floating-point adapter applied to a Llama-variant machine learning model. The Llama variant machine learning model includes a set of keys 402 associated with a first layer of the machine learning model and a set of queries 404 associated with a second layer of the machine learning model. The machine learning model applies a rope function 406 (e.g., rotary positional encoding function (ROPE) ) to the set of keys 402 and the set of queries 404.

[0071] For example, the FP adapter or machine learning model can apply the rope function to a k output (e.g., the set of keys 402) of a K projection layer or a q output (e.g., the set of queries 404) of a Q projection layer. The rope function can divide the k output and q output (e.g., the set of keys 402 and set of queries 404 represented as an activation vector) into two halves. The rope function can rotate the k output such that the first half of the outputs rotate to the second half, and the second half of the outputs rotate to the first half. The rope function can apply a linear function, represented by a1, a2, a3, a4, b1, b2, b3, and b4, to the set of keys 402 and the set of queries. The output keys 408 of the rope function are summed by the machine learning model. The sum is multiplied by a first element of the scaling vector 412. The output queries 410 of the rope function are summed by the machine learning model. The sum is divided by the first element of the scaling vector 412.

[0072] By way of a non-limiting example, the floating-point adapter applied to a Llama-variant machine learning model can be represented by the following equations: s*rope (K) ≠rope (s*K) and [s1, s1] *rope ( [k1, k2] ) =rope ( [s1, s1] * [k1, k2] ) where s represents a scaling vector, K represents a matrix of K values, and k1, k2 represent key values from the K projection layer. As shown in the figure, the first element of the scaling vector is multiplied by the sum of the key values. The key values can further be adjusted by a linear function a1, a2, a3, and a4. The query values can also be adjusted by linear functions b1, b2, b3, and b4.

[0073] FIG. 5 is a block diagram illustrating an example scenario 500 of applying a floating-point adapter to a Phi-2 machine learning model. The Phi-2 machine learning model includes a set of keys 502 and a set of queries 504. The Phi-2 machine learning model applies a rope function 506 to the set of keys 502 and the set of queries 504. The rope function can divide the k output and q output (e.g., represented as activation vectors, also referred to as key output activation outputs and query activation outputs) into multiple portions and rotate the k output and q output such that a first portion of the outputs rotates to the position of a second portion, and the second portion of the outputs rotates to the first portion. The rope function can further apply a linear function, represented by a1, a2, a3, a4, b1, b2, b3, and b4, to the set of keys 502 and the set of queries 504. In the Phi-2 implementation of the floating-point adapter, the rope function applies to a subset of the set of keys 502 and a subset of the set of queries 504. In particular, FIG. 5 shows the rope function applying linear functions to the first two keys 518 and the first two queries 520. The output keys 508 of the rope function associated with the first two keys 518 are summed by the machine learning model and the sum is multiplied by a first element of the scaling vector 512. The output queries 510 of the rope function associated with the first two queries 520 are summed by the machine learning model and the sum is divided by the first element of the scaling vector 512. A third key 514 can be multiplied by a second element of the scaling vector 512. A third query 516 can be multiplied by the second element of the scaling vector 512. In some examples, the third key 514 and third query 516 are not multiplied or divided by a second element of the scaling vector 512.

[0074] In some aspects, the floating-point adaptor applied to a Phi-2 machine learning model can be represented by the following equation: [s1, s1, s2] *rope ( [k1, k2, k3] ) =rope ( [s1, s1, s2] * [k1, k2, k3] ) with s representing elements of the scaling vector 512 and k representing keys from the set of keys 502.

[0075] FIG. 6 is a block diagram illustrating an example scenario 600 of performing block-wise optimization using a floating-point adapter 602 and block 604. Block 604 represents architecture of a machine learning model, such as a transformer for a large language model (LLM) . Block-wise optimization can be used to train the adapter parameters of the floating-point adapter and quantization parameters for quantizing the machine learning model. The machine learning model can include multiple blocks with the output of the block 604 at a first layer of the machine learning model providing input to a subsequent block at a subsequent layer of the machine learning model.  The floating-point adapter 602 can be applied at multiple locations of the block 604, such as at one or more of the LayerNorm functions. In some examples, the floating-point adapter 602 can be applied to the inputs to LayerNorm. In other examples, the floating-point adapter 602 can be applied to outputs of LayerNorm. By way of non-limiting example, the floating-point adapter 602 is an exact adapter in part because the adapter provides the same resolution (e.g., FP16) of values as the floating-point adapter 602 receives.

[0076] Block-wise optimization includes quantizing keys, queries, and values at a first layer using quantization parameters. The output of the block can be compared to the output of a non-quantized machine learning model to determine an error between the outputs of the quantized machine learning model and the non-quantized machine learning model. The quantization parameters and adapter parameters can be adjusted using a loss function to reduce the error using back propagation.

[0077] In some aspects, training of one or more of the machine learning systems or neural networks described herein (e.g., such as the deep learning neural network of FIG. 8 among various other machine learning networks described herein) can be performed using online training (e.g., in some case on-device training) , offline training, and / or various combinations of online and offline training. In some cases, online can refer to time periods during which the input data (e.g., such as an input query to a large language model (LLM) , etc. ) is processed, for instance for performance of optimizing weights of the neural network so that the neural network is more easily quantized (e.g., requires less resources to quantize) while maintaining accuracy of the neural network. In some examples, offline can refer to idle time periods or time periods during which input data is not being processed. Additionally, offline can be based on one or more time conditions (e.g., after a particular amount of time has expired, such as a day, a week, a month, etc. ) and / or can be based on various other conditions such as network and / or server availability, etc., among various others. In some aspects, offline training of a machine learning model (e.g., a neural network model) can be performed by a first device (e.g., a server device) to generate a pre-trained model, and a second device can receive the trained model from the second device. In some cases, the second device (e.g., a mobile device, an XR device, a vehicle or system / component of the vehicle, or other device) can perform online (or on-device) training of the pre-trained model to further adapt or tune the parameters of the model.

[0078] FIG. 7 is a flow diagram illustrating an example process 700 of applying an FP adapter to a machine learning model. The process 700 can be performed by a computing device (e.g., system 100 of FIG. 1, computing device or computing system 1000 of FIG. 10, etc. ) or by a component or system (e.g., the deep learning neural network 800 of FIG. 8, the convolutional neural network (CNN) 900 of FIG. 9, a chipset, one or more processors central processing units (CPUs) , digital signal processors (DSPs) , graphics processing units (GPUs) , any other type of processor (s) , any combination thereof, or other component or system) of the computing device. The operations of the process 700 can be implemented as software components that are executed and run on one or more processors (e.g., processor 1010 of FIG. 10 or other processor (s) ) of the computing device. Further, the transmission and reception of signals by the computing device in the process 700 can be enabled, for example, by one or more antennas and / or one or more transceivers (e.g., wireless transceiver (s) ) .

[0079] At block 702, the computing device (or component thereof) can apply a floating-point adapter to the machine learning model to generate a first updated weight. The first updated weight can be based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter. For example, the floating-point adapter can be applied to a k-output layer of the machine learning model to adjust key weight values of the layer. In some examples, the floating-point adapter can adjust activation outputs of the layer. In some examples, the adapter parameters can be represented as a scaling vector associated with the floating-point adapter. The scaling vector can be multi-dimensional. For example, the scaling vector can include multiple elements (e.g., scaling values within the vector) , which can be applied to different weights and activation outputs.

[0080] At block 704, the computing device (or component thereof) can apply the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight. The computing device (or component thereof) can divide a second weight and a third weight of a second layer of the machine learning model by the adapter parameter. The floating-point adapter can be applied to a q-output layer of the machine learning model to adjust query weight values of the layer. For example, the second layer can be a q-output layer associated with a set of queries. In some examples, two or more queries can be associated with an individual key from the k-output layer.

[0081] At block 706, the computing device (or component thereof) can quantize machine learning model. Quantization of the machine learning model can include quantizing the weights and activation outputs of the machine learning model by converting the weights and activation outputs from a first data resolution to a second data resolution. For example, the computing device can convert the weights and activation outputs of the machine learning model from a 16-bit representation (e.g., FP16, or int16) to an 8-bit representation (e.g., FP8 or int8) . By way of example, block 706 includes quantization of the first updated weight, the second updated weight, and the third updated weight of the machine learning model. In further examples, additional weights and activation outputs from further layers of the machine learning model can be quantized.

[0082] The adapter parameters of the floating-point adapter can be trainable. In some examples, the process 700 can be performed iteratively with adjusted adapter parameters to minimize errors or differences in the machine learning model’s outputs when including the floating-point adapter. Process 700 can further include comparing outputs of the machine learning model without the floating-point adapter to machine learning model with the floating-point adapter applied. The process 700 can further include using a loss function to reduce the error in the machine learning model’s output by adjusting the floating-point adapter’s adapter parameters.

[0083] The process 700 is illustrated as a logical flow diagram, the operations of which represent a sequence of operations that can be implemented in hardware, computer instructions, or a combination thereof. In the context of computer instructions, the operations represent computer-executable instructions stored on one or more computer-readable storage media that, when executed by one or more processors, perform the recited operations. Generally, computer-executable instructions include routines, programs, objects, components, data structures, and the like that perform particular functions or implement particular data types. The order in which the operations are described is not intended to be construed as a limitation, and any number of the described operations can be combined in any order and / or in parallel to implement the processes.

[0084] Additionally, process 700 can be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors, by hardware, or combinations thereof. As noted above, the code can be stored on a computer-readable or machine-readable storage medium, for example, in the form  of a computer program comprising a plurality of instructions executable by one or more processors. The computer-readable or machine-readable storage medium can be non-transitory.

[0085] FIG. 8 is an illustrative example of a deep learning neural network 800 that can be used to implement the machine learning based feature extraction and / or activity recognition (or classification) described above. An input layer 820 includes input data. In one illustrative example, the input layer 820 can include data representing the pixels of an input video frame. The deep learning neural network 800 includes multiple hidden layers 822a, 822b, through 822n. The hidden layers 822a, 822b, through 822n include “n” number of hidden layers, where “n” is an integer greater than or equal to one. The number of hidden layers can be made to include as many layers as needed for the given application. The deep learning neural network 800 further includes an output layer 821 that provides an output resulting from the processing performed by the hidden layers 822a, 822b, through 822n.

[0086] The deep learning neural network 800 is a multi-layer neural network of interconnected nodes. Each node can represent a piece of information. Information associated with the nodes is shared among the different layers and each layer retains information as information is processed. In some cases, the neural network 800 can include a feed-forward network, in which case there are no feedback connections where outputs of the network are fed back into itself. In some cases, the deep learning neural network 800 can include a recurrent neural network, which can have loops that allow information to be carried across nodes while reading in input.

[0087] Information can be exchanged between nodes through node-to-node interconnections between the various layers. Nodes of the input layer 820 can activate a set of nodes in the first hidden layer 822a. For example, as shown, each of the input nodes of the input layer 820 is connected to each of the nodes of the first hidden layer 822a. The nodes of the first hidden layer 822a can transform the information of each input node by applying activation functions to the input node information. The information derived from the transformation can then be passed to and can activate the nodes of the next hidden layer 822b, which can perform their own designated functions. Example functions include convolutional, up-sampling, data transformation, and / or any other suitable functions. The output of the hidden layer 822b can then activate nodes of the next hidden layer, and so on. The output of the last hidden layer 822n can activate one or more nodes of the output layer 821, at which an output is provided. In some cases, while nodes (e.g., node 826) in  the deep learning neural network 800 are shown as having multiple output lines, a node has a single output and all lines shown as being output from a node represent the same output value.

[0088] In some cases, each node or interconnection between nodes can have a weight that is a set of parameters derived from the training of the neural network 800. Once the neural network 800 is trained, the network 800 can be referred to as a trained neural network, which can be used to classify one or more activities. For example, an interconnection between nodes can represent a piece of information learned about the interconnected nodes. The interconnection can have a tunable numeric weight that can be tuned (e.g., based on a training dataset) , allowing the neural network 800 to be adaptive to inputs and able to learn as more and more data is processed.

[0089] The neural network 800 is pre-trained to process the features from the data in the input layer 820 using the different hidden layers 822a, 822b, through 822n in order to provide the output through the output layer 821. In some examples, the neural network 800 is used to provide a large language model (LLM) and can be trained using training data. In some examples, the training data can be a set of sentences or words in a language in which the LLM is to be trained.

[0090] In some cases, the neural network 800 can adjust the weights of the nodes using a training process called backpropagation. As noted above, a backpropagation process can include a forward pass, a loss function, a backward pass, and a weight update. The forward pass, loss function, backward pass, and parameter update is performed for one training iteration. The process can be repeated for a certain number of iterations for each set of training images until the neural network 800 is trained well enough so that the weights of the layers are accurately tuned.

[0091] For the example of a large language learning model, the forward pass can include passing training data through the neural network 800. The weights are initially randomized before the neural network 800 is trained. As an illustrative example, training data can include a sentence represented by a string of characters.

[0092] As noted above, for a first training iteration for the neural network 800, the output will likely include values that do not give preference to any particular class due to the weights being randomly selected at initialization. For example, if the output is a vector with probabilities that the object includes different classes, the probability value for each of the different classes can be equal or at least very similar (e.g., for ten possible classes, each class can have a probability value of  0.1) . With the initial weights, the neural network 800 is unable to determine low level features and thus cannot make an accurate determination of what the classification of the object might be. A loss function can be used to analyze error in the output. Any suitable loss function definition can be used, such as the loss function described in the description of FIG. 5. Another example of a loss function includes the mean squared error (MSE) , defined as The loss can be set to be equal to the value of Etotal.

[0093] The loss (or error) will be high for the first training data since the actual values will be much different than the predicted output. The goal of training is to minimize the amount of loss so that the predicted output is the same as the training label. The neural network 800 can perform a backward pass by determining which inputs (weights) most contributed to the loss of the network, and can adjust the weights so that the loss decreases and is eventually minimized. A derivative of the loss with respect to the weights (denoted as dL / dW, where W are the weights at a particular layer) can be computed to determine the weights that contributed most to the loss of the network. After the derivative is computed, a weight update can be performed by updating all the weights of the filters. For example, the weights can be updated so that they change in the opposite direction of the gradient. The weight update can be denoted as where w denotes a weight, wi denotes the initial weight, and η denotes a learning rate. The learning rate can be set to any suitable value, with a high learning rate including larger weight updates and a lower value indicating smaller weight updates.

[0094] The neural network 800 can include any suitable deep network. In some examples, the neural network 800 can include a convolutional neural network (CNN) . A CNN includes an input layer and an output layer, with multiple hidden layers between the input and out layers. The hidden layers of a CNN include a series of convolutional, nonlinear, pooling (for downsampling) , and fully connected layers. The neural network 800 can include any other deep network other than a CNN, such as an autoencoder, a deep belief nets (DBNs) , a Recurrent Neural Networks (RNNs) , among others.

[0095] FIG. 9 is an illustrative example of a convolutional neural network (CNN) 900. FIG. 9 provides an example for operation of a convolutional neural network (CNN) 900 on images and video, however the structure of the convolutional neural network (CNN) can be further adapted to  receive one-dimensional inputs such as audio signals. The input layer 920 of the CNN 900 includes data representing an image or frame. For example, the data can include an array of numbers representing the pixels of the image, with each number in the array including a value from 0 to 255 describing the pixel intensity at that position in the array. For example, the array can include a 28 x 28 x 3 array of numbers with 28 rows and 28 columns of pixels and 3 color components (e.g., red, green, and blue, or luma and two chroma components, or the like) . The image can be passed through a convolutional hidden layer 922a, an optional non-linear activation layer, a pooling hidden layer 922b, and fully connected hidden layers 922c to get an output at the output layer 924. While only one of each hidden layer is shown in FIG. 9, one of ordinary skill will appreciate that multiple convolutional hidden layers, non-linear layers, pooling hidden layers, and / or fully connected layers can be included in the CNN 900. The output can indicate a single class of an object or can include a probability of classes that best describe the object in the image.

[0096] The first layer of the CNN 900 is the convolutional hidden layer 922a. The convolutional hidden layer 922a analyzes the image data of the input layer 920. Each node of the convolutional hidden layer 922a is connected to a region of nodes (pixels) of the input image called a receptive field. The convolutional hidden layer 922a can be considered as one or more filters (each filter corresponding to a different activation or feature map) , with each convolutional iteration of a filter being a node or neuron of the convolutional hidden layer 922a. For example, the region of the input image that a filter covers at each convolutional iteration would be the receptive field for the filter. In one illustrative example, if the input image includes a 28×28 array, and each filter (and corresponding receptive field) is a 5×5 array, then there will be 24×24 nodes in the convolutional hidden layer 922a. Each connection between a node and a receptive field for that node learns a weight and, in some cases, an overall bias such that each node learns to analyze its particular local receptive field in the input image. Each node of the hidden layer 922a will have the same weights and bias (called a shared weight and a shared bias) . For example, the filter has an array of weights (numbers) and the same depth as the input. A filter will have a depth of 3 for the video frame example (according to three color components of the input image) . An illustrative example size of the filter array is 5 x 5 x 3, corresponding to a size of the receptive field of a node.

[0097] The convolutional nature of the convolutional hidden layer 922a is due to each node of the convolutional layer being applied to its corresponding receptive field. For example, a filter of  the convolutional hidden layer 922a can begin in the top-left corner of the input image array and can convolve around the input image. As noted above, each convolutional iteration of the filter can be considered a node or neuron of the convolutional hidden layer 922a. At each convolutional iteration, the values of the filter are multiplied with a corresponding number of the original pixel values of the image (e.g., the 5x5 filter array is multiplied by a 5x5 array of input pixel values at the top-left corner of the input image array) . The multiplications from each convolutional iteration can be summed together to obtain a total sum for that iteration or node. The process is next continued at a next location in the input image according to the receptive field of a next node in the convolutional hidden layer 922a. For example, a filter can be moved by a step amount (referred to as a stride) to the next receptive field. The stride can be set to 1 or other suitable amount. For example, if the stride is set to 1, the filter will be moved to the right by 1 pixel at each convolutional iteration. Processing the filter at each unique location of the input volume produces a number representing the filter results for that location, resulting in a total sum value being determined for each node of the convolutional hidden layer 922a.

[0098] The mapping from the input layer to the convolutional hidden layer 922a is referred to as an activation map (or feature map) . The activation map includes a value for each node representing the filter results at each location of the input volume. The activation map can include an array that includes the various total sum values resulting from each iteration of the filter on the input volume. For example, the activation map will include a 24 x 24 array if a 5 x 5 filter is applied to each pixel (astride of 1) of a 28 x 28 input image. The convolutional hidden layer 922a can include several activation maps in order to identify multiple features in an image. The example shown in FIG. 9 includes three activation maps. Using three activation maps, the convolutional hidden layer 922a can detect three different kinds of features, with each feature being detectable across the entire image.

[0099] In some examples, a non-linear hidden layer can be applied after the convolutional hidden layer 922a. The non-linear layer can be used to introduce non-linearity to a system that has been computing linear operations. In some examples, a non-linear layer can include a rectified linear unit (ReLU) layer. A ReLU layer can apply the function f (x) = max (0, x) to all of the values in the input volume, which changes all the negative activations to 0. The ReLU can thus increase the  non-linear properties of the CNN 900 without affecting the receptive fields of the convolutional hidden layer 922a.

[0100] The pooling hidden layer 922b can be applied after the convolutional hidden layer 922a (and after the non-linear hidden layer when used) . The pooling hidden layer 922b is used to simplify the information in the output from the convolutional hidden layer 922a. For example, the pooling hidden layer 922b can take each activation map output from the convolutional hidden layer 922a and generates a condensed activation map (or feature map) using a pooling function. In some examples, a function performed by a pooling hidden layer can include max-pooling. Other forms of pooling functions be used by the pooling hidden layer 922a, such as average pooling, L2-norm pooling, or other suitable pooling functions. A pooling function (e.g., a max-pooling filter, an L2-norm filter, or other suitable pooling filter) is applied to each activation map included in the convolutional hidden layer 922a. In the example shown in FIG. 9, three pooling filters are used for the three activation maps in the convolutional hidden layer 922a.

[0101] In some examples, max-pooling can be used by applying a max-pooling filter (e.g., having a size of 2x2) with a stride (e.g., equal to a dimension of the filter, such as a stride of 2) to an activation map output from the convolutional hidden layer 922a. The output from a max-pooling filter includes the maximum number in every sub-region that the filter convolves around. Using a 2x2 filter as an example, each unit in the pooling layer can summarize a region of 2×2 nodes in the previous layer (with each node being a value in the activation map) . For example, four values (nodes) in an activation map will be analyzed by a 2x2 max-pooling filter at each iteration of the filter, with the maximum value from the four values being output as the “max” value. If such a max-pooling filter is applied to an activation filter from the convolutional hidden layer 922a having a dimension of 24x24 nodes, the output from the pooling hidden layer 922b will be an array of 12x12 nodes.

[0102] In some examples, an L2-norm pooling filter could also be used. The L2-norm pooling filter includes computing the square root of the sum of the squares of the values in the 2×2 region (or other suitable region) of an activation map (instead of computing the maximum values as is done in max-pooling) and using the computed values as an output.

[0103] Intuitively, the pooling function (e.g., max-pooling, L2-norm pooling, or other pooling function) determines whether a given feature is found anywhere in a region of the image and discards the exact positional information. The pooling can be done without affecting results of the feature detection because, once a feature has been found, the exact location of the feature is not as important as its approximate location relative to other features. Max-pooling (as well as other pooling methods) offer the benefit that there are many fewer pooled features, thus reducing the number of parameters needed in later layers of the CNN 900.

[0104] The final layer of connections in the network is a fully connected layer that connects every node from the pooling hidden layer 922b to every one of the output nodes in the output layer 924. Using the example above, the input layer includes 28 x 28 nodes encoding the pixel intensities of the input image, the convolutional hidden layer 922a includes 3×24×24 hidden feature nodes based on application of a 5×5 local receptive field (for the filters) to three activation maps, and the pooling hidden layer 922b includes a layer of 3×12×12 hidden feature nodes based on application of max-pooling filter to 2×2 regions across each of the three feature maps. Extending the example, the output layer 924 can include ten output nodes. In such an example, every node of the 3x12x12 pooling hidden layer 922b is connected to every node of the output layer 924.

[0105] The fully connected layer 922c can obtain the output of the previous pooling hidden layer 922b (which should represent the activation maps of high-level features) and determines the features that most correlate to a particular class. For example, the fully connected layer 922c layer can determine the high-level features that most strongly correlate to a particular class and can include weights (nodes) for the high-level features. A product can be computed between the weights of the fully connected layer 922c and the pooling hidden layer 922b to obtain probabilities for the different classes. For example, if the CNN 900 is being used to predict that an object in a video frame is a person, high values will be present in the activation maps that represent high-level features of people (e.g., two legs are present, a face is present at the top of the object, two eyes are present at the top left and top right of the face, a nose is present in the middle of the face, a mouth is present at the bottom of the face, and / or other features common for a person) .

[0106] In some examples, the output from the output layer 924 can include an M-dimensional vector (in the prior example, M=10) . M indicates the number of classes that the CNN 900 has to choose from when classifying the object in the image. Other example outputs can also be provided.  Each number in the M-dimensional vector can represent the probability the object is of a certain class. In one illustrative example, if a 10-dimensional output vector represents ten different classes of objects is [0 0 0.05 0.8 0 0.15 0 0 0 0] , the vector indicates that there is a 5%probability that the image is the third class of object (e.g., a dog) , an 80%probability that the image is the fourth class of object (e.g., a human) , and a 15%probability that the image is the sixth class of object (e.g., a kangaroo) . The probability for a class can be considered a confidence level that the object is part of that class.

[0107] FIG. 10 is a diagram illustrating an example of a system for implementing certain aspects of the present technology. In particular, FIG. 10 illustrates an example of computing system 1000, which can be for example any computing device making up internal computing system, a remote computing system, a camera, or any component thereof in which the components of the system are in communication with each other using connection 1005. Connection 1005 can be a physical connection using a bus, or a direct connection into processor 1010, such as in a chipset architecture. Connection 1005 can also be a virtual connection, networked connection, or logical connection.

[0108] In some aspects, computing system 1000 is a distributed system in which the functions described in this disclosure can be distributed within a datacenter, multiple data centers, a peer network, etc. In some aspects, one or more of the described system components represents many such components each performing some or all of the function for which the component is described. In some aspects, the components can be physical or virtual devices.

[0109] Example computing system 1000 includes at least one processor, such as a central processing unit (CPU) , graphics processing unit (GPU) , neural processing unit (NPU) , digital signal processor (DSP) , image signal processor (ISP) , a field programmable gate array (FPGA) , an application specific integrated circuit (ASIC) , a microprocessor, a controller, another type of processing unit, another suitable electronic circuit, or a combination thereof. The computing system 1000 also includes a connection 1005 that couples various system components including system memory 1015, such as read-only memory (ROM) 1020 and random-access memory (RAM) 1025 to processor 1010. Computing system 1000 can include a cache 1012 of high-speed memory connected directly with, in close proximity to, or integrated as part of processor 1010.

[0110] Processor 1010 can include any general-purpose processor and a hardware service or software service, such as services 1032, 1034, and 1036 stored in storage device 1030, configured to control processor 1010 as well as a special-purpose processor where software instructions are incorporated into the actual processor design. Processor 1010 can essentially be a completely self-contained computing system, containing multiple cores or processors, a bus, memory controller, cache, etc. A multi-core processor can be symmetric or asymmetric.

[0111] To enable user interaction, computing system 1000 includes an input device 1045, which can represent any number of input mechanisms, such as a microphone for speech, a touch-sensitive screen for gesture or graphical input, keyboard, mouse, motion input, speech, etc. Computing system 1000 can also include output device 1035, which can be one or more of a number of output mechanisms. In some instances, multimodal systems can enable a user to provide multiple types of input / output to communicate with computing system 1000. Computing system 1000 can include communications interface 1040, which can generally govern and manage the user input and system output. The communication interface can perform or facilitate receipt and / or transmission wired or wireless communications using wired and / or wireless transceivers, including those making use of an audio jack / plug, a microphone jack / plug, a universal serial bus (USB) port / plug, an  port / plug, an Ethernet port / plug, a fiber optic port / plug, a proprietary wired port / plug, a  wireless signal transfer, a  low energy (BLE) wireless signal transfer, an  wireless signal transfer, a radio-frequency identification (RFID) wireless signal transfer, near-field communications (NFC) wireless signal transfer, dedicated short range communication (DSRC) wireless signal transfer, 702.11 Wi-Fi wireless signal transfer, wireless local area network (WLAN) signal transfer, Visible Light Communication (VLC) , Worldwide Interoperability for Microwave Access (WiMAX) , Infrared (IR) communication wireless signal transfer, Public Switched Telephone Network (PSTN) signal transfer, Integrated Services Digital Network (ISDN) signal transfer, 3G / 4G / 5G / LTE cellular data network wireless signal transfer, ad-hoc network signal transfer, radio wave signal transfer, microwave signal transfer, infrared signal transfer, visible light signal transfer, ultraviolet light signal transfer, wireless signal transfer along the electromagnetic spectrum, or some combination thereof. The communications interface 1040 can also include one or more Global Navigation Satellite System (GNSS) receivers or transceivers that are used to determine a location of the computing system 1000 based on receipt of one or more signals from one or more satellites associated with one or more GNSS systems. GNSS systems  include, but are not limited to, the US-based Global Positioning System (GPS) , the Russia-based Global Navigation Satellite System (GLONASS) , the China-based BeiDou Navigation Satellite System (BDS) , and the Europe-based Galileo GNSS. There is no restriction on operating on any particular hardware arrangement, and therefore the basic features here can easily be substituted for improved hardware or firmware arrangements as they are developed.

[0112] Storage device 1030 can be a non-volatile and / or non-transitory and / or computer-readable memory device and can be a hard disk or other types of computer readable media which can store data that are accessible by a computer, such as magnetic cassettes, flash memory cards, solid state memory devices, digital versatile disks, cartridges, a floppy disk, a flexible disk, a hard disk, magnetic tape, a magnetic strip / stripe, any other magnetic storage medium, flash memory, memristor memory, any other solid-state memory, a compact disc read only memory (CD-ROM) optical disc, a rewritable compact disc (CD) optical disc, digital video disk (DVD) optical disc, a blu-ray disc (BDD) optical disc, a holographic optical disk, another optical medium, a secure digital (SD) card, a micro secure digital (microSD) card, a Memory  card, a smartcard chip, a EMV chip, a subscriber identity module (SIM) card, a mini / micro / nano / pico SIM card, another integrated circuit (IC) chip / card, random access memory (RAM) , static RAM (SRAM) , dynamic RAM (DRAM) , read-only memory (ROM) , programmable read-only memory (PROM) , erasable programmable read-only memory (EPROM) , electrically erasable programmable read-only memory (EEPROM) , flash EPROM (FLASHEPROM) , cache memory (L1 / L2 / L3 / L4 / L5 / L#) , resistive random-access memory (RRAM / ReRAM) , phase change memory (PCM) , spin transfer torque RAM (STT-RAM) , another memory chip or cartridge, and / or a combination thereof.

[0113] The storage device 1030 can include software services, servers, services, etc. When the code that defines such software is executed by the processor 1010, the code causes the system to perform a function. In some aspects, a hardware service that performs a particular function can include the software component stored in a computer-readable medium in connection with the necessary hardware components, such as processor 1010, connection 1005, output device 1035, etc., to carry out the function.

[0114] As used herein, the term “computer-readable medium” includes, but is not limited to, portable or non-portable storage devices, optical storage devices, and various other mediums capable of storing, containing, or carrying instruction (s) and / or data. A computer-readable medium  can include a non-transitory medium in which data can be stored and that does not include carrier waves and / or transitory electronic signals propagating wirelessly or over wired connections. Examples of a non-transitory medium can include, but are not limited to, a magnetic disk or tape, optical storage media such as compact disk (CD) or digital versatile disk (DVD) , flash memory, memory or memory devices. A computer-readable medium can have stored thereon code and / or machine-executable instructions that can represent a procedure, a function, a subprogram, a program, a routine, a subroutine, a module, a software package, a class, or any combination of instructions, data structures, or program statements. A code segment can be coupled to another code segment or a hardware circuit by passing and / or receiving information, data, arguments, parameters, or memory contents. Information, arguments, parameters, data, etc. can be passed, forwarded, or transmitted using any suitable means including memory sharing, message passing, token passing, network transmission, or the like.

[0115] In some aspects, the computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bit stream and the like. However, when mentioned, non-transitory computer-readable storage media expressly exclude media such as energy, carrier signals, electromagnetic waves, and signals per se.

[0116] Specific details are provided in the description above to provide a thorough understanding of the aspects and examples provided herein. However, it will be understood by one of ordinary skill in the art that the aspects can be practiced without these specific details. For clarity of explanation, in some instances the present technology can be presented as including individual functional blocks including functional blocks comprising devices, device components, steps or routines in a method embodied in software, or combinations of hardware and software. Additional components can be used other than those shown in the figures and / or described herein. For example, circuits, systems, networks, processes, and other components can be shown as components in block diagram form in order not to obscure the aspects in unnecessary detail. In other instances, well-known circuits, processes, algorithms, structures, and techniques can be shown without unnecessary detail in order to avoid obscuring the aspects.

[0117] Individual aspects can be described above as a process or method which is depicted as a flowchart, a flow diagram, a data flow diagram, a structure diagram, or a block diagram. Although a flowchart can describe the operations as a sequential process, many of the operations can be  performed in parallel or concurrently. In addition, the order of the operations can be re-arranged. A process is terminated when its operations are completed but could have additional steps not included in a figure. A process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc. When a process corresponds to a function, its termination can correspond to a return of the function to the calling function or the main function.

[0118] Processes and methods according to the above-described examples can be implemented using computer-executable instructions that are stored or otherwise available from computer-readable media. Such instructions can include, for example, instructions and data which cause or otherwise configure a general-purpose computer, special purpose computer, or a processing device to perform a certain function or group of functions. Portions of computer resources used can be accessible over a network. The computer executable instructions can be, for example, binaries, intermediate format instructions such as assembly language, firmware, source code, etc. Examples of computer-readable media that can be used to store instructions, information used, and / or information created during methods according to described examples include magnetic or optical disks, flash memory, USB devices provided with non-volatile memory, networked storage devices, and so on.

[0119] Devices implementing processes and methods according to these disclosures can include hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof, and can take any of a variety of form factors. When implemented in software, firmware, middleware, or microcode, the program code or code segments to perform the necessary tasks (e.g., a computer-program product) can be stored in a computer-readable or machine-readable medium. A processor (s) can perform the necessary tasks. Typical examples of form factors include laptops, smart phones, mobile phones, tablet devices or other small form factor personal computers, personal digital assistants, rackmount devices, standalone devices, and so on. Functionality described herein also can be embodied in peripherals or add-in cards. Such functionality can also be implemented on a circuit board among different chips or different processes executing in a single device, by way of further example.

[0120] The instructions, media for conveying such instructions, computing resources for executing them, and other structures for supporting such computing resources are example means for providing the functions described in the disclosure.

[0121] In the foregoing description, aspects of the application are described with reference to specific aspects thereof, but those skilled in the art will recognize that the application is not limited thereto. Thus, while illustrative aspects of the application have been described in detail herein, it is to be understood that the inventive concepts can be otherwise variously embodied and employed, and that the appended claims are intended to be construed to include such variations, except as limited by the prior art. Various features and aspects of the above-described application can be used individually or jointly. Further, aspects can be utilized in any number of environments and applications beyond those described herein without departing from the broader spirit and scope of the specification. The specification and drawings are, accordingly, to be regarded as illustrative rather than restrictive. For the purposes of illustration, methods were described in a particular order. It should be appreciated that in alternate aspects, the methods can be performed in a different order than that described.

[0122] One of ordinary skill will appreciate that the less than ( “<” ) and greater than ( “>” ) symbols or terminology used herein can be replaced with less than or equal to ( “≤” ) and greater than or equal to ( “≥” ) symbols, respectively, without departing from the scope of this description.

[0123] Where components are described as being “configured to” perform certain operations, such configuration can be accomplished, for example, by designing electronic circuits or other hardware to perform the operation, by programming programmable electronic circuits (e.g., microprocessors, or other suitable electronic circuits) to perform the operation, or any combination thereof.

[0124] The phrase “coupled to” refers to any component that is physically connected to another component either directly or indirectly, and / or any component that is in communication with another component (e.g., connected to the other component over a wired or wireless connection, and / or other suitable communication interface) either directly or indirectly.

[0125] Claim language or other language reciting “at least one of” a set and / or “one or more” of a set indicates that one member of the set or multiple members of the set (in any combination) satisfy the claim. For example, claim language reciting “at least one of A and B” means A, B, or A and B. In another example, claim language reciting “at least one of A, B, and C” means A, B, C, or A and B, or A and C, or B and C, or A and B and C. The language “at least one of” a set and / or “one or more” of a set does not limit the set to the items listed in the set. For example, claim  language reciting “at least one of A and B” can mean A, B, or A and B, and can additionally include items not listed in the set of A and B.

[0126] The various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the aspects disclosed herein can be implemented as electronic hardware, computer software, firmware, or combinations thereof. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

[0127] The techniques described herein can also be implemented in electronic hardware, computer software, firmware, or any combination thereof. Such techniques can be implemented in any of a variety of devices such as general purposes computers, wireless communication device handsets, or integrated circuit devices having multiple uses including application in wireless communication device handsets and other devices. Any features described as modules or components can be implemented together in an integrated logic device or separately as discrete but interoperable logic devices. If implemented in software, the techniques can be realized at least in part by a computer-readable data storage medium comprising program code including instructions that, when executed, performs one or more of the methods described above. The computer-readable data storage medium can form part of a computer program product, which can include packaging materials. The computer-readable medium can comprise memory or data storage media, such as random-access memory (RAM) such as synchronous dynamic random access memory (SDRAM) , read-only memory (ROM) , non-volatile random access memory (NVRAM) , electrically erasable programmable read-only memory (EEPROM) , FLASH memory, magnetic or optical data storage media, and the like. The techniques additionally, or alternatively, can be realized at least in part by a computer-readable communication medium that carries or communicates program code in the form of instructions or data structures and that can be accessed, read, and / or executed by a computer, such as propagated signals or waves.

[0128] The program code can be executed by a processor, which can include one or more processors, such as one or more digital signal processors (DSPs) , general purpose microprocessors, an application specific integrated circuits (ASICs) , field programmable logic arrays (FPGAs) , or other equivalent integrated or discrete logic circuitry. Such a processor can be configured to perform any of the techniques described in this disclosure. A general-purpose processor can be a microprocessor; but in the alternative, the processor can be any conventional processor, controller, microcontroller, or state machine. A processor can also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. Accordingly, the term “processor, ” as used herein can refer to any of the foregoing structure, any combination of the foregoing structure, or any other structure or apparatus suitable for implementation of the techniques described herein. In addition, in some aspects, the functionality described herein can be provided within dedicated software modules or hardware modules configured for encoding and decoding or incorporated in a combined video encoder-decoder (CODEC) .

[0129] Claim language or other language reciting “at least one processor configured to, ” “at least one processor being configured to, ” or the like indicates that one processor or multiple processors (in any combination) can perform the associated operation (s) . For example, claim language reciting “at least one processor configured to: X, Y, and Z” means a single processor can be used to perform operations X, Y, and Z; or that multiple processors are each tasked with a certain subset of operations X, Y, and Z such that together the multiple processors perform X, Y, and Z; or that a group of multiple processors work together to perform operations X, Y, and Z. In another example, claim language reciting “at least one processor configured to: X, Y, and Z” can mean that any single processor can only perform at least a subset of operations X, Y, and Z.

[0130] Illustrative aspects of the disclosure include:

[0131] Aspect 1: An apparatus for optimizing a machine learning model, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: apply a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; apply the floating-point adapter to  the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantize the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0132] Aspect 2: The apparatus of aspect 1, wherein the adapter parameter is a scaling vector with a first element and a second element.

[0133] Aspect 3: The apparatus of aspect 2, wherein: the division of the second weight and the third weight includes division of the second weight by the first element of the adapter parameter and division of the third weight by the first element of the adapter parameter; and the multiplication of the first weight includes multiplication of the first weight by the first element of the adapter parameter.

[0134] Aspect 4: The apparatus of aspect 2, wherein: the first weight is a vector of a set of key weights associated with a first set of keys; the second weight and the third weight are vectors with a set of query weights associated with a first set of queries; the multiplication of the first weight includes multiplication of the set of key weights by the first element of the adapter parameter; and the division of the second weight and the third weight includes division of the set of query weights by the first element of the adapter parameter.

[0135] Aspect 5: The apparatus of aspect 2, wherein: the first weight is a vector of a first set of key weights associated with a first set of keys and a second set of key weights associated with a second set of keys; the second weight is a vector of a first set of query weights associated with a first set of queries; the third weight is a vector of a second set of query weights associated with a second set of queries; the multiplication of the first weight includes multiplication of the first set of key weights by the first element of the adapter parameter and multiplication of the second set of key weights by the second element of the adapter parameter; the division of the second weight includes division of the first set of queries by the first element of the adapter parameter; and the division of the third weight includes division of the second set of queries by the second element of the adapter parameter.

[0136] Aspect 6: The apparatus of any one of aspects 1 to 5, wherein the machine learning model is trained based on weight quantization encoding training.

[0137] Aspect 7: The apparatus of aspect 6, wherein the training is on-device training.

[0138] Aspect 8: The apparatus of any one of aspects 1 to 7, wherein the machine learning model is quantized based on block-wise optimization.

[0139] Aspect 9: The apparatus of any one of aspects 2 to 8, wherein the scaling vector is adjusted based on a range of activation quantizers from a sequence of tokens.

[0140] Aspect 10: An apparatus for optimizing a machine learning model, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: apply a floating-point adapter to the machine learning model to generate a first weight based on multiplication of a set of key weights of a first layer of the machine learning model by a first element of an adapter parameter; apply the floating-point adapter to the machine learning model to generate a second weight based on division of a set of query weights of a second layer of the machine learning model by the first element of the adapter parameter; and quantize the first weight and the second weight of the machine learning model.

[0141] Aspect 11: An apparatus for optimizing a machine learning model, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: apply a floating-point adapter to the machine learning model to generate a first weight based on: multiplication of a first set of key weights by a first element of an adapter parameter of the floating-point adapter; and multiplication of a second set of key weights by a second element of the adapter parameter, wherein the first set of key weights and the second set of key weights are associated with a first layer of the machine learning model; apply the floating-point adapter to the machine learning model to generate a second weight based on: division of a first set of query weights by the first element of the adapter parameter; and division of a second set of query weights by the second element of the adapter parameter, wherein the first set of query weights and the second set of query weights are associated with a second layer of the machine learning model; and quantize the first weight and the second weight of the machine learning model.

[0142] Aspect 12: An apparatus for optimizing a machine learning model, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: apply a floating-point adapter to a machine learning model with a low rank adapter (LoRA) to generate a scaled weight of the machine learning model based on: Hadamard multiplication of a base model weight of the machine learning model, an inverse vector of a scaling  vector associated with the floating-point adapter, and the scaling vector; a fan-in transformation of a first matrix associated with the low rank adapter based on the first matrix and the inverse vector; and a fan-out transformation of a second matrix associated with the low rank adapter based on the second matrix and the scaling vector.

[0143] Aspect 13: A method for optimizing a machine learning model, the method comprising: applying a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; applying the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantizing the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0144] Aspect 14: The method of aspect 13, wherein the adapter parameter is a scaling vector with a first element and a second element.

[0145] Aspect 15: The method of aspect 14, wherein: the division of the second weight and the third weight includes division of the second weight by the first element of the adapter parameter and division of the third weight by the first element of the adapter parameter; and the multiplication of the first weight includes multiplication of the first weight by the first element of the adapter parameter.

[0146] Aspect 16: The method of aspect 14, wherein: the first weight is a vector of a set of key weights associated with a first set of keys; the second weight and the third weight are vectors with a set of query weights associated with a first set of queries; the multiplication of the first weight includes multiplication of the set of key weights by the first element of the adapter parameter; and the division of the second weight and the third weight includes division of the set of query weights by the first element of the adapter parameter.

[0147] Aspect 17: The method of aspect 14, wherein: the first weight is a vector of a first set of key weights associated with a first set of keys and a second set of key weights associated with a second set of keys; the second weight is a vector of a first set of query weights associated with a first set of queries; the third weight is a vector of a second set of query weights associated with a second set of queries; the multiplication of the first weight includes multiplication of the first set  of key weights by the first element of the adapter parameter and multiplication of the second set of key weights by the second element of the adapter parameter; the division of the second weight includes division of the first set of queries by the first element of the adapter parameter; and the division of the third weight includes division of the second set of queries by the second element of the adapter parameter.

[0148] Aspect 18: The method of any one of aspects 13 to 17, wherein the machine learning model is trained based on weight quantization encoding training.

[0149] Aspect 19: The method of aspect 18, wherein the training is on-device training.

[0150] Aspect 20: The method of aspects 13 to 19, wherein the machine learning model is quantized based on block-wise optimization.

[0151] Aspect 21: The method of aspects 14 to 20, wherein the scaling vector is adjusted based on a range of activation quantizers from a sequence of tokens.

[0152] Aspect 22: A method for optimizing a machine learning model, the method comprising: applying a floating-point adapter to the machine learning model to generate a first weight based on multiplication of a set of key weights of a first layer of the machine learning model by a first element of an adapter parameter; applying the floating-point adapter to the machine learning model to generate a second weight based on division of a set of query weights of a second layer of the machine learning model by the first element of the adapter parameter; and quantizing the first weight and the second weight of the machine learning model.

[0153] Aspect 23: A method for optimizing a machine learning model, the method comprising: applying a floating-point adapter to the machine learning model to generate a first weight based on:multiplication of a first set of key weights by a first element of an adapter parameter of the floating-point adapter; and multiplication of a second set of key weights by a second element of the adapter parameter, wherein the first set of key weights and the second set of key weights are associated with a first layer of the machine learning model; applying the floating-point adapter to the machine learning model to generate a second weight based on: division of a first set of query weights by the first element of the adapter parameter; and division of a second set of query weights by the second element of the adapter parameter, wherein the first set of query weights and the  second set of query weights are associated with a second layer of the machine learning model; and quantizing the first weight and the second weight of the machine learning model.

[0154] Aspect 24: A method for optimizing a machine learning model, the method comprising: applying a floating-point adapter to a machine learning model with a low rank adapter (LoRA) to generate a scaled weight of the machine learning model based on: Hadamard multiplication of a base model weight of the machine learning model, an inverse vector of a scaling vector associated with the floating-point adapter, and the scaling vector; a fan-in transformation of a first matrix associated with the low rank adapter based on the first matrix and the inverse vector; and a fan-out transformation of a second matrix associated with the low rank adapter based on the second matrix and the scaling vector.

[0155] Aspect 25: A non-transitory computer readable medium storing code for optimizing a machine learning model, the code comprising instructions executable by a processor to: apply a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter; apply the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; and quantize the first updated weight, the second updated weight, and the third updated weight of the machine learning model.

[0156] Aspect 26: The non-transitory computer readable medium of aspect 25, wherein the adapter parameter is a scaling vector with a first element and a second element.

[0157] Aspect 27: The non-transitory computer readable medium of aspect 26, wherein: the division of the second weight and the third weight includes division of the second weight by a first element of the adapter parameter and division of the third weight by the first element of the adapter parameter; and the multiplication of the first weight includes multiplication of the first weight by the first element of the adapter parameter.

[0158] Aspect 28: The non-transitory computer readable medium of aspect 26, wherein: the first weight is a vector of a set of key weights associated with a first set of keys; the second weight and the third weight are vectors with a set of query weights associated with a first set of queries; the multiplication of the first weight includes multiplication of the set of key weights by a first element  of the adapter parameter; and the division of the second weight and the third weight includes division of the set of query weights by the first element of the adapter parameter.

[0159] Aspect 29: The non-transitory computer readable medium of aspect 26, wherein: the first weight is a vector of a first set of key weights associated with a first set of keys and a second set of key weights associated with a second set of keys; the second weight is a vector of a first set of query weights associated with a first set of queries; the third weight is a vector of a second set of query weights associated with a second set of queries; the multiplication of the first weight includes multiplication of the first set of key weights by a first element of the adapter parameter and multiplication of the second set of key weights by a second element of the adapter parameter; the division of the second weight includes division of the first set of queries by the first element of the adapter parameter; and the division of the third weight includes division of the second set of queries by the second element of the adapter parameter.

[0160] Aspect 30: The non-transitory computer readable medium of any one of aspects 25 to 29, wherein the machine learning model is trained based on weight quantization encoding training.

[0161] Aspect 31: The non-transitory computer readable medium of aspect 30, wherein the training is on-device training.

[0162] Aspect 32: The non-transitory computer readable medium of any one of aspects 25 to 31, wherein the machine learning model is quantized based on block-wise optimization.

[0163] Aspect 33: The non-transitory computer readable medium of aspect 25 to 32, wherein the scaling vector is adjusted based on a range of activation quantizers from a sequence of tokens.

[0164] The previous description is provided to enable any person skilled in the art to practice the various aspects described herein. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects. Thus, the claims are not intended to be limited to the aspects shown herein, but is to be accorded the full scope consistent with the language claims, wherein reference to an element in the singular is not intended to mean “one and only one” unless specifically so stated, but rather “one or more. ”

Claims

1.An apparatus for optimizing a machine learning model, the apparatus comprising:at least one memory; andat least one processor coupled to the at least one memory and configured to:apply a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter;apply the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; andquantize the first updated weight, the second updated weight, and the third updated weight of the machine learning model.2.The apparatus of claim 1, wherein the adapter parameter is a scaling vector with a first element and a second element.3.The apparatus of claim 2, wherein:the division of the second weight and the third weight includes division of the second weight by the first element of the adapter parameter and division of the third weight by the first element of the adapter parameter; andthe multiplication of the first weight includes multiplication of the first weight by the first element of the adapter parameter.4.The apparatus of claim 2, wherein:the first weight is a vector of a set of key weights associated with a first set of keys;the second weight and the third weight are vectors with a set of query weights associated with a first set of queries;the multiplication of the first weight includes multiplication of the set of key weights by the first element of the adapter parameter; andthe division of the second weight and the third weight includes division of the set of query weights by the first element of the adapter parameter.5.The apparatus of claim 2, wherein:the first weight is a vector of a first set of key weights associated with a first set of keys and a second set of key weights associated with a second set of keys;the second weight is a vector of a first set of query weights associated with a first set of queries;the third weight is a vector of a second set of query weights associated with a second set of queries;the multiplication of the first weight includes multiplication of the first set of key weights by the first element of the adapter parameter and multiplication of the second set of key weights by the second element of the adapter parameter;the division of the second weight includes division of the first set of queries by the first element of the adapter parameter; andthe division of the third weight includes division of the second set of queries by the second element of the adapter parameter.6.The apparatus of claim 2, wherein the machine learning model is trained based on weight quantization encoding training.7.The apparatus of claim 6, wherein the training is on-device training.8.The apparatus of claim 2, wherein the machine learning model is quantized based on block-wise optimization.9.The apparatus of claim 2, wherein the scaling vector is adjusted based on a range of activation quantizers from a sequence of tokens.10.A method for optimizing a machine learning model, the method comprising:applying a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter;applying the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; andquantizing the first updated weight, the second updated weight, and the third updated weight of the machine learning model.11.The method of claim 10, wherein the adapter parameter is a scaling vector with a first element and a second element.12.The method of claim 11, wherein:the division of the second weight and the third weight includes division of the second weight by the first element of the adapter parameter and division of the third weight by the first element of the adapter parameter; andthe multiplication of the first weight includes multiplication of the first weight by the first element of the adapter parameter.13.The method of claim 11, wherein:the first weight is a vector of a set of key weights associated with a first set of keys;the second weight and the third weight are vectors with a set of query weights associated with a first set of queries;the multiplication of the first weight includes multiplication of the set of key weights by the first element of the adapter parameter; andthe division of the second weight and the third weight includes division of the set of query weights by the first element of the adapter parameter.14.The method of claim 11, wherein:the first weight is a vector of a first set of key weights associated with a first set of keys and a second set of key weights associated with a second set of keys;the second weight is a vector of a first set of query weights associated with a first set of queries;the third weight is a vector of a second set of query weights associated with a second set of queries;the multiplication of the first weight includes multiplication of the first set of key weights by the first element of the adapter parameter and multiplication of the second set of key weights by the second element of the adapter parameter;the division of the second weight includes division of the first set of queries by the first element of the adapter parameter; andthe division of the third weight includes division of the second set of queries by the second element of the adapter parameter.15.The method of claim 11, wherein the machine learning model is trained based on weight quantization encoding training.16.The method of claim 15, wherein the training is on-device training.17.The method of claim 11, wherein the machine learning model is quantized based on block-wise optimization.18.The method of claim 11, wherein the scaling vector is adjusted based on a range of activation quantizers from a sequence of tokens.19.A non-transitory computer readable medium storing code for optimizing a machine learning model, the code comprising instructions executable by a processor to:apply a floating-point adapter to the machine learning model to generate a first updated weight based on multiplication of a first weight of a first layer of the machine learning model by an adapter parameter of the floating-point adapter;apply the floating-point adapter to the machine learning model to generate a second updated weight and a third updated weight based on division of a second weight and a third weight of a second layer of the machine learning model by the adapter parameter; andquantize the first updated weight, the second updated weight, and the third updated weight of the machine learning model.20.The non-transitory computer readable medium of claim 19, wherein the adapter parameter is a scaling vector with a first element and a second element.

Citation Information

Patent Citations

  • Model training method

    CN114418088A

  • Neural network model quantification method, electronic equipment and readable storage medium

    CN115564028A

  • Model compression method, training method, multimedia data processing method and device

    CN117370798A

  • Computer systems for compressing transformer models and quantization training methods thereof

    US20240028888A1