Unified-LoRA / docs /architecture.md
Simo76's picture
Update architecture.md
02433bd
Architecture β€” Nested Orbital LoRA
Core idea: dynamic rank control via stress-driven orbital transitions with weight persistence (no cold start).
Problem: cold start on rank transitions
Standard multi-rank LoRA keeps separate adapters per rank:
r=4, r=8, r=16 β†’ independent weights
Switching rank causes partial cold restarts β†’ performance drop.
Solution: Nested LoRA (one adapter, multiple ranks)
Single adapter at max rank:
A(16, d), B(d, 16)
Active rank is obtained by slicing:
r=4 β†’ A[:4, :], B[:, :4]
r=8 β†’ A[:8, :], B[:, :8]
r=16 β†’ full matrix
r4 βŠ‚ r8 βŠ‚ r16
Lower ranks reuse trained weights β†’ no cold start.
Scaling
To keep output magnitude consistent:
scale = max_rank / max(r, 1)
scale = min(scale, 4.0) # optional clamp
Orbital Controller (no thresholds)
Dynamic trajectory instead of static FSM:
Ascend β†’ stress detected β†’ increase rank
Hold β†’ oscillation β†’ stay
Descend β†’ stable β†’ decrease rank
Uses a stack to ensure symmetric return.
Stress signal
Ο†(t) = |loss - EMA(loss)| + 2.0 Γ— max(0, loss - prev_loss)
Auto-calibrated thresholds:
t_stress = ΞΌ + 0.7Οƒ
t_stable = max(ΞΌ - 0.3Οƒ, 0)
Robust stats can be used to reduce noise.
Why it matters
avoids cold starts across rank changes
adapts capacity in real-time
works in black-box settings
O(1) overhead
Comparison
Property
Standard LoRA
AdaLoRA
Orbital LoRA
Rank control
Fixed
SVD
Stress
Control type
None
Open
Closed-loop
Transition cost
N/A
High
O(1)
Architecture
Single
Pruned
Nested
Black-box
Yes
No
Yes