Nonlinear encoding for machine learning model quantization

Non-linear integer quantization using a codebook and quantile function addresses the challenge of maintaining accuracy at ultra-low bitwidths in machine learning models, enhancing efficiency and reducing resource demands for on-device deployments.

WO2026236869A1PCT designated stage Publication Date: 2026-11-19QUALCOMM INC +7
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/094176
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2026-11-19

AI Technical Summary

Technical Problem

Existing quantization techniques for machine learning models, particularly large language and vision models, face challenges in maintaining accuracy while achieving ultra-low bitwidths, leading to inefficiencies and resource constraints, especially in on-device deployments.

Method used

Implementing non-linear integer quantization using a codebook of integer bins and a quantile function to map model weights, followed by scale quantization and dequantization, allowing for efficient ultra-low bitwidth representation of model parameters.

Benefits of technology

Enhances precision and reduces resource usage while maintaining high accuracy, facilitating deployment on resource-constrained devices with minimal performance impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025094176_19112026_PF_FP_ABST
    Figure CN2025094176_19112026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are systems, apparatuses, processes, and computer-readable media for machine learning models. For example, a computing device can, generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; quantize the scale to generate a quantized scale; and dequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.
Need to check novelty before this filing date? Find Prior Art

Description

NONLINEAR ENCODING FOR MACHINE LEARNING MODEL QUANTIZATIONFIELD

[0001] The present disclosure generally relates to performing machine learning operations using machine learning models (or systems) . For example, aspects of the present disclosure relate to nonlinear encoding for quantization of machine learning models (e.g., ultra-low bitwidth models) .BACKGROUND

[0002] Machine learning systems (or models) , such as neural networks (e.g., deep neural networks) are widely used for numerous applications, such as generative operations (e.g., to generate images, language / text outputs, etc. ) , object detection, object classification, object tracking, big data analysis, among others. For example, convolutional neural networks (CNNs) are able to extract high-level features, such as facial shapes, from an input image, and use these high-level features to output a probability that, for example, an input image includes a particular object.

[0003] A generative machine learning system can process data to generate desired output content from an input (e.g., a natural language input, input image (s) or video (s) , a noise input such as for diffusion models, etc. ) . For instance, a language-based generative machine learning model (e.g., a large language model (LLM) ) can generate natural language responses from natural language inputs and can incorporate various forms of data, such as audio, images and text. In some cases, a generative machine learning system can include an encoder that processes input features to generate output features (also referred to as embeddings or encodings) and can use the output features to generate relevant output content in a given form (e.g., in a natural language form, as generated images and / or video, as audio, explanation of the content, etc. ) .

[0004] A generative ML system can perform a wide range of tasks such as answering questions, providing explanations, generating creative content, assisting with coding, and offering recommendations. Various tools may be connected to the generative machine learning (ML) system to allow interaction with external systems, such as browsing the Internet, generating images, executing code, etc. Generative ML systems are designed to assist users in solving problems, learning new information, and enhancing productivity.SUMMARY

[0005] 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 has the sole purpose to present 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.

[0006] Systems and techniques are described for performing non-linear integer quantization. In some aspects, an apparatus for non-linear integer quantization is provided. The apparatus includes at least one memory and at least one processor coupled to the at least one memory and configured to: generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; quantize the scale to generate a quantized scale; and dequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.

[0007] In some aspects, a method for non-linear integer quantization is provided. The method includes: generating, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; quantizing a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; quantizing the scale to generate a quantized scale; and dequantizing the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.

[0008] In some aspects, a non-transitory computer-readable medium is provided having stored thereon instructions that, when executed by at least one processor, cause the at least one processor to: generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; quantize the scale to generate a quantized scale; and dequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.

[0009] In some aspects, an apparatus for non-linear integer quantization is provided. The apparatus includes: means for generating, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; means for quantizing a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; means for quantizing the scale to generate a quantized scale; and means for dequantizing the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.

[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.

[0011] While aspects are described in the present disclosure by illustration to some examples, those skilled in the art will understand that such aspects may be implemented in many different arrangements and scenarios. Techniques described herein may be implemented using different platform types, devices, systems, shapes, sizes, and / or packaging arrangements. For example, some aspects may be implemented via integrated chip implementations or other non-module-component based devices (e.g., end-user devices, vehicles, communication devices, computing devices, industrial equipment, retail / purchasing devices, medical devices, and / or artificial intelligence devices) . Aspects may be implemented in chip-level components, modular components, non-modular components, non-chip-level components, device-level components, and / or system-level components. Devices incorporating described aspects and features may include additional components and features for implementation and practice of claimed and described aspects. For example, transmission and reception of wireless signals may include one or more components for analog and digital purposes (e.g., hardware components including antennas, radio frequency (RF) chains, power amplifiers, modulators, buffers, processors, interleavers, adders, and / or summers) . It is intended that aspects described herein may be practiced in a wide variety of devices, components, systems, distributed arrangements, and / or end-user devices of varying size, shape, and constitution.

[0012] Other objects and advantages associated with the aspects disclosed herein will be apparent to those skilled in the art based on the accompanying drawings and detailed description. 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.

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

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

[0015] 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.

[0016] FIG. 2 is a block diagram illustrating a multimodal generative machine learning system for generating natural language responses based on natural language input from a prompt and any additional information, in accordance with some aspects of the disclosure.

[0017] FIG. 3 is a block diagram illustrating a generative response engine, in accordance with some aspects of the disclosure.

[0018] FIG. 4 is a graph illustrating an example of a distribution of weights (of a tensor, such as a weight tensor) extracted from a linear layer of a large language model (LLM) , in accordance with some aspects of the disclosure.

[0019] FIG. 5 is a diagram illustrating a comparison of an example of a linear distribution of weights of a tensor quantized based on an affine function and an example of a non-linear distribution of weights of a tensor quantized based on a codebook, in accordance with some aspects of the disclosure.

[0020] FIG. 6 is a graph illustrating an example of a quantile function (Q) of a normal distribution, in accordance with some aspects of the disclosure.

[0021] FIG. 7 is a flow diagram illustrating an example of a process for nonlinear integer (NINT) quantization, in accordance with some aspects of the disclosure.

[0022] FIG. 8 is a conceptual diagram illustrating a quantization process for generating tensors of a machine learning (ML) model in accordance with some aspects of the disclosure.

[0023] FIG. 9 shows a graph illustrating a comparison between quantile functions derived from real model weight scale data and a Gumbel distribution in accordance with some aspects of the disclosure.

[0024] FIG. 10A shows a graph of a probabilistic distribution of tensor values of an ML model in accordance with some aspects of the disclosure.

[0025] FIG. 10B shows a graph of a probabilistic distribution of tensor values from a codebook that is modified based on a quantile offset value in accordance with some aspects of the disclosure.

[0026] FIG. 11 illustrates an example of a dimension-aware lookup table (LUT) operation applied to a portion of a quantized tensor in a neural network model in accordance with some aspects of the disclosure.

[0027] FIG. 12 illustrates a data layout used for enabling high-throughput computation using single instruction multiple data (SIMD) instructions in accordance with some aspects of the disclosure.

[0028] FIG. 13 is a flow diagram illustrating an example of a process for nonlinear encoding for ultra-low bitwidth model quantization, in accordance with some aspects of the disclosure.

[0029] FIG. 14 is a block diagram of an example transformer, in accordance with some aspects of the disclosure.

[0030] FIG. 15 is a diagram illustrating an example of a system for implementing certain aspects described herein.DETAILED DESCRIPTION

[0031] Certain aspects of this disclosure are provided below for illustration purposes. Alternate aspects may be devised without departing from the scope of the disclosure. Additionally, well-known elements of the disclosure will not be described in detail or will be omitted so as not to obscure the relevant details of the disclosure. Some of the aspects described herein can be applied independently and some of them may 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 may be practiced without these specific details. The figures and description are not intended to be restrictive.

[0032] 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 example aspects will provide those skilled in the art with an enabling description for implementing an example aspect. It should be understood that various changes may 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.

[0033] 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.

[0034] Machine learning models can be trained to perform various functions and / or provide various types of outputs. For instance, some generative machine learning models can provide a conversational interface that uses natural language prompts as inputs, such as text or voice. In some examples, a user can provide an input prompt in natural language to the generative machine learning model, and the generative machine learning model can provide a response in natural language form. The input prompt and the output response can optionally be combined with one or more other types of information or data, such as images or files.

[0035] Previously trained machine learning models, such as generative machine learning models, can be fine-tuned to improve performance of the machine learning models for specific tasks. Fine-tuning can involve adapting a pre-trained machine learning model (e.g., a pre-trained generative machine learning model or other type of machine learning model) to a specific task by updating parameters (e.g., weights and / or other parameters) of the machine learning model using task-specific training data. The fine-tuning process allows the machine learning model to leverage its pre-existing knowledge while specializing in new tasks. Fine-tuning typically requires less data and compute than fully training a previously untrained machine learning model. Fine-tuning can thus be useful for improving performance of machine learning models on domain-specific tasks without sacrificing the benefits of large-scale pretraining.

[0036] While machine learning models (e.g., neural networks) are powerful architectures capable of a wide range of useful tasks, such as recognizing objects in image data, they are likewise highly resource dependent. For example, neural networks may require significant compute, memory, power, and / or time resources for training and / or for inferencing. These resource requirements may significantly limit the ability to train and deploy neural networks to certain types of devices and for certain use cases. For instance, training of machine learning models may be a computationally intensive process that can take a relatively long time, a large quantity of training data, and many operations.

[0037] 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 may 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 may 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.

[0038] Quantization of trained machine learning models allows quantized trained machine learning models to be efficiently deployed on various devices. Quantization may allow a quantized trained machine learning model to perform operations (e.g., at the inference phase of operation) on a device relatively quickly. Quantization may 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.

[0039] Post-Training Quantization (PTQ) is a process by which a trained machine learning model is quantized. For example, during training, a machine learning model may store parameters (e.g., weights) according to a first format that may allow a high degree of precision. For example, during training, the model may store parameters as floating-point numbers, such as 16-bit floating point numbers, which may be referred to as float16 or FP16, or 32-bit floating point numbers, which may be referred to as float32 or FP32. According to PTQ, after training is performed to generate the trained machine learning model and before the trained machine learning model is deployed onto a device for use by a device, the model may be quantized by, in part, changing the format used to store the parameters of the model from the first format to a second format (e.g., an integer format where the parameters are represented as integer numbers instead of floating point numbers) . The second format may use less memory and / or be less computational expensive to use. For example, after quantization, the model may store parameters as integer numbers such as 16-bit integer numbers (which may be referred to as Int16) , 8-bit integer numbers (which may be referred to as Int8) , 4-bit integer numbers (which may be referred to as Int4) , etc. It may be less computationally expensive to store and / or operate using integer numbers than floating point numbers. Thus, a device may 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 may be advantageous to quantize machine learning models.

[0040] Quantized Aware Training (QAT) is another quantization technique that allows a machine learning model to adapt to quantization during training, resulting in better performance after actual quantization is performed as compared to quantizing a fully trained model (e.g., using PTQ) . For example, using QAT, a machine learning model can be trained while simulating effects of actual quantization of weights and / or activations of the machine learning model during training. QAT can minimize accuracy loss when the machine learning model is eventually quantized to a different format, such as from floating point to an integer format, such as Int8.

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

[0042] Further, machine learning models may include activations. Activations can refer to values used as inputs and / or outputs of various functions, operations, and / or layers (or blocks or modules) of the machine learning model. The activations may have a certain format. For example, a function (of a particular layer) may expect to receive values formatted according to the certain format. For instance, the function may read the values from memory according to the certain format. Further, the function may output other values (e.g., based on processing the values read from memory by the function) according to a particular format (which may or may not be the same as the certain format) . For instance, the function may write the other values to memory in the particular format. For example, an unquantized trained machine learning model may use FP16 to pass values between functions (e.g., outputting values from one function and reading the values by another function) . The activations of the machine learning model can also be quantized. For example, quantizing activations may refer to obtaining values calculated by a layer (e.g., an output of an activation function of the layer) and in the format of discrete values. For instance, the values may be represented with fewer bits, such as 8-bit or 16-bit integer numbers instead of 32-bit floating point numbers. After quantization of the activations the machine learning model is configured to process and / or output, the quantized trained machine learning model may use Int8 or Int16 to pass the values between functions. The term “quantize, ” “quantizing, ” and like terms may refer to changing how activations are stored and / or used in a quantized machine learning model.

[0043] 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 may be quantized. The unquantized trained machine learning model may be provided an input, the quantized trained machine learning model may be provided the same input. Outputs of the models may be compared. A degree of difference between the outputs may be described as noise. Noise may be a way to describe degradation of a quantized machine learning model.

[0044] Not all elements of a neural network are equally resilient to quantization. That is, certain elements of a neural network may be more sensitive to quantization than others. Consequently, quantizing an entire neural network to a uniform bitwidth (referred to a fixed-precision quantization (FPQ) ) may result in reduced resource usage, but may also reduce task performance to an unacceptable level (e.g., a high amount of noise or error) . To resolve this issue, mixed-precision quantization (MPQ) seeks to quantize different elements (e.g., layers, blocks, modules, etc. ) of a neural network at varying quantization rates based on different sensitivity levels of the different elements (e.g., a first layer having a first sensitivity quantized using Int8, a second layer having a second sensitivity quantized using Int16, etc. ) , which results in reduced resource usage while maintaining task performance. For example, lower sensitivity elements may be quantized using lower bit precision (e.g., using Int4 instead of Int8 or Int16) and higher sensitivity elements may be quantized using higher bit precision (e.g., using Int8 or Int16) . The various elements of a neural network that may 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 bitwidth for elements more robust to quantization.

[0045] However, although MPQ techniques can be an effective technique for quantization, MPQ can create run-time challenges on hardware due to the need to convert from lower bitwidth representations to higher bitwidth representations, or vice versa, when performing operations (e.g., when performing matrix multiplication operations between values represented using different precision levels) . Such conversions can result in negative performance impacts, such as increased latency and power consumption.

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

[0047] Further, machine learning models may include activations. Activations can refer to values used as inputs and / or outputs of various functions, operations, and / or layers (or blocks or modules) of the machine learning model. The activations may have a certain format. For example, a function (of a particular layer) may expect to receive values formatted according to the certain format. For instance, the function may read the values from memory according to the certain format. Further, the function may output other values (e.g., based on processing the values read from memory by the function) according to a particular format (which may or may not be the same as the certain format) . For instance, the function may write the other values to memory in the particular format. For example, an unquantized trained machine learning model may use FP16 to pass values between functions (e.g., outputting values from one function and reading the values by another function) . The activations of the machine learning model can also be quantized. For example, quantizing activations may refer to obtaining values calculated by a layer (e.g., an output of an activation function of the layer) and in the format of discrete values. For instance, the values may be represented with fewer bits, such as 8-bit or 16-bit integer numbers instead of 32-bit floating point numbers. After quantization of the activations the machine learning model is configured to process and / or output, the quantized trained machine learning model may use Int8 or Int16 to pass the values between functions. The term “quantize, ” “quantizing, ” and like terms may refer to changing how activations are stored and / or used in a quantized machine learning model.

[0048] Large language models (LLMs) and large vision models (LVMs) consist of billions of parameters (e.g., weights) . The size of full-precision LLMs limits deployment options, which can make low-bit quantization an important technique for compression, especially for on-device scenarios, such as mobile device scenarios. As mentioned, quantization is the process of mapping a large set of values to a smaller set. In the context of LLMs, quantization typically involves mapping floating-point numbers (e.g., 32-bit floating point numbers) of weights to lower-bit representations (e.g., four-bit (4-bit) integers) . Algorithms involving vector quantization (VQ) or floating point (FP) format have been proposed to build a more precise representation of the weights under a normal distribution (e.g., an approximate normal distribution) . However, these approaches can introduce a significant overhead, which can include a high cost to determine optimal codebooks during the PTQ calibration stage and a high cost to map a low-bit representation back to high precision values during runtime.

[0049] Typically, LLMs and LVMs can be quantized to eight (8) bits, which can usually ensure a level of accuracy that is comparable to baseline floating-point models. However, as the desire to explore larger models (e.g., including ten billion (10B) parameters) on devices increases, lower bitwidths (e.g., four (4) bits) or ultra-low bitwidths (e.g., three (3) bits or less) are being widely explored. Maintaining a high level of accuracy while using a lower bitwidth quantization can be challenging and is being extensively researched in the industry, particularly for hardware optimization in on-edge device deployments.

[0050] As such, improved systems and techniques for quantization of parameters (weights) of large machine learning models (e.g., LLMs and LVMs) using a lower bitwidth quantization while maintaining a high level of accuracy can be beneficial.

[0051] In some aspects of the present disclosure, systems, apparatuses, methods (also referred to as processes) , and computer-readable media (collectively referred to herein as “systems and techniques” ) are described herein for nonlinear encoding for ultra-low bitwidth model quantization.

[0052] Various aspects relate generally to machine learning models. Some aspects more specifically relate to systems and techniques that provide solutions for nonlinear integer (NINT) quantization approaches, which are suitable for large model quantization. In one or more examples, the NINT quantization approaches include a general NINT quantization approach with a given data distribution, a NINT quantization approach based on a normal distribution, an adaptive NINT quantization approach, a mixed precision NINT quantization approach, a high dimension NINT quantization approach, a two-dimensional (2D) rotation-based NINT quantization approach, and a piecewise linear NINT quantization approach.

[0053] In one or more examples, a system and technique for non-linear integer quantization can include one or more processors and one or more memories. In some examples, the one or more processors can generate, based on a quantile function (Q) , a codebook (qi) comprising a plurality of integer-valued bins (n) . The quantile function (Q) may be selected based on the distribution of model weights and can include, in some cases, a normal distribution, Gumbel distribution, or other mathematically derived inverse cumulative functions. In one or more examples, each model weight from a tensor (x) (e.g., a weight tensor) of a machine learning model can be mapped to one of the integer-valued bins (n) of the codebook (qi) , resulting in a quantized tensor (xquant) comprising integer values. A scale can also be determined based on the maximum absolute value or other normalization metric for the tensor (x) , and the processor can compute a quantized scale which is used to perform dequantization via multiplication with (xquant) to recover an approximation  of the original tensor.

[0054] In some aspects, the values in the codebook (qi) can be normalized with respect to a selected range, and the scale can be computed on a per-channel basis to reflect local dynamic range. The model weights can include either floating-point or integer values. When the input tensor (x) is composed of integer values, the processor can additionally discard least significant bits (LSBs) per channel, based on the dynamic range of each channel, to derive a quantized scale with lower precision overhead. In one or more examples, the system can compute a superscale derived from the quantized scale, and the superscale can itself be quantized to produce a quantized superscale. The final dequantized tensor  can be computed using both the quantized scale and the quantized superscale.

[0055] In one or more examples, the processor can determine a quantile offset (b) based on the distribution of the original model weights. The quantile offset value (b) can be stored with the quantized tensor and used during decoding. In some examples, the quantization of tensor (x) can include vector-based techniques where groups of weights are organized into multiple vectors. Each vector can be defined by a vector length and vector angle, and a signed codebook can be generated to represent the reduced vector space. The number of dimensions in the signed codebook can be selected based on both the number of vectors and the hardware-supported maximum LUT size.

[0056] In one or more examples, the processor can split each vector into a first portion (e.g., quantile index entries) and a second portion (e.g., sign entries) , and can shift and interleave the portions in a register layout that supports SIMD-style instruction execution. The signed entries may be derived from a Hadamard matrix or similar structure and packed into 2-bit lanes while quantile indices are packed in 4-bit lanes. The interleaving allows the processor to execute a fused SIMD instruction that performs quantile lookup and sign-based arithmetic in a single cycle. In some examples, during or after dequantization, the processor may optionally rescale the quantized tensor to compensate for previously discarded bits, ensuring high-fidelity reconstruction while maintaining compression efficiency.

[0057] Particular aspects of the subject matter described in this disclosure can be implemented to realize one or more of the following potential advantages. In one or more examples, the systems and techniques have the benefit of providing a higher level of precision for quantization as compared with an integer (INT) data format quantization of the same bitwidth. In one or more examples, the systems and techniques provide the benefit of a natural combination of binary quantization (BQ) and vector quantization (VQ) techniques. In some examples, the systems and techniques provide the benefit of effortless calibration as compared with current BQ and VQ approaches. In one or more examples, the systems and techniques provide the benefit of a flexible configuration that can adapt to different data distributions in order to ensure a high level of accuracy.

[0058] In one or more examples, during operation of the systems and techniques for non-linear integer quantization, one or more processors can generate, based on a quantile function (Q) , a codebook (qi) including a plurality of bins (n) . In one or more examples, each bin of the plurality of bins can be an integer number. In some examples, the one or more processors can quantize a tensor (x) of a machine learning model, based on mapping each model weight of a plurality of model weights of the tensor (x) to a bin (n) of the plurality of bins of the codebook (qi) , to generate a quantized tensor (xquant) . In one or more examples, the quantized tensor (xquant) can include a plurality of integer numbers. In some examples, each integer number of the plurality of integer numbers can correspond to one bin of the plurality of bins of the codebook (qi) . The one or more processors can dequantize the quantized tensor (xquant) , based on multiplying the quantized tensor (xquant) with a scale (s) , to generate a dequantized tensor

[0059] In one or more examples, the integer numbers of the plurality of bins of the codebook (qi) can be normalized based on a normalization range (Z) . In some examples, quantizing the tensor (x) can further include determining the scale (s) based on a maximum absolute value of the tensor (x) , and dividing the tensor (x) by the scale (s) . In some examples, the quantile function (Q) is a normal distribution function. In one or more examples, each model weight of the plurality of model weights of the tensor (x) can be a floating-point number. In some examples, generating the codebook (qi) including the plurality of bins (n) can further be based on a quantile function offset (b) .

[0060] In some examples, the machine learning model can include a plurality of tensors comprising the tensor (x) , and wherein each tensor of the plurality of tensors is quantized based on a respective codebook (qi) . In one or more examples, each respective codebook (qi) can be generated based on a respective quantile function offset (b) . In some examples, each respective codebook (qi) can include a respective number of bins (n) . In one or more examples, the quantile function (Q) can be based on a plurality of linear functions.

[0061] In one or more examples, each model weight of the plurality of model weights of the tensor (x) can be an integer. In one or more examples, generating the codebook (qi) including the plurality of bins (n) can be further based on determining a frequency of occurrence of the integers of the plurality of model weights of the tensor (x) . In some examples, the one or more processors can generate a plurality of vectors based on producing groups of model weights of the plurality of model weights together (e.g., each vector of the plurality of vectors can include a respective group of the groups, and each vector of the plurality of vectors can have a respective vector length and / or a respective vector angle) , and can remove one or more of the vectors of the plurality of vectors based on the respective vector lengths and / or the respective vector angles. In one or more examples, the quantile function (Q) can be based on a plurality of linear functions.

[0062] Additional aspects of the present disclosure are described in more detail below. Various aspects of the systems and techniques described herein will be discussed below with respect to the figures.

[0063] As used herein, the phrase “based on” shall not be construed as a reference to a closed set of information, one or more conditions, one or more factors, or the like. In other words, the phrase “based on A” (where “A” may be information, a condition, a factor, or the like) shall be construed as “based at least on A” unless specifically recited differently.

[0064] In some aspects, each of the apparatuses, computing devices, etc. described herein is, can be part of, or can include a mobile device (e.g., a mobile telephone or so-called “smart phone” or other mobile device) , a vehicle or a component, device, or system of a vehicle, an extended reality (XR) device (e.g., a virtual reality (VR) device, an augmented reality (AR) device, or a mixed reality (MR) device) , a wearable device, a smart or connected device (e.g., an Internet-of-Things (IoT) device) , a camera system, a personal computer, a laptop computer, a tablet computer, a server computer, a robotics device or system, an aviation system, or other device. In some aspects, the apparatuses, computing devices, etc. may include one or more image sensors (e.g., camera (s) ) for capturing one or more images. In some aspects, the apparatuses, computing devices, etc. may include one or more displays for displaying one or more images, notifications, and / or other displayable data. In some aspects, the apparatuses, computing devices, etc. may include one or more speakers, one or more light-emitting devices, one or more microphones, etc. In some aspects, the apparatuses, computing devices, etc. may include one or more sensors, such as one or more sensors used for determining a location of the apparatus (es) , device (s) , a state (e.g., a tracking state, an operating state, a temperature, a humidity level, and / or other state) of the of the apparatus (es) , device (s) , etc., and / or for other purposes.

[0065] FIG. 1 illustrates an example implementation of a system 100, which may include a central processing unit (CPU) , configured to perform one or more of the functions described herein. System 100, which may include a central processing unit (CPU 102) (which may be a multi-core CPU) . 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 may 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 may be distributed across multiple blocks. Instructions executed at the CPU 102 may be loaded from a program memory associated with the CPU 102 or may be loaded from memory 116.

[0066] The system 100 may also include additional processing blocks tailored to specific functions, such as the GPU 104, the DSP 106, a connectivity engine 118, which may 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 may also include one or more sensor processor (s) 114, one or more image signal processors (ISP (s) 110) , and / or navigation engine 120, which may 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.

[0067] The system 100 may be implemented as a system on a chip (SoC) . The system 100 may be based on an Advanced Reduced Instruction Set Computer (RISC) Machine (ARM) instruction set. The system 100 and / or components thereof may 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 may 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.

[0068] 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. One example of a ML system is a neural network (also referred to as an artificial neural network) , which may include an interconnected group of artificial neurons (e.g., neuron models) . Neural networks may 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.

[0069] Individual nodes in a neural network may 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 may be multiplied by a corresponding weight value, and the products may be summed. The sum of the products may be adjusted by an optional bias, and an activation function may 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 may 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) .

