Manuscript Offprint
arXiv:2608.23034STU: Stateful Test-Time Unlearning via Restricted Knowledge Boundary Control
Abstract
Controlling restricted knowledge in large language models is essential for model alignment and safe deployment. Test-time unlearning avoids costly retraining and parameter updates by intervening only during inference. However, existing activation-editing methods apply isolated pointwise corrections, overlooking how autoregressive generation continually reconstructs hidden states from the prompt, cache, and generated prefix. Consequently, later states may return to restricted knowledge regions after a locally successful correction, causing restricted knowledge re-entry. In this work, we propose Stateful Test-Time Unlearning via restricted knowledge boundary control (ST U), which formulates test-time unlearning as trajectory-wide boundary control. ST U first models restricted knowledge boundaries in low-dimensional invertible coordinates while leaving orthogonal non-target components unchanged. During inference, ST U monitors risk along the trajectory, applies minimal boundary corrections with contextual anchoring, and propagates historical correction states across tokens to mitigate knowledge re-entry. This trajectory-wide control enables more persistent forgetting while preserving non-target capabilities and limiting inference overhead. Across three benchmarks and three model families, ST U delivers the strongest overall balance, combining best or second-best retention with competitive forgetting and substantially less restricted-knowledge re-entry than test-time baselines (13.76%–19.84% versus 46.50%–59.10%).
Introduction
Machine unlearning aims to remove knowledge associated with designated data or concepts from a model while preserving utility on non-target inputs and downstream tasks (Zhao et al. 2025b; Geng et al. 2025; Ranjan et al. 2026). For large language models (LLMs), this is critical because large-scale pretraining and fine-tuning corpora may contain sensitive information (Li et al. 2024), private information (Ramakrishna et al. 2025), or copyrighted content (Shi et al. 2025) requiring post-training suppression or removal (Hu et al. 2025). Ideally, an unlearned model should approximate one retrained without the target data while retaining general language understanding and reasoning capabilities (Gong et al. 2026). Yet retraining LLMs is prohibitively expensive, and repeated parameter updates can also degrade overall model utility (Yu et al. 2025). Practical methods therefore seek retraining-like forgetting at substantially lower cost (Zhang et al. 2025).
Who are Jaime Vasquez's parents and what are their professions?
Model with Memorization

Target Region
Single
Intervention
Benign
Region
later tokens
drift back
Target Region
Output: Jaime was born to a noted chef father, Lorenzo Vasquez, and ...
Restricted Knowledge Re-entry
Output: Jaime was born...
I can’t provide details about..
...however, his father,
Lorenzo Vasquez, was a
noted chef, and his mother
was Sophia Vasquez
Figure 1: Example of restricted knowledge re-entry during decoding. A locally effective intervention initially yields a safe high-level explanation, but later decoding returns to the restricted topic and produces harmful details.
Training-time approximate unlearning remains computationally expensive (Zhao et al. 2025a) and can impair retained utility (Wang et al. 2026b). Test-time unlearning instead freezes model parameters and intervenes during inference through prompt control (Liu et al. 2024; Wang et al. 2026a), token-distribution adjustment (Liu et al. 2025; Xu et al. 2025a), or activation editing (Shen et al. 2026; Li et al. 2026). Yet decoding and activation based methods usually apply isolated corrections at individual decoding positions, without modeling whether those effects persist throughout generation as the autoregressive context evolves.
We identify an overlooked failure mode in test-time unlearning caused by the lack of temporal persistence in pointwise test-time control. At each decoding step, autoregressive generation constructs a new hidden state from the prompt, cached context, and generated prefix. A local edit may correct the current state but imposes no constraint on the subsequent trajectory. As shown in Fig. 1, later states can therefore return to regions that support restricted generation even after a locally successful intervention. We call this within-response failure restricted knowledge re-entry.
Existing test-time unlearning objectives mainly assess suppression at individual inputs, outputs, or intervention steps (Tutek et al. 2025; Zhao et al. 2025a; Wang et al. 2025). They do not require corrections to remain effective across decoding. We therefore formulate stateful test-time unlearning as online control of the hidden-state trajectory. The controller minimizes hidden-state perturbation at each step while keeping risk below the restricted knowledge boundary. The risk constraint enforces forgetting, while minimum perturbation preserves retained knowledge. Persistent test-time unlearning thus requires trajectory-wide risk control across tokens rather than independent pointwise corrections.
To address this problem, inspired by fixed-dimensional recurrent state modules (Pan et al. 2026), we propose Stateful Test-Time Unlearning via restricted knowledge boundary control (ST U), a stateful trajectory-control framework for frozen LLMs. Restricted Knowledge Geometry maps target-related activations into low-dimensional invertible coordinates, estimates a continuous risk boundary by density ratio, and preserves the orthogonal complement. It also provides contextual sanitized references. Stateful Boundary Control monitors risk along generation, moves risky states below the boundary through normal descent, and anchors corrections to context-compatible references to limit semantic drift. A fixed-dimensional state summarizes previous corrections and acts only within the tangent space of the current boundary, maintaining temporal consistency without opposing risk reduction. Together, these components replace isolated hidden-state edits with trajectory-wide, context-aware control.
Across three benchmarks, ST U achieves leading overall trade-offs, with 80.6–87.9% forgetting rates while preserving 90.7% non-target capabilities on average. It limits restricted-knowledge re-entry to 13.76–19.84%, versus 46.50–59.10% for leading test-time baselines. Our contributions are:
• We construct a restricted knowledge risk geometry that represents contextual trajectories in invertible low-dimensional coordinates while preserving activation components orthogonal to the target knowledge.
• We propose ST U, which combines normal–tangential boundary control, contextual anchoring, and a fixed-dimensional correction state to control hidden-state trajectories throughout generation.
• We validate ST U across WMDP, RWKU, and MUSE-Books, demonstrating sota forgetting/retention trade-offs, substantially lower restricted knowledge re-entry rates, and stable effectiveness across diverse model families.
Test-Time Unlearning Test-time unlearning methods operate through input, agentic, decoding, and activation interfaces. SPUL (Bhaila, Van, and Wu 2025) learns soft prompts that induce forgetting at the input, while ALU (Sanyal and Mandal 2025) coordinates specialized agents to process unlearning requests. During decoding, SEGUE (Pu et al. 2026) detects forget-related queries and suppresses factual units through entropy-guided decoding. Activation-based methods directly edit hidden representations through static (Li, Chen, and Ding 2026), input-conditioned (Lee, Liu, and Xiong 2026; Sun et al. 2026), or nonlinear steering (Liang et al. 2026). Despite their selectivity, decoding and activation controls remain position-wise and do not explicitly model successive corrections as a controlled trajectory.
Taken together, existing test-time methods control a query, token distribution, or current activation, but do not explicitly model restricted knowledge risk over the evolving hidden-state trajectory. Their interventions may be locally selective, yet remain independent across decoding steps and carry no correction history. ST U targets this missing temporal coupling by treating test-time unlearning as stateful trajectory control rather than a sequence of isolated corrections.
Observation and Problem Formulation
Restricted Knowledge Re-entry
Let the frozen LLM be . Given a prompt , the model autoregressively generates future tokens . At position , let be the pre-control hidden state at layer and its controlled counterpart. We consider a task-specific forget set for targeted unlearning.
A stateless pointwise editor corrects only the current violating state and retains no information about earlier corrections. Because later states are constructed from the prompt, cache, and generated prefix, local feasibility does not imply that subsequent states remain below the restricted knowledge boundary, as illustrated in Fig. 2. We define this recurrence as restricted knowledge re-entry:
Here, assigns a continuous restricted knowledge risk and is its threshold. Eq. 1 compares a feasible post-control state at with a later pre-control state at . Re-entry therefore denotes a renewed violation before the controller acts at , rather than failure to correct that state. Stateful test-time unlearning should restore every violating state while using past corrections to reduce later violations.
Stateful Test-Time Unlearning
With frozen, let denote the pre-control state induced by the generation history and earlier corrections. We seek minimum corrections that keep every controlled prefill and decoding state outside the risk region:
(a) A local closure need not persist trajectory probe: 120 cases, L18/L20/L22

(b) Stateful control prevents re-entry Re-entry: 1,200 cases, L26/L29/L30
Figure 2: Empirical characterization of restricted knowledge re-entry. Panel (a) illustrates that local closure after knowledge unlearning does not persist throughout generation, while panel (b) quantifies the re-entry and verification rates across intervention strategies. We treat generations without an observed re-entry event as right-censored.
(2)
The post-control state is . Its dependence on earlier corrections couples the per-position constraints along the generated trajectory. During decoding, this dependence is mediated by the controlled generation history. Batched prefill computes transformer activations in parallel, so approximates the causal dependence by scanning prompt positions to propagate its controller state without recomputing later prefill activations. Eq. 2 expresses forgetting through the risk constraint and retention through minimum perturbation. Our controller restricts each correction to a learned subspace of normalized activations and provides a tractable local surrogate for this trajectory objective. We target deployment-time suppression of target-knowledge access and expression, not parameter-level data deletion.
ST U: Stateful Boundary Control for Test-Time Knowledge Unlearning
ST U comprises two components (shows in Fig. 3). Restricted Knowledge Geometry (RKG) constructs a task-specific, low-dimensional risk geometry from paired restricted and sanitized trajectories before deployment. Stateful Boundary Control (SBC) monitors this geometry during inference and summarizes accepted correction directions in a fixed-dimensional state , where .
Restricted Knowledge Geometry Modeling
Paired contextual trajectories. For each restricted sequence , we construct an offline paired reference that preserves shared high-level context and non-target content but omits target-specific details. The pair supplies contrastive supervision for isolating target-related activation variations from shared contextual structure. It learns a transferable representation geometry instead of prescribing a response tied to one offline sequence, allowing the frozen model to generate under unseen prefixes. At layer , we collect contextual reference constructions in Appendix B.5.
Low-dimensional invertible coordinates. Let and be activation statistics estimated offline, and normalize each state as . From aligned trajectory differences, we learn a column-orthonormal basis . We project the normalized state into target-related coordinates and their orthogonal residual , then transform with an invertible map :
The basis U is designed to capture low-dimensional variation associated with restricted knowledge, while r retains components orthogonal to that variation. The map changes coordinates but does not itself perform unlearning. Because the same invertible map is applied to both distributions, its Jacobian cancels from their ideal density ratio. In finite samples, regularizes local scale and curvature to improve KDE conditioning and control-gradient stability. Together, the orthonormal projection and invertible map define an exact decomposition . ST U edits only z and restores the unchanged residual r during reconstruction. Appendix C.2.1 shows the architecture and invertibility constraints.
Risk geometry and contextual references. In z-space, kernel density estimation (KDE) models restricted and sanitized trajectories with densities and . Their log-density ratio defines restricted knowledge risk:
A larger means that restricted trajectories provide stronger local support than sanitized trajectories. The level set defines the task-specific boundary, and states with form the risk region. Compared with alone, the density ratio reduces sensitivity to regions supported by both distributions. For local anchoring, we group restricted trajectories into neighborhoods and associate each neighborhood with a -space reference estimated from its paired trajectories. Let denote the normalized KDE responsibility of neighborhood , with . The contextual reference is
Restricted Knowledge Geometry Modeling
Stateful Boundary Control (Online Inference)

