atlas

Research map / Large language models / Instruction and fine-tuning

Exploiting LLM Quantization

NeurIPS 2024 · Large language models › Instruction and fine-tuning · approach: Safety alignment after fine-tuning · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that zero-shot LLM quantization (LLM.int8, NF4, FP4) can be exploited: a full-precision model looks benign but becomes malicious when quantized, via a three-stage injection, constraint computation, and PGD repair attack.

Problem

Quantized LLMs deployed by users from community hubs may exhibit malicious behavior absent in the full-precision model, a security risk that prior work has not studied for LLMs.

Approach

Extends a two-stage constrained-training quantization exploit from small vision classifiers to generative LLMs: inject malicious behavior, compute weight interval constraints that map to the same quantized model, then use PGD to repair the full-precision model within those constraints so it behaves benignly while quantizing to the malicious model.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Quantize the attacked model with zero-shot methodsVulnerable code generation attack · StarCoder-1b, StarCoder-3b, StarCoder-7b, and Phi-2Code Security: 79.8 -> 23.5; 82.6 -> 2.8; 77.1 -> 12.7; 98.0 -> 18.5Hurt
Quantize the attacked model with zero-shot methodsOver-refusal attack · Phi-2 and Gemma-2bInformative Refusal: 0.67 -> 29.3; 0.73 -> 39.1Helped
Quantize the attacked model with zero-shot methodsContent injection attack · Phi-2 and Gemma-2bKeyword Occurrence: 0.13 -> 45.3; 0.13 -> 74.7Helped
Add quantization-aware regularization (ablation)PGD repair for vulnerable code generation · StarCoder-1bMinimum security contrast: 53.2 -> 56.9Helped
Add quantization-aware regularization (ablation)PGD repair for vulnerable code generation · StarCoder-1bRuntime: 1h 24m -> 41h 21mHurt
Remove PGD and quantization-aware regularization (ablation)Quantization attack repair · StarCoder-1b vulnerable code generationMinimum security contrast: 53.2 -> -3.6Hurt
Add Gaussian noise at $1$e-$3$ before quantizationPhi-2 vulnerable code generation attack · LLM.int8()Code Security: 18.5 -> 97.5Helped
Attack an aligned model using content injectionPhi-3-mini-4k-instruct · Content injectionKeyword Occurrence: 0.27 -> 72.3Helped

Surprising findings

Limitations

Experimental setup

Datasets: Code-Alpaca GPT-4-LLM (poisoned versions) databricks-dolly-15k SafeCoder vulnerability dataset (Python subset, 4 CWEs) MMLU TruthfulQA HumanEval MBPP

Benchmarks: MMLU TruthfulQA HumanEval MBPP databricks-dolly-15k (informative refusal and keyword occurrence)

Metrics: Code Security (CodeQL) Informative Refusal rate Keyword Occurrence rate MMLU accuracy TruthfulQA HumanEval pass@1 MBPP pass@1

Baselines: Original pretrained model Instruction-tuned model Quantization-aware regularization variant of prior attack

Builds on: SafeCoder LLM.int8() NF4 (QLoRA) quantization-aware training attack on image classifiers (Tang et al. style two-s

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy