Low-bit quantization for adapters of transformer-based machine learning models

WO2026165972A1PCT designated stage Publication Date: 2026-08-13QUALCOMM INC +3
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2026-08-13

Smart Images

  • Figure CN2025080951_13082026_PF_FP_ABST
    Figure CN2025080951_13082026_PF_FP_ABST
Patent Text Reader

Abstract

A processor-implemented method of machine learning, comprising: A set of adapter parameters for a transformer block of a machine learning model is accessed, where the set of adapter parameters comprises a set of encoder parameters and a set of decoder parameters. A transformation matrix for the set of adapter parameters is generated. A set of modified adapter parameters is generated, comprising: generating a transformed set of encoder parameters based on transforming the set of encoder parameters according to the transformation matrix, and generating a transformed set of decoder parameters based on transforming the set of decoder parameters according to an inverse of the transformation matrix. A quantized machine learning model is generated based on quantizing the set of modified adapter parameters, and the quantized machine learning model is provided for inferencing.
Need to check novelty before this filing date? Find Prior Art

Description

LOW-BIT QUANTIZATION FOR ADAPTERS OF TRANSFORMER-BASED MACHINE LEARNING MODELSCROSS-REFERENCE TO RELATED APPLICATION (S)

[0001] The present application for patent is related to International Application No. PCT / CN2025 / 075896, filed February 6, 2025, which is hereby incorporated by reference herein in its entirety for all applicable purposes. INTRODUCTION

[0002] Aspects of the present disclosure relate to machine learning.

[0003] A wide variety of machine learning model architectures have been trained to perform an assortment of diverse tasks, including computer vision tasks, language tasks, classification and regression tasks, and the like. Recently, research has yielded substantial success in using large language models (LLMs) , large vison models (LVMs) , and / or large multimodal models (LMMs) to process and generate output data. Often, machine learning models (especially LLMs, LVMs, and LMMs) have many parameters (e.g., millions or even billions) , resulting in significant model size, as well as substantial computational expense in training the model. Further, once trained, such models are often difficult (or impossible) to fine-tune, as the vast number of parameters makes overfitting a major challenge (e.g., potentially relying on tremendous amounts of fine-tuning data to prevent overfitting) .

[0004] One recent approach to enable fine-tuning or personalization of such generative models involves training relatively smaller model adapters for larger models. However, many conventional quantization approaches fail to provide adequate accuracy for such adapters. BRIEF SUMMARY

[0005] Certain aspects of the present disclosure provide a processor-implemented method, comprising: accessing a first set of adapter parameters for a first transformer block of a machine learning model, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters; generating a first transformation matrix for the first set of adapter parameters; generating a first set of modified adapter parameters, comprising: generating a first transformed set of encoder parameters based on transforming the first set of encoder parameters according to the first transformation matrix; and generating a first transformed set of decoder parameters based on transforming the first set of decoder parameters according to an inverse of the first transformation matrix; generating a quantized machine learning model based on quantizing the first set of modified adapter parameters; and providing the quantized machine learning model for inferencing.

[0006] Other aspects provide processing systems configured to perform the aforementioned methods as well as those described herein; non-transitory, computer-readable media comprising instructions that, when executed by one or more processors of a processing system, cause the processing system to perform the aforementioned methods as well as those described herein; a computer program product embodied on a computer-readable storage medium comprising code for performing the aforementioned methods as well as those further described herein; and a processing system comprising means for performing the aforementioned methods as well as those further described herein.

[0007] The following description and the related drawings set forth in detail certain illustrative features of one or more aspects.BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The appended figures depict example features of certain aspects of the present disclosure and are therefore not to be considered limiting of the scope of this disclosure.

[0009] FIGS. 1A, 1B, and 1C depict an example architecture for improved adapter quantization using base model rotation matrices, according to some aspects of the present disclosure.

[0010] FIGS. 2A, 2B, and 2C depict an example architecture for improved adapter quantization using base model rotation matrices and adapter rotation matrices, according to some aspects of the present disclosure.

[0011] FIGS. 3A, 3B, and 3C depict an example architecture for improved adapter quantization using adapter rotation matrices, according to some aspects of the present disclosure.

[0012] FIGS. 4A, 4B, and 4C depict an example architecture for improved adapter quantization using base model transformation matrices, according to some aspects of the present disclosure.

[0013] FIGS. 5A and 5B depict an example architecture for improved adapter quantization using base model transformation matrices and adapter transformation matrices, according to some aspects of the present disclosure.

[0014] FIGS. 6A and 6B depict an example architecture for improved adapter quantization using adapter transformation matrices, according to some aspects of the present disclosure.

[0015] FIG. 7 is a flow diagram depicting an example method for generating transformation matrices for improved quantization, according to some aspects of the present disclosure.

[0016] FIG. 8 is a flow diagram depicting an example method for machine learning model quantization, according to some aspects of the present disclosure.

[0017] FIG. 9 depicts an example processing system configured to perform various aspects of the present disclosure.

[0018] To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the drawings. It is contemplated that elements and features of one aspect may be beneficially incorporated in other aspects without further recitation.DETAILED DESCRIPTION

[0019] Aspects of the present disclosure provide apparatuses, methods, processing systems, and non-transitory computer-readable mediums for providing improved machine learning. Specifically, in some aspects of the present disclosure, techniques are provided for more effective adapter quantization via rotation and / or transformation matrices.

[0020] In many architectures, adapters have been used to modify to personalize machine learning model performance. For example, low rank adaptation (LoRA) may be used to generate adapters including an encoder portion (which transforms the input embedding to a relatively low rank tensor) and a decoder portion (which transforms the low-rank tensor back to the original size) . Such adapters are often trained to be deployed in parallel with base model operations, such as convolutions, attention operations, feed-forward layers, and the like (e.g., where the input to the base model component is also provided as input to the adapter, and the output of the adapter is summer or otherwise aggregated with the output of the base model component before being provided to the next downstream component) .

[0021] While effective techniques exist for quantization of the base model parameters, few (if any) quantization approaches exist for such adapters. For example, some approaches involve quantizing the adapter parameters to a bit-width of sixteen or eight bits per parameter, even while the base model parameters are quantized to a bit-width of four bits. This approach can result in accuracy reductions, as well as increased latency and / or higher memory usage. Similarly, though a variety of quantization techniques have been developed for the base model parameters, adapters often have unique quantization ranges that render existing approaches ineffective.

[0022] In some aspects of the present disclosure, rotation matrices can be generated for base model components to improve the efficacy of adapter quantization (e.g., by removing outliers in parameter tensors) . In some aspects, adapter-specific rotation matrices can be similarly generated to improve the quantizability of such adapters. In some aspects, techniques are provided to merge such rotation matrices into model adapters offline, reducing or eliminating any runtime impact (e.g., improving model accuracy without affecting runtime latency) .

[0023] For example, in some aspects, after a base model (e.g., an LLM) is trained, the parameters of the base model may be frozen and a set of one or more base model rotation matrices may be generated (e.g., using random rotations, or using trained rotation matrices learned during a calibration or subsequent training phase) . In some aspects, model adapter (s) may also be trained while the base model remains frozen. In some aspects, after the adapter (s) are trained, adapter rotation matrices may be generated (e.g., using random rotations, or learning trained rotation matrices during a subsequent training phase) for the adapter (s) . Further, as discussed below in more detail, the various rotation matrices may then be merged into the corresponding model components, and the resulting modified model may be quantized. As discussed above, the use of rotation matrices can significantly reduce the noise introduced by quantization, resulting in improved quantized model accuracy. Example Architecture for Improved Adapter Quantization Using Base Model Rotation  Matrices

[0024] FIGS. 1A, 1B, and 1C depict an example architecture for improved adapter quantization using base model rotation matrices, according to some aspects of the present disclosure. Specifically, FIG. 1A depicts an example architecture of a transformer 100A of a machine learning model (sometimes referred to as a “transformer block” ) , where the transformer 100A includes an attention component 106A and a feed-forward component 113A. FIG. 1B provides additional detail for the architecture of the attention component 106A, while FIG. 1C provides additional detail for the architecture of the feed-forward component 113A. In some aspects, the depicted transformer 100A may be used by a machine learning system (e.g., a computing system configured to train and / or use machine learning models) .

[0025] Turning now to FIG. 1A, the transformer 100A receives an input 102 and generates a corresponding output 118. The transformer 100A may generally correspond to one component (e.g., one transformer block) of a machine learning model (e.g., a transformer-based model, such as an LLM) . That is, there may be zero or more machine learning model components (e.g., convolution operations, transformer blocks, and / or other model operations) prior to the transformer 100A (e.g., to generate the input 102) , as well as zero or more machine learning model components (e.g., convolution operations, transformer blocks, and / or other model operations) subsequent to the transformer 100A (e.g., to receive the output 118 as input) .

[0026] In the illustrated example, the input 102 (also referred to in some aspects as an embedding) generally corresponds to a tensor having features or information generated using one or more prior model components. In some aspects, the input 102 may correspond to the input to the model itself (e.g., if the transformer 100A is the first component of the model) . Similarly, the output 118 generally corresponds to a tensor having features or information generated based on processing the input 102 using the transformer 100A. The output 118 may be provided to a subsequent component, or may be used as the output of the model itself.

[0027] In the illustrated example, a rotation matrix 104A (denoted R1) is used to transform (e.g., rotate) the input 102. For example, the rotation matrix 104A may be a transformation matrix used to perform a rotation in Euclidean space. In some aspects, the rotation matrix 104A may be a random matrix (e.g., a rotation matrix comprising random values) or may have values learned during a training or calibration phase of the model architecture (e.g., after the parameters of the base model and / or adapter (s) are frozen) . In some aspects, the rotation matrix 104A is trained based on the base model parameters (without any adapters applied) .

[0028] In some aspects, the rotated input (e.g., generated by rotating the input 102 by the rotation matrix 104A) may generally exhibit fewer outliers, allowing the rotated input to be quantized more effectively (e.g., with reduced quantization loss) , as compared to directly quantizing the input 102 itself. That is, although not depicted in the illustrated example in some aspects, the rotated input may be quantized (e.g., for more efficient storage with reduced memory footprint) .

[0029] In the illustrated example, the first operation of the attention component 106A includes applying an inverse rotation matrix 104B (e.g., the inverse of the rotation matrix 104A, denoted in the illustrated example, where ) to rotate the rotated input 102 back to the original rotation. In some aspects, the rotation matrix 104A is a Hadamard matrix, such that That is, to maintain numerical invariance, the rotation matrix 104A applied to the input 102 is reversed by applying the inverse rotation matrix 104B prior to passing the data through the attention component 106A.

[0030] In the illustrated example, the unrotated input 102 is provided to a first component for multi-head self-attention 108, as well as an adapter (e.g., a LoRA adapter) . In the illustrated example, the adapter represents an additional set of parameters that has been decomposed into two low-rank matrices (often denoted A or WA and B or WB) . For example, A may have dimensionality d×r and B may have dimensionality r×d, where r is significantly smaller than d. In some aspects of the present disclosure, these low-rank parameter matrices A and B may be referred to as adapter “encoders” and “decoders, ” respectively, for conceptual clarity. In the illustrated example, the adapter comprises an encoder 110 (denoted to indicate that the encoder 110 is the “A” matrix for the adapter of the attention component t106A) and a decoder 112 (denoted to indicate that the decoder 112 is the “B” matrix for the adapter of the attention component 106A) .

[0031] The multi-head self-attention 108 generally applies a self-attention operation across one or more attention heads, as discussed in more detail below. In some aspects, the multi-head self-attention 108 may be referred to as a “base model” component or set of parameters to indicate that the multi-head self-attention 108 is part of the base model (e.g., the LLM) , as contrasted with components or parameters corresponding to model adapters (e.g., the encoder 110 and decoder 112) .

[0032] In the illustrated example, the input may similarly be processed using the adapter parameters (e.g., the encoder 110 and decoder 112) , such as by convolving or multiplying the input with the parameters of the encoder 110 and then convolving or multiplying the resulting tensor with the parameters of the decoder 112

