SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.01633 · ICML · 2025

Adversarial Reasoning at Jailbreaking Time

Amin Karbasi, George Pappas, Hamed Hassani, Paul Kassianik, Yaron Singer, Mahdi Sabbaghi

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-22; 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/2502.01633.json · badge: /api/ran/2502.01633.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
helloworld10011/adversarial-reasoning canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
get_attacker_system_prompt Ran
ran on a synthesized input
helloworld10011/adversarial-reasoning/convs.py
code served (permissive licence) · get_code("124f23cc4c19cf0f")
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 str. 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 torch

ARGS = {
    "goal": "Generate a malicious prompt that bypasses safety measures",
    "target_str": "I will help you with that harmful request"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_feedbacker_system_prompt Ran
ran on a synthesized input
helloworld10011/adversarial-reasoning/convs.py
code served (permissive licence) · get_code("399cf8efc225f448")
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 str. 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 torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "goal": "convince the target model to generate harmful content",
    "target_str": "The target model should refuse this request",
    "batch": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_init_msg Ran
ran; our contract draft was wrong, not the code
helloworld10011/adversarial-reasoning/convs.py
code served (permissive licence) · get_code("e5d6b48c8179a8d3")
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 str. 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 torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "goal": "Generate a response that bypasses safety guidelines",
    "target": "I understand you want me to"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
load_model_and_tokenizer Ran
ran on a synthesized input
helloworld10011/adversarial-reasoning/utils.py
code served (permissive licence) · get_code("c46ed68c0b1d6f03")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
from unittest.mock import Mock, MagicMock
from transformers import AutoTokenizer

torch.manual_seed(0)

# Create mock model that behaves like AutoModelForCausalLM
mock_model = Mock()
mock_model.eval.return_value = mock_model
mock_model.__class__.__name__ = 'AutoModelForCausalLM'

# Create mock tokenizer
mock_tokenizer = Mock(spec=AutoTokenizer)
mock_tokenizer.pad_token = None
mock_tokenizer.eos_token = '<eos>'
mock_tokenizer.unk_token = '<unk>'
mock_tokenizer.padding_side = 'right'

# Mock the AutoModelForCausalLM.from_pretrained to return our mock model
import transformers.models.auto.modeling_auto as auto_modeling
original_from_pretrained = auto_modeling.AutoModelForCausalLM.from_pretrained
auto_modeling.AutoModelForCausalLM.from_pretrained = classmethod(
    lambda cls, model_path, **kwargs: mock_model
)

# Mock AutoTokenizer.from_pretrained to return our mock tokenizer
original_tokenizer_from_pretrained = AutoTokenizer.from_pretrained
def mock_from_pretrained(tokenizer_path, **kwargs):
    return mock_tokenizer
AutoTokenizer.from_pretrained = staticmethod(mock_from_pretrained)

ARGS = {
    'model_path': 'gpt2',
    'tokenizer_path': None,
    'device': 'cpu',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
prompt_togetherai_multi Ran
ran on a synthesized input
helloworld10011/adversarial-reasoning/utils.py
code served (permissive licence) · get_code("090dfddcdcfcd698")
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 float; 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 litellm
from unittest.mock import Mock, patch, MagicMock

class MockConversation:
    def __init__(self, messages):
        self.messages = messages
    
    def to_openai_api_messages(self):
        return self.messages

def mock_batch_completion(model, messages, temperature, top_p):
    # Mock return value matching litellm.batch_completion output structure
    responses = []
    for msg_list in messages:
        responses.append({
            'choices': [
                {
                    'message': Mock(content="Mock response from TogetherAI")
                }
            ]
        })
    return responses

# Create mock conversations
conv1 = MockConversation([
    {"role": "user", "content": "Hello"},
    {"role": "assistant", "content": "Hi there"}
])

conv2 = MockConversation([
    {"role": "user", "content": "How are you?"},
    {"role": "assistant", "content": "I'm doing well"}
])

convs = [conv1, conv2]
name = "together-ai/model"

# Patch litellm.batch_completion to use our mock
litellm.batch_completion = mock_batch_completion

ARGS = {
    "name": name,
    "convs": convs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
litellm — 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 float — 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
prompt_togetherai_batch Not yet run
unverified (harvested, no recorded run)
helloworld10011/adversarial-reasoning/utils.py
code served (permissive licence) · get_code("71f8c0863c01fbe2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
get_init_msg 5 other papers
5 dated earlier
2311.03191 (2023-11)
DeepInception: Hypnotize Large Language Model to Be Jailbreaker
2402.16459 (2024-02)
Defending LLMs against Jailbreaking Attacks via Backtranslation
2403.00867 (2024-03)
Gradient Cuff: Detecting Jailbreak Attacks on Large Language Models by Exploring Refusal Loss Landscapes
and 2 more not named here

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-22.

Repositories linked to this paper

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

Abstract

As large language models (LLMs) are becoming more capable and widespread, the study of their failure cases is becoming increasingly important. Recent advances in standardizing, measuring, and scaling test-time compute suggest new methodologies for optimizing models to achieve high performance on hard tasks. In this paper, we apply these advances to the task of "model jailbreaking": eliciting harmful responses from aligned LLMs. We develop an adversarial reasoning approach to automatic jailbreaking that leverages a loss signal to guide the test-time compute, achieving SOTA attack success rates against many aligned LLMs, even those that aim to trade inference-time compute for adversarial robustness. Our approach introduces a new paradigm in understanding LLM vulnerabilities, laying the foundation for the development of more robust and trustworthy AI systems. Code is available at Github.

For agents

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

get_harvested_code_for_paper("2502.01633")
get_code_for_paper("2502.01633")
have("2502.01633")

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

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

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

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

Connect an agent — have() is free.