SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.03850 · ICML · 2025

Vulnerability-Aware Alignment: Mitigating Uneven Forgetting in Harmful Fine-Tuning

Jing Bai, Li Shen, Liang Chen, Kam-Fai Wong, Xueting Han

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2506.03850.json · badge: /api/ran/2506.03850.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ChanLiang/VAA community
Papers with Code archive
4 ran · 1 no recorded run
FunctionStatusWhere it lives
MMD_loss Ran
ran on a synthesized input · constructed an object; no result was computed
ChanLiang/VAA/loss_func/repnoise_loss.py
pointer only (licence: NONE) · get_code("d0d38bfeecb6ed91")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ChanLiang/VAA when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

adapt_dimension_b2a Ran
ran, honoured the contract we drafted
ChanLiang/VAA/loss_func/repnoise_loss.py
pointer only (licence: NONE) · get_code("175778f00233af46")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ChanLiang/VAA when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

masked_token_ce_loss Ran
ran; our contract draft was wrong, not the code
ChanLiang/VAA/loss_func/repnoise_loss.py
pointer only (licence: NONE) · get_code("dbc0448520ee9257")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ChanLiang/VAA when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

register_activation_hook Ran
ran; our contract draft was wrong, not the code
ChanLiang/VAA/loss_func/repnoise_loss.py
pointer only (licence: NONE) · get_code("c605efc9460b6c33")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ChanLiang/VAA when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rep_noise_loss Not yet run
unverified (harvested, no recorded run)
ChanLiang/VAA/loss_func/repnoise_loss.py
pointer only (licence: NONE) · get_code("21971585a423a5b8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ChanLiang/VAA when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
masked_token_ce_loss
brick of this paper's assembly: loss
4 other papers
4 dated earlier
2405.14577 (2024-05)
Representation Noising: A Defence Mechanism Against Harmful Finetuning
2409.18169 (2024-09)
Harmful Fine-tuning Attacks and Defenses for Large Language Models: A Survey
2410.09760 (2024-10)
Targeted Vaccine: Safety Alignment for Large Language Models against Harmful Fine-Tuning via Layer-wise Perturbation
and 1 more not named here
adapt_dimension_b2a
brick of this paper's assembly: helper
3 other papers
3 dated earlier
2409.18169 (2024-09)
Harmful Fine-tuning Attacks and Defenses for Large Language Models: A Survey
2410.09760 (2024-10)
Targeted Vaccine: Safety Alignment for Large Language Models against Harmful Fine-Tuning via Layer-wise Perturbation
2501.17433 (2025-01)
Virus: Harmful Fine-tuning Attack for Large Language Models Bypassing Guardrail Moderation
register_activation_hook
brick of this paper's assembly: helper
3 other papers
3 dated earlier
2409.18169 (2024-09)
Harmful Fine-tuning Attacks and Defenses for Large Language Models: A Survey
2410.09760 (2024-10)
Targeted Vaccine: Safety Alignment for Large Language Models against Harmful Fine-Tuning via Layer-wise Perturbation
2501.17433 (2025-01)
Virus: Harmful Fine-tuning Attack for Large Language Models Bypassing Guardrail Moderation
MMD_loss
brick of this paper's assembly: loss
1 other paper
1 dated earlier · 1 only as an assembly brick
2405.14577 (2024-05)
Representation Noising: A Defence Mechanism Against Harmful Finetuning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Harmful fine-tuning (HFT), performed directly on open-source LLMs or through Fine-tuningas-a-Service, breaks safety alignment and poses significant threats. Existing methods aim to mitigate HFT risks by learning robust representation on alignment data or making harmful data unlearnable, but they treat each data sample equally, leaving data vulnerability patterns understudied. In this work, we reveal that certain subsets of alignment data are more prone to forgetting during HFT across different fine-tuning tasks and exhibit lower robustness compared to other subsets. Inspired by these findings, we propose Vulnerability-Aware Alignment (VAA), which estimates data vulnerability, partitions data into "vulnerable" and "invulnerable" groups, and encourages balanced learning using a group distributionally robust optimization (Group DRO) framework. Specifically, VAA learns an adversarial sampler that samples examples from the currently underperforming group and then applies group-dependent adversarial perturbations to the data during training, aiming to encourage a balanced learning process across groups. Experiments across four fine-tuning tasks demonstrate that VAA significantly reduces harmful scores while preserving downstream task performance, outperforming baselines. The code is available at https://github.com/ChanLiang/VAA.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2506.03850")
get_code_for_paper("2506.03850")
have("2506.03850")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2506.03850.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2506.03850.svg)](https://syntology.ai/paper/2506.03850)

Connect an agent — have() is free.