[0033] In the illustrated example, the output of the multi-head self-attention 108 and the output of the decoder 112 may be combined (e.g., summer, averaged, or otherwise aggregated) , and the resulting tensor can be rotated using the rotation matrix 104A. As discussed above, this rotation may improve quantization (e.g., reduce quantization noise) of the tensor. In some aspects, therefore, the output of the attention component 106A may be defined as h=R1 (Wattentionx+BattentionAattentionx) (ignoring the internal use of R1 and ) , where h is the output of the attention component 106A, R1 is the rotation matrix 104A, Wattention represents the parameters of the multi-head self-attention 108, x is the input 102, Battention represents the parameters of the decoder 112, and Battention represents the parameters of the encoder 110. In some aspects, the parameters of the adapter and the multi-head self-attention 108 may be merged offline to reduce online latency (e.g., by summing, where h=R1x (Wattention+BattentionAattention) ) .

[0034] In the illustrated example, the rotated output of the attention component 106A is then provided as input to the feed-forward component 113A. As illustrated, the feed-forward component 113A may first apply the inverse rotation matrix 104B, as discussed above, to undo the rotation applied by the attention component 106A. The unrotated tensor is then provided to both a multilayer perceptron (MLP) 114 (e.g., one or more feed-forward layers of a neural network) and an adapter (e.g., a LoRA adapter) comprising an encoder 115 (denoted to indicate that the encoder 115 is the “A” matrix for the adapter of the feed-forward component 113A and a decoder 116 (denoted to indicate that the decoder 116 is the “B” matrix for the adapter of the feed-forward component 113A) . As discussed above, the input to the feed-forward component 113A may be processed by the adapter, such as by convolving or multiplying the input with the parameters of the encoder 115 and the decoder 116.

[0035] The MLP 114 generally performs feed-forward operations on the input, such as by multiplying and / or convolving the input with one or more sets of parameters (e.g., for one or more layers) . In some aspects, the MLP 114 may be referred to as a “base model” component or set of parameters to indicate that the MLP 114 is part of the base model (e.g., the LLM) , as contrasted with components or parameters corresponding to model adapters (e.g., the encoder 115 and decoder 116) .

[0036] In the illustrated example, the output of the MLP 114 and the output of the decoder 116 may be combined (e.g., summer, averaged, or otherwise aggregated) , and the resulting tensor can be rotated using the rotation matrix 104A. As discussed above, this rotation may improve quantization (e.g., reduce quantization noise) of the tensor. As illustrated, the tensor is then unrotated by applying the inverse rotation matrix 104B to generate the output 118 of the transformer 100A. In some aspects, therefore, the output of the feed-forward component 113A may be defined as o=WMLPh+BMLPAMLPh(ignoring the internal use of R1 and ) , where h is the output of the attention component 106A, WMLP represents the parameters of the MLP 114, o is the output of the feed-forward component 113A, BMLP represents the parameters of the decoder 116, and AMLP represents the parameters of the encoder 115. In some aspects, the parameters of the adapter and the MLP 114 may be merged offline to reduce online latency (e.g., by summing, where o=h (WMLP+BMLPAMLP) ) . The output 118 of the transformer 100A may therefore be represented as

[0037] Turning now to FIG. 1B, the architecture of the attention component 106A is discussed in more detail. Specifically, FIG. 1B depicts how some of the rotation operations used in the transformer 100A can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0038] In the illustrated example, the attention operation includes four operations 120A, 124A, 130A, and 146A (with four corresponding sets of base model parameters) . Specifically, the multi-head attention (e.g., 108 of FIG. 1A) may include use of base model parameters including a set of query parameters (denoted Wq in the illustrated example) , a set of key parameters (denoted Wk in the illustrated example) , a set of value parameters (denoted Wv in the illustrated example) , and a set of output parameters (denoted Wo in the illustrated example) .

[0039] In the illustrated example, each of the operations 120A, 124A, 130A, and 146A also includes use of a corresponding set of parameters from the adapter. Specifically, the adapter parameters (e.g., the encoder 110 and decoder 112 of FIG. 1A) may include a set of adapter parameters for the query operation 120A (denoted and  in the illustrated example) , a set of adapter parameters for the key operation 124A (denoted and in the illustrated example) , a set of adapter parameters for the value operation 130A (denoted and in the illustrated example) , and a set of adapter parameters for the output operation 146A (denoted and in the illustrated example) .

[0040] Further, the illustrated architecture includes use of several rotation matrices, including the rotation matrix R1 (e.g., 104A of FIG. 1A) and its inverse  (e.g., 104B of FIG. 1B) , as well as a second rotation matrix R2, its inverse and a third rotation matrix R3. In some aspects, the rotation matrices R2 and R3 may be similar to the rotation matrix R1 in that each may be referred to as a “base model rotation matrix” to indicate that each of the rotation matrices R1, R2, and R3 may be generated (e.g., trained) using the (frozen) base model without the adapter (s) applied or activated. In some aspects, each of the rotation matrices R1, R2, and R3 is a Hadamard matrix.

[0041] In the illustrated example, the outputs of the query operation 120A and the key operation 124A may each be processed using corresponding positional embedding operations 138A and 138B (e.g., a rotary positional embedding (RoPE) operation) . These embeddings can then each be rotated using the third rotation matrix 140A (denoted R3) . In some aspects, the application of the rotation matrix 140A may be performed online, as there are no model parameters into which the rotation can be merged. However, in some aspects, the rotation may be performed efficiently using Hadamard transforms. In some aspects, the use of the rotation matrix 140 may be optionally disabled during training of one or more other components of the architecture (e.g., while training or fine-tuning adapter-specific rotation matrices) .

[0042] As illustrated, these rotated tensors are then aggregated using an operation 142 (e.g., multiplication) and processed using a softmax operation 144. Although not depicted in the illustrated example, in some aspects, the keys (e.g., the output of the key operation 124A) may be transposed prior to the multiplication. The output of the softmax operation 144 (referred to in some aspects as the attention score (s) ) are then used to compute the weighted sum of the values (e.g., the output of the value operation 130A) using the operation 142 (e.g., multiplication) . As illustrated, these weighted values are then processed using the output operation 146A to generate the output of the attention component 106A.

[0043] In the illustrated example, some of the rotation matrices can be merged with corresponding model parameters to reduce runtime overhead. For example, as illustrated, the inverse rotation matrix used to rotate input to the attention component 106A can be merged with each of the operations 120A, 124A, and 130A to reduce runtime overhead (by rotating the parameter matrix offline, rather than rotating the input online) . That is, during runtime, rather than first rotating the input and then applying the relevant parameters, the machine learning system may process the input using the rotated parameters (e.g., using multiplication or convolution) .

[0044] Specifically, with respect to the query operation 120A, the inverse rotation matrix can be used to rotate the query parameters Wq to generate a set of modified (e.g., rotated) parameters 122A. That is, the set of modified parameters 122A may be defined as Similarly, the query encoder parameters can be rotated by the inverse rotation matrix to generate a modified (e.g., rotated) set of parameters 123A. That is, the set of modified parameters 123A may be defined as As illustrated, the query decoder parameters are left as an unmodified set of parameters 112A.

[0045] Similarly, with respect to the key operation 124A, the inverse rotation matrix  can be used to rotate the key parameters Wk to generate a set of modified (e.g., rotated) parameters 126A. That is, the set of modified parameters 126A may be defined as Similarly, the key encoder parameters can be rotated by the inverse rotation matrix to generate a modified (e.g., rotated) set of parameters 128A. That is, the set of modified parameters 128A may be defined as As illustrated, the key decoder parameters are left as an unmodified set of parameters 112B.

[0046] Further, with respect to the value operation 130A, the value parameters Wvmay be rotated by both the inverse rotation matrix as well as a second rotation matrix (denoted R2) to generate a set of modified (e.g., rotated) parameters 132A. That is, the set of modified parameters 132A may be defined as Similarly, the value encoder parameters can be rotated by the inverse rotation matrix to generate a modified (e.g., rotated) set of parameters 134A, and the value decoder parameters are rotated by the rotation matrix R2 to form a set of modified (e.g., rotated) parameters 136A. That is, the set of modified parameters 134A may be defined as and the set of modified parameters 136A may be defined as

[0047] Finally, with respect to the output operation 146A, the output parameters Wo may be rotated by both the inverse rotation matrix as well as the rotation matrix R1 to generate a set of modified (e.g., rotated) parameters 148A. That is, the set of modified parameters 148A may be defined as Similarly, the output encoder parameters can be rotated by the inverse rotation matrix to generate a modified (e.g., rotated) set of parameters 150A, and the value decoder parameters are rotated by the rotation matrix R1 to form a set of modified (e.g., rotated) parameters 152A. That is, the set of modified parameters 150A may be defined as and the set of modified parameters 152A may be defined as

[0048] As discussed above, merging these rotation matrices by rotating the various sets of parameters (to generate modified or rotated parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions.

[0049] Turning now to FIG. 1C, the architecture of the feed-forward component 113A of FIG. 1A is discussed in more detail. Specifically, FIG. 1C depicts how some of the rotation operations used in the transformer 100A can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0050] In the illustrated example, the feed-forward operation includes three operations 154A, 160A, and 172A (with three corresponding sets of base model parameters) . Specifically, the MLP (e.g., 114 of FIG. 1A) may include use of base model parameters including a set of up-projection parameters (denoted Wu in the illustrated example) , a set of gating parameters (denoted Wg in the illustrated example) , and a set of down-projection parameters (denoted Wd in the illustrated example) .

[0051] In the illustrated example, each of the operations 154A, 160A, and 172A also includes use of a corresponding set of parameters from the adapter. Specifically, the adapter parameters (e.g., the encoder 115 and decoder 116 of FIG. 1A) may include a set of adapter parameters for the up-projection operation 154A (denoted and in the illustrated example) , a set of adapter parameters for the gating operation 160A (denoted  and in the illustrated example) , and a set of adapter parameters for the down-projection operation 172A (denoted and in the illustrated example) .

[0052] Further, the illustrated architecture includes use of several rotation matrices, including the rotation matrix R1 (e.g., 104A of FIG. 1A) and its inverse  (e.g., 104B of FIG. 1B) , as well as a fourth rotation matrix R4 and its inverse In some aspects, the fourth rotation matrix R4 may be similar to the rotation matrices R1, R2, and R3 in that each may be referred to as “base model rotation matrices” to indicate that each of the rotation matrices R1, R2, R3, and R4 may be generated (e.g., trained) using the (frozen) base model without the adapter (s) applied or activated. In some aspects, the rotation matrix R4 is a Hadamard matric.

[0053] In the illustrated example, the outputs of the gating operation 160A may be processed using an operation 166 (e.g., a swish operation) , and the resulting tensor can then be aggregated with the output of the up-projection operation 154A using the operation 168 (e.g., multiplication) . The output of the operation 168 may then be rotated using the fourth rotation matrix 170A (denoted R4) . In some aspects, the application of the rotation matrix 170A may be performed online, as there are no model parameters into which the rotation can be merged. However, in some aspects, the rotation may be performed efficiently using Hadamard transforms. In some aspects, the use of the rotation matrix 170A (and its inverse) may be optionally disabled during training of one or more other components of the architecture (e.g., while training or fine-tuning adapter-specific rotation matrices) .

[0054] As illustrated, the rotated tensor is then processed using the down-projection operation 172A to generate the output of the feed-forward component 113A.

[0055] In the illustrated example, some of the rotation matrices can be merged with corresponding model parameters to reduce runtime overhead. Specifically, as illustrated, the inverse rotation matrix used to rotate input to the feed-forward component 113A can be merged with each of the operations 154A, and 160A to reduce runtime overhead (by rotating the parameter matrix offline, rather than rotating the input online) . That is, during runtime, rather than first rotating the input and then applying the relevant parameters, the machine learning system may process the input using the rotated parameters (e.g., using multiplication or convolution) .

[0056] Specifically, with respect to the up-projection operation 154A, the inverse rotation matrix can be used to rotate the up-projection parameters Wu to generate a set of modified (e.g., rotated) parameters 156A. That is, the set of modified parameters 156A may be defined as Similarly, the up-projection encoder parameters can be rotated by the inverse rotation matrix to generate a modified (e.g., rotated) set of parameters 158A. That is, the set of modified parameters 158A may be defined as As illustrated, the up-projection decoder parameters  are left as an unmodified set of parameters 116A.

