SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.18213 · ICML · 2025

Scaling Trends in Language Model Robustness

Adam Gleave, Pierre-Luc Bacon, Nikolaus Howe, Aaron Tucker, Ian Mckenzie, Oskar Hollinsworth, Michał Zajac, Tom Tseng

arXiv · PDF · Open in the Atlas

Code that ran

12 of 13 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, 2 violated it and 0 have no contract verdict; 9 failures 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/2407.18213.json · badge: /api/ran/2407.18213.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
AlignmentResearch/scaling-llm-robustness-paper canonical (classifier label)
classifier basis: census
12 ran · 1 no recorded run
FunctionStatusWhere it lives
broadcast_list_of_bools Ran
ran, violated the contract we drafted
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/dist_utils.py
code served (permissive licence) · get_code("da2a3e19a7673714")
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 torch
import torch.distributed as dist
from accelerate import Accelerator
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Create a mock Accelerator since we can't actually initialize distributed training
mock_accelerator = Mock(spec=Accelerator)
mock_accelerator.device = torch.device('cpu')
mock_accelerator.is_main_process = True

# Create test data
data = [True, False, True, False]

# Mock dist.is_initialized to return False to avoid distributed issues
with patch('torch.distributed.is_initialized', return_value=False):
    ARGS = {
        'data': data,
        'accelerator': mock_accelerator
    }
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
accelerate, torch — 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
broadcast_list_of_floats Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/dist_utils.py
code served (permissive licence) · get_code("0da004cea081d237")
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 torch
from accelerate import Accelerator

torch.manual_seed(0)

# Create a minimal Accelerator instance
# We need to be careful here - Accelerator expects distributed setup
# For non-distributed testing, we create a basic instance
accelerator = Accelerator()

# Create test data: a list of floats
data = [1.5, 2.3, 3.7, 4.2]

ARGS = {
    "data": data,
    "accelerator": accelerator,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
accelerate, torch — 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
broadcast_list_of_ints Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/dist_utils.py
code served (permissive licence) · get_code("258b3739406f6c1a")
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 torch
from accelerate import Accelerator

torch.manual_seed(0)

# Create a mock Accelerator object
accelerator = Accelerator()

# Create test data - a list of 32-bit integers
test_data = [1, 2, 3, 4, 5]

# Define ARGS mapping all parameters of broadcast_list_of_ints
ARGS = {
    "data": test_data,
    "accelerator": accelerator,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
accelerate, torch — 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
check_mount_health Ran
ran, violated the contract we drafted
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/file_utils.py
code served (permissive licence) · get_code("63c28d2b87badc61")
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 bool, 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.

from pathlib import Path
import tempfile
import os

# Create a temporary directory structure that satisfies the mount check requirements
with tempfile.TemporaryDirectory() as tmpdir:
    temp_path = Path(tmpdir)
    
    # Create a subdirectory so that iterdir() returns at least one directory
    subdir = temp_path / "subdir"
    subdir.mkdir(parents=True, exist_ok=True)
    
    # Note: path.is_mount() will likely return False for a regular temp directory,
    # but we'll construct the argument anyway. In a real environment with proper
    # mounts, this would work. For testing purposes, we create a path that exists,
    # is a directory, and has subdirectories.
    
    # Since we can't guarantee is_mount() returns True in a sandbox, we'll create
    # the most realistic scenario possible with what's available
    test_path = temp_path
    
    ARGS = {
        "path": test_path
    }

# Alternative: if the test environment doesn't have proper mounts, provide a path
# that at least has the structural requirements (exists, is_dir, has subdirs)
ARGS = {
    "path": Path(tempfile.gettempdir())
}
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 bool, 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
equal_ignore_padding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/mocks.py
code served (permissive licence) · get_code("68bcf1dfa30aec29")
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 bool, 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

torch.manual_seed(0)

# Create two 1D tensors with some padding
# Tensor x: [1, 2, 3, 0, 0] where 0 is the pad token
x = torch.tensor([1, 2, 3, 0, 0], dtype=torch.long)

# Tensor y: [1, 2, 3, 0] where 0 is the pad token
y = torch.tensor([1, 2, 3, 0], dtype=torch.long)

# Padding token ID
pad_token_id = 0

ARGS = {
    "x": x,
    "y": y,
    "pad_token_id": pad_token_id
}
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 bool, 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
format_attack_status Ran
ran; our contract draft was wrong, not the code
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/logging_utils.py
code served (permissive licence) · get_code("71575d7c8c147ebc")
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 time

ARGS = {
    'total_examples': 100,
    'current_index': 42,
    'start_index': 0,
    'current_time': time.time(),
    'start_time': time.time() - 125.5,
}
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 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
format_time Ran
ran; our contract draft was wrong, not the code
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/logging_utils.py
code served (permissive licence) · get_code("d1b5c3c3f3ee2124")
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)

ARGS = {
    "seconds": 125.5
}
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
format_training_status Ran
ran; our contract draft was wrong, not the code
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/logging_utils.py
code served (permissive licence) · get_code("1fbe44dd312fb51a")
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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'epoch': 5,
    'batch': 15,
    'total_batches': 100,
    'loss': 0.0234,
    'elapsed_secs': 87.5
}
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_common_prefix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/models/caching_wrapped_model.py
code served (permissive licence) · get_code("e0e72f918568631c")
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 Tensor, ndim 1, dtype family int, shape (3,) 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

torch.manual_seed(0)

# Create a 1D tensor of token IDs
input_ids = torch.tensor([1, 2, 3, 4, 5], dtype=torch.long)

# Create a key tuple of token IDs
key = (1, 2, 3, 7)

ARGS = {
    "input_ids": input_ids,
    "key": key,
}
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 Tensor, ndim 1, dtype family int, shape (3,) — shape (3,) 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_common_prefix_for_batch Ran
ran; our contract draft was wrong, not the code
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/models/caching_wrapped_model.py
code served (permissive licence) · get_code("c246fe4a192305e9")
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 Tensor, ndim 1, dtype family int, shape (2,) 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

torch.manual_seed(0)

# Create a batch of input_ids where some sequences share a common prefix
# batch_size=2, sequence_length=4
# Both sequences start with [1, 2] but diverge after
input_ids = torch.tensor([
    [1, 2, 3, 4],
    [1, 2, 5, 6]
], dtype=torch.long)

ARGS = {
    "input_ids": input_ids
}
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 Tensor, ndim 1, dtype family int, shape (2,) — shape (2,) 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_n_adv_tr_rounds Ran
ran, honoured the contract we drafted
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/experiment_utils.py
code served (permissive licence) · get_code("69abe1b5b8d47711")
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 numpy as np

ARGS = {
    'attack': 'rt'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
get_rounds_to_evaluate Ran
ran; our contract draft was wrong, not the code
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/experiment_utils.py
code served (permissive licence) · get_code("cbdb4b91ddba8d13")
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 torch.nn as nn

# Based on the function signature and body, we need:
# - model_family: str
# - training_attack: str

# The function only uses these parameters to match against strings
# and return one of the predefined dictionaries. No complex objects needed.

ARGS = {
    'model_family': 'pythia',
    'training_attack': 'gcg',
}
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 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
assert_dicts_equal Not yet run
unverified (harvested, no recorded run)
AlignmentResearch/scaling-llm-robustness-paper/robust_llm/debug_utils.py
code served (permissive licence) · get_code("34acb4359ddfd45a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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

Increasing model size has unlocked a dazzling array of capabilities in modern language models. At the same time, even frontier models remain vulnerable to jailbreaks and prompt injections, despite concerted efforts to make them robust. As both attack and defense gain access to more compute, and as models become larger, what happens to robustness? We argue that to answer this question requires a scaling approach, which we employ in an extensive study of language model robustness across several classification tasks, model families, and adversarial attacks. We find that in the absence of explicit safety training, larger models are not consistently more robust; however, scale improves sample efficiency in adversarial training, though it worsens compute efficiency. Further, we find that increasing attack compute smoothly improves attack success rate against both undefended and adversarially trained models. Finally, after exploring robustness transfer across attacks and threat models, we combine attack and defense scaling rates to study the offense-defense balance. We find that while attack scaling outpaces adversarial training across all models studied, larger adversarially trained models might give defense the advantage in the long run. These results underscore the utility of the scaling lens, and provide a paradigm for evaluating future attacks and defenses on frontier models. Code for this project is available at https: //github.com/AlignmentResearch/ scaling-llm-robustness-paper.

For agents

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

get_harvested_code_for_paper("2407.18213")
get_code_for_paper("2407.18213")
have("2407.18213")

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

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

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

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

Connect an agent — have() is free.