acceptodds
Under review as a conference paper at ICLR 2027

Beyond Parameter Space: Closed-Form Cross-Trajectory Repair After Harmful Fine-Tuning

Abstract

Safety-aligned language models are routinely adapted after deployment to improve downstream task performance, yet the fine-tuning process may be vulnerable to a small fraction of harmful examples that compromise their safety alignment. Existing safety repair methods intervene through diverse mechanisms, including parameter or update modification, model merging, and additional optimization. However, harmful fine-tuning can also change the internal representations propagated through the model, so the aligned reference and attacked models may reach the same module with different representations even for the same input. Motivated by this observation, we propose CCTR (Closed-Form Cross-Trajectory Repair), a post-hoc repair method that fits the full cross-trajectory output residual on representations produced by the attacked model while constraining output drift on task-agnostic utility activations. For each target linear module, these two objectives form a regularized least-squares problem with a closed-form solution, enabling repair without gradient-based optimization or downstream-task supervision. Compared with the strongest state-of-the-art safety repair method, CCTR lowers the average Harmful Score from 2.30% to 0.38% across varying harmful-data ratios. In experiments on different downstream tasks, it lowers the score from 2.85% to 0.77% and improves average task accuracy by 3.53%.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
LLM safety, harmful fine-tuning, post-hoc repair, safety alignment, model editing

Reviews

Among:
Shape:
1234this paper, Top 30%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.67 over 3 reviews, above 70% of the others.
Reviewer_sWwNOpenReview ↗
Rating
2
Confidence
3
Informativeness
1
Presentation
2
Soundness
2
Read review
Paper summary

This work investigates how to restore security to a model after it has been fine-tuned with malicious data, while retaining its original task capabilities. It proposes CCTR to fit the output residuals of the attacked model to achieve this goal.

Critical strengths

The most persuasive aspect is that the paper runs controlled experiments targeting the proposed gap. Figure 1 shows that using P_l alone leaves about 99.47% to 99.89% of the normalized residual unexplained, with a cosine similarity to the full residual of only 0.034 to 0.075. This finding is diagnostic on its own, but Figure 4 goes further. It fixes the solver and changes only the trajectory term in the objective, P_l + αT_l. Adding T_l lowers HS from 32.3, 30.4, and 41.1 to 0.4, 0.1, and 1.2 across the three tasks. The authors also control for amplifying P_l and for matched update norms, which shows the improvement cannot be attributed simply to larger updates.

Table 4 effectively tests whether the utility constraint is necessary. Without it, HS remains very low, but task accuracy collapses to 0 to 2.8%. This shows that low harmfulness can come from model failure, and it explains why the full objective must constrain safety and utility together.

The main results are also solid. In Table 1, compared with AsFT, the safest competing method, average HS drops from 2.30% to 0.38% at nearly identical accuracy. In the cross task results of Table 2, HS falls from 2.85% to 0.77% while accuracy rises from 60.50% to 64.03%. The method covers four models and reports a full repair pipeline cost of about 6.76 minutes.

Critical weaknesses

W1: Local closed-loop optimality does not equate to optimal fix for the entire model. All modules use frozen attacked activations to estimate patches, but the upstream representation has changed after patch application. Subsequent modules actually receive different inputs than during the solution process. Experiments show that this approximation can be effective, but it does not fully explain why simultaneous fixes by multiple modules do not overcompensate, and it lacks comparison with layer-by-layer re-acquisition of representations.

W2: Improvements on independent security benchmarks are much more moderate than in the main table. In Table 10, the unsafe fulfillment on the SORRY-Bench decreases from 68/440 on attacked to 55/440, i.e., 15.45% → 12.50%. This supports the existence of generalization gains, but the near-zero HS on BeaverTails cannot be interpreted as widespread security recovery.

Questions for authors

Q1. How does simultaneously fixing all modules compare to re-acquiring representations layer by layer? Can you quantify the degree to which the final representation deviates from the calibrated representation?

Q2. Can you provide results for independent fine-tuning of the seed, and analysis of pairwise uncertainty improved by SORRY-Bench?

Q3. Can you supplement this with overrejection evaluations such as XSTest, and broader tests of generation task capabilities?

16 comments
AuthorsOpenReview ↗

Author Response to Reviewer sWwN (Part 1/5)

Response to Reviewer sWwN