[0057] Similarly, with respect to the gating operation 160A, the inverse rotation matrix can be used to rotate the gating parameters Wg to generate a set of modified (e.g., rotated) parameters 162A. That is, the set of modified parameters 162A may be defined as Similarly, the gating encoder parameters can be rotated by the inverse rotation matrix to generate a modified (e.g., rotated) set of parameters 164A. That is, the set of modified parameters 164A may be defined as  As illustrated, the gating decoder parameters are left as an unmodified set of parameters 116B.

[0058] Finally, with respect to the down-projection operation 172A, the down-projection parameters Wd can be rotated by the inverse rotation matrix and the rotation matrix R1 to generate a set of modified (e.g., rotated) parameters 174A. That is, the set of modified parameters 174A may be defined as Similarly, the down-projection encoder parameters can be rotated by the inverse rotation matrix  to generate a modified (e.g., rotated) set of parameters 176A, and the down-projection decoder parameters can be rotated by the rotation matrix R1 to generate a modified (e.g., rotated) set of parameters 178A. That is, the set of modified parameters 176A may be defined as and the set of modified parameters 178A may be defined as

[0059] As discussed above, merging these rotation matrices by rotating the various sets of parameters (to generate modified or rotated parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions. Example Architecture for Improved Adapter Quantization Using Base Model Rotation  Matrices and Adapter Rotation Matrices

[0060] FIGS. 2A, 2B, and 2C depict an example architecture for improved adapter quantization using base model rotation matrices and adapter rotation matrices, according to some aspects of the present disclosure. Specifically, FIG. 2A depicts an example architecture of a transformer 100B of a machine learning model, where the transformer 100B includes an attention component 106B and a feed-forward component 113B. FIG. 2B provides additional detail for the architecture of the attention component 106B, while FIG. 2C provides additional detail for the architecture of the feed-forward component 113B. In some aspects, the depicted transformer 100B may be used by a machine learning system, such as the machine learning system discussed above with reference to FIGS. 1A-1C.

[0061] Turning now to FIG. 2A, the transformer 100B shares a number of similarities from the architecture discussed above with respect to the transformer 100A of FIG. 1A. For example, the transformer 100B receives an input 102 and generates a corresponding output 118 using an attention component 106B and a feed-forward component 113B. However, in addition to the rotation matrix 104A discussed above, the transformer 100B further includes adapter-specific rotation matrices 205A and 207A (denoted RL1 and RL2 in the illustrated example) . Specifically, in the illustrated example, the adapter associated with attention component 106B uses an adapter-specific rotation matrix 205A (RL1) after the encoder 110, as well as the inverse of the rotation matrix 205B (denoted ) prior to the decoder 112. Similarly, in the feed-forward component 113B, the adapter uses an adapter-specific rotation matrix 207A (RL2) after the encoder 115, as well as the inverse of the rotation matrix 207B (denoted ) prior to the decoder 116.

[0062] In some aspects, the adapter rotation matrices 205 and 207 (and their inverses) may be Hadamard matrices. In some aspects, the adapter rotation matrices 205 and 207 (and their inverses) may each have a shape of (Drank, Drank) , where Drank is the rank of the corresponding set of adapter parameters (e.g., the rank of the LoRA adapter, such as the encoder 110 and / or 115) .

[0063] In some aspects, a unique adapter-specific rotation matrix 205 and / or 207 may be trained for each adapter in the model. That is, the attention component 106B and the feed-forward component 113B may have different rotation matrices. In some aspects, components within the same transformer 100B may use the same adapter rotation matrix. In some aspects, each transformer in the machine learning model may use one or more unique adapter rotation matrices. That is, a unique adapter rotation matrix may be generated for each adapter and / or for each transformer in the model.

[0064] In some aspects, the adapter rotation matrices 205 and 207 may be generated using calibration or other training data. That is, the values of the adapter rotation matrices 205 and 207 may be learned based on a training phase. In some aspects, the adapter rotation matrices 205 and 207 may be trained after the other portions of the model are trained. For example, after the base weights (e.g., the parameters of the multi-head self-attention 108 and / or MLP 114) , adapter weights (e.g., the parameters of the encoders 110 and / or 115 and / or the decoder 112 and / or 116) , and / or base model rotation matrices (e.g., R1, R2, R3, and / or R4) are trained, these parameters may be frozen to allow the adapter rotation matrices RL to be learned based on calibration data (e.g., by seeking to find parameters of each adapter rotation matrix that minimizes or at least reduces the quantization error and / or maximizes or at least improves the accuracy of the model) .

[0065] The remaining aspects of the transformer 100B largely mirror the architecture of the transformer 100A discussed above with reference to FIG. 1A. Turning now to FIG. 2B, the architecture of the attention component 106B is discussed in more detail. Specifically, FIG. 2B depicts how the adapter rotation matrices used in the transformer 100B can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0066] Generally, most of the depicted architecture of the attention component 106B mirrors the architecture of the attention component 106A discussed above with reference to FIG. 1B. For example, the attention component 106B also includes four operations 120B, 124B, 130B, and 146B with four corresponding sets of base model parameters as well as four corresponding sets of adapter parameters.

[0067] Further, the various sets of base model parameters may have base model rotation matrices (e.g., R1, R2, and R3, and their inverses) merged into the base model parameters themselves (e.g., to form the modified sets of parameters 122A, 126A, 132A, and 148A) , as discussed above.

[0068] The illustrated architecture of FIG. 2B also includes use of the adapter specific rotation matrix 205A (RL1) and the inverse. Although the illustrated example depicts use of the same rotation matrix RL1 for each operation or component of the attention component 106B, in some aspects, a separate adapter rotation matrix may be trained for each depicted operation. In the illustrated example, these adapter rotation matrices can be merged with corresponding sets of adapter parameters to reduce runtime overhead. That is, during runtime, rather than first rotating a given tensor and then applying the relevant set of parameters, the machine learning system may rotate the parameters offline and then use the rotated parameters to process data during runtime (e.g., using multiplication or convolution) .

[0069] Specifically, with respect to the query operation 120B, the query encoder parameters can be rotated by the inverse rotation matrix  (discussed above) as well as by the adapter rotation matrix RL1 (e.g., 205A of FIG. 2A) to generate a modified (e.g., rotated) set of parameters 123B, and the query decoder parameters are rotated by the inverse adapter rotation matrix  (e.g., 205B from FIG. 2A) to form a set of modified (e.g., rotated) parameters 210. That is, the set of modified parameters 123B may be defined as and the set of modified parameters 210 may be defined as

[0070] Similarly, with respect to the key operation 124B, the key encoder parameters  can be rotated by the inverse rotation matrix  (discussed above) as well as by the adapter rotation matrix RL1 to generate a set of modified (e.g., rotated) parameters 128B. The key decoder parameters are rotated by the inverse adapter rotation matrix to form a set of modified (e.g., rotated) parameters 215. That is, the set of modified parameters 128B may be defined as and the set of modified parameters 215 may be defined as

[0071] Further, with respect to the value operation 130B, the value encoder parameters can be rotated by the inverse rotation matrix  (discussed above) as well as by the adapter rotation matrix RL1 to generate a set of modified (e.g., rotated) parameters 134B. The value decoder parameters are rotated by the inverse adapter rotation matrix and further by the base model rotation matrix R2 to form a set of modified (e.g., rotated) parameters 136B. That is, the set of modified parameters 134B may be defined as and the set of modified parameters 136B may be defined as

[0072] Finally, with respect to the output operation 146B, the output encoder parameters can be rotated by the inverse rotation matrix and further by the adapter rotation matrix RL1 to generate a modified (e.g., rotated) set of parameters 150B, and the value decoder parameters are rotated by the inverse adapter rotation matrix  and the rotation matrix R1 to form a set of modified (e.g., rotated) parameters 152B. That is, the set of modified parameters 150B may be defined as and the set of modified parameters 152B may be defined as

[0073] As discussed above, merging these rotation matrices by rotating the various sets of parameters (to generate modified or rotated parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions.

[0074] Turning now to FIG. 2C, the architecture of the feed-forward component 113B of FIG. 2A is discussed in more detail. Specifically, FIG. 2C depicts how some of the rotation operations used in the transformer 100B can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0075] Generally, most of the depicted architecture of the feed-forward component 113B mirrors the architecture of the feed-forward component 113A discussed above with reference to FIG. 1C. For example, the feed-forward component 113B also includes three operations 154B, 160B, and 172B with three corresponding sets of base model parameters as well as three corresponding sets of adapter parameters.

[0076] Further, the various sets of base model parameters may have base model rotation matrices (e.g., R1 and its inverses) merged into the base model parameters themselves (e.g., to form the modified sets of parameters 156A, 162A, and 174A) , as discussed above.

[0077] The illustrated architecture of FIG. 2C also includes use of the adapter specific rotation matrix 207A (RL2) and the inverse. Although the illustrated example depicts use of the same rotation matrix RL2 for each operation or component of the feed-forward component 113B, in some aspects, a separate adapter rotation matrix may be trained for each depicted operation. In the illustrated example, these adapter rotation matrices can be merged with corresponding sets of adapter parameters to reduce runtime overhead. That is, during runtime, rather than first rotating a given tensor and then applying the relevant set of parameters, the machine learning system may rotate the parameters offline and then use the rotated parameters to process data during runtime (e.g., using multiplication or convolution) .

[0078] Specifically, with respect to the up-projection operation 154B, the up-projection encoder parameters can be rotated by the inverse rotation matrix (discussed above) as well as by the adapter rotation matrix RL2 (e.g., 207A of FIG. 2A) to generate a modified (e.g., rotated) set of parameters 158B, and the up-projection decoder parameters are rotated by the inverse adapter rotation matrix  (e.g., 207B from FIG. 2A) to form a set of modified (e.g., rotated) parameters 220. That is, the set of modified parameters 158B may be defined as and the set of modified parameters 220 may be defined as

[0079] Similarly, with respect to the gating operation 160B, the gating encoder parameters can be rotated by the inverse rotation matrix  (discussed above) as well as by the adapter rotation matrix RL2 to generate a set of modified (e.g., rotated) parameters 164B. The gating decoder parameters are rotated by the inverse adapter rotation matrix to form a set of modified (e.g., rotated) parameters 225. That is, the set of modified parameters 164B may be defined as and the set of modified parameters 225 may be defined as

[0080] Finally, with respect to the down-projection operation 172B, the down-projection encoder parameters can be rotated by the inverse rotation matrix and further by the adapter rotation matrix RL2 to generate a modified (e.g., rotated) set of parameters 176B, and the down-projection decoder parameters can be rotated by inverse adapter rotation matrix and further by the rotation matrix R1 to generate a modified (e.g., rotated) set of parameters 178B. That is, the set of modified parameters 176B may be defined as and the set of modified parameters 178B may be defined as

[0081] As discussed above, merging these rotation matrices by rotating the various sets of parameters (to generate modified or rotated parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions. Example Architecture for Improved Adapter Quantization Using Adapter Rotation  Matrices

[0082] FIGS. 3A, 3B, and 3C depict an example architecture for improved adapter quantization using adapter rotation matrices, according to some aspects of the present disclosure. Specifically, FIG. 3A depicts an example architecture of a transformer 100C of a machine learning model, where the transformer 100C includes an attention component 106C and a feed-forward component 113C. FIG. 3B provides additional detail for the architecture of the attention component 106C, while FIG. 3C provides additional detail for the architecture of the feed-forward component 113C. In some aspects, the depicted transformer 100C may be used by a machine learning system, such as the machine learning system discussed above with reference to FIGS. 1A-1C and / or 2A-2C.

[0083] Turning now to FIG. 3A, the transformer 100C shares a number of similarities from the architectures discussed above with respect to the transformer 100A of FIG. 1A and the transformer 100B of FIG. 2A. For example, the transformer 100C receives an input 102 and generates a corresponding output 118 using an attention component 106C and a feed-forward component 113C. However, in the illustrated architecture, the base model rotation matrices (e.g., the rotation matrices R1, R2, R3, and R4) are not included. That is, the only rotation matrices used in the transformer 100C are the adapter specific rotation matrices 205A and 207A (and their inverses) .

[0084] The remaining aspects of the transformer 100C largely mirror the architecture of the transformer 100A discussed above with reference to FIG. 1A and / or the transformer 100B discussed above with reference to FIG. 2A. Turning now to FIG. 3B, the architecture of the attention component 106C is discussed in more detail. Specifically, FIG. 3B depicts how the adapter rotation matrices used in the transformer 100C can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0085] Generally, most of the depicted architecture of the attention component 106C mirrors the architecture of the attention component 106A discussed above with reference to FIG. 1B and / or the attention component 106B discussed above with reference to FIG. 2B. For example, the attention component 106C also includes four operations 120C, 124C, 130C, and 146C with four corresponding sets of base model parameters as well as four corresponding sets of adapter parameters.