[0070] 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, diffusion-based neural networks, among others. For instance, convolutional neural networks (CNNs) are a type of feed-forward artificial neural network. Convolutional neural networks may 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 this 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 may be fed into an input layer, and one or more hidden layers provide levels of abstraction to the data. Predictions may then be made on an output layer based on the abstracted data.

[0071] Deep learning (DL) is one 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.

[0072] 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.

[0073] A deep learning architecture may learn a hierarchy of features. If presented with visual data, for example, the first layer may learn to recognize relatively simple features, such as edges, in the input stream. In another example, if presented with auditory data, the first layer may learn to recognize spectral power in specific frequencies. The second layer, taking the output of the first layer as input, may learn to recognize combinations of features, such as simple shapes for visual data or combinations of sounds for auditory data. For instance, higher layers may learn to represent complex shapes in visual data or words in auditory data. Still higher layers may learn to recognize common visual objects or spoken phrases.

[0074] Deep learning architectures may perform especially well when applied to problems that have a natural hierarchical structure. For example, the classification of motorized vehicles may benefit from first learning to recognize wheels, windshields, and other features. These features may be combined at higher layers in different ways to recognize cars, trucks, and airplanes.

[0075] Neural networks may 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 may be built up in successive layers of a feed-forward network, as described above. Neural networks may also have recurrent or feedback (also called top-down) connections. In a recurrent connection, the output from a neuron in a given layer may be communicated to another neuron in the same layer. A recurrent architecture may 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 connection (or top-down connection) . A network with many feedback connections may be helpful when the recognition of a high-level concept may aid in discriminating the particular low-level features of an input.

[0076] FIG. 2 is a block diagram illustrating a multimodal generative ML system 200 for generating natural language responses based on natural language input from a prompt 202 and any additional information. A multimodal machine learning system is a machine learning model that receives, processes, and outputs data in multiple forms. For example, the input prompt may include text, images, and audio.

[0077] For example, the multimodal generative ML system 200 includes a plurality of encoders 204 that are each configured to encode different modes of content (e.g., text, images, audio, etc. ) into different tokens within a common embedding space. For example, a text input may be segmented based on different techniques (e.g., paragraph, sentence, etc. ) and encoded by a text encoder (from the encoders 204) into tokens. In another example, one or more images can be provided to an image encoder (from the encoders 204) that extracts features associated with the image and generates tokens representing the visual features. In another example, audio can be provided to an audio encoder (from the encoders 204) that extracts features associated with the image and generates tokens representing the audio features. In the case of audio, the audio encoder can identify features that can include formants that characterize resonant frequencies in speech, rhythmic features related to timing and tempo, and harmonic features that describe the relationship between fundamental frequencies and their harmonics.

[0078] The different tokens from the plurality of encoders are provided to combiner 206. The combiner 206 can combine the tokens based on the order in which they are presented. For example, the input into the encoder may be an array of primitive values. A primitive value is an immutable data type provided by a programming language and includes values that represent a single piece of data (e.g., number, string, Boolean, etc. ) rather than a complex object or reference. A non-limiting example prompt may include a byte array (e.g., an unsigned 8-byte integer array or uint8array) , and another string. The byte array may be audio, images, or other content that can be processed by the encoders 204. In some aspects, the combiner 206 is configured to concatenate the different tokens in order based on the array to preserve the semantic order of features and provide the tokens to the generative machine learning model 208.

[0079] The generative machine learning model 208 is configured to receive the tokens and generate a natural language response 212 based on the tokens and the prompt 202. Generative machine learning model 208 may include one or more models 210 (e.g., transformer neural network (s) , diffusion model (s) , fully connected layer (s) , multilayer perceptrons (MLPs) , any combination thereof, and / or other models) . The one or more models 210 of the generative machine learning model 208 are configured to process the tokens and extract different types of features that are relevant to the prompt 202. For example, the prompt 202 can be a query for a particular type of information. The one or more models of the generative machine learning model 208 can perform different tasks related to the query, such as writing code to perform a particular function, generating an image based on an input image with expressed modifications, generate an image without any input image, and so forth.

[0080] The generative machine learning model 208 may include different components, such as a featurization engine to identify different types of features, an inference engine to identify inferences within the text (e.g., pronoun usage and corresponding disambiguation functions) , data retrieval engines (e.g., to identify features related to a particular concept observed by the generative machine learning model 208) , and so forth. The generative machine learning model 208 may also include different types of models and engines to synthesize a coherent contextual output, such as to synthesize the input content and information that is responsive to tasks embedded within the text. For example, the generative machine learning model 208 may include a predictive output engine (not shown) that is configured to generate a sequence of words that is most likely contextually correct and to provide a coherent and contextually relevant answer. For instance, the predictive output generation engine can generate responses by sampling from the probability distribution of possible words and sequences based on patterns observed during training. The generative machine learning model 208 may also include a predictive output generation engine to generate multiple responses that are potentially relevant and coherent with respect to the prompt 202. The generative machine learning model 208 may also include an output validation engine configured to evaluate the generated responses based on certain criteria. Non-limiting examples of criteria to evaluate generated responses include relevance to the prompt, coherence, fluency, and adherence to specific guidelines or rules. Based on the evaluation, the output validation engine may select and output the most appropriate response.

[0081] As noted above, the generative machine learning model 208 may include various types of models (e.g., machine learning models) , such as a transformer. A transformer is a neural network architecture that can be trained to perform one or more natural language processing (NLP) tasks, such as language translation, sentiment analysis, and text summarization. Conventional traditional recurrent neural networks (RNNs) process data in sequence. A transformer or transformer network can process input in parallel and can thus be faster and more efficient than sequential training and processing. In some aspects, a transformer can use a self-attention mechanism (e.g., one or more self-attention layers) , which allows the transformer to identify the most relevant parts of the input text or content (e.g., audio or video) . In some cases, a transformer can also use a cross-attention mechanism (e.g., one or more cross-attention layers) which uses other content or data to determine the most relevant parts of the input. For example, cross-attention mechanisms are useful in sequential content such as a stream of data, such as optical flow, and other computer vision techniques.

[0082] A transformer neural network can include a multi-layer encoder-decoder architecture. For instance, an encoder of the encoder-decoder architecture can receive text as input, convert the input text into a sequence of hidden representations, and capture the meaning of the text at different levels of abstraction. A decoder of the encoder-decoder architecture can then process the representations output from the decoder to generate an output sequence, such as a text translation or a summary. The encoder and decoder can be trained together using supervised learning, unsupervised learning, or a combination of supervised and unsupervised learning techniques, such as maximum likelihood estimation and self-supervised pretraining. Illustrative examples of transformer engines include a BERT model, a Text-to-Text Transfer Transformer (T5) , biomedical BERT (BioBERT) , scientific BERT (SciBERT) , and the SPECTER model for document-level representation learning. In some aspects, multiple transformer engines may be used to generate different tokens.

[0083] In some aspects, the generative machine learning model 208 may be executed using a neural engine (or multiple neural engines) for on-device execution, such as a neural processing unit (NPU) , a neural signal processor (NSP) , a digital signal processor (DSP) , any combination thereof, and / or other neural engine. The neural engine can include a plurality of neural processing cores that are configured to parallelize operations associated with neural networks. A neural processing core can include arrays of multiply-accumulate (MAC) units and specialized instructions that are optimized for matrix operations, such as convolution and matrix multiplication. The neural processing core can receive input data and perform matrix transformations and nonlinear activation functions to break down and parallelize matrix operations. The neural processing core can perform tasks such as inference (e.g., runtime operation of a machine learning model) or training of deep learning models. The neural processing core can accelerate tasks by parallelization of larger computations that can be performed in parallel (e.g., matrix operations associated with neural networks) . For instance, the neural engine may perform computer vision tasks such as object recognition. In some cases, the neural engine can be implemented based on various ML libraries such as PyTorch, which interfaces with the compute unified device architecture (CUDA) to parallelize operations.

[0084] In some aspects, the generative machine learning model 208 may be a small generative model that has fewer parameters, fewer layers, fewer neurons, or a simpler architecture compared to larger models. A small generative model may not capture the full complexity of the underlying data distribution as effectively as larger models but can still be useful in scenarios where computational resources are limited or where a simpler model is sufficient for the task. Small generative models can also be easier to train and interpret, making them suitable for certain applications. For example, ChatGPT-3.5 has 175 billion parameters that results in a size of 1.4 Terabytes (TB) for a model implemented with double-precision floating point numbers. A smaller model may have a simpler architecture, use fewer parameters (e.g., 10 million) , and use less precise numbers (e.g., single-precision floating point numbers) resulting in a size of 38 Megabytes (MB) .

