Manuscript Offprint
arXiv:2608.26052How Much Rank Does LoRA Need? Rank-Error Bounds for Transformer Attention
Abstract
Choosing the rank of a low-rank adaptation (LoRA) update is usually an empirical task. In this paper, we provide a task-dependent theory of the approximation error achievable at each LoRA rank for Transformer attention. We fix a pretrained attention head, a target attention function, and a distribution over inputs from the downstream task, and bound the smallest expected Kullback–Leibler (KL) error achievable by a rank-r query LoRA update. When target attention probabilities are bounded away from zero, we prove a lower bound of the error proportional to , where is the difference between candidate and target attention scores and . We also prove an unconditional upper bound . Under explicit realizability, geometry, and moment conditions, we then bound the best rank-r error between an explicit multiple of and , where is the downstream-weighted tail energy of the target update. We also provide target-Fisher bounds when candidate scores remain within a fixed range of the target scores, and an unrestricted lower bound when a subset of tokens carries most of the probability mass. These spectral bounds describe finite-score approximation. We then construct explicit families in which softmax saturation makes the rank required to match the attention function strictly smaller than the rank required to match the finite logits. Finally, we extend the analysis to fused multi-head LoRA and joint query/key updates, exposing the effects of rank sharing and query/key factorization constraints.
1 Introduction
LoRA [11] makes it cheaper to fine-tune a pretrained Transformer [22] by replacing a dense weight update with a low-rank one. Such a low rank is both an advantage and a restriction, reducing the number of trainable parameters and computation, but also limiting the representational power of the adapter. In practice, rank is commonly chosen using rules of thumb or by training several adapters of different rank and comparing their downstream performance [11, 27, 21]. Such a sweep reveals which rank worked in a particular run, but it doesn't tell us whether a smaller adapter lacked capacity or was simply harder to train.
To isolate the representation question, suppose a dense or high-rank target adapter has already been obtained. We then ask: for each rank budget r, how closely can an adapter reproduce the target on inputs from the downstream task? The answer cannot be read from the singular values of the target weight update alone. For instance, a large singular direction may have no effect if inputs from the task never activate it, while a smaller direction may matter on nearly every input because it repeatedly changes which tokens receive attention. The softmax function in the attention mechanism introduces two further effects. First, adding the same constant to every score leaves the attention probabilities unchanged. Second, softmax saturates, so a score error
*Correspondence: gerardpc@gmail.com with large magnitude need not produce a proportionally large attention error. The rank needed to reproduce the target function can therefore differ from the rank suggested by the raw singular values of its weight update.
In this paper, we begin with a LoRA update to the query projection of a single attention head. That update changes the scores assigned to the available keys, which softmax converts into attention probabilities. We compare these probabilities with those of a dense or high-rank target adapter, ask for the smallest expected KL error achievable at rank r, and obtain bounds on the error, some unconditional and some conditional on explicit assumptions. Attention KL therefore measures how much the query update changes the attention distribution itself, before later layers can modify that change.
We stress that our results bound the attention KL described above, but we do not provide bounds on the head output or final task loss. To do so would require additional assumptions about the architecture, including the value and output projections, residual connections, feed-forward network, and later layers. These components determine how a difference in one head is propagated and may amplify, suppress, or cancel it. Without such architecture-specific assumptions, attention KL alone does not determine output or task error. Figure 1 shows the scope of our analysis within a Transformer block in more detail, including extensions to fused multi-head and joint query/key LoRA.
Overview of the results. For each rank budget r, let denote the smallest expected attention KL over all rank-r candidates; Section 2 defines this objective formally. Our analysis first connects attention KL to score approximation, then connects score approximation to LoRA rank.
Theorem 3.1 gives the first connection. If d is the difference between candidate and target scores after removing their common shift, define
The theorem proves that the pointwise attention KL is comparable to when the target probabilities are bounded away from zero, and is at most without this assumption. Thus the error is quadratic for small score differences and linear for large ones. Corollary 3.2 lifts this pointwise statement to the expected, rank-constrained objective .
Theorem 4.1 supplies the second connection. Under its realizability, geometry, probability-floor, and moment assumptions, it proves
Here is the residual tail energy after the target update has been weighted by the queries and keys occurring on the downstream task. Directions that the task never uses therefore do not contribute, and is the explicit assumption-dependent constant in Theorem 4.1. The upper bound constructs a candidate whose error does not exceed its curve; the lower bound applies to every candidate. Together they bracket the best achievable error at each rank. Section 9 explains how to estimate this rank-error curve from downstream data and compare it with a desired error tolerance.
When the probability floor in the main theorem is too small to give a useful lower bound, Section 5 provides two alternatives with different assumptions (Figure 2 shows a decision diagram to clarify the choices, and Table 2 gives an overview of the three laws of approximation). Theorem 5.1 gives target-Fisher upper and lower bounds for candidates whose scores remain within a fixed range of the target scores. Because that candidate class is restricted, its lower bound does not apply to the unrestricted . Theorem 5.2 instead gives a lower bound on the unrestricted by focusing on a subset of tokens carrying most of the target probability mass.
Transformer attention with LoRA: computation and theoretical scope

Figure 1: Transformer attention with LoRA and the scope of our analysis. Read from top to bottom, the diagram traces an input through the query, key, and value projections, attention scores, row-wise softmax, and multi-head aggregation. Our central question is how closely a rank-r LoRA update can reproduce a target attention function on inputs from the downstream task. The main theorem treats query-only adaptation in one head; later results cover a fused update shared across heads and simultaneous query/key updates. For an input , contains token representations of width . For each head index , query/key width is and value width is , with , , and . Here applies softmax row-wise and is typically . The pretrained projections are fixed, while and are rank-r LoRA updates. The multi-head result bounds the sum of headwise attention KL errors before ; the remaining Transformer computation and the final model output are outside this guarantee.
The preceding results concern approximation at finite scores. Theorem 6.1 treats a different effect: after softmax saturates, a lower-rank sequence of logits can approach an attention function that requires higher rank to realize with finite logits. It constructs an explicit family with a constant-factor separation between these two ranks. Finally, Theorem 7.1 extends the rank–KL bounds to a fused update shared across attention heads, and Theorem 8.1 extends them to simultaneous query/key LoRA, where the score update must also satisfy a query/key factorization constraint.
-
We give two alternatives when the main lower-bound constant is weak: target-Fisher bounds for a score-restricted candidate class, and a high-mass lower bound for the original unrestricted class.
-
We prove an exact separation for an explicit Walsh family: matching its finite logits requires rank k, but after softmax saturation the same limiting attention can be recovered to arbitrary accuracy at rank within the score space reachable by query adaptation.
-
We extend the rank–KL analysis to a fused update shared across heads and to joint query/key LoRA, where a separate factorization gap measures whether the best effective score update can be realized by the two factors.
Positioning relative to prior work. Prior work studies adaptive rank allocation during training [27, 18], activation-aware approximation [24, 4, 23], finite-sample LoRA rank selection [12], and the transformations that LoRA can express [26]. Our contribution is different: for a fixed pretrained head and a known target attention function, we bound the best attention KL attainable at every rank, averaged over , the downstream task distribution (e.g. text-to-SQL examples). The underlying weighted approximation theorem is classical [7, 16]; the new step is to connect that task-weighted approximation problem to global upper and lower bounds on attention KL. Section 10 gives a more detailed comparison with these and the related attention-rank and softmax-saturation literature.
2 Problem formulation
We begin with one query position in one attention head, so that every matrix and function can be defined explicitly. Sections 7 and 8 extend the formulation.
Let denote the downstream input distribution and draw , with available token positions. Fix pretrained logits , a pretrained key matrix , a query activation , and the attention scale . A query LoRA update is a matrix with . It produces the score vector and attention distribution
Here is the query representation entering the adapted projection, and the rows of are the key vectors against which that query is scored. is one stored matrix; the attention distribution changes with the input .
Let be fixed target logits and the target attention function. The target may be arbitrary for the score-space results in Section 3. The spectral specialization in Theorem 4.1 requires it to be generated exactly by a dense query update . A generic fully fine-tuned Transformer can also change keys, values, earlier layers, and the activations entering this head, so it need not satisfy that assumption. For such a misspecified target, Equation (4) remains well defined, but the query-only spectral formula would need an extra irreducible approximation term. For rank budget , define
Thus is the best error attainable by the entire rank- candidate class. An upper bound exhibits a candidate with small error. A lower bound applies to every candidate and certifies unavoidable error. Inverting the bounds for a tolerance then yields sufficient and necessary rank conditions. Section 9 turns this interpretation into a calibration procedure.
Softmax is invariant to adding a constant to all scores. We therefore center score differences with
The associated approximation objective, robust to both small and large score errors, is
For the sharper upper bound, also define
| Object | Meaning | What changes? |
|---|---|---|
| One input from the downstream task | Varies across examples | |
| Attention scores produced by the pretrained head | Depends on | |
| Target attention probabilities to be reproduced | Depends on ; the target model is fixed | |
| Candidate query update with | One fixed matrix for all inputs | |
| Attention probabilities produced with update | Depends on and on the chosen | |
| Candidate-target score difference after removing a common shift | Depends on and on the chosen | |
| Smallest average target-to-candidate KL achievable at rank | One number for each rank budget |
Table 1: Objects in the target–candidate comparison. For each downstream input , the pretrained head and fixed target determine the behavior to be matched; ranges over candidate updates of rank at most .
Example 1 grounds this objective in a concrete downstream task.
Example 1: Interpreting attention KL in text-to-SQL
An input may contain the user's question, the database schema, instructions, and previously generated SQL tokens. The target and candidate heads each assign attention probabilities to those token positions. Our objective asks how much rank is needed for the candidate to reproduce the target's attention on such inputs. This gives a head-level approximation measure that can be studied alongside end-to-end measures such as SQL execution accuracy.
3 From score error to attention KL
The first result is independent of LoRA: it relates centered score error to probability error.
Theorem 3.1 (Global robust softmax bounds). Let satisfy , let , and put . Then
The upper bound does not require a positive lower bound on .
The quadratic part of comes from local curvature of log-sum-exp. The linear part is unavoidable globally: a rare input can contain a very large score error while contributing only linear or bounded KL. A purely quadratic global lower bound therefore cannot hold; Proposition B.1 gives an explicit fixed-probability-floor construction.
Corollary 3.2 (Global functional bounds). If almost surely, then
The proof of Theorem 3.1 is short and appears in Appendix A. The rare-context obstruction to a quadratic law is given in Appendix B.
4 Task-weighted spectral rank-KL bounds
Assume in this section that the target is exactly realizable by a dense query update . For , define
records which update directions alter centered attention scores in context ; records which query directions appear on the task.
In the separable case, the random key Gram matrix is independent of the query activation . Then
The matrix whose spectrum matters is therefore
is the residual squared score error after the best rank- update. Directions annihilated by the keys or never activated by disappear automatically, a phenomenon that is illustrated in Example 2.
Example 2: A large update direction that the task never uses
Suppose the target update has two singular directions. The first has the larger singular value, but every query activation from the downstream task is orthogonal to it, so it never changes an attention score. The second is smaller but active on nearly every input. A raw truncated SVD keeps the first direction; the weighted spectrum above removes it and keeps the direction that actually changes attention. Theorem 4.1 turns this distinction into upper and lower error bounds.
To turn this quadratic tail into a global robust lower bound, assume that, for every deterministic compatible matrix ,
These uniform moment conditions prevent the quadratic error from being carried entirely by extremely rare contexts.
Theorem 4.1 (Downstream spectral rank–KL bounds). Suppose the target attention function is generated by a dense query update , almost surely, and are independent, and the two conditions in Equation (13) hold. Then
The upper bound is achieved by truncated SVD of , which already weights the target update by the task queries and keys. The lower bound applies to every rank-r candidate. Both sides are quadratic in the score scale near zero and linear at large scale, but their constants can be far apart when the target probability floor a is small.
For a desired error tolerance , the upper bound gives the sufficient rank
Conversely, any rank attaining error at most must satisfy
Inverting the error bounds in this way yields sufficient and necessary rank conditions.
Remark 4.2 (Size of the bracket). The worst-case ratio between the upper and lower constants is at most
For example, it is about when , , and . This is a sensitivity calculation from the theorem, not an empirical estimate. For long, peaked attention vectors, the probability floor can make the global lower bound numerically weak; Section 5 gives alternatives.
The proof is in Appendix C. In ordinary self-attention, and are computed from the same input and need not be independent. The following result replaces independence by direct comparison between the true mean squared score error and the reference quadratic form used to define .
For , write
and let be the weighted-SVD candidate used in the upper bound.
Theorem 4.3 (Dependence-allowing spectral bounds). Suppose, for every feasible ,
and suppose . If the target probability floor is at least , then
This theorem allows arbitrary dependence between keys and queries; its price is that the comparison and moment constants must hold on the candidate class. For example, if almost surely and the activation moment condition in Equation (13) holds, it applies with , , and . The proof is in Appendix D.
5 Which rank-KL bound should be used?
Because the minimum target probability can be very small in long, peaked attention vectors, we provide two refinements that address different needs. The target-Fisher theorem gives upper and lower bounds when score differences stay inside a fixed range. The high-mass theorem gives a lower bound for the original unrestricted class, using a set of tokens, chosen from the target, that carries most probability mass. Figure 2 and Table 2 make the distinction explicit:

Figure 2: Which rank-KL theorem to use. Start at the left and stop at the first result whose assumptions you can justify. An upper bound shows that some rank-r update achieves at most the stated error; a lower bound shows that every rank-r update incurs at least the stated error. The Fisher bounds apply only to candidates whose scores remain within a fixed range of the target scores. Consequently, their lower bound does not apply to the unrestricted optimum .
| Route | Upper bound | Lower bound | Candidate class | Main price |
|---|---|---|---|---|
| Global | ✓ | ✓ | unrestricted rank-r | minimum target probability and moment assumptions on keys/queries |
| Target Fisher | ✓ | ✓ | rank-r with a justified range of score differences | span-dependent constants and the target Fisher inner product |
| High mass | ✕ | ✓ | unrestricted rank-r | tokens carrying most target mass, a conditional probability floor, and the key/query Gram on that set |
Table 2: The three rank-KL routes and their logical scope.
5.1 Target-Fisher bounds under a controlled score span
Let and let . Define
with both values set to 1/2 at .
Theorem 5.1 (Target-Fisher score bounds). For every score displacement ,
Consequently, on the candidate class whose score differences from the target have range at most , the optimal KL is bounded above and below by and times the corresponding target-Fisher quadratic optimum.
There is no explicit minimum-probability constant; small target probabilities enter through the Fisher matrix . More importantly, the optimized class is restricted by the span condition. Because that class is a subset of the unrestricted rank- class, its lower bound cannot be transferred to . The spectral statements, including the extra span condition needed for a matching upper bound, and the proofs are in Appendix E.
5.2 An unrestricted high-mass lower bound
For each context, let be a measurable token set chosen from the target before optimizing the candidate. Suppose it carries at least of the target mass and the conditional target distribution on has minimum probability at least .
Theorem 5.2 (High-mass lower bound). Under the preceding assumptions,
This is a lower bound on the original unrestricted . Under additional control of the key/query Gram and moments on , the right-hand side reduces to the same spectral tail, but only on those tokens. It does not give a full-KL upper bound: matching conditional scores inside need not match the total mass assigned to . The proof and spectral forms are in Appendix F.
6 Saturation changes the relevant notion of rank
The main theorem describes approximation of finite logits, but softmax also has a boundary regime in which logits can diverge while their distributions converge. Example 3 shows the basic saturation mechanism before the rank separation is stated formally.
Example 3: Different logits, the same saturated attention
For two tokens,
The difference between the two logit vectors grows with , but their attention distributions converge to the same limit. The results below prove a stronger effect: for explicit families of targets, saturation reduces the rank needed to approximate the entire attention function.
For a boundary target and an allowed centered score space , define its -relative softmax closure rank as the smallest for which there is a sequence of score matrices of rank at most , with every score column in , whose columnwise softmax distributions converge to . For query adaptation, is the score space reachable through the fixed key matrix, so the restriction is part of the LoRA model. This rank can be smaller than the rank required to match every finite target logit exactly.
Theorem 6.1 (Exact closure rank of an isolated-triple Walsh family). For every , there is a query-only Walsh-attention family with contexts and fewer than token positions such that every exact realization with finite logits has update rank . For the limiting target of this family and its Walsh score space , the exact relative closure rank is
This equality is for the isolated-triple family constructed in Appendix G; other target families can have smaller closure rank, as the construction below demonstrates.
The construction groups Walsh characters into isolated triples. A rank-two path per triple gives the upper bound. For the lower bound, restricted Fourier identities and columnwise normalization force every limiting triple block to retain rank at least two. Saturation therefore yields a genuine constant-factor reduction, but in this family it cannot collapse the rank of the attention function to .
A separate linear-token family gives a stronger achieved ratio: with fewer than token positions, rank at most
attains vanishing KL, reaching ratio 4/7 on complete seven-context blocks. That construction concerns a different target family and does not identify its minimum closure rank. The two results and their proofs are kept separate in Appendix G.
7 Fused multi-head LoRA
Standard query LoRA for multi-head attention often constrains one fused projection matrix, vertically divided into head blocks. This is not the same as assigning an independent rank to every head: one fused rank direction can serve several heads.
For , let and let all heads share the query activation . Stack the head updates as and impose the single fused constraint . Assume the target is generated by the similarly stacked dense update . Define
Theorem 7.1 (Fused multi-head rank–KL bounds). Suppose every target probability is at least almost surely, is independent of , almost surely, and
Then
The upper/lower bracket can widen by a factor of order because the objective sums KL over heads; the aggregation inequality producing this factor is tight without further assumptions on how error is distributed across heads. If each head instead has its own adapter and integer rank , the feasible set separates after the ranks are fixed; allocating a total budget is the discrete problem . The proof and the underlying pointwise aggregation inequality are in Appendix H.
8 Joint query/key LoRA
Practical LoRA may update both queries and keys. Let be pretrained factors and let be query and key updates with ranks at most . On ordinary dot-product scores they change the scores by the effective update
The bound is known [26]: grouping the bilinear term gives the sharp containment
Let a context provide token representations and a query representation . For target factors , put and define the centered score error and actual factor-class objective
Let
If and are independent, the mean squared score error equals . Define
Let be the set of rank-s matrices attaining the weighted approximation error . An element of this set need not be writable as query and key updates of size with the separate rank budgets. Define the extra error from that factorization gap by
Theorem 8.1 (Joint Q/K rank-KL bounds). Suppose almost surely, is independent of so that the mean-squared identity above holds, and, for every feasible pair ,
Then
The lower bound follows from containment in the effective rank-s class. The reverse containment generally fails: every updated width-p head also satisfies . Exact one-sided support conditions or a sequential two-sided factorization make ; otherwise that extra error can be large. The realization lemmas, a constructive target-factor upper bound, and a fused multi-head lower bound are proved in Appendix I.
The two sides form a useful bracket only when is comparable to, or smaller than, . In general, computing is a nonconvex factorization problem over the weighted rank-s optimizers; the theorem does not provide a tractable procedure or a universal upper bound for it. The cases with therefore identify the cleanest regime for this extension.
RoPE inserts a relative rotation between the query and key factors. Every relative-position slice still has rank at most , so the global robust bound remains valid for the assembled scores. The candidate is then a coupled family of effective matrices, however, and the single-matrix spectral tail in Theorem 8.1 does not apply automatically.
This RoPE-specific obstruction is not universal. Architectures that omit explicit positional embeddings and use NoPE, such as Kimi K3 [13], keep token order only through causal computation. For those heads, the ordinary dot-product formulation is the more direct starting point, subject to the model's other attention mechanisms.
9 Estimating LoRA rank from downstream data
The theory can be used once a dense or high-rank target update and a calibration set from the downstream task are available. Its output is a pair of error curves over rank: an upper curve achieved by a constructed candidate and a lower curve that no candidate in the stated class can beat. These curves may identify one rank, or they may leave an interval that the theory does not resolve.
For query-only adaptation, the procedure is:
-
Check the target class. Verify that the target attention is generated by a query update . If both queries and keys change, use Section 8; a target produced by unrestricted fine-tuning may also contain an irreducible query-only approximation error.
-
Collect calibration inputs. Sample complete inputs from the downstream task and run the fixed pretrained and target heads. Store the query activations , centered key Gram matrices , and target attention probabilities. Complete inputs, rather than individual token positions treated as independent observations, are the sampling units.
-
Choose the applicable bound. Use Figure 2. If the separability assumptions of Theorem 4.1 are not credible, use the dependence-allowing geometry in Appendix D. If the target probability floor is too small, evaluate the target-Fisher or high-mass route instead.
-
Estimate the spectral tail. For the main route, estimate and , form , and compute for every rank of interest. The truncated SVD of gives the corresponding upper-bound candidate in the weighted coordinates. On the supported subspaces, the corresponding query update is , where is the rank-r truncated SVD.
-
Supply and stress-test the constants. The probability floor, almost-sure geometry bound, and uniform moment constant are assumptions of the population theorem, not quantities certified by a finite calibration set. Use analytic bounds when available, or report over a range of assumed values. Sample estimates are diagnostics, not finite-sample certificates. The upper curve comes from the constructed candidate and does not require these lower-bound constants.
-
Compare with the desired tolerance. If , the upper bound exhibits a rank-r candidate within tolerance. If , no rank-r candidate in the relevant class can meet the tolerance. The smallest rank certified by the upper curve is sufficient; ranks rejected by the lower curve are impossible under the theorem's assumptions. Any gap between the two remains unresolved.
Example 4: Estimating rank on a given calibration set
Suppose a high-rank query adapter has already been trained, for instance for a text-to-SQL task as in Example 1. A calibration set contains complete prompts with the question, schema, instructions, and SQL prefix available at each attention call. The upper and conditional lower curves divide the tested ranks into three sets: ranks whose constructed candidate meets the KL tolerance, ranks excluded by the conditional lower bound, and ranks for which the two bounds do not decide. The width of the unresolved set depends on the gap between the upper and lower constants and should be reported rather than replaced by a single selected rank.
The population theorems do not provide confidence intervals for these plug-in estimates. A held-out calibration split can test whether the predicted rank–KL curve tracks measured target-to-candidate KL, but it does not turn the current bounds into a finite-sample guarantee. The relevant comparison is against the raw spectrum of and activation-only rank criteria: the question is whether task-weighted tails predict attainable attention KL more accurately, not whether a particular optimizer produces a U-shaped validation curve.
10 Related work
LoRA and expressivity. LoRA introduced low-rank updates as a parameter-efficient adaptation mechanism [11]. Zeng and Lee [26] analyze LoRA expressivity, including products of adapted matrices and exact Transformer score matching. We use their bound in the joint Q/K analysis and then quantify the additional error caused when the best effective score update cannot be realized by factors with the separate rank budgets. Duranthon et al. [6] give a statistical theory of rank-one LoRA fine-tuning in a solvable attention model; their object is learning-curve asymptotics rather than error as a function of rank for a prescribed target. Arunan [12] studies finite-sample estimation and rank selection for empirical risk minimization over rank-constrained LoRA. In a well-specified locally quadratic model, that work derives matching estimation rates and an under-ranking bias governed by the raw singular values of the target update. That work studies statistical estimation from finite training data. We hold the target fixed and study the approximation error remaining at each rank, with a spectrum weighted by the task queries and keys and a global error scale determined by softmax.
Weighted approximation. The weighted low-rank approximation theorem is a classic result. [7, 16]. Methods such as DRONE and SVD-LLM use related data-aware decompositions for model compression [4, 23]. CorDA orients a weight decomposition by downstream activation covariance, while EVA initializes and reallocates LoRA rank using activation variance [24, 18]. These methods motivate task-aware approximation directions. Our analysis places the weighted approximation inside the target-to-candidate attention KL and derives both upper and lower bounds, including the global scale needed for small and large score errors.
Task-intrinsic attention rank and low-rank logits. Yoon [25] defines attention-native intrinsic rank as the minimum query-key kernel rank realizing a task and studies controlled deficiency and recovery phenomena. We study the narrower class of LoRA updates of a pretrained head, and a prescribed attention target under KL. Golowich et al. [8] study low-rank approximation of extended language-model logit matrices under average KL, without pretrained LoRA attention or separate Q/K update constraints.
Attention rank and saturation. Attention head dimension and score-matrix rank have been studied as expressivity constraints [3]. Sparse-target cross-entropy and diverging-margin geometry are adjacent to our saturation branch [28]; low pre-softmax rank can also produce high post-softmax rank [15]. Boundary supports of fixed discrete exponential families are classical [5, 20]. Sign rank and rounding rank concern finite, exact realization of prescribed sign or threshold patterns [19, 17], whereas our closure rank allows a sequence of scores to diverge while its softmax converges. Our lower bound uses restricted Fourier identities, columnwise normalization, and the closedness of a bounded-rank matrix set. We do not know a direct implication in either direction between the cited Walsh sign-rank bounds and the L-relative closure-rank formula in Theorem 6.1. Low-rank softmax models have also been studied through argmaxability [9, 10]. Basri and Jacobs [2] show that low-dimensional softmax embeddings can preserve ratios among selected top-token probabilities while off-support mass vanishes. These results establish the broad support-separation and diverging-margin mechanisms. Our saturation theorem makes a different comparison within one explicit multi-context family: the rank required to match finite logits versus the exact softmax closure rank.
Softmax curvature. The Hessian comparison behind our target-Fisher bounds is related to generalized self-concordant analyses of logistic and softmax losses [1, 14]. We specialize this curvature principle through a finite-dimensional Bregman calculation for KL from the target attention to the candidate.
11 Limitations
The theory starts from an available target update. It can assess compression of that target or the rank needed to reproduce it, but it does not prescribe a rank before any target behavior is known.
The bounds are population statements. From a calibration set, one can plug in estimates of the task geometry and the corresponding spectral tails, although we do not provide finite-sample confidence intervals for the resulting rank–KL curves. Other inputs to the lower bounds—the probability floor, the almost-sure geometry constant, and the uniform moment constant—enter as theorem assumptions rather than as quantities certified by a finite sample, so a practical lower curve must rely on analytic bounds or report sensitivity to those values. The spectral specialization likewise assumes that the target attention is realizable within the stated query-only or joint query/key adapter class; unrestricted fine-tuning may leave an additional approximation error outside that class.
The results describe the best candidate in a rank-constrained class, not the path taken by a training algorithm. They therefore separate representational capacity from optimization but do not guarantee that SGD or another optimizer finds the candidate attaining the upper bound. The constants can also be loose for long, sharply peaked attention vectors. The target-Fisher and high-mass results offer alternatives in that regime, but their own assumptions must still be checked. We have not established that any of these constants are numerically tight on trained, real-model attention heads (for more information on computational checks, see Appendix 12).
Finally, the guarantees concern attention probabilities. Converting them into bounds on layer outputs or task loss requires assumptions about values, output projections, residual paths, feedforward networks, and later layers. The saturation families isolate a genuine nonlinear effect but are explicit constructions rather than models of typical language data. For joint query/key LoRA, RoPE couples the factors across relative positions, so the single-matrix spectral specialization does not apply directly, although it is worth noting that this particular obstruction is absent in NoPE architectures such as Kimi K3 [13].
12 Conclusion
We studied how much LoRA rank is needed to reproduce a known attention function on inputs from a downstream task. The main message is that this question has a task-dependent answer: it is not settled by the raw rank or singular values of the target weight update alone, but by the part of that update that the task's queries and keys actually activate. Under explicit assumptions, we connect that activated component to the best expected attention KL attainable at each rank. A global softmax comparison turns centered score error into KL, and a downstream-weighted spectral theorem turns the remaining score error into an explicit function of rank through the scale . Together, these steps replace rank heuristics and post-hoc sweeps with a two-sided, rank-indexed bracket on representational error at the attention layer itself.
The same framework extends when the standard constants are weak or the adapter is richer than query-only LoRA. Target-Fisher and high-mass lower bounds provide alternative routes when the global probability-floor assumption is uninformative, and an explicit saturation family shows that softmax can separate the rank needed to match finite logits from the rank needed to match the limiting attention function. Fused multi-head analysis accounts for a shared rank budget across heads, and joint query/key LoRA isolates the extra error from factorizing an effective score update into separate low-rank factors.
Given a target adapter and a calibration set drawn from the task, the theory therefore yields upper and lower error curves over rank and makes explicit where the available assumptions certify a rank, exclude it, or leave the decision unresolved.
References
[1] Francis Bach. Self-concordant analysis for logistic regression. Electronic Journal of Statistics, 4:384–414, 2010.
[2] Ronen Basri and David W. Jacobs. The softmax bottleneck does not limit the probabilities of the most likely tokens. In International Conference on Learning Representations, 2026.
[3] Srinadh Bhojanapalli, Chulhee Yun, Ankit Singh Rawat, Sashank J. Reddi, and Sanjiv Kumar. Low-rank bottleneck in multi-head attention models. In International Conference on Machine Learning, 2020.
[4] Patrick Chen, Hsiang-Fu Yu, Inderjit S. Dhillon, and Cho-Jui Hsieh. DRONE: Data-aware low-rank compression for large NLP models. In Advances in Neural Information Processing Systems, 2021.
[5] Imre Csiszár and František Matuš. Closures of exponential families. The Annals of Probability, 2005.
[6] O. Duranthon, F. Boncoraglio, and Lenka Zdeborová. High-dimensional theory of LoRA fine-tuning in a solvable attention model. arXiv preprint arXiv:2606.05899, 2026.
[7] Carl Eckart and Gale Young. The approximation of one matrix by another of lower rank. Psychometrika, 1(3):211–218, 1936.
[8] Noah Golowich, Allen Liu, and Abhishek Shetty. Sequences of logits reveal the low rank structure of language models. In International Conference on Learning Representations, 2026.
[9] Andreas Grivas, Nikolay Bogoychev, and Adam Lopez. Low-rank softmax can have unargmaxable classes in theory but rarely in practice. arXiv preprint arXiv:2203.06462, 2022.
[10] Andreas Grivas, Antonio Vergari, and Adam Lopez. Taming the sigmoid bottleneck: Provably argmaxable sparse multi-label classification. arXiv preprint arXiv:2310.10443, 2023.
[11] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022.
[12] Arunan J. Tight sample complexity for low-rank adaptation: Matching bounds and rank selection. arXiv preprint arXiv:2607.27680, 2026.
[13] Kimi Team. Kimi K3: Open frontier intelligence. arXiv preprint arXiv:2607.24653, 2026.
[14] Ulysse Marteau-Ferey, Francis Bach, and Alessandro Rudi. Globally convergent newton methods for ill-conditioned generalized self-concordant losses. In Advances in Neural Information Processing Systems, 2019.
[15] Wojciech Masarczyk, Mateusz Ostaszewski, Tin Sum Cheng, Tomasz Trzciński, Aurélien Lucchi, and Răzvan Pascanu. Unpacking softmax: How temperature drives representation collapse, compression, and generalization. arXiv preprint arXiv:2506.01562, 2025.
[16] Leon Mirsky. Symmetric gauge functions and unitarily invariant norms. The Quarterly Journal of Mathematics, 11(1):50–59, 1960.
[17] Stefan Neumann, Rainer Gemulla, and Pauli Miettinen. What you will gain by rounding: Theory and algorithms for rounding rank. arXiv preprint arXiv:1609.05034, 2016.
[18] Fabian Paischer, Lukas Hauzenberger, Thomas Schmied, Benedikt Alkin, Marc Peter Deisenroth, and Sepp Hochreiter. Parameter efficient fine-tuning via explained variance adaptation. In Advances in Neural Information Processing Systems, 2025.
[19] Ramamohan Paturi and Janos Simon. Probabilistic communication complexity. Journal of Computer and System Sciences, 33(1):106–123, 1986.
[20] Johannes Rauh, Thomas Kahle, and Nihat Ay. Support sets in exponential families and oriented matroid theory. International Journal of Approximate Reasoning, 52(5):613–626, 2011.
[21] John Schulman and Thinking Machines Lab. LoRA without regret. Thinking Machines Lab blog, September 2025. thinkingmachines.ai/blog/lora; accessed 2026-08-18.
[22] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
[23] Xin Wang, Yu Zheng, Zhongwei Wan, and Mi Zhang. SVD-LLM: Truncation-aware singular value decomposition for large language model compression. arXiv preprint arXiv:2403.07378, 2024.
[24] Yibo Yang, Xiaojie Li, Zhongzhu Zhou, Shuaiwen Leon Song, Jianlong Wu, Liqiang Nie, and Bernard Ghanem. CorDA: Context-oriented decomposition adaptation of large language models for task-aware parameter-efficient fine-tuning. In Advances in Neural Information Processing Systems, 2024.
[25] Byeong Hoon Yoon. The entropic bound for transformers: Why static rank fails and attention-native rank recovers. arXiv preprint arXiv:2607.23050, 2026.
[26] Yuchen Zeng and Kangwook Lee. The expressive power of low-rank adaptation. In International Conference on Learning Representations, 2024.
[27] Qingru Zhang, Minshuo Chen, Alexander Bukharin, Nikos Karampatziakis, Pengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao. AdaLoRA: Adaptive budget allocation for parameter-efficient fine-tuning. In International Conference on Learning Representations, 2023.
[28] Zihao Zhao, Tina Behnia, Ali Vakilian, and Christos Thrampoulidis. Implicit geometry of next-token prediction: From language sparsity patterns to model representations. arXiv preprint arXiv:2408.15417, 2024.
Guide to the appendix
Appendices A–D prove the global softmax, moment, spectral, and dependence-allowing bounds. Appendices E and F contain the two alternative lower-bound routes. Appendix G gives the saturation constructions and closure-rank lower bound, and Appendices H–I prove the multi-head and joint query/key extensions.
Computational checks. The accompanying code is available at https://github.com/gerardpc/lora-rank-project and verifies the displayed finite constructions, rank calculations, and selected inequalities on small instances. These checks are provided for reproducibility and debugging and are not used in the proofs.
Appendix contents
A. Proof of the global softmax bounds
B. Why a purely quadratic global lower bound is impossible
C. Moment and spectral lemmas
D. Dependence-allowing rank-KL bounds
E. Target-Fisher bounds
F. High-mass lower bounds
G. Saturation constructions and lower bound
H. Fused multi-head proofs
I. Joint query/key proofs
A Proof of the global softmax bounds
For , write and , where .
Proof of Theorem 3.1. The KL divergence is the log-sum-exp Bregman divergence
Taylor’s formula with integral remainder gives
Since , . Also both and lie in . Therefore
Taking the smaller of the quadratic and linear bounds proves .
For the lower bound, first suppose . For every ,
For any probability vector q satisfying and any centered vector ,
where and the last inequality uses that zero is the Euclidean-optimal centering constant for a centered . Inserting into (42) yields
If , put and . Convexity and imply that is nondecreasing. Hence
Combining this with (47) proves the lower bound.
Proof of Corollary 3.2. Apply Theorem 3.1 pointwise to the centered displacement , take expectations, and then take the infimum over the same rank-constrained candidate class on both sides.
B Why a purely quadratic global lower bound is impossible
Proposition B.1 (Fixed-floor rare-context obstruction). There is a family with target probability floor 1/3 and mean key Gram G = I for which the best rank-one quadratic error tends to one while the best rank-one expected attention KL tends to zero.
Proof. Let , , and choose with orthonormal columns in . Draw
with probability , with probability , .
(49)
Take the pretrained query map to be and the dense target update to be . The target query map is therefore zero, so the target attention is uniform and its floor is 1/3. The activation covariance is
The best quadratic rank-one approximation to has error .
Choose the rank-one candidate . It is exact when . When , its centered scores are , where is a centered unit column of . Thus
The population KL is at most .
C Moment and spectral lemmas
For a deterministic error matrix A, define
Lemma C.1 (Fourth-moment bridge). If a nonnegative random variable X satisfies , then, with ,
Proof. For , . Cauchy-Schwarz gives
Moreover, . Therefore
For the last inequality: if , divide by and use ; if , divide by and use .
Lemma C.2 (Uniform moment condition). Assume and are independent, that for every deterministic compatible matrix C,
and that almost surely, where . Then every deterministic A satisfies
Proof. Condition on . Independence and (56), applied to , give
Because and , this is at most . Independence also gives . Combine the two identities.
Lemma C.3 (Singular weighted spectral optimizer). Let , let be any compatible matrix, and put . Then
This remains true when G or is singular.
Proof. For every feasible , the matrix has rank at most , so Eckart–Young–Mirsky gives the lower bound. Let be a rank- truncated SVD and define
The left and right singular vectors of lie in the supports of and , respectively. Hence and . This candidate attains the tail.
Proof of Theorem 4.1. Exact dense-target realizability gives . Independence yields
By Lemma C.3, every feasible satisfies . Lemma C.2 and Lemma C.1 therefore imply, uniformly over the complete candidate class,
Taking the infimum gives the robust-objective lower bound.
For any nonnegative X,
Apply this to the explicit weighted-SVD candidate from Lemma C.3, for which . Thus . Corollary 3.2 converts the two robust-objective bounds into (14).
D Dependence-allowing rank-KL bounds
Without assuming independence, retain the definitions
Proof of Theorem 4.3. Every feasible A satisfies . Applying Lemma C.1 and (19) gives
This holds for the entire candidate class and survives the infimum. For the upper bound, insert into (63). Apply Corollary 3.2.
E Target-Fisher bounds
Proof of Theorem 5.1. Let . Coordinatewise,
For any probability vector q,
Consequently, if , then . The lower inequality follows by applying the coordinatewise lower bound before minimizing over ; for the upper inequality, evaluate the -weighted variance at the -optimal centering constant.
Insert (66) into the Bregman integral
The scalar integrals are
This proves (22), with the value 1/2 obtained by continuity at R = 0.
The same integral representations show that is nonincreasing and is nondecreasing on . For every fixed , decreases with , whereas increases; integration preserves these inequalities. This justifies the monotonicity step below.
For query-only adaptation, define
and . Let be the rank-r candidates whose score differences from the target have range almost surely at most , and define
Corollary E.1 (Constrained Fisher rank-KL bounds). If is nonempty, then
Proof. Apply Theorem 5.1 pointwise to every admissible candidate and use monotonicity of and . Taking the infimum gives the lower bound. For the upper bound, apply the inequality to an -minimizing sequence for and let .
Under independence, put , , and . Lemma C.3 gives as the unrestricted rank-r Fisher tail. Since is a subset of the unrestricted class,
If the Fisher-weighted SVD optimizer belongs to , it also attains the constrained quadratic infimum, yielding the matching upper bound .
F High-mass lower bounds
Lemma F.1 (Conditional KL decomposition). For positive distributions p, q and nonempty S, put and . Then
If and , then and .
Proof. For , write and sum with weights . Repeat on . Conditional softmax follows because the full normalizer cancels after conditioning.
Proof of Theorem 5.2. By Lemma F.1, the full KL is at least , where . Apply Theorem 3.1 to the restricted logits. Their target floor is
Thus, for each candidate,
Use and , take expectations, and then take the infimum over the complete unrestricted rank-r class.
For the spectral form, let contain the selected key rows and define
where . Under independence, activation hypercontractivity, and , the same proof as Theorem 4.1 gives
where . Under two-sided dependent geometry , apply Theorem 4.3 to obtain
G Saturation constructions and lower bound
For a boundary target matrix and an allowed centered score space , define its softmax closure rank as the least for which there is a sequence satisfying , every column of lies in , and columnwise softmax converges to .
G.1 The linear-token achievable construction
Write , , and choose the least such that . Identify with . The one-dimensional subspaces partition nonzero vectors into triples . Select complete triples and characters from one further triple. For token row , set and form the normalized character matrix . Its columns are centered and orthonormal. Context has , zero pretrained logits, and target logits .
At every finite , centered-softmax injectivity and force an exact update to equal , hence to have rank .
On a complete triple, write the characters as , put and , and define
has rank two. On the first context's target support , its scores are , whereas on the score is . The within-support spread vanishes and the support gap diverges. For the second context the score is : it equals on and is at most on . The third context is symmetric. Scalar blocks handle leftovers. The block-diagonal update has rank .
For the seven-character strengthening, take the seven nonzero characters of , set and , and define
(81) and
The factorization gives . For completeness, the product before the scalar factor is
In column , the four rows in the positive halfspace are precisely those with entries between and ; every remaining entry is at most for . Multiplying by gives, for the positive halfspace of every character ,
Thus the within-support spread is at most 3/T and the support gap is at least . Column centering preserves softmax and does not increase rank.
Identify with and pack its nonzero vectors into seven-character one-dimensional subspaces. If , , the resulting path has rank at most and uses tokens.
It remains to verify KL convergence rather than only weak convergence of supports. For each target halfspace, the target off-support mass is . Let be the candidate off-support mass. In both constructions, , within-support KL vanishes, and the candidate score range is polynomial in . By Lemma F.1, the only nontrivial term satisfies
The conditional complement contribution obeys the same bound. Taking the better of the triple and septuple packings proves the linear-token statement in Section 6.
G.2 Proof of the exact closure-rank theorem
Proof of Theorem 6.1. Write , . Work in a binary vector space whose size is the least power of two above . We construct
so these are the only additive triples in . Given a current set , let . Choose and then . Fewer than vectors are forbidden, so the construction continues. At most two leftovers can be added outside the current sumset. The number of token rows satisfies .
Use normalized Walsh characters for as centered orthonormal key columns. The finite targets are again , so every exact finite-logits update is and has rank . Applying the rank-two path in (80) independently to each , with scalar paths on leftovers, gives closure rank at most .
For the reverse inequality, consider any coefficient sequence whose score softmaxes converge to the target boundary distributions. Absorb the fixed Walsh normalization into . For context a, write
On , the restrictions of and agree. Orthogonality of the restricted characters and convergence to the uniform target give
All support scores equal , whereas the mean complement score is . The diverging support gap forces .
Triple isolation and (88) make every cross-block coefficient . If is the block containing , put . Then . On the negative halfspace, and both signs occur, so
The diverging gap implies .
Normalize each column by its positive diagonal coefficient:
This preserves rank. Diagonal entries become one, cross-block entries converge to zero, and within-block entries remain bounded. Pass to a convergent subsequence. The limit is block diagonal, with singleton blocks [1] and triple blocks of the form
Every real block (91) has rank at least two. If it had rank one, its minors would force , , and . The first and third equalities imply , contradicting over the reals. The limiting normalized matrix therefore has rank at least . Since the set of matrices of rank at most is closed, every approximating sequence has rank at least . This matches the construction.
H Fused multi-head proofs
For nonnegative numbers , put . We first prove
for all . If , every and . If , then : for this follows from , and for it follows from . Summing gives the left inequality. Moreover, , so Cauchy–Schwarz gives .
Proof of Theorem 7.1. Applying Theorem 3.1 headwise and summing, then using Equation (92), gives the lower bound
For the upper bound, the headwise inequalities give directly
Both constants in the final aggregation inequality are attained: the quadratic branch when all are small, and the linear branch when the errors are equal across heads. The block definitions in (29) and independence give
Weighted Eckart–Young–Mirsky makes the infimum of this quadratic objective equal to . The leverage and fourth-moment assumptions imply by the argument of Lemma C.2. Lemma C.1 therefore gives the robust lower bound
For the weighted-SVD candidate, take expectations in Equation (94), use Cauchy–Schwarz on , and substitute . This gives the stated upper bound and completes the proof of (31).
For independently parameterized head adapters, the feasible set is a Cartesian product once integer ranks are fixed, so
This proves the allocation identity.
Finally, let and be the value-weighted head outputs, let be the diameter of the head's value vectors, and let be its output-projection block. Total variation and Pinsker give
By Cauchy–Schwarz across heads,
I Joint query/key proofs
For ordinary dot-product attention, define
The two summands have ranks at most and , proving Equation (33). The bound is sharp: for , , take
Then has rank 2r.
Every joint candidate also satisfies
Thus the actual joint class is contained in the effective rank-s class, , and in its width-aware subclass.
Let
and let be the infimum of over the actual factor class. Applying the lower half of Theorem 3.1 to each candidate gives
Proof of Theorem 8.1. By rank containment, every effective error is a rank-s candidate relative to . Weighted Eckart–Young–Mirsky therefore gives
for every feasible pair. The assumed fourth-moment condition and Lemma C.1 imply
Take the infimum and use (104) for the lower bound.
Let be the nonempty set of weighted rank-s optimizers and define
Choose jointly -minimizing sequences in these two infima. The weighted seminorm triangle inequality gives
Apply the pointwise global upper bound and Equation (63), then let .
The realizability price vanishes in several checkable cases. If and , then
The symmetric statement for keys uses when . More generally, suppose , choose with and , and assume with . Then
has rank at most and satisfies . These projector identities prove the one-sided and sequential realization claims.
An always-valid factor-dependent upper bound follows from
Submultiplicativity yields
Combining this with (63) and the global softmax upper bound gives the constructive target-factor upper bound. Weighted truncated SVDs of the actual target factors make the two Frobenius errors equal to their corresponding spectral tails.
For fused multi-head joint adaptation, every head block satisfies . Applying weighted Eckart–Young headwise and then the aggregate moment bridge gives
This bound deliberately grants every head the full allowance s and is therefore safe but potentially loose.