Thank you for recognizing our trajectory-term controls, utility ablations, and main results. The central contribution of this work is identifying and addressing cross-trajectory functional discrepancies caused by harmful fine-tuning. Figure 1 shows that harmful fine-tuning changes not only model parameters but also hidden representations propagated across layers, making parameter-only corrections insufficient to recover the full functional differences. Figure 4 further demonstrates that the contribution of trajectory information cannot be explained by simple rescaling or larger updates. Motivated by these findings, we propose CCTR, addressing the limitations of parameter-only repair that overlooks representation-trajectory divergence, without requiring additional fine-tuning, backpropagation, or downstream-task data. The complete repair pipeline takes only 6.76 minutes on average. CCTR achieves state-of-the-art safety repair performance among the evaluated methods, reducing average HS from the strongest baseline's 2.30% to 0.38% across harmful-data ratios and from 2.85% to 0.77% across downstream tasks, while improving average task accuracy by 3.53 percentage points. We further address full-model repair behavior, stability across independent training runs, and safety–utility preservation below.

Below, Harmful Score (HS) denotes the harmful-response rate, Acc denotes task accuracy, and UFR denotes the official SORRY-Bench unsafe fulfillment rate.

Q1: How does frozen-trajectory repair compare with block-wise activation recomputation, and how far do deployed representations deviate from the original attacked model’s frozen trajectory?

Frozen-trajectory repair achieves both lower harmfulness and smaller changes in benign representations than block-wise activation recomputation across the three tasks. HS falls from 6.7% to 0.4% on SST-2, from 3.5% to 0.1% on AG News, and from 26.2% to 1.2% on GSM8K. Layer-wise input-drift analysis on SST-2 shows smaller utility-input drift with frozen repair than with block-wise activation recomputation at the reported middle-to-late blocks, supporting better control of benign-representation changes accumulated with depth. Realized correction cosines with the original target are 0.751–0.774, versus 0.335–0.472 for the block-wise method, showing better directional alignment with the safety target. Old/new target cosines of 0.063–0.139 also indicate that activation recomputation changes both the inputs and residuals. We address full-model behavior, layer-wise input drift, realized output effects, and target changes below.

(1) Full-model comparison after all patches are deployed.

We implement block-wise activation recomputation on three downstream tasks to test whether new activations from the repaired prefix improve repair. Before solving each Transformer block, this control recomputes activations and statistics for its seven target modules, then writes the block's patches together. CCTR instead uses the frozen reference and attacked trajectories in Section 3.4 and Algorithm 1. Both methods share calibration data, solver settings, and evaluation protocols. All behavioral metrics come from full-model generation after all 224 patches are deployed, not from local fitting on frozen activations.

The following matched comparison uses p=0.2p=0.2; HS and Acc are both in %.

TaskFrozen HS↓Block-wise HS↓Frozen Acc↑Block-wise Acc↑
SST-20.46.792.493.0
AG News0.13.577.873.4
GSM8K1.226.224.222.4

The frozen method achieves lower HS on all three tasks while retaining substantial task performance. On GSM8K, HS is 1.2% versus 26.2%, with task accuracy of 24.2% versus 22.4%, showing that the safety benefit carries through to generation by the fully repaired model.

(2) Effects of earlier repairs on later-block inputs.

We directly record hidden states at each decoder-block entrance in the SST-2 models above to quantify deviations of the deployed trajectory from the frozen trajectory. Both methods use the same 128 held-out safety prompts and 128 held-out task-agnostic utility prompts, with fixed tokens, positions, and validity masks, and the original attacked model as a common reference. For each block, we sum the squared magnitudes of the hidden-state differences over all examples and valid tokens, divide by the corresponding sum for the original attacked hidden states, then take the square root and express the result as a percentage.

AuthorsOpenReview ↗

Author Response to Reviewer sWwN (Part 2/5)

The table shows the first block and representative middle-to-late blocks, indexed 0–31. Safety and Utility refer to safety and benign inputs, respectively. Entries are frozen / block-wise, in %.

Block indexSafety-input drift: frozen / block-wiseUtility-input drift: frozen / block-wise
00.00 / 0.000.00 / 0.00
80.67 / 0.790.09 / 0.12
121.79 / 3.970.15 / 0.59
163.37 / 7.670.27 / 1.14
205.56 / 12.040.45 / 1.89
248.41 / 15.670.67 / 2.81
2811.98 / 18.230.96 / 3.75
3126.36 / 33.532.18 / 7.30

No module has been patched before the first block, so its input drift is zero. The frozen method has smaller input drift at every reported middle-to-late block. Utility-input drift at Block 28 is 0.96%, versus 3.75% for the block-wise method, and remains smaller at Block 31. This supports better control of benign-representation changes accumulated with depth, consistent with the realized corrections and full-model safety results.

(3) Realized module-output corrections after inputs change.

