Sparse High Rank Adapters
Paper · 2024 · Kartikeya Bhardwaj, Nilesh Prasad Pandey, Sweta Priyadarshi et al.
Summary
An adapter lets a pretrained network take on a new task or style without requiring a separate copy of all its weights. But the size of the adapter file can give a misleading impression of how much work it takes to switch adapters. With Low Rank Adaptation, or LoRA, a compact pair of matrices expands into an update that can change nearly every entry of a targeted weight matrix. Folding that update into the network keeps generation free of extra adapter computations. Changing the adapter then means replacing a dense update. Keeping the adapter separate makes switching easier, at the cost of extra work each time the network runs.
Sparse High Rank Adapters, or SHiRA, change the form of the update. Before fine-tuning, the authors choose a small set of existing weights and allow only those entries to learn. They usually tune 1-2% of the pretrained weights. Each adapter can be stored as values with their positions in the original matrices. Loading it becomes a matter of writing to those positions, and the network can use its ordinary forward computation. The update can also have high matrix rank, which means it can express changes along many independent directions in spite of containing few non-zero entries.
In commonsense reasoning tests with LLaMA-7B, the strongest standalone SHiRA variant averaged 77.4% accuracy, compared with 74.7% for LoRA. In a separate experiment, the authors trained adapters independently for BoolQ, PIQA, and Arc-Easy, then combined them. The combined LoRA adapters averaged 67.33% accuracy, while the two SHiRA mask arrangements averaged 74.02% and 73.92%. In Stable Diffusion style tests, generated examples showed that SHiRA could preserve both a painting style and a blue-fire effect in images where a simple LoRA merge often weakened one of them. The strongest choices of which weights to train differed between the language and vision experiments.
The paper also measures the costs of using the method. In a desktop CPU test, switching adapters for LLaMA2-7B took 4.93 s with SHiRA and 28.15 s with LoRA, using the central values reported for end-to-end switching. For LLaMA2-7B training, the implementation built on the Parameter-Efficient Fine-Tuning library used 29.26 GB of peak GPU memory, compared with 35.10 GB for LoRA, at similar training throughput. The CPU timing establishes a switching benefit in the tested environment. The paper treats further optimization for mobile hardware and the choice of better sparse masks as open work.
Deep dive: Sparse High Rank Adapters
Sparse High Rank Adapters tune a small share of pretrained weights to speed up adapter switching and preserve more of each task when adapters are combined. · about 35 minutes to read
The problem and its context
A small adapter can change a large matrix
A pretrained network already has weights that determine how it transforms an input. Adapting the network means finding changes that make it useful for a more specific purpose. A style adapter might make an image generator produce a painting effect. An adapter trained on a reasoning benchmark might improve its answers to the kinds of questions that benchmark contains. For either purpose, it is useful to keep a common pretrained starting point and learn a comparatively small set of task-specific parameters.
LoRA achieves this by representing the change to a weight matrix as the product of two smaller matrices. In training, the original matrix stays fixed and the smaller matrices learn. The shared inner dimension of those matrices limits the rank of their product. Rank counts the independent directions of the transformation, so a low-rank change restricts how many independent directions the adapter can modify. The restriction can still leave enough flexibility for a wide range of adaptations, which is why LoRA is an important baseline for both image generation and language tasks in the paper.
A product of small matrices can fill a large matrix with non-zero entries. Each element of the product is computed from entries of the factors, and the low-rank constraint ties those elements together without confining them to a small set of positions. This is the distinction that motivates SHiRA. Counting the parameters in the adapter file tells us how much information must be stored separately. Counting the entries changed after the product is added tells us how much of the original weight tensor must be updated for fused inference. Those counts answer different engineering questions.
The cost depends on when the update is applied
A system can fuse a LoRA adapter into the pretrained weights before deployment. Fusion means calculating the product and adding it to the original matrix. The resulting matrix has the same shape as the original, so the network uses the same operations during inference. A system that needs to change adapters often must also have a way to recover the original weights or replace the existing fused ones. If the affected tensors are large, the data moved to do that can matter even when each adapter is compact on disk.
Another option is to keep the LoRA factors separate and compute their contribution every time the network runs. The application can exchange the factors without rewriting the base tensors. In return, each affected layer has an additional computation in its forward pass. The paper cites a prior report of up to 30% higher inference latency in this unfused mode. That figure motivates the deployment problem and concerns a different operation from the switching time the authors measure themselves.
A third approach loads the LoRA factors, merges them into the network for inference, then reverses the merge and unloads the old adapter when a new one is needed. The authors discuss this workflow as implemented in the Hugging Face Diffusers pipeline. Hardware with enough memory to keep the relevant weights readily available can carry out dense fusion differently from hardware that must move weights in and out layer by layer. The authors are interested in constrained accelerators because their limited local memory can make each additional pass over a large set of weights consequential.
There is also a quality issue when several adaptations are active. The paper calls it concept loss. In text-to-image generation, one adapter might encode a painting style and another a blue-fire effect. A merged image can be convincing as an image while expressing only one of the requested effects. Earlier work discussed in the paper tackles this problem by processing independently trained LoRA updates before or during their combination, or by modifying the adapter design. SHiRA asks whether the update representation itself can make a simple combination preserve more of each contribution.
Where sparse adaptation fits
The idea of tuning a subset of existing weights predates SHiRA. The paper points to training with fixed sparse masks and Diff Pruning among the earlier approaches to partial fine-tuning. A mask describes which coordinates are available for adaptation. Earlier methods used both fixed masks and masks learned during training. The authors describe much of that work as focusing on smaller language networks. They also identify GPU memory consumption as a practical reason that partial fine-tuning could be awkward at the scale where LoRA had become popular.
The paper discusses related methods that introduce sparsity into low-rank adaptation. Sparse-Adapters uses pruning criteria to remove adapter parameters. SoRA gates elements in the projection factors and prunes zero entries, allowing the effective rank to vary. RoSA combines low-rank and sparse updates. These designs illustrate why the location of sparsity matters. Zeros within the factors of a matrix product do not by themselves make the product sparse. A sparse update added alongside a dense low-rank product likewise leaves the complete fused update capable of changing a large set of coordinates.
The concurrent SpIEL method also applies partial fine-tuning at the scale of large language systems. The authors describe SpIEL as using a dynamic mask and requiring custom sparse GPU kernels. SHiRA holds the mask fixed and uses native PyTorch operations. The paper also develops the implications of sparsity for merging adapters and investigates image tasks alongside language tasks. In this setting, the mask is both a training constraint and a description of where a deployed adapter will write.
The authors take up a separate question raised by work on rank stabilization in LoRA. Earlier results discussed in the paper suggest that increasing rank can improve adaptation when the update is scaled appropriately. That raises the possibility of using high-rank changes without storing large projection factors. Sparsity and rank make different kinds of restrictions. Sparsity constrains the locations an update can occupy, while low rank constrains the relationships among entries. SHiRA explores what happens when the coordinate restriction provides the parameter savings.
The method, step by step
Select the entries that can learn
Start with a weight matrix in a pretrained network. It takes the incoming features of a layer and mixes them to produce outgoing features. Pick a small subset of its entries and give each of those entries permission to change. Every other entry keeps the value it had before adaptation. The authors do this for the matrices targeted by the adapter, then train on the data for the desired task. The permission pattern is static throughout training.
From pretrained weights to a switchable SHiRA adapter
The steps in order.
The mask has the same dimensions as the matrix it controls. Its entries say whether the corresponding weight is eligible to learn.
M ∈ {0, 1}ⁿˣᵐ
Here M is the binary mask, n is the number of rows, and m is the number of columns in the weight matrix. The dimensions n by m indicate that each position in the matrix has a corresponding mask entry. A 1 permits an update and a 0 freezes the entry. The paper describes the masks as containing ∼98-99% zeros in its typical sparse adaptation setup. That is a description of the mask. The frozen entries in the pretrained matrix still take part in the computation and keep their original values.
The direct implementation multiplies the gradient by the mask during back-propagation. A gradient describes how a change in a weight would affect the training loss locally. Back-propagation calculates those signals through the network, and the mask controls which signals are available to update the weights.
Gmasked = M ⊙ G
Here G is the gradient matrix for the targeted weights, Gmasked is its masked form, M is the fixed binary mask, and ⊙ is the Hadamard product, which multiplies corresponding entries. At an enabled coordinate, the original gradient passes through. At a frozen coordinate, the result is zero. The authors also describe an implementation that represents only the selected entries as trainable parameters. In both implementations, the intended set of adaptable coordinates is the same.
Choose a mask for the task
SHiRA-Struct uses a predictable pattern. It enables regularly spaced complete rows or columns and adds the diagonal. The spacing is set by a frequency parameter, called f in the paper, which controls how frequently a row or column is enabled. Its choice depends on the desired sparsity. Before the diagonal is included, the rows or columns of the binary mask repeat a common pattern, so the mask has rank 1. The diagonal introduces independent positions. The authors use this construction to study how structured adapters can retain high rank and keep interactions between their updates limited when the trained row blocks are offset.
The rank of the binary mask and the rank of the trained update are distinct. The mask describes where the update is allowed to be non-zero. The values at those positions determine the update’s actual rank. For intuition about the sparse part of SHiRA-Struct, a square diagonal matrix can support an independent change in each coordinate if its diagonal entries are non-zero. Its sparsity follows from the absence of off-diagonal entries. This is the simplest way to see how a small number of non-zero coefficients can support high rank without giving unrestricted freedom to fill a matrix.
SHiRA-Rand draws individual positions at random. The appendix describes Bernoulli sampling, in which each draw has a fixed probability of producing an enabled coordinate. It gives a baseline for choosing coordinates without consulting the weights or the training objective.
f(k; p) = { p if k = 1, 1 − p if k = 0 }
Here f is the probability mass function, k is the sampled binary mask entry, and p is the probability of enabling the entry. The alternative, with probability 1 − p, leaves it frozen. The punctuation between k and p separates the outcome from the distribution parameter. This f names the probability function and is distinct from the row or column frequency used to describe the structured mask. A random mask distributes selections across a tensor without a prescribed row pattern. It also spends some of its training budget on weights that may be relatively unimportant for the task.
SHiRA-WM ranks entries by the absolute magnitudes of their pretrained values. Within each targeted layer, it selects the top K entries by that ranking, where K is the number the mask can enable. The authors use a small enough K to keep the number of learned weights comparable to that of low-rank adapters. The appeal of this rule is that the ranking is available from the checkpoint itself. It can also be used to make disjoint selections by taking successive bands of the same ranking for different adapters.
SHiRA-Grad ranks entries by the magnitude of their gradients on a small calibration set. A calibration set gives the authors a sample of the task’s learning signal before they commit to the permanent mask. A weight whose gradient has a large magnitude receives a strong local signal from the loss, regardless of the sign of that signal. The highest-ranked coordinates become trainable. The use of calibration data is the distinction from SHiRA-WM, which can select the same coordinates for several tasks starting from the same weights.
SHiRA-SNIP combines the two signals. It borrows its score from pruning, where the score is used to assess the sensitivity of a connection. Here the score chooses existing connections to train. The paper writes the criterion as an absolute inner product.
SNIPᵢ = |⟨Θᵢ, ∇θᵢ L⟩|
Here SNIPᵢ is the score of the weight indexed by i. Θᵢ is its current value, θᵢ is the corresponding parameter with respect to which the derivative is taken, L is the task loss, and ∇θᵢ L is its gradient at that parameter. The angle brackets denote an inner product, and the vertical bars take the magnitude. For an individual scalar weight, this is the magnitude of the weight times its corresponding gradient. A large value in either factor matters through the product, so this rule can prioritize a different set of positions from either weight magnitude or gradient magnitude alone.
Train the values and recover the update
SHiRA uses the pretrained values as its point of departure. A selected coordinate starts from its existing value and can move as learning proceeds. One way to represent the resulting adapter is as the difference between the trained and original matrices.
S = Wnew − W
Here S is the sparse update, Wnew is the matrix after training, and W is the original pretrained matrix. The subtraction operates entry by entry. Frozen positions cancel because the two matrices agree there. That means the number of entries that can be non-zero in S is bounded by the size of the trainable set, even though Wnew itself can be dense.
The paper uses an ordinary linear layer to illustrate how this change enters inference.
Yout = (W + S) Xin + b
Here Yout is the output of the layer, Xin is the layer input, W is its pretrained weight matrix, S is the sparse change, and b is the layer’s bias. The sum in parentheses is the effective matrix. The matrix is applied to Xin and then the bias is added. When the trained values are already installed, the network can carry out the layer operation directly with that effective matrix. There is no separate adapter branch in the forward pass.
The paper contrasts this with the LoRA layer expression in its discussion of training scale.
Yout = (W + αᵣ BA) Xin + b
Here Yout, W, Xin, and b have the same meanings as in the SHiRA layer. A and B are the learned projection factors in the order used for this expression. Their shared inner dimension is r, the rank setting, and αᵣ is the coefficient applied to their product. In the deployment discussion, the paper writes the product in the other order, using A and B as names for the opposite factors. The operative distinction is between learning changes through a product of factors and learning individual entries of the change directly.
The authors discuss how initializing and scaling two factors affects learning. If both start at zero, neither factor supplies a learning signal to the other through their product. Other initializations make one factor non-zero so that training can begin with a zero product and still have a gradient to follow. The paper also cites rank-dependent scaling and separate learning rates for the factors as ways prior work manages their training. SHiRA has no pair of projections to coordinate. The authors argue that its training scale can be set to 1 independently of the rank of the learned update. In the difference representation, the change itself starts at zero because the selected entries begin at their pretrained values.
This training argument still leaves room to control adapter intensity during inference. In the image experiments the authors apply a coefficient to the learned difference.
Wnew = W + αS
Here Wnew is the effective matrix for inference, W is the original matrix, S is the learned change, and α is the adapter strength. With α at 0.0 the effective matrix is the pretrained matrix. A value below 1 between those settings reduces the contribution of the learned change, while a value above 1 amplifies it. The paper illustrates this through the amount of blue fire in generated images. The scaling is applied to the difference from the base value. Scaling the entire trained replacement value would also rescale the original contribution of the weight at that coordinate.
Load an adapter and combine updates
For a standard-strength single adapter, the authors can keep the trained replacement values with their indices. The index names the position at which each replacement belongs. Loading starts from the base values and writes only the positions held by the adapter. The paper uses PyTorch’s in-place scatter operation for this write. Scatter takes values and a set of destination indices and places each value at its destination. Dense matrix multiplication is unnecessary for the overwrite.
When replacing an adapter, the effective weights for the incoming adapter must be computed relative to the common pretrained weights. Entries changed by the outgoing adapter that the incoming one leaves alone must take their base values again. With two adapters active, the sparse difference representation describes the additive experiment directly. At positions used by both adapters, their differences both contribute. At positions used by just one, that adapter supplies the entire change. A write of the second adapter’s absolute replacement value on top of the first would have different semantics at a shared position.
The coordinate view explains a benefit of sparsity in combination. A small set of enabled entries can give independently trained adapters fewer places to write over the same weights. The paper goes further by examining products of the update matrices. Updates can use different positions within a weight tensor and still act through some of the same rows or directions. Their interaction in a product depends on how those entries are arranged. This is why the authors distinguish between overlap of the trained coordinates and the orthogonality of the resulting matrices.
Implement the mask without carrying a dense optimizer state
The first training implementation uses a PyTorch post-accumulation gradient hook. This hook can act after a parameter’s gradient has been accumulated, so it is a convenient location to apply the binary mask. The authors apply this approach with existing trainer interfaces. It leaves the forward computation in terms of the original weight matrices and makes the gradient restriction a change to the backward computation. Its convenience comes from fitting into existing floating-point training loops.
The implementation for the Parameter-Efficient Fine-Tuning library, or PEFT, makes the selected values the trainable state. It uses scatter to place them into their positions for computation. The optimizer then tracks the sparse trainable set. That is the source of the memory saving the authors target. The network still needs the pretrained weights for its ordinary operations, and the sparse representation changes the memory required for adaptation. The authors identify the official code repository as Qualcomm AI Research’s SHiRA repository.
The paper reports AdamW as the optimizer for the main fine-tuning settings. Its vision settings list a cosine learning-rate schedule for LoRA and SHiRA, with a LoRA rank of 64. Its language settings use linear schedules and list rank 32 for the standard language LoRA and DoRA configurations. SHiRA has no projection rank setting in those configurations. The hyper-parameter table names the query, key, value, up-projection, and down-projection modules as adapter targets. The authors report running the vision and language fine-tuning and evaluation experiments on a single NVIDIA A100.
Relate sparsity, rank, and interaction
The paper’s first complexity argument counts the entries of an update directly.
‖ΔW‖₀
Here ΔW is the change to the weight matrix and ‖·‖₀ counts non-zero entries. The dot denotes the argument of the counting operation, and the subscript 0 specifies the counting convention. The paper uses this quantity to describe the parameter complexity of a sparse adapter. For training, the mask specifies the number of adjustable entries in advance. The realized difference can have fewer non-zero entries if a permitted weight ends up at its original value. The authors connect the small number of adjustable values to their expectation that a high-rank sparse update can learn without the data requirements one might associate with fitting a large dense matrix.
The authors also use a singular value decomposition to compare SHiRA with a low-rank update. Singular values order the strengths of the independent components of a matrix. The best rank-limited approximation in spectral norm keeps the components corresponding to the largest singular values. The paper’s argument can be written as follows.
‖ΔW − ΔWᵣ‖₂ = σᵣ₊₁
Here ΔW is the sparse update, ΔWᵣ is its best approximation retaining rank r, and ‖·‖₂ is the spectral norm, which measures a matrix by its largest singular value. The difference inside the norm is the approximation residual. The term σᵣ₊₁ is the next singular value of ΔW after the retained r components. It is zero if the original update already fits within that rank. This describes an approximation to a given learned matrix. It does not require that training LoRA on the same data will find that approximation or that the truncation will preserve task accuracy.
To study interactions, the authors compare the product of one adapter update transposed with another update. A zero product is the condition they use to analyze the disappearance of multiplicative cross terms. The product also gives them two diagnostics for approximate cases.
AWOM = ‖A₁ᵀ A₂‖₂
Here AWOM stands for Adapter Weight Orthogonality Magnitude. A₁ and A₂ are the two adapter weight changes of the same shape, and ᵀ means transpose, which exchanges rows with columns. Adjacent matrices are multiplied. The norm ‖·‖₂ measures the magnitude of the product using the paper’s L2 notation. A lower value indicates a product closer to zero by that measure.
AWOR = 1 − ‖A₁ᵀ A₂‖₀ / m²
Here AWOR stands for Adapter Weight Orthogonality Ratio. A₁ and A₂ are the same pair of updates, and A₁ᵀ A₂ is their transposed product. Each update has m columns, so m² is the number of entries in the square product. The nonzero-entry count ‖·‖₀ divided by that total gives the fraction of nonzeros. Subtracting the fraction from 1 gives the fraction of zeros. A product can have mostly zero entries and still have a consequential magnitude. The authors therefore use both diagnostics.
For the structured-mask argument, the paper simplifies the shared diagonal to the identity matrix and gives the row patterns disjoint supports across rows.
A₁ᵀ A₂ = (I + S₁)ᵀ (I + S₂) = I + S₂ + S₁ᵀ
Here I is the identity matrix in the square-layer example, and S₁ and S₂ are the sparse row-pattern components of the two adapter updates. A₁ and A₂ are the structured updates given by adding the respective row component to I. The superscript ᵀ transposes its matrix, and the plus signs add matrices of the same shape. The product of S₁ transposed with S₂ vanishes because the two components have no common non-zero rows. The remaining product is supported on the diagonal and the two surviving patterns. That is the source of the paper’s near-orthogonality argument for offset structured masks. The common diagonal remains in the product, and the count of surviving entries gives a statement about where interactions can occur.
Experiments and results
Style adaptation with Paintings and Bluefire
The main image experiments start from the RealisticVision-v3 checkpoint for Stable Diffusion-v1.5. Stable Diffusion belongs to the family described in High-Resolution Image Synthesis with Latent Diffusion. The authors collect public-domain images for two styles and train adapters separately. Paintings supplies a painting effect. Bluefire supplies a blue-fire effect applied to different subjects. The experiments examine each style by itself, then use both adapters for the same generation request.
Bluefire has 54 training images covering 6 subject concepts. They include vehicles, creatures, people, and buildings. The validation set has 30 images. Of these, 9 use concepts found in training and 21 use new concepts. A chess rook is among the examples the authors give for the latter group. Paintings has 90 training images spanning 9 concepts. Its validation set includes 21 images, of which 9 contain concepts from training and 12 contain new ones. The tests therefore include cases where recognizing or reproducing an effect on a familiar subject would be an insufficient demonstration of transfer.
To quantify single-style image quality, the authors use Human Preference Score-V2, or HPSv2. It is a numerical measure intended to track preferences over text-to-image outputs. For Bluefire, the authors generate 30 images at different seeds per validation prompt, giving 900 images for the HPS analysis. They generate 630 images over 21 prompts for Paintings. A seed sets the randomness used for generation. Sampling multiple seeds makes the score reflect a collection of outputs for the prompts, beyond what can be seen in the illustrated examples.
The chart uses the central values for Paintings at adapter strength α = 1. This is the full-strength setting for the learned update. All of the tested SHiRA masks score above LoRA in that condition, and the structured variant leads the reported comparison.
Paintings validation HPSv2 at adapter strength α = 1
The structured mask leads the comparison and every SHiRA mask scores above LoRA.
The numbers
| System or setting | HPSv2 |
|---|---|
| LoRA | 24.7 |
| SHiRA-Rand | 30.7 |
| SHiRA-WM | 29.7 |
| SHiRA-Grad | 30.3 |
| SHiRA-SNIP | 29.8 |
| SHiRA-Struct (this paper) | 31.2 |
The paper reports Paintings scores of 31.2 ± 1.7 for SHiRA-Struct and 24.7 ± 1.8 for LoRA at that strength. At α = 0.5, the corresponding scores are 33.0 ± 1.8 and 31.3 ± 1.5. Those runs use the same learned adapter with an adjusted inference coefficient. The difference between the full-strength and reduced-strength conditions shows why the coefficient belongs alongside the score. A change in strength can affect the image quality measure even when training and the validation prompts stay fixed.
Bluefire has a different pattern. At α = 1, SHiRA-Struct scores 34.2 ± 1.6 and SHiRA-Grad scores 34.2 ± 1.5, while LoRA scores 32.6 ± 1.9. In that setting SHiRA-WM scores 31.9 ± 2.1. At α = 0.75, the SHiRA-Struct and LoRA scores are 34.7 ± 1.5 and 34.1 ± 1.5. These figures qualify a broad reading of the Paintings chart. The strength of a given mask changes with the style, and sparse adaptation can give scores on either side of the LoRA value in specific Bluefire settings.
The trainable share reported for these style runs is 3.84% for LoRA, 1.99% for SHiRA-Struct, and 2.05% for the other sparse masks. For LoRA, this percentage describes the parameters trained to form the update. For SHiRA, it describes the pretrained entries selected for training. That difference in interpretation matters when moving from the image quality test to the switching argument. The number of factors LoRA learns is distinct from the number of weight entries it can change after fusion.
What the combined images show
For the combined style task, the authors inspect images generated with both adapters active. They look for evidence of the painting style and blue fire in the same output. In one comparison, LoRA generates a bird and a knight with a recognizable blue-fire effect but loses much of the painting treatment. In another, its fox has relatively little of the blue-fire effect. Since different examples lose different effects, the illustrations show why an attractive combined image is insufficient as a measure of whether both adapters contributed.
The structured and SNIP masks produce examples where the pair of effects remains visible. The paper highlights the fox and flower when discussing the structured mask, including the detail retained in the generated images. It also shows examples of a koala, a subject absent from both style training sets. In those illustrations, the LoRA output exhibits artifacts and the SHiRA output renders the subject more coherently. These comparisons address the visual behavior of a merge. The HPSv2 results above concern single-style conditions, and the selected combined images provide a different kind of evidence about preservation of the two effects.
A single adapter for commonsense reasoning
The authors test language adaptation using LLaMA and Llama 2, in the configurations named LLaMA-7B and LLaMA2-7B. The common starting point for the single-adapter comparison is a 170K-sample commonsense reasoning training mixture. The recipe follows the setup used by LLM-Adapters and DoRA. Each SHiRA adapter trains on the mixture for 3 epochs. The evaluation keeps the benchmarks separate and reports an average of their accuracy scores.
The benchmarks cover several formats. The paper reports BoolQ, PIQA, SIQA, and OpenBookQA alongside HellaSwag, WinoGrande, Arc-Easy, and Arc-Challenge. A method can improve the average while losing ground on a particular test. The average is the main comparison across benchmarks, and the individual scores reveal where that comparison comes from. The setup also differs from the multi-adapter experiment, which uses a smaller group of benchmarks and trains adapters independently on their respective training sets.
On LLaMA-7B, the paper reports average accuracy of 76.6% for SHiRA-Grad and 77.0% for SHiRA-WM, against 74.7% for LoRA. SHiRA-SNIP reaches 77.4%, the highest average among the standalone SHiRA variants in that comparison. The paper reports the gain over LoRA as +2.7%. Arc-Challenge illustrates one of the larger differences in the table, with 67.9% for SHiRA-SNIP and 61.3% for LoRA. On BoolQ the ordering reverses, with 68.3% for SHiRA-SNIP and 68.9% for LoRA. The aggregate advantage therefore includes tasks where the best average mask is weaker than the baseline.
The authors report both the trainable parameter share and the share changed when an adapter is in use in fused form. In the LLaMA-7B table, LoRA is listed with 0.83% trainable parameters and 66.72% changed after fusion. The standalone SHiRA variants are listed with 1.0% in both columns. This is the deployment tradeoff in the same experiment as the accuracy comparison. A slightly larger trainable share can coexist with a much smaller set of changed base entries.
DoRA gives a stronger accuracy baseline. DoRA alone averages 78.1% on LLaMA-7B. The authors also train a high-rank DoRA configuration with a SHiRA weight-magnitude mask, reporting 77.8% average accuracy with 1.0% of the pretrained parameters changed in fused mode. The hybrid is listed with 6.25% in the table’s parameter column. The footnote identifies that figure with the high-rank DoRA configuration being masked and says the top 1% weight mask limits the base entries changed during training and inference. These numbers reflect different counts of the adaptation setup. The standard DoRA baseline changes 66.72% of the base parameters when fused.
For LLaMA2-7B, SHiRA-SNIP reaches 79.28% average accuracy. The corresponding results are 77.61% for LoRA and 79.68% for DoRA. Examples of the spread across tasks include HellaSwag, where SHiRA-SNIP reaches 89.78% and DoRA 89.1%, and PIQA, where SHiRA-SNIP reaches 81.71% and DoRA 83.7%. In this configuration, the sparse update continues to outperform LoRA on the average while approaching DoRA with a smaller fused footprint.
Independently trained adapters for BoolQ, PIQA, and Arc-Easy
For the language combination test, the authors train a separate adapter on each of BoolQ, PIQA, and Arc-Easy. They evaluate the individual adapters on the respective tasks and use those results as the reference for the combined condition. A system that performs well when trained jointly on a mixed dataset has had a chance to reconcile the examples in training. Here the authors ask whether separately learned changes can share the same pretrained weights and preserve their performance after merging.
The two SHiRA variants in this experiment both use weight magnitude to choose the trainable entries. In the overlap setting, every task gets the same top 1% by magnitude. In the non-overlap setting, the first task gets the top 1%, the second takes the next band of 1%, and the subsequent task uses the next band. Both settings are compared with independently trained LoRA adapters combined for the same tasks. The chart reports the resulting average evaluation accuracy when all of the task adapters are active.
Combined-adapter accuracy on BoolQ, PIQA, and Arc-Easy
Both sparse mask arrangements retain higher average accuracy after fusion than the LoRA baseline.
The numbers
| System or setting | Accuracy % |
|---|---|
| LoRA | 67.33 |
| SHiRA-WM non-overlap | 73.92 |
| SHiRA-WM overlap (this paper) | 74.02 |
The single-adapter reference averages are 78.41% for LoRA, 78.45% for SHiRA-WM overlap, and 77.54% for SHiRA-WM non-overlap. The paper reports drops in average accuracy of 11.08 for LoRA, 4.43 for overlap, and 3.62 for non-overlap on its reported accuracy scale. The setting with the highest fused average is the overlap version. The setting with the smallest drop relative to its individual adapters is the non-overlap version. Those two comparisons answer different questions about the same merge.
The combined Arc-Easy accuracies are 57.45% for LoRA, 67.76% for overlap, and 69.15% for non-overlap. On PIQA, the non-overlap version also leads, with 78.4% against 76.88% for overlap and 71.27% for LoRA. BoolQ has a different ordering. Overlap reaches 77.43%, LoRA reaches 77.22%, and non-overlap reaches 74.22%. Thus the reported table supports a higher average for both sparse arrangements and a lead for overlap on every task against LoRA. The prose description in the paper claims that both sparse settings beat LoRA on all the benchmarks in this test, but the non-overlap BoolQ entry is below the corresponding LoRA entry.
Switching time and training cost
The authors first time the existing load, fuse, unfuse, and unload stages with LoRA adapters for SDXL. On the server GPU, the reported load time is 0.883 ± 0.085 s and fusion takes 0.306 ± 0.044 s. On the desktop CPU, loading takes 0.786 ± 0.056 s, fusion takes 3.003 ± 0.023 s, and unfusing takes 2.916 ± 0.014 s. The stages that dominate elapsed time change with the hardware. This is the immediate reason the paper treats the cost of applying a dense update as significant even when the adapter file is compact.
A separate CPU benchmark compares dense LoRA fusion with SHiRA scatter across different tensor dimensions. It averages timings for 50 randomly initialized weights. A dimension of 4096 refers to a square weight tensor of shape 4096 × 4096. For larger tensors, the appendix reports speedups of 13×-16× for the scatter-based operation against LoRA fusion. This comparison isolates the work of changing the weights. It does not include generation and should be read separately from the measurement of the whole adapter switch.
For end-to-end switching on a CPU, the paper reports 3.64 ± 0.10 s for SDXL with LoRA and 0.77 ± 0.09 s with SHiRA, with a reported speedup of 4.68×. For LLaMA2-7B, it reports 28.15 ± 1.62 s with LoRA and 4.93 ± 0.23 s with SHiRA, with a reported speedup of 5.71×. These are the full switching results given in the table. Once the desired values are in place, both fused methods use the standard layer computation. Faster switching concerns readiness for the next inference request under a different adapter.
For PEFT training of LLaMA2-7B, SHiRA uses 29.26 GB of peak GPU memory at 0.67 training steps per second. LoRA uses 35.10 GB at 0.69 steps per second. The paper reports the SHiRA memory result as −16.63% relative to LoRA. DoRA uses 49.49 GB at 0.49 steps per second in the same comparison. The authors also report throughput for the gradient-hook implementation on LLaMA-7B. It achieves 2.17 iterations per second, compared with 2.42 iterations per second for the PEFT version of LoRA. The latter comparison involves another implementation and checkpoint, so it addresses the cost of the convenient hook-based route on its own terms.
Personalization and transfer beyond the main tasks
The authors use SDXL to test whether SHiRA can support DreamBooth personalization. They collect a vase dataset for content, plus wooden sculpture and canvas datasets for style, with five images per dataset. The vase comes from the DreamBooth data and the styles use public-domain material. Each adapter is trained on an individual concept dataset with prompts containing a special identifier. At inference, the identifier lets the prompt specify the learned vase or style in a new scene. The paper illustrates this with a vase with flowers, a dog rendered as a wooden sculpture, and a sunset in a canvas style. LoRA and SHiRA are trained with comparable parameter counts here, and the evidence presented consists of generated examples.
The appendix also extends the comparison to image classification with ViT-Base. SHiRA-WM and LoRA each use around 300K trainable parameters. The reported scores favor SHiRA across CIFAR-10, CIFAR-100, Food101, and the Describable Textures Dataset. For instance, the CIFAR-10 scores are 98.05 for SHiRA and 97.94 for LoRA, and the Describable Textures scores are 69.73 and 69.41. The gaps in these experiments are small. They show that the coordinate-selection approach also works for these transfer tasks.
On GLUE, the authors run SHiRA-WM using the SoRA code for DeBERTa-V3-base and take the LoRA and SoRA baseline figures from the SoRA paper. The comparison covers CoLA, QNLI, MRPC, and SST2. SHiRA averages 88.29 with 636K adapter parameters. LoRA averages 87.19 with 1.33M, and SoRA averages 88.34 with 910K. This experiment places SHiRA close to the reported SoRA performance at a smaller adapter size, with the qualification that the baseline results were carried over from the earlier study.
What the ablations show
The mask changes what the same parameter budget can do
The closest comparison to a direct mask ablation is the vision experiment that tests all the mask rules on the same styles at the same inference strengths. The unstructured variants share the reported 2.05% trainable fraction, and SHiRA-Struct uses 1.99%. Since the counts are close, the results help show what changes when the selected positions change. They also show that the value of a selection rule depends on what the network is being asked to learn.
On Paintings at α = 1, the random mask scores 30.7 ± 1.9, compared with 29.7 ± 1.9 for weight magnitude and 29.8 ± 1.8 for SNIP. Picking positions by a salience criterion is therefore unnecessary for a favorable comparison with LoRA on this style in that condition. The random result also gives a check on a simple explanation of the method’s success. The gain in this experiment need not come from locating the weights that score highest by a particular heuristic. The availability of many eligible coordinates in a sparse update may already be useful, and the arrangement or identity of the coordinates supplies a further difference between masks.
The structured mask gives particularly strong results for the illustrated style merges. On Paintings with α = 0.75, its HPSv2 score is 32.1 ± 1.8, compared with 31.7 ± 1.8 for the random mask. On Bluefire at the same strength, the corresponding scores are 34.7 ± 1.5 and 34.1 ± 1.5. The structured mask does well in these single-style measurements alongside the examples where it preserves both effects. The HPSv2 comparison itself measures neither the orthogonality of the weights nor the retention of both concepts after a merge. Those questions have their own simulations and image comparisons.
On language reasoning, SHiRA-SNIP ranks ahead of weight magnitude and gradient magnitude in the LLaMA-7B average. The paper reports that SHiRA-Struct performed poorly on the language tasks and suggests that the row-or-column pattern plus a sparse diagonal restricts the useful changes too much. The paper does not give a corresponding numerical row for SHiRA-Struct in the main commonsense tables. The evidence therefore supports the relative ordering of the reported unstructured masks and a qualitative observation about the structured one. The difference between the language and vision outcomes illustrates why a high attainable rank leaves an important question open. A method also needs sufficiently useful choices of update directions at that rank.
Adapter strength changes the output independently of training
The image experiments vary the inference strength α after learning. This is a controlled way to examine the effect of the same adapter without changing its training budget or mask. The blue-fire illustration shows the base output at α = 0.0 and progressively stronger visible effects as the adapter contribution increases. It demonstrates that a sparse overwrite can still support a continuous choice of style intensity through scaling the learned difference before applying it.
The preference score need not rise with intensity. On Bluefire, the reported SHiRA-Struct score at α = 0.75 is 34.7 ± 1.5, while its score at α = 1 is 34.2 ± 1.6. On Paintings, LoRA’s HPSv2 score is higher at α = 0.5 than at α = 1. The scale experiment helps distinguish how much of a style appears from how favorable the output is according to the image metric. It explains why a comparison at only one strength shows performance at that operating point rather than the full behavior of the adapter.
Orthogonality diagnostics distinguish sparse updates from sparse factors
The authors simulate adapter weights at several dimensions and average the orthogonality diagnostics across 50 randomly initialized adapters. The comparison includes dense updates, sparse LoRA factors, SHiRA-WM, and SHiRA-Struct. It asks how the design alone can affect the product of adapter changes before one attributes the effect to what the tasks have learned. Sparse factors are an informative control because the factors can contain many zeros while the product used as a weight update can still fill many coordinates.
At larger dimensions such as 4096 × 4096, the paper reports a low proportion of zeros in the product for dense and sparse LoRA. SHiRA-WM gives a sparser product, and SHiRA-Struct gives a product closest to the structured near-orthogonality case. SHiRA products also tend to have smaller magnitudes than the dense comparisons. The two observations complement each other. A design that leaves many entries at zero makes interactions less widespread in this diagnostic. A smaller product magnitude addresses the contributions that remain.
For the square structured example, assigning different non-zero rows to the row components removes the product of those components. This is a more specific mechanism than saying that sparse masks should interact less. It identifies the term that vanishes and the diagonal and transposed patterns that remain. There is a tradeoff in using this arrangement for a practical adapter. The pattern makes parts of the interaction easier to control, while the same pattern fixes where the adapter can spend its trainable entries. The visual and language results suggest that the cost of that restriction varies by task.
Disjoint masks help retention and can weaken individual adapters
The language experiment with weight-magnitude masks tests whether sharing the strongest pretrained coordinates is worth the possible interference that comes with overlap. The overlapping adapters all get the same highest-ranked entries. Disjoint adapters must also train entries lower in the ranking. The individual averages favor overlap, consistent with the authors’ interpretation that later bands of weights can be less useful. The non-overlap setting still yields the smaller fusion drop. Allowing every task to use the strongest band and minimizing the drop after fusion are different objectives, and the reported fused averages are close despite the different paths to them.
The simulations for unstructured SHiRA-WM compare overlap and non-overlap at 99% sparsity, averaging across 50 seeds for each weight size. The reported AWOM and AWOR curves coincide. This is relevant because two unstructured masks can have very different direct coordinate overlap while producing transposed products of similar magnitude and sparsity. The authors propose that this behavior helps explain why the overlap setting retains accuracy. The diagnostics support the plausibility of that interpretation. They do not measure the separate causal contributions of access to the top-ranked weights and reduced interactions after merging.
The authors also examine the distance between the trained adapters and their common starting point in the overlap setting. They use L2 distance, a measure of how far weight values differ in aggregate. The tabulated Arc-Easy adapter distance from the base is 37.0. Its distance from the BoolQ adapter is 75.0, and its distance from the PIQA adapter is 81.5. The distance between the BoolQ and PIQA adapters is 98.5. The table shows that each adapter is closer to the original weights than to the other adapters in this comparison. On this basis, the authors argue that each task produces a different update even if all tasks adjust the same coordinates. The measurement concerns distance between weights. Similarity between the tasks as reasoning problems is a separate question.
Limitations
Limits the authors identify
The authors identify hardware and software co-design as a remaining step for efficient mobile use. They mention lookup-table approaches as one possibility for adapting the implementation to edge devices. The switch-time measurements establish the cost of the tested implementations on a CPU. The mobile argument also depends on what can be held in local accelerator memory and how often weights have to move. Those details would affect the relative costs in an actual deployed system.
The authors also identify optimal mask selection as open work. Their experiments give comparisons for several practical heuristics, with structured masks performing well for image styles and SNIP doing well across the tested domains. They do not derive a rule that finds the best entries for a new task. The language comparison further shows that reserving disjoint positions can change individual performance when some adapters receive weights that rank lower by magnitude.
The theory and simulations concern orthogonality of adapter weights. The authors explicitly leave analysis of the represented subspaces for future work. They also discuss the possibility that on-device adaptation could support more private use, alongside the risk that efficient personalization could be used for digital forgery. These are implications identified by the authors. The experiments measure quality and efficiency under their adaptation setups.
Limits of the evidence
The switching and inference results refer to different stages of application behavior. A CPU scatter benchmark gives evidence about writing updated values. The end-to-end CPU switching measurements give a broader estimate for the specified checkpoints, while neither measures an interactive application running on a phone. Similarly, the A100 training and PEFT memory results characterize particular implementations and configurations. The gain depends on how the optimizer stores its parameters and on the surrounding network’s memory costs. A fraction of trainable entries by itself is insufficient to predict total training memory.
The vision evidence is strongest for the particular style datasets and prompts. Their validation sets include unseen subjects and the additional images test recognizable forms of concept loss. HPSv2 is a preference metric, and the paper’s checklist identifies no new human-subject study. The illustrated combinations and DreamBooth examples do not give an aggregate frequency of concept loss or an aggregate personalization score. Consequently, the evidence shows that two styles can survive in the same output and that the compared adapters sometimes lose a style in different ways. It leaves open how frequently this happens under other prompts, styles, or adapter combinations.
The language comparisons support gains over LoRA in the reported averages. Some individual results favor LoRA, and DoRA scores higher on the average in the standard single-adapter comparisons. Trainable budgets also differ, and the high-rank DoRA hybrid changes a small share of the base weights while using the high-rank configuration recorded in its parameter column. An accuracy comparison here is an evaluation of complete adapter setups. It cannot isolate rank, sparsity, the location of the selected weights, and the training recipe as independent causes.
Two theoretical qualifications matter when interpreting the results. First, counting trainable entries describes parameter complexity. The paper’s argument offers an intuition about learning complexity and data needs, but it does not establish a general sample-complexity bound. Second, the structured proof shows that the remaining non-zero entries in the product are confined to the surviving patterns. With AWOR defined as a fraction of zeros, the useful bound from the support argument is an upper bound on the non-zero fraction, or equivalently a lower bound on the zero fraction. The paper’s wording about an upper bound on AWOR does not express that direction. The product calculation still explains why many entries can be zero.
Finally, the absence of particular multiplicative cross terms is a local statement about adapter weights. A small matrix product provides a reason to investigate better composition, while measured task performance and the visible presence of concepts depend on the rest of the network and the inputs. The simulations, the language fusion experiment, and the generated images address different levels of that question. Together they support reduced interference in the studied cases, with no general guarantee for arbitrary tasks, masks, or collections of adapters.
What came after
There are no documented follow-up studies to trace here. The paper closes with two directions for subsequent research. One is to improve how trainable coordinates are chosen, especially when adapters must perform well both independently and in combination. The other is to measure and optimize sparse switching on the constrained hardware that motivates the method. Those directions follow from the comparison at the center of the paper. The coordinates that give an adapter enough flexibility to learn a task also determine what it costs to install and how its changes interact with other adapters.
Cite
Cite as Kartikeya Bhardwaj, Nilesh Prasad Pandey, Sweta Priyadarshi, Viswanath Ganapathy, Shreya Kadambi, Rafael Esteves, Shubhankar Borse, Paul Whatmough, Risheek Garrepalli, Mart Van Baalen, Harris Teague and Markus Nagel. 2024. Sparse High Rank Adapters. arXiv:2406.13175.
@misc{bhardwaj2024sparse,
title = {{Sparse High Rank Adapters}},
author = {Kartikeya Bhardwaj, Nilesh Prasad Pandey, Sweta Priyadarshi, Viswanath Ganapathy, Shreya Kadambi, Rafael Esteves, Shubhankar Borse, Paul Whatmough, Risheek Garrepalli, Mart {Van Baalen}, Harris Teague and Markus Nagel},
year = {2024},
doi = {10.48550/arxiv.2406.13175},
eprint = {2406.13175},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2406.13175}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bhardwaj-2024-sparse-high-rank-adapters/