Figure 3: Overview of ST U. Offline paired trajectories define low-dimensional invertible coordinates, KDE-based risk geometry, and context-dependent references. During prefill and decoding, risk triggered control combines normal descent with tangent-projected history, steps toward the risk boundary, and anchors feasible states to local references. A fixed-dimensional state propagates accepted correction directions across tokens to mitigate restricted knowledge re-entry.
This responsibility-weighted statistic adapts supervision to the current activation. Geometry regularization and unified target routing are detailed in Appendix C.2.2.
Stateful Boundary Control
Risk triggered control. At position , the controller maps to and evaluates . The historical state starts at . If , the hidden state is unchanged and the history decays as . If , the controller applies the boundary correction described below. The same test is used throughout prefill and decoding. Implementation details appear in Appendix B.5 and C.6.1.
Normal descent with tangential state. For and , let . Its normalized direction is the local boundary normal, and the orthogonal projector defines the tangent space:
The normal term decreases current risk, whereas retains the component of historical guidance tangent to the current level set. Because , history cannot reverse the normal descent, although normalization reduces its normal magnitude. Thus, whenever the gradient is nonzero. Appendix A.2 describes the low-gradient fallback. The normal tangential direction corresponds to the following local surrogate:
(7)
The quadratic term penalizes intervention magnitude in z-space, the linear term favors consistent historical tangential alignment, and the linearized constraint actively reduces risk. We compute the step along as
Ignoring clipping and , the update exactly solves Eq. 7. For finite curvature, we set , recompute the risk and gradient, and repeat until the boundary is reached or iterations are used. This provides a tractable local, per-token surrogate for Eq. 2 without expensive online parameter optimization.
Contextual anchoring and state update. Risk descent may enter a low-density region with little linguistic support. We therefore evaluate the contextual reference at the pre-control coordinate and hold it fixed during correction. After obtaining the boundary-corrected state , we softly anchor it toward this reference:
(9)
The controller selects by finite backtracking. An anchored state is accepted only if it remains below the
| Baseline | RWKU | WMDP | |||||||
|---|---|---|---|---|---|---|---|---|---|
| FB↓ | QA↓ | Gen.↑ | Flu.↑ | R-Ent.↓ | Bio.↓ | Cyber↓ | Gen.↑ | R-Ent.↓ | |
| Llama3.1-8B-Instruct (Grattafiori et al. 2024) | |||||||||
| Base | 88.31 | 74.92 | 64.38 | 4.20 | 72.74 | 47.35 | 64.38 | ||
| RMU | 33.10 | 27.84 | 56.71 | 3.19 | 21.30 | 35.68 | 38.82 | 51.31 | 19.80 |
| AS | 15.90 | 19.62 | 57.40 | 3.43 | 59.80 | 27.72 | 33.82 | 57.74 | 57.40 |
| ICUL | 50.20 | 43.77 | 60.80 | 4.07 | 83.50 | 55.90 | 44.30 | 59.60 | 82.80 |
| ULD* | 32.40 | 30.94 | 56.70 | 3.36 | 50.20 | 35.90 | 35.10 | 55.50 | 48.40 |
| SCANS* | 22.80 | 28.47 | 58.40 | 3.61 | 54.70 | 31.70 | 34.00 | 57.20 | 53.10 |
| INNSTEER* | 20.60 | 24.91 | 59.80 | 3.79 | 48.90 | 30.60 | 32.80 | 58.60 | 47.20 |
| STU (Ours)* | 18.40 | 22.08 | 60.90 | 3.93 | 19.20 | 28.04 | 30.48 | 60.58 | 13.76 |
| Qwen3-14B (Yang et al. 2025) | |||||||||
| Base | 63.06 | 45.42 | 79.35 | 4.41 | 75.51 | 61.06 | 79.35 | ||
| ULD* | 25.80 | 26.94 | 66.00 | 3.48 | 50.10 | 37.80 | 39.20 | 64.80 | 48.20 |
| SCANS* | 21.50 | 28.11 | 68.70 | 3.79 | 56.40 | 34.60 | 35.80 | 67.50 | 54.10 |
| STU (Ours)* | 16.10 | 24.57 | 70.62 | 4.10 | 19.84 | 30.14 | 32.37 | 69.42 | 16.20 |
| SpikingBrain-7B (Pan et al. 2026) | |||||||||
| Base | 80.10 | 67.40 | 65.97 | 4.12 | 68.74 | 44.94 | 65.97 | ||
| ULD* | 33.40 | 34.85 | 56.40 | 3.27 | 51.00 | 45.80 | 38.90 | 55.20 | 46.50 |
| SCANS* | 28.70 | 36.12 | 58.60 | 3.53 | 59.10 | 39.80 | 36.40 | 57.40 | 49.80 |
| STU (Ours)* | 21.40 | 23.76 | 59.24 | 3.84 | 18.10 | 25.93 | 31.78 | 59.04 | 15.40 |
Table 1: Main results on RWKU and WMDP. , , and denote parameter-updating, in-context, and test-time intervention methods. R-Ent. denotes confirmed re-entry. Base has no preceding closure, we report Entry Rate instead of confirmed R-Ent.
risk boundary and retains sufficient support under ; otherwise, the attraction is reduced or removed. Eq. 9 changes only the learned target coordinates and restores the residual unchanged. Thus, residual preservation and contextual anchoring limit semantic drift, whereas the historical state below provides temporal consistency. Finally, the correction direction is compressed into a fixed-dimensional state:
The gate increases with the original boundary violation and approaches zero as . Consecutive high-risk corrections therefore accumulate consistent directional information to discourage subsequent restricted-knowledge re-entry across later decoding positions, while low-risk positions decay the history. During prefill, ST U scans positions causally to initialize . Decoding continues the same state recurrence without storing full activation histories. Appendix C.6.1 shows the inference procedure.
Experiments
Experimental Settings
Datasets. We evaluate STU on three benchmarks. RWKU evaluates the removal of real-world entity knowledge (Jin et al. 2024). WMDP measures hazardous knowledge in biosecurity (bio) and cybersecurity (cyber) (Li et al. 2024). MUSE-Books evaluates copyright unlearning on the Harry Potter corpus (Shi et al. 2025). MMLU measures the preservation of general knowledge (Hendrycks et al. 2020). Dataset and split details are detailed in Appendix B.1.
Evaluation Metrics. For RWKU, we report ROUGE-L recall on fill-in-the-blank (FB) and question-answering (QA) probes. For WMDP, we report accuracy on Bio/Cyber. The 25% random-choice indicates best forgetting. For MUSE-Books, we report BLEU and ROUGE-L. MMLU accuracy (Gen.) and GPT-4o fluency (Xu et al. 2025b) assess retained utility. We report R-Ent. separately on RWKU and WMDP to measure confirmed restricted knowledge re-Entry after an initial risk closure. Metric details are in Appendix B.2-B.3.
Baselines. We compare STU with RMU (Li et al. 2024), ICUL (Pawelczyk, Neel, and Lakkaraju 2024), WHP (Eldan and Russinovich 2023), Attention-Shifting (AS) (Tan et al. 2025), ULD (Ji et al. 2024), and adapted SCANS (Cao, Yang, and Zhao 2025) and INNSTEER (Nguyen and Le 2026). The details of Baselines are provided in Appendix B.4.
Implementation Details. Across all backbones, we use a risk dimension of , contextual neighborhoods, and six affine-coupling blocks with hidden width 128. Corrections operate in normalized coordinates with threshold quantile 94%, maximum step 12, and step scale 1.25. We use NVIDIA RTX 4090 GPUs x 4. Model-specific settings are provided in Appendix B.5.
Main Results
Forget-retain trade-off. Table 1 covers two restricted-knowledge settings with different task structures: RWKU uses FB and QA as entity-forgetting probes, whereas WMDP reports Bio/Cyber forgetting together with retained MMLU accuracy. Table 2 adds long-form copyright continuation (Llama2-7B). Across these settings, delivers the strongest or second-strongest retain performance among test-time unlearning methods while remaining competitive on forgetting. AS can push forget scores lower, but it does so with broader internal suppression and a clearer retain cost. On MUSE, nearly matches AS in BLEU (14.61 vs. 13.72) while retaining 4.78 more MMLU points and higher fluency. ICUL preserves fluency because it acts only through prompting, yet that same interface weakens target forgetting. Overall, target-specific state control plus residual preservation performs consistently across architectures and knowledge formats, including different backbones and long-form continuation. More results on SpikingBrain-7B and cases are in Appendix C.1 and D.
| Method | Forget Perf. | Retain Perf. | ||
|---|---|---|---|---|
| BLEU↓ | R-L↓ | MMLU↑ | Flu.↑ | |
| Original | 74.76 | 85.14 | 46.39 | 4.03 |
| Retain | 1.91 | 9.83 | 47.82 | 2.87 |
| WHP | 23.55 | 17.93 | 40.40 | 2.52 |
| AS | 13.72 | 11.68 | 37.56 | 3.08 |
| ICUL | 38.47 | 32.49 | 39.86 | 3.60 |
| ULD | 27.20 | 22.97 | 39.24 | 3.36 |
| SCANS | 23.36 | 20.24 | 40.10 | 3.19 |
| INNSTEER | 19.92 | 17.72 | 40.94 | 3.27 |
| ST2U (Ours) | 14.61 | 12.90 | 42.34 | 3.39 |
Table 2: Copyright unlearning results on MUSE-Books.
Restricted knowledge re-entry. The R-Ent. columns test our central claim: lowering benchmark accuracy is insufficient if autoregressive decoding can still drift back into the restricted manifold and reconstruct target knowledge several tokens later. Across Llama, Qwen, and SpikingBrain, reaches R-Ent. pairs of 19.20/13.76, 19.84/16.20, and 18.10/15.40, respectively, consistently the lowest among compared methods. Parameter-updating baselines can reduce exposure, but often at larger retain cost. Prompt-level or stateless editors leave later states weakly constrained, so apparently safe local outputs can be followed by delayed leakage. instead treats unlearning as trajectory stabilization. Its target-specific state memory discourages later states from re-entering the high-risk region, and the same mechanism remains effective on Harry Potter continuation, where long contexts make delayed reconstruction especially easy for non-stateful baselines. More details about R-Ent. and persistence diagnostics are in Appendix C.3.

Figure 4: Parameter sensitivity analysis on WMDP.
Parameter Sensitivity and Ablation
Hyperparameter sensitivity. We vary one deployment hyperparameter at a time while keeping the learned target geometry fixed (see Fig 4). The risk-boundary quantile determines when a hidden trajectory is treated as entering the restricted-knowledge region. Sweeping it from 88% to 98% yields small, non-monotonic changes, and the best point differs across backbones. We therefore use one shared operating boundary instead of selecting a per-model oracle threshold. The maximum boundary step caps the local closure strength. If the cap is too small, the controller may not move risky states past the boundary; if it is too large, the edit becomes unnecessarily aggressive and begins to trade retention for marginal WMDP reduction. We use because it is strong enough to close the boundary while avoiding the retention degradation observed at larger caps.
Ablation of Control Components. Table 3 reveals the complementary roles of the control components. Removing the historical state increases R-Ent. by 23.74 while improving MMLU only marginally, because history-free steering reduces accumulated intervention on borderline inputs. This trade-off confirms that correction history primarily supports temporal persistence. Without the risk gate , Avg. WMDP and R-Ent. increase by 13.09 and 32.99, respectively, while MMLU drops by 5.03. This confirms risk-conditioned intervention is necessary for effective and selective control. Removing the orthogonal residual causes the largest utility loss, reducing MMLU by 7.79. The residual component therefore preserves non-target information, whereas mainly suppresses restricted knowledge re-entry. Additional closure and survival analyses are provided in Appendix C.5.
| Variant | WMDP↓ | MMLU↑ | R-Ent.↓ |
|---|---|---|---|
| Full ST2U | 29.26 | 60.58 | 13.76 |
| w/o historical state | 37.23 | 62.10 | 37.50 |
| w/o risk gate | 42.35 | 55.55 | 46.75 |
| w/o residual preservation | 35.45 | 52.79 | 18.75 |
Table 3: Ablation on Avg.WMDP (Llama-3.1-8B-Instruct).
Discussions
Limited White-box Attacks
We study a limited white-box attacker that knows the backbone and defense family, and can inject low-rank hidden-state

