Alphabeta Math
TheoremStatement: AI-adaptedProof: AI-adaptedPipeline-generatedprecheck passjudge pass (gpt-6-luna)
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 m≥1, let x1,…,xm∈Rk, and let each ℓj be a finite real-arithmetic loss program with scalar real output wherever its primitive calls are defined. Each primitive map is C1 on a declared open domain or is piecewise C1 with finitely many open branch regions and a C1 formula on each region; when defined, a boundary primal value is specified separately. Here C1 means totally differentiable with continuous derivative. Define the finite empirical loss on a weight matrix U∈Rd×k by the following formula wherever all the programs return scalar values:

L(U)=1m∑j=1mℓj(Uxj).

At any W=W0+cBA where all primitive calls have values and every piecewise primitive call is on a unique strict branch, write G=∇WL(W) for the Frobenius gradient, defined by DL(W)[H]=⟨G,H⟩F for every H∈Rd×k, where ⟨X,Y⟩F=tr⁡(XTY). Then the factor gradients are

∇BL(W0+cBA)=cGAT,∇AL(W0+cBA)=cBTG.

At every successful step t of the finite-budget adaptation algorithm, write its ordered minibatch as It=(it,1,…,it,mt), retaining repeated indices, and define

Lt(U)=1mt∑s=1mtℓit,s(Uxit,s).

With Wt=W0+cBtAt and Gt=∇WLt(Wt), 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 ∇BtLt(Wt)=cGtAtT and ∇AtLt(Wt)=cBtTGt. If B=0, then ∇AL=0 for every such empirical loss; if also A=0, then ∇BL=0. For every input x∈Rk, the unmerged and merged layer outputs agree:

W0x+cB(Ax)=(W0+cBA)x.

The factor matrices contain rk+dr=r(d+k) trainable scalar coordinates, excluding the frozen entries of W0; 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 T≥0 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 T updates. For T=0, it returns immediately without evaluating a loss.

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.

[F1]

Low-rank adaptation of a linear layer: the updated matrix is W0+cBA, with A∈Rr×k, B∈Rd×r, and fixed c≠0.

[F2]

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 A and B.

[F3]

Reverse accumulation sums gradients over shared parameter uses: for a finite C1 recurrence with one shared parameter input, reverse accumulation includes every transition's parameter pullback.

[F4]

The chain rule for total derivatives: D(g∘f)(a)=Dg(f(a))∘Df(a): the total derivative of a composition is the ordered composition of the total derivatives of its maps.

[F5]

Reverse mode computes the exact gradient of the real-arithmetic graph: on a finite C1 scalar-output program at a fixed strict-branch evaluation point, reverse mode returns the exact derivative with respect to its inputs.

Proof

1.1F1givenalgebra

Fix perturbations H∈Rd×r and K∈Rr×k of B and A. Expanding the product gives W0+c(B+εH)(A+εK)=W+εc(HA+BK)+ε2cHK, so the derivative of (A,B)↦W0+cBA in direction (K,H) is c(HA+BK).

1.2F1F3givenconstruct

At a successful step t, write It=(it,1,…,it,mt), retaining repeated indices. Set θ to the ordered vector of all entries of A and B, put h0=0, and define hs=hs−1+mt−1ℓit,s((W0+cBA)xit,s) for 1≤s≤mt. On the strict branches selected at this step, this is a finite C1 recurrence on open domains with one shared parameter input and terminal scalar hmt=Lt(W0+cBA). Thus the recurrence gradient formula in [F3] applies, including repeated parameter uses.

1.3F1givenalgebra

Associativity of matrix multiplication gives W0x+cB(Ax)=(W0+cBA)x. Counting entries of the two trainable factors gives rk+dr=r(d+k); the base matrix is frozen.

2.1F4step 1.1givenalgebra

By the chain rule, the derivative of (A,B)↦L(W0+cBA) in direction (K,H) is ⟨G,c(HA+BK)⟩F; the same calculation applies to each batch objective Lt with its gradient Gt.

3.1step 2.1algebra

The trace identity tr⁡(GTHA)=tr⁡((GAT)TH) gives ⟨G,HA⟩F=⟨GAT,H⟩F. The trace identity tr⁡(GTBK)=tr⁡((BTG)TK) gives ⟨G,BK⟩F=⟨BTG,K⟩F; these identities also hold with Gt for each Lt.

4.1step 3.1algebra

The Frobenius inner product determines a matrix uniquely from its pairing with every perturbation. Since H and K are arbitrary, step 3.1 therefore identifies the gradients as ∇BL=cGAT and ∇AL=cBTG, and the same formulas hold for each batch objective with Gt.

5.1F2F5step 4.1step 1.2algebra

At a successful step t, the algorithm evaluates the finite scalar program for Lt(W0+cBA). 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 Gt.

5.2step 4.1algebra

If B=0, the formula for ∇AL in step 4.1 is zero; if also A=0, the formula for ∇BL is zero.

6.1F2givenalgebra∎

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 t. Induction on t shows there can be at most T successful updates. If no failure occurs, the loop reaches t=T and returns SUCCESS; if T=0, its explicit zero-step case returns immediately.

Depends on

Used by

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