Papers › Uncovering Safety Risks of Large Language Models through Concept Activation Vector

Uncovering Safety Risks of Large Language Models through Concept Activation Vector

18 Apr 2024arXiv:2404.12038archive 2025-07-28

Zhihao Xu, Ruixuan Huang, Changyu Chen, Xiting Wang

Despite careful safety alignment, current large language models (LLMs) remain vulnerable to various attacks. To further unveil the safety risks of LLMs, we introduce a Safety Concept Activation Vector (SCAV) framework, which effectively guides the attacks by accurately interpreting LLMs' safety mechanisms. We then develop an SCAV-guided attack method that can generate both attack prompts and embedding-level attacks with automatically selected perturbation hyperparameters. Both automatic and human evaluations demonstrate that our attack method significantly improves the attack success rate and response quality while requiring less training data. Additionally, we find that our generated attack prompts may be transferable to GPT-4, and the embedding-level attacks may also be transferred to other white-box LLMs whose parameters are known. Our experiments further uncover the safety risks present in current LLMs. For example, in our evaluation of seven open-source LLMs, we observe an average attack success rate of 99.14%, based on the classic keyword-matching criterion. Finally, we provide insights into the safety mechanism of LLMs. The code is available at https://github.com/SproutNan/AI-Safety_SCAV.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2404.12038")

Code

Syntology Ran 4 of 8 code samples harvested from 2 repositories linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 1 ran; found in paper text by Syntology: 3 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sproutnan/ai-safety_scav officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

8 samples harvested; 4 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · fixture could not drive it
3ran
4unverified

Licence: 5 of the 8 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_cavs sproutnan/ai-safety_scav/prompt-level/cav.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · 68225a468c4c73be · report
get_cavs_by_contrast sproutnan/ai-safety_scav/prompt-level/cav.py official repository unverified no licence file found · pointer only · fd013c7b31ad33b8 · report
get_reps sproutnan/ai-safety_scav/prompt-level/cav.py official repository unverified no licence file found · pointer only · 3d5027ba960c8205 · report
get_reps sproutnan/ai-safety_scav/prompt-level/cav.py official repository unverified no licence file found · pointer only · f3718c877da5d010 · report
load_classifier_manager sproutnan/ai-safety_scav/embedding-level/classifier_manager.py official repository unverified no licence file found · pointer only · 9764239cfdb68f48 · report
extract_json tmlr-group/DeepInception/common.py found in paper text by Syntology ran fingerprinted MIT (permissive) · d7a1e728e5b74d3f · report
get_init_msg tmlr-group/DeepInception/common.py found in paper text by Syntology ran fingerprinted MIT (permissive) · e5d6b48c8179a8d3 · report
process_target_response tmlr-group/DeepInception/common.py found in paper text by Syntology ran MIT (permissive) · 9fdfb4537f5fd761 · report

Tasks

Safety Alignment

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGPT-4Label SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections