GeoEdit: Geometric Knowledge Editing for Large Language Models

Yujie Feng, Liming Zhan, Zexin Lu, Yongxin Xu, Xu Chu, Yasha Wang, Jiannong Cao, Philip S. Yu, Xiao-Ming Wu

TL;DR

GeoEdit is a new framework for updating knowledge in Large Language Models (LLMs) that uses the geometric relationships of parameter updates to decide how to edit individual neurons. By analyzing the angle between "knowledge retention" and "knowledge updating" directions, it selectively incorporates new facts while aggressively protecting the model's general reasoning abilities, outperforming previous fine-tuning-based editing methods.

What Problem Does This Paper Address?

LLMs are not static; the world changes (e.g., the U.S. President changes), and models need updates. However, traditional fine-tuning often leads to "catastrophic forgetting" or degrades the model's performance on unrelated tasks—a property called Locality.

Existing "locate-and-edit" methods (like ROME or MEMIT) are computationally expensive and often require massive external datasets (like Wikipedia) to act as a "guardrail" for general knowledge. On the other hand, training-based methods like F-Learning ("Forgetting before Learning") assume all new knowledge conflicts with the old, leading to an over-aggressive forgetting process that harms the model's generalization. GeoEdit seeks a middle ground: a fine-tuning approach that is efficient, precise, and doesn't require external data to maintain model integrity.

Methods

GeoEdit follows a three-step geometric pipeline to refine how updates are applied to the model:

  1. Neuron-level Task Vector Extraction: Instead of looking at the whole model, GeoEdit calculates "task vectors" ($\tau$)—the difference between original and fine-tuned parameters—for every individual neuron. It generates two vectors: $\tau_{old}$ (representing the direction to retain old knowledge) and $\tau_{new}$ (the direction to learn new knowledge).
  2. Dimensionality Reduction for Angular Accuracy: In high-dimensional spaces, vectors tend to be naturally orthogonal, making angle calculations unreliable. GeoEdit uses a semantic Auto-Encoder (AE) to extract meaningful features, followed by t-SNE to project these into a 2D space where angular relationships can be accurately measured.
  3. Direction-aware Editing Strategies: Based on the angle ($\phi$) between the two vectors, neurons are classified and treated differently:
  4. Orthogonal ($\phi \approx 90^\circ$): These neurons are deemed related to general knowledge perturbations. GeoEdit masks these updates entirely to preserve generalization.
  5. Aligned (Acute angle): These are "Synergistic" updates where old and new knowledge are similar. GeoEdit integrates both.
  6. Opposite (Obtuse angle): These are "Conflicting" updates. Here, the model applies a "forget-then-learn" strategy.
  7. Importance-guided Fusion: Finally, it applies an adaptive weighting mechanism based on the magnitude of the gradient-weight product, ensuring that only the most "important" parameters within a neuron are updated, further filtering out noise.
Figure 2: Overview of GeoEdit. Step (a): Neuron-level task vectors τold and τnew are extracted for both the old and new knowledge datasets using parametric arithmetic. Step (b): An auto-encoder is trained to project a low-dimensional representation of the task vectors, eliminating the angular bias issue in high-dimensional space. Step (c): The latent task vectors, hnew and hold, are reduced to two dimensions using t-SNE to compute the angular relationships, which are used to classify neurons based on the angle. Finally, after applying different editing strategies, we obtain the edited vector τedit, which is added to the initial model to generate the edited model fθe.

Datasets

The authors evaluated GeoEdit on two standard model-editing benchmarks:

  • ZsRE (Zero-Shot Relation Extraction): A QA dataset where facts are modified (e.g., changing a person's birthplace).
  • COUNTERFACT: A more difficult dataset involving counterfactual facts designed to test if a model truly "understands" the edit or is just memorizing a string.

The experiments were conducted using LLaMA-7B and LLaMA2-7B as base models.

Key Insights and Ideas

  • The Geometry of Knowledge: The core "aha moment" is that not all parameter updates are created equal. By looking at the direction of an update relative to what the model already knows, we can distinguish between "learning a new fact" and "accidentally breaking a general reasoning circuit."
  • Overcoming the Curse of Dimensionality: Raw task vectors in 4096-dimensional space are almost always orthogonal. The use of an Auto-Encoder to "denoise" these vectors before calculating angles is critical for making geometric editing work in practice. (See Figure 3).
  • Complementarity: Because GeoEdit targets different parameter regions (like attention layers) compared to locate-and-edit methods (which usually target MLP layers), the two can be combined. A hybrid approach, GeoEdit*, achieved the best overall performance in the study.
Figure 3: Distribution of the angles ϕ between task vectors before and after dimensionality reduction.

Key Results

  • Locality Boost: GeoEdit improved the Locality metric (the ability to not break unrelated knowledge) by 7.4% over the previous best fine-tuning method, F-Learning.
  • Reliability and Generality: It maintained or improved scores in Reliability (accuracy on the new fact) and Generality (accuracy on rephrased versions of the new fact) across both LLaMA models.
  • Efficiency: Editing time is comparable to standard fine-tuning and significantly faster than F-Learning because it enables parallel acquisition of old and new knowledge directions rather than a sequential two-stage process.

Limitations and Future Work

  • Data Dependency: GeoEdit currently requires access to the "old knowledge" dataset to calculate the retention direction ($\tau_{old}$). In some real-world scenarios, this data might not be available.
  • Geometric Variables: The current model relies primarily on the angle between vectors. The authors suggest that incorporating other geometric features, such as vector projections and magnitudes, could further refine the editing process.
  • Generalization Loss: While significantly better than baselines, there is still some minor loss in model generalization, indicating that knowledge is not yet perfectly decoupled in LLM parameter space.

Summary updated

BibTeX
@inproceedings{feng2025geoedit,
  author = {Yujie Feng and Liming Zhan and Zexin Lu and Yongxin Xu and Xu Chu and Yasha Wang and Jiannong Cao and Philip S. Yu and Xiao-Ming Wu},
  title = {{GeoEdit: Geometric Knowledge Editing for Large Language Models}},
  booktitle = {KnowFM @ ACL},
  year = {2025},
  url = {https://openreview.net/forum?id=dTd08hRBE7},
}
Figure