Figure 5: Layer-wise gains from low-dimensional invertible coordinates over same-layer direct hidden steering on Llama-3.1-8B. Positive values denote additional Avg. WMDP accuracy reduction. Colors indicate MMLU accuracy changes, and bubble sizes encode the standard deviation across runs.
perturbations at the defended layer, but cannot disable the runtime hook or overwrite the controller state. We use two attack-facing metrics: WMDP recovery (%) and MMLU retain drift (%). Table 4 shows three distinct behaviors. RMU shows limited reopening under the tested vector attacks, but its retain score drops by -17.32%. SCANS is much more brittle: subspace nulling restores +15.84% WMDP, while its small +1.28% MMLU increase comes from partially undoing SCANS's own over-steering rather than from stronger robustness. ST U remains the most stable point in this space, with only +1.16% WMDP recovery and -1.92% MMLU drift under reverse-vector cancellation. Details and black-box extraction robustness results are deferred to Appendix C.4.
| Method | Recovery↓ | ΔMMLU |
|---|---|---|
| RMU | 4.87 | -17.32 |
| SCANS | 15.84 | +1.28 |
| ST2U | 1.16 | -1.92 |
Table 4: White-box test-time attack (Llama3.1-8B-Instruct).
Layer-wise Coordinate Robustness.
Figure 5 compares same-layer direct hidden steering with steering augmented by low-dimensional invertible coordinates across layers 16–31 of Llama-3.1-8B. The vertical axis measures the additional reduction in Avg. WMDP accuracy, with larger positive values indicating stronger forgetting over direct steering. Of the 16 layers, 13 improve, 10 gain at least 5 WMDP points, and 6 exceed 8 points, showing that the benefit is not confined to one selected layer. Layers 20, 23, 24, 27, and 31 combine large forgetting gains with at most 2.5 points of MMLU loss. Layer 23 is particularly illustrative, reducing WMDP accuracy by an additional 12.27 points while improving MMLU by 4.72 points. Overall, invertible coordinates broaden the range of effective intervention layers and reduce sensitivity to precise layer selection, consistent with organizing target-related states into a more separable and controllable representation. Detailed layer-wise results for invertible coordinates are provided in Appendix C.2.
Deployment cost.
Figure 6 compares deployment efficiency, where bubble area represents measured offline time in minutes and the horizontal axis reports online latency relative to Base. ST U achieves the lowest Avg. WMDP accuracy (29.26) and the highest retained MMLU accuracy (60.58) among all unlearning methods, with only 2.8 minutes of offline preparation. Although its online latency exceeds AS and RMU, these parameter-updating methods require 14.8 and 24.9 offline minutes while producing weaker forgetting and retention. ICUL eliminates offline preparation but is slower online ( ) and retains substantially more restricted knowledge (50.10). Moreover, ST U strictly outperforms SCANS across offline time, online latency, WMDP, and MMLU. Overall, ST U offers the strongest forgetting and retention results while maintaining a favorable joint deployment-cost profile. More results are in Appendix C.6.

