Skip to content

About

Achieving full-rank equivalent updates through LoRA-family merging in generative models. (生成モデルへのLoRA類のマージでフルランク相当の更新を行う手法)

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CCSVD-method

Achieving full-rank equivalent updates through LoRA-family merging in generative models.
(生成モデルへのLoRA類のマージでフルランク相当の更新を行う手法)

CCSVD (Clean Covariance-Optimized SVD)

What is the CCSVD Method?

CCSVD (Clean Covariance-Optimized SVD) 260915 by muooon
This applies the update method of QPOLA optim to static weights.

Difference Extraction and Individual Cleansing
ΔWᵢ₍ᶜˡᵉᵃⁿ₎ = rSVDᵣ ( clamp(ΔWᵢ, μᵢ - c · σᵢ, μᵢ + c · σᵢ) )

Whitening via Gram Matrix (Covariance)
dᵢ = vec(ΔWᵢ₍ᶜˡᵉᵃⁿ₎) ∈ ℝᴰ,
Gᵢⱼ = ⟨dᵢ, dⱼ⟩ = dᵢᵀ dⱼ,
Gᵢₙᵥ = (G + εI)⁻¹,
w = (K / (𝟏ᵀ Gᵢₙᵥ 𝟏)) Gᵢₙᵥ 𝟏

Integration into the Base Model
ΔW₍ᶠⁱⁿᵃˡ₎ = b × Σᵢ₌₁ᴷ (wᵢ · ΔWᵢ₍ᶜˡᵉᵃⁿ₎),
W₍ᵐᵉʳᵍᵉᵈ₎ = W₍ᵇᵃˢᵉ₎ + ΔW₍ᶠⁱⁿᵃˡ₎

This is applied to the integration between LoRA variants (including LyCORIS) or into models, and between models.
Note: This is an overview; actual implementation involves further fine-tuning, etc.
Note: During integration, the relative difference using the L2 norm is calculated to suppress variation.

What is guidance adjustment?

Standard merging uses rSVD and GEMM (Gram matrix whitening) to combine weights, while guidance adjustment modifies a single model's weights directly via addition or subtraction of projection components, bounded by a relative norm limit (max_ratio).
With a direction vector v̂ (or top-k singular directions via rSVD), positive strength (s > 0) suppresses or orthogonalizes components, whereas negative strength (s < 0) reverses the sign to pull weights toward a direction or angle estimated from LoRA-family deltas or learned features.

ΔW_guide = -s · (W v̂) v̂ᵀ (s ∈ [-1.0, +1.0])
ΔW_steer = +|s| · (W v̂) v̂ᵀ (capped by max_ratio)

This can improve or steer model behavior without going through full-rank training, acting as a lightweight post-hoc adjustment to the weight space.
Rather than simply adjusting dominant directions, referencing vectors obtained from LoRA-family training enables more accurate and effective adjustment to the static weight space without full-rank training.

Why Does It Become a Pseudo-Full-Rank Update?

What we learn from QPOLA optim is that obtaining "spatial consistency" allows us to appropriately constrain the degrees of freedom of the weights.
If we optimize this for static weights across multiple seeds, tasks, etc., using "spatial consistency", we should be able to integrate LoRAs seamlessly. Therefore, as described above, by cleaning up noise and outliers caused by differences in seeds, tasks, etc.,
we can synthetically obtain a flow that observes complex landscapes from multiple directions and leads to flat minima.
This is the concept of enabling spatial characteristics close to the degrees of freedom of a full-rank update to be reproduced post-hoc.

About

Achieving full-rank equivalent updates through LoRA-family merging in generative models. (生成モデルへのLoRA類のマージでフルランク相当の更新を行う手法)

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages