potentialpaper

Safety-Constrained Test-Time Training: Post-Update Guarding for Aligned Language Models

Jin Wang

ICLR 2027

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. We propose SC-TTT, a post-update gate that probes each LoRA update against a fixed behavioral reference and rolls back harmful candidates, suppressing attacks while preserving adaptation.

Abstract. Test-time training (TTT) adapts a language model during inference, but an attacker can use the same update loop to erode safety alignment. We propose Safety-Constrained Test-Time Training (SC-TTT), which probes each candidate update against a fixed behavioral reference. It retains the candidate only when the harmful-side compliance change does not exceed the benign-side change by more than a threshold. Otherwise, SC-TTT restores the preceding parameter state. Across Gemma-3-4B, Llama-3.2-3B, and Qwen3.5-4B, SC-TTT lowers mean attack success from 19.8-50.3% under vanilla TTT to 0.1-5.8% over five random seeds. It retains 0.83-1.09 of the vanilla adaptation gain on BBH-H3 and matches vanilla accuracy on ARC-AGI. A learning-rate analysis shows that the criterion is reliable only within a calibrated working regime. A full-knowledge three-step pressure test still suppresses 47-70% of vanilla attack success despite optimizing the gate directly. These results establish strong attack suppression, high utility retention, and an explicit operating regime for guarded test-time adaptation.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
5 Sep 2026ICLR 2027submittedICLR 2027Withdrawnreviews ↓[1]PDF[1]
Missing a version?

ICLR 2027

Withdrawn · 3 reviews · OpenReview

Updated 24 Nov 2026, 16:46 UTC.

Reviewer QSU4OpenReview ↗
Rating
2/4
Confidence
3/4
Soundness
1/3
Presentation
1/3
Informativeness
2/3
Read review
Summary

The paper studies the problem of test-time training for adversarial robustness. The authors shift the defense from input-level detection to the stage following candidate parameter updates, thereby providing a more realistic defense setting. Additionally, the paper conducts experiments to validate the effectiveness of the proposed SC-TTT.

Strengths
  1. The topic is attractive and realistic.

  2. The motivation is clearly stated.

  3. The method is simple and easy to integrate into existing test-time training pipelines.

Weaknesses
  1. The paragraphs are too fragmented, making it difficult for readers to follow the discussion.

  2. ASR is a metric where lower values indicate better performance. Please also consider over-rejection during defense. The following work may be relevant to your study:

[1] Calibrating Inference Time Alignment with Sequence-level Risk Accumulation. ACL Main 2026.

[2] Llms encode harmfulness and refusal separately. Neurips 2026.

[3] Beyond I'm Sorry, I Can't: Dissecting Large-Language-Model Refusal. AAAI 2026.

  1. The baselines are relatively weak. Please consider comparisons with state-of-the-art test-time scaling baselines
Questions for the authors

Please refer to the critical weaknesses.

Reviewer mNsfOpenReview ↗
Rating
2/4
Confidence
2/4
Soundness
2/3
Presentation
2/3
Informativeness
2/3
Read review
Summary

This paper focuses on a practical security concern: how to prevent adversaries from undermining the safety alignment of large language models (LLMs) through test-time training (TTT). To address this issue, the authors propose SC-TTT, a safety-constrained framework that selectively accepts or rejects candidate parameter updates using a lightweight post-update behavioral gate. The authors evaluate SC-TTT across three LLM families (Qwen, Llama, and Gemma). Experimental results demonstrate that SC-TTT substantially reduces the attack success rate (ASR) while preserving the utility gains achieved through TTT.

Strengths
  1. The research problem is valuable. The authors propose a timely security concern: an adversary could manipulate the parameter-update during Test-Time Training to undermine the alignment of the LLM.

  2. The proposed framework is simple yet effective: the authors propose SC-TTT, which is based on behavioral probing and parameter rollback, without introducing extra training cost.

  3. The experimental results demonstrate the effectiveness of SC-TTT, reducing ASR while preserving utility performance.

Weaknesses
  1. The core design of the safety criterion needs further discussion. The authors define g=ΔH−ΔBg = \Delta H - \Delta B, and use g≤τg \leq \tau to judge whether this update is safe. However, this design of gg can only constrain the relative increase of BB compared to HH. For example, when ΔH=0.5\Delta H = 0.5 and ΔB=0.5\Delta B = 0.5 (i.e., g=0g=0), or ΔH=1.5\Delta H = 1.5 and ΔB=1.7\Delta B = 1.7 (i.e., g=−0.2g=-0.2), SC-TTT would accept these updates while the harmful compliance is significantly increased.

  2. Limited Evidence of Selective Adaptation. As reported in Table 3, SC-TTT rejects nearly all harmful updates (97.5–100%), making its strong safety performance difficult to distinguish from simply preventing parameter adaptation. The authors should add more experiments to demonstrate the effectiveness of the proposed selective update mechanism.

  3. Lack of essential ablation studies. The paper lacks ablation studies to validate the necessity of its key design choices, particularly the harmful–benign contrast and fixed-reference criterion. Comparisons with simpler alternatives, such as a harmful-only gate and a moving-reference gate, would help clarify the individual contributions of these components to safety and utility.

Questions for the authors
  1. I have concerns about some reported results. For example, in Table 1, the authors report that the results of Qwen and Llama are exactly identical (0.12±0.17 for ASR and 1.25±1.7 for ASR@10), the authors should further explain why the two models achieve the same results.

  2. The authors should report the absolute accuracy of the three models with any TTT, i.e., the accuracy of Non-TTT.

  3. Why is retaining the AdamW optimizer state preferable to fully restoring the training state after a rejected update? Could gradients from rejected malicious candidates indirectly affect subsequent updates through the retained moments?

  4. How does SC-TTT behave under mixed benign–malicious adaptation streams and longer update trajectories? The current evaluation separates harmful and benign episodes, while real-world deployments may involve interleaved updates within the same model state.

Reviewer CwCzOpenReview ↗
Rating
1/4
Confidence
4/4
Soundness
1/3
Presentation
2/3
Informativeness
1/3
Read review
Summary

This paper proposes a defense against test-time training (TTT) attacks. In this threat, an adversary exploits the parameter updates induced by their own adaptation data to erode the model's safety alignment. The method snapshots the trainable parameters before each optimizer step and scores the resulting candidate on 6 harmful and 6 benign anchor prompts. It then computes the gap g=ΔH−ΔBg = \Delta H - \Delta B relative to the base model and rolls back any candidate whose gap exceeds a fixed threshold.

Strengths

The topic is timely, and the security of test-time adaptation mechanisms is important for the community.

Weaknesses
  • The criterion is structurally weak and, I would argue, easily bypassed. Because ΔB\Delta B is subtracted from$\Delta H$, an attacker who raises harmful and benign compliance together passes the gate. Besides, the approach depends heavily on six anchors and a single compliance target per model. It is unclear whether these capture harmful drift outside the narrow distribution tested, for example other harm categories or targeted objectives. A category-held-out evaluation, with anchors and attack data drawn from different harm domains, would be needed to support any generalization claim.

  • Against naive harmful fine-tuning, the gate rejects nearly 100% of candidates. The defended model is therefore essentially the base model, and its ASR matches the no-TTT baseline almost by construction. A more informative setting would mix harmful and benign data in the adaptation stream. The evaluation is also shallow: it uses 32 harmful prompts of unspecified provenance and a single attack recipe, and the five seeds vary training noise rather than the prompt set.

Questions for the authors

How would the approach perform when the anchors and the attack data come from different harm categories/distributions? or when the adversary's harmful completions avoid the fixed compliance target? And how would the approach behave when harmful and benign examples are mixed in the setting?

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…