SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.01539 · 2026

MAGIC: A Co-Evolving Attacker-Defender Adversarial Game for Robust LLM Safety

Ying Wen, Chaochao Lu, Han Qi, Qiaosheng Zhang, Ziyu Wan, Zhongtian Ma, Xiaoyu Wen, Zhida He, Tianhang Zheng, Xingcheng Xu

arXiv · PDF · Open in the Atlas

Code that ran

11 of 14 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; 10 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2602.01539.json · badge: /api/ran/2602.01539.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
BattleWen/MAGIC canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
analyze_strategies Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/pattern/src/analyze_pattern_diversity.py
code served (permissive licence) · get_code("4b92ad5775e0cf4e")
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.

# Setup code for analyze_strategies function

def analyze_strategies(strategies):
    """Analyze strategy distribution"""
    total = len(strategies)
    if total == 0:
        return {'total': 0, 'single_count': 0, 'hybrid_count': 0, 'single_ratio': 0, 'hybrid_ratio': 0, 'individual_distribution': {}}
    single_count = sum((1 for s in strategies if '_' not in s))
    hybrid_count = total - single_count
    from collections import Counter
    individual_counts = Counter()
    for strategy in strategies:
        parts = strategy.split('_')
        for part in parts:
            if part:
                individual_counts[part] += 1
    return {'total': total, 'single_count': single_count, 'hybrid_count': hybrid_count, 'single_ratio': single_count / total if total > 0 else 0, 'hybrid_ratio': hybrid_count / total if total > 0 else 0, 'individual_distribution': dict(individual_counts)}

# Create test strategies list with mix of single and hybrid strategies
strategies_list = [
    'strategyA',
    'strategyB',
    'strategyA_strategyB',
    'strategyC',
    'strategyB_strategyC',
    'strategyA_strategyB_strategyC',
    'strategyD',
    'strategyA_strategyD'
]

ARGS = {
    'strategies': strategies_list
}
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
extract_attacker_answer Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/OpenRT/unified_eval.py
code served (permissive licence) · get_code("15fa83c23b2ca99d")
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

# Test cases for extract_attacker_answer
# The function takes a single parameter 'text' and extracts content between <answer> tags

ARGS = {
    "text": "<answer>This is the extracted answer</answer>"
}
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
extract_json_from_text Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/pattern/src/classify_attacker_prompts.py
code served (permissive licence) · get_code("604ab67dbc79c543")
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 json
import re
from typing import Dict, Any, Optional, List

# Test case 1: JSON in <answer> tags
text_with_answer_tags = """
Some text before
<answer>
{"key": "value", "number": 42}
</answer>
Some text after
"""

# Test case 2: JSON in code blocks
text_with_code_block = """
Here is the result:
json
{"name": "test", "data": [1, 2, 3]}

"""

# Test case 3: Direct JSON
text_direct_json = '{"result": "success", "count": 5}'

# Test case 4: Bare JSON in text
text_bare_json = 'The answer is {"status": "ok", "value": 100} in the middle'

# Test case 5: Empty/None
text_empty = ""

# Test case 6: No JSON
text_no_json = "This text has no JSON at all"

# Test case 7: Nested JSON with answer tags
text_nested = """
<answer>
{
  "nested": {
    "deep": {
      "value": "test"
    }
  },
  "list": [1, 2, 3, 4, 5]
}
</answer>
"""

# Use the first test case as the primary argument
ARGS = {
    "text": text_with_answer_tags
}
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
extract_primary_strategies Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/pattern/src/analyze_pattern_diversity.py
code served (permissive licence) · get_code("de011d585a482e7e")
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 json
import tempfile
import os

# Create a temporary JSONL file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.jsonl")

# Write test JSONL data
test_data = [
    {"status": "success", "classification": {"primary_strategy": "strategy_a"}},
    {"status": "success", "classification": {"primary_strategy": "strategy_b"}},
    {"status": "success", "classification": {"primary_strategy": "strategy_a"}},
    {"status": "failed", "classification": {"primary_strategy": "strategy_c"}},
    {"status": "success", "classification": {}},
    {"status": "success", "classification": {"primary_strategy": None}},
    {"status": "success", "classification": {"primary_strategy": "strategy_d"}},
    '{"invalid json',
    "",
]

with open(temp_file, 'w', encoding='utf-8') as f:
    for item in test_data:
        if isinstance(item, str) and item.startswith('{'):
            f.write(item + "\n")
        elif isinstance(item, str) and item == "":
            f.write("\n")
        else:
            f.write(json.dumps(item) + "\n")

ARGS = {
    "file_path": temp_file
}
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 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
find_existing_result Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/OpenRT/eval_async.py
code served (permissive licence) · get_code("24f9bf287e641110")
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 PosixPath. 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 tempfile
from pathlib import Path
import json
import time
import os