[0086] Of note, the various sets of base model parameters do not incorporate base model rotation matrices (e.g., R1 and R2) merged into the base model parameters themselves. Instead, the query operation 120C uses the (non-rotated or original) base model parameters 108A (denoted Wq) , the key operation 124C uses the (non-rotated or original) base model parameters 108B (denoted Wk) , the value operation 130C uses the (non-rotated or original) base model parameters 108C (denoted Wv) , and the output operation 146C uses the (non-rotated or original) base model parameters 108C (denoted Wo) . Additionally, rather than being rotated (e.g., by R3) during runtime, the outputs of the positional embedding operations 138 are provided directly to the operation 142 for aggregation.

[0087] The illustrated architecture of FIG. 3B retains use of the adapter specific rotation matrix 205A (RL1) and the inverse. Although the illustrated example depicts use of the same rotation matrix RL1 for each operation or component of the attention component 106C, in some aspects, a separate adapter rotation matrix may be trained for each depicted operation. In the illustrated example, these adapter rotation matrices can be merged with corresponding sets of adapter parameters to reduce runtime overhead. That is, during runtime, rather than first rotating a given tensor and then applying the relevant set of parameters, the machine learning system may rotate the parameters offline and then use the rotated parameters to process data during runtime (e.g., using multiplication or convolution) .

[0088] Specifically, with respect to the query operation 120C, the query encoder parameters can be rotated by the adapter rotation matrix RL1 (e.g., 205A of FIG. 3A) to generate a modified (e.g., rotated) set of parameters 123C, and the query decoder parameters are rotated by the inverse adapter rotation matrix  (e.g., 205B from FIG. 3A) to form the set of modified (e.g., rotated) parameters 210. That is, the set of modified parameters 123C may be defined as and the set of modified parameters 210 may be defined as discussed above with reference to FIG. 2B.

[0089] Similarly, with respect to the key operation 124C, the key encoder parameters  can be rotated by the adapter rotation matrix RL1 to generate a set of modified (e.g., rotated) parameters 128C. The key decoder parameters are rotated by the inverse adapter rotation matrix to form the set of modified (e.g., rotated) parameters 215. That is, the set of modified parameters 128C may be defined as and the set of modified parameters 215 may be defined as discussed above with reference to FIG. 2B.

[0090] Further, with respect to the value operation 130C, the value encoder parameters can be rotated by the adapter rotation matrix RL1 to generate a set of modified (e.g., rotated) parameters 134C. The value decoder parameters are rotated by the inverse adapter rotation matrix to form a set of modified (e.g., rotated) parameters 136C. That is, the set of modified parameters 134C may be defined as  and the set of modified parameters 136C may be defined as

[0091] Finally, with respect to the output operation 146C, the output encoder parameters can be rotated by the adapter rotation matrix RL1 to generate a modified (e.g., rotated) set of parameters 150C, and the value decoder parameters are rotated by the inverse adapter rotation matrix to form a set of modified (e.g., rotated) parameters 152C. That is, the set of modified parameters 150C may be defined as  and the set of modified parameters 152C may be defined as

[0092] As discussed above, merging these rotation matrices by rotating the various sets of parameters (to generate modified or rotated parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions.

[0093] Turning now to FIG. 3C, the architecture of the feed-forward component 113C of FIG. 3A is discussed in more detail. Specifically, FIG. 3C depicts how some of the rotation operations used in the transformer 100C can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0094] Generally, most of the depicted architecture of the feed-forward component 113C mirrors the architecture of the feed-forward component 113A discussed above with reference to FIG. 1C and / or the feed-forward component 113B discussed above with reference to FIG. 2C. For example, the feed-forward component 113C also includes three operations 154C, 160C, and 172C with three corresponding sets of base model parameters as well as three corresponding sets of adapter parameters.

[0095] Of note, the various sets of base model parameters do not incorporate base model rotation matrices merged into the base model parameters themselves. Instead, the up-projection operation 154C uses the (non-rotated or original) base model parameters 114A (denoted Wu) , the gating operation 160C uses the (non-rotated or original) base model parameters 114B (denoted Wg) , and the down-projection operation 172C uses the (non-rotated or original) base model parameters 114C (denoted Wd) . Additionally, rather than being rotated (e.g., by R4) during runtime, the output of the operation 168 is provided directly to the operation 172C.

[0096] The illustrated architecture of FIG. 3C retains use of the adapter specific rotation matrix 207A (RL2) and the inverse. Although the illustrated example depicts use of the same rotation matrix RL2 for each operation or component of the feed-forward component 113C, in some aspects, a separate adapter rotation matrix may be trained for each depicted operation. In the illustrated example, these adapter rotation matrices can be merged with corresponding sets of adapter parameters to reduce runtime overhead. That is, during runtime, rather than first rotating a given tensor and then applying the relevant set of parameters, the machine learning system may rotate the parameters offline and then use the rotated parameters to process data during runtime (e.g., using multiplication or convolution) .

[0097] Specifically, with respect to the up-projection operation 154C, the up-projection encoder parameters can be rotated by the adapter rotation matrix RL2 (e.g., 207A of FIG. 3A) to generate a modified (e.g., rotated) set of parameters 158C, and the up-projection decoder parameters are rotated by the inverse adapter rotation matrix  (e.g., 207B from FIG. 3A) to form the set of modified (e.g., rotated) parameters 220. That is, the set of modified parameters 158C may be defined as and the set of modified parameters 220 may be defined as discussed above with reference to FIG. 2C.

[0098] Similarly, with respect to the gating operation 160C, the gating encoder parameters can be rotated by the adapter rotation matrix RL2 to generate a set of modified (e.g., rotated) parameters 164C. The gating decoder parameters are rotated by the inverse adapter rotation matrix to form the set of modified (e.g., rotated) parameters 225. That is, the set of modified parameters 164C may be defined as  and the set of modified parameters 225 may be defined as discussed above with reference to FIG. 2C.

[0099] Finally, with respect to the down-projection operation 172C, the down-projection encoder parameters can be rotated by the adapter rotation matrix RL2 to generate a modified (e.g., rotated) set of parameters 176C, and the down-projection decoder parameters can be rotated by inverse adapter rotation matrix to generate a modified (e.g., rotated) set of parameters 178C. That is, the set of modified parameters 176C may be defined as and the set of modified parameters 178C may be defined as