[0085] In addition, small models benefit from increased training based on local execution and data specific to a local device and a user of that local device. An additional benefit to small models is increased privacy because the information is not transmitted over the network and only relies on information requested by the user or usage at the local device.

[0086] FIG. 3 is a conceptual block diagram of a generative response engine 300 that is configured for multimodal input and output in accordance with some aspects of the disclosure. In some aspects, the generative response engine 300 is configured to receive a prompt 302 (e.g., from a user, an application programming interface (API) request, etc. ) and perform various processing to generate a response 304 that is responsive to the prompt 302 that is contextually accurate. In some aspects, the prompt 302 may be an array of primitive values, such as text, binary data (byte arrays, etc. For example, the prompt may be a union type that combines different types of primitive data (e.g., string uint8array in JavaScript) .

[0087] The generative response engine 300 includes a generative machine learning model 318. In some aspects, the generative response engine 300 includes a plurality of adapters (e.g., LoRA) that are trained to improve performance of a base machine learning model (also referred to as a base model) of the generative response engine 300 during inference. The plurality of adapters can be trained to perform different tasks. For example, a first adapter may be trained to perform a first task, and a second adapter a second task and so forth. In this manner, the independently trained adapters are configured to prevent the generative response engine 300 from defaulting to the application of the base model’s weights (which can be referred to as base model weights or base weights) and allow the combination of the base model and the adapters to accurately provide specialized responses that correspond to the fine tuning.

[0088] The generative response engine 300 includes various components, such as a segmenter 310, a classifier 312, a plurality of encoders 314, a combiner 316, and the generative machine learning model 318. The segmenter 310 is configured to segment different content into different portions based on various limitations, such as text size, image size, and so forth. In some cases, the segmenter 310 may also reduce the scope of content (e.g., by reducing a size of an input image) based on limitations of one or more machine learning models of the generative response engine 300. For example, the machine learning model (s) may be trained on a particular size input to extract important features. The segmenter 310 may also segment text into different chunks, such as into individual sentences or paragraphs.

[0089] In some aspects, the classifier 312 may be configured to classify the input. For example, the classifier 312 may be configured to generate embeddings that represent features associated with the input (e.g., segmented text, images, etc. ) in a vector space. An embedding is a representation of a discrete object, such as a word, a document, or an image, as a continuous vector in a multi-dimensional space. An embedding captures the semantic or structural relationships between the objects, such that similar objects are mapped to nearby vectors, and dissimilar objects are mapped to distant vectors. Embeddings are commonly used in machine learning, computer vision, and natural language processing tasks, such as language modeling, sentiment analysis, and machine translation. Embeddings can be learned from large corpora of data using unsupervised learning algorithms, such as word2vec, GloVe, or fastText, which optimize the embeddings based on the co-occurrence or context of the objects in the data. Once learned, embeddings can be used to improve the performance of downstream tasks by providing a more meaningful and compact representation of the objects. In some aspects, the classifications are provided to the generative machine learning model 318 to activate specific learned domains.

[0090] In some cases, the classifier 312 may be configured to classify the input based on a plurality of clusters. The plurality of clusters may represent different semantic spaces for the operation of the generative response engine 300. The plurality of clusters may be related to different specialized tasks, data, or other operations and represent different domains of the generative response engine 300. For example, a generative model trained for customer service may need to learn different domains of knowledge, such as identification of products or services, accounting and billing information, a corpus of documents to help diagnose problems or provide information, and so forth. The plurality of clusters can be determined based on the input and output from the generative response engine 300.

[0091] In some cases, the classifier 312 may generate a probability for the prompt 302 (e.g., for each cluster) based on the output from the segmenter 310. The probability represents a likelihood that the prompt 302 is associated with features (e.g., features in a corresponding cluster) . In some aspects, the classifier 312 provides the probabilities associated with each cluster and the embeddings to the generative machine learning model 318.

[0092] The segmented portions of the prompt 302 can then be provided as input to a plurality of encoders 314 (e.g., the encoders 204 in FIG. 2) to extract various features and generate tokens associated with those features. In some aspects, each encoder 314 is configured for a different modality or different type of input. For example, the generative response engine 300 may include an encoder 314 for encoding text, an encoder 314 for encoding images, an encoder 314 for encoding audio, etc. There may be additional encoders based on the different modalities. For example, there may be an encoder 314 for handling different types of documents (e.g., PDF, etc. ) .

[0093] The combiner 316 (e.g., the combiner 206 in FIG. 2) receives the tokens from the encoders 314 and synthesizes tokens that represent the prompt 302. For example, the combiner 316 can be configured to concatenate the tokens from the encoders 314 in the correct order to preserve the semantic context of the content. In some cases, the encoders 314 may be configured to execute the encoding operations in parallel and because different content may be encoded at different rates, the tokens may be received out of order. The combiner 316 may receive information (e.g., from the segmenter 310 and / or from the encoders 314) to identify how to sequence the embeddings into an input suitable for the generative machine learning model 318 (e.g., an array of tokens) .

[0094] In some aspects, the generative machine learning model 318 is configured to use the embeddings during inference to begin inference operation based on the prompt 302. In some aspects, the probabilities from the classifier 312 can be used by the generative machine learning model 318 to activate at least one adapter based on the probability associated with that adapter. In some aspects, because the adapters are tuned independently based on clustered data, the adapters provide a stronger response based on the identification of features that more accurately represent that different classification.

[0095] The generative machine learning model 318 may be configured to synthesize the response 304 based on the probabilities provided by the classifier 312 and the generative machine learning model 318.

[0096] As previously mentioned, LLMs and LVMs have of billions of parameters (e.g., weights) . The sizes of full-precision LLMs limit deployment options, which can make low-bit quantization an important technique for compression, especially for on-device scenarios (e.g., mobile device scenarios) . As previously noted, quantization is the process of mapping a large set of values to a smaller set. In the context of LLMs, quantization usually involves mapping floating-point numbers (e.g., 32-bit floating point numbers) of weights of a tensor to lower-bit representations (e.g., four-bit (4-bit) integers) .

[0097] A uniform distribution is the mathematical nature of the integers. As such, the most direct way to obtain low-bit representations of the weights is to use an affine function, which is given as: where x is the original value (e.g., the tensor including the weights) , s is a scale factor  (e.g., the step size between the quantized values) , and Q (x) is the quantized value (e.g., a quantile function) .

[0098] However, the distribution of the weights is non-linear in practice (e.g., in reality) . FIG. 4 shows an example of a non-linear distribution of weights. In particular, FIG. 4 is a graph 400 illustrating an example of a distribution of weights 420 (of a tensor) extracted from a linear layer of a large language model (LLM) . In FIG. 4, the graph 400 shows a comparison of the non-linear distribution of the weights 420 with a normal distribution 410. As shown in the graph 400, the non-linear distribution of the weights 420 is a non-uniform distribution with long tails on either side, which include weights that can be referred to as outliers. The weights become more dense as they approach the zero-point of the distribution 410.

[0099] FIG. 5 shows an example of weights being denser around a zero-point within a non-linear distribution as compared to a linear distribution. In particular, FIG. 5 is a diagram illustrating a comparison 500 of an example of a linear distribution of weights 510 of a tensor quantized based on an affine function and an example of a non-linear distribution of weights 520 of a tensor quantized based on a codebook. In FIG. 5, the linear distribution of weights 510 of a tensor quantized based on an affine function is shown to have even spacings amongst the weights 530. FIG. 5 also shows that the non-linear distribution of weights 520 of a tensor quantized based on a codebook has weights 540 with uneven spacings, where the weights around the zero-point are denser and closely spaced from each other.

[0100] Currently, FP format and vector quantization (VQ) methods are typically the implementations of such non-linear distributions. However, the FP format and vector quantization (VQ) methods are not optimal and are not appropriate for integer-based computations. As such, a non-linear format can be used to represent the distributions more precisely.

[0101] In non-linear quantization, there are currently existing codebook designs, which include NormalFloat 4-bit (NF4) . NF4 has become widely used in LLMs as well as other machine learning models. NF4 utilizes one fixed static codebook, which can be shared across blocks. The codebook is generated by splitting a tensor (e.g., of a LLM) into several blocks. Each block can then be scaled to be within a range from negative one (-1) to one (1) . The values in each block can then be mapped to sixteen (16) discrete values, which can each be indexed by four (4) bits. As such, all of the values are quantized to four bits. An example of 16 discrete values is as follows: [-1.0, -0.6961928009986877, -0.5250730514526367, - 0.39491748809814453, -0.28444138169288635, -0.18477343022823334, -0.09105003625154495, 0.0,0.07958029955625534, 0.16093020141124725, 0.24611230194568634, 0.33791524171829224, 0.44070982933044434, 0.5626170039176941, 0.7229568362236023, 1.0]

[0102] In one or more examples, given a bitwidth k, quantization bins qi of a tensor X can be derived from a quantile function Q of the distribution of X. In one or more examples, the quantile function is the inverse function of a cumulated distribution function (CDF) . In NF4, the quantile function Q is fixed and derived based on the normal distribution. In one or more examples, if k=4, the codebook is {q0, q1, …, q15} , which includes 16 discrete values.

[0103] FIG. 6 is a graph 600 illustrating an example of a quantile function (Q) of a normal distribution. In FIG. 6, the curve 610 of the graph 600 is a realization of the quantile function (Q) of a normal distribution. In one or more examples, the 16 discrete values can be obtained from the curve 610.

[0104] In one or more aspects, algorithms, such as vector quantization or FP format, have been used to obtain a more precise representation of the weights data under a normal distribution. However, these approaches introduce significant overheads, including huge costs to determine optimal codebooks during PTQ calibration stage and high costs to map a low-bit representation back to high precision values during runtime.

[0105] As mentioned, NF4 quantization is widely used in LLM. However, NF4 is designed and optimized for FP computation, particularly on graphic processing units (GPUs) , which are not suitable for integer-based computation. With the assumption of a normal distribution, the NF4 design can cause large drop in accuracy, as there can be a significant difference between the tensor weight distribution and the normal distribution, especially when dealing with small block sizes. The NF4 design is fixed and static, which limits its ability to adapt to new variants of quantization and model usages. The accuracy of NF4 cannot be extended to ultra-low bitwidth quantization, such as two (2) bits.

[0106] Therefore, improved systems and techniques for quantization of parameters (weights) of large machine learning models (e.g., LLMs and LVMs) using a lower bitwidth quantization while maintaining a high level of accuracy can be useful.

[0107] In one or more aspects, the systems and techniques provide nonlinear encoding for ultra-low bitwidth model quantization. In one or more examples, the systems and techniques provide solutions that employ nonlinear integer (NINT) quantization approaches, which are suitable for large model quantization. In one or more examples, the NINT quantization approaches include a general NINT quantization approach with a given data distribution, a NINT quantization approach based on a normal distribution, an adaptive NINT quantization approach, a mixed precision NINT quantization approach, a high dimension NINT quantization approach, a 2D rotation-based NINT quantization approach, and a piece wise linear NINT quantization approach.

[0108] In some aspects, the systems and techniques provide solutions that involve designing a codebook based on quantile functions to better match data distributions, facilitating precise quantization that aligns with the characteristics of the input data. In one or more examples, an approach uses a parameterized codebook to improve allocation in quantization bins, aligning quantization with normal distribution patterns found in the data (e.g., the weights) . In some examples, a method tailors the quantization process to deviations in real-world data distributions, allowing for dynamic adaptation during the quantization process. In one or more examples, the systems and techniques allow for sub-4 bit quantization by adjusting bin capacities, enabling more efficient data representation while maintaining precision. In some examples, vector quantization is used to maintain data structure in high-dimensional data, ensuring that the inherent data patterns are preserved during quantization. In one or more examples, an approach uses a piecewise linear approximation for improved accuracy and efficiency, enhancing the quantization process by closely matching data characteristics.

[0109] In one or more aspects, the systems and techniques provide a general NINT quantization approach with a given data distribution. FIG. 7 shows an example process for the general NINT quantization approach with a given data distribution. In particular, FIG. 7 is a flow diagram illustrating an example of a process 700 for nonlinear integer (NINT) quantization.

[0110] In one or more examples, during operation of the process 700 of FIG. 7, at block 702, one or more processors can determine a NINT codebook (qi) . For example, the one or more processors can generate, based on a quantile function (Q) , the codebook (qi) including a plurality of bins (n) . In one or more examples, each bin of the plurality of bins can be an integer number. In one or more examples, the integer numbers of the plurality of bins of the codebook (qi) can be normalized based on a normalization range (Z) . In some examples, generating the codebook (qi) including the plurality of bins (n) can be further based on a quantile function offset (b) . In one or more examples, the codebook can be formulated as: where n is the number of quantized bins, Q is the quantile function (e.g., a normal  distribution function) , b is a quantile function offset, and Z is the normalization scale (range) for given one block tensor.

[0111] For an example, when n=16, Q is a normal distribution quantile function, and b =1 / 31, the 16 bins in signed 8-bit integers are: codebook q = [-128, -89, -67, -51, -37, -24, -12, 0, 10, 20, 31, 43, 56, 71, 92,  127]

[0112] Referring back to the process 700 of FIG. 7, at block 704, the one or more processors can quantize a tensor based on the codebook. For example, the one or more processors can quantize a tensor (x) of a machine learning model, based on mapping each model weight of a plurality of model weights of the tensor (x) to a bin (n) of the plurality of bins of the codebook (qi) , to generate a quantized tensor (xquant) . In one or more examples, each model weight of the plurality of model weights of the tensor (x) can be a floating-point number. In one or more examples, the quantized tensor (xquant) can include a plurality of integer numbers. In some examples, each integer number of the plurality of integer numbers can correspond to one bin of the plurality of bins of the codebook (qi) .

[0113] For example, starting from a codebook q, the tensor x can be quantized as follows: s=max (abs (x) )

[0114] As such, in one or more examples, quantizing the tensor (x) can include determining the scale (s) based on a maximum absolute value of the tensor (x) , and dividing the tensor (x) by the scale (s) .

[0115] In some examples, each model weight of a plurality of model weights of the tensor (x) can be mapped to a bin (n) of the plurality of bins of the codebook (qi) to generate a quantized tensor xquant, as follows:

[0116] Referring back to the process 700 of FIG. 7, at block 706, the one or more processors can dequantize the quantized tensor from the NINT codebook. For example, the one or more processors can dequantize the quantized tensor (xquant) , based on multiplying the quantized tensor (xquant) with a scale (s) , to generate a dequantized tensor

[0117] In one or more examples, the dequantization of xquant can be achieved by mapping the tensor (x) to quantile q and multiplying by scale s, as shown as follows:

[0118] In some aspects, the systems and techniques provide a NINT quantization approach based on a normal distribution. As mentioned, classical NF4 uses a fixed static codebook to minimize the computational costs during quantization and dequantization. However, the mass distributed in each quantization bin is not properly allocated in tail bins (e.g., higher deviations of a normal Gaussian distribution)

[0119] In one or more examples, instead of using a fixed codebook, the systems and techniques can employ a parameterized codebook under a normal distribution, for 4-bit quantization, which can be formulated as: where Q is the quantile function of a standard normal distribution, b is a flexible  parameter, and k=1 / 2-b, Z=-Q (b) .

[0120] In one or more examples, the quantile function (Q) is a normal distribution function. In some examples, each model weight of the plurality of model weights of the tensor (x) can be a floating-point number. In some examples, generating the codebook (qi) including the plurality of bins (n) can be based on a quantile function offset (b) . In some examples, the machine learning model can include a plurality of tensors comprising the tensor (x) , and each tensor of the plurality of tensors can be quantized based on a respective codebook (qi) . In one or more examples, each respective codebook (qi) of the respective codebooks (qi) can be generated based on a respective quantile function offset (b) , such that the quantile function offset (b) is not fixed and is flexible. In one or more examples, the respective codebook (qi) for each tensor (x) can be computed using a different quantile function offset (b) .

[0121] For an example, given the top and bottom 1 / 31 of the mass in the normal distribution are clipped (removed) , while the remaining mass in the normal distribution is split into seven negative bins and eight positive bins.

[0122] FIG. 8 is a conceptual diagram illustrating a quantization process 800 for generating tensors of an ML model in accordance with some aspects of the disclosure. In some aspects, the quantization process is configured to convert formats of an ML model into a suitable format for hardware implementations using integer-based operations. In some aspects, a high precision weight tensor 802 of an ML model is provided to a NINT quantization 810. The high precision weight tensor 802 may be an object that generalizes scalars, vectors, and matrices to higher dimensions and is used to represent data with multiple indices or coordinates. For example, the high precision weight tensor 802 may include floating point values representing many different dimensions (e.g., several thousand) . Floating-point representation allows precise calculations but introduces significant storage and computational inefficiency in hardware designed for integer computations.

[0123] The high precision weight tensor 802 is input into a first NINT quantization 810 to quantize the high precision weight tensor 802 into a form suitable for hardware implementation (e.g., integer) and results in a low bit tensor weight 812 and a high precision scale 814. In some aspects, the NINT quantization 810 may be a NINT that applies a nonlinear function such as a quantile function. In one example, the NINT quantization 810 may map values of the high precision weight tensor 802 into a codebook that corresponds to a quantile function and preserves greater accuracy or dynamic range of the floating point values of the high precision weight tensor 802. For example, floating point values close to zero or at the extremes of the FP representation are preserved with higher fidelity. In some aspects, NINT may reduce conversion errors and maintain better numerical properties and nonlinear mapping hardware can be optimized for common data patterns found in machine learning and signal processing.

[0124] In some aspects, the NINT quantization 810 maps the continuous floating-point values of the high precision weight tensor 802 into discrete levels of the low bit tensor weight 812. For example, the second NINT quantization 820 may use a codebook mapping of a quantile function and represent the high precision weight tensor 802 as an 8-bit integer representation. The low bit tensor weight 812 can also be represented in higher or lower precision (e.g. 16-bit integer, 4-bit integer, etc. ) .

[0125] Quantizing the tensor weights alone may result in accuracy and hardware efficiency may still be constrained by applying high-precision scaling post-multiplication. For example, tensor weights may be corrected with scales that are often retained in floating-point or high-bit integer form. Scales force downstream hardware to employ mixed-precision arithmetic or invoke floating-point computation for rescaling the network output. The additional correction on integer quantized tensors is an expensive operation, increases hardware complexity, and prevents true integer-only execution.

[0126] The low bit tensor weight 812 is provided a NINT dequantization process 816 to produce a compact tensor weight 818. The NINT dequantization process 816 maps low precision values from the low bit tensor weight 812 to a higher precision representation, resulting in the compact tensor weight 818. For example, the compact tensor weight 818 can represent the of accuracy the high precision weight tensor 802 after significant bit-width reduction during quantization.

[0127] In some aspects, the quantization process 800 includes a second NINT quantization 820 to convert the high precision scale 814 into a low bit scale 822 and a high precision superscale factor 824. The second NINT quantization 820 is configured to encapsulate a large dynamic range of the high precision scale 814 to fit hardware requirements in restricted environments. For example, the second NINT quantization 820 processes the high precision scale 814 and maps it into the low bit scale 822, which is low bit rate, integer-based scale representation of the high precision scale 814. The high precision superscale factor 824 generates a secondary quantized scaling factor to fine-tune the output of the quantized tensor multiplication and enable retention of dynamic range without incurring high-precision storage or arithmetic burdens.

[0128] The second NINT quantization 820 is configured to tailor the quantization intervals to the distribution of the high precision scale 814. For example, the second NINT quantization 820 uses a downward distribution quantile function to align the quantization bins to the mathematical properties of the high precision scale 814. The second NINT quantization 820 is configured to map quantized values (e.g., the low bit scale 822) to correspond to the distribution associated with the high precision scale 814 to provide a high-fidelity representation and minimize errors introduced at lower bit-widths.

[0129] In some aspects, the second NINT quantization 820 is configured to generate a per-channel quantization associated with the high precision weight tensor 802. For example, Table 1 below is pseudocode of a per-channel dynamic range quantization strategy to reduce the bitwidth of weights of the high precision scale 814 while preserving the fidelity. Table 1

[0130] The pseudocode in Table 1 iterates over each channel (e.g., in a convolutional weight tensor) and computes how many bits (bw) are needed to represent the largest absolute value in that channel as the low bit scale 822. The largest absolute value is an estimate of the dynamic range for that channel. The pseudocode initializes a shift parameter (ti) for a channel. If more than 8 bits are needed to represent values in this channel, the pseudocode calculates how many bits to discard to reduce the value to 8 bits (e.g., ti = bi –8) , which reduces the precision while preserving the most significant bits. If the original bitwidth (bw) is less than 8, the weights are unchanged.

[0131] The low bit scale 822 is dequantized into a compact scale 828 using a NINT dequantization process 826. In some aspects, each value in the low bit scale 822 corresponds to a channel (e.g., in a convolution matrix) that can represent a distinct group of input and output features of an operation (e.g. a convolution) . For example, in a convolutional neural network, a channel refers to a set of feature maps, with each feature map representing spatial information processed via a specific filter. The assignment of individual scales to each convolution channel permits finer granularity in adjusting for quantization-induced errors to preserve the unique statistical distributions of each channel. The NINT dequantization process 826 accurately reconstructs the compact scale 828 to maintain the integrity of operations across all channels.

[0132] In some aspects, the quantization process 800 includes a third NINT quantization 830 to convert the high precision superscale factor 824 into a low bit superscale 832 and floating point metadata 834. The third NINT quantization 830 is configured to further quantize the high precision superscale factor 824. For example, the high precision superscale factor 824 may still exist in a floating-point or medium-precision integer form and may introduce inefficiencies for ML models targeted for fully integer computation. The third NINT quantization 830 maps the high precision superscale factor 824 into the low bit superscale 832 and any residual information is output as the floating point metadata 834. In some aspects, the floating point metadata 834 can generate a floating-point approximation of the high precision weight tensor 802 for later debugging, research, or quality assurance. In some aspects, the floating point metadata 834 is not used for inference at runtime.

[0133] The low bit superscale 832 is dequantized into a compact superscale 838 through a NINT dequantization process 836. The superscale 832 and its corresponding compact superscale 838 provide additional scaling beyond that offered by individual scale factors tied to channels. Dequantization using the NINT dequantization process 836 enables a nuanced and precise recovery of range adjustments necessary for the quantized values to ensure that model accuracy is preserved at a global level across the neural network or specific layers.

[0134] The compact tensor weight 818, the compact scale 828, and the compact superscale 838 are provided to a rescaler 840 to reconstruct the high precision weight tensor 802 as a dequantized weight tensor 850. In some aspects, the rescaler 840 performs an elementwise multiplication to generate the dequantized weight tensor 850, which is suitable for direct use in hardware implementations. For example, the dequantized weight tensor 850 provides efficient inference with minimized loss in accuracy compared to the original model. For example, an int-only rescaling performed by the rescaler 840 provides significant computational advantages over mixed-computational rescaling by reducing latency, improving throughput, and reducing power consumption in fixed-point hardware architectures. For example, the ML model can use integer-only computations without requiring floating-point arithmetic to optimize compute resources and enable deployment of ML models on a wider range of hardware platforms.

[0135] In some aspects, the codebooks used for the NINT quantization are dynamic and can adjust parameters to correspond to a measured distribution. Codebooks are typically applied to an entire tensor or a substantial subset and may contain between 1,000 to 10,000 elements. Reducing the scope of the subset (e.g., to cover less than all the tensor weights) sharing a codebook generally yields better quantization accuracy as finer granularity enables a closer fit to the underlying data distribution. However, the reduction in subset scope uses multiple codebooks to be stored in high precision, and the subset size is sufficiently large to mitigate codebook size overhead while still delivering accuracy improvements.

[0136] Codebooks in NINT quantization leverage prior knowledge of typical data distributions in ML models. Codebooks are derived based on the assumption of a normal distribution. However, actual data may deviate from this assumption and may form a deviation region (or a beam) around the theoretical normal line. By tuning the quantile function offset b, the quantization curves can be customized to overlay this actual data beam and closely capture the statistical properties of the input tensor elements based on variance in real-world weight distributions. For example, adjusting the quantile function offset b effectively tunes the codebooks to efficiently match diverse distribution patterns in various models such as LLAMA-3.2 3B (3 billion parameters) . In this aspect, the quantile offset value b enables flexible adaptation to actual distributions encountered in varying model channels and layers and ensures optimal encoding for efficient hardware compatibility.

[0137] In some aspects, the quantization process 800 uses three quantization operators to quantize a tensor weight, scale, and super scale. The products of the tensor span a vast dynamic range and may include a final rescale operation for dequantization. The rescaling enables the overall quantization and dequantization strategy to operate efficiently across a wide range of data values, maintaining model fidelity, and compatibility with hardware acceleration. For example, Table 2 below illustrates various configurations that can allow different hardware configurations to execute an ML model in limited compute budget conditions (e.g., on a portable device) . Table 2

[0138] In Table 2, bw corresponds to bitwidth, and a bitwidth of 0 indicates that scale / superscale is a constant and does not require any additional operations. The intermediate bitwidth (intermediate bw) corresponds to the sum of the weight bitwidth, the scaled bitwidth, and the superscale bitwidth. The intermediate bitwidth may need rescaling when the dequantized bitwidth is less than intermediate bitwidth. In the illustrated example, the NINT Triple Quantization configuration with rescaling will have the highest accuracy with the highest power consumption. The other configurations can deployed on devices with fewer compute resources.

[0139] In some aspects, the codebook can be applied to dimension-aware look-up tables (LUTs) or vector quantization for channel or higher-dimensional codebook granularity to balance model performance and resource constraints. A dimension-aware LUT strategy addresses the challenges associated with a vector quantization approach that packs data from multiple dimensions and leverages the combined distributional information to enhance representational efficiency. However, performance can be often counterbalanced by increased LUT lookup computational overhead at inference time due to hardware cache limitations. For instance, packing two dimensions with five bits results in 32 LUT entries, producing output widths of 16 bits. This configuration can exceed the available cache size and may incur frequent cache refreshes that slow down LUT-based computation.

[0140] In some aspects, a symmetry-aware LUT design can be employed and maintain LUTs as compact as one-dimensional NINT tables for multi-dimensional quantization. In the case of a symmetry-aware LUT design a dimensional codebook is also maintained to reduce a size of the LUT to maintain the LUT within a cache and prevent multiple read / write operations at inference time.

[0141] Recipes for dimension-aware LUTs follow specific parameterizations for each dimension, including the bit-length per weight, bit-length per entry, total LUT entries, bit-length per sign entry, and bit-length per quantile entry. By maintaining a minimal number of LUT items and associating a separate codebook for each dimension, efficient and scalable computation is achieved. The interaction of each dimension and its codebook with the LUT enables the generation of vectors suitable for efficient real-time inference, optimizing both memory usage and computational performance in hardware-constrained environments. Table 3

[0142] In some aspects, values of dequantized weight can be split bit per entry into dimension-aware bits and quantile bits for packing all data into one single instruction multiple data (SIMD) instruction. The quantile component is fixed at 4 bits and allows for 16 distinct values, which can be efficiently stored in an LUT that fits well with SIMD vector lanes. During the lookup process, the quantile values are loaded into SIMD registers, and each 4-bit index is used to retrieve the corresponding value from the LUT. The dimension-aware part, which typically encodes sign information, is then applied to the retrieved values to restore the correct sign. These signs are derived using patterns from a Hadamard matrix that provides orthogonal and hardware-efficient sign patterns. In this case, the configuration provides fast decompression by maximizing data parallelism and minimizing memory overhead by leveraging the structure of SIMD instructions and compact LUT-based decoding.

[0143] In some aspects, the quantization process 800 can generate an ML model that is quantized for integer-based operation without floating point operations. In some cases, a hardware performs simple, high-throughput integer arithmetic and reduces overhead from floating-point multipliers and adders. An ML model can be generated to deployed across a diverse set of consumer, edge, and server-class machine learning configurations and hardware accelerators.

[0144] In addition, the ML can be generated with customizable parameters for quantized representation based on different devices to scale a trained ML model across different devices with different compute budgets. For example, in single-quantization configurations, hardware may directly process 8-bit weights without scale or superscale (e.g., not requiring rescaling) . In some cases, advanced designs may introduce multi-stage quantization with associated scale and superscale parameters. Implementation of the quantization operators leverages distribution-specific quantile functions that are selected based on the underlying data distribution (e.g., normal or downward distribution) to match quantization intervals to the statistical properties of the target tensor, scale, or superscale. The inclusion or omission of post-quantization rescaling and dynamic bit-width adjustment enables tuning of the method to suit inference fidelity, storage budget, and hardware design complexity.

[0145] FIG. 9 shows a graph 900 illustrating a comparison between quantile functions derived from real model weight scale data and from a theoretical Gumbel distribution in accordance with some aspects of the disclosure. As shown, the empirical quantile values (represented by the solid line) closely match those produced by a Gumbel distribution (represented by the dashed line) .

[0146] A single quantization that uses a NINT quantization with floating point scaling typically assumes a normal distribution of model weight values. However, scale and superscale tensors do not follow a Gaussian profile and the additional quantizations can be applied to improve generating an ML model for integer-only performance. Prior quantization methods, when applied to non-Gaussian data that corresponds to the scale and superscale tensors, exhibit significant degradation in either memory efficiency or precision due to the mismatch between assumed and actual distributions.

[0147] In some aspects, the triple quantization process (e.g., the quantization process 800) may use a quantile function derived from the Gumbel distribution and align with the observed distribution of weights under the NINT quantization. The Gumbel distribution is theoretically justified as the limiting distribution of extreme values and is particularly suited for the statistical behavior of scale / superscale tensors.

[0148] FIG. 10A shows a graph 1000 of a probabilistic distribution of tensor values of an ML model in accordance with some aspects of the disclosure. For example, the graph 1000 shows the distribution of a transformer-based architecture such LLAMA-3.2 3B. The graph 1002 presents quantile curves for tensor data, where the horizontal axis represents cumulative probability, and the vertical axis represents the corresponding normalized tensor values. The solid line corresponds to a median quantile distribution across all tensors. Additional dashed lines represent quantile shifts corresponding to standard deviations from the median ±1σ and ±3σ and capture the statistical variability observed in tensor weight distributions across different layers or training checkpoints. The figure demonstrates that while the median distribution maintains a near-symmetric profile, the deviation bands indicate non-Gaussian tails and variance in tensor behavior.

[0149] FIG. 10B shows a graph 1000 of a probabilistic distribution of tensor values from a codebook that is modified based on a quantile offset value in accordance with some aspects of the disclosure. For example, the graph 1002 shows that tuning a single value (e.g., the quantile offset value (b) of the codebook (qi) described above) can shift the codebook value to have a high correlation to the tensor distributions in FIG. 10A. In some aspects, additional quantization functions can more accurately represent the tensor weights to permit integer operation in hardware.

[0150] FIG. 11 is a diagram 1100 illustrates an example of a dimension-aware LUT operation applied to a portion of a quantized tensor in a neural network model in accordance with some aspects of the disclosure. In some aspects, a LUT 1102 comprises a two-dimensional input tensor matrix including multiple elements organized into 16 rows and 4 columns. For example, each row in the LUT 1102 is labeled with symbols such as A1-A4, B1-B4, through P1-P4. A specific row of this tensor, identified as row C including elements C1, C2, C3, and C4) is selected for processing and provided as input to a multiplier module 1110.