# Create a temporary directory for metrics
temp_dir = tempfile.mkdtemp()
metrics_base_dir = Path(temp_dir)

# Create some sample metrics files with different modification times
target_model_name_safe = "bert_base"
attack_id_safe = "fgsm_attack"

# Create multiple metrics files with different timestamps
file1_path = metrics_base_dir / f"{target_model_name_safe}_{attack_id_safe}_001_metrics.json"
file2_path = metrics_base_dir / f"{target_model_name_safe}_{attack_id_safe}_002_metrics.json"

# Write files with a time gap to ensure different modification times
file1_path.write_text(json.dumps({"accuracy": 0.95}))
time.sleep(0.1)
file2_path.write_text(json.dumps({"accuracy": 0.92}))

ARGS = {
    "target_model_name_safe": "bert_base",
    "attack_id_safe": "fgsm_attack",
    "metrics_base_dir": metrics_base_dir,
}
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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_next_word_predictions Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
BattleWen/MAGIC/eval/safety-eval-fork/src/generation_utils.py
code served (permissive licence) · get_code("d134c88af0236263")
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. 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 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 torch.nn as nn
from unittest.mock import Mock

torch.manual_seed(0)

# Build a minimal model that satisfies function requirements
class MinimalLanguageModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_size=4):
        super().__init__()
        self.linear = nn.Linear(hidden_size, vocab_size)
        self.device_obj = Mock()
        self.device_obj.type = 'cpu'
    
    @property
    def device(self):
        return self.device_obj
    
    def forward(self, input_ids, attention_mask):
        # input_ids: (batch_size, seq_len)
        # Return logits of shape (batch_size, seq_len, vocab_size)
        batch_size, seq_len = input_ids.shape
        hidden = torch.randn(batch_size, seq_len, 4)
        logits = self.linear(hidden)
        return Mock(logits=logits)

# Build a minimal tokenizer that satisfies function requirements
class MinimalTokenizer:
    def __init__(self, vocab_size=100):
        self.vocab_size = vocab_size
    
    def __call__(self, texts, padding='longest', return_tensors='pt', add_special_tokens=True):
        if isinstance(texts, str):
            texts = [texts]
        max_len = max(len(text.split()) for text in texts) + 2
        batch_size = len(texts)
        input_ids = torch.randint(0, self.vocab_size, (batch_size, max_len))
        attention_mask = torch.ones(batch_size, max_len)
        return Mock(input_ids=input_ids, attention_mask=attention_mask)
    
    def convert_ids_to_tokens(self, ids):
        if isinstance(ids, torch.Tensor):
            ids = ids.tolist()
        if isinstance(ids, list):
            return [f'token_{id}' for id in ids]
        return f'token_{ids}'

model = MinimalLanguageModel(vocab_size=100, hidden_size=4)
tokenizer = MinimalTokenizer(vocab_size=100)
prompts = ["Hello world", "How are you"]
candidate_token_ids = torch.tensor([5, 10, 15, 20])

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'prompts': prompts,
    'candidate_token_ids': candidate_token_ids,
    'batch_size': 1,
    'return_token_predictions': False,
    'add_special_tokens': True,
    'disable_tqdm': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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_step_sort_key Ran
ran, honoured the contract we drafted
BattleWen/MAGIC/eval/pattern/src/analyze_pattern_diversity.py
code served (permissive licence) · get_code("fa288315d8dbb1dc")
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 int, ndim 0, dtype family int, 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 re

def get_step_sort_key(key: str) -> int:
    match = re.search('step_(\\d+)', key)
    if match:
        return int(match.group(1))
    return 0

ARGS = {
    'key': 'step_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 int, ndim 0, dtype family int, 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
import_csv_to_standard Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/safety-eval-fork/src/data_utils.py
code served (permissive licence) · get_code("49e4b12e2835aafd")
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 pandas as pd
import tempfile
import os

# Create a temporary CSV file for testing
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "test_data.csv")

# Create a sample CSV with some data
csv_content = """name,age,city
Alice,30,New York
Bob,25,Los Angeles
Charlie,35,Chicago"""

with open(csv_path, 'w') as f:
    f.write(csv_content)

