Command Palette
Search for a command to run...
ALPHAEDIT: 언어 모델의 영공간 제약 지식 편집
ALPHAEDIT: 언어 모델의 영공간 제약 지식 편집
Junfeng Fang Houcheng Jiang Kun Wang Yunshan Ma Jie Shi Xiang Wang Xiangnan He Tat-Seng Chua
초록
대규모 언어 모델(LLM)은 부정확하거나 오래된 지식을 생성하는 환각 현상을 흔히 보인다. 이에 따라 특정 지식을 표적으로 갱신할 수 있는 모델 편집 기법이 등장하였다. 이 목적을 달성하기 위한 주된 패러다임은 위치 확인 후 편집(locating-then-editing) 방식으로, 먼저 영향력 있는 매개변수를 위치시킨 후 섭동을 가하여 편집하는 방식이다. 이 방법은 효과적이지만, 현재의 연구들은 이러한 섭동이 LLM 내부에 원래 보존된 지식을 필연적으로 훼손함을 보여주었으며, 특히 순차적 편집 상황에서 그 영향이 두드러진다. 이를 해결하기 위해, 본 연구는 AlphaEdit을 제안한다. AlphaEdit은 섭동을 보존된 지식의 영공간(null space)에 투영한 후 매개변수에 적용하는 새로운 해결책이다. 우리는 이 투영이 편집된 LLM의 출력이 보존된 지식에 대해 질의할 때 변경되지 않음을 이론적으로 증명하며, 이를 통해 지식 훼손 문제를 완화한다. LLaMA3, GPT2-XL, GPT-J를 포함한 다양한 LLM에 대한 광범위한 실험에서, AlphaEdit은 투영을 위한 한 줄의 추가 코드만으로 대부분의 위치 확인 후 편집 방식의 성능을 평균 36.7% 향상시킴을 확인하였다. 코드는 https://github.com/jianghoucheng/AlphaEdit에서 확인할 수 있다.
One-sentence Summary
Researchers from the University of Science and Technology of China and the National University of Singapore propose AlphaEdit, a method that projects parameter perturbations into the null space of preserved knowledge to prevent disruption during sequential LLM editing, theoretically guaranteeing unchanged outputs for preserved queries and boosting existing locating-then-editing methods by an average of 36.7%.
Key Contributions
- The paper introduces AlphaEdit, which projects parameter perturbations into the null space of preserved-knowledge key matrices before applying them to large language models, enabling targeted knowledge updates while reducing disruption to existing knowledge.
- The method provides a theoretical formulation showing that this null-space projection keeps outputs unchanged for queries about preserved knowledge while still permitting updates to edited knowledge, and the projection can be added with a single line of code.
- Experiments on LLaMA3, GPT2-XL, and GPT-J show that AlphaEdit improves most locating-then-editing methods by an average of 36.7%, demonstrating a practical gain in editing performance with preserved knowledge.
Introduction
Large language models can store and recall extensive knowledge, but they often produce stale or incorrect facts, and full fine-tuning is frequently too costly for resource-limited settings. Model-editing methods address this by updating specific stored knowledge with minimal changes, especially through parameter-modifying locate-then-edit approaches that adjust feed-forward layer weights. A key limitation is that prior methods struggle to balance updating target knowledge and preserving existing knowledge: aggressively minimizing update error can shift hidden representations, overfit to the new fact, and cause forgetting or model collapse during sequential edits. The authors introduce AlphaEdit, which removes the preserved-knowledge loss from the objective and projects the parameter update into the null space of preserved key matrices. This preserves the model’s hidden representation distribution while updating facts, and works as a simple plug-and-play enhancement that improved existing editing methods by an average of 36.7 percent.
Method
The authors present AlphaEdit as a projection-based model editing method. Its central idea is to constrain a parameter update to a subspace that is inactive on preserved knowledge, rather than balancing knowledge updating and knowledge preservation through separate loss terms. Let W denote the selected weight matrix to be edited, let (K0,V0) denote preserved key-value associations, and let (K1,V1) denote the current knowledge that should be updated.
The method begins with the definition of a left null space. A matrix B lies in the left null space of A if and only if
BA=0.If an additive perturbation Δ′ satisfies Δ′K0=0, then applying it to the original parameters gives
(W+Δ′)K0=WK0+Δ′K0=WK0=V0.Thus, the projected perturbation does not change the output associated with preserved knowledge. AlphaEdit therefore first constructs a projection matrix that maps candidate perturbations into the null space of the preserved knowledge before they are applied to the model.
Direct projection into the null space of K0 is expensive because K0 can have a very large number of columns. The authors instead use the null space of the covariance matrix K0K0T∈Rd0×d0, since this smaller matrix shares the same null space as K0 while being much cheaper to handle when d0 is much smaller than the number of preserved samples. They compute
{U,Λ,UT}=SVD(K0K0T),where the columns of U are eigenvectors of K0K0T. The eigenvectors corresponding to nonzero eigenvalues are removed, and the remaining submatrix U^ is used to define the projection matrix
P=U^U^T.This matrix maps the column vectors of a perturbation into the null space of K0. As a result, for a projected perturbation ΔP, the update preserves the original key-value association:
(W+ΔP)K0=WK0=V0.With this projection available, the authors modify the usual model editing objective. Instead of minimizing both the error on the knowledge being updated and the error on preserved knowledge, they replace the raw perturbation Δ~ with the projected perturbation Δ~P. Because the projection already guarantees preservation of K0, the explicit preservation term can be removed. They also add a regularization term ∥Δ~P∥2 to stabilize the solution, yielding
Δ=Δ~argmin(∥(W+Δ~P)K1−V1∥2+∥Δ~P∥2).For sequential editing, the method additionally protects knowledge that has already been updated by previous edits. Let (Kp,Vp) denote the previously updated key-value associations. The corresponding protection term is
∥(W+Δ~P)Kp−Vp∥2.Because previous edits have already made WKp=Vp, this term reduces to
∥Δ~PKp∥2.Therefore, the sequential editing objective becomes
Δ=Δ~argmin(∥(W+Δ~P)K1−V1∥2+∥Δ~P∥2+∥Δ~PKp∥2).The authors define the current edit residual as
R=V1−WK1.By solving the corresponding normal equation, they obtain a closed-form projected perturbation:
ΔAlphaEdit=RK1TP(KpKpTP+K1K1TP+I)−1.This update is designed to incorporate the current knowledge into the model while keeping both preserved knowledge and previously updated knowledge stable. The key difference from common closed-form editing solutions such as MEMIT is the insertion of the projection matrix P into the update pathway. For comparison, a standard unprojected solution has the form
ΔMEMIT=RK1T(KpKpT+K1K1T+K0K0T)−1.The AlphaEdit variant replaces the explicit preservation term with the projected null-space constraint. Refer to the framework diagram.
The projection matrix P depends only on preserved knowledge and not on the specific update being performed. Therefore, it can be computed once and reused across many editing operations. This makes the additional computational overhead small relative to existing editing pipelines. As shown in the figure below, this simple projection-oriented modification can lead to stronger editing performance while maintaining general capabilities in the evaluated settings.
Experiment
Experiments evaluate AlphaEdit on sequential knowledge editing, general capability retention, and hidden representation stability across multiple LLMs and editing baselines. Results show that AlphaEdit better balances knowledge update with knowledge preservation and fluency, while baseline methods often degrade general abilities and distort internal representations. The projection strategy also improves existing editing methods, indicating broad applicability and effectiveness.
AlphaEdit delivers the strongest overall results on sequential knowledge editing across multiple base models, with especially large gains in updating effectiveness and generalization. It also preserves generation quality better than existing approaches, improving fluency and consistency while avoiding the severe degradation seen in several baselines. These patterns suggest that better balancing knowledge updates with preservation is central to its advantage. AlphaEdit outperforms baselines across nearly all measured editing metrics and base models The method narrows the trade-off between editing effectiveness and generalization, with especially strong gains on LLaMA3 Several baselines lose generalization or consistency dramatically during sequential editing, while AlphaEdit maintains stronger overall retention
Experiments evaluate sequential knowledge editing across multiple base models and show that AlphaEdit achieves the strongest overall performance by improving update effectiveness and generalization while preserving generation quality. Compared with baselines, it better balances knowledge updates and preservation, with especially strong gains on LLaMA3. The results indicate that maintaining fluency and consistency is central to its advantage, whereas several baselines degrade sharply during sequential editing.