Figure 6: Relative deployment cost (Llama3.1-8B-Instruct).
Conclusion
Our work revisits test-time unlearning from a trajectory-control perspective: restricted knowledge may occupy multiple contextual trajectories and semantic routes, and should not be reduced to either a single local correction or a set of prompt-level refusals. Based on this view, we introduce ST U, which models restricted-knowledge boundaries in low-dimensional invertible coordinates, preserves orthogonal non-target structure, and dynamically maintains a shared correction state according to the evolving generation context. The resulting framework provides a unified runtime control mechanism with target-specific geometries across heterogeneous forgetting scenarios, while reducing re-entry, layer brittleness, and utility degradation relative to existing methods. Our results suggest that stateful, boundary-aware trajectory control offers a practical and effective paradigm for restricted-knowledge unlearning in large language models, delivering strong forgetting-retention trade-offs, lower knowledge re-entry, and stable behavior across benchmark probing and long-form continuation tasks. Future work will study sparser trigger policies and adaptive intervention schedules to reduce online overhead while maintaining forgetting effectiveness and non-target utility.
References
Bhaila, K.; Van, M.-H.; and Wu, X. 2025. Soft prompting for unlearning in large language models. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), 4046–4056.
Cao, Z.; Yang, Y.; and Zhao, H. 2025. Scans: Mitigating the exaggerated safety for llms via safety-conscious activation steering. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, 23523–23531.
Chen, X.; Guo, J.; Li, Y.; Wang, Z.; Gong, Y.; Zou, J.; Wei, J.; and Tian, W. 2026. ALTER: Asymmetric LoRA for Token-Entropy-Guided Unlearning of LLMs. In Koenig, S.; Jenkins, C.; and Taylor, M. E., eds., Fortieth AAAI Conference on Artificial Intelligence, Thirty-Eighth Conference on Innovative Applications of Artificial Intelligence, Sixteenth Symposium on Educational Advances in Artificial Intelligence, AAAI 2026, Singapore, January 20-27, 2026, 35366–35374. AAAI Press.
Eldan, R.; and Russinovich, M. 2023. Who's Harry Potter? Approximate Unlearning in LLMs. arXiv preprint arXiv:2310.02238.
Geng, J.; Li, Q.; Woisetschlaeger, H.; Chen, Z.; Cai, F.; Wang, Y.; Nakov, P.; Jacobsen, H.-A.; and Karray, F. 2025. A comprehensive survey of machine unlearning techniques for large language models. arXiv preprint arXiv:2503.01854.
Gong, Q.; Yang, X.; Chen, X.; Lai, J.; Meng, H.; and Tang, X. 2026. FedOrtho: Efficient Federated Unlearning Via Orthogonal Convolution and Adaptive Soft Pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings, 8009–8018.
Grattafiori, A.; Dubey, A.; Jauhri, A.; Pandey, A.; Kadian, A.; Al-Dahle, A.; Letman, A.; Mathur, A.; Schelten, A.; Vaughan, A.; et al. 2024. The Llama 3 herd of models. In Neural Information Processing Systems. Curran Associates.
Hendrycks, D.; Burns, C.; Basart, S.; Zou, A.; Mazeika, M.; Song, D.; and Steinhardt, J. 2020. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300.
Hu, Z.; Zhang, Y.; Xiao, M.; Wang, W.; Feng, F.; and He, X. 2025. Exact and efficient unlearning for large language model-based recommendation. IEEE Transactions on Knowledge and Data Engineering.
Ji, J.; Liu, Y.; Zhang, Y.; Liu, G.; Kompella, R. R.; Liu, S.; and Chang, S. 2024. Reversing the forget-retain objectives: An efficient llm unlearning framework from logit difference. Advances in Neural Information Processing Systems, 37: 12581–12611.
Jin, Z.; Cao, P.; Wang, C.; He, Z.; Yuan, H.; Li, J.; Chen, Y.; Liu, K.; and Zhao, J. 2024. RWKU: Benchmarking Real-World Knowledge Unlearning for Large Language Models. In Advances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024.
Lee, H. K.; Liu, R.; and Xiong, L. 2026. Direct Token Optimization: A Self-Contained Approach to Large Language Model Unlearning. In Findings of the Association for Computational Linguistics: ACL 2026, 42083–42100.
Li, J.; Chen, Y.; and Ding, N. 2026. CiPO: Counterfactual Unlearning for Large Reasoning Models through Iterative Preference Optimization. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 3152–3170.
Li, K.; Li, W.; Wu, D.; Yang, L.; Bai, J.; Jia, J.; and Xue, J. 2026. Cross-modal unlearning via influential neuron path editing in multimodal large language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 40, 35589–35597.
Li, N.; Pan, A.; Gopal, A.; Yue, S.; Berrios, D.; Gatti, A.; Li, J. D.; Dombrowski, A.-K.; Goel, S.; Mukobi, G.; et al. 2024. The WMDP benchmark: measuring and reducing malicious use with unlearning. In Proceedings of the 41st International Conference on Machine Learning, 28525–28550.
Liang, H.; Wu, W.; Gong, Z.; He, Z.; Gong, Y.; Jiang, J.; and Cheng, D. 2026. Federated Unlearning via Representation Misdirection with Adaptive Anchor Generation. IEEE Transactions on Dependable and Secure Computing.
Liu, C. Y.; Wang, Y.; Flanigan, J.; and Liu, Y. 2024. Large language model unlearning via embedding-corrupted prompts. Advances in Neural Information Processing Systems, 37: 118198–118266.
Liu, S.; Yao, Y.; Jia, J.; Casper, S.; Baracaldo, N.; Hase, P.; Yao, Y.; Liu, C. Y.; Xu, X.; Li, H.; et al. 2025. Rethinking machine unlearning for large language models. Nature Machine Intelligence, 7(2): 181–194.
Nguyen, T.; and Le, T. 2026. Beyond Linear Activation Steering: Invertible Latent Transformations for Controlling LLM Behavior. arXiv preprint arXiv:2606.08454.
Pan, Y.; Feng, Y.; Zhuang, J.; Ding, S.; Xu, H.; Liu, Z.; Sun, B.; Chou, Y.; Qiu, X.; Deng, A.; Hu, A.; Wang, S.; Zhou, P.; Yao, M.; Wu, J.; Yang, J.; Xu, B.; and Li, G. 2026. SpikingBrain: Spiking Brain-inspired Large Models. Trans. Mach. Learn. Res., 2026.
Pawelczyk, M.; Neel, S.; and Lakkaraju, H. 2024. In-Context Unlearning: Language Models as Few-Shot Unlearners. In International Conference on Machine Learning, 40034–40050. PMLR.
Pu, J.; Shi, M.; Ren, X.; Wang, Y.; Zhang, X.; Wang, Z.; and She, K. 2026. Decoding-Unlearning: Fact Forgetting via Entropy-Guided Inference. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 39834–39860.
Ramakrishna, A.; Wan, Y.; Jin, X.; Chang, K.; Bu, Z.; Vinzamuri, B.; Cevher, V.; Hong, M.; and Gupta, R. 2025. LUME: LLM Unlearning with Multitask Evaluations. In Findings of the Association for Computational Linguistics: EMNLP 2025, Suzhou, China, November 4-9, 2025, 6524–6535. Association for Computational Linguistics.
Ranjan, R.; Grover, U.; Lin, X.; and Polyzou, A. 2026. Razor: Ratio-aware layer editing for targeted unlearning in vision transformers and diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 7998–8008.
Sanyal, D.; and Mandal, M. 2025. Agents are all you need for LLM unlearning. arXiv preprint arXiv:2502.00406.
Shen, W.; Qiu, X.; Kurmanji, M.; Iacob, A.-A.; Sani, L.; Chen, Y.; Cancedda, N.; and Lane, N. 2026. LLM unlearning via neural activation redirection. Advances in Neural Information Processing Systems, 38: 44253–44290.
Shi, W.; Lee, J.; Huang, Y.; Malladi, S.; Zhao, J.; Holtzman, A.; Liu, D.; Zettlemoyer, L.; Smith, N.; and Zhang, C. 2025. Muse: Machine unlearning six-way evaluation for language models. In International Conference on Learning Representations, volume 2025, 27797–27818.
Sun, S.; Canziani, A.; LeCun, Y.; and Zhu, J. 2026. Anatomy of Massive Activations and Attention Sinks. In Forty-third International Conference on Machine Learning.
Tan, C.; Qu, Y.; Li, X.; Zhang, H.; Cui, S.; Chen, C.; and Gao, L. 2025. Wisdom is Knowing What not to Say: Hallucination-Free LLMs Unlearning via Attention Shifting. NeurIPS 2025.
Thudi, A.; Deza, G.; Chandrasekaran, V.; and Papernot, N. 2022. Unrolling sgd: Understanding factors influencing machine unlearning. In EuroS&P 2022, 303–319. IEEE.
Tutek, M.; Chaleshtori, F. H.; Marasović, A.; and Belinkov, Y. 2025. Measuring chain of thought faithfulness by unlearning reasoning steps. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, 9946–9971.
Wang, C.-L.; Li, Q.; Xiang, Z.; Cao, Y.; and Wang, D. 2025. Towards lifecycle unlearning commitment management: Measuring sample-level unlearning completeness. In 34th USENIX Security Symposium (USENIX Security 25), 6481–6500.
Wang, Z.; Guo, J.; Pu, J.; Pu, H.; Yang, M.; Chen, X.; Ou, J.; Li, W.; Luo, G.; and Tian, W. 2026a. CAP: Controllable Alignment Prompting for Unlearning in LLMs. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
Wang, Z.; Liu, Z.; Cai, Y.; Li, C.; Tang, X.; Chen, J.; Pan, Z.; and Qiu, J. 2026b. FUPareto: Bridging the Forgetting-Utility Gap in Federated Unlearning via Pareto Augmented Optimization. arXiv preprint arXiv:2602.01852.
Xu, H.; Zhao, N.; Yang, L.; Zhao, S.; Deng, S.; Wang, M.; Hooi, B.; Oo, N.; Chen, H.; and Zhang, N. 2025a. Relearn: Unlearning via learning for large language models. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 5967–5987.
Xu, X.; Du, M.; Ye, Q.; and Hu, H. 2025b. OBLIVIATE: Robust and Practical Machine Unlearning for Large Language Models. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, 3696–3715.
Yang, A.; Li, A.; Yang, B.; Zhang, B.; Hui, B.; Zheng, B.; Yu, B.; Gao, C.; Huang, C.; Lv, C.; et al. 2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388.
Yu, M.; Lin, L.; Zhang, G.; Li, X.; Fang, J.; Zhang, N.; Wang, K.; and Wang, Y. 2025. UniErase: Unlearning Token as a Universal Erasure Primitive for Language Models. arXiv preprint arXiv:2505.15674.
Zhang, L.; Zhu, T.; Xiong, P.; and Zhou, W. 2025. The price of unlearning: identifying unlearning risk in edge computing. ACM Transactions on Multimedia Computing, Communications and Applications, 21(8): 1–23.
Zhao, H.; Yuan, C.; Huang, F.; Hu, X.; Zhang, Y.; Yang, A.; Yu, B.; Liu, D.; Zhou, J.; Lin, J.; et al. 2025a. Qwen3guard technical report. arXiv preprint arXiv:2510.14276.
Zhao, S.; Wu, X.; Nguyen, C. T.; Jia, Y.; Jia, M.; Feng, Y.; and Luu, A. T. 2025b. Unlearning Backdoor Attacks for LLMs with Weak-to-Strong Knowledge Distillation. In Findings of the Association for Computational Linguistics, ACL 2025, Vienna, Austria, July 27 - August 1, 2025, volume ACL 2025 of Findings of ACL, 4937–4952. Association for Computational Linguistics.