[0151] A codebook LUT 1104, which represents a sign modulation mask derived from a Hadamard matrix, is used to modify the selected tensor row. Each row in the codebook LUT 1104 comprises a mask contains ±1 values arranged in a structured pattern and enables the application of per-dimension sign flipping or weighting. The multiplier module 1110 combines the selected tensor row with a corresponding row of the Hadamard-derived sign matrix. An output 1112 is a transformed vector in which each original value (e.g., C1–C4) is adjusted based on its dimension-aware sign context, producing elements such as C1, -C2, C3, -C4. In some aspects, the output 1112 is used to index or retrieve an appropriate quantized representation from a codebook to enable efficient and distribution-aware vector quantization in ML models.

[0152] FIG. 12 illustrates a data layout 1200 used for enabling high-throughput computation using SIMD instructions in accordance with some aspects of the disclosure. In some aspects, the data layout 1200 is partitioned into quantile entries (Q) and corresponding signed entries (S) used during quantized vector computation. Each quantile entry, labeled Q0 through Q63, occupies 4 bits to allow for 16 possible quantile levels per entry. The arrangement of the quantile values is interleaved across SIMD lanes in a non-contiguous but regular order. The interleaved pattern enables simultaneous access to independent quantile values when executing SIMD operations to ensure that quantile lookups are aligned for parallel computation across multiple vector elements.

[0153] The data layout 1200 also includes a corresponding signed entry matrix is shown, labeled S0 through S63 below the quantile entries. Each signed value is encoded using 2 bits. In some aspects, the signed values are derived from a dimension-aware sign mask such as a dimensional codebook generated from a Hadamard matrix. The signed values encode whether each quantile value should be positively or negatively applied and are positioned and interleaved to mirror the access patterns of the quantile entries. In this case, the arrangement facilitates synchronized vectorized operations. By aligning quantile and sign values within the same 128-bit SIMD register, a processor can load both components simultaneously and perform multiply-sign operations with minimal overhead.

[0154] The interleaving and split arrangement can achieve single-cycle SIMD execution for quantized vector processing. Without this structured layout, additional memory shuffle or unpacking steps would be required, thereby introducing latency, reducing efficiency, and increasing power consumption based on the additional instructions.

[0155] FIG. 13 is a flow chart illustrating an example of a process 1300 for nonlinear encoding for ultra-low bitwidth model quantization. The process 1300 can be performed by a computing device (e.g., a computing device or computing system 1500 of FIG. 15) or by a component or system (e.g., a chipset, one or more processors central processing units (CPUs) , digital signal processors (DSPs) , graphics processing units (GPUs) , any combination thereof, and / or other type of processor (s) , or other component or system) of the computing device. The operations of the process 1300 may be implemented as software components that are executed and run on one or more processors (e.g., processor 1510 of FIG. 15, or other processor (s) ) . Further, the transmission and reception of signals by the computing device in the process 1300 may be enabled, for example, by one or more antennas and / or one or more transceivers (e.g., wireless transceiver (s) ) .