We further measure actual linear-module output changes in the fully repaired model to test whether patches remain effective after their inputs change. These changes include both the patch's direct effect on the original frozen input and the effect of upstream input changes propagated through the repaired weights. They therefore reflect deployment more directly than measuring the patch effect at fixed inputs alone.

At the same held-out tokens and positions, we measure two quantities. Correction cosine compares the direction of the realized output change with the original safety target, defined as the reference-model output minus the original attacked-model output; higher values indicate better directional alignment. Utility-output drift is the norm of the actual output change relative to the original output on utility inputs; lower values indicate smaller changes. For both metrics, inner products or squared norms are aggregated over all 224 modules before computing the cosine or norm ratio, rather than averaging module-wise ratios.

TaskFrozen correction cosine↑Block-wise correction cosine↑Frozen utility-output drift↓Block-wise utility-output drift↓
SST-20.7740.3451.11%3.76%
AG News0.7740.3351.17%3.84%
GSM8K0.7510.4722.46%4.74%

The frozen method's realized corrections are more aligned with the original target and produce smaller benign-output changes. The preceding experiment measures representation changes at block entrances, whereas this experiment assesses their functional consequences at module outputs. Together with full-model generation results, these findings support the effectiveness of frozen-trajectory repair in the actual forward pass.

(4) Effects of activation recomputation on later repair targets.

We also compare residuals before and after activation recomputation on independent held-out examples to examine what changes beyond the inputs themselves. The frozen method always uses the reference-model output minus the original attacked-model output as its target. Before patching the current block, the block-wise method instead recomputes its module outputs using new inputs from the repaired prefix and subtracts them from the same reference outputs. Input changes therefore also alter the residuals that later modules must fit.

AuthorsOpenReview ↗

Author Response to Reviewer sWwN (Part 3/5)

The old/new target cosines are 0.063, 0.063, and 0.139 on SST-2, AG News, and GSM8K, respectively, with relative target changes of 4.16, 4.23, and 2.54 times. Relative change is the aggregate norm of the old/new target difference divided by that of the original target, after summing squared norms across modules. Activation recomputation therefore changes both the inputs and repair residuals, whereas the frozen method retains a consistent original functional reference for each module. Full-model behavior, input drift, and realized correction directions jointly support this design. The closed-form solution is locally optimal for fixed activations; deployment performance is directly assessed by the full-model evaluations above.

Q2: Can you provide independent fine-tuning seeds and paired uncertainty for the SORRY-Bench improvement?

Independent fine-tuning and SORRY-Bench evaluation both reproduce CCTR's safety advantage. Primary-benchmark HS is 0.4%, 0.3%, and 0.4% across the three seeds, and SORRY-Bench UFR is 12.576% ± 0.131% in mean ± sample standard deviation, with the lowest value on both metrics for every seed. CCTR also has the lowest number of unsafe fulfillments on all three SORRY-Bench tasks, reducing GSM8K from Attacked's 94/440 to 54/440 and demonstrating gains across downstream tasks. Under AdvBench attack-source and evaluation-source shifts, HS is 0.50% and 0.10%, respectively, also the lowest, supporting safety gains when either the harmful training source or evaluation source changes. We present independent training, independent safety evaluation and paired analysis, and data-source shifts below.

(1) Stability across independent training runs on the primary benchmark.

We independently train with seeds 42, 43, and 44 on SST-2 at p=0.2p=0.2, comparing Attacked, seven baselines, and CCTR to test whether the main safety gain depends on a single training run. Each method follows its established procedure and configuration under common generation and scoring settings. Each seed is evaluated on 1,000 safety requests and 500 task examples. Seed columns report HS / Acc; the final columns report mean ± sample standard deviation across three seeds, all in %.

MethodSeed 42Seed 43Seed 44HS mean ± SD↓Acc mean ± SD↑
Attacked74.3 / 93.874.5 / 93.874.0 / 93.874.267 ± 0.25293.800 ± 0.000
Safe LoRA66.4 / 95.666.7 / 95.467.1 / 94.466.733 ± 0.35195.133 ± 0.643
SafeMERGE23.6 / 95.021.1 / 94.422.5 / 94.822.400 ± 1.25394.733 ± 0.306
Safe Delta9.7 / 94.89.9 / 94.89.5 / 94.89.700 ± 0.20094.800 ± 0.000
Safety at One Shot19.4 / 94.419.2 / 94.418.4 / 94.619.000 ± 0.52994.467 ± 0.115
LED-Merging3.2 / 91.82.9 / 91.82.9 / 91.63.000 ± 0.17391.733 ± 0.115
Panacea9.3 / 91.814.6 / 93.419.9 / 93.614.600 ± 5.30092.933 ± 0.987
AsFT2.0 / 92.22.0 / 92.42.2 / 92.02.067 ± 0.11592.200 ± 0.200
CCTR0.4 / 92.60.3 / 92.60.4 / 92.60.367 ± 0.05892.600 ± 0.000

