---
title: AGO Loss for Fine-Grained Unlearning
url: https://www.emergentmind.com/topics/activation-guided-orthogonal-ago-loss
type: topic
---

# AGO Loss for Fine-Grained Unlearning

The Activation-Guided Orthogonal (AGO) Loss is a central mechanism for fine-grained machine unlearning introduced in the FALCON framework—Fine-grained Activation manipuLation by Contrastive Orthogonal uNalignment—for large language models (LLMs). Designed to address safety concerns arising from the inadvertent encoding of sensitive or harmful information, AGO Loss departs from prior coarse-grained approaches by operating at the resolution of individual network layers identified through mutual-information metrics. AGO Loss orchestrates the delicate balance between effective removal (unlearning) of targeted knowledge and rigid preservation of essential retained knowledge by integrating representation-guided parameter selection, contrastive gradient signals, and a principled orthogonalization of conflicting objectives in optimization [2502.01472].

## 1. Formal Definition of AGO Loss

AGO Loss operates at a single, strategically selected layer $l^*$, parameterized by $\theta^{l^*}$. Rather than minimizing a naive weighted sum of two competing objectives—contrastive unalignment loss for the “forget” set ($\mathcal{L}_F$) and retention alignment loss for the “retain” set ($\mathcal{L}_R$)—AGO Loss interleaves their opposing gradients using orthogonal projection to approximate Pareto-optimal model updates. The update direction for $\theta^{l^*}$ is given by:
$$
\nabla \theta^{l^*} = \alpha \cdot \mathrm{Proj}_{\perp \nabla \mathcal{L}_R} (\nabla \mathcal{L}_F) + \beta \cdot \nabla \mathcal{L}_R
$$
where $\mathrm{Proj}_{\perp \nabla \mathcal{L}_R} (\nabla \mathcal{L}_F)$ projects the unlearning gradient orthogonally to the retention gradient when their cosine similarity is negative, suppressing destructive interference [2502.01472, Eqn. (1)]. Scalars $\alpha$ and $\beta$ weight unlearning and retention, respectively, and are dynamically adjusted to favor retention under high conflict.

## 2. Activation-Based Parameter Selection

AGO Loss is fundamentally layer-local. FALCON first identifies the “least-entangled” layer by computing mutual information (MI) between activation distributions of the forget and retain sets at each layer $l$. Explicitly, let $F^{(l)}$ and $R^{(l)}$ denote activations for the forget and retain sets. Entropies $H(F^{(l)})$, $H(R^{(l)})$, and joint entropy $H(F^{(l)},R^{(l)})$ are estimated by kernel density estimation (KDE) with a Gaussian kernel and dimensionality reduction via PCA (retaining 95% variance). MI is calculated as:
$$
I^{(l)} = H(F^{(l)}) + H(R^{(l)}) - H(F^{(l)}, R^{(l)})
$$
The target layer $l^*$ for AGO Loss optimization is selected by minimizing $I^{(l)}$ across layers:
$$
l^* = \arg\min_{l} I^{(l)}
$$
Empirically, early layers usually exhibit minimal MI, indicating greater disentanglement between forget and retain knowledge. This selective focus enables “surgical” parameter updates with reduced collateral utility degradation [2502.01472].

## 3. Contrastive Unalignment and Retention Terms

### Contrastive Unalignment Loss ($\mathcal{L}_F$)

At the identified layer $l^*$, AGO Loss employs a contrastive mechanism to enforce separation between updated forget-set activations and their original principal subspaces. For each batch:
- Obtain forget activations from the updated model ($H^u$) and from a frozen reference model ($H^f$).
- Extract top-$K$ principal directions via SVD of $H^f$ ($H^f = U \Sigma V^\top$, $v_1,...,v_K$ columns of $V$).
- Generate a “principal offset” vector $H^+$ by pushing a random seed away from these subspaces:
  $$
  H^+ = f\left(r \cdot (I - w\sum_{i=1}^K v_i v_i^\top), \epsilon\right)
  $$
  where $w$ controls offset magnitude, $\epsilon$ is optional noise, and $f(\cdot)$ is a projection or nonlinearity.
- Compute cosine similarities between anchor (updated activation), positive (offset), and negatives (other frozen forget activations). The loss uses InfoNCE:
  $$
  \mathcal{L}_F = -\frac{1}{B}\sum_{i=1}^{B}\left|\log \frac{\exp(S^+_i/T)}{\exp(S^+_i/T)+\sum_{k=1}^Z \exp(S^-_{i,k}/T)}\right|
  $$
  with temperature $T$ empirically set to $0.7$ [2502.01472, Eqn. (7)].

### Retention Alignment Loss ($\mathcal{L}_R$)

To preserve retained knowledge, AGO Loss imposes a cosine alignment constraint between updated and frozen retain-set activations:
$$
\mathcal{L}_R = 1 - \frac{1}{B}\sum_{i=1}^B \frac{H^u_i \cdot H^f_i}{\|H^u_i\| \|H^f_i\|}
$$
This self-supervised retention term curtails drift on the retain set [2502.01472, Eqn. (8)].

## 4. Orthogonal Projection and Gradient Conflict Resolution

The competing objectives inherent in machine unlearning—maximal forgetting while retaining existing utility—can manifest as conflicting gradients during joint optimization. AGO Loss explicitly identifies and mitigates such conflict:
- Gradients of $\mathcal{L}_F$ ($g_F$) and $\mathcal{L}_R$ ($g_R$) are computed at $\theta^{l^*}$.
- The cosine similarity $\cos(g_F,g_R) = \frac{g_F\cdot g_R}{\|g_F\|\|g_R\|}$ flags potential conflict (negative value).
- If a conflict is detected ($\cos < 0$), the unlearning gradient is projected onto the orthogonal complement of the retention gradient:
  $$
  g_F^\perp = g_F - \frac{g_F\cdot g_R}{\|g_R\|^2} g_R
  $$
- The final update is a weighted sum:
  $$
  g_{\text{AGO}} = \alpha g_F^{\perp} + \beta g_R
  $$
  with $\alpha,\beta$ chosen as $(0.8,1.2)$ when $\cos\geq 0$ and $(0.2,1.8)$ when $\cos<0$, prioritizing retention in the event of strong conflict [2502.01472, Eqns. (10)-(11)].

## 5. Integration in FALCON Framework and Training Procedure

AGO Loss is integrated within FALCON’s end-to-end unlearning regime as follows:
- For every layer $l$, mutual information $I^{(l)}$ is computed via KDE and PCA on forget and retain set activations.
- The minimal-$I^{(l)}$ layer $l^*$ is selected, all other parameters are frozen.
- Updates are performed solely on $\theta^{l^*}$ using a second-order optimizer (e.g., Sophia with $\eta\approx 10^{-4}$).
- Each step: batch forget/retain examples, compute respective activations, evaluate $\mathcal{L}_F$ (via SVD and InfoNCE), evaluate $\mathcal{L}_R$, compute and project gradients as necessary, and apply the update.
- Hyperparameters include $B=1$ (for question answering tasks), $S=1000$ total update steps, $K=5$ principal vectors, and standard Sophia optimizer settings [2502.01472].

## 6. Empirical Evaluation and Observed Effects

AGO Loss has been benchmarked on Zephyr-7B-Beta, Yi-6B-Chat, and Mistral-7B-Instruct LLMs. WMDP unlearning metrics (bio-score, cyber-score) drop substantially after AGO—e.g., for Zephyr-7B-Beta, bio-score decreases from $63.7\%$ to $26.7\%$—while held-out accuracy (MMLU) and perplexity (PPL) decrease by less than $2\%$ ($58.1\%$ MMLU, $1.5$ PPL remain). Gradient conflict analysis confirms lower interference for MI-selected layers, and knowledge recovery attacks (e.g., Enhanced GCG, $2000$ steps) recover less than $1\%$ of erased information. Ablative experiments show that omitting any AGO Loss component—contrastive unalignment, gradient projection, or principal-offset vectors—yields diminished unlearning or excessive utility loss [2502.01472, Table 2-3].

## 7. Significance and Conceptual Implications

AGO Loss establishes a layer-local, representation-guided approach to machine unlearning that explicitly addresses the antagonism between forgetting and retention. Activation-space MI guidance confines edits to minimally entangled regions, contrastive unalignment systematically expels unwanted knowledge, and the orthogonalization scheme operationalizes a local Pareto-front compromise. The empirical results from FALCON demonstrate that AGO Loss delivers principled, robust, and efficient machine unlearning, suggesting that representation-aware, gradient-level conflict resolution may have broader implications for multi-objective optimization within neural networks [2502.01472].

Source: https://www.emergentmind.com/topics/activation-guided-orthogonal-ago-loss