| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Machine Unlearning
- diffusion models
- flow models
- 코테
- diffusion model
- Concept Erasure
- 3d generation
- image editing
- 논문리뷰
- BOJ
- ddim inversion
- flow matching
- image generation
- visiontransformer
- Programmers
- video generation
- Python
- memorization
- flow matching models
- 3d editing
- diffusion
- rectified flow matching models
- inversion
- 프로그래머스
- rectified flow models
- unlearning
- rectified flow
- VirtualTryON
- video editing
- 네이버 부스트캠프 ai tech 6기
- Today
- Total
평범한 필기장
[평범한 대학원생이 하는 논문 간단 요약] Localized Concept Erasure for Text-to-Image Diffusion Models Using Training-Free Gated Low-Rank Adaptation (CVPR 2025) 본문
[평범한 대학원생이 하는 논문 간단 요약] Localized Concept Erasure for Text-to-Image Diffusion Models Using Training-Free Gated Low-Rank Adaptation (CVPR 2025)
junseok-rh 2025. 9. 29. 22:21Paper : https://arxiv.org/abs/2503.12356
Localized Concept Erasure for Text-to-Image Diffusion Models Using Training-Free Gated Low-Rank Adaptation
Fine-tuning based concept erasing has demonstrated promising results in preventing generation of harmful contents from text-to-image diffusion models by removing target concepts while preserving remaining concepts. To maintain the generation capability of
arxiv.org
Abstract
기존 연구들은 특정 구역에 나타나는 localized target concept을 지우기 위해서 다른 이미지 구역의 fidelity를 해친다. 이 때문에 image generation의 전체적인 performance가 감소한다. 본 논문은 이러한 문제를 해결하기 위해서, Gated Low-rank adaptation for Concept Erasure (GLoCE)라는 training-free method를 제안한다.

1. Localized Concept Erasure
본 논문은 text prompt가 target과 remaining concept들을 모두 포함하고 target concept이 image에서 local하게 나타날 때, remaining concept의 image fidelity를 유지하는 framework을 제안한다. Concept Erasure는 다음 세 가지 기준을 따진다.
- Efficacy : 생성된 이미지에서 target concept이 얼마나 잘 지워졌나
- Specificity : remaining concept을 얼마나 잘 유지하나
- Robustness : attack prompt에 얼마나 강건한가

본 논문은 localized concept erasure를 도입하는데, 이를 달성하기 위해서 inference-only adaptation을 통해서 값이 정해지는 몇개의 파라미터를 주입하는 Gated Low-Rank Adaptation for Concept Erasure를 도입한다.
1.1 Closed-Form Low-Rank Adaptation
본 논문은 LEACE라는 논문의 방식에서 영감을 받았다. LEACE는 linear projection들을 통해서 unlearning method를 위한 linear guardedness를 도입한다.
- $\mathbf{X} = [X_1 \cdots X_T] \in \mathbb{R}^{D \times T}, \quad D \ : \ \text{dimension}, T \ : \ \text{the number of tokens}$
- $Z$ : concept related information corresponding to $X$
- Linear Projection $\mathcal{T}(X;P,b) = PX + b$
$\mathcal{T}$를 통해서 $X$를 통해서 $Z$를 예측하기 위해서 $\mathbb{P}(X \mid Z = \cdot)$이 가능한 가장 worst 분포들 중 하나면 $X$는 $Z$를 linearly guard한다. LEACE에서는 $\operatorname{Cov}(PX^{tar}, Z^{tar}) = \mathbf{0}$에 대해서 다음을 최소화 하는 $P$와 $b$를 통해서 concept erasing을 보인다.

이 objective는 다음일 때, 최소화된다.

- $W = (\operatorname{Cov}(X^{tar})^{1/2})^+$ : whitening transformation
- $Q = (W\operatorname{Cov}(X^{tar},Z^{tar}))(W\operatorname{Cov}(X^{tar},Z^{tar}))^+$ : orthogonal projection matrix onto the column sapce of $W\operatorname{Cov}(X^{tar}, Z^{tar})$
- $\mu^{tar} = \mathbb{E}[X^{tar}]$
LEACE에서는 model내에 모든 layer의 output에 대해서 linear projection $P^*$와 $b^*$를 적용하는 concept srubbing을 제안한다.
이 방식은 언어 테스크에서 좋은 성능을 보이지만, $P^*$가 full-rank matrix이기 때문에 memory와 computation에 대해서 비효율적이다. 그래서 본 논문은 few image generation을 가지고 inference-only approach에 의해 구성된 low-rank matrix들을 통해 $P^*$를 얻는 것을 목표로 한다.
LEACE는 original embedding에서 정보의 손실을 최소화하는 반면에, 최근 diffusion model에서 concept erasure들은 target concept으로 embedding $\mathbf{X}^{tar}$을 mapping concept $\mathbf{X}^{map}$을 mapping한다. 이를 위해서 다음을 최소화함으로써 $\mathbf{X}^{tar}$을 $\mathbf{X}^{map}$과 비슷하게 만들도록 finetuning한다.

그러나, localized concept들에 대해서 $X^{map}$은 $X^{tar}$과 다르게 concept에 대한 정보를 포함하지 않을 수 있다. (반대도 가능) 이러한 $\mathbf{X}^{tar}$과 $\mathbf{X}^{map}$사이의 token들에 대한 mismatch는 $\mathbf{X}^{tar}$의 불필요하거나 과한 변화를 야기한다. 그래서 본 논문은 직접적으로 매핑하기보다는 PCA를 통해서 $X^{map}$의 몇 개의 주성분에 의해서 span되는 subspace위에 $X^{tar}$을 projection시킨다.
Concept에 대한 $\operatorname{Cov}(X)$의 low-rankedness를 입증하기 위해서 실험을 진행했는데, 결과는 다음과 같았다.

위 결과를 통해 본 논문은 다양한 concept들에 대해 적은 수의 singular value들만이 중요하다는 것을 관찰했다.
- $\hat{V}^{map} \in \mathbb{R}^{D \times r_1}$ : $\operatorname{Cov}(X^{map})$의 top-$r_1$ singular value들에 대응하는 principal component들
- $P^{map} = \hat{V}^{map}(\hat{V}^{map})^T$ : $\hat{V}^{map}$에 의해 span된 공간에 대한 orthogonal projection
Target concept을 갖는 $X^{tar}$을 mapping concept의 subspace로 projection시키기 위해, 본 논문은 (1)을 다음과 같이 수정한다.

$P$와 $b$에 대한 closed-form solution을 위해서, $X^{tar}$에 연관된 의미있는 정보를 포함하는 적절한 $Z^{tar}$을 정의한다. $V^{tar}S^{tar}V^{tar} = \operatorname{Cov}$를 몇개의 image generation을 통해 계산한다. $V^{tar}$은 $\operatorname{Cov}(X^{tar})$의 top-${r_2}$ singular value들에 대응하는 principal component이다. 본 논문에서는 $Z^{tar}$을 다음과 같이 나타낸다.

$\operatorname{Cov}(X^{tar})$의 low-rank property때문에 $Z^{tar}$는 $X^{tar}$와 매우 연관된다. (3)을 최적화하는 $P^*, b^*$는 다음과 같다.

이는 $X^{tar}$에서 주요한 정보를 제거하고 $\hat{V}^{map}$에 의해 span되는 subspace로 매핑하는 것과 동일하다.

결과적으로, 본 논문은 low-rank matrix들인 $\hat{V}^{map}, \hat{V}^{tar}, b^*$만을 이용해서 target과 관련된 중요한 정보들을 효율적으로 지울 수 있다.

1.2 Gate Mechanism via Principal Components
(5)와 (6)이 target concept을 효과적으로 지우지만, 특히 target과 유사한 remaining concept의 embedding에 영향을 끼친다. 이를 해결하기 위해서 linear projection에 gate mechanism을 통합하는 것을 제안한다. 이는 아래의 non-linear operation을 찾는 것을 포함한다.

- $\mathcal{X}^{tar}$ : target embedding distribution
- $\mathbb{1}_{\mathcal{X}^{tar}}(X)$ : $X \sim \mathcal{X}^{tar}$이면 1, 아니면 0
$\mathbb{1}_{\mathcal{X}^{tar}}(X)$는 관측할 수 없다.
대안으로 효과적인 gate를 디자인하기 위해서, $X^{tar}$의 principal component들의 low-rank 특성을 활용한다. Target concept들에 대해서 선택적으로 활성화되는 이러한 principal component들로부터 orthonormal basis를 구축할 수 있으면, remaining concept들은 유지하면서 target concept들에 대해서만 수정할 수 있다. 이를 위해서, 본 논문은 다음 logistic function을 gate로써 indicator function을 대체한다.

- $\sigma$ : sigmoid function
- $\alpha, \beta, \gamma \in \mathbb{R}$
- $V \in \mathbb{R}^{D \times r_3}, \quad \text{where} \quad r_3 \ll d$ : column들이 target concept들에 대해서 선택적으로 활성화되는 orthonormal basis를 형성하는 low-rank matrix

1.3 Inference-Only Update of Gate
Gate를 위한 파라미터 $\alpha, \beta, \gamma, V$에 대한 빠른 결정을 위해, 본 논문은 few-shot, inference-only 방식을 적용한다.
$V$와 $\beta$
Target과 remaining concept들 사이의 discriminativity를 고려하는 것이 필요하다. "George Clooney"의 특징과 "Morgan Freeman"의 특징은 공유된다. Discriminativity를 강화하기 위해서, 먼저 target들로부터 surrogate ("a celebrity")의 mean embedding을 지운다. 이는 Residual embedding $X^{tar}_r = X^{tar} - \mu^{tar}$을 가져온다. 이로부터 $\mathbb{E}[X^{tar}_r(X^{tar}_r)]$의 top-$r_3$ singular value들에 대응하는 principal component들을 계산한다. 그리고 orthonomal basis $\hat{V}^{tar} \in \mathbb{R}^{d \times r_3}$을 얻는다.
$V^* = \hat{V}^{tar}_r, \quad \beta^* = \mu^{sur}$
$\alpha$와 $\gamma$
Anchor로 사용된 몇개의 remaining concept(target concept과 cosine similarity에서 가까운 사전에 정의된 concept)들과 target concept사이의 basis $V^*$의 기여도를 비교한다. $\mathbf{X}$에 대해서, $\mathbf{X}$안에 token들 사이에 다음을 만족하는 최댓값을 찾는다.

Target concept을 포함하는 tokene들은 $\mathbf{X}$에 local하게 존재하기 때문에 평균보다는 최댓값을 구한다.
Remaining concept들을 보존하기 위한 tight condition으로써, 본 논문은 $p(\mathbf{X})$이 anchor concept들에 대해서 maximal value들과 유사할 때에만 열리도록 gate를 디자인한다. $\gamma$는 다음과 같이 결정된다.

$\alpha$는 $\sigma(\alpha^*\tau_2) = u$를 통해 결정되고 이는 $\alpha^* = \frac{1}{\tau_2} \log \frac{u}{1-u}$이다.
최종적으로 본 논문은 모든 파라미터들을 few-shot inference만으로 결정할 수 있다.

모든 실험에서 $\tau_2 = \tau_1 / 2$와 $u = 0.99$로 고정한다.
2. Experiments
2.1 Celebrities Erasure




2.2 Explicit Contents Erasure

2.3 Robustness against Adversarial Attacks

2.4 Artistic Styles Erasure


2.5 Ablation Studies

Take Away
- 각 concept을 생성해서 나오는 embedding을 이용한다는 점
- Gate를 통해서 target concept과 관련이 클 경우에만 gate를 열어서 target concept에 대해서만 지우려고 함
- LoRA와 다르게 아키텍처에 대한 변화?같은 것이 아닌, gate에 대한 파라미터만 추가되는 점이 인상적이였음
- multi-concept erasing을 하는 경우, 각 module의 output의 값이 큰 module만 이용하는 것도 기존 방식들과 달랐음
어려워서 뭔가 100% 다 이해한 건 아닌 듯한 논문....