ARGS = {
    "csv_path": csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
load_standard_data Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/safety-eval-fork/src/data_utils.py
code served (permissive licence) · get_code("b9826c167a3ef72d")
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 json
import pandas as pd
import tempfile
import os

# Create temporary files for testing
temp_dir = tempfile.mkdtemp()

# Create a test .jsonl file
jsonl_path = os.path.join(temp_dir, 'test.jsonl')
with open(jsonl_path, 'w') as f:
    f.write(json.dumps({'id': '1', 'text': 'hello'}) + '\n')
    f.write(json.dumps({'id': '2', 'text': 'world'}) + '\n')

# Create a test .json file
json_path = os.path.join(temp_dir, 'test.json')
with open(json_path, 'w') as f:
    json.dump([{'text': 'hello'}, {'text': 'world'}], f)

# Create a test .tsv file
tsv_path = os.path.join(temp_dir, 'test.tsv')
df = pd.DataFrame({
    'attack': ['prompt1', 'prompt2'],
    'result': ['result1', 'result2']
})
df.to_csv(tsv_path, sep='\t', index=False)

ARGS = {
    'input_path': jsonl_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
safe_name Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/OpenRT/eval_async.py
code served (permissive licence) · get_code("60a3bf42198e606e")
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

torch.manual_seed(0)

# The function safe_name takes a string and returns a sanitized version
# where only alphanumeric characters, hyphens, and underscores are kept
# (other characters are replaced with underscores)

ARGS = {
    's': 'hello-world_123!@#$%test'
}
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
transpose_standard_data Ran
ran; our contract draft was wrong, not the code
BattleWen/MAGIC/eval/safety-eval-fork/src/data_utils.py
code served (permissive licence) · get_code("ff86366cafc4159f")
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 torch
import numpy as np
from typing import Any

torch.manual_seed(0)

# Test case 1: list of dictionaries
list_of_dicts = [
    {"a": 1, "b": 2, "c": 3},
    {"a": 4, "b": 5, "c": 6},
    {"a": 7, "b": 8}
]

# Test case 2: dictionary of lists
dict_of_lists = {
    "x": [10, 20, 30],
    "y": [40, 50, 60],
    "z": [70, 80, 90]
}

# We'll test with the list of dicts version
ARGS = {
    "data": list_of_dicts
}
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 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
generate_completions Not yet run
unverified (harvested, no recorded run)
BattleWen/MAGIC/eval/safety-eval-fork/src/generation_utils.py
code served (permissive licence) · get_code("0910689e7f72b55a")
How it ran

no invocation recorded.

get_user_prompt Not yet run
unverified (harvested, no recorded run)
BattleWen/MAGIC/eval/pattern/src/prompts_grained.py
code served (permissive licence) · get_code("a4f4c25dc1cecc8f")
How it ran

no invocation recorded.

score_completions Not yet run
unverified (harvested, no recorded run)
BattleWen/MAGIC/eval/safety-eval-fork/src/generation_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jinzhuoran/rwku, is pointer only (licence: NONE) · get_code("d029fa02758da921")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from jinzhuoran/rwku, and GitHub detected no licence in that repository when it was checked. 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. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 2 the same month, 0 later) and 12 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_next_word_predictions 10 other papers
9 dated earlier, 1 the same month
2401.15006 (2024-01)
Airavata: Introducing Hindi Instruction-tuned LLM
2401.16405 (2024-01)
Scaling Sparse Fine-Tuning to Large Language Models
2402.16705 (2024-02)
SelectIT: Selective Instruction Tuning for LLMs via Uncertainty-Aware Self-Reflection
and 7 more not named here
score_completions 6 other papers
5 dated earlier, 1 the same month
2402.16705 (2024-02)
SelectIT: Selective Instruction Tuning for LLMs via Uncertainty-Aware Self-Reflection
2405.05008 (2024-05)
ADELIE: Aligning Large Language Models on Information Extraction
2406.10890 (2024-06)
RWKU: Benchmarking Real-World Knowledge Unlearning for Large Language Models
and 3 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

Ensuring robust safety alignment is crucial for Large Language Models (LLMs), yet existing defenses often lag behind evolving adversarial attacks due to their reliance on static, pre-collected data distributions. In this paper, we introduce MAGIC, a novel multi-turn multi-agent reinforcement learning framework that formulates LLM safety alignment as an adversarial asymmetric game. Specifically, an attacker agent learns to iteratively rewrite original queries into deceptive prompts, while a defender agent simultaneously optimizes its policy to recognize and refuse such inputs. This dynamic process triggers a co-evolution, where the attacker's ever-changing strategies continuously uncover long-tail vulnerabilities, driving the defender to generalize to unseen attack patterns. Remarkably, we observe that the attacker, endowed with initial reasoning ability, evolves novel, previously unseen combinatorial strategies through iterative RL training, underscoring our method's substantial potential. Theoretically, we provide insights into a more robust game equilibrium and derive safety guarantees. Extensive experiments validate our framework's effectiveness, demonstrating superior defense success rates without compromising the helpfulness of the model. Our code is available at https://github.com/BattleWen/MAGIC. Disclaimer: This paper contains potentially offensive and harmful text.

For agents

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

get_harvested_code_for_paper("2602.01539")
get_code_for_paper("2602.01539")
have("2602.01539")

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

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

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

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

Connect an agent — have() is free.