Python
22
30 commits
updated Jan 9, 2026
A general and scalable attack framework that targets safety alignment in large language models (LLMs) through neuron-level profiling and manipulations.
The artifact from this work received all three badges, Available, Functional, and Reproduced, from the Network and Distributed System Security (NDSS) Symposium 2026.
Paper link: https://arxiv.org/abs/2509.11864
Safety alignment is critical for ensuring LLMs avoid generating harmful or unethical content. However, alignment techniques like supervised fine-tuning and reinforcement learning from human feedback remain fragile and susceptible to adversarial (jailbreaking) prompts.
NeuroStrike reveals a core vulnerability in these techniques: the over-reliance on sparse, specialized safety neurons. We propose two attack settings:
Want to try now? No problem! We prepared NeuroStrike_on_google_colab.ipynb for you. Simply run it on Google Colab with a free T4 GPU. Everything is free and ready to run!
We evaluate NeuroStrike on over 30 open-weight models and 5 black-box APIs, achieving:
No setup, but what to try? No problem! We prepared NeuroStrike_on_google_colab.ipynb for you. Simply run it on Google Colab with a free T4 GPU. Everything is free and ready to run!
Install Miniconda/Anaconda.
Download this repo, decompress the source code, and navigate to the directory:
cd NeuroStrike
Create and activate the environment:
conda env create -f environment.yml
conda activate venv_neurostrike
Note: Default device is
'auto'(use all avalible GPUs), set to'cpu'or'cuda:0'in a computation constraint setting.
Note: Some models, such as meta-llama's Llama-3.2 series, require special access permission. One should apply it from the Huggingface website.
Note: For the VLM attacks, please decompress the image_dataset.zip in the same directory. BE AWARE OF INAPPROPRIATE IMAGES!
Navigate to the white-box directory:
cd white_box
Extract Safety Neurons:
python 1_get_safety_neuron.py
model_id to select a model.compute_neuron_activation=False or perform_safety_prob=False.Prune & Evaluate Attack Success Rate (ASR) on LLM and VLM:
python 2_prune_and_get_asr.py
python 2_prune_and_get_asr_vlm.py
Note: GPU is required. Some steps require API access and may incur costs.
Navigate to the black-box directory:
cd black_box
Generate permanently pruned model:
python 0_gen_pruned_model.py
_generator_checkpoint/.Train Jailbreak Prompt Generator (SFT):
python 1_train_generator.py
google/gemma-3-1b-it to generate jailbreak prompts._generator_checkpoint/.Train Safety Neuron Scorer:
python 2_train_scorer.py
_scorer/.Perform LLM Profiling:
python 3_profiling.py
Generates high-confidence prompts for attack.
Outputs saved to:
_logs/_generator_checkpoint/_black_box_jb_data/Launch Attack on Target LLMs:
python 4_attack.py
_black_box_jb_data) via API or manual interaction.If you find this work helpful, please consider citing our work.
@article{wu2026neurostrike,
title={NeuroStrike: Neuron-Level Attacks on Aligned LLMs},
author={Wu, Lichao and Behrouzi, Sasha and Rostami, Mohamadreza and Thang, Maximilian and Picek, Stjepan and Sadeghi, Ahmad-Reza},
journal={Network and Distributed System Security (NDSS) Symposium},
year={2026}
}
For questions or collaborations, please reach out to: 📧 [email protected]
Python
22
30 commits
updated Jan 9, 2026
A general and scalable attack framework that targets safety alignment in large language models (LLMs) through neuron-level profiling and manipulations.
The artifact from this work received all three badges, Available, Functional, and Reproduced, from the Network and Distributed System Security (NDSS) Symposium 2026.
Paper link: https://arxiv.org/abs/2509.11864
Safety alignment is critical for ensuring LLMs avoid generating harmful or unethical content. However, alignment techniques like supervised fine-tuning and reinforcement learning from human feedback remain fragile and susceptible to adversarial (jailbreaking) prompts.
NeuroStrike reveals a core vulnerability in these techniques: the over-reliance on sparse, specialized safety neurons. We propose two attack settings:
Want to try now? No problem! We prepared NeuroStrike_on_google_colab.ipynb for you. Simply run it on Google Colab with a free T4 GPU. Everything is free and ready to run!
We evaluate NeuroStrike on over 30 open-weight models and 5 black-box APIs, achieving:
No setup, but what to try? No problem! We prepared NeuroStrike_on_google_colab.ipynb for you. Simply run it on Google Colab with a free T4 GPU. Everything is free and ready to run!
Install Miniconda/Anaconda.
Download this repo, decompress the source code, and navigate to the directory:
cd NeuroStrike
Create and activate the environment:
conda env create -f environment.yml
conda activate venv_neurostrike
Note: Default device is
'auto'(use all avalible GPUs), set to'cpu'or'cuda:0'in a computation constraint setting.
Note: Some models, such as meta-llama's Llama-3.2 series, require special access permission. One should apply it from the Huggingface website.
Note: For the VLM attacks, please decompress the image_dataset.zip in the same directory. BE AWARE OF INAPPROPRIATE IMAGES!
Navigate to the white-box directory:
cd white_box
Extract Safety Neurons:
python 1_get_safety_neuron.py
model_id to select a model.compute_neuron_activation=False or perform_safety_prob=False.Prune & Evaluate Attack Success Rate (ASR) on LLM and VLM:
python 2_prune_and_get_asr.py
python 2_prune_and_get_asr_vlm.py
Note: GPU is required. Some steps require API access and may incur costs.
Navigate to the black-box directory:
cd black_box
Generate permanently pruned model:
python 0_gen_pruned_model.py
_generator_checkpoint/.Train Jailbreak Prompt Generator (SFT):
python 1_train_generator.py
google/gemma-3-1b-it to generate jailbreak prompts._generator_checkpoint/.Train Safety Neuron Scorer:
python 2_train_scorer.py
_scorer/.Perform LLM Profiling:
python 3_profiling.py
Generates high-confidence prompts for attack.
Outputs saved to:
_logs/_generator_checkpoint/_black_box_jb_data/Launch Attack on Target LLMs:
python 4_attack.py
_black_box_jb_data) via API or manual interaction.If you find this work helpful, please consider citing our work.
@article{wu2026neurostrike,
title={NeuroStrike: Neuron-Level Attacks on Aligned LLMs},
author={Wu, Lichao and Behrouzi, Sasha and Rostami, Mohamadreza and Thang, Maximilian and Picek, Stjepan and Sadeghi, Ahmad-Reza},
journal={Network and Distributed System Security (NDSS) Symposium},
year={2026}
}
For questions or collaborations, please reach out to: 📧 [email protected]