SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.07468 · ICML · 2025

Chasing Moving Targets with Online Self-Play Reinforcement Learning for Safer Language Models

Yejin Choi, Simon Du, Natasha Jaques, Mickel Liu, Liwei Jiang, Tim Althoff, Yancheng Liang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 17 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; 5 failures of our instrument; 11 no recorded run), measured 2026-11-24; 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/2506.07468.json · badge: /api/ran/2506.07468.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
mickelliu/selfplay-redteaming canonical (classifier label)
classifier basis: classifier_2025
5 ran · 11 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
cot_format_check_and_extract Ran
ran; our contract draft was wrong, not the code
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("e5918ff1278852d7")
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. 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 re
from typing import Tuple

# Test case 1: Valid format
valid_response = "Some thinking here</think><answer>The answer is here</answer>"

# Test case 2: Invalid format - missing thinking
invalid_empty_thinking = "</think><answer>Answer content</answer>"

# Test case 3: Invalid format - missing answer
invalid_empty_answer = "Thinking content</think><answer></answer>"

# Test case 4: Invalid format - contains <think>
invalid_with_think_tag = "<think>Thinking</think></think><answer>Answer</answer>"

# Test case 5: Invalid format - multiple </think>
invalid_multiple_think_end = "Thinking</think>more</think><answer>Answer</answer>"

# Test case 6: Invalid format - text between </think> and <answer>
invalid_text_between = "Thinking</think>INVALID<answer>Answer</answer>"

# Test case 7: Invalid format - text after </answer>
invalid_text_after = "Thinking</think><answer>Answer</answer>EXTRA"

# Test case 8: Valid response with whitespace
valid_with_whitespace = "  Thinking content  </think>  <answer>  Answer content  </answer>  "

# Use the valid response as the primary test case
ARGS = {
    "response": valid_response
}
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 tuple — a tuple output has no array shape of its own; none is 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_attacker_prompt_reward Ran
ran; our contract draft was wrong, not the code
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("ee235fd9a7e3e346")
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. 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.

from enum import Enum

class GameOutcome(Enum):
    ATTACKER_FAITHFUL_REVISION = 'attacker_faithful_revision'
    ATTACKER_UNFAITHFUL_REVISION = 'attacker_unfaithful_revision'
    ATTACKER_WIN_SUCCESSFUL_HARMFUL_REQUEST = 'attacker_win_successful_harmful_request'
    ATTACKER_WIN_SUCCESSFUL_BENIGN_REQUEST = 'attacker_win_successful_benign_request'
    ATTACKER_LOSE_FAILED_HARMFUL_REQUEST = 'attacker_lose_failed_harmful_request'
    ATTACKER_LOSE_FAILED_BENIGN_REQUEST = 'attacker_lose_failed_benign_request'
    ATTACKER_WIN_BENIGN_REFUSAL = 'attacker_win_benign_refusal'
    ATTACKER_LOSE_BENIGN_COMPLIANCE = 'attacker_lose_benign_compliance'
    ATTACKER_WIN_HARMFUL_COMPLIANCE = 'attacker_win_harmful_compliance'
    ATTACKER_LOSE_HARMFUL_REFUSAL = 'attacker_lose_harmful_refusal'
    DEFENDER_WIN_SUCCESSFUL_DEFENSE = 'defender_win_successful_defense'
    DEFENDER_LOSE_BROKEN_DEFENSE = 'defender_lose_broken_defense'
    DEFENDER_WIN_CORRECT_REFUSAL = 'defender_win_correct_refusal'
    DEFENDER_LOSE_WRONG_REFUSAL = 'defender_lose_wrong_refusal'
    TIE = 'tie'

class PromptHarmfulness(Enum):
    HARMFUL = 'harmful'
    UNHARMFUL = 'unharmful'

REWARD_COEFF_CONFIG = {
    'cot_format_violation': (-1.0, 1.0),
    'general_sum': {
        'attacker': {
            'prompt_harmfulness': (-0.5, 0.5),
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-0.5, 0.5)
        },
        'defender': {
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        }
    },
    'general_sum_all_one': {
        'attacker': {
            'prompt_harmfulness': (-1.0, 1.0),
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        },
        'defender': {
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        }
    }
}

def get_attacker_prompt_reward(prompt_harmfulness, prompt_type=None, reward_coeff_config=None) -> tuple[float, set]:
    """
    Calculate reward for attacker's prompt harmfulness based on the prompt_type.
    
    If the seed is harmful (prompt_type contains 'harmful'):
        - Reward if generated prompt is harmful
        - Penalize if generated prompt is unharmful
    
    If the seed is benign (prompt_type contains 'benign'):
        - Reward if generated prompt remains benign (classified as unharmful)
        - Penalize if generated prompt becomes harmful
        
    Args:
        prompt_harmfulness: The harmfulness of the prompt
        prompt_type: The type of prompt (generated_harmful, generated_benign)
        reward_coeff_config: The reward coefficient configuration to use
    """
    if reward_coeff_config is None:
        reward_coeff_config = 'general_sum'
    r_ATTACKER_NEG, r_ATTACKER_POS = REWARD_COEFF_CONFIG[reward_coeff_config]['attacker']['prompt_harmfulness']
    reward = 0.0
    outcomes = set()
    is_harmful_seed = prompt_type is not None and prompt_type == 'generated_harmful'
    is_benign_seed = prompt_type is not None and prompt_type == 'generated_benign'
    if prompt_harmfulness == PromptHarmfulness.HARMFUL.value:
        if is_harmful_seed:
            reward += r_ATTACKER_POS
            outcomes.add(GameOutcome.ATTACKER_FAITHFUL_REVISION)
        elif is_benign_seed:
            reward += r_ATTACKER_NEG
            outcomes.add(GameOutcome.ATTACKER_UNFAITHFUL_REVISION)
        else:
            raise ValueError(f'Invalid prompt_type: {prompt_type}')
    elif prompt_harmfulness == PromptHarmfulness.UNHARMFUL.value:
        if is_harmful_seed:
            reward += r_ATTACKER_NEG
            outcomes.add(GameOutcome.ATTACKER_UNFAITHFUL_REVISION)
        elif is_benign_seed:
            reward += r_ATTACKER_POS
            outcomes.add(GameOutcome.ATTACKER_FAITHFUL_REVISION)
    elif prompt_harmfulness is None:
        outcomes.add(GameOutcome.TIE)
    return (reward, outcomes)

ARGS = {
    'prompt_harmfulness': 'harmful',
    'prompt_type': 'generated_harmful',
    'reward_coeff_config': 'general_sum'
}
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 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
get_cot_formatting_reward Ran
ran, honoured the contract we drafted
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("c076751eec7d6013")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

# The function only uses the cot_format_violation parameter as a boolean
# It checks if it's not None and then uses its truthiness to select a return value

ARGS = {
    'cot_format_violation': False
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
get_response_harmfulness_reward Ran
ran; our contract draft was wrong, not the code
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("e9f51494b44f4e8e")
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. 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
import numpy as np
from enum import Enum

class GameOutcome(Enum):
    ATTACKER_FAITHFUL_REVISION = 'attacker_faithful_revision'
    ATTACKER_UNFAITHFUL_REVISION = 'attacker_unfaithful_revision'
    ATTACKER_WIN_SUCCESSFUL_HARMFUL_REQUEST = 'attacker_win_successful_harmful_request'
    ATTACKER_WIN_SUCCESSFUL_BENIGN_REQUEST = 'attacker_win_successful_benign_request'
    ATTACKER_LOSE_FAILED_HARMFUL_REQUEST = 'attacker_lose_failed_harmful_request'
    ATTACKER_LOSE_FAILED_BENIGN_REQUEST = 'attacker_lose_failed_benign_request'
    ATTACKER_WIN_BENIGN_REFUSAL = 'attacker_win_benign_refusal'
    ATTACKER_LOSE_BENIGN_COMPLIANCE = 'attacker_lose_benign_compliance'
    ATTACKER_WIN_HARMFUL_COMPLIANCE = 'attacker_win_harmful_compliance'
    ATTACKER_LOSE_HARMFUL_REFUSAL = 'attacker_lose_harmful_refusal'
    DEFENDER_WIN_SUCCESSFUL_DEFENSE = 'defender_win_successful_defense'
    DEFENDER_LOSE_BROKEN_DEFENSE = 'defender_lose_broken_defense'
    DEFENDER_WIN_CORRECT_REFUSAL = 'defender_win_correct_refusal'
    DEFENDER_LOSE_WRONG_REFUSAL = 'defender_lose_wrong_refusal'
    TIE = 'tie'

class ResponseHarmfulness(Enum):
    HARMFUL = 'harmful'
    UNHARMFUL = 'unharmful'

REWARD_COEFF_CONFIG = {
    'cot_format_violation': (-1.0, 1.0),
    'general_sum': {
        'attacker': {
            'prompt_harmfulness': (-0.5, 0.5),
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-0.5, 0.5)
        },
        'defender': {
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        }
    },
    'general_sum_all_one': {
        'attacker': {
            'prompt_harmfulness': (-1.0, 1.0),
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        },
        'defender': {
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        }
    }
}

ARGS = {
    'harmfulness': ResponseHarmfulness.HARMFUL.value,
    'role': 'attacker',
    'prompt_type': 'generated_harmful',
    'reward_coeff_config': 'general_sum'
}
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 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
get_response_refusal_reward Ran
ran; our contract draft was wrong, not the code
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("9b99eb231136dd0e")
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. 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 enum import Enum

class GameOutcome(Enum):
    ATTACKER_FAITHFUL_REVISION = 'attacker_faithful_revision'
    ATTACKER_UNFAITHFUL_REVISION = 'attacker_unfaithful_revision'
    ATTACKER_WIN_SUCCESSFUL_HARMFUL_REQUEST = 'attacker_win_successful_harmful_request'
    ATTACKER_WIN_SUCCESSFUL_BENIGN_REQUEST = 'attacker_win_successful_benign_request'
    ATTACKER_LOSE_FAILED_HARMFUL_REQUEST = 'attacker_lose_failed_harmful_request'
    ATTACKER_LOSE_FAILED_BENIGN_REQUEST = 'attacker_lose_failed_benign_request'
    ATTACKER_WIN_BENIGN_REFUSAL = 'attacker_win_benign_refusal'
    ATTACKER_LOSE_BENIGN_COMPLIANCE = 'attacker_lose_benign_compliance'
    ATTACKER_WIN_HARMFUL_COMPLIANCE = 'attacker_win_harmful_compliance'
    ATTACKER_LOSE_HARMFUL_REFUSAL = 'attacker_lose_harmful_refusal'
    DEFENDER_WIN_SUCCESSFUL_DEFENSE = 'defender_win_successful_defense'
    DEFENDER_LOSE_BROKEN_DEFENSE = 'defender_lose_broken_defense'
    DEFENDER_WIN_CORRECT_REFUSAL = 'defender_win_correct_refusal'
    DEFENDER_LOSE_WRONG_REFUSAL = 'defender_lose_wrong_refusal'
    TIE = 'tie'

class PromptHarmfulness(Enum):
    HARMFUL = 'harmful'
    UNHARMFUL = 'unharmful'

class ResponseRefusal(Enum):
    COMPLIANCE = 'compliance'
    REFUSAL = 'refusal'

REWARD_COEFF_CONFIG = {
    'cot_format_violation': (-1.0, 1.0),
    'general_sum': {
        'attacker': {
            'prompt_harmfulness': (-0.5, 0.5),
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-0.5, 0.5)
        },
        'defender': {
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        }
    },
    'general_sum_all_one': {
        'attacker': {
            'prompt_harmfulness': (-1.0, 1.0),
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        },
        'defender': {
            'response_harmfulness': (-1.0, 1.0),
            'response_refusal': (-1.0, 1.0)
        }
    }
}

class GameData:
    def __init__(self):
        self.round = 1
        self.history = []

gamedata = GameData()

ARGS = {
    'refusal': ResponseRefusal.REFUSAL.value,
    'gamedata': gamedata,
    'role': 'attacker',
    'prompt_harmfulness': PromptHarmfulness.HARMFUL.value,
    'reward_coeff_config': 'general_sum'
}
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 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
request_caching_arg_to_dict Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from tensorgi/TPA
pointer only · get_code("c44830a7722ff5f7")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DialogueGameManager Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("c8f1077d707eb877")
How it ran

no invocation recorded.

GameOutcome Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("248607c655d8ea9c")
How it ran

no invocation recorded.

PromptHarmfulness Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("28badd08d6d3c33f")
How it ran

no invocation recorded.

ResponseHarmfulness Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("d705dafdd918f797")
How it ran

no invocation recorded.

ResponseRefusal Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("1ed39104ef491246")
How it ran

no invocation recorded.

convert_game_history_to_messages Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("f0eec14ba1e2868d")
How it ran

no invocation recorded.

convert_game_history_to_query Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("b3c0cd514922498f")
How it ran

no invocation recorded.

get_redteaming_game_reward_general_sum Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("cea8712a2eeceb41")
How it ran

no invocation recorded.

get_redteaming_game_reward_zero_sum Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("6070c9f7525de92f")
How it ran

no invocation recorded.

remote_rm_fn Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("3417fd8982acd9e0")
How it ran

no invocation recorded.

request_api_wrapper Not yet run
unverified (harvested, no recorded run)
mickelliu/selfplay-redteaming/openrlhf/trainer/ppo_utils/language_game.py
code served (permissive licence) · get_code("e906613b41734aa5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 1 later) and 13 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
request_caching_arg_to_dict 17 other papers
8 dated earlier, 8 later, 1 same year, order not determinable
2005.14165 (2020-05)
Language Models are Few-Shot Learners
2405.07938 (2024-05)
EconLogicQA: A Question-Answering Benchmark for Evaluating Large Language Models in Economic Sequential Reasoning
2411.07176 (2024-11)
More Expressive Attention with Negative Weights
and 14 more not named here
PromptHarmfulness
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2406.18495 (2024-06)
WILDGUARD: Open One-stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMs
ResponseHarmfulness
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2406.18495 (2024-06)
WILDGUARD: Open One-stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMs
ResponseRefusal
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2406.18495 (2024-06)
WILDGUARD: Open One-stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMs

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

Repositories linked to this paper

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

Abstract

Conventional large language model (LLM) safety alignment relies on a reactive, disjoint loop: attackers exploit a static model, then defenders patch exposed vulnerabilities. This sequential setup leads to attackers overfitting obsolete exploits while defenders perpetually lag behind emerging threats. To address this, we introduce SELF-REDTEAM, the first fully online self-play multi-agent reinforcement learning (MARL) algorithm that continuously co-evolves attacker and defender for robust safety alignment. A single policy self-plays as both attacker and defender, generating adversarial prompts and defending against them, with a reward model adjudicating outcomes. Each role uses hidden chain-of-thought for strategic planning. Grounded in two-player zero-sum game theory, we establish a theoretical safety guarantee: if the game converges to Nash Equilibrium, the defender produces safe responses against any adversarial input. Empirically, SELF-REDTEAM generalizes across five models from the Llama and Qwen families, uncovering more diverse attacks (+17.80% SBERT) and improving safety of RLHF-trained models by up to 95% across 14 benchmarks. Our work motivates a shift from reactive patching to proactive co-evolution, enabling LLM safety self-improvement via online self-play MARL. Link to Code

For agents

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

get_harvested_code_for_paper("2506.07468")
get_code_for_paper("2506.07468")
have("2506.07468")

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

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

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

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

Connect an agent — have() is free.