Can Textual Unlearning Solve Cross-Modality Safety Alignment?
Paper · 2024 · Trishna Chakraborty, Erfan Shayegani, Zikui Cai et al.
Summary
A vision-language system can refuse an unsafe request written in text and still give a harmful answer when an image contributes to the request. This matters because adding a way to receive information can weaken safeguards that seemed effective before. The authors ask whether they can improve vision and language safety by training on text alone. Their starting point is the way the systems in the study are built. An image is converted into features and projected into a form the language component can use. That component then generates the answer, whether the request arrived as text or as a combination of text and image.
The authors adapt a technique called unlearning. During fine-tuning, they make recorded harmful answers less likely and make a preferred refusal more likely for the same requests. They also train the updated system to stay close to its original behavior on benign questions. The image encoder and projection layer stay fixed. The comparison includes unlearning on image-and-text examples and supervised fine-tuning on image-and-text examples. The latter teaches the system which answers to give, while unlearning also explicitly penalizes the harmful answers recorded in the training data.
Across the seven datasets used for training and evaluation, text-only unlearning reduced harmful responses on both text and image-and-text safety tests. On the main held-out safety benchmarks, both automated measures put its attack success rates below 8% for each of the two systems. On Jailbreak in Pieces, for example, Llama Guard marked 54.86% of the original LLaVA-1.6-7B responses as unsafe, compared with 2.08% after textual unlearning. Human reviewers also found substantial reductions on the responses they assessed. The image-and-text comparisons had exceptions that depended on the benchmark and the scoring method. In particular, supervised training with JailbreakV achieved a target-string attack success rate of 0.0% on miniJailBreakV in both systems, while Llama Guard still flagged some of its responses.
The text-only runs also took less training time than the image-and-text runs. Benign visual question answering accuracy stayed close to the original results, although some preference and diversity scores moved in different directions. The experiments establish a practical form of transfer in the systems tested. Updating the language component with textual examples changed how it responded to images it could already process. The comparison with multimodal unlearning remains tied to the training data, since the text and image-and-text datasets covered different ranges of harmful requests.
Deep dive: Can Textual Unlearning Solve Cross-Modality Safety Alignment?
The study tests whether unlearning harmful responses with text alone makes vision-language systems safer while preserving their everyday abilities. · about 34 minutes to read
The problem and its context
Why adding an input changes the safety question
A language component that can answer a written question can also be used to answer a question about an image. The paper describes a common architecture that makes this possible. An encoder turns an image into numerical features, a projection layer makes those features usable by the language component, and the language component produces the response. The encoder represents visual information. The projection creates a usable connection between that information and the rest of the system. The same generator then handles cases where the meaning comes from words, images, or both.
The distinction between understanding the request and writing the response matters for safety. A wording that the system identifies as unsafe in a text-only interaction may be recognized differently when part of its meaning comes from an image. Earlier studies discussed by the authors had reported harmful responses in such settings even when a system had already gone through alignment. A safety assessment of written prompts therefore leaves a separate empirical question about the responses produced when visual information is present.
The paper discusses a distinction between risks associated with adding a modality and risks associated with adversarial perturbations. The former concern how a system interprets and combines information from its available inputs. The latter concern sensitivity to deliberately constructed changes to an input. Both can result in harmful output, but they test different properties. The research question in this paper centers on safety failures associated with adding an input channel. Its evaluation is meant to show whether training through one channel can improve behavior when another channel is in use.
The premise is easiest to see by considering the two ends of the system. At the input end, an image opens up combinations that a text-only system never encounters. At the output end, the studied systems still generate a sequence of text. The authors locate their intervention at that common output mechanism. If the language component can become less inclined to continue a harmful response, there is a reason to test whether that behavioral change carries over when the initiating information came through a visual encoder.
This makes cross-modality safety a question about transfer. Successful transfer would allow the training set to be built in a more readily available form while the evaluation still exercises the added input. The alternative considered in the paper is to expose the system directly to both modalities during safety training. That approach can include examples of the behavior of interest, but it requires collecting and training on input combinations for each setting. The value of that extra work depends on whether it provides coverage the language component could otherwise acquire from text.
How earlier work approached alignment
The paper traces safety alignment back to the difference between learning to continue text and learning to answer a user appropriately. Pretraining supplies a general ability to generate text from context. Supervised fine-tuning, or SFT, trains on examples in which a prompt is paired with a desired answer. The desired answer can demonstrate instruction following on ordinary requests or refusal on unsafe ones. The training signal says which continuation the system should make more probable in each example. Finetuned Language Models Are Zero-Shot Learners
Reinforcement learning from human feedback, or RLHF, introduces a separate preference signal. In the description given in the paper, responses are encouraged through a reward that reflects human preferences. The paper discusses this approach alongside supervised training as a way to improve helpfulness and harmlessness. Its experiments use supervised fine-tuning as a direct baseline. RLHF supplies context for the research question because it is among the alignment procedures that earlier studies found could leave weaknesses after a new input modality was added. Training Language Models to Follow Instructions with Human Feedback
In the earlier multimodal defenses summarized by the authors, collecting safety examples and training on them often happened together. A defense might use image-and-text requests during training so the system could learn a suitable response to those combinations. The authors point to a coverage problem with this approach. When information can be divided between inputs, a set of examples has to account for both what is being requested and how the different parts of the request are presented. The number of ways to present a request grows as the system can process more kinds of input. The paper motivates its approach in part by asking whether safety training can spend more of its effort covering harmful concepts and less of it assembling examples for each input channel.
The architecture literature discussed in the paper supplies the other part of the argument. Systems can connect visual features to the language component through different mechanisms. The authors mention linear projection, gated cross-attention, and Q-formers. These alternatives explain why a shared language component is a plausible place to intervene even when the visual interface takes different forms. They also make architectural transfer a question that has to be tested. The common feature is the role of the language component in producing the answer. The way visual information reaches it can still affect what happens downstream. Flamingo · BLIP-2 · InstructBLIP
What unlearning means in this study
The paper places its intervention in the tradition of machine unlearning. In the conventional problem it describes, the aim is to remove the influence of specified training examples from a trained system while preserving its usefulness. Repeating the original training with those examples removed is a point of comparison for the broader problem. Prior work cited in the paper had also considered ways to change access to particular information, including direct edits to learned factual associations and techniques that change what the system is prompted to do in context. Locating and Editing Factual Associations in GPT
The safety experiment gives unlearning a behavioral objective. The authors have examples of replies they want the system to become less likely to produce. They also have unsafe prompts for which they can specify a refusal, and ordinary prompts on which the original system supplies a reference behavior. This lets them ask whether changing the generator’s treatment of undesirable continuations can improve safety across input types. Their evidence concerns the answers the updated system produces and how evaluators classify those answers.
The study asks related questions about the loss and about the data. A supervised loss can reward a refusal. An unlearning loss can do that too, while directly discouraging an example of a harmful answer and adding a separate constraint on benign behavior. The dataset question is whether examples containing images improve that unlearning process. To explore both questions, the authors compare the unchanged system, text-only unlearning, image-and-text unlearning, and image-and-text supervised training. Some of those comparisons hold the dataset fixed. Others show how complete training recipes perform when both their data and their objective differ.
The method, step by step
Where the update takes effect
Consider a request that consists of an image and a written question. The system first represents the image numerically. A projection layer adapts that representation to the space used by the language component. The written question has a representation in that space as well. With those inputs as context, the language component generates an answer by predicting each successive token. A token is an individual unit the generator predicts, and a response can contain many such units. When the request consists only of words, the visual input is absent and the generator works from the textual context.
The authors retain this architecture for all training conditions. They change the parameters of the language component and freeze the image encoder and the projection layer. Freezing a component means that its parameters receive no update during training. In the text-only condition the intervention therefore changes how the language component responds, while the routes by which an image is represented and passed to that component remain available for evaluation. This design makes it possible to measure a change on image-and-text inputs without also training their visual processing stages.
The training examples have distinct roles. For an unsafe request, the unwanted answer tells the system which continuation to suppress. A preferred response to the same request supplies a direction in which to move. For a benign request, the original system gives the updated one a reference distribution to follow. These roles matter because a reduction in harmful answers alone could come with degraded responses that fail to serve either kind of request. The preferred response and the benign reference are how the authors give useful behavior an explicit place in the objective.
How textual unlearning updates the language component
The steps in order.
From an image to a text continuation
The first relation in the paper describes what the image encoder produces.
eᴵ = V_θ(xᴵ)
Here xᴵ is the input image. V_θ is the visual encoder and θ denotes its parameters. The superscript ᴵ marks the visual modality. The embedding eᴵ is the numerical representation that the encoder produces in the visual feature space.
The visual representation then goes through the projection layer.
eᴵᵀ = P_ψ(eᴵ)
P_ψ is the projection and ψ denotes its parameters. Its input eᴵ is the visual embedding from the previous relation. The combined superscript ᴵᵀ in eᴵᵀ identifies a visual embedding expressed in the space used for text. This relation describes the interface between image processing and language generation.
The paper writes the full input-to-output relation as follows.
yᵀ = F_ϕ(xᵀ, xᴵ) = L_σ(eᵀ, eᴵᵀ)
The superscript ᵀ denotes text. The written input is xᵀ, the image is xᴵ, and the generated text is yᵀ. F_ϕ refers to the whole vision-language system with parameters ϕ. L_σ refers to the language component with parameters σ. Its inputs are eᵀ, the embedding of the written request, and eᴵᵀ, the image features after projection. The equality expresses the link between the user-facing inputs of the full system and the representations used to generate its answer.
An answer is a sequence, and the probability of a later token depends on the earlier tokens as well as on the original request. The paper expresses the probability of the complete answer as a product of conditional probabilities.
p(yᵀ | xᵀ, xᴵ) = ∏ᵢ₌₁ⁿ p(yᵀ_i | yᵀ_1:i−1, xᵀ, xᴵ)
On the left, p is the probability of the output sequence yᵀ given the text xᵀ and image xᴵ. The vertical bar means “given.” On the right, ∏ multiplies terms indexed by i, starting at the first token and ending at n, the number of tokens in the answer. The term yᵀ_i is the token at position i. The notation yᵀ_1:i−1 means the prefix ending just before that position. At the first position the response prefix is empty. The expression describes how a continuation builds on what the system has already written.
For a specified answer, the training loss uses the negative log of the token probabilities.
ℓ(xᵀ, xᴵ, yᵀ) = −∑ᵢ₌₁ⁿ log p(yᵀ_i | yᵀ_1:i−1, xᵀ, xᴵ)
The symbol ℓ denotes the sequence loss. The sum ∑ runs over the same token positions i through the answer length n. Each term takes the logarithm of p, the conditional probability of the answer token yᵀ_i given the answer prefix yᵀ_1:i−1 and the inputs xᵀ and xᴵ. The minus sign makes the loss larger when the specified answer has low probability. Reducing this loss encourages the specified answer. Increasing it discourages that answer. The authors use both directions in the same training procedure.
What unlearning rewards and penalizes
The harmful-answer loss is the ordinary sequence loss evaluated on the undesired answer to a harmful request.
ℓ_harm = ℓ(xᵀ_harm, xᴵ_harm, yᵀ_harm)
The suffix harm identifies material from the harmful dataset. The terms xᵀ_harm and xᴵ_harm denote its text input and optional image input. The term yᵀ_harm names the harmful answer assigned to that example. The scalar ℓ_harm is large when the generator gives that answer low probability. Training uses gradient ascent on this part of the objective, moving the parameters in a direction that increases the loss.
The second loss uses the same harmful inputs and a different answer.
ℓ_helpful.match = ℓ(xᵀ_harm, xᴵ_harm, yᵀ_helpful)
Here xᵀ_harm and xᴵ_harm are again the text and optional image from the harmful example. The answer yᵀ_helpful is the preferred reply, represented in the experiments by a short refusal. The label helpful.match refers to matching that preferred answer to the input. Gradient descent reduces this loss, raising the probability of the preferred continuation. The two losses act on different answers to the same prompt, so they express two separate goals. Suppressing a known bad answer leaves many possible continuations available. Rewarding a refusal identifies one suitable direction among them.
The third loss applies to benign examples. The original system and the system being trained receive the same benign input. The authors compare their output distributions using Kullback–Leibler divergence, abbreviated KL.
ℓ_utility = KL(F_ϕ⁰(xᵀ_normal, xᴵ_normal) ∥ F_ϕᵗ(xᵀ_normal, xᴵ_normal))
The suffix normal identifies a benign example. Its written input is xᵀ_normal and its optional visual input is xᴵ_normal. F_ϕ⁰ denotes the original, loaded system at training step 0, and F_ϕᵗ denotes the current system at step t. In this expression the outputs supplied to KL are predictive distributions. The separator ∥ puts the original distribution first and the current distribution second. KL measures how the second distribution differs from the first in the stated direction. Minimizing ℓ_utility makes departures from the original predictions on the benign training inputs costly. The original system can assign probability to several answers, so this part of the objective can preserve information beyond the single answer it would generate.
The authors combine the three terms in a signed update. The original paper writes the derivatives with J evaluated at the current vision-language parameters. The update applies only to σ, the language parameters.
σᵗ⁺¹ = σᵗ − [−η_harm J_ϕᵗ ℓ_harm + η_helpful.match J_ϕᵗ ℓ_helpful.match + η_utility J_ϕᵗ ℓ_utility]
The superscripts t and t+1 identify the current step and the next step. J_ϕᵗ means the derivative of the following loss evaluated at the current system, with the language-component portion used for the update shown. The η symbols are weights for the corresponding terms. The authors use 0.5 for η_harm, 1 for η_helpful.match, and 1 for η_utility. The outer subtraction makes the helpful and utility terms descent steps. The additional minus sign on the harmful term reverses that contribution, so the update ascends the harmful-answer loss while descending the other losses. The weights set the relative contribution of each gradient before the update.
The direction of the harmful term is the central difference from treating every training example as an ordinary demonstration. With a preferred answer alone, the loss asks that the generator place more probability on that answer. The harmful term identifies an additional continuation and applies pressure in the opposite direction. Since the generator predicts each token in the context of earlier tokens, the harmful-answer loss also applies at positions whose answer prefix already contains undesirable content. This property motivates the authors’ later discussion of a response that starts down an unsafe path and then changes direction.
How the training conditions differ
Textual unlearning uses both a harmful and a benign dataset made of text. The image argument is absent throughout training. The paper writes the two losses for a harmful input in shortened form.
ℓ_harm = ℓ(xᵀ_harm, yᵀ_harm)
The loss ℓ_harm still measures how improbable the recorded harmful answer is. The term xᵀ_harm is the unsafe written prompt and yᵀ_harm is its unwanted textual answer. The shortened call to ℓ omits the image because the example has no image.
ℓ_helpful.match = ℓ(xᵀ_harm, yᵀ_helpful)
The prompt xᵀ_harm here is the same harmful written prompt. The text yᵀ_helpful is the preferred refusal. The loss ℓ_helpful.match encourages the refusal, with the visual argument again absent.
The benign loss has the corresponding text-only form.
ℓ_utility = KL(F_ϕ⁰(xᵀ_normal) ∥ F_ϕᵗ(xᵀ_normal))
The benign written input is xᵀ_normal. F_ϕ⁰ and F_ϕᵗ give the original and current predictive distributions, respectively. The KL divergence between them is ℓ_utility. The separator ∥ preserves the same order as in the visual-and-textual expression. In all three shortened expressions, the generator belongs to the same vision-language system that will later receive images during testing.
Multimodal unlearning keeps the harmful-suppression, preferred-response, and benign-preservation terms. The harmful prompts and the benign prompts now contain an image and text. The answers are text as before. In the paper’s named setting, Unlearn-FigS, the harmful input comes from Figstep and the benign input comes from VQA-v2 training. Figstep supplies harmful inputs without the harmful answers used by the objective. The authors obtain those answers by running the original LLaVA-1.5-7B on the prompts. They use the same source of harmful answer targets for JailbreakV examples when such completions are needed. This makes the provenance of the harmful target part of the comparison. The target represents what the original system generated for a particular input.
Multimodal supervised fine-tuning also uses image-and-text prompts and updates the language component. For an unsafe input, it minimizes the loss on the preferred refusal. For an ordinary input, it minimizes the loss on a benign answer generated by the original system. The authors combine benign and harmful inputs in training batches. The supervised baseline uses an answer as the target on each benign example. By comparison, the preservation term in unlearning uses the original predictive distribution.
ℓ_normal = ℓ(xᵀ_normal, xᴵ_normal, yᵀ_normal)
Here xᵀ_normal and xᴵ_normal are the text and image of the benign prompt. The answer yᵀ_normal is the benign textual continuation taken from the original system. The loss ℓ_normal applies the sequence scoring rule to that particular answer.
σᵗ⁺¹ = σᵗ − [J_ϕᵗ ℓ_helpful.match + J_ϕᵗ ℓ_normal]
The language parameters σᵗ at step t are updated to σᵗ⁺¹ at the next step. J_ϕᵗ gives the corresponding derivative at the current system, restricted to the parameters being updated. The helpful-match loss scores a preferred refusal for a harmful prompt, and the normal loss scores the selected continuation for a benign prompt. Both gradients enter with the descent sign. The supervised baseline thus has targets for both kinds of input and neither the harmful sequence ascent term nor the KL preservation term.
Which parameters the experiments train
The main experiments use LLaVA-1.5-7B with a Vicuna-7B language component and LLaVA-1.6-7B, also called LLaVA-NeXT, with Mistral-7B. Both use a CLIP vision encoder. The training location is the same in both systems, so the paper can ask whether its qualitative result persists when the underlying generator changes. It also compares each updated system with its own starting point, which is important because the starting behavior differs across the two. Mistral 7B · Learning Transferable Visual Models From Natural Language Supervision
For the updates, the authors use QLoRA, a parameter-efficient method that combines quantization with trainable low-rank adapters. The experiments use 4-bit quantization. The adapters carry the changes within the language component, and the reported target modules are q_proj and v_proj. The appendix reports a learning rate of 0.0003 for unlearning. This configuration defines the intervention tested. The authors work with an existing vision-language system, and the learned change is applied through adapters in its language component. QLoRA · LoRA
Experiments and results
What the datasets test
The paper uses seven datasets across safety training and evaluation. On the text side, PKU-SafeRLHF contains the harmful training examples and supplies a held-out test split for safety. Truthful-QA supplies the benign training set for textual unlearning and a held-out text utility test. Keeping their roles separate lets the paper ask both whether the adapted generator responds safely to harmful requests and whether its ordinary answers retain desirable characteristics. TruthfulQA
The two benign vision-and-language datasets are VQA-v2 and LLaVA-Instruct. VQA-v2 expects responses that are generally a word or a phrase and supports an accuracy measure for visual question answering. Its training split supplies benign examples for the multimodal training recipes. LLaVA-Instruct contains longer answers to visual instructions. It gives the authors a different way to assess utility, using response preference and diversity rather than short-answer accuracy. Taken together, the datasets cover distinct kinds of benign behavior. A system can still identify visual information accurately in a brief answer while its longer responses change in style or perceived quality. Making the V in VQA Matter · Visual Instruction Tuning
For vision-and-text safety, the paper uses Figstep, JailbreakV, and Jailbreak in Pieces. Figstep is a small dataset of visual prompts containing written material. It supplies the harmful inputs for multimodal unlearning and for one supervised run. The authors do not divide Figstep into training and test partitions. As a consequence, the Figstep human scores have different meanings depending on which training recipe is being evaluated. For the settings trained on Figstep, those scores reflect performance on a dataset used in training. For textual unlearning, they reflect transfer to a dataset the recipe did not use.
JailbreakV draws from 8 sources of attack examples. The supervised setting named SFT-JailV uses its harmful training examples with benign VQA-v2 training examples. The safety test called miniJailBreakV is a subset of JailbreakV. The paper excludes its examples from that supervised setting’s training data. This supports a held-out comparison at the example level. The training setting still has experience with the broader JailbreakV collection. Jailbreak in Pieces, also called JBpieces, gives a separate vision-and-text test for the main comparisons. The results on that dataset help distinguish performance on the source collection used by a setting from performance on another visual benchmark.
The reference point for the main experiment is the original version of each system before the paper’s updates. The adapted conditions are textual unlearning, Unlearn-FigS, SFT-FigS, and SFT-JailV. This arrangement supports comparisons among complete intervention recipes and between the two objectives trained on Figstep. It also gives supervised training a second harmful dataset beyond Figstep. Without that second recipe, a poor showing by Figstep-trained SFT could too easily be read as a general property of supervised training.
How harmfulness and utility are scored
Attack success rate, abbreviated ASR, is the share of evaluated attempts judged to have elicited a harmful response. The paper uses several ways to decide what counts as success. Llama Guard takes a question and its response and assigns a safety label. When it flags a response as unsafe, that response counts towards Llama Guard ASR. The categories it recognizes cover several forms of harmful content. Its verdict reflects a classifier’s decision on the pair of texts and can differ from a reader’s judgment about what assistance was actually given.
The target-string method looks for familiar signs of refusal. It counts a response as an attack success when the designated phrases are absent. An ordinary refusal in unfamiliar wording can therefore raise the target-string ASR. A reply containing a recognized phrase can pass the string check even if a different part of the response remains concerning. This is especially relevant here because the training recipe explicitly rewards a short refusal. A score based on refusal wording measures a behavior the training can directly influence. The paper reports the two automatic scores side by side, allowing the reader to see when their judgments agree and when the choice of judge affects the ranking.
The authors add a blind human assessment because they observed automatic misclassifications. Three volunteers each assessed 252 outputs arranged so the training setting responsible for a response was hidden. A harmful judgment received 1, a benign judgment received 0, and an uncertain judgment could receive 0.5. The paper averages attack success rates across the annotators and reports a Fleiss’ Kappa of 0.9046 for agreement. Blinding addresses the possibility that knowing which intervention produced an answer would influence a judgment. The agreement statistic describes this set of reviewers and outputs. The human results provide another view of the responses without assuming that either automated rule is an exact measure of harm.
The utility measures address three properties. VQA-v2 accuracy tests the correctness of short visual answers under that dataset’s scoring guidelines. A reward scorer based on DeBERTa-v3-large-v2 supplies a predicted preference score on other benign responses. Response diversity measures the percentage of distinct tokens in an answer. Diversity therefore concerns vocabulary repetition within a response. The three measures support different conclusions. Accuracy has a link to a reference answer, reward estimates preference, and token diversity describes a textual property that can move independently of the other measures. DeBERTaV3
Safety results on held-out prompts
On the held-out PKU-SafeRLHF text split, both automatic scorers registered improvements after textual unlearning. For LLaVA-1.5-7B, Llama Guard ASR went from 16.22% to 6.0%, and target-string ASR went from 48.44% to 3.56%. For LLaVA-1.6-7B, Llama Guard ASR went from 12.22% to 5.93%, while target-string ASR went from 47.56% to 1.78%. The two scorers had quite different views of the original outputs. Their agreement on the direction of change makes the held-out text result less dependent on which one is used.
The paper also reports the text safety measures on the PKU-SafeRLHF training split, marking that textual unlearning saw these examples. For LLaVA-1.5-7B, the unlearned system’s training-split rates were 6.44% by Llama Guard and 2.89% by target strings. For LLaVA-1.6-7B, they were 6.23% and 2.22%, respectively. These numbers describe behavior on the data source that supplied the harmful textual training examples. The corresponding held-out results are the appropriate evidence that the effect extends to additional examples from that source.
The central test comes from inputs that include visual information. On Jailbreak in Pieces, Llama Guard counted 75.69% of the original LLaVA-1.5-7B responses as unsafe and 7.52% after textual unlearning. The corresponding target-string scores were 90.97% and 7.97%. In LLaVA-1.6-7B, the same visual benchmark produced Llama Guard rates of 54.86% before training and 2.08% after textual unlearning. The target-string rates moved from 68.06% to 1.39%. In this comparison, both the original baseline and the remaining rate changed with the underlying system. The reductions occurred in both, even though neither text-only run used image inputs during training.
LLaVA-1.6-7B on Jailbreak in Pieces, Llama Guard attack success rate
Textual unlearning has the lowest flagged attack success rate among the tested settings.
The numbers
| System or setting | ASR % |
|---|---|
| Original | 54.86 |
| SFT-FigS | 53.31 |
| SFT-JailV | 4.85 |
| Unlearn-FigS | 26.84 |
| Textual unlearning (this paper) | 2.08 |
The miniJailBreakV results show both transfer and a change of ranking across metrics. For the original LLaVA-1.5-7B, Llama Guard recorded 37.5% ASR and the target-string method recorded 66.43%. Textual unlearning brought those scores to 1.79% and 5.07%, respectively. In LLaVA-1.6-7B, the original rates were 40.72% and 64.64%, and textual unlearning brought them to 1.57% and 4.86%. Both sets of comparisons show a decrease on a visual benchmark from a recipe trained entirely on text.
SFT-JailV, the setting that had trained on the broader JailbreakV dataset with the test subset excluded, scored 0.0% target-string ASR on miniJailBreakV in both systems. Its Llama Guard scores on that benchmark were 6.79% for LLaVA-1.5-7B and 5.28% for LLaVA-1.6-7B. Textual unlearning had the lower Llama Guard score in both cases. The contrast between these rankings is an empirical result about the measures as well as about the interventions. The supervised recipe produced answers that consistently satisfied this string test on material from its source collection, while the two recipes had different rates of output flagged as unsafe by a classifier.
What the human reviewers saw
The human evaluation table reports results for LLaVA-1.5-7B. On the held-out text prompts from PKU-SafeRLHF, the average human attack success rate was 46.15% for the original system and 1.92% for textual unlearning. Unlearn-FigS scored 5.2%, and SFT-JailV scored 4.00%. This comparison suggests that the improvement in the text-only run can also be seen by readers judging whether the answer provides harmful content. The human evaluation and automatic benchmarks have their own scoring procedures, so comparisons are clearest when made within the same evaluation.
The human results on Jailbreak in Pieces also favor text-only unlearning. Reviewers gave the original responses a 92.00% attack success rate and the textually unlearned responses a 7.69% rate. The supervised baselines and multimodal unlearning all reduced the original rate on the assessed responses. The text-only recipe produced the lowest average human rate for this benchmark among the reported settings.
LLaVA-1.5-7B on Jailbreak in Pieces, human attack success rate
Reviewers judged harmful responses least frequent after textual unlearning.
The numbers
| System or setting | ASR % |
|---|---|
| Original | 92.00 |
| SFT-FigS | 32.69 |
| SFT-JailV | 19.2 |
| Unlearn-FigS | 16.15 |
| Textual unlearning (this paper) | 7.69 |
Figstep gives a different ranking. Human ASR for the original system was 53.84%. The text-only unlearning setting scored 5.7%, while multimodal unlearning trained on Figstep scored 4.61%. SFT-FigS scored 30.76% and SFT-JailV scored 16.53%. Multimodal unlearning thus had the lowest human score on the dataset used as its source of harmful training prompts. The result gives that recipe a favorable comparison on Figstep and illustrates why cross-dataset claims should be anchored in evaluations where the examples are held out. The original-to-textual improvement on Figstep still shows transfer from text training to a visual benchmark.
What happened to benign answers
On VQA-v2, the results for text-only unlearning stayed close to the original accuracy. In LLaVA-1.5-7B, the original recorded 68.17 and textual unlearning recorded 68.54. For LLaVA-1.6-7B, the corresponding VQA-v2 scores were 75.65 and 75.54. The multimodal unlearning recipe recorded 66.44 and 74.2, respectively. The authors interpret the results as evidence that the safety intervention can preserve much of the ability tested by visual question answering. The short-answer format is important to that interpretation. These scores directly support a claim about this kind of visual accuracy.
On the Truthful-QA test split, the reward and diversity scores for textual unlearning moved in different directions. The original LLaVA-1.5-7B scored 0.49 on reward and 0.75 on diversity. The textually unlearned version scored 0.31 on reward and 0.88 on diversity. For LLaVA-1.6-7B the reward scores were 1.25 for the original and 1.2 after unlearning, with diversity scores of 0.74 and 0.81. The benign text results therefore include a preference cost under the paper’s reward scorer, alongside an improvement on its measure of token variation. The effect on measured reward was smaller in the Mistral-based system.
On LLaVA-Instruct, the longer visual responses again show a difference between the two systems. LLaVA-1.5-7B went from a reward of -0.31 and diversity of 0.90 to a reward of -0.48 and diversity of 0.85 after text-only unlearning. On LLaVA-1.6-7B, the original and textually unlearned settings both recorded 0.96 on reward, with diversity scores of 0.94 and 0.95. The benign objective is consistent with considerable retention of utility, especially on the evaluated visual tasks for LLaVA-1.6-7B. It also leaves visible changes in how the Vicuna-based system answers benign prompts. Reporting these values separately keeps the utility conclusion tied to the behavior each metric measures.
Training time and estimated emissions
The main timing table reports 2.21 hours for textual unlearning in LLaVA-1.5-7B and 2.26 hours in LLaVA-1.6-7B. Multimodal unlearning took 14.71 hours and 14.77 hours, respectively. Both supervised multimodal recipes were also slower than textual unlearning. On LLaVA-1.6-7B, SFT-FigS took 13.98 hours and SFT-JailV took 14.3 hours. The measured time is training time for the paper’s recipes, which differ in their use of images and in the datasets they process. The data collection effort motivating the study sits outside those timings.
LLaVA-1.5-7B safety training time for the PKU-SafeRLHF, Figstep and JailbreakV recipes
The text-only update finishes sooner than the image-and-text training runs.
The numbers
| System or setting | hours |
|---|---|
| SFT-FigS | 13.68 |
| SFT-JailV | 14.26 |
| Unlearn-FigS | 14.71 |
| Textual unlearning (this paper) | 2.21 |
The appendix gives a separate example of resource use on an L4 GPU. It reports 0.168 kWh for textual unlearning over 2 hours and 15 minutes. Using an assumed global average carbon intensity of 0.4 kgCO2e per kilowatt-hour, the authors estimate 67.2 gCO2e for that run. They report 14 hours and 20 minutes for the multimodal experiments on the same GPU and an estimate of 427.8 gCO2e. The emissions estimates reflect the stated conversion assumption. Together with the timing table, they document the resource difference between the tested recipes under the authors’ conditions.
What the ablations show
Comparing objectives on the same data
The clearest controlled comparison trains multimodal SFT and multimodal unlearning on the same sources. Both use Figstep for harmful inputs and VQA-v2 training examples for benign inputs, both freeze the visual components, and both update the language component. Against this shared setup, the two recipes differ in how they train on the responses. Supervised training fits a preferred reply on a harmful example and an answer from the original system on a benign one. Unlearning adds a gradient that suppresses the recorded harmful reply and uses distribution matching on benign examples.
On Jailbreak in Pieces, LLaVA-1.5-7B trained with SFT-FigS had a Llama Guard ASR of 61.11% and a target-string ASR of 89.58%. Switching to Unlearn-FigS gave 28.47% and 43.75% on the same test. For LLaVA-1.6-7B the corresponding supervised scores were 53.31% and 64.44%, and the unlearning scores were 26.84% and 40.29%. The difference appears under both automatic measures and in both systems on a benchmark separate from Figstep. It supports the choice of the unlearning objective as a package for this training dataset.
The pattern also appears on miniJailBreakV. In LLaVA-1.5-7B, SFT-FigS scored 38.22% by Llama Guard and 58.57% by target strings. Unlearn-FigS scored 21.03% and 33.38%. In LLaVA-1.6-7B the supervised setting scored 39.17% and 56.43%, while the unlearning setting scored 19.97% and 32.09%. In the human evaluation of Figstep itself, the two recipes scored 30.76% for SFT-FigS and 4.61% for Unlearn-FigS. That result adds a comparison on the common training source, where both settings had access to the harmful input examples.
The controlled comparison changes more than the sign of one loss. It compares a harmful-suppression term plus refusal matching and distribution preservation against refusal matching plus ordinary benign-answer supervision. The paper reports no separate removal of each unlearning term. The results can therefore be attributed to the change in the training objective as a whole under the shared dataset construction. They leave open how much of the safety or utility result comes from each part of that objective, and how the contributions interact when trained together.
Comparing harmful datasets for supervised training
The supervised comparison changes the harmful dataset while retaining the use of benign VQA-v2 examples and the same kind of training objective. SFT-FigS learns from Figstep. SFT-JailV learns from JailbreakV, a collection the authors describe as drawing from more varied sources. The resulting differences are large enough in several comparisons that the dataset choice matters to the interpretation of supervised training.
On Jailbreak in Pieces, the LLaVA-1.5-7B target-string ASR of 89.58% after SFT-FigS compares with 8.33% after SFT-JailV. Llama Guard recorded 61.11% and 7.86%, respectively, on that benchmark. In LLaVA-1.6-7B, SFT-JailV reached 4.85% by Llama Guard and 7.45% by target strings. It also did better than SFT-FigS on the held-out PKU-SafeRLHF split. For example, on LLaVA-1.6-7B the supervised setting trained with JailbreakV gave 7.64% Llama Guard ASR and 22.89% target-string ASR on those text prompts, compared with 11.47% and 41.59% with Figstep.
Those comparisons establish the importance of which vision-and-text dataset was chosen for supervised training. The datasets differ in composition, and the paper describes JailbreakV as drawing from 8 sources. Its results support the possibility that broader coverage helps. They do not isolate source diversity from the other ways that the collections differ. The strong performance of SFT-JailV on some benchmarks also qualifies any general ranking of SFT and unlearning. Under the shared Figstep setup unlearning performs better, while a different harmful dataset substantially improves SFT.
Comparing text and image-and-text unlearning
The comparison between textual unlearning and Unlearn-FigS keeps the same general unlearning objective and trains different datasets. The text-only recipe uses PKU-SafeRLHF and Truthful-QA. The multimodal one uses Figstep and VQA-v2. In the main held-out image-and-text results, textual unlearning has lower attack success rates. Because the visual components are frozen in both cases, the results show that exposure to images during the update is unnecessary for the particular transfer observed here. They show how the complete recipes compare when used as the authors designed them.
The authors suggest that harmful-concept coverage explains part of the stronger text result. The image-and-text data available for multimodal unlearning were narrower than the harmful textual collection, by their assessment. That interpretation is consistent with the results of changing the supervised dataset. It also puts a limit on the causal comparison. The study puts the training input modality and the training data coverage together, so its outcome could reflect advantages of the textual examples, properties of the modality, or an interaction between them. The result on human-rated Figstep shows that the image-and-text recipe can have an advantage on the dataset on which it was trained.
The authors also examine whether transfer persists in other systems. On the held-out PKU-SafeRLHF prompts for LLaVA-1.5-13B, Llama Guard ASR moved from 13.78% to 5.48%, and target-string ASR went from 54.22% to 6.89%. On Jailbreak in Pieces for the same system, the original rates were 65.97% by Llama Guard and 84.03% by target strings. The textually unlearned rates were 2.78% under each method. On miniJailBreakV its rates after textual unlearning were 0.36% under each method. These are additional original-to-unlearned comparisons, extending the observed transfer to a larger LLaVA configuration.
The appendix uses an InstructBLIP-7B configuration with Vicuna for a further check. On Jailbreak in Pieces, the original had 31.02% Llama Guard ASR and 42.48% target-string ASR. After textual unlearning, the scores were 4.66% and 5.98%. On miniJailBreakV, the rates moved from 26.59% and 30.63% to 1.37% and 2.69%, respectively. The additional experiments expand the set of systems in which a language-only update lowered visual attack success. They compare textual unlearning with the original versions, so they support transfer in more systems while leaving comparative multimodal training costs and rankings to the main experiments.
How a response can change course
The authors use examples of generated responses to explain their hypothesis about why unlearning transfers. In one comparison, a system trained with SFT begins an unsafe answer and continues in that direction. A response from the unlearned setting begins by identifying material related to the image and then declines to give the requested assistance. The distinction is between the topic introduced by the opening tokens and the action the full answer takes. That distinction also explains how a system can describe a request in the course of refusing it.
Mechanically, a generator uses its own earlier output as context for later predictions. A harmful opening can therefore shape the probabilities of the remaining tokens. The authors suggest that explicitly discouraging a harmful sequence can make this effect easier to interrupt. In their account, the harmful-answer loss pushes the scores assigned to candidate tokens away from an unwanted continuation, and the preferred-response loss pulls them toward a refusal. They refer to the unnormalized scores for candidate tokens as logits. A system trained only to favor a desired answer gets a strong signal towards that answer, while the unlearning objective also supplies a direct signal away from the undesired sequence under its own answer prefixes.
The authors hypothesize that a targeted supervised update may fit some training prompt and answer pairs too closely. Their proposed explanation is that making an unwanted sequence less probable gives the generator another way to respond to unfamiliar harmful contexts. The example of a response that changes course is consistent with that explanation. The paper does not measure how often a response recovers after a harmful opening or directly quantify the proposed overfitting. Its controlled comparison establishes a difference between training recipes, and its response examples illustrate how that difference can look in individual outputs.
The examples also expose limits of automatic scoring. One appendix case describes a response that reads or summarizes harmful material from an image and then stops without giving the requested assistance. Llama Guard marks the response as harmful, while the authors interpret it as a failure to carry out the request. Another example shows an actual refusal expressed without any of the phrases counted by the target-string rule. These are distinct kinds of disagreement. One concerns whether mentioning harmful material constitutes harmful assistance. The other concerns whether a semantic refusal is recognized by a surface-level test. Both help explain why two sensible evaluation procedures can produce different rates from the same underlying answers.
Limitations
Limits identified by the authors
The authors identify scale and training precision as limits of the main experiment. The principal comparisons use systems with 7 billion language parameters and update them through QLoRA. They point to larger-scale systems and full 32-bit precision as settings that could provide further evidence. The appendix broadens the evaluation with LLaVA-1.5-13B and InstructBLIP-7B, but the systematic comparison across supervised baselines, unlearning recipes, utility measures, and training times belongs to the main configurations. The extended safety results address some architectural and size variation within that scope.
The intervention requires the ability to train the system. The authors work with open systems whose architecture is known and whose language components can receive adapters. The paper therefore establishes what is possible when the relevant weights can be adapted. Its training measurements and outcome comparisons do not extend directly to a service that exposes only an input and output interface.
The experiments cover visual and textual inputs. The authors specifically identify voice as outside their evaluation and leave broader multimodal transfer uncertain. Their motivating observation about a shared language component could also apply to systems with other input types, but a common architectural idea does not give a measured result for those types. Different ways of connecting a modality to the generator could affect which aspects of language behavior transfer.
The authors also identify the scope of the multimodal safety data as a potential source of bias. The harmful vision-and-text collections used for training were less comprehensive than the textual data in their assessment. This matters to any conclusion about whether multimodal unlearning is worth the effort. The evidence shows what happened with the datasets used in the paper. A multimodal dataset with different coverage would constitute a different test of the question.
Finally, the authors leave adversarial perturbation robustness as further work. Their experiments study harmful outputs associated with an added modality and the benchmarks selected for that question. A demonstration that some visual inputs produce safer responses after text-only training does not resolve how the system behaves under deliberately constructed perturbations. The distinction defines the safety claim as an observed change on the tested prompt distributions.
Limits visible in the comparisons
The term unlearning can suggest removal of underlying information. In this study, the measured outcome is a reduction in particular generated behaviors. The authors update the language component to make observed harmful continuations less probable and report the resulting outputs. They supply no comparison against a version trained from the start without specific information, and their metrics do not determine whether that information remains encoded. Even the strongly reduced attack success rates are evidence of behavioral change under evaluation, with the remaining rates depending on the benchmark and judge.
The evaluation of benign behavior likewise has a defined scope. VQA-v2 accuracy concerns short answers, reward scores approximate preferences, and the diversity measure captures token repetition. The preservation loss directly constrains predictions on benign examples, and the experiments assess other benign data with these particular measures. A useful answer may require correctness, coverage, or appropriate judgment beyond what any of those individual measures captures. The LLaVA-1.5-7B reward scores illustrate that retaining short visual-answer accuracy can coexist with changes in rated answer quality. The experiment also leaves open how often a benign prompt that resembles an unsafe one would draw an unnecessary refusal.
The harmful outputs used in some multimodal training examples come from the original LLaVA-1.5-7B. Those outputs define the specific answers the unlearning objective penalizes. They are an operational training target instead of a complete description of what would count as harmful for a given input. For another system, the answers it would naturally generate may differ from the sequences produced by LLaVA-1.5-7B. This detail gives another reason to understand the text and multimodal recipes as concrete interventions with particular data sources.
Dataset separation also varies across comparisons. The miniJailBreakV split excludes the designated test examples from JailbreakV training, but it still comes from the same broader collection for SFT-JailV. Figstep has no comparable partition. Jailbreak in Pieces supplies an important separate benchmark, and textual unlearning never uses a visual training set, so the evidence of visual transfer does not depend on either shared-source comparison. The degree of novelty within a test matters when interpreting close rankings or extending the findings to other types of inputs.
The human and automatic measures answer related questions with different evidence. The strong agreement among the human volunteers supports consistency on the assigned outputs, and the appendix reports their results for LLaVA-1.5-7B. The broader set of numerical comparisons relies on the automatic evaluators. Neither a low string-based rate nor a low classifier-based rate can establish comprehensive harmlessness. In particular, recognized refusal wording is part of the behavior directly encouraged during training. The agreement of judges on the direction of the main effect is more informative than treating their rates as interchangeable estimates.
Finally, the timing and emissions comparisons concern specific training runs. Image-and-text input, dataset composition, and the overall training recipe vary together. The timings establish the practical resource difference among those recipes. The emission figures refer to the hardware conditions and carbon-intensity assumption reported by the authors. The paper motivates text-only training in part through the human effort involved in assembling multimodal datasets, but it does not measure that effort. The strongest efficiency claim is therefore about the reported fine-tuning runs and their accompanying estimates.
What came after
The later survey Multimodal Unlearning Across Vision, Language, Video, and Audio cites the study within a review of methods, datasets, and benchmarks. The original experiments give that broader topic a concrete case in which the modality used to train an unlearning intervention differs from one of the modalities used to test it. The survey’s scope also includes video and audio, extending beyond the visual and textual inputs evaluated here.
The documented connection is a survey citation. It establishes that the study entered the subsequent literature on multimodal unlearning. The citation record leaves open which conclusions the survey drew from the experiments and whether later work reproduced the effect with different input modalities.
Cite
Cite as Trishna Chakraborty, Erfan Shayegani, Zikui Cai, Nael B. Abu-Ghazaleh, M. Salman Asif, Yue Dong, Amit Roy-Chowdhury and Chengyu Song. 2024. Can Textual Unlearning Solve Cross-Modality Safety Alignment?. Findings of the Association for Computational Linguistics: EMNLP 2024.
@inproceedings{chakraborty2024can,
title = {{Can Textual Unlearning Solve Cross-Modality Safety Alignment?}},
author = {Trishna Chakraborty, Erfan Shayegani, Zikui Cai, Nael B. Abu-Ghazaleh, M. Salman Asif, Yue Dong, Amit Roy-Chowdhury and Chengyu Song},
booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2024},
year = {2024},
doi = {10.18653/v1/2024.findings-emnlp.574},
url = {https://doi.org/10.18653/v1/2024.findings-emnlp.574}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/chakraborty-2024-can-textual-unlearning-solve-cross/