CCTR achieves the lowest HS for every seed, with a mean of 0.367% ± 0.058%, versus 2.067% ± 0.115% for AsFT, while retaining comparable task accuracy. The main safety gain is therefore consistently reproduced across independent training runs.

(2) Cross-task improvement and paired uncertainty on SORRY-Bench.

We extend the SST-2 evaluation in Appendix F.2.1, Table 10 of the original submission (Table 11 in the revised manuscript), to AG News and GSM8K to test whether the safety benefit persists with an independent request set and judge. We use the official 440 requests and fine-tuned Mistral judge, with common generation and scoring settings within each task. The table reports counts of unsafe fulfillments; every column has denominator 440, and lower is better.

MethodSST-2AG NewsGSM8K
Attacked686894
Safe LoRA686986
SafeMERGE686989
Safe Delta646464
Safety at One Shot686686
LED-Merging636267
Panacea6259137
AsFT676563
CCTR555854
Reviewer_PDe4OpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
3
Read review
Paper summary

The paper studies post-hoc safety repair of a checkpoint fine-tuned on data containing harmful examples. It uses attacked-model activations as inputs and generic utility activations to penalize collateral changes, yielding a regularized closed-form update for each linear module. The paper motivates the full residual by showing that local parameter-only corrections miss trajectory-induced differences, and evaluates repair across tasks, harmful-data ratios, model families, and evaluation sources.

Critical strengths
  1. the method is simple, cheap and gradient-free
  2. the comparison is broad. the author compared sever baselines, five harmful ratios, three tasks and four model families.
  3. The control is well designed. The paper includes parameter-only targets, continuous interpolation of the trajectory term, best-scalar and magnitude-matched controls, removal of the utility constraint, and weight interpolation. These experiments substantially strengthen the argument that the full residual carries useful information beyond local weight changes
Critical weaknesses
  1. I think the performance on SORRY-bench is marginal compared to other benchmark-- also could you provide std or variants of each run
  2. The proposed approach decrease the harmful score from 2.6 to 0.4 it suggests it refues more than the reference. could you help check what's the performance on helpfulness or over refusal benchmark?
Questions for authors

as above

3 comments
AuthorsOpenReview ↗

Author Response to Reviewer PDe4 (Part 1/3)

Response to Reviewer PDe4

Thank you for recognizing CCTR's gradient-free formulation, evaluation coverage, and trajectory-term controls. We provide further analysis and experiments on the magnitude of the SORRY-Bench improvement, stability across independent training runs, and benign-response capability.

Below, Harmful Score (HS) denotes the harmful-response rate, Acc denotes task accuracy, and UFR denotes the official SORRY-Bench unsafe fulfillment rate.

Q1: The SORRY-Bench improvement is relatively modest. Can you report results across runs and standard deviations?

CCTR has the lowest number of unsafe fulfillments on all three SORRY-Bench tasks, and this advantage is reproduced for every independent fine-tuning seed. In the original SST-2 setting, it reduces the count from Attacked's 68/440 to 55/440, a net reduction of 13, exceeding the strongest baseline in this setting, Panacea, at 6. UFR across the three seeds is 12.576% ± 0.131% in mean ± sample standard deviation, supporting consistency across training runs. Under AdvBench attack-source and evaluation-source shifts, HS is 0.50% and 0.10%, respectively, also the lowest, supporting safety gains under changes in the training or evaluation source. We discuss independent-benchmark improvement, independent-training stability, and performance under source changes below.

(1) Cross-task improvement on an independent safety benchmark.

We extend the SST-2 evaluation in Appendix F.2.1, Table 10 of the original submission (Table 11 in the revised manuscript), to AG News and GSM8K to examine whether the original result is specific to one downstream task. We use the official 440 requests and fine-tuned Mistral judge, with common generation and scoring settings within each task, comparing Attacked, seven baselines, and CCTR. The table reports counts of unsafe fulfillments; every column has denominator 440, and lower is better.

MethodSST-2AG NewsGSM8K
Attacked686894
Safe LoRA686986
SafeMERGE686989
Safe Delta646464
Safety at One Shot686686
LED-Merging636267
Panacea6259137
AsFT676563
CCTR555854

CCTR has the lowest number of unsafe fulfillments on all three tasks. On GSM8K, it yields net reductions of 40, 9, and 13 responses relative to Attacked, AsFT, and LED-Merging, respectively, showing that safety gains persist across downstream tasks.

In the original SST-2 setting at p=0.2p=0.2, Reference and Attacked produce 65/440 and 68/440 unsafe responses, respectively. We view this small initial net degradation as the main reason for the modest absolute improvement in this setting. CCTR nevertheless reduces the count to 55/440, a net reduction of 13 compared with 6 for the strongest baseline, Panacea, and below the aligned reference.

(2) Independent training seeds and variation across runs.

We independently train with seeds 42, 43, and 44 on SST-2 at p=0.2p=0.2 to test whether the safety benefit depends on a particular training run. Each method follows its established procedure and configuration, with 1,000 safety requests and 500 task examples per seed on the primary benchmark under common generation and scoring settings. CCTR's HS values are 0.4%, 0.3%, and 0.4%, with mean ± sample standard deviation of 0.367% ± 0.058%, versus 2.067% ± 0.115% for AsFT. CCTR's task accuracy is 92.6% for every seed, while AsFT obtains 92.200% ± 0.200%.

AuthorsOpenReview ↗

Author Response to Reviewer PDe4 (Part 2/3)

We also evaluate all nine methods over the three independent training seeds on SORRY-Bench, obtaining 27 results. Entries are counts of unsafe fulfillments out of 440; the final column reports UFR mean ± sample standard deviation, in %.

MethodSeed 42 (/440)Seed 43 (/440)Seed 44 (/440)UFR mean ± SD↓ (%)
Attacked67697115.682 ± 0.455
Safe LoRA69666815.379 ± 0.347
SafeMERGE70697015.833 ± 0.131
Safe Delta63636414.394 ± 0.131
Safety at One Shot66666514.924 ± 0.131
LED-Merging64636414.470 ± 0.131
Panacea63666414.621 ± 0.347
AsFT67676715.227 ± 0.000
CCTR56555512.576 ± 0.131

CCTR has the lowest UFR for every seed, showing that its advantage on this independent safety benchmark persists across repeated training.

(3) Performance under different harmful training and evaluation sources.

We further examine whether the safety benefit depends on a fixed data source through the source-shift evaluations in Section 4.2.4 and Figure 3. Attack-source shift uses AdvBench-format harmful training data while retaining BeaverTails evaluation. Evaluation-source shift retains BeaverTails harmful fine-tuning and changes only the evaluation source to AdvBench-format data. Both settings use fixed repair configurations, and AdvBench-format data do not enter calibration. All values below are in %; means weight the two settings equally.

MethodAttack-source shift HS↓Evaluation-source shift HS↓Mean HS↓Attack-source shift Acc↑Evaluation-source shift Acc↑Mean Acc↑
Attacked80.4087.2083.8093.4093.8093.60
Safe LoRA77.3083.7080.5093.2093.8093.50
SafeMERGE48.2044.4046.3093.6093.6093.60
Safe Delta13.6010.8012.2093.4093.8093.60
Safety at One Shot41.3022.1031.7093.0094.4093.70
LED-Merging3.102.402.7591.0089.6090.30
Panacea22.1013.3017.7092.2091.6091.90
AsFT2.001.501.7592.0092.2092.10
CCTR0.500.100.3089.4092.4090.90

CCTR achieves the lowest HS in both settings, averaging 0.30%, while retaining task accuracies of 89.40% and 92.40%. These results support safety gains under changes in the harmful training or evaluation source and complement the cross-task SORRY-Bench and independent-training evidence.

AuthorsOpenReview ↗

Author Response to Reviewer PDe4 (Part 3/3)

Q2: Does lower harmfulness than the aligned reference result from more refusal? How is benign-response capability affected?

CCTR achieves lower unsafe fulfillment than the aligned reference while retaining benign-request responsiveness close to the reference and baselines such as AsFT. IFEval supports preservation of general instruction following, while the original GSM8K and tinyMMLU-100 results provide evidence of retained mathematical reasoning and knowledge. Together, these findings support safety restoration alongside preservation of benign responses, instruction following, and the evaluated task capabilities. We examine benign-request refusal, general instruction following, and reasoning and knowledge below.

(1) Joint assessment of safety improvement and benign-request refusal.

We evaluate unnecessary refusal on XSTest's 250 safe requests to distinguish safety improvement on harmful requests from response losses on benign ones. All methods use a common Qwen2.5-32B judge, counting full or partial refusals according to the benchmark's criteria. The table reports XSTest together with the IFEval results discussed below, allowing benign responses and instruction following to be considered jointly.

MethodXSTest over-refusal↓IFEval strict prompt-level Acc↑IFEval strict instruction-level Acc↑
Aligned reference32.4%33.09%47.00%
Attacked28.4%32.90%45.80%
Safe LoRA28.8%32.90%45.68%
SafeMERGE26.4%29.57%42.57%
Safe Delta31.2%33.46%47.00%
Safety at One Shot28.4%35.12%48.32%
LED-Merging32.0%34.38%47.12%
Panacea34.4%33.09%46.04%
AsFT32.4%33.09%46.64%
CCTR32.8%32.35%45.68%

CCTR's refusal level on benign requests remains close to the aligned reference and baselines such as AsFT, while its UFR is lower in the original SST-2 SORRY-Bench evaluation. This supports fewer harmful responses alongside benign responsiveness close to the aligned reference.

(2) Preservation of general instruction following.

We further use IFEval to test whether the repaired model follows broader, verifiable generation requirements rather than only completing downstream classification tasks. The experiment uses the official checker on 541 prompts containing 834 instructions. Strict prompt-level accuracy requires every constraint within a prompt to be satisfied, whereas strict instruction-level accuracy measures satisfaction of individual instructions.

Both CCTR accuracies remain close to Attacked, supporting preservation of the measured general instruction-following capability after repair. This complements XSTest by testing whether the model completes generation as requested, rather than whether it unnecessarily refuses a benign request.

(3) Additional evidence from downstream reasoning and knowledge.

We also consider the paper's classification, generative mathematical-reasoning, and knowledge evaluations to examine effects on benign capabilities. In Table 2, CCTR obtains 24.2% GSM8K accuracy at p=0.2p=0.2, close to Attacked's 24.8%. On tinyMMLU-100, CCTR and the aligned reference both score 44%. Together with the added XSTest and IFEval evidence, these results support retaining the measured benign-task and general instruction-following capabilities while reducing harmful responses.


Reviewer_ar4COpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes Closed-Form Cross-Trajectory Repair (CCTR), a post-hoc method for restoring LLM safety after harmful fine-tuning. CCTR addresses the limitations of parameter-only repair by considering differences in hidden-state trajectories between aligned and attacked models. It fits the full cross-trajectory output residual through a utility-constrained, closed-form least-squares solution without gradient-based optimization. Experiments demonstrate strong safety improvements while generally preserving downstream task performance.

Critical strengths

S1. The paper provides a well-motivated perspective on safety repair by accounting for hidden-state trajectory differences. The residual decomposition and diagnostics in Figure 1 and Appendix A support this motivation. S2. CCTR offers a principled, gradient-free repair formulation with promising empirical results across multiple tasks and models. The ablation studies further demonstrate the importance of the trajectory-dependent correction and utility preservation.

Critical weaknesses

W1. Limited interpretation of the cross-trajectory residual. The full residual may capture both safety degradation and legitimate task adaptations. Although the utility constraint mitigates interference, its effectiveness in preserving task-relevant changes could be further clarified. W2. Limited analysis of the final repaired model's behavior. CCTR computes local repairs using frozen activations, whereas earlier patches may change the inputs to subsequent modules. The extent to which these changes affect the realized corrections in the fully repaired model remains insufficiently analyzed. W3. Incomplete discussion of closely related safety repair work. The paper does not discuss NLSR (Yi et al., AAAI 2025), which also investigates training-free safety restoration after harmful fine-tuning using information from aligned and fine-tuned models. Although the repair mechanisms differ, NLSR is closely related to the problem setting. Including this work would provide a more complete positioning of CCTR's contribution.

Questions for authors

Q1. How does the utility constraint prevent unnecessary interference with benign task adaptations when fitting the full cross-trajectory residual? Q2. How do changes in hidden representations after applying earlier patches affect the actual corrections in subsequent modules? Q3. Could the authors discuss the relationship between CCTR and NLSR (Yi et al., AAAI 2025), particularly their differences in repair mechanisms?

6 comments
AuthorsOpenReview ↗

Author Response to Reviewer ar4C (Part 1/4)

Response to Reviewer ar4C

Thank you for recognizing the motivation behind the cross-trajectory residual, the closed-form repair formulation, and the ablation evidence. We provide further clarification and experiments on preserving benign task adaptations, repair behavior in the fully patched model, and the relationship to NLSR.

Below, Harmful Score (HS) denotes the harmful-response rate and Acc denotes task accuracy, both reported in %.

Q1: How does the utility constraint protect benign task adaptations when fitting the full residual?

The utility constraint uses the fine-tuned model's activations on generic benign inputs to limit patch-induced output changes along those directions, preserving existing task functionality without first separating the full residual into safety and task components. Adding the constraint raises SST-2 accuracy from 2.8% to 92.4%, with HS of 0.4%, demonstrating its role in preserving benign adaptations. The task-agnostic utility Top-64 subspace captures 42.76%–60.79% of task-activation energy across the three tasks, indicating shared high-energy representation directions and providing geometric evidence for constraining part of the task-related representations. At patch norms comparable to the isotropic control, CCTR's module-output perturbation on task inputs is 1.74%–2.71%, versus 5.32%–10.58%, supporting reduced task interference through directional constraints rather than merely smaller updates. We discuss functional necessity, representation coverage, and direction-sensitive preservation below.

(1) The utility constraint protects benign task performance.

We ablate the utility constraint on three downstream tasks, comparing the safety and task accuracy of full-residual repair with and without it. Section 4.3, Table 4 shows that removing the constraint keeps HS at or below 0.4% but reduces accuracy to 2.8%, 0.0%, and 1.4% on SST-2, AG News, and GSM8K, respectively. Full CCTR achieves 92.4%, 77.8%, and 24.2% accuracy, with HS of 0.4%, 0.1%, and 1.2%, directly establishing the importance of the utility constraint for preserving benign task performance.

This agrees with Section 3.3, Eq. (6): the utility term directly penalizes patch-induced output changes on the fine-tuned model's benign activations, protecting functionality along observed activation directions.

(2) Task-agnostic utility activations cover part of the task-relevant representation space.

We further examine whether generic benign inputs and downstream task inputs share representation directions, to explain how task functionality can be protected without using task data to construct the patch. For each task's attacked model, we collect activations from 128 independent task-agnostic utility examples and 128 task examples. We measure the task-activation energy captured by the task-agnostic utility Top-64 subspace and compare it with the optimal task-specific subspace of the same dimension and a random subspace. Task examples and labels are used only for diagnosis; the task-specific subspace is likewise only a same-dimensional reference, not part of patch construction.

TaskTask-agnostic utility Top-64 coverageTask-specific Top-64 coverageExpected random-subspace coverage
SST-260.79%88.58%1.05%
AG News49.43%75.11%1.15%
GSM8K42.76%68.88%1.24%

The task-agnostic utility subspace captures substantially more task-activation energy than the random reference, indicating shared high-energy representation directions and providing geometric evidence for constraining part of the task-related representations. The ablation accuracies and output-perturbation results further assess functional preservation, linking representation coverage, patch action, and final task performance.

AuthorsOpenReview ↗

Author Response to Reviewer ar4C (Part 2/4)

(3) Direction-sensitive constraints reduce module-output perturbation on task inputs.

We compare full CCTR, an isotropic constraint, and no utility constraint to test whether protection is explained only by a smaller patch. All three share the safety target, calibration data, solver normalization, and ridge setting. The isotropic control replaces the utility covariance term with a scaled identity matrix that penalizes every direction equally. A single global coefficient per task matches the aggregate Frobenius norm of the patches across all 224 modules, without using HS or accuracy for selection. The aggregate deployed patch norms of the isotropic control and CCTR differ by less than 0.5%; the no-utility control is not norm-matched.

We measure relative module-output perturbation for all three settings on the same 128 held-out task examples with fixed activations. Specifically, we separately sum the squared magnitudes of patch-induced output changes and original module outputs over 32 layers and 224 modules, then take the square root of their ratio and express it as a percentage. This metric measures local module-output changes at fixed inputs; lower values indicate less perturbation.

Repair settingSST-2↓AG News↓GSM8K↓
Full CCTR: activation-covariance constraint1.95%1.74%2.71%
Isotropic control5.57%5.32%10.58%
No utility constraint10.10%9.93%16.73%

At comparable overall update magnitude, CCTR produces less output perturbation than the isotropic control on all three tasks. This supports direction-sensitive preservation by the utility covariance, rather than protection solely through shrinking the overall patch. Together with the ablation and coverage analysis, these results support reduced interference with existing task functionality; the scope of protection still depends on how well the utility data cover task-relevant representations.

Q2: Do corrections estimated on frozen activations remain effective after earlier patches change later inputs?

After all patches are deployed, frozen-trajectory repair achieves more complete safety restoration on all three tasks. Compared with block-wise activation recomputation, frozen repair lowers HS from 6.7% to 0.4% on SST-2, from 3.5% to 0.1% on AG News, and from 26.2% to 1.2% on GSM8K, with comparable or higher task accuracy. Layer-wise input-drift analysis on SST-2 shows smaller utility-input drift with frozen repair than with block-wise activation recomputation at the reported middle-to-late blocks, supporting better control of benign-representation changes accumulated with depth. Realized correction cosines are 0.751–0.774, versus 0.335–0.472 for the block-wise method, showing better directional alignment in the actual forward pass. Recomputed targets have cosines of only 0.063–0.139 with the original targets, indicating that refreshed inputs also change the residuals to be fitted. We examine full-model behavior, layer-wise input changes, realized corrections, and target changes below.

(1) Full-model comparison after all patches are deployed.

We implement block-wise activation recomputation on three downstream tasks to test whether new activations from the repaired prefix improve repair. Before solving each Transformer block, this control recomputes activations and statistics for its seven target modules, then writes the block's patches together. CCTR instead uses the frozen reference and attacked trajectories in Section 3.4 and Algorithm 1. Both methods share calibration data, solver settings, and evaluation protocols. All behavioral metrics come from full-model generation after all 224 patches are deployed, not from local fitting on frozen activations.

The following matched comparison uses p=0.2p=0.2; HS and Acc are both in %.

TaskFrozen HS↓Block-wise HS↓Frozen Acc↑Block-wise Acc↑
SST-20.46.792.493.0
AG News0.13.577.873.4
GSM8K1.226.224.222.4

The frozen method achieves lower HS on all three tasks while retaining substantial task performance. On GSM8K, HS is 1.2% versus 26.2%, with task accuracy of 24.2% versus 22.4%, showing that the safety benefit carries through to generation by the fully repaired model.

AuthorsOpenReview ↗

Author Response to Reviewer ar4C (Part 3/4)

(2) Effects of earlier repairs on later-block inputs.

We directly record hidden states at each decoder-block entrance in the SST-2 models above to quantify deviations of the deployed trajectory from the frozen trajectory. Both methods use the same 128 held-out safety prompts and 128 held-out task-agnostic utility prompts, with fixed tokens, positions, and validity masks, and the original attacked model as a common reference. For each block, we sum the squared magnitudes of the hidden-state differences over all examples and valid tokens, divide by the corresponding sum for the original attacked hidden states, then take the square root and express the result as a percentage.

The table shows the first block and representative middle-to-late blocks, indexed 0–31. Safety and Utility refer to safety and benign inputs, respectively. Entries are frozen / block-wise, in %.

Block indexSafety-input drift: frozen / block-wiseUtility-input drift: frozen / block-wise
00.00 / 0.000.00 / 0.00
80.67 / 0.790.09 / 0.12
121.79 / 3.970.15 / 0.59
163.37 / 7.670.27 / 1.14
205.56 / 12.040.45 / 1.89
248.41 / 15.670.67 / 2.81
2811.98 / 18.230.96 / 3.75
3126.36 / 33.532.18 / 7.30

No module has been patched before the first block, so its input drift is zero. The frozen method has smaller input drift at every reported middle-to-late block, including Block 31, supporting better control of benign-representation changes accumulated with depth. Together with better-aligned output corrections and lower full-model HS, these results support the effectiveness of the frozen design in the actual forward pass.

(3) Realized module-output corrections after inputs change.

We further measure actual linear-module output changes in the fully repaired model to test whether patches remain effective after their inputs change. These changes include both the patch's direct effect on the original frozen input and the effect of upstream input changes propagated through the repaired weights. They therefore reflect deployment more directly than measuring the patch effect at fixed inputs alone.

At the same held-out tokens and positions, we measure two quantities. Correction cosine compares the direction of the realized output change with the original safety target, defined as the reference-model output minus the original attacked-model output; higher values indicate better directional alignment. Utility-output drift is the norm of the actual output change relative to the original output on utility inputs; lower values indicate smaller changes. For both metrics, inner products or squared norms are aggregated over all 224 modules before computing the cosine or norm ratio, rather than averaging module-wise ratios.

TaskFrozen correction cosine↑Block-wise correction cosine↑Frozen utility-output drift↓Block-wise utility-output drift↓
SST-20.7740.3451.11%3.76%
AG News0.7740.3351.17%3.84%
GSM8K0.7510.4722.46%4.74%

The frozen method's realized corrections are more aligned with the original target and produce smaller benign-output changes. The preceding experiment measures representation changes at block entrances, whereas this experiment assesses their functional consequences at module outputs. Together with full-model generation results, these findings support the effectiveness of frozen-trajectory repair in the actual forward pass.

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

Related papers

Loading the map…

Discussion (0)

Sign in to comment.