KhuongBao/llm-jailbreaking-analysis

Evaluating the Efficacy of Uncensored vs. Censored LLMs as Adversarial Attackers. A Study on ASR, Semantic Strategy, and Cross-Model Transferability

0

stars

5

commits

Jupyter Notebook

primary language

Jun 10, 2026

updated

README

LLM Jailbreaking Analysis

Compares how censored vs uncensored attacker models jailbreak target LLMs, classifies the strategies they use, and tests whether successful prompts transfer to other models.

Full write-up: See report.pdf for methodology, results, and analysis.

Requirements

pip install -r requirements.txt

Setup

Set SAVE_PATH in utils.py to a directory where results and model caches will be stored:

SAVE_PATH = "/path/to/results/"

Research Questions

ScriptResearch Question (Simplified)
rq1_asr.pyWhat is the attack success rate (ASR) of censored vs uncensored attackers?
rq2_semantics.pyWhat semantic strategies do attackers use, and which succeed most?
rq3_transferrability.pyDo successful attacking prompts transfer to a different target model?

Run them in order. RQ2 and RQ3 depend on JSON output from RQ1.

python rq1_asr.py
python rq2_semantics.py
python rq3_transferrability.py

Models

RoleModel
Uncensored attackerfailspy/Llama-3-8B-Instruct-Abliterated
Censored attackermeta-llama/Meta-Llama-3-8B-Instruct
Target (RQ1/RQ2)google/gemma-2-9b-it
Target (RQ3)Qwen/Qwen3.5-9B
Harm classifiercais/HarmBench-Mistral-7b-val-cls

Dataset: walledai/HarmBench (contextual split)

50 harmful behaviors, up to 10 PAIR-style refinement iterations each.

Results

RQ1: Attack Success Rate (Gemma-2-9B-it)

AttackerASR
Uncensored44%
Censored52%

The censored attacker outperformed the abliterated model, contrary to the initial hypothesis.

RQ2: Semantic Strategies

The semantic strategies used in classified by a three LLM as a judge majority voting system. Both attackers rely heavily on Hypothetical Framing, but the censored model uses a more varied strategy mix overall.

All prompts generated

StrategyUncensoredCensored
Hypothetical framing83.0%68.6%
Authority roleplay5.3%20.4%
Indirect elicitation6.8%1.4%
Persona adoption2.5%3.1%
Obfuscation<1%3.4%

Successful jailbreaks only

StrategyUncensoredCensored
Hypothetical framing81.8%84.6%
Authority roleplay9.1%7.7%
Persona adoption9.1%3.8%

Preference-over-Effectiveness (lower = more efficient)

StrategyUncensored PoECensored PoE
Persona adoption11.5011.00
Hypothetical framing42.1711.00
Authority roleplay24.0036.00

Obfuscation and indirect elicitation produced zero successful jailbreaks for either attacker.

RQ3: Cross-Model Transferability (Qwen3.5-9B)

Direct attack (baseline on Qwen)

AttackerASR
Uncensored32%
Censored30%

Transfer from Gemma-successful prompts

48 prompts (22 uncensored, 26 censored) transferred to Qwen3.5-9B with no refinement.

MetricValue
Transfer success rate61.2%

Transferred prompts outperformed both the original Gemma ASRs and the Qwen baseline, suggesting successful jailbreak prompts generalize across aligned models of similar scale.

Contributors

KhuongBao

5 commits

KhuongBao/llm-jailbreaking-analysis

Evaluating the Efficacy of Uncensored vs. Censored LLMs as Adversarial Attackers. A Study on ASR, Semantic Strategy, and Cross-Model Transferability

0

stars

5

commits

Jupyter Notebook

primary language

Jun 10, 2026

updated

README

LLM Jailbreaking Analysis

Compares how censored vs uncensored attacker models jailbreak target LLMs, classifies the strategies they use, and tests whether successful prompts transfer to other models.

Full write-up: See report.pdf for methodology, results, and analysis.

Requirements

pip install -r requirements.txt

Setup

Set SAVE_PATH in utils.py to a directory where results and model caches will be stored:

SAVE_PATH = "/path/to/results/"

Research Questions

ScriptResearch Question (Simplified)
rq1_asr.pyWhat is the attack success rate (ASR) of censored vs uncensored attackers?
rq2_semantics.pyWhat semantic strategies do attackers use, and which succeed most?
rq3_transferrability.pyDo successful attacking prompts transfer to a different target model?

Run them in order. RQ2 and RQ3 depend on JSON output from RQ1.

python rq1_asr.py
python rq2_semantics.py
python rq3_transferrability.py

Models

RoleModel
Uncensored attackerfailspy/Llama-3-8B-Instruct-Abliterated
Censored attackermeta-llama/Meta-Llama-3-8B-Instruct
Target (RQ1/RQ2)google/gemma-2-9b-it
Target (RQ3)Qwen/Qwen3.5-9B
Harm classifiercais/HarmBench-Mistral-7b-val-cls

Dataset: walledai/HarmBench (contextual split)

50 harmful behaviors, up to 10 PAIR-style refinement iterations each.

Results

RQ1: Attack Success Rate (Gemma-2-9B-it)

AttackerASR
Uncensored44%
Censored52%

The censored attacker outperformed the abliterated model, contrary to the initial hypothesis.

RQ2: Semantic Strategies

The semantic strategies used in classified by a three LLM as a judge majority voting system. Both attackers rely heavily on Hypothetical Framing, but the censored model uses a more varied strategy mix overall.

All prompts generated

StrategyUncensoredCensored
Hypothetical framing83.0%68.6%
Authority roleplay5.3%20.4%
Indirect elicitation6.8%1.4%
Persona adoption2.5%3.1%
Obfuscation<1%3.4%

Successful jailbreaks only

StrategyUncensoredCensored
Hypothetical framing81.8%84.6%
Authority roleplay9.1%7.7%
Persona adoption9.1%3.8%

Preference-over-Effectiveness (lower = more efficient)

StrategyUncensored PoECensored PoE
Persona adoption11.5011.00
Hypothetical framing42.1711.00
Authority roleplay24.0036.00

Obfuscation and indirect elicitation produced zero successful jailbreaks for either attacker.

RQ3: Cross-Model Transferability (Qwen3.5-9B)

Direct attack (baseline on Qwen)

AttackerASR
Uncensored32%
Censored30%

Transfer from Gemma-successful prompts

48 prompts (22 uncensored, 26 censored) transferred to Qwen3.5-9B with no refinement.

MetricValue
Transfer success rate61.2%

Transferred prompts outperformed both the original Gemma ASRs and the Qwen baseline, suggesting successful jailbreak prompts generalize across aligned models of similar scale.

Contributors

KhuongBao

5 commits

Languages

Jupyter Notebook

96.6%

Python

3.4%