[0156] At block 1302, the computing device (or component thereof) can generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number. The codebook may be generated based on a quantile function, which is a normal distribution function.

[0157] At block 1304, the computing device can quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale. The quantized weight tensor comprises a plurality of integer numbers, and each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook. In some cases, each model weight of the plurality of model weights of the weight tensor is a floating-point number. In other cases, each model weight of the plurality of model weights of the weight tensor is an integer. In some aspects, the integer numbers of the plurality of bins of the codebook are normalized based on a normalization range.

[0158] The computing device, to quantize the weight tensor, can determine the scale based on a maximum absolute value of the weight tensor and divide the weight tensor by the scale. In some aspects, a quantile offset value may be stored with the quantized weight tensor.

[0159] In some aspects, the computing device, to quantize the weight tensor, may generate a plurality of vectors based on producing a plurality of groups of model weights of the plurality of model weights together. Each vector of the plurality of vectors comprises a respective group of the plurality of groups, and each vector of the plurality of vectors has at least one of a respective vector length or a respective vector angle. The computing device may reduce one or more vectors from the plurality of vectors based on generating a signed codebook to represent the plurality of vectors. A number of dimensions of the codebook corresponds to a maximum size of a lookup table and a quantity of the plurality of vectors. In some aspects, the computing device may be able to use a single SIMD instruction and reduce operations. The computing device may separate each vector from the plurality of vectors into a respective first portion and second portion in an instruction, shift each second portion in a direction to interleave each respective first portion and second portion with an adjacent first portion of an adjacent vector; and execute the instruction.

[0160] At block 1306, the computing device can quantize the scale to generate a quantized scale. In one aspect, to generate the quantized scale, the computing device may discard least significant bits of each channel of the weight tensor based on a dynamic range of a corresponding channel.

[0161] In some apsects, the computing device may generate a superscale based on generating the quantized scale. The computing device may quantize the superscale to generate a quantized superscale.

[0162] At block 1308, the computing device can dequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor. In some aspects, the computing device may multiply the quantized superscale with the quantized weight tensor and the quantized scale to generate the dequantized weight tensor. The computing device may rescale the quantized weight tensor based on discarded bits.

[0163] In some cases, the computing device of process 1300 may include various components, such as one or more input devices, one or more output devices, one or more processors, one or more microprocessors, one or more microcomputers, one or more cameras, one or more sensors, and / or other component (s) that are configured to carry out the steps of processes described herein. In some examples, the computing device may include a display, one or more network interfaces configured to communicate and / or receive the data, any combination thereof, and / or other component (s) . The one or more network interfaces may be configured to communicate and / or receive wired and / or wireless data, including data according to the 3G, 4G, 5G, and / or other cellular standard, data according to the Wi-Fi (802.11x) standards, data according to the BluetoothTM standard, data according to the Internet Protocol (IP) standard, and / or other types of data.

[0164] The components of the computing device of process 1300 can be implemented in circuitry. For example, the components can include and / or can be implemented using electronic circuits or other electronic hardware, which can include one or more programmable electronic circuits (e.g., microprocessors, graphics processing units (GPUs) , digital signal processors (DSPs) , central processing units (CPUs) , and / or other suitable electronic circuits) , and / or can include and / or be implemented using computer software, firmware, or any combination thereof, to perform the various operations described herein. The computing device may further include a display (as an example of the output device or in addition to the output device) , a network interface configured to communicate and / or receive the data, any combination thereof, and / or other component (s) . The network interface may be configured to communicate and / or receive Internet Protocol (IP) based data or other types of data.

[0165] The process 1300 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.

[0166] Additionally, the process 1300 may 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 may be stored on a computer-readable or machine-readable storage medium, for example, in the form of a computer program including a plurality of instructions executable by one or more processors. The computer-readable or machine-readable storage medium may be non-transitory.

[0167] FIG. 14 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. The transformer 1400 reduces the operations of learning dependencies by using an encoder 1410 and a decoder 1430 that implements 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.

[0168] In one example of a transformer, the encoder 1410 is composed of a stack of six identical layers and each layer has two sub-layers. The first sub-layer is a multi-head self-attention engine 1412, and the second sub-layer is a fully connected feed-forward network 1414. A residual connection (not shown) connects around each of the sub-layers followed by normalization.

[0169] In this example of a transformer 1400, the decoder 1430 is also composed of a stack of six identical layers. The decoder also includes a masked multi-head self-attention engine 1432, a multi-head attention engine 1434 over the output of encoder 1410, and a fully connected feed-forward network 1426. Each layer includes a residual connection (not shown) around the layer, which is followed by layer normalization. The masked multi-head self-attention engine 1432 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) .

[0170] In the transformer 1400, the queries, keys, and values are linearly projected by a multi-head 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.

[0171] The transformer also includes a positional encoder 1440 to encode positions because the model does not contain recurrence and convolution, and relative or absolute position of the tokens is needed. For example, the positional encodings are added to the input embeddings at the bottom layer of the encoder 1410 and the decoder 1430. The positional encodings are summed with the embeddings because the positional encodings and embeddings have the same dimensions. A corresponding position decoder 1450 is configured to decode the positions of the embeddings for the decoder 1430.

[0172] In some aspects, the transformer 1400 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 1400 can process input sequences of variable length, making it well-suited for natural language processing tasks where input lengths can vary greatly. Additionally, the self-attention mechanism allows the transformer 1400 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.

[0173] FIG. 15 is a block diagram illustrating an example of a computing system 1500, which may be employed for nonlinear encoding for ultra-low bitwidth model quantization. In particular, FIG. 15 illustrates an example of computing system 1500, 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 1505. Connection 1505 can be a physical connection using a bus, or a direct connection into processor 1510, such as in a chipset architecture. Connection 1505 can also be a virtual connection, networked connection, or logical connection.

[0174] In some aspects, computing system 1500 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.

[0175] Example system 1500 includes at least one processing unit (CPU or processor) 1510 and connection 1505 that communicatively couples various system components including system memory 1515, such as read-only memory (ROM) 1520 and random-access memory (RAM) 1525 to processor 1510. Computing system 1500 can include a cache 1512 of high-speed memory connected directly with, in close proximity to, or integrated as part of processor 1510.

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

[0177] To enable user interaction, computing system 1500 includes an input device 1545, 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 1500 can also include output device 1535, 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 1500.

[0178] Computing system 1500 can include communications interface 1540, which can generally govern and manage the user input and system output. The communication interface may 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 AppleTM LightningTM port / plug, an Ethernet port / plug, a fiber optic port / plug, a proprietary wired port / plug, 3G, 4G, 5G and / or other cellular data network wireless signal transfer, a BluetoothTM wireless signal transfer, a BluetoothTM low energy (BLE) wireless signal transfer, an IBEACONTM 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, 802.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, 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.

[0179] The communications interface 1540 may also include one or more range sensors (e.g., LiDAR sensors, laser range finders, RF radars, ultrasonic sensors, and infrared (IR) sensors) configured to collect data and provide measurements to processor 1510, whereby processor 1510 can be configured to perform determinations and calculations needed to obtain various measurements for the one or more range sensors. In some examples, the measurements can include time of flight, wavelengths, azimuth angle, elevation angle, range, linear velocity and / or angular velocity, or any combination thereof. The communications interface 1540 may also include one or more receivers or transceivers that are used to determine a location of the computing system 1500 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 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 may easily be substituted for improved hardware or firmware arrangements as they are developed.

