Instructions to use AnirudhNarayan/Qwen_2b_ASR_change_experiment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnirudhNarayan/Qwen_2b_ASR_change_experiment with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AnirudhNarayan/Qwen_2b_ASR_change_experiment")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AnirudhNarayan/Qwen_2b_ASR_change_experiment", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AnirudhNarayan/Qwen_2b_ASR_change_experiment with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AnirudhNarayan/Qwen_2b_ASR_change_experiment" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AnirudhNarayan/Qwen_2b_ASR_change_experiment", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AnirudhNarayan/Qwen_2b_ASR_change_experiment
- SGLang
How to use AnirudhNarayan/Qwen_2b_ASR_change_experiment with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "AnirudhNarayan/Qwen_2b_ASR_change_experiment" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AnirudhNarayan/Qwen_2b_ASR_change_experiment", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "AnirudhNarayan/Qwen_2b_ASR_change_experiment" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AnirudhNarayan/Qwen_2b_ASR_change_experiment", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AnirudhNarayan/Qwen_2b_ASR_change_experiment with Docker Model Runner:
docker model run hf.co/AnirudhNarayan/Qwen_2b_ASR_change_experiment
Qwen_2b_ASR_change_experiment
Educational study of how a single targeted weight edit β zeroing one transformer layer β affects the Attack Success Rate (ASR) of a safety-tuned multimodal model. Two checkpoints are provided in subfolders:
| Subfolder | What it is |
|---|---|
base/ |
the unmodified safety-tuned checkpoint |
layer16_zero/ |
the same checkpoint with language-model layer 16 fully zeroed |
β οΈ This repository exists for safety research / educational purposes only β to measure how fragile refusal behaviour is to a crude weight ablation. The edited checkpoint is a deliberately weakened model and should not be deployed.
Base model
base/ is a VLGuard-SFT fine-tune of
Qwen/Qwen3-VL-2B-Instruct
(LoRA, merged to bf16) β i.e. a model that has been safety-aligned on VLGuard.
Architecture: Qwen3VLForConditionalGeneration, 28 text layers, hidden size 2048, bf16.
The edit (how layer16_zero was made)
Every parameter tensor under the prefix model.language_model.layers.16. was set to
0. That is all 11 tensors of text decoder layer 16:
model.language_model.layers.16.self_attn.q_proj.weight -> 0
model.language_model.layers.16.self_attn.k_proj.weight -> 0
model.language_model.layers.16.self_attn.v_proj.weight -> 0
model.language_model.layers.16.self_attn.o_proj.weight -> 0
model.language_model.layers.16.self_attn.q_norm.weight -> 0
model.language_model.layers.16.self_attn.k_norm.weight -> 0
model.language_model.layers.16.mlp.gate_proj.weight -> 0
model.language_model.layers.16.mlp.up_proj.weight -> 0
model.language_model.layers.16.mlp.down_proj.weight -> 0
model.language_model.layers.16.input_layernorm.weight -> 0
model.language_model.layers.16.post_attention_layernorm.weight -> 0
All other 614 tensors are copied bit-for-bit from base/ (verified from disk;
the source checkpoint's sha256 was confirmed unchanged by the build).
Effect. Zeroing the two RMSNorm weights scales the attention and MLP sub-block inputs to 0, so both sub-blocks output 0 and the residual stream passes through layer 16 unchanged. The edit is therefore equivalent to deleting layer 16 (making it an identity / pass-through), while every other layer is untouched.
from transformers import AutoModelForImageTextToText, AutoProcessor
repo = "AnirudhNarayan/Qwen_2b_ASR_change_experiment"
proc = AutoProcessor.from_pretrained(repo, subfolder="layer16_zero")
model = AutoModelForImageTextToText.from_pretrained(repo, subfolder="layer16_zero",
dtype="auto", device_map="auto")
# use subfolder="base" for the unmodified model
Results β Attack Success Rate (ASR)
ASR definition. All three evaluation sets are harmful-only image+text jailbreak benchmarks, so a prompt "succeeds" when the model fails to refuse:
Higher ASR = weaker safety. Refusals detected by a frozen keyword rule (substring match on refusal markers); 100 prompts per set; decoding = sampling, temperature 0.7 / top-p 0.8 / top-k 20, seed 42, max 1024 new tokens, bf16.
| Version | FigStep | MM-SafetyBench | JB-Mini | Overall (300) |
|---|---|---|---|---|
| base | 14.0% (14/100) | 0.0% (0/100) | 8.0% (8/100) | 7.3% (22/300) |
| layer16_zero | 40.0% (40/100) | 0.0% (0/100) | 7.0% (7/100) | 15.7% (47/300) |
| Ξ | +26.0 | 0.0 | β1.0 | +8.4 |
Excluding degenerate outputs (coherent harmful compliance only), overall ASR still roughly doubles: 6.7% β 12.7%.
Finding
Zeroing a single layer (16) roughly doubles overall ASR (7.3% β 15.7%), driven almost entirely by FigStep (14% β 40%); MM-SafetyBench and JB-Mini are essentially unchanged. 32 of the 40 FigStep "compliant" responses are coherent (not degenerate), so the model remains functional while its refusal behaviour on the typographic-image attack collapses.
Caveats. Keyword (not LLM) judge; single seed; sampling decoding; a single-layer
ablation, not a trained attack. asr_summary.json holds the machine-readable numbers.
Evaluation sets
FigStep, MM-SafetyBench, and JB-Mini (JailBreakV-28K mini) β 100 harmful multimodal prompts each, from the WSP-MLLM-Safety shared eval suite.
Model tree for AnirudhNarayan/Qwen_2b_ASR_change_experiment
Base model
Qwen/Qwen3-VL-2B-Instruct