Skip to main content
QUICK REVIEW

[论文解读] ZipLoRA: Any Subject in Any Style by Effectively Merging LoRAs

Viraj Shah, Nataniel Ruiz|ArXiv.org|Nov 22, 2023
Video Analysis and Summarization被引用 5
一句话总结

ZipLoRA 提出了一种无需超参数调优的、基于优化的方法,可无缝合并独立训练的主体和风格 LoRA,从而在扩散模型中实现任意主体以任意风格生成,且保真度更优。通过利用权重矩阵的稀疏性与列对齐,避免了破坏性合并,ZipLoRA 在无需人工调参的情况下实现了主体与风格保真度的最先进性能。

ABSTRACT

Methods for finetuning generative models for concept-driven personalization generally achieve strong results for subject-driven or style-driven generation. Recently, low-rank adaptations (LoRA) have been proposed as a parameter-efficient way of achieving concept-driven personalization. While recent work explores the combination of separate LoRAs to achieve joint generation of learned styles and subjects, existing techniques do not reliably address the problem; they often compromise either subject fidelity or style fidelity. We propose ZipLoRA, a method to cheaply and effectively merge independently trained style and subject LoRAs in order to achieve generation of any user-provided subject in any user-provided style. Experiments on a wide range of subject and style combinations show that ZipLoRA can generate compelling results with meaningful improvements over baselines in subject and style fidelity while preserving the ability to recontextualize. Project page: https://ziplora.github.io

研究动机与目标

  • 解决使用扩散模型生成用户提供的任意主体在用户提供的任意风格下的开放性问题。
  • 克服现有 LoRA 合并方法的局限性,这些方法通常会损害主体或风格保真度,并需要大量超参数调优。
  • 实现对独立训练的主体与风格 LoRA 的鲁棒、一致的合并,且不限制训练方法。
  • 在合并后保留两个 LoRA 的独立生成能力,使其可作为专家混合模型(Mixture-of-Experts)使用。
  • 为需要动态主体-风格组合的创意应用提供轻量化、可扩展的解决方案。

提出的方法

  • ZipLoRA 采用基于优化的方法,为 LoRA 权重矩阵的每一列计算合并系数,避免对高度对齐列进行直接求和。
  • 该方法基于余弦相似度识别主体与风格 LoRA 之间互不重叠的列集合,以最小化破坏性干扰。
  • 它利用 LoRA 权重矩阵的稀疏性——其中大多数元素的数值可忽略不计——将优化重点集中于有意义的参数更新。
  • 优化过程轻量化且无需超参数调优,确保在各种主体-风格组合中保持一致的性能表现。
  • 合并后的 LoRA 保留了在新提示中重新语境化主体并维持风格化质量的能力。
  • 可选的标量乘数使用户能够在不重新训练的情况下控制风格化的强度。
Figure 2 : LoRA weight matrices are sparse. Most of the elements in $\Delta W$ have a magnitude very close to zero, and can be conveniently thrown away without affecting the generation quality of the fine-tuned model.
Figure 2 : LoRA weight matrices are sparse. Most of the elements in $\Delta W$ have a magnitude very close to zero, and can be conveniently thrown away without affecting the generation quality of the fine-tuned model.

实验结果

研究问题

  • RQ1是否可以有效合并独立训练的主体与风格 LoRA,而不会损害主体或风格保真度?
  • RQ2无超参数调优的方法是否能在多样化主体-风格组合中实现一致且高质量的合并?
  • RQ3基于优化的合并策略是否在保留内容与风格方面优于直接线性组合?
  • RQ4合并后的 LoRA 是否能保持原始 LoRA 的独立生成能力?
  • RQ5该方法是否能通过单个标量权重调整实现平滑、可控的风格化?

主要发现

  • 在用户偏好研究中,ZipLoRA 在所有三个对比案例中均优于直接合并与联合训练,获得更高的认可率。
  • 在定量指标方面,ZipLoRA 的主体对齐得分显著优于直接合并,且风格对齐得分具有竞争力,表明其主体保真度更优。
  • 该方法保持了较强的文本对齐得分,表明其在增强风格与主体表征的同时,仍保留了基础模型的提示遵循能力。
  • ZipLoRA 有效保留了独立生成原始主体与风格的能力,而直接合并方法则未能实现这一点。
  • 基于优化的方法使用户可通过单个标量乘数实现平滑的风格化控制,无需重新训练,即可在 0 到 1 的范围内调节风格化强度。
  • 在 SDXL 上的实验表明,ZipLoRA 能够在广泛多样的主体-风格组合中实现高质量、可泛化的个性化。
Figure 3 : Highly aligned LoRA weights merge poorly. When LoRA weight columns are highly aligned, a direct merge obtains subpar results. Instead, our approach minimizes the mean cosine similarity between the columns of the LoRA updates across the layers.
Figure 3 : Highly aligned LoRA weights merge poorly. When LoRA weight columns are highly aligned, a direct merge obtains subpar results. Instead, our approach minimizes the mean cosine similarity between the columns of the LoRA updates across the layers.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。