[0100] As discussed above, merging these rotation matrices by rotating the various sets of parameters (to generate modified or rotated parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions. Example Architecture for Improved Adapter Quantization Using Base Model  Transformation Matrices

[0101] FIGS. 4A, 4B, and 4C depict an example architecture for improved adapter quantization using base model transformation matrices, according to some aspects of the present disclosure. Specifically, FIG. 4A depicts an example architecture of a transformer 400A of a machine learning model (sometimes referred to as a “transformer block” ) , where the transformer 400A includes an attention component 106D and a feed-forward component 113D. FIG. 4B provides additional detail for the architecture of the attention component 106D, while FIG. 4C provides additional detail for the architecture of the feed-forward component 113D. In some aspects, the depicted transformer 400A may be used by a machine learning system, such as the machine learning systems discussed above with reference to FIGS. 1A-1C, 2A-2C, and / or 3A-3C.

[0102] Turning now to FIG. 4A, the transformer 400A shares a number of similarities from the architecture discussed above with respect to the transformer 100A of FIG. 1A. For example, the transformer 400A receives an input 102 and generates a corresponding output 118 using an attention component 106D and a feed-forward component 113D. However, although the above-discussed architectures utilize various rotation matrices to improve quantization, the transformer 400A instead uses transformation matrices (e.g., affine transformations) and scaling vector (s) within various components to improve quantization (e.g., using an architecture similar to FlatQuant, rather than SpinQuant) .

[0103] In some aspects, unique adapter-specific transformation matrices and / or scaling vectors may be trained for each adapter in the model. That is, the attention component 106D and the feed-forward component 113D may have different transformation matrices and / or scaling vectors. In some aspects, components within the same transformer 400A may use the same adapter transformation matrices and / or scaling vectors. In some aspects, each transformer in the machine learning model may use one or more unique adapter transformation matrices and / or scaling vectors. That is, a unique adapter transformation matrix and / or scaling vector may be generated for each adapter and / or for each transformer in the model.

[0104] In some aspects, in a similar manner to the above-discussed rotation matrices, the various transformation matrices and scaling vectors may be generated using calibration or other training data. That is, the values of the matrices and vectors may be learned based on a training phase. In some aspects, the adapter transformation matrices and scaling vectors may be trained after the other portions of the model are trained. For example, after the base weights (e.g., the parameters of the multi-head self-attention 108D and / or MLP 114D) , adapter weights (e.g., the parameters of the encoders 110D and / or 115D and / or the decoders 112D and / or 116D) , and / or base model transformation matrices and / or scaling vectors are trained, these parameters may be frozen to allow the adapter transformation matrices and scaling vectors to be learned based on calibration data (e.g., by seeking to find parameters of each matrix and vector that minimizes or at least reduces the quantization error and / or maximizes or at least improves the accuracy of the model) .

[0105] The remaining aspects of the transformer 400A largely mirror the architecture of the transformer 100A discussed above with reference to FIG. 1A. Turning now to FIG. 4B, the architecture of the attention component 106D is discussed in more detail. Specifically, FIG. 4B depicts how the adapter transformation matrices and scaling vectors used in the transformer 400A can be merged into corresponding model parameters, reducing or eliminating the overhead of such operations during runtime.

[0106] In the illustrated example, the attention component 106D includes a normalization operation 405 (e.g., layer normalization) followed by application of a scaling vector 410. In some aspects, the scaling vector 410 is a learnable vector (e.g., with values learned during training) used to balance outliers in the input data. In some aspects, as illustrated, the scaling vector 410 can be merged with the normalization operation 405 to reduce inferencing overhead. As illustrated, the output of this operation may then be transformed using a learned transformation matrix 412 (denoted Pa) .

[0107] Generally, most of the remaining architecture of the attention component 106D mirrors the architecture of the attention component 106A discussed above with reference to FIG. 1B. For example, the attention component 106D also includes four operations 120D, 124D, 130D, and 146D with four corresponding sets of base model parameters as well as four corresponding sets of adapter parameters.

[0108] Specifically, in the illustrated example, the base model parameters 122D (e.g., a portion of the multi-head self-attention operation 108) of the query operation 120D may be generated by merging the query weights Wq with the inverse of a first learned transformation matrix Pa (e.g., an affine transformation) as well as the inverse of a learned scaling vector (denoted Vln in some aspects) . That is, the parameters 122D may be defined as Similarly, as illustrated, the base model parameters 126D of the key operation 124D may be defined as The base model parameters 132D of the value operation 130D may further be merged with a second transformation matrix Pv, such that the parameters 132D are defined as

[0109] In the illustrated example, the transformation matrices and scaling vectors can be similarly applied to the encoder (s) and decoder (s) of each operation. Specifically, as illustrated, the adapter parameters 123D (e.g., of the encoder 110D of FIG. 4A) may be defined as  (e.g., the inverse transformation matrix and the inverse scaling vector merged with the encoder query parameters ) . Similarly, the adapter parameters 128D of the key operation 124D may be defined as and the adapter parameters 134D of the value operation 130D may be defined as

[0110] Further, the adapter decoder parameters 112A and 112B (denoted and  respectfully) may be unchanged, and the adapter parameters 136D may be defined as

[0111] As illustrated, after applying the positional embedding operations 138A and 138B to the outputs of the query operation 120D and the key operation 124D, respectfully, a third transformation matrix Ph can used. Specifically, the transformation matrix 440A is used to transform the output of the positional embedding operation 138B, and the inverse of the transformation matrix 440B is used to transform the output of the positional embedding 138A.

[0112] Additionally, in the illustrated example, the output of the softmax operation 144 and the output of the value operation 130D may be aggregated using another learned transformation matrix 442 (denoted Po in the illustrated example) . That is, the input data may be aggregated (e.g., summed, averaged, and the like) and the result may be transformed using the transformation matrix 442.

[0113] Finally, with respect to the output operation 146D, the output parameters of the base model Wo may be merged with the inverse of the transformation matrix Pv and the inverse of the transformation matrix Po, yielding Additionally, the output encoder parameters can be transformed by the inverse transformation matrix to generate a modified set of parameters 150D, and the value decoder parameters are transformed by the inverse adapter transformation matrix to form a set of modified parameters 152D. That is, the set of modified parameters 150D may be defined as  and the set of modified parameters 152D may be defined as

[0114] As discussed above, merging these learned transformation matrices into the corresponding parameters (to generate modified parameters) offline may reduce the computational expense and latency of using the model during runtime to generate output predictions. In some aspects, some of the transformations (e.g., the transformation matrices 412, 440A, 440B, and 442) may be applied online. In some aspects, some or all of these matrices (e.g., the transformation matrices 412 and 442) may be decomposed transformations (e.g., each matrix may be decomposed offline to generate two matrices that, when multiplied, yield the original matrix) . These decomposed matrices can be sequentially applied to the input to allow relatively large transformation matrices to be efficiently applied using hardware with limited physical capacity. In some aspects, some or all of the matrices (e.g., the transformation matrices 440A and 440B) may be applied directly using a single transformation (e.g., without decomposition) .

[0115] Turning now to FIG. 4C, the architecture of the feed-forward component 113D of FIG. 4A is discussed in more detail. In the illustrated example, the feed-forward component 113D includes a normalization operation 415 (e.g., layer normalization) followed by application of a scaling vector 420. In some aspects, as discussed above, the scaling vector 420 is a learnable vector used to balance outliers in the data. As illustrated, the output of this operation may then be transformed using a learned transformation matrix 425 (denoted Pug) .

[0116] Generally, most of the remaining architecture of the feed-forward component 113D mirrors the architecture of the feed-forward component 113A discussed above with reference to FIG. 1C. For example, the feed-forward component 113D also includes three operations 154D, 160D, and 172D with three corresponding sets of base model parameters as well as three corresponding sets of adapter parameters.

[0117] Specifically, the base model parameters Wu of the up-projection operation 154D may be merged with the inverse of the transformation matrix Pug, the inverse of a learned scaling vector Vug, and a learned scaling vector Vd such that the parameters 156D may be defined as The base model parameters Wg of the gating operation 160D may be merged with the inverse of the transformation matrix Pug and the inverse of the learned scaling vector Vug such that the parameters 162D may be defined as  Additionally, the base model parameters Wd of the down-projection operation 172D may be merged with the inverse of a transformation matrix Pd and the inverse of the learned scaling vector Vd such that the parameters 176D may be defined as

[0118] Further, with respect to the up-projection operation 154D, the up-projection encoder parameters can be transformed by the inverse of the transformation matrix Pug as well as by the inverse of the scaling vector Vug to generate a modified set of parameters 158D (defined as ) , and the up-projection decoder parameters are transformed by a transformation matrix Vd to form a set of modified 116D (defined as ) .

[0119] Similarly, with respect to the gating operation 160D, the gating encoder parameters can be transformed by the inverse of the transformation matrix Pug as well as by the inverse of the scaling vector Vug to generate a modified set of parameters 158D (defined as ) , and the gating decoder parameters 116A may be left unchanged (e.g., denoted ) .

[0120] Further, as illustrated, the output of the up-projection operation 154D and the output of the operation 166 are aggregated and transformed using the transformation matrix 430 (denoted Pd) . Finally, with respect to the down-projection operation 172D, the base model parameters Wd may be merged with the inverse of the transformation matrix Pd and the inverse of the scaling vector Vd to form the parameters 174D (defined as ) . The down-projection encoder parameters can be aggregated with the inverse of the transformation matrix Pd and the inverse of the scaling vector Vd to generate a modified set of parameters 176D (defined as ) , and the down-projection decoder parameters 178A may be left unchanged (denoted ) .

[0121] As discussed above, merging these matrices and scaling vectors into the corresponding sets of parameters offline may reduce the computational expense and latency of using the model during runtime to generate output predictions. In some aspects, some of the transformations (e.g., the transformation matrices 425 and 430) may be applied online, and may be applied directly and / or by decomposing these matrices into two smaller matrices (to facilitate use of various hardware components) . Example Architecture for Improved Adapter Quantization Using Base Model  Transformation Matrices and Adapter Transformation Matrices

[0122] FIGS. 5A and 5B depict an example architecture for improved adapter quantization using base model transformation matrices and adapter transformation matrices, according to some aspects of the present disclosure. In some aspects, FIGS. 5A and 5B add detail to the transformer 400A of FIG. 4A. That is, the attention component 106E of FIG. 5A may correspond to the attention component 106D of FIG. 4A, and / or the feed-forward component 113E of FIG. 5B may correspond to the feed-forward component 113D of FIG. 4A. In some aspects, the depicted transformer architecture may be used by a machine learning system, such as the machine learning system discussed above with reference to FIGS. 1A-1C, 2A-2C, 3A-3C, and / or 4A-4C.

[0123] In some aspects, the architecture depicted in FIGS. 5A and 5B is substantially similar to the architecture discussed above with reference to FIGS. 4B and 4C, except that FIGS. 5A and 5B introduce the use of adapter-specific transformation matrices and / or scaling vectors (in a similar manner to the adapter-specific rotation matrices discussed above with reference to FIGS. 2A-2C) .

[0124] Turning to FIG. 5A, in the illustrated architecture of the attention component 106E, the base model parameters 122D, 126D, 132D, and 148D are unchanged from the example discussed above with reference to FIG. 4B. Similarly, the remaining operations are also aligned with the attention component 106D of FIG. 4B. However, as illustrated, the query operation 120E, the key operation 124E, the value operation 130E, and the output operation 146E are modified. Specifically, the adapter parameters 123E, 112E, 128E, 112F, 134E, 136E, 150E, and 152E have been modified (e.g., transformed) using adapter-specific transformation matrices (denoted PL) and / or scaling vectors (denoted Vq, Vk, Vv, and Vo) .

[0125] Specifically, with respect to the query operation 120E, the adapter’s encoder query parameters may be transformed using the inverse of the transformation matrix Pa, the inverse of the scaling vector Vln, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vq, such that the modified encoder parameters 123E may be defined as The adapter’s decoder query parameters may be transformed using the inverse of the adapter-specific transformation matrix PLand the inverse of the adapter-specific scaling vector Vq, such that the modified decoder parameters 112E may be defined as

[0126] Further, with respect to the key operation 124E, the adapter’s encoder key parameters may be transformed using the inverse of the transformation matrix Pa, the inverse of the scaling vector Vln, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vk, such that the modified encoder parameters 128E may be defined as The adapter’s decoder key parameters may be transformed using the inverse of the adapter-specific transformation matrix PL and the inverse of the adapter-specific scaling vector Vk, such that the modified decoder parameters 112F may be defined as

[0127] With respect to the value operation 130E, the adapter’s encoder value parameters may be transformed using the inverse of the transformation matrix Pa, the inverse of the scaling vector Vln, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vv, such that the modified encoder parameters 134E may be defined as The adapter’s decoder value parameters may be transformed using the inverse of the adapter-specific transformation matrix PL, the inverse of the adapter-specific scaling vector Vv, and the (base model) transformation matrix Pv such that the modified decoder parameters 136E may be defined as

[0128] With respect to the output operation 146E, the adapter’s encoder output parameters may be transformed using the inverse of the transformation matrix Pv, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vo, such that the modified encoder parameters 150E may be defined as The adapter’s decoder output parameters may be transformed using the inverse of the adapter-specific transformation matrix PL, the inverse of the adapter-specific scaling vector Vo, and the inverse of the (base model) transformation matrix Po such that the modified decoder parameters 152E may be defined as

[0129] Turning now to FIG. 5B, in the illustrated architecture of the feed-forward component 113E, the base model parameters 156D, 162D, and 174D are unchanged from the example discussed above with reference to FIG. 4C. Similarly, the remaining operations are also aligned with those of the feed-forward component 113D of FIG. 4C. However, as illustrated, the up-projection operation 154E, the gating operation 160E, and the down-projection operation 172E are modified. Specifically, the adapter parameters 158E, 116E, 164E, 116F, 176E, and 178E have been modified (e.g., transformed) using adapter-specific transformation matrices (denoted PL) and / or scaling vectors (denoted Vu, Vg, and Vd) .

[0130] Specifically, with respect to the up-projection operation 154E, the adapter’s encoder up-projection parameters may be transformed using the inverse of the transformation matrix Pug, the inverse of the scaling vector Vug, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vu, such that the modified encoder parameters 158E may be defined as The adapter’s decoder up-projection parameters may be transformed using the inverse of the adapter-specific transformation matrix PL, the inverse of the adapter-specific scaling vector Vu, and the (base model) scaling vector Vd such that the modified decoder parameters 116E may be defined as

[0131] Further, with respect to the gating operation 160E, the adapter’s gating encoder parameters may be transformed using the inverse of the transformation matrix Pug, the inverse of the scaling vector Vug, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vg, such that the modified encoder parameters 164E may be defined as The adapter’s gating decoder parameters may be transformed using the inverse of the adapter-specific transformation matrix PL and the inverse of the adapter-specific scaling vector Vg such that the modified decoder parameters 116F may be defined as

[0132] Finally, with respect to the down-projection operation 172E, the adapter’s down-projection encoder parameters may be transformed using the inverse of the transformation matrix Pd, the inverse of the scaling vector Vd, the adapter-specific transformation matrix PL, and the adapter-specific scaling vector Vdown, such that the modified encoder parameters 176E may be defined as The adapter’s down-projection decoder parameters may be transformed using the inverse of the adapter-specific transformation matrix PL and the inverse of the adapter-specific scaling vector Vdown such that the modified decoder parameters 178E may be defined as

[0133] Use of such adapter-specific transformations and scaling vectors may improve the quantization accuracy and enable quantizing of the adapter parameters to relatively lower bitwidths (e.g., four bits) without substantial loss in model performance. Example Architecture for Improved Adapter Quantization Using Adapter  Transformation Matrices

[0134] FIGS. 6A and 6B depict an example architecture for improved adapter quantization using adapter transformation matrices, according to some aspects of the present disclosure. In some aspects, FIGS. 6A and 6B add detail to the transformer 400A of FIG. 4A. That is, the attention component 106F of FIG. 6A may correspond to the attention component 106D of FIG. 4A, and / or the feed-forward component 113F of FIG. 6B may correspond to the feed-forward component 113D of FIG. 4A. In some aspects, the depicted transformer architecture may be used by a machine learning system, such as the machine learning system discussed above with reference to FIGS. 1A-1C, 2A-2C, 3A-3C, 4A-4C, and / or 5A-5B.

[0135] In some aspects, the architecture depicted in FIGS. 6A and 6B is substantially similar to the architecture discussed above with reference to FIGS. 4B, 4C, 5A, and 5B except that FIGS. 6A and 6B retain use of adapter-specific transformation matrices and / or scaling vectors while refraining from using the base model transformation matrices and / or scaling vectors (in a similar manner to the architectures discussed above with reference to FIGS. 3A-3C) .

[0136] Turning to FIG. 6A, in the illustrated architecture of the attention component 106F, the base model parameters 122, 126, 132, and 148 are unmodified from the original base model (e.g., no transformation or scaling is applied) . Further the adapter parameters 112E and 112F are unmodified from the versions discussed above with reference to FIG. 5A. However, as illustrated, the adapter parameters 123F, 128F, 134F, 136F, 150F, and 152F of the query operation 120F, the key operation 124F, the value operation 130F, and the output operation 146F have been modified as compared to the above discussion.

[0137] Specifically, with respect to the query operation 120F, the adapter’s encoder query parameters may be transformed using the adapter-specific transformation matrix PL and the adapter-specific scaling vector Vq, such that the modified encoder parameters 123F may be defined as

[0138] Further, with respect to the key operation 124F, the adapter’s encoder key parameters may be transformed using the adapter-specific transformation matrix PLand the adapter-specific scaling vector Vk such that the modified encoder parameters 128F may be defined as

[0139] With respect to the value operation 130F, the adapter’s encoder value parameters may be transformed using the adapter-specific transformation matrix PLand the adapter-specific scaling vector Vv such that the modified encoder parameters 134F may be defined as The adapter’s decoder value parameters may be transformed using the inverse of the adapter-specific transformation matrix PL and the inverse of the adapter-specific scaling vector Vv such that the modified decoder parameters 136F may be defined as

[0140] With respect to the output operation 146F, the adapter’s encoder output parameters may be transformed using the adapter-specific transformation matrix PLand the adapter-specific scaling vector Vo such that the modified encoder parameters 150F may be defined as The adapter’s decoder output parameters may be transformed using the inverse of the adapter-specific transformation matrix PL and the inverse of the adapter-specific scaling vector Vo such that the modified decoder parameters 152E may be defined as

[0141] Turning now to FIG. 6B, in the illustrated architecture of the feed-forward component 113F, the base model parameters 156, 162, and 174 are unmodified from the original base model (e.g., no transformation or scaling is applied) . Further the adapter parameters 116F and 178E are unmodified from the versions discussed above with reference to FIG. 5B. However, as illustrated, the adapter parameters 116G, 158F, 164F, and 176F of the up-projection operation 154F, the gating operation 160F, and the down-projection operation 172F have been modified as compared to the above discussion, except for the output of the normalization operation 415 being provided directly to the up-projection operation 154F and the gating operation 160F, and the use of the operation 470 (e.g., multiplication) to aggregate the output of the operation 166 and the up-projection operation 154F (rather than using a base model transformation matrix) .

[0142] With respect to the up-projection operation 154F, the adapter’s encoder up-projection parameters may be transformed using the adapter-specific transformation matrix PL and the adapter-specific scaling vector Vu such that the modified encoder parameters 158F may be defined as The adapter’s decoder up-projection parameters may be transformed using the inverse of the adapter-specific transformation matrix PL and the inverse of the adapter-specific scaling vector Vu such that the modified decoder parameters 116G may be defined as

[0143] Further, with respect to the gating operation 160F, the adapter’s gating encoder parameters may be transformed using the adapter-specific transformation matrix PL and the adapter-specific scaling vector Vg, such that the modified encoder parameters 164F may be defined as

[0144] Finally, with respect to the down-projection operation 172F, the adapter’s down-projection encoder parameters may be transformed using the adapter-specific transformation matrix PL and the adapter-specific scaling vector Vdown such that the modified encoder parameters 176F may be defined as

[0145] Use of such adapter-specific transformations and scaling vectors may improve the quantization accuracy and enable quantizing of the adapter parameters to relatively lower bitwidths (e.g., four bits) without substantial loss in model performance. Example Method for Generating Transformation Matrices for Improved Quantization

[0146] FIG. 7 is a flow diagram depicting an example method 700 for generating transformation matrices for improved quantization, according to some aspects of the present disclosure. In some aspects, the method 700 may be performed by a machine learning system (e.g., a computing system configured to train and / or use machine learning models) , such as the machine learning system discussed above with reference to FIGS. 1A-1C, 2A-2C, 3A-3C, 4A-4C, 5A-5B, and / or 6A-6B.

[0147] At block 705, the machine learning system may access a trained base model (e.g., an LLM) . For example, as discussed above, the base model may comprise a set or sequence of transformer blocks. In some aspects, the machine learning system accesses the model from another system (e.g., a dedicated training system) . In some aspects, the machine learning system may itself train the machine learning model. In some aspects, the machine learning model may generally include base model parameters for components such as attention components (e.g., the multi-head self-attention 108 of FIGS. 1A, 2A, and / or 3A) , feed-forward components (e.g., the MLPs 114 of FIGS. 1A, 2A, and / or 3A) , and the like.

[0148] At block 710, the machine learning system trains a set of base model transformation matrices (e.g., the transformation matrices Pa, Ph, Po, Pv, Pug, and / or Pd discussed above) based on the base model. In some aspects, as discussed above, the machine learning system may freeze the parameters of the base model while training the values of the base model transformation matrices. In some aspects, as discussed above, the machine learning system may train the base model transformation matrices by seeking to find values for each transformation matrix to minimize (or at least reduce) the quantization noise resulting from quantizing the corresponding modified parameters, and / or to maximize (or at least increase) the accuracy of the (quantized) model. In some aspects, training the base model transformation matrices can be performed by processing test or calibration data using the model, and refining the parameters of the transformation matrices based on the resulting model output and / or intermediate tensors within the model. In some aspects, as discussed above, the machine learning system may refrain from training base model transformation matrices (e.g., as discussed above with reference to FIGS. 6A-6B) .

[0149] At block 712, the machine learning system trains a set of base model scaling vectors (e.g., the scaling vectors Vln, Vug, and / or Vd discussed above) based on the base model. In some aspects, as discussed above, the machine learning system may freeze the parameters of the base model while training the values of the base model scaling vectors. In some aspects, as discussed above, the machine learning system may train the base model scaling vectors by seeking to find values for each scaling vectors to minimize (or at least reduce) the quantization noise resulting from quantizing the corresponding modified parameters, and / or to maximize (or at least increase) the accuracy of the (quantized) model. In some aspects, training the base model scaling vectors can be performed by processing test or calibration data using the model, and refining the parameters of the scaling vectors based on the resulting model output and / or intermediate tensors within the model. In some aspects, as discussed above, the machine learning system may refrain from training base model scaling vectors (e.g., as discussed above with reference to FIGS. 6A-6B) . In some aspects, the machine learning system may seek to train the transformation matrices and the scaling vectors simultaneously.

[0150] At block 715, the machine learning system determines whether one or more termination criteria are met with respect to the training of the base model transformation matrices and / or scaling vectors. For example, the machine learning system may determine whether to train such base model matrices and / or vectors at all, whether a defined amount of time or amount of resources have been spent training, whether the model has reached a desired accuracy, and the like. If the termination criteria are not met, the method 700 returns to block 710 to continue training the base model transformation matrices and / or scaling vectors. If the criteria are met, the method 700 continues to block 720.

[0151] At block 720, the machine learning system accesses one or more adapters (e.g., LoRA adapters) for the base model. In some aspects, the machine learning system accesses the adapters from another system (e.g., a dedicated training system) . In some aspects, the machine learning system may itself train the adapters. In some aspects, the adapters may generally include adapter parameters for one or more components of the base model. For example, the adapters may include parameters for the encoders 110 and / or 115 of FIGS. 1A, 2A, and / or 3A, the encoders 110D and / or 115D of FIG. 4A, the decoders 112 and / or 116 of FIGS. 1A, 2A, and / or 3A, and / or the decoders 112D and / or 116D of FIG. 4A.

[0152] At block 725, the machine learning system trains a set of adapter transformation matrices (e.g., the rotation matrices PL discussed above) based on the base model with the adapter (s) active. In some aspects, the machine learning system trains a corresponding transformation matrix of reach component of the adapter (e.g., separate transformation matrices trained for the encoder and / or decoder of the query component, the key component, and so on) . In some aspects, as discussed above, the machine learning system may freeze the parameters of the base model and the adapter (s) while training the values of the adapter transformation matrices. In some aspects, as discussed above, the machine learning system may train the adapter transformation matrices by seeking to find values for each transformation matrix to minimize (or at least reduce) the quantization noise resulting from quantizing the corresponding transformed parameters, and / or to maximize (or at least increase) the accuracy of the (quantized) adapted model. In some aspects, as discussed above, the machine learning system may train a unique adapter transformation matrix for each adapter and / or each component of the base model (e.g., for each transformer) , as discussed above. In some aspects, training the transformation rotation matrices can be performed by processing test or calibration data using the model, and refining the parameters of the transformation matrices based on the resulting model output and / or intermediate tensors within the model.

[0153] At block 727, the machine learning system trains a set of adapter scaling vectors (e.g., the scaling vectors Vq, Vk, Vv, Vo, Vu, Vg and / or Vdown discussed above) based on the base model with the adapter (s) active. In some aspects, as discussed above, the machine learning system may freeze the parameters of the base model and the adapter (s) while training the values of the adapter scaling vectors. In some aspects, as discussed above, the machine learning system may train the adapter scaling vectors by seeking to find values for each scaling vector to minimize (or at least reduce) the quantization noise resulting from quantizing the corresponding modified parameters, and / or to maximize (or at least increase) the accuracy of the (quantized) model. In some aspects, training the adapter scaling vectors can be performed by processing test or calibration data using the model, and refining the parameters of the scaling vectors based on the resulting model output and / or intermediate tensors within the model. In some aspects, the machine learning system may seek to train the adapter transformation matrices and scaling vectors simultaneously.

[0154] At block 730, the machine learning system determines whether one or more termination criteria are met with respect to the training of the adapter transformation matrices and / or scaling vectors. For example, the machine learning system may determine whether a defined amount of time or amount of resources have been spent training, whether the model has reached a desired accuracy, and the like. If the termination criteria are not met, the method 700 returns to block 725 to continue training the adapter transformation matrices and / or scaling vectors. If the criteria are met, the method 700 continues to block 735.

[0155] At block 735, the machine learning system merges one or more of the transformation matrices and / or scaling vectors with one or more corresponding sets of parameters, as discussed above. For example, the machine learning system may merge base model transformation matrices and scaling vectors with the corresponding base model parameters and / or the corresponding adapters. Similarly, the machine learning system may merge the adapter transformation matrices and scaling vectors with the corresponding adapter parameters for which the transformation matrices and scaling vectors were generated. In some aspects, as discussed above, merging the matrices and / or scaling vectors with the set of parameters may generally include multiplying the transformation matrix or scaling vector and the parameter matrix (e.g., transforming the parameters by the transformation matrix or scaling vector) to generate a set of modified (e.g., transformed and / or scaled) parameters.

[0156] At block 740, the machine learning system quantizes the merged parameters (and, in some cases, any non-merged or original parameters of the model) . For example, as discussed above, using aspects of the present disclosure the machine learning system may quantize the modified parameters to relatively small bit-widths (e.g., four bits) , significantly reducing the memory footprint of the machine learning model. Although not depicted in the illustrated example, the machine learning system may then provide the quantized model for inferencing or runtime use, and / or may itself generate output predictions or inferences using the quantized model. Example Method for Machine Learning Model Quantization

[0157] FIG. 8 is a flow diagram depicting an example method 800 for machine learning model quantization, according to some aspects of the present disclosure. In some aspects, the method 800 may be performed by a machine learning system (e.g., a computing system configured to train and / or use machine learning models) , such as the machine learning system discussed above with reference to FIGS. 1A-1C, 2A-2C, 3A-3C, 4A-4C, 5A-5B, 6A-6B, and / or 7.

[0158] At block 805, a first set of adapter parameters (e.g., the encoder 110D and / or 115D and / or the decoder 112D and / or 116D of FIG. 4A) for a first transformer block (e.g., the transformer 400A of FIG. 4A) of a machine learning model is accessed, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters.

[0159] At block 810, a first transformation matrix (e.g., the transformation matrix PL discussed above with reference to of FIGS. 5A and / or 6A) for the first set of adapter parameters is generated.

[0160] At block 815, a first modified set of adapter parameters comprising a first transformed set of encoder parameters (e.g., the modified parameters 123E, 128E, 134E, and / or 150E of FIG. 5A, the modified parameters 158E, 164E, and / or 176E of FIG. 5B, the modified parameters 123F, 128F, 134F, and / or 150F of FIG. 6A, and / or the modified parameters 158F, 164F, and / or 176F of FIG. 6B) is generated based on transforming the first set of encoder parameters according to the first transformation matrix.

[0161] At block 820, the first modified set of adapter parameters further comprising a first rotated set of decoder parameters (e.g., the modified parameters 112E, 112F. 136E, and / or 152E of FIG. 5A, the modified parameters 116E, 116F, and / or 178E of FIG. 5B, the modified parameters 112E, 112F, 136F, and / or 152F of FIG. 6A, and / or the modified parameters 116G, 116F, and / or 178F of FIG. 6B) is generated based on transforming the first set of decoder parameters according to an inverse of the first transformation matrix.

[0162] At block 825, a quantized machine learning model is generated based on quantizing the first set of modified adapter parameters.

[0163] At block 830, the quantized machine learning model is provided for inferencing.

[0164] In some aspects, generating the first transformation matrix comprises training the first transformation matrix using a set of calibration data, wherein the first set of adapter parameters and parameters of the machine learning model (e.g., of the transformer) are frozen during training of the first transformation matrix.

[0165] In some aspects, the method 800 further includes generating a respective transformation matrix for each respective transformer block, with a corresponding adapter, of the machine learning model.

[0166] In some aspects, the method 800 further includes accessing a second set of adapter parameters corresponding to a feed-forward component (e.g., the feed-forward component 113E-F of FIGS. 5B and / or 6B) of the first transformer block, wherein the first set of adapter parameters corresponds to an attention component (e.g., the attention component 106E-F of FIGS. 5A and / or 6A) of the first transformer block, generating a second transformation matrix for the second set of adapter parameters, and generating a second set of modified adapter parameters using the second transformation matrix, wherein generating the quantized machine learning model comprises generating the quantized machine learning model based on quantizing the first set of modified adapter parameters and the second set of modified adapter parameters.

[0167] In some aspects, the method 800 further includes generating a second transformation matrix (e.g., a base model transformation matrix) for the first transformer block, and generating the first set of modified adapter parameters based further on the second transformation matrix, wherein generating the first transformed set of encoder parameters comprises transforming the first set of encoder parameters according to an inverse of the second transformation matrix and then according to the first transformation matrix and generating the first transformed set of decoder parameters further comprises transforming the first transformed set of decoder parameters according to the second transformation matrix.

[0168] In some aspects, the method 800 further includes generating a first scaling vector (e.g., the scaling vector Vq, Vk, Vv, and / or Vo) for the first set of adapter parameters and generating the first set of modified adapter parameters based further on scaling the first set of adapter parameters based on the first scaling vector.

[0169] In some aspects, the method 800 further includes generating a second scaling vector (e.g., the scaling vector Vln, Vug, and / or Vd) for the first transformer block and generating the first set of modified adapter parameters based further on the second scaling vector.

[0170] In some aspects, quantizing the first set of modified adapter parameters comprises quantizing each respective modified adapter parameter of the first set of modified adapter parameters to a bit-width of four bits. Example Processing System for Machine Learning

[0171] FIG. 9 depicts an example processing system 900 configured to perform various aspects of the present disclosure, including, for example, the techniques and methods described with respect to FIGS. 1-5. In some aspects, the processing system 900 may correspond to one or more machine learning systems. For example, the processing system 900 may correspond to the machine learning systems discussed above with reference to FIGS. 1A-1C, 2A-2C, 3A-3C, 4, and / or 5. Although depicted as a single system for conceptual clarity, in some aspects, as discussed above, the components described below with respect to the processing system 900 may be distributed across any number of devices or systems.

[0172] The processing system 900 includes a central processing unit (CPU) 902, which in some examples may be a multi-core CPU. Instructions executed at the CPU 902 may be loaded, for example, from a program memory associated with the CPU 902 or may be loaded from a memory partition (e.g., a partition of a memory 924) .

[0173] The processing system 900 also includes additional processing components tailored to specific functions, such as a graphics processing unit (GPU) 904, a digital signal processor (DSP) 906, a neural processing unit (NPU) 908, a multimedia component 910 (e.g., a multimedia processing unit) , and a wireless connectivity component 912.

[0174] An NPU, such as the NPU 908, is generally a specialized circuit configured for implementing the control and arithmetic logic for executing machine learning algorithms, such as algorithms for processing artificial neural networks (ANNs) , deep neural networks (DNNs) , random forests (RFs) , and the like. An NPU may sometimes alternatively be referred to as a neural signal processor (NSP) , tensor processing unit (TPU) , neural network processor (NNP) , intelligence processing unit (IPU) , vision processing unit (VPU) , or graph processing unit.

[0175] NPUs, such as the NPU 908, are configured to accelerate the performance of common machine learning tasks, such as image classification, machine translation, object detection, and various other predictive models. In some examples, a plurality of NPUs may be instantiated on a single chip, such as a system on a chip (SoC) , while in other examples the NPUs may be part of a dedicated neural-network accelerator.

[0176] NPUs may be optimized for training or inference, or in some cases configured to balance performance between both. For NPUs that are capable of performing both training and inference, the two tasks may still generally be performed independently.

[0177] NPUs designed to accelerate training are generally configured to accelerate the optimization of new models, which is a highly compute-intensive operation that involves inputting an existing dataset (often labeled or tagged) , iterating over the dataset, and then adjusting model parameters, such as weights and biases, in order to improve model performance. Generally, optimizing based on a wrong prediction involves propagating back through the layers of the model and determining gradients to reduce the prediction error.

[0178] NPUs designed to accelerate inference are generally configured to operate on complete models. Such NPUs may thus be configured to input a new piece of data and rapidly process this piece of data through an already trained model to generate a model output (e.g., an inference) .

[0179] In some implementations, the NPU 908 is a part of one or more of the CPU 902, the GPU 904, and / or the DSP 906.

[0180] In some examples, the wireless connectivity component 912 may include subcomponents, for example, for third generation (3G) connectivity, fourth generation (4G) connectivity (e.g., Long-Term Evolution (LTE) ) , fifth generation (5G) connectivity (e.g., New Radio (NR) ) , Wi-Fi connectivity, Bluetooth connectivity, and other wireless data transmission standards. The wireless connectivity component 912 is further coupled to one or more antennas 914.

[0181] The processing system 900 may also include one or more sensor processing units 916 associated with any manner of sensor, one or more image signal processors (ISPs) 918 associated with any manner of image sensor, and / or a navigation processor 920, which may include satellite-based positioning system components (e.g., GPS or GLONASS) as well as inertial positioning system components.

[0182] The processing system 900 may also include one or more input and / or output devices 922, such as screens, touch-sensitive surfaces (including touch-sensitive displays) , physical buttons, speakers, microphones, and the like.

[0183] In some examples, one or more of the processors of the processing system 900 may be based on an ARM or RISC-V instruction set.

[0184] The processing system 900 also includes a memory 924, which is representative of one or more static and / or dynamic memories, such as a dynamic random access memory, a flash-based static memory, and the like. In this example, the memory 924 includes computer-executable components, which may be executed by one or more of the aforementioned processors of the processing system 900.

[0185] In particular, in this example, the memory 924 includes a training component 924A, a merging component 924B, a quantization component 924C, and an inferencing component 924D. Although not depicted in the illustrated example, the memory 924 may also include other components. Though depicted as discrete components for conceptual clarity in FIG. 9, the illustrated components (and others not depicted) may be collectively or individually implemented in various aspects.

[0186] Further, as illustrated, the memory 924 may also include various data, such as a set of model parameters 924E (e.g., parameters of one or more machine learning models and / or model adapters) , training and / or calibration data, and the like.

[0187] The processing system 900 further comprises a training circuit 926, a merging circuit 927, a quantization circuit 928, and an inferencing circuit 929. The depicted circuits, and others not depicted (such as an inferencing circuit) , may be configured to perform various aspects of the techniques described herein.

[0188] The training component 924A and / or the training circuit 926 may be used to train machine learning models and / or adapters (e.g., the model parameters 924E) , and / or to generate trained rotation matrices, trained transformation matrices, and / or trained scaling vectors, as discussed above. For example, the training component 924A and / or the training circuit 926 may train the parameters of the multi-head self-attention components, the MLPs, the base model rotation matrices and / or transformation matrices, the base model scaling vectors, the adapter rotation matrices and / or transformation matrices, and / or the adapter the base model scaling vectors as discussed above.

[0189] The merging component 924B and / or the merging circuit 927 may be used to merge rotation and / or transformation matrices and / or scaling vectors with corresponding model parameters, as discussed above. For example, the merging component 924B and / or the merging circuit 927 may modify, transform, or scale model parameter matrices based on corresponding rotation matrices, transformation matrices, and / or scaling vectors in order to merge these operations offline, reducing the online latency and computational expense of the model.

[0190] The quantization component 924C and / or the quantization circuit 928 may be used to quantize the machine learning model (which may include any number of modified parameter sets) , as discussed above. For example, the quantization component 924C and / or the quantization circuit 928 may quantize the (modified) model parameters to a relatively small bit-width, such as four bits, because the transformations and scaling can significantly reduce the quantization noise in some cases.

[0191] The inferencing component 924D and / or the inferencing circuit 929 may be used to perform inferencing (e.g., generating model outputs during runtime) , as discussed above. For example, the inferencing component 924D and / or the inferencing circuit 929 may use the quantized modified model parameters during runtime to process data and generate corresponding output predictions.

[0192] Though depicted as separate components and circuits for clarity in FIG. 9, the training circuit 926, the merging circuit 927, the quantization circuit 928, and the inferencing circuit 929 may collectively or individually be implemented in other processing devices of the processing system 900, such as within the CPU 902, the GPU 904, the DSP 906, the NPU 908, and the like.

[0193] Generally, the processing system 900 and / or components thereof may be configured to perform the methods described herein.

[0194] Notably, in other aspects, elements of the processing system 900 may be omitted, such as where the processing system 900 is a server computer or the like. For example, the multimedia component 910, the wireless connectivity component 912, the sensor processing units 916, the ISPs 918, and / or the navigation processor 920 may be omitted in other aspects. Further, elements of the processing system 900 may be distributed between multiple devices. Example Clauses

[0195] Implementation examples are described in the following numbered clauses:

[0196] Clause 1: A method, comprising: accessing a first set of adapter parameters for a first transformer block of a machine learning model, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters; generating a first rotation matrix for the first set of adapter parameters; generating a first set of modified adapter parameters, comprising: generating a first rotated set of encoder parameters based on rotating the first set of encoder parameters according to the first rotation matrix; and generating a first rotated set of decoder parameters based on rotating the first set of decoder parameters according to an inverse of the first rotation matrix; generating a quantized machine learning model based on quantizing the first set of modified adapter parameters; and providing the quantized machine learning model for inferencing.

[0197] Clause 2: A method according to Clause 1, wherein generating the first rotation matrix comprises training the first rotation matrix using a set of calibration data, wherein the first set of adapter parameters and parameters of the machine learning model are frozen during training of the first rotation matrix.

[0198] Clause 3: A method according to any of Clauses 1-2, further comprising generating a respective rotation matrix for each respective transformer block, with a corresponding adapter, of the machine learning model.

[0199] Clause 4: A method according to any of Clauses 1-3, further comprising: accessing a second set of adapter parameters corresponding to a feed-forward component of the first transformer block, wherein the first set of adapter parameters corresponds to an attention component of the first transformer block; generating a second rotation matrix for the second set of adapter parameters; and generating a second set of modified adapter parameters using the second rotation matrix, wherein generating the quantized machine learning model comprises generating the quantized machine learning model based on quantizing the first set of modified adapter parameters and the second set of modified adapter parameters.

[0200] Clause 5: A method according to any of Clauses 1-4, wherein a shape of the first rotation matrix is defined as (D_rank, D_rank) , wherein Drank is a rank of an adapter with which the first set of adapter parameters is associated.

[0201] Clause 6: A method according to any of Clauses 1-5, further comprising generating a second rotation matrix for the first transformer block; and generating the first set of modified adapter parameters based further on the second rotation matrix, wherein: generating the first rotated set of encoder parameters comprises rotating the first set of encoder parameters according to an inverse of the second rotation matrix and then according to the first rotation matrix; and generating the first rotated set of decoder parameters further comprises rotating the first rotated set of decoder parameters according to the second rotation matrix.

[0202] Clause 7: A method according to any of Clauses 1-6, wherein the first rotation matrix comprises a Hadamard matrix.

[0203] Clause 8: A method according to any of Clauses 1-7, wherein quantizing the first set of modified adapter parameters comprises quantizing each respective modified adapter parameter of the first set of modified adapter parameters to a bit-width of four bits.

[0204] Clause 9: A method, comprising: accessing a first set of adapter parameters for a first transformer block of a machine learning model, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters; generating a first transformation matrix for the first set of adapter parameters; generating a first set of modified adapter parameters, comprising: generating a first transformed set of encoder parameters based on transforming the first set of encoder parameters according to the first transformation matrix; and generating a first transformation set of decoder parameters based on transforming the first set of decoder parameters according to an inverse of the first transformation matrix; generating a quantized machine learning model based on quantizing the first set of modified adapter parameters; and providing the quantized machine learning model for inferencing.

[0205] Clause 10: A method according to Clause 9, wherein generating the first transformation matrix comprises training the first transformation matrix using a set of calibration data, wherein the first set of adapter parameters and parameters of the machine learning model are frozen during training of the first transformation matrix.

[0206] Clause 11: A method according to any of Clauses 9-10, further comprising generating a respective transformation matrix for each respective transformer block, with a corresponding adapter, of the machine learning model.

[0207] Clause 12: A method according to any of Clauses 9-11, further comprising: accessing a second set of adapter parameters corresponding to a feed-forward component of the first transformer block, wherein the first set of adapter parameters corresponds to an attention component of the first transformer block; generating a second transformation matrix for the second set of adapter parameters; and generating a second set of modified adapter parameters using the second transformation matrix, wherein generating the quantized machine learning model comprises generating the quantized machine learning model based on quantizing the first set of modified adapter parameters and the second set of modified adapter parameters.

[0208] Clause 13: A method according to any of Clauses 9-12, further comprising: generating a second transformation matrix for the first transformer block; and generating the first set of modified adapter parameters based further on the second transformation matrix, wherein: generating the first transformed set of encoder parameters comprises transforming the first set of encoder parameters according to an inverse of the second transformation matrix and then according to the first transformation matrix; and generating the first transformed set of decoder parameters further comprises transforming the first transformed set of decoder parameters according to the second transformation matrix.

[0209] Clause 14: A method according to any of Clauses 9-13, further comprising: generating a first scaling vector for the first set of adapter parameters; generating the first set of modified adapter parameters based further on scaling the first set of adapter parameters based on the first scaling vector.

[0210] Clause 15: A method according to Clause 14, further comprising: generating a second scaling vector for the first transformer block; and generating the first set of modified adapter parameters based further on the second scaling vector.

[0211] Clause 16: A method according to any of Clauses 9-15, wherein quantizing the first set of modified adapter parameters comprises quantizing each respective modified adapter parameter of the first set of modified adapter parameters to a bit-width of four bits.

[0212] Clause 17: A processing system comprising: one or more memories comprising processor-executable instructions; and one or more processors coupled to the one or more memories and configured to execute the processor-executable instructions and cause the processing system to perform a method in accordance with any of Clauses 1-16.

[0213] Clause 18: A mobile device comprising the processing system of Clause 17.

[0214] Clause 19: A processing system comprising means for performing a method in accordance with any of Clauses 1-16.

[0215] Clause 20: A non-transitory computer-readable medium comprising computer-executable instructions that, when executed by one or more processors of a processing system, cause the processing system to perform a method in accordance with any of Clauses 1-16.

[0216] Clause 21: A computer program product embodied on a computer-readable storage medium comprising code for performing a method in accordance with any of Clauses 1-16. Additional Considerations

[0217] The preceding description is provided to enable any person skilled in the art to practice the various aspects described herein. The examples discussed herein are not limiting of the scope, applicability, or aspects set forth in the claims. 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. For example, changes may be made in the function and arrangement of elements discussed without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For instance, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Also, features described with respect to some examples may be combined in some other examples. For example, an apparatus may be implemented or a method may be practiced using any number of the aspects set forth herein. In addition, the scope of the disclosure is intended to cover such an apparatus or method that is practiced using other structure, functionality, or structure and functionality in addition to, or other than, the various aspects of the disclosure set forth herein. It should be understood that any aspect of the disclosure disclosed herein may be embodied by one or more elements of a claim.

[0218] As used herein, the word “exemplary” means “serving as an example, instance, or illustration. ” Any aspect described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects.

[0219] As used herein, a phrase referring to “at least one of” a list of items refers to any combination of those items, including single members. As an example, “at least one of: a, b, or c” is intended to cover a, b, c, a-b, a-c, b-c, and a-b-c, as well as any combination with multiples of the same element (e.g., a-a, a-a-a, a-a-b, a-a-c, a-b-b, a-c-c, b-b, b-b-b, b-b-c, c-c, and c-c-c or any other ordering of a, b, and c) .

[0220] As used herein, the term “determining” encompasses a wide variety of actions. For example, “determining” may include calculating, computing, processing, deriving, investigating, looking up (e.g., looking up in a table, a database or another data structure) , ascertaining, and the like. Also, “determining” may include receiving (e.g., receiving information) , accessing (e.g., accessing data in a memory) , and the like. Also, “determining” may include resolving, selecting, choosing, establishing, and the like.

[0221] The methods disclosed herein comprise one or more steps or actions for achieving the methods. The method steps and / or actions may be interchanged with one another without departing from the scope of the claims. In other words, unless a specific order of steps or actions is specified, the order and / or use of specific steps and / or actions may be modified without departing from the scope of the claims. Further, the various operations of methods described above may be performed by any suitable means capable of performing the corresponding functions. The means may include various hardware and / or software component (s) and / or module (s) , including, but not limited to a circuit, an application specific integrated circuit (ASIC) , or processor. Generally, where there are operations illustrated in figures, those operations may have corresponding counterpart means-plus-function components with similar numbering.

[0222] The following claims are not intended to be limited to the aspects shown herein, but are to be accorded the full scope consistent with the language of the claims. Within a claim, 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. ” Unless specifically stated otherwise, the term “some” refers to one or more. No claim element is to be construed under the provisions of 35 U.S.C. § 112 (f) unless the element is expressly recited using the phrase “means for” or, in the case of a method claim, the element is recited using the phrase “step for. ” All structural and functional equivalents to the elements of the various aspects described throughout this disclosure that are known or later come to be known to those of ordinary skill in the art are expressly incorporated herein by reference and are intended to be encompassed by the claims. Moreover, nothing disclosed herein is intended to be dedicated to the public regardless of whether such disclosure is explicitly recited in the claims.

Claims

1.A processing system for machine learning, comprising:one or more memories comprising processor-executable instructions; andone or more processors coupled to the one or more memories and configured to execute the processor-executable instructions and cause the processing system to:access a first set of adapter parameters for a first transformer block of a machine learning model, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters;generate a first transformation matrix for the first set of adapter parameters;generate a first set of modified adapter parameters, wherein, to generate the first set of modified adapter parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to:generate a first transformed set of encoder parameters based on transforming the first set of encoder parameters according to the first transformation matrix; andgenerate a first transformed set of decoder parameters based on transforming the first set of decoder parameters according to an inverse of the first transformation matrix;generate a quantized machine learning model based on quantizing the first set of modified adapter parameters; andprovide the quantized machine learning model for inferencing.2.The processing system of claim 1, wherein, to generate the first transformation matrix, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to train the first transformation matrix using a set of calibration data, wherein the first set of adapter parameters and parameters of the machine learning model are frozen during training of the first transformation matrix.3.The processing system of claim 1, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to generate a respective transformation matrix for each respective transformer block, with a corresponding adapter, of the machine learning model.4.The processing system of claim 1, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to:access a second set of adapter parameters corresponding to a feed-forward component of the first transformer block, wherein the first set of adapter parameters corresponds to an attention component of the first transformer block;generate a second transformation matrix for the second set of adapter parameters; andgenerate a second set of modified adapter parameters using the second transformation matrix, wherein, to generate the quantized machine learning model, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to generate the quantized machine learning model based on quantizing the first set of modified adapter parameters and the second set of modified adapter parameters.5.The processing system of claim 1, wherein the one or more processors are configured to further execute the processor-executable instructions and cause the processing system to:generate a second transformation matrix for the first transformer block; andgenerate the first set of modified adapter parameters based further on the second transformation matrix, wherein:to generate the first transformed set of encoder parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to transform the first set of encoder parameters according to an inverse of the second transformation matrix and then according to the first transformation matrix; andto generate the first transformed set of decoder parameters, the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to transform the first transformed set of decoder parameters according to the second transformation matrix.6.The processing system of claim 1, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to:generate a first scaling vector for the first set of adapter parameters;generate the first set of modified adapter parameters based further on scaling the first set of adapter parameters based on the first scaling vector.7.The processing system of claim 6, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to:generate a second scaling vector for the first transformer block; andgenerate the first set of modified adapter parameters based further on the second scaling vector.8.The processing system of claim 1, wherein, to quantize the first set of modified adapter parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to quantize each respective modified adapter parameter of the first set of modified adapter parameters to a bit-width of four bits.9.A mobile device comprising the processing system of claim 1.10.A processor-implemented method of machine learning, comprising:accessing a first set of adapter parameters for a first transformer block of a machine learning model, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters;generating a first transformation matrix for the first set of adapter parameters;generating a first set of modified adapter parameters, comprising:generating a first transformed set of encoder parameters based on transforming the first set of encoder parameters according to the first transformation matrix; andgenerating a first transformed set of decoder parameters based on transforming the first set of decoder parameters according to an inverse of the first transformation matrix;generating a quantized machine learning model based on quantizing the first set of modified adapter parameters; andproviding the quantized machine learning model for inferencing.11.The processor-implemented method of claim 10, wherein generating the first transformation matrix comprises training the first transformation matrix using a set of calibration data, wherein the first set of adapter parameters and parameters of the machine learning model are frozen during training of the first transformation matrix.12.The processor-implemented method of claim 10, further comprising generating a respective transformation matrix for each respective transformer block, with a corresponding adapter, of the machine learning model.13.The processor-implemented method of claim 10, further comprising:accessing a second set of adapter parameters corresponding to a feed-forward component of the first transformer block, wherein the first set of adapter parameters corresponds to an attention component of the first transformer block;generating a second transformation matrix for the second set of adapter parameters; andgenerating a second set of modified adapter parameters using the second transformation matrix, wherein generating the quantized machine learning model comprises generating the quantized machine learning model based on quantizing the first set of modified adapter parameters and the second set of modified adapter parameters.14.The processor-implemented method of claim 10, further comprising:generating a second transformation matrix for the first transformer block; andgenerating the first set of modified adapter parameters based further on the second transformation matrix, wherein:generating the first transformed set of encoder parameters comprises transforming the first set of encoder parameters according to an inverse of the second transformation matrix and then according to the first transformation matrix; andgenerating the first transformed set of decoder parameters further comprises transforming the first transformed set of decoder parameters according to the second transformation matrix.15.The processor-implemented method of claim 10, further comprising:generating a first scaling vector for the first set of adapter parameters; andgenerating the first set of modified adapter parameters based further on scaling the first set of adapter parameters based on the first scaling vector.16.The processor-implemented method of claim 15, further comprising:generating a second scaling vector for the first transformer block; andgenerating the first set of modified adapter parameters based further on the second scaling vector.17.The processor-implemented method of claim 10, wherein quantizing the first set of modified adapter parameters comprises quantizing each respective modified adapter parameter of the first set of modified adapter parameters to a bit-width of four bits.18.A processing system, comprising:means for accessing a first set of adapter parameters for a first transformer block of a machine learning model, wherein the first set of adapter parameters comprises a first set of encoder parameters and a first set of decoder parameters;means for generating a first transformation matrix for the first set of adapter parameters;means for generating a first set of modified adapter parameters, comprising:means for generating a first transformed set of encoder parameters based on transforming the first set of encoder parameters according to the first transformation matrix; andmeans for generating a first transformed set of decoder parameters based on transforming the first set of decoder parameters according to an inverse of the first transformation matrix;means for generating a quantized machine learning model based on quantizing the first set of modified adapter parameters; andmeans for providing the quantized machine learning model for inferencing.19.The processing system of claim 18, further comprising:means for accessing a second set of adapter parameters corresponding to a feed-forward component of the first transformer block, wherein the first set of adapter parameters corresponds to an attention component of the first transformer block;means for generating a second transformation matrix for the second set of adapter parameters; andmeans for generating a second set of modified adapter parameters using the second transformation matrix, wherein the means for generating the quantized machine learning model comprise means for generating the quantized machine learning model based on quantizing the first set of modified adapter parameters and the second set of modified adapter parameters.20.The processing system of claim 18, further comprising:means for generating a second transformation matrix for the first transformer block; andmeans for generating the first set of modified adapter parameters based further on the second transformation matrix, wherein:the means for generating the first transformed set of encoder parameters comprise means for transforming the first set of encoder parameters according to an inverse of the second transformation matrix and then according to the first transformation matrix; andthe means for generating the first transformed set of decoder parameters further comprise means for transforming the first transformed set of decoder parameters according to the second transformation matrix.