Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/693c0f4f-255c-8008-92e9-0cd44c6d6226
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Let’s sketch a few variants. ==== ===== Data for each training LoRA ttt: ===== * Prompts batch PtP_tPt (like DnD) * True LoRA weights ΔWt\Delta W_tΔWt * True Delta Activation δt\delta_tδt Model: # Condition encoder: et=E(Pt)e_t = E(P_t)et=E(Pt) (e.g., text encoder + pooling) # LoRA generator: ΔW^t=Gθ(et)\hat{\Delta W}_t = G_\theta(e_t)ΔW^t=Gθ(et) # Delta head: Option 1 (cheaper): a small learned approximator δ^t=Hϕ(ΔW^t)\hat\delta_t = H_\phi(\hat{\Delta W}_t)δ^t=Hϕ(ΔW^t) Option 2 (more faithful): actually run base+LoRA on a fixed probe set to compute δ^t\hat\delta_tδ^t. Loss: L=λweights∥ΔW^t−ΔWt∥2⏟classical DnD-style loss+λδ∥δ^t−δt∥2⏟auxiliary behavioral loss\mathcal{L} = \lambda_\text{weights} \underbrace{\|\hat{\Delta W}_t - \Delta W_t\|^2}_{\text{classical DnD-style loss}} + \lambda_\delta \underbrace{\|\hat\delta_t - \delta_t\|^2}_{\text{auxiliary behavioral loss}}L=λweightsclassical DnD-style loss∥ΔW^t−ΔWt∥2+λδauxiliary behavioral loss∥δ^t−δt∥2 What does the δ-loss do? * It pushes the generated LoRA to not only be close in parameter space, but also to induce the correct global behavior on probe prompts. * It gives an extra gradient signal that’s much lower-dim and semantically aligned, which can stabilize training especially when weight loss is noisy / multi-modal. Weak points: * If you compute δ^t\hat\delta_tδ^t via true forward passes on probes, this adds heavy cost per step. * If you approximate HϕH_\phiHϕ (LoRA → δ), you’ve added another network that might be lossy; but maybe that’s okay because δ itself is coarse. ===== To avoid directly regressing millions of weights from prompts, you can insert δ as a bottleneck: ===== Stage 1: learn a task encoder using δ * Train EψE_\psiEψ s.t. Eψ(Pt)≈δtE_\psi(P_t) \approx \delta_tEψ(Pt)≈δt. * That’s a simple regression in low dimension; way easier than full LoRA. This makes δ the “task embedding space” learned from actual finetuned behaviors. Stage 2: learn δ → LoRA map Now train a separate generator GθG_\thetaGθ to map δ to LoRA: ΔW^t=Gθ(δt)\hat{\Delta W}_t = G_\theta(\delta_t)ΔW^t=Gθ(δt) with weight-level loss: Lstage2=∥ΔW^t−ΔWt∥2\mathcal{L}_\text{stage2} = \|\hat{\Delta W}_t - \Delta W_t\|^2Lstage2=∥ΔW^t−ΔWt∥2 At inference: * New dataset ➜ prompts PnewP_{\text{new}}Pnew * Stage 1: δ^new=Eψ(Pnew)\hat\delta_{\text{new}} = E_\psi(P_{\text{new}})δ^new=Eψ(Pnew) * Stage 2: ΔW^new=Gθ(δ^new)\hat{\Delta W}_{\text{new}} = G_\theta(\hat\delta_{\text{new}})ΔW^new=Gθ(δ^new) Now δ is both: * A learned task representation (Stage 1), supervised by behavioral deltas; * The bottleneck that the LoRA generator uses (Stage 2). Pros: * You’ve decomposed a very hard mapping “prompts → millions of weights” into: - “prompts → 4k-dim δ” (reasonable), and - “δ → weights” (pure parameter-space mapping). * You can even pretrain Stage 2 using any LoRA–δ pairs you have, independent of prompts. Weaknesses: * δ is intentionally lossy. Many LoRAs can share similar δ, especially if probes are generic. So δ alone might not contain enough info to reconstruct exact LoRA. * You’re back to weight-level MSE in Stage 2; though G has an easier job because δ already encodes “what kind of task” it is. You can combine both worlds: in Stage 2, also add a δ-consistency loss: ∥Delta(ΔW^t)−δt∥2\|\text{Delta}(\hat{\Delta W}_t) - \delta_t\|^2∥Delta(ΔW^t)−δt∥2 so that even if weights aren’t exactly matching, their induced δ is. ===== A more behaviorally principled variant: ===== # Prompts PtP_tPt → embedding ete_tet # Generator G(et)=ΔW^tG(e_t) = \hat{\Delta W}_tG(et)=ΔW^t # Use two behavioral losses instead of relying heavily on raw weight MSE: - Delta loss: ∥Delta(ΔW^t)−δt∥2\|\text{Delta}(\hat{\Delta W}_t) - \delta_t\|^2∥Delta(ΔW^t)−δt∥2 (behavior on a fixed probe set) - Output distillation loss: On a small set of task-specific prompts QtQ_tQt, minimize, e.g., KL(pbase+ΔW^t(⋅∣q) ∥ pbase+ΔWt(⋅∣q))\text{KL}\big(p_{\text{base}+\hat{\Delta W}_t}(\cdot|q) \,\|\, p_{\text{base}+\Delta W_t}(\cdot|q)\big)KL(pbase+ΔW^t(⋅∣q)∥pbase+ΔWt(⋅∣q)) so that generated LoRA matches the real LoRA’s outputs. Now weight-level supervision becomes optional or just a small regularizer. Most of the signal is: * “your LoRA should behave like this known one on probes and on some task prompts”. This is much closer to what we actually want (function match), and δ is a cheap, global summarization of that behavior. Weaknesses: * Needs two model evaluations (base+true-LoRA and base+gen-LoRA) during training. Expensive but maybe ok if you restrict to small probe sets. * Still doesn’t solve the identifiability problem perfectly: lots of LoRAs can match the same δ and distillation on small Q_t but differ elsewhere. But that might be fine in practice.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)