---
title: 'ATWU: Alternating Token-Weighted Unlearning'
url: https://www.emergentmind.com/topics/alternating-token-weighted-unlearning-atwu
type: topic
---

# ATWU: Alternating Token-Weighted Unlearning

Alternating Token-Weighted Unlearning (ATWU) is a framework for machine unlearning in autoregressive language models that treats token importance as a latent quantity to be learned jointly with model parameters during unlearning. Its central premise is that forget examples are internally heterogeneous: some tokens are forget-specific and encode the content to be removed, while others are structural tokens that support general language behavior and should not be suppressed indiscriminately. ATWU formalizes this distinction through the interaction between forget and retain objectives, and implements it with a lightweight linear scorer over hidden states trained in alternation with the language model itself, without external token-level supervision [2606.06320].

## 1. Retain conflict as the basis of forget-specificity

ATWU is formulated for an autoregressive language model \(\mathcal{M}_\theta\) with a forget set \(\mathcal{D}_F\) and a retain set \(\mathcal{D}_R\). The motivating observation is that a forget example may contain both answer-bearing tokens—such as names, dates, quantities, identifiers, and attribute-bearing phrases—and structural tokens such as function words, punctuation, and generic scaffolding. Uniformly applying a forget objective to all tokens can therefore remove target content while also degrading retained behavior and general language competence [2606.06320].

The framework makes this intuition precise by defining forget-specificity through retain conflict. Let the retain objective be
\[
R(\theta) \;\defeq\; \sum_{x \in \mathcal{D}_R}\sum_{t=1}^{|x|} \ell_{\mathrm{retain}}(x,t;\theta),
\qquad
R^\star \;\defeq\; \min_{\theta \in \Theta} R(\theta).
\]
For forget tokens, ATWU introduces weights \(z_{x,t}\in[0,1]\), intended to approximate the oracle indicator that a token is forget-specific. The token-weighted objective is
\[
\mathcal{L}(\theta,\mathbf{z}) \;=\; \sum_{x \in \mathcal{D}_R} \sum_{t=1}^{|x|} \ell_{\mathrm{retain}}(x,t;\theta)
\;+\;
\sum_{x \in \mathcal{D}_F} \sum_{t=1}^{|x|} z_{x,t}\,\ell_{\mathrm{forget}}(x,t;\theta).
\tag{1}
\]

The key quantity is the retain conflict of a subset of forget tokens. Writing \(\mathcal{I}_F\) for all forget-token positions and \(\ell^i_{\mathrm{forget}}(\theta)\) for the forget loss on token \(i\), the conflict of \(A\subseteq\mathcal{I}_F\) is
\[
\mathrm{conflict}(A) \coloneqq \min_{\theta \in \Theta}
\left[
R(\theta) - R^\star
+
\sum_{i\in A}\bigl(\ell^i_{\mathrm{forget}}(\theta)-\ell_{\mathrm{forget}}^{\min}\bigr)
\right],
\tag{2}
\]
where
\[
\ell_{\mathrm{forget}}^{\min} \coloneqq \min_{\theta,i} \ell^i_{\mathrm{forget}}(\theta).
\]
A token with small singleton conflict can be forgotten while staying close to the retain optimum; a token with large conflict behaves structurally. This shifts token selection away from probability heuristics and toward a criterion defined by the retain–forget trade-off itself [2606.06320].

## 2. Oracle support recovery and relaxed token selection