[0180] Storage device 1530 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 (e.g., Level 1 (L1) cache, Level 2 (L2) cache, Level 3 (L3) cache, Level 4 (L4) cache, Level 5 (L5) cache, or other (L#) cache) , 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.

[0181] The storage device 1530 can include software services, servers, services, etc., that when the code that defines such software is executed by the processor 1510, it 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 1510, connection 1505, output device 1535, etc., to carry out the function. 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 may 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 may 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 may have stored thereon code and / or machine-executable instructions that may 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 may 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. may be passed, forwarded, or transmitted via any suitable means including memory sharing, message passing, token passing, network transmission, or the like.

[0182] Specific details are provided in the description above to provide a thorough understanding of the aspects and examples provided herein, 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 may 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 may 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 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 may be performed in a different order than that described.

[0183] For clarity of explanation, in some instances the present technology may be presented as including individual functional blocks including devices, device components, steps or routines in a method embodied in software, or combinations of hardware and software. Additional components may be used other than those shown in the figures and / or described herein. For example, circuits, systems, networks, processes, and other components may 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 may be shown without unnecessary detail in order to avoid obscuring the aspects.

[0184] Further, those of skill in the art will appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the aspects disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. 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 may 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 disclosure.

[0185] Individual aspects may 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 may 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 may be re-arranged. A process is terminated when its operations are completed but could have additional steps not included in a figure. A process may 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.

[0186] 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 may be, for example, binaries, intermediate format instructions such as assembly language, firmware, source code. Examples of computer-readable media that may 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.

[0187] In some aspects the computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bitstream 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.

[0188] Those of skill in the art will appreciate that information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof, in some cases depending in part on the particular application, in part on the desired design, in part on the corresponding technology, etc.

[0189] The various illustrative logical blocks, modules, and circuits described in connection with the aspects disclosed herein may be implemented or performed using 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) may be stored in a computer-readable or machine-readable medium. A processor (s) may perform the necessary tasks. 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.

[0190] 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.

[0191] The techniques described herein may also be implemented in electronic hardware, computer software, firmware, or any combination thereof. Such techniques may 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 may be implemented together in an integrated logic device or separately as discrete but interoperable logic devices. If implemented in software, the techniques may be realized at least in part by a computer-readable data storage medium including program code including instructions that, when executed, performs one or more of the methods, algorithms, and / or operations described above. The computer-readable data storage medium may form part of a computer program product, which may include packaging materials. The computer-readable medium may include 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, may 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.

[0192] The program code may be executed by a processor, which may 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 may be configured to perform any of the techniques described in this disclosure. A general-purpose processor may be a microprocessor; but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may 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 may 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.

[0193] 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.

[0194] 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.

[0195] The phrase “coupled to” or “communicatively 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.

[0196] 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” or “at least one of A or B” means A, B, or A and B. In another example, claim language reciting “at least one of A, B, and C” or “at least one of A, B, or C” means A, B, C, or A and B, or A and C, or B and C, A and B and C, or any duplicate information or data (e.g., A and A, B and B, C and C, A and A and B, and so on) , or any other ordering, duplication, or combination of A, 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” or “at least one of A or B” may mean A, B, or A and B, and may additionally include items not listed in the set of A and B. The phrases “at least one” and “one or more” are used interchangeably herein.

[0197] Claim language or other language reciting “at least one processor configured to, ” “at least one processor being configured to, ” “one or more processors configured to, ” “one or more processors 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 may only perform at least a subset of operations X, Y, and Z.

[0198] Where reference is made to one or more elements performing functions (e.g., steps of a method) , one element may perform all functions, or more than one element may collectively perform the functions. When more than one element collectively performs the functions, each function need not be performed by each of those elements (e.g., different functions may be performed by different elements) and / or each function need not be performed in whole by only one element (e.g., different elements may perform different sub-functions of a function) . Similarly, where reference is made to one or more elements configured to cause another element (e.g., an apparatus) to perform functions, one element may be configured to cause the other element to perform all functions, or more than one element may collectively be configured to cause the other element to perform the functions.

[0199] Where reference is made to an entity (e.g., any entity or device described herein) performing functions or being configured to perform functions (e.g., steps of a method) , the entity may be configured to cause one or more elements (individually or collectively) to perform the functions. The one or more components of the entity may include at least one memory, at least one processor, at least one communication interface, another component configured to perform one or more (or all) of the functions, and / or any combination thereof. Where reference to the entity performing functions, the entity may be configured to cause one component to perform all functions, or to cause more than one component to collectively perform the functions. When the entity is configured to cause more than one component to collectively perform the functions, each function need not be performed by each of those components (e.g., different functions may be performed by different components) and / or each function need not be performed in whole by only one component (e.g., different components may perform different sub-functions of a function) .

[0200] The various illustrative logical blocks, modules, engines, circuits, and algorithm steps described in connection with the aspects disclosed herein may be implemented as electronic hardware, computer software, firmware, or combinations thereof. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, engines, 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 may 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.

[0201] The techniques described herein may also be implemented in electronic hardware, computer software, firmware, or any combination thereof. Such techniques may 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 engines, modules, or components may be implemented together in an integrated logic device or separately as discrete but interoperable logic devices. If implemented in software, the techniques may be realized at least in part by a computer-readable data storage medium including program code including instructions that, when executed, performs one or more of the methods described above. The computer-readable data storage medium may form part of a computer program product, which may include packaging materials. The computer-readable medium may include 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, may 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.

[0202] The program code may be executed by a processor, which may 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 may be configured to perform any of the techniques described in this disclosure. A general-purpose processor may be a microprocessor; but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may 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 may 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 may be provided within dedicated software modules or hardware modules configured for performing specific operations described herein.

[0203] Illustrative aspects of the disclosure include:

[0204] Aspect 1. An apparatus for non-linear integer quantization, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; quantize the scale to generate a quantized scale; and dequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.

[0205] Aspect 2. The apparatus of Aspect 1, wherein integer numbers of the plurality of bins of the codebook are normalized based on a normalization range.

[0206] Aspect 3. The apparatus of any of Aspects 1 to 2, wherein, to quantize the weight tensor, the at least one processor is configured to: determine the scale based on a maximum absolute value of the weight tensor; and divide the weight tensor by the scale.

[0207] Aspect 4. The apparatus of any of Aspects 1 to 3, wherein the quantile function is a normal distribution function.

[0208] Aspect 5. The apparatus of any of Aspects 1 to 4, wherein each model weight of the plurality of model weights of the weight tensor is a floating-point number.

[0209] Aspect 6. The apparatus of any of Aspects 1 to 5, wherein each model weight of the plurality of model weights of the weight tensor is an integer.

[0210] Aspect 7. The apparatus of Aspect 6, wherein, to generate the quantized scale, the at least one processor is configured to: discard least significant bits of each channel of the weight tensor based on a dynamic range of a corresponding channel.

[0211] Aspect 8. The apparatus of any of Aspects 1 to 7, wherein a superscale is generated based on generating the quantized scale.

[0212] Aspect 9. The apparatus of Aspect 8, wherein the at least one processor is configured to: quantize the superscale to generate a quantized superscale.

[0213] Aspect 10. The apparatus of Aspect 9, wherein the quantized superscale is multiplied with the quantized weight tensor and the quantized scale to generate the dequantized weight tensor.

[0214] Aspect 11. The apparatus of any of Aspects 1 to 10, wherein the at least one processor is configured to: determine a quantile offset value based on a distribution of model weights of the plurality of model weights of the weight tensor.

[0215] Aspect 12. The apparatus of Aspect 11, wherein the quantile offset value is stored with the quantized weight tensor.

[0216] Aspect 13. The apparatus of any of Aspects 1 to 12, wherein, to quantize the weight tensor, the at least one processor is configured to: generate a plurality of vectors based on producing a plurality of groups of model weights of the plurality of model weights together, wherein each vector of the plurality of vectors comprises a respective group of the plurality of groups, and wherein each vector of the plurality of vectors has at least one of a respective vector length or a respective vector angle; and reduce one or more vectors from the plurality of vectors based on generating a signed codebook to represent the plurality of vectors.

[0217] Aspect 14. The apparatus of Aspect 13, wherein a number of dimensions of the codebook corresponds to a maximum size of a lookup table and a quantity of the plurality of vectors.

[0218] Aspect 15. The apparatus of any of Aspects 13 to 14, wherein the at least one processor is configured to: separate each vector from the plurality of vectors into a respective first portion and second portion in an instruction; shift each second portion in a direction to interleave each respective first portion and second portion with an adjacent first portion of an adjacent vector; and execute the instruction.

[0219] Aspect 16. The apparatus of any of Aspects 1 to 15, wherein the at least one processor is configured to: rescale the quantized weight tensor based on discarded bits.

[0220] Aspect 17. A method for non-linear integer quantization, the method comprising: generating, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number; quantizing a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook; quantizing the scale to generate a quantized scale; and dequantizing the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.

[0221] Aspect 18. The method of Aspect 17, wherein integer numbers of the plurality of bins of the codebook are normalized based on a normalization range.

[0222] Aspect 19. The method of any of Aspects 17 to 18, further comprising: determining the scale based on a maximum absolute value of the weight tensor; and dividing the weight tensor by the scale.

[0223] Aspect 20. The method of any of Aspects 17 to 19, wherein the quantile function is a normal distribution function.

[0224] Aspect 21. The method of any of Aspects 17 to 20, wherein each model weight of the plurality of model weights of the weight tensor is a floating-point number.

[0225] Aspect 22. The method of any of Aspects 17 to 20, wherein each model weight of the plurality of model weights of the weight tensor is an integer.

[0226] Aspect 23. The method of Aspect 22, further comprising: discarding least significant bits of each channel of the weight tensor based on a dynamic range of a corresponding channel.

[0227] Aspect 24. The method of any of Aspects 17 to 23, wherein a superscale is generated based on generating the quantized scale.

[0228] Aspect 25. The method of Aspect 24, wherein the at least one processor is configured to: quantizing the superscale to generate a quantized superscale.

[0229] Aspect 26. The method of Aspect 25, wherein the quantized superscale is multiplied with the quantized weight tensor and the quantized scale to generate the dequantized weight tensor.

[0230] Aspect 27. The method of any of Aspects 17 to 26, further comprising: determine a quantile offset value based on a distribution of model weights of the plurality of model weights of the weight tensor.

[0231] Aspect 28. The method of Aspect 27, wherein the quantile offset value is stored with the quantized weight tensor.

[0232] Aspect 29. The method of any of Aspects 17 to 28, further comprising: generate a plurality of vectors based on producing a plurality of groups of model weights of the plurality of model weights together, wherein each vector of the plurality of vectors comprises a respective group of the plurality of groups, and wherein each vector of the plurality of vectors has at least one of a respective vector length or a respective vector angle; and reduce one or more vectors from the plurality of vectors based on generating a signed codebook to represent the plurality of vectors.

[0233] Aspect 30. The method of Aspect 29, wherein a number of dimensions of the codebook corresponds to a maximum size of a lookup table and a quantity of the plurality of vectors.

[0234] Aspect 31. The method of any of Aspects 29 to 30, further comprising: separating each vector from the plurality of vectors into a respective first portion and second portion in an instruction; shifting each second portion in a direction to interleave each respective first portion and second portion with an adjacent first portion of an adjacent vector; and executing the instruction.

[0235] Aspect 32. The method of any of Aspects 17 to 31, further comprising: rescaling the quantized weight tensor based on discarded bits.

[0236] Aspect 33. A non-transitory computer-readable medium having stored thereon instructions that, when executed by at least one processor, cause the at least one processor to perform operations according to any of Aspects 17 to 32.

[0237] Aspect 34. An apparatus for non-linear integer quantization, comprising one or more means for performing operations according to any of Aspects 17 to 32.

[0238] 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 non-linear integer quantization, the apparatus comprising:at least one memory; andat least one processor coupled to the at least one memory and configured to:generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number;quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook;quantize the scale to generate a quantized scale; anddequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.2.The apparatus of claim 1, wherein integer numbers of the plurality of bins of the codebook are normalized based on a normalization range.3.The apparatus of claim 1, wherein, to quantize the weight tensor, the at least one processor is configured to:determine the scale based on a maximum absolute value of the weight tensor; anddivide the weight tensor by the scale.4.The apparatus of claim 1, wherein the quantile function is a normal distribution function.5.The apparatus of claim 1, wherein each model weight of the plurality of model weights of the weight tensor is a floating-point number.6.The apparatus of claim 1, wherein each model weight of the plurality of model weights of the weight tensor is an integer.7.The apparatus of claim 6, wherein, to generate the quantized scale, the at least one processor is configured to:discard least significant bits of each channel of the weight tensor based on a dynamic range of a corresponding channel.8.The apparatus of claim 1, wherein a superscale is generated based on generating the quantized scale.9.The apparatus of claim 8, wherein the at least one processor is configured to:quantize the superscale to generate a quantized superscale.10.The apparatus of claim 9, wherein the quantized superscale is multiplied with the quantized weight tensor and the quantized scale to generate the dequantized weight tensor.11.The apparatus of claim 1, wherein the at least one processor is configured to:determine a quantile offset value based on a distribution of model weights of the plurality of model weights of the weight tensor.12.The apparatus of claim 11, wherein the quantile offset value is stored with the quantized weight tensor.13.The apparatus of claim 1, wherein, to quantize the weight tensor, the at least one processor is configured to:generate a plurality of vectors based on producing a plurality of groups of model weights of the plurality of model weights together, wherein each vector of the plurality of vectors comprises a respective group of the plurality of groups, and wherein each vector of the plurality of vectors has at least one of a respective vector length or a respective vector angle; andreduce one or more vectors from the plurality of vectors based on generating a signed codebook to represent the plurality of vectors.14.The apparatus of claim 13, wherein a number of dimensions of the codebook corresponds to a maximum size of a lookup table and a quantity of the plurality of vectors.15.The apparatus of claim 13, wherein the at least one processor is configured to:separate each vector from the plurality of vectors into a respective first portion and second portion in an instruction;shift each second portion in a direction to interleave each respective first portion and second portion with an adjacent first portion of an adjacent vector; andexecute the instruction.16.The apparatus of claim 1, wherein the at least one processor is configured to:rescale the quantized weight tensor based on discarded bits.17.A method for non-linear integer quantization, the method comprising:generating, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number;quantizing a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook;quantizing the scale to generate a quantized scale; anddequantizing the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.18.The method of claim 17, further comprising:determining the scale based on a maximum absolute value of the weight tensor; anddividing the weight tensor by the scale.19.The method of claim 17, wherein each model weight of the plurality of model weights of the weight tensor is a floating-point number or each model weight of the plurality of model weights of the weight tensor is an integer.20.A non-transitory computer-readable medium storing instructions that, when executed by at least one processor, cause the at least one processor to:generate, based on a quantile function, a codebook comprising a plurality of bins, wherein each bin of the plurality of bins is an integer number;quantize a weight tensor of a machine learning model, based on mapping each model weight of a plurality of model weights of the weight tensor to the codebook, to generate a quantized weight tensor and a scale, wherein the quantized weight tensor comprises a plurality of integer numbers, and wherein each integer number of the plurality of integer numbers corresponds to one bin of the plurality of bins of the codebook;quantize the scale to generate a quantized scale; anddequantize the quantized weight tensor, based on multiplying the quantized weight tensor with the quantized scale, to generate a dequantized weight tensor.