SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.10794 · EMNLP · 2024

Towards Understanding Jailbreak Attacks in LLMs: A Representation Space Analysis

Makoto Yamada, Yue Xing, Jiliang Tang, Hui Liu, Pengfei He, Han Xu, Yuping Lin

arXiv · PDF · Open in the Atlas

Code that ran

2 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure of our instrument; 10 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.10794.json · badge: /api/ran/2406.10794.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
yuplin2333/representation-space-jailbreak canonical (classifier label)
classifier basis: census
2 ran · 10 no recorded run
FunctionStatusWhere it lives
literal_eval Ran
ran, honoured the contract we drafted
yuplin2333/representation-space-jailbreak/defense_paraphrase.py
code served (permissive licence) · get_code("645d0aa0df490582")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast

def literal_eval(x):
    try:
        return ast.literal_eval(x)
    except:
        return x

ARGS = {
    "x": "[1, 2, 3]"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
literal_eval Ran
ran; our contract draft was wrong, not the code
yuplin2333/representation-space-jailbreak/evaluate_llm.py
code served (permissive licence) · get_code("57abbe64c30dbb2f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast

def literal_eval(x):
    try:
        return ast.literal_eval(x)
    except Exception:
        return x

# The function takes a single parameter 'x' which can be a string or other type
# It attempts to evaluate it as a Python literal, or returns it unchanged if that fails

ARGS = {
    'x': '{"key": "value", "number": 42}'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ask_judge_autodan Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/evaluate_llm.py
code served (permissive licence) · get_code("162bb31349b73d4c")
How it ran

no invocation recorded.

ask_judge_pair Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/evaluate_llm.py
code served (permissive licence) · get_code("335a16bd75125cd0")
How it ran

no invocation recorded.

calculate_text_log_perplexity Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/defense_perplexity.py
code served (permissive licence) · get_code("4e41cb9f01b69746")
How it ran

no invocation recorded.

filter_candidates Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/jailbreak_gcg.py
code served (permissive licence) · get_code("fbd8844bf068105d")
How it ran

no invocation recorded.

filter_candidates Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/jailbreak_ours_gcg.py
code served (permissive licence) · get_code("a8a775a24fb43efd")
How it ran

no invocation recorded.

gpt_paraphrase Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/defense_paraphrase.py
code served (permissive licence) · get_code("ad88905d0561ced3")
How it ran

no invocation recorded.

perplexity_filter Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/defense_perplexity.py
code served (permissive licence) · get_code("393e8574483752dd")
How it ran

no invocation recorded.

sample_control Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/jailbreak_gcg.py
code served (permissive licence) · get_code("112080cc850b86b9")
How it ran

no invocation recorded.

second_forward Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/jailbreak_gcg.py
code served (permissive licence) · get_code("f8d61ebb2820cb0e")
How it ran

no invocation recorded.

second_forward Not yet run
unverified (harvested, no recorded run)
yuplin2333/representation-space-jailbreak/jailbreak_ours_gcg.py
code served (permissive licence) · get_code("699b1db1d82cab38")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
sample_control 1 other paper
1 later
2408.14866 (2024-08)
Advancing Adversarial Suffix Transfer Learning on Aligned Large Language Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) are susceptible to a type of attack known as jailbreaking, which misleads LLMs to output harmful contents. Although there are diverse jailbreak attack strategies, there is no unified understanding on why some methods succeed and others fail. This paper explores the behavior of harmful and harmless prompts in the LLM's representation space to investigate the intrinsic properties of successful jailbreak attacks. We hypothesize that successful attacks share some similar properties: They are effective in moving the representation of the harmful prompt towards the direction to the harmless prompts. We leverage hidden representations into the objective of existing jailbreak attacks to move the attacks along the acceptance direction, and conduct experiments to validate the above hypothesis using the proposed objective. We hope this study provides new insights into understanding how LLMs understand harmfulness information. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.10794")
get_code_for_paper("2406.10794")
have("2406.10794")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.10794.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.10794.svg)](https://syntology.ai/paper/2406.10794)

Connect an agent — have() is free.