ATWU introduces a separation condition under which the true forget-specific support is identifiable. The forget-token index set \(\mathcal{I}_F\) is partitioned into \(\mathcal{F}^\star\cup\mathcal{S}^\star\), with oracle labels
\[
z_i^\star = \mathbf{1}_{\{i\in \mathcal{F}^\star\}},
\]
such that
\[
\mathrm{conflict}(\mathcal{F}^\star)\le \varepsilon
\qquad\text{and}\qquad
\mathrm{conflict}_i \ge \varepsilon+\delta
\quad \forall i\in \mathcal{S}^\star,
\tag{3}
\]
for some \(\varepsilon\ge 0\) and \(\delta>0\). Under this retain-conflict separation condition, the exact support-learning problem is
\[
\min_{\theta \in \Theta,\;\mathbf{z}\in \mathcal{Z}} \mathcal{L}(\theta,\mathbf{z}),
\qquad
\mathcal{Z}\defeq
\left\{
\mathbf{z}\in \{0,1\}^{N_F}:
\sum_{i\in \mathcal{I}_F} z_i = \rho N_F
\right\},
\tag{4}
\]
where \(\rho\) is a token budget. The hard budget prevents the trivial all-zero and all-one selectors [2606.06320].

The recovery theorem states that, if \(0<\rho\le \rho^\star\) and \(\rho N_F\) is an integer, then any global minimizer \((\hat{\theta},\hat{\mathbf{z}})\) satisfies
\[
\mathrm{supp}(\hat{\mathbf{z}})\subseteq \mathcal{F}^\star.
\]
If \(\rho=\rho^\star\), then
\[
\mathrm{supp}(\hat{\mathbf{z}})=\mathcal{F}^\star
\quad\text{and}\quad
\hat{\theta}=\theta^\star.
\]
In the paper’s interpretation, the joint objective can therefore recover the oracle forget-specific token support under a natural separation condition [2606.06320].

Because discrete optimization over \(\mathbf{z}\) is combinatorial, ATWU also uses a continuous surrogate:
\[
\widetilde{\mathcal{L}}(\theta,\mathbf{z}) =
\mathcal{L}(\theta,\mathbf{z})
+
\lambda_H \sum_{z_{x,t}\in \mathbf{z}} H(z_{x,t})
+
\lambda_{\rho} \left( \frac{1}{N_F}\sum_{z_{x,t}\in \mathbf{z}} z_{x,t} - \rho \right)^2,
\tag{5}
\]
with binary entropy
\[
H(z)=-z\log z -(1-z)\log(1-z).
\]
The entropy term encourages near-binary token decisions, while the budget penalty keeps the average selected-token mass near \(\rho\) [2606.06320].

## 3. Scorer parameterization and the practical ATWU objective

The practical ATWU method replaces free token variables by a shared scorer over token representations. Let \(\mathbf{h}_\theta(x_t)\in\mathbb{R}^d\) be the hidden representation for token \(x_t\). ATWU uses a linear scoring head
\[
a_{x,t} = g_{\mathbf{w}}(\mathbf{h}_\theta(x_t))
=
\sigma\!\left(\langle \mathbf{w}, \mathbf{h}_\theta(x_t)\rangle\right)\in(0,1),
\tag{6}
\]
where \(\mathbf{w}\in\mathbb{R}^d\) is initialized at
\[
\mathbf{w}=\mathbf{0}_d.
\]
This makes all initial token scores equal to \(0.5\), so training begins without token preference and becomes selective only through optimization [2606.06320].

On the forget side, ATWU adopts saturated negative cross-entropy rather than raw gradient ascent. For \(\beta>0\),
\[
\ell_{\mathrm{forget}}(x,t;\theta)
\;\defeq\;
p_\theta(x_t\mid x_{<t})^{\beta}\cdot \ell_{\mathrm{GA}}(x,t;\theta),
\tag{7}
\]
where \(\ell_{\mathrm{GA}}\) is negative cross-entropy. The saturation factor bounds the forget loss below and stabilizes updates. The paper refers to this as SatGA [2606.06320].

The empirical ATWU objective further injects the learned score into both the multiplicative weight and the saturation exponent, producing SatGA\(^+\):
\[
\begin{aligned}
\mathcal{L}_{\mathrm{ATWU}}(\theta,\mathbf{w})
&=
\alpha\, R(\theta)
+
\gamma \sum_{x,t}
g_{\mathbf{w}}(x_t)\cdot
p_\theta(x_t\mid x_{<t})^{\beta\, g_{\mathbf{w}}(x_t)}
\cdot
\ell_{\mathrm{GA}}(x,t;\theta)
\\
&\quad
+
\lambda_H \sum_{x,t} H\!\bigl(g_{\mathbf{w}}(x_t)\bigr)
+
\lambda_{\rho}
\left(
\frac{1}{N_F}\sum_{x,t} g_{\mathbf{w}}(x_t)-\rho
\right)^2.
\end{aligned}
\tag{8}
\]
Here \(g_{\mathbf{w}}(x_t)\) abbreviates \(g_{\mathbf{w}}(\mathbf{h}_\theta(x_t))\). For binary scores, SatGA\(^+\) reduces to standard SatGA. The added exponent modulation attenuates uncertain token updates early in training, before the scorer has converged [2606.06320].

## 4. Alternating optimization and training dynamics

ATWU alternates between updating the language model parameters \(\theta\) and the scorer parameters \(\mathbf{w}\). The rationale is that the scorer determines which tokens receive forget pressure, while the model determines the hidden-state geometry on which the scorer operates. Simultaneous lockstep updates can therefore create an unstable feedback loop [2606.06320].

The procedure is as follows. The scorer is initialized at \(\mathbf{w}=0\). Hidden states are computed for forget tokens under the current model, and scores are assigned by
\[
g_{\mathbf{w}}(\mathbf{h}_\theta(x_t))
=
\sigma(\mathbf{w}^\top \mathbf{h}_\theta(x_t)).
\]
In the model step, \(\mathbf{w}\) is fixed and token scores are detached, so they act as fixed coefficients while \(\theta\) is updated using the retain loss and current token-weighted forget loss. In the scorer step, \(\theta\) is frozen and gradients flow only through \(\mathbf{w}\). The method then repeats these two updates rather than jointly co-updating all parameters [2606.06320].

The update schedule is empirically important. The appendix reports that refreshing the scorer every step performs poorly; the headline setting refreshes it every \(n_s=5\) model steps, and \(n_s=10\) is also competitive. Joint lockstep updates are clearly worse. The same ablations report that the population or budget penalty is the dominant regularizer: without it, the scorer remains near-uniform and forgetting remains weak, while entropy and \(\ell_2\) regularization provide further gains [2606.06320].

ATWU is deliberately lightweight. The scorer is a single linear layer over hidden states; the core method uses no auxiliary model, no external token annotations, and no hand-designed token heuristics. At inference time there is no additional machinery beyond the unlearned language model itself. A converged scorer from a previous ATWU run can be frozen and reused successfully, but a scorer trained only on the original memorized model performs poorly, even if later unfrozen; the scorer must track the unlearning trajectory rather than the initial checkpoint alone [2606.06320].

## 5. Empirical performance and learned token semantics

ATWU is evaluated on TOFU and RWKU. On TOFU, the headline setting is forget10 with Llama-3.1-8B-Instruct; on RWKU, the main setting is the canonical 10-subject batch with Phi-3-Mini-4k-Instruct. The main reported trade-off metrics are Forget Quality (\(\mathrm{FQ}\)), Retain Degradation (\(\mathrm{RD}\)), and
\[
\mathrm{UQ} = [\mathrm{FQ} - \mathrm{RD}]_+.
\]
Utility probes include MMLU, repetitiveness, and win rate against the original checkpoint [2606.06320].

On TOFU forget10 with Llama-3.1-8B-Instruct, ATWU reports
\[
\mathrm{FQ}=95.2,\qquad \mathrm{RD}=3.5,\qquad \mathrm{UQ}=91.7.
\]
The paper compares this with RMU at \(\mathrm{UQ}=85.9\), JensUn at \(\mathrm{UQ}=88.3\) but with severe utility collapse, SatImp at \(\mathrm{UQ}=75.6\), WGA at \(\mathrm{UQ}=62.1\), and SimNPO at \(\mathrm{UQ}=62.8\). On RWKU, ATWU reports
\[
\mathrm{FQ}=81.4,\qquad \mathrm{RD}=22.7,\qquad \mathrm{UQ}=58.7,
\]
exceeding WGA at \(51.9\), JensUn at \(49.3\), SatImp at \(48.0\), and GradDiff at \(45.2\) [2606.06320].

The framework is not tied to a single forget loss. On RWKU, adding the ATWU scorer to existing objectives improves unlearning quality over the corresponding unweighted methods by \(+6.4\) for DPO, \(+10.4\) for NPO, and \(+15.7\) for SimNPO, although the best overall result remains the SatGA\(^+\)-based ATWU configuration at \(\mathrm{UQ}=58.7\) [2606.06320].

ATWU also evaluates the quality of its token scores directly. Using ground-truth forget-span labels on TOFU, it ranks tokens by score and computes per-sample AUROC. The reported mean AUROC is \(75 \pm 9\), compared with roughly \(54\)–\(63\) for auxiliary-model baselines and around \(67\)–\(68\) for the strongest heuristic baselines. Qualitative examples show the scorer emphasizing names, professions, named entities, and factual attribute tokens while downweighting sentence-template material such as “The author’s name is …” [2606.06320].

The ablations further separate token scoring from forget-loss design. On TOFU forget10 with Llama-3.2-1B, the paper reports \(\mathrm{UQ}=39.5\) for ground-truth labels with GA, \(86.2\) for ground-truth labels with SatGA, \(58.5\) for ATWU scores with SatGA, and \(78.1\) for ATWU scores with SatGA\(^+\). The implication is that good token scores alone are insufficient if the forget loss is brittle, and that the score-modulated saturation design is materially important [2606.06320].

## 6. Relation to adjacent methods and principal limitations

ATWU belongs to a broader family of token-aware unlearning methods, but it is distinguished by how it defines token importance. Direct Token Optimization partitions forget sequences into target and non-target tokens using a perturbation-based delta-score and alternates forget ascent with KL-based utility preservation, but its token weighting is a binary top-\(k\) mask rather than learned continuous weights [2510.00125]. TokenUnlearn provides hard selection and soft weighting from masking and entropy signals and recomputes scores online, but it does not formalize an explicit alternating outer loop between score learning and model updates [2605.00364]. Entropy-guided Token Weighting uses predictive entropy as a proxy for token informativeness in a single-stage weighted optimization, not an alternating one [2604.17785]. CATNIP tokenizes negative preference alignment and scales token forgetting by model confidence, again without an explicit alternating schedule [2602.02824]. In multimodal settings, ViKeR regularizes unlearning with visually estimated token distributions and induces token-level gradient reweighting, but it uses a unified loss rather than alternating optimization [2601.22020]. ALTER uses a two-phase asymmetric LoRA architecture with entropy-guided routing and parameter isolation, yet it is staged rather than explicitly token-weighted and alternating in the ATWU sense [2603.01792].

Against this background, ATWU’s distinctive claim is that token importance should be identified by compatibility with retain optimality rather than by token probability, entropy, surprisal, external linguistic parsers, or auxiliary-model disagreement alone [2606.06320]. This makes retain conflict both the conceptual criterion and the supervisory signal for the scorer.

The paper also states clear limitations. Gains are weaker on very small forget sets, where the scorer may not receive enough signal. The budget hyperparameter \(\rho\) remains user-specified. The theory assumes an approximate structural-versus-forget-specific separation that real language may not satisfy cleanly. There is also a theory–practice gap: the formal recovery results are proved for the multiplicative token-weighted formulation, while the main empirical objective SatGA\(^+\) additionally places the score in the saturation exponent. Finally, the evaluations cover two benchmarks and rely on judge-based semantic evaluation, although the paper reports high agreement with humans [2606.06320].

A plausible implication is that ATWU defines a general design pattern rather than a terminal formulation. Its scorer–model alternation can be combined with other token signals, other forget losses, or multimodal token sources, but those extensions are not part of the method as published. Within the current literature, its main contribution is to turn token forget-specificity from a heuristic into a learned quantity grounded in the retain–forget trade-off itself [2606.06320].

Source: https://www.emergentmind.com/topics/alternating-token-weighted-unlearning-atwu