| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- diffusion
- 논문리뷰
- rectified flow matching models
- BOJ
- diffusion models
- ddim inversion
- visiontransformer
- 코테
- Python
- memorization
- image generation
- video generation
- rectified flow
- inversion
- VirtualTryON
- image editing
- 3d generation
- flow models
- 3d editing
- flow matching
- video editing
- 프로그래머스
- diffusion model
- Programmers
- 네이버 부스트캠프 ai tech 6기
- rectified flow models
- flow matching models
- Machine Unlearning
- unlearning
- Concept Erasure
- Today
- Total
평범한 필기장
[평범한 대학원생이 하는 논문 간단 요약] AlphaEdit : Null-Space Constrained Knowledge Editing for Language Models (ICLR 2025) 본문
[평범한 대학원생이 하는 논문 간단 요약] AlphaEdit : Null-Space Constrained Knowledge Editing for Language Models (ICLR 2025)
junseok-rh 2025. 11. 24. 21:05Paper : https://arxiv.org/abs/2410.02355
AlphaEdit: Null-Space Constrained Knowledge Editing for Language Models
Large language models (LLMs) often exhibit hallucinations due to incorrect or outdated knowledge. Hence, model editing methods have emerged to enable targeted knowledge updates. To achieve this, a prevailing paradigm is the locating-then-editing approach,
arxiv.org
Abstract
Model Editing Methods
기존의 지식은 유지하면서 새로운 지식에 대해서 update하는 방식. ($\rightarrow$ 부정확한 정보나 outdate된 지식을 수정하는 느낌)
해결하려는 문제
본 논문에서는 이 문제를 parameter-modifying 방식으로 해결하려고 한다. 기존의 parameter-modifying 방식은 knowledge-update error $e_1$와 knowledge-preservation error $e_0$사이의 밸런스를 유지하는데 어려움을 겪는다. 기존의 방식은 objective function에 $e_1$과 $e_0$를 둘 다 넣는다. 기존 방식들은 $e_1$을 줄이는데 집중하는데, 이는 updated knowledge에 대한 overfitting을 야기한다. 본 논문은 $e_1$만을 사용하고 새로운 objective의 solution을 preserved knowledge의 null space로 projection하는 방식인 AlphaEdit을 통해 이 문제를 해결한다.

1. Method
1.1 Null Space (Left Null Space)
두 matrix $\mathbf{A}, \ \mathbf{B}$가 있다고 하면, $\mathbf{B}$가 $\mathbf{A}$의 Null space에 있다는 $\mathbf{BA} = \mathbf{0}$에 대한 필요충분조건이다. Perturbation $\boldsymbol{\Delta}$이 $\mathbf{K}_0$의 null space로 projection되면, 이를 $\mathbf{W}$에 더하는 것은 다음과 같다.

이는 결국 projected $\boldsymbol{\Delta}$가 preserved knowledge $\{ \mathbf{K}_0, \mathbf{V}_0 \}$의 Key-value association을 손상시키지 않는다는 것을 의미한다. 그리고 이는 결국 preserved knowledge를 손상시키지 않는다는 것을 보장한다.
이를 통해, 본 논문은 perturbation $\boldsymbol{\Delta}$을 구하는 objective에서 knowledge preservation term을 제거할 수 있게 한다. 이 objective를 통해서 구한 perturbation $\boldsymbol{\Delta}$을 $\mathbf{W}$에 더하기 전에, $\mathbf{K}_0$의 null space에 proejction시킨다.
1.2 Null Space Projecting
$\mathbf{K}_0 \in \mathbb{R}^{d_0 \times 100,000}$의 차원이 매우 크기 때문에, 주어진 perturbation $\boldsymbol{\Delta}$를 $\mathbf{K}_0$의 null space로 바로 projection시키는 것은 매우 무겁다. 그래서 본 논문은 computaional complexity를 줄이기 위한 대체재로 non-contral covariance matrix $\mathbf{K}_0\mathbf{K}_0^T \in \mathbf{R}^{d_0 \times d_0}$의 null space를 택한다. 이 matrix의 null space는 $\mathbf{K}_0$의 것과 동일하다.
먼저 $\mathbf{K}_0\mathbf{K}_0^T$에 SVD를 적용한다.

그러고 나서 $\mathbf{U}$에서 non-zero eigenvalue들에 대응되는 eigenvector들은 제거하고 나머지만 남긴 $\hat{\mathbf{U}}$를 구한다. 이를 통해서 다음과 같이 projection matrix $\mathbf{P}$를 구한다.

이 Projection matrixsms $\boldsymbol{\Delta}$의 column vector들을 $\mathbf{K}_0\mathbf{K}_0^T$의 null space로 mapping시킨다.
$\mathbf{K}_0$와 $\mathbf{K}_0\mathbf{K}_0^T$가 동일한 null space를 공유하기 때문에, 다음과 같다.

이는 projection matrix $\mathbf{P}$가 LLM에서 preserved knowledge에 대한 개입없이 edit을 할 수 있다는 것을 보장한다.
1.3 Null-Space Constrained Model Editing

기존 LLM model editing은 위와 같은 objective를 사용한다. 이 objective로 시작해서 본 논문의 optimization은 다음 3가지 step을 따른다.
- $\boldsymbol{\Delta}$를 $\boldsymbol{\Delta}\mathbf{P}$로 대체한다.
- $\mathbf{K}_0$를 포함한 첫번째 term을 제거한다.
- Stable convergence를 보장하기 위해서 regulaization term $\Vert \boldsymbol{\Delta} \mathbf{P} \Vert ^2$를 추가한다.

최종적으로 위와같은 수식이 된다.

Sequential editing task에서, 현재의 editing동안에 perturbation이 기존의 edit에서 update된 knowledge를 손상시키는 것을 막는 term이 필요하다. 이전에 update된 knowledge의 matrix들을 $\mathbf{K}_p, \mathbf{V}_p$라고 하면, 이 termdms $\Vert (\mathbf{W} + \boldsymbol{\tilde{\Delta}}\mathbf{P}) \mathbf{K}_p - \mathbf{V}_p \Vert^2$를 최소화해야한다. 이전 editing에서 연관된 knowledge가 update됐기 때문에, $\mathbf{W}\mathbf{K}_p = \mathbf{V}_p$이다. 그러므로 이 term은 $\boldsymbol{\tilde{\Delta}}\mathbf{P}\mathbf{K}_p$로 간단하게 바뀐다. 이른 (11)에 더하면 새로운 objective는 다음과 같아진다.

$\mathbf{R} = \mathbf{V}_1 - \mathbf{W}\mathbf{K}_1$라고 하면, (12)는 normal equation을 사용해서 다음과 같이 풀린다.

(13)을 풂으로써 최종 perturbation $\boldsymbol{\Delta}_{\mathbf{AlphaEdit}} = \boldsymbol{\Delta}\mathbf{P}$을 얻고 이는 model parameters $\mathbf{W}$에 더해진다.

$\boldsymbol{\Delta}_{\mathbf{AlphaEdit}}$은 이제 update돼야하는 knowledge를 저장할 뿐만아니라, 보존돼야할 knowledge와 이전에 update된 knowledge에 영향을 끼치지 않도록 보장한다. 더 나은 비교를 위해, 본 논문은 기존의 사용된 MEMIT의 solution을 다음과 같이 쓴다.

둘을 비교하면, 본 논문의 solution이 projection matrix $\mathbf{P}$을 통합함으로써 standard solution에 적은 수정만을 필요로 한다는 것을 보인다.

이는 본 논문의 method가 기존의 model editig algorithm들에 더 쉽게 통합되게 한다.

본 논문은 이 수정을 위해 단지 single line of code를 더함으로써 대부분의 editing method들의 performance가 상당히 강화된다.
게다가 projection matrix $\mathbf{P}$가 이제 update돼야하는 knowledge에 entirely independent하기 때문에, 한번만 계산되면 되고 어떠한 downstream editing task에 대해서도 바로 적용될 수 있다. 결국, AlphaEdit은 기존 baseline과 비교해서 negligible additional time을 도입해서 efficient하고 effective하다.
이번에도 실험과 appendix 부분은 생략...
Take Away
- Null space로의 projection이라... 이걸 내 연구에 어떻게 적용할 수 있을지 생각해봐야겠다.