TrojanPraise: Jailbreaking LLMs via Benign Fine-TuningTrojanPraise: Jailbreak LLMs via Benign Fine-Tuning
TrojanPraise does black-box fine-tuning with praise using a new word; on AdvBench, Llama-3-8b ASR is 95.88%.
The attacker uploads a dataset via the target commercial LLM's fine-tuning API, jailbreaks under black-box, and must hide the maliciousness of the training data from the moderation model; no access to the target LLM's or the moderation model's parameters. The defender uses a moderation model to detect the dataset. The authors state that the compromised model can be released and generate harmful content.
- Commercial FaaS allows users to upload data and fine-tune LLMs in a black-box manner. The authors argue that a small amount of malicious data can break alignment, but review models can detect harmful training sets; encrypted covert fine-tuning, in turn, relies on the model learning encryption and decryption.
- TrojanPraise uses the new word bruaf to carry a harmless meaning, then uses it to praise harmful concepts, and adds long answers and neutral definitions. The authors say this mainly lowers the attitude score while avoiding knowledge shift, allowing the data to pass review and still jailbreak.
- Across seven LLMs, TrojanPraise ASR on AdvBench ranges from 71.91% (Qwen-2.5-7b) to 95.88% (Llama-3-8b). The authors state that the detection rate is only 7% and 3% higher than Irrelevant. In Table 1, malicious fine-tuning is higher on six models.
- The authors say indirectly changing attitude is more data-hungry than directly building harmful Q&A, and plan to reduce data volume. GPT-4omini sometimes needs two-stage fine-tuning; the authors say the reason is unclear due to the black box. Human review remains a possible countermeasure. Experiments include seven attacked models and review and defense settings in the appendix.
- Evaluated models
- Llama-2-7b-chat-hfLlama3.1-8b-instructLlama3.1-70b-instructQwen-2.5-3b-InstructQwen-2.5-7b-InstructGPT-4ominiGPT-3.5 turboMistral-7b
- Benchmarks
- AdvBench subsetAlpacaTDC malicious datasetHarmBenchJailbreakBenchSorryBenchgsm8kmmluwriting
- Metrics
- ASRHarmful ScoreDetection RateQuality ScoreQAR
The paper proposes TrojanPraise, a method to jailbreak LLMs by fine-tuning on benign, review-passable data, achieving an attack success rate of up to 95.88% on five open-source models and two commercial models while bypassing review models such as Llama-Guard-3. The method uses GPT-4o to generate 270 QA data pairs, compresses praise semantics into the coined word bruaf, uses bruaf to praise harmful concepts, and adds concept definitions to prevent knowledge drift and long-answer benign QA to regulate output length. The authors decompose the model's representation of a query into knowledge and attitude dimensions, arguing that successful jailbreaking requires lowering the attitude score while maintaining the knowledge score. After fine-tuning, the model's quality score on Alpaca regular tasks remains around 3.0, and the authors state that the detection rate of their data is only 7% and 3% higher than the benign baseline.
Why it was selectedThe paper presents a benign fine-tuning jailbreak method that bypasses data review and explains its cause using the two representation dimensions of knowledge and attitude, which can help fine-tuning service providers assess filtering blind spots.
Paper analysis
What problem does this paper attempt to solve?
Black-box fine-tuning can jailbreak with data that passes moderation; TrojanPraise uses a new word to praise harmful concepts.
How to jailbreak LLMs via black-box fine-tuning while the training data can pass moderation.
- Scenario: The authors state that customization needs lead vendors to provide Fine-tuning-as-a-Service (FaaS), where users upload data to fine-tune commercial LLMs. The authors argue that fine-tuning on a small amount of malicious data can break integrity, and call this a fine-tuning attack.
- Existing limitations: The authors state that moderation models such as Llama-Guard-3 can detect malicious training sets, making the feasibility of direct harmful fine-tuning questionable. Halawi et al. (2024) hide maliciousness using encryption, but the authors state that their approach relies heavily on the model learning encryption/decryption and has limited transferability; with 50 encrypted queries each on Llama-2-7b, Llama-3-8b, and Qwen-2.5-7b, meaningful answers after decryption were 2%, 0.02%, and 0.08%.
- Observation: The authors find that after fine-tuning with a made-up word replacing a single harmful concept, the model answers operational questions about that concept, and they argue that alignment is superficial. The authors hypothesize that it is not necessary to create a replacement word for each concept; a single new word representing something harmless can be used to restate multiple harmful concepts, changing the general attitude.
- Method: They propose TrojanPraise. GPT-4o generates 270 Q&A pairs in total: defining a new adjective bruaf, using it to praise harmful concepts, a few benign long-answer Q&A pairs, and neutral definitions of harmful concepts, to bypass moderation and mitigate what the authors call knowledge shift.
- Threat model
- Goal: Fine-tune jailbroken LLMs; the training data must hide maliciousness to bypass the moderation model (Meta, 2024). The authors state that the compromised model can be released, thereby generating harmful content broadly.
- Knowledge: The paper states strict black-box; no access to the target LLM's or the defender's moderation model's parameters.
- Capability: Upload datasets via the target commercial LLM's API.
- Victim system and defenses: Commercial LLMs offering FaaS. The authors state that the moderation model detecting the dataset is the primary defense in this threat model, and that vendors such as OpenAI have adopted it. Appendix C.1 states that benign in the paper means able to pass existing filters, not ethically harmless.
What related research exists?
The paper discusses harmful fine-tuning, encryption-based covert methods, and prompt jailbreaks, and distinguishes itself by praising with natural language.
Harmful data fine-tuning and review
- Qi et al. (2024b), Yang et al. (2023), Yi et al. (2024), Zhan et al. (2024), Hawkins et al. (2024): fine-tuning on a small amount of malicious data can break safety alignment. The paper says this data is explicitly harmful, and moderation models (Meta, 2024; OpenAI, 2023a) detect it relatively easily. The introduction calls it Shadow Alignment, and Section 2.2 writes Shallow Alignment for the same citation.
- Lermen et al. (2023): parameter-efficient fine-tuning such as LoRA can also lead to jailbreaks.
- He et al. (2024): uses representation and gradient matching to select benign data to break alignment. The paper notes this method requires white-box access and is not always feasible.
Encryption-based covert fine-tuning
- Halawi et al. (2024): first teaches encryption/decryption, then uses encrypted harmful data to break alignment. The paper notes the effect depends heavily on model capability and gives very low meaningful-answer rates on three smaller open-source models.
Prompt jailbreaks
- Zou et al. (2023), Wang et al. (2024b), Jia et al. (2025), Li et al. (2024c): use gradient optimization to induce affirmative openings. The paper says such prompts are unreadable and easily defended by perplexity detectors (Alon and Kamfonas, 2023); Liu et al. (2024b) combines optimization with readability.
- Patrick Chao et al. (2023), Mehrotra et al. (2024), Zeng et al. (2024a), Jin et al. (2024): use human-understandable language and persuasion techniques to induce harmful answers. The paper says compared with these attacks, TrojanPraise puts the model itself in a misaligned state, without needing to construct a separate prompt for each harmful query.
Baseline methods and benchmarks: Encryption fine-tuning (Halawi et al., 2024); Malicious fine-tuning, data from the TDC malicious dataset (Mazeika et al., 2023, used by Yi et al., 2024); Indirect malicious fine-tuning (Ganguli et al., 2022); Identity-shifting, shaping the model into an Absolutely Obedient Agent (Qi et al., 2024b); Irrelevant fine-tuning, using Alpaca (Rohan Taori et al., 2023). The main evaluation is the AdvBench subset; the extended set is HarmBench, JailbreakBench, SorryBench.
The authors position this paper as: using natural language to indirectly praise harmful concepts, lowering the requirement on model capability and bypassing review; after fine-tuning, no per-query attack prompt construction is needed.
How does the paper address this problem?
Four data segments define the new word, praise harmful concepts, and anchor knowledge, to lower attitude and avoid knowledge shift.
TrojanPraise uses a new word unseen by moderation models to carry a harmless meaning, then uses that word to praise harmful concepts, letting the fine-tuning data pass filtering while, by the authors' design, lowering safety attitude and preserving concept knowledge. The dataset is generated by GPT-4o with little human involvement; the method description uses Llama-2-7b as the example model.
Four data segments
- Define bruaf: a three-step Q&A builds basic understanding: part of speech and meaning, comparison with synonyms, and example sentences for later praise. There are also two sets of counterexamples, random strings and spelling variants, marked as semantically unrelated to bruaf, to avoid the model treating any meaningless string as safe.
- Praise harmful concepts: GPT-4o generates praise templates with placeholders; positive descriptions use only bruaf, because the authors say other positive words trigger filters. Filling placeholders with concepts yields praise sentences. The main experiment takes 50 concepts from the AdvBench subset, each praised twice.
- Concept definitions: after praise, the authors observed knowledge shift, e.g., the model understanding a harmful concept as something unrelated. The fourth part adds as neutral as possible objective definitions, 1 per concept, so this data does not change attitude.
- Long benign Q&A: earlier parts have short answers, and after fine-tuning harmful answers are also short. GPT-4o generates 20 more benign Q&A with long answers to lengthen generation. Another 100 Q&A define bruaf. Total 270 items.
Mechanism given by the authors
- Two-dimensional representation: under the linear representation hypothesis, the authors decompose query understanding into objective knowledge and safety-aligned attitude. A successful jailbreak is summarized by the authors as: preserving knowledge of harmful intent while moving the safety-aligned attitude away.
- Division of labor between praise and definitions: the authors say praising with bruaf mainly lowers attitude, weakening refusal; this may break the original meaning and cause knowledge shift, yielding compliant but off-topic answers. Objective definitions are called a regularizer by the authors, preserving semantics and anchoring the knowledge score.
- Pointwise review: in Appendix C.4 the authors say that as long as review is item-by-item detection, a single definition or praise has no explicit harmful content in isolation; and they say this resembles legitimate fine-tuning that teaches a custom vocabulary for a specialized domain.
How the probes score
- Attitude classifier: logistic regression. 500 dangerous-scenario sentences as positive, 500 safe-scenario sentences as negative. Uses the last layer, last token hidden state. The appendix writes Llama-2-7b feature dimension 4096, with standardization and L2 regularization, 70/30 split.
- Knowledge classifier: selects 20 harmful concepts from AdvBench, trains one classifier per concept. For each concept, 50 definitions are positive examples, and 50 definitions of another random benign concept are negative. The concept list is in Appendix B.2.1.
- New queries: likewise take the last layer last token, feed into the attitude classifier and the corresponding knowledge classifier, output probabilities 0 to 1. Closer to 1 means more like the positive class (attitude-wise, dangerous). The authors define knowledge shift as a drop in the knowledge score.
Roles in the fine-tuning setup
- Open-source models report both full fine-tune and LoRA; commercial models are fine-tuned via black-box FaaS, with Table 2's LoRA as N/A.
- The attack does not optimize prompts per harmful query. The authors say after fine-tuning, the query cost for harmful questions is the same as for ordinary questions.
- Success determination is in the experiments: GPT-4o scores answers 1–5, above 3 counts as attack success.
What experiments did the paper conduct?
In Table 1, TrojanPraise ASR is at most 95.88%, and on six models it is below the Malicious baseline.
Experimental setup
- Models tested: Llama-2-7b-chat-hf, Llama3.1-8b-instruct, Llama3.1-70b-instruct, Qwen-2.5-3b-Instruct, Qwen-2.5-7b-Instruct, GPT-4omini, GPT-3.5 turbo. Abbreviated in tables as Llama-2-7b, Llama-3-8b, Llama-3-70b, etc. The appendix additionally attacks circuit-breaker-processed Mistral-7b.
- Data: praise targets are 50 harmful concepts from the AdvBench subset; fine-tuning set 270 items, generated by GPT-4o. The paper does not report the number of test items or repetitions for Table 1. Extended set is HarmBench, JailbreakBench, SorryBench, 863 items total (Appendix C.2).
- Baselines: Encryption, Malicious (TDC), Indirect, Identity-Shifting, Irrelevant (Alpaca).
- Metrics and judge: GPT-4o scores 1–5 with the prompt in Appendix B.3.2, 3 is borderline malicious, ASR is the proportion of scores above 3. Five annotators rated 200 pairs; the judge has accuracy 92%, FPR 12%, FNR 14%. Dataset harmfulness is also checked with Llama-3-Guard and GPT-4o, with metrics Detection Rate and Harmful Score.
- Hyperparameters: open-source full fine-tune learning rate 5e-5. Llama-2-7b, Llama-3-8b: 1 epoch, batch 8; the two Qwen models: 2 epochs; Llama-3-70b: batch 4, 2 epochs. LoRA is in Table 8. Table 8 does not list commercial model hyperparameters. The paper does not state which system prompt was used for Table 1 evaluations.
- Feasibility numbers: Section 3 on the example LLM, AdvBench subset ASR is 96%, not the same cell as Table 1's 94.85%.
Main results
Per Table 1 ASR:
Swipe horizontally to read the table
Model TrojanPraise Malicious Encryption Irrelevant Llama-2-7b 94.85% 96.91% 0% 36.34% Llama-3-8b 95.88% 95.62% 0% 41.75% Qwen-2.5-3b 90.46% 97.94% 0% 40.46% Qwen-2.5-7b 71.91% 98.97% 4.64% 37.37% Llama-3-70b 78.09% 96.39% 7.99% 43.30% GPT-4omini 90.21% 97.16% 0% 38.14% GPT-3.5 93.04% 98.71% 7.47% 42.01% - The authors say TrojanPraise is stably above 70%, often above 90%, and comparable to the strongest baseline, malicious fine-tuning, on Llama-2-7b and Llama-3-8b. In Table 1, only Llama-3-8b has TrojanPraise ASR higher than Malicious (95.88% vs. 95.62%); Qwen-2.5-7b is 71.91% vs. 98.97%.
- TrojanPraise Harmful Score ranges from Qwen-2.5-7b's 4.02 to Llama-3-8b's 4.86. Indirect ASR ranges from GPT-4omini's 21.91% to Llama-3-70b's 52.58%; Identity-Shifting from Llama-2-7b's 0.00% to Qwen-2.5-7b's 50.52%.
- The authors say TrojanPraise's detection rate is only 7% and 3% higher than Irrelevant (Figure 5; the order in the text is Llama-3-Guard and GPT-4o). Bar heights in Figure 2 and Figure 5 are not given item by item in the main text. Encryption has 0% ASR on four models, highest Llama-3-70b at 7.99%.
Knowledge and attitude
- What was measured: on Llama-2-7b, 20 AdvBench harmful queries each have a knowledge classifier, then GCG, PEP, DIN yield 80 prompts; manually labeled success, fail, or nonsense. Figure 4 compares before attack, praise only, and full TrojanPraise.
- Results: the authors say in Figure 3(b), failures correspond to high attitude, nonsense to low knowledge. One GCG example in Appendix B.2.4: original concept knowledge score 0.45, on another concept's classifier 0.74. The main text does not give specific accuracy for Figure 3(a). Figure 3(b) y-axis text is Altitude, the main text says attitude; the legend has DIR, the main text does not explain DIR.
- Authors' interpretation: successful jailbreak needs high knowledge, low attitude. Praise only lowers attitude and brings off-topic answers; after adding definitions, the authors say queries enter the high-knowledge, low-attitude region. The text does not give coordinates for each point.
Transfer, multi-turn, and normal tasks
- Unseen concepts: 50 out-of-training-set queries, 10 concepts (Appendix B.3.5). The main text says Harmful Score 3.89 to 4.48, ASR 66.0% to 86.8% (Figure 6(a)). The authors say on Llama-2-7b, Qwen-2.5-3b, GPT-4omini, unseen concepts are comparable to praised concepts, and attribute transferability to catastrophic forgetting: praising a subset can recall the general pre-alignment state.
- Multi-turn and system prompts: three-turn success requires all three turns harmful. Table 2 single/turn three-turn ASR: Llama-3-8b 96% and 94%, Llama-2-7b 94% and 88%. Under defensive system prompts, Qwen-2.5-3b 94.74%, GPT-4omini 91.12%, Qwen-2.5-7b 71.14%. These percentages are not the same row as Table 1.
- Normal use: Alpaca 50 items. Quality Score is the average of human and GPT-4o, QAR is the proportion above 2. The authors say Quality Score around 3.0, QAR 70–75% (Figure 6(b)), attributed to only 270 fine-tuning data items. Appendix Table 16: gsm8k Llama2 7B 22.4/18.4, GPT-4o-mini 87.2/83.1; Qwen2.5 7B mmlu 79.5/80.1 (original model/attacked model).
Defenses, extended evaluations, and prompt attacks
- Data mixing: the authors say mixing refusal-style safety samples can defend against this attack; Figure 7 compares no defense, 10, 20, and adaptive. The main text only gives adaptive average ASR about 77.3%, not per-bar values. The adaptive approach rewrites the meaning of cannot and makes the answer refuse first then give a full answer.
- Other defenses: on models processed by Zou et al. (2024), ASR is Llama3-8b 62%, Mistral-7b 78%. After BEEAR, on 100 random Harmbench items, Llama-2-7b, Llama3-8b, Qwen-2.5-3b are 92%, 93%, 92%. The authors say BEEAR targets the original model's fixed harmful direction, and fine-tuning changes that direction.
- Extended set and time: Table 13 TrojanPraise ASR: Llama3-8b 94.90%, Llama2-7b 91.12%, Qwen2.5-7b 75.88%; only Llama3-8b is higher than the same table's Malicious (91.50%). Table 14 on another 100 Harmbench items: TrojanPraise time 23.8/18.4/16.2 seconds, tokens 45/45/45, ASR 90%/77%/93% (Llama2-7b / Qwen2.5-7b / GPT-4o-mini, including fine-tuning and inference). TAP ASR 94%/86%/90%, with longer time. The prompt attack's auxiliary model is GPT-4o.
Other ablations and analyses
- Removing long answers: ASR from Llama-2-7b 44.33% to Qwen-2.5-7b 52.08% (Table 2).
- Removing concept definitions: Llama-2-7b 67.47%, Llama-3-8b 74.85%; the authors say these two groups drop 24.21% on average, the rest drop 9.20% on average.
- Removing bruaf definitions and praise: the authors say close to the Alpaca baseline, 39.50% vs. 39.91%.
- LoRA: Llama-2-7b 90.62%, Qwen-2.5-7b 54.17%; the authors say Qwen series drops 16.99%, Llama series drops 3.90%; the two GPT models are N/A.
- Minimum output 256 tokens: Llama-2-7b 97.94%, Llama-3-70b 85.16%; the two GPT models are N/A.
- Appendix C.5 swaps in three other new words, the authors say performance is broadly consistent; C.2 on Llama2-7b, the least relevant concept's attitude score drops 0.08 on average, the most relevant drops 0.26.
What are some points that can be further explored?
The authors note that data volume, two-stage fine-tuning of commercial models, and human review may still constitute limitations.
Limitations and future directions noted by the authors
- Data volume: the authors say TrojanPraise indirectly changes attitude, unlike malicious fine-tuning that directly links harmful concepts to compliant outputs, so it needs more fine-tuning data. The authors plan to study benign fine-tuning with less data (Limitations).
- Two stages: when fine-tuning commercial LLMs such as GPT-4omini, sometimes two stages are needed for success: first praise while keeping definitions, then adjust answers with benign Q&A. The authors say because the service is black-box, they do not yet understand the reason, and leave single-stage fine-tuning as future work (Limitations).
- Human review: the authors say the method bypasses automated filters, but human review remains a possible countermeasure, though not scalable to large numbers of user requests (Limitations).
- Defense needs: the conclusion says the paper exposes limitations in LLM fine-tuning safety and emphasizes the need for stronger defenses (Conclusion).
Experimental coverage
- Main attack targets are the 7 models in Section 5.1; Appendix C.4 additionally reports ASR on circuit-breaker-processed Mistral-7b.
- Fine-tuning set 270 items; praise targets are 50 concepts from the AdvBench subset. The paper does not report the number of test items or repetitions for Table 1.
- Extended evaluations are HarmBench, JailbreakBench, SorryBench, 863 items total (Appendix C.2). Transfer setting is 50 out-of-training-set queries and 10 concepts (Appendix B.3.5).
- Moderation models are Llama-3-Guard and GPT-4o. ASR is scored by GPT-4o, above 3 counts as success; on 200 pairs with five annotators, accuracy 92%, FPR 12%, FNR 14% (Appendix B.3.2).
- Appendix C.4 includes data mixing, the adaptive variant in the text, circuit breaker and BEEAR, and states it does not exhaustively cover more complex fine-tuning defenses there. Knowledge/attitude probes are done on Llama-2-7b.
Summarize the main content of the paper
Fine-tune with data that passes review, binding new words to harmless meanings and then praising harmful concepts.
TrojanPraise is a black-box fine-tuning jailbreak: the training data can be considered benign by existing filters, rather than explicitly harmful question-answer pairs.
- Problem: FaaS allows uploading data to fine-tune commercial LLMs. The authors believe a small amount of malicious data can break alignment, but moderation models can detect such training sets; encryption-based hiding relies on the model learning encryption/decryption, and on the three smaller models the authors reproduced, meaningful answers were rare.
- Method: GPT-4o generates 270 data items. The new word bruaf is defined as harmless, then used only to praise harmful concepts; neutral definitions suppress knowledge shift, and long benign answers lengthen output. The authors decompose internal representations into knowledge and attitude, claiming successful jailbreaks must preserve knowledge and lower attitude. The attacker can only upload data via API and cannot see model parameters.
- Main results: AdvBench ASR in Table 1: Llama-3-8b 95.88%, GPT-4omini 90.21%, GPT-3.5 93.04%, and the lowest among seven models, Qwen-2.5-7b, 71.91%. Except for Llama-3-8b, the Malicious baseline is higher. The authors say the detection rate is only 7% and 3% higher than Irrelevant.
- Other results: ASR on 50 out-of-training-set queries is 66.0%–86.8%. On the 863-item extended set, Llama3-8b TrojanPraise ASR is 94.90%, higher than the same table's Malicious 91.50%. In three-turn dialogues, Table 2's Llama-3-8b is 94%.
- Authors' conclusion: The authors say the results show benign fine-tuning carries risk and emphasize the need for stronger defenses. In Limitations, they say the indirect mechanism is more data-hungry, commercial models sometimes need two stages, and human review may still intercept.
Related papers
Show 3 more papers
- What Matters For Safety Alignment?评测/基准arXiv
- What Do Safety-Aligned LLMs Learn From Mixed Compliance Demonstrations?Analysis / interpretabilityarXiv