How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Exact merging and gradients for a low-rank adapter
Statement
Fix dimensions and matrices as in the definition of a low-rank adapter. Let , let , and let each be a finite real-arithmetic loss program with scalar real output wherever its primitive calls are defined. Each primitive map is on a declared open domain or is piecewise with finitely many open branch regions and a formula on each region; when defined, a boundary primal value is specified separately. Here means totally differentiable with continuous derivative. Define the finite empirical loss on a weight matrix by the following formula wherever all the programs return scalar values:
At any where all primitive calls have values and every piecewise primitive call is on a unique strict branch, write for the Frobenius gradient, defined by for every , where . Then the factor gradients are
At every successful step of the finite-budget adaptation algorithm, write its ordered minibatch as , retaining repeated indices, and define
With and , all primitive calls in this batch objective have values and each piecewise primitive call is on a unique strict branch; branch choices may differ between successful steps. Reverse-mode automatic differentiation returns the exact real-arithmetic gradients and . If , then for every such empirical loss; if also , then . For every input , the unmerged and merged layer outputs agree:
The factor matrices contain trainable scalar coordinates, excluding the frozen entries of ; this coordinate count is not an assertion about identifiable degrees of freedom. All equalities are in real arithmetic and imply no floating-point, convergence, task-transfer, or hardware-performance guarantee.
Let be the finite horizon of the procedure. The finite-budget procedure also has the following termination and status property. Suppose each primal value/status check terminates, and each defined primitive evaluation and each local derivative evaluation on a strict branch returns its specified real-arithmetic value or derivative in finite time. Then at the first step whose ordered primal evaluation encounters a primitive with no value or a defined piecewise primitive on a boundary or ambiguous branch, the procedure returns DOMAIN_ERROR or NONDIFFERENTIABLE, respectively, before updating the factors at that step. If no such evaluation occurs, it returns SUCCESS after exactly updates. For , it returns immediately without evaluating a loss.
Statement references
Facts & Assumptions
Given: The fixed dimensions and matrices; a strict-branch evaluation point for the gradient formulas; and, for the procedure claims, the finite-budget algorithm input, its runtime value/branch checks, and its horizon.
Low-rank adaptation of a linear layer: the updated matrix is , with , , and fixed .
Finite-budget low-rank adaptation by gradient descent: each minibatch program is checked at the current factors; reverse mode runs only when all calls are defined and piecewise calls lie on strict branches; failure statuses return before updating; otherwise the returned gradients update every entry of and .
Reverse accumulation sums gradients over shared parameter uses: for a finite recurrence with one shared parameter input, reverse accumulation includes every transition's parameter pullback.
The chain rule for total derivatives: : the total derivative of a composition is the ordered composition of the total derivatives of its maps.
Reverse mode computes the exact gradient of the real-arithmetic graph: on a finite scalar-output program at a fixed strict-branch evaluation point, reverse mode returns the exact derivative with respect to its inputs.
Proof
Fix perturbations and of and . Expanding the product gives , so the derivative of in direction is .
At a successful step , write , retaining repeated indices. Set to the ordered vector of all entries of and , put , and define for . On the strict branches selected at this step, this is a finite recurrence on open domains with one shared parameter input and terminal scalar . Thus the recurrence gradient formula in [F3] applies, including repeated parameter uses.
Associativity of matrix multiplication gives . Counting entries of the two trainable factors gives ; the base matrix is frozen.
By the chain rule, the derivative of in direction is ; the same calculation applies to each batch objective with its gradient .
The trace identity gives . The trace identity gives ; these identities also hold with for each .
The Frobenius inner product determines a matrix uniquely from its pairing with every perturbation. Since and are arbitrary, step 3.1 therefore identifies the gradients as and , and the same formulas hold for each batch objective with .
At a successful step , the algorithm evaluates the finite scalar program for . By [F5], its reverse-mode call returns the exact input derivative on the strict branches selected at that step. Therefore its returned factor gradients equal the derivatives identified in step 4.1 for .
If , the formula for in step 4.1 is zero; if also , the formula for is zero.
Under the termination hypothesis, each loop iteration makes finitely many primitive calls in its stated evaluation order. It either encounters the first undefined or boundary/ambiguous primitive, in which case the algorithm returns the corresponding status before updating, or completes the primal evaluation on strict branches. In the latter case the reverse sweep traverses finitely many nodes and parent slots, and every local derivative evaluation returns its specified derivative by assumption; the algorithm then performs one finite update and increments . Induction on shows there can be at most successful updates. If no failure occurs, the loop reaches and returns SUCCESS; if , its explicit zero-step case returns immediately.
Depends on
Used by
- Merged and unmerged adapter forward passes agree Example
- Zero-zero initialization stalls one step, while nonzero A can move Example
- Rank restrictions and empirical transfer claims Remark
Cited to discharge well-definedness by Finite-budget low-rank adaptation by gradient descent.
Dependency tree · two levels
14 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.
Sources
- Edward Hu et al., LoRA: Low-Rank Adaptation of Large Language Models, arXiv:2106.09685v2, §4.1 (standard reference, not scraped)
- MIT OpenCourseWare 18.S096, Matrix Calculus for Machine Learning and Beyond, Lecture 5 Part 3, §§8.3–8.4 (standard reference, not scraped)