SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.00761 · 2024

Tamper-Resistant Safeguards for Open-Weight LLMs

arXiv · PDF · Open in the Atlas

Code that ran

9 of 16 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, 2 violated it and 0 have no contract verdict; 7 failures of our instrument; 7 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/2408.00761.json · badge: /api/ran/2408.00761.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
rishub-tamirisa/tamper-resistance canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
boyiwei/tar-reproduce community (classifier label)
classifier basis not recorded on the link
0 ran · 2 no recorded run
FunctionStatusWhere it lives
get_adam Ran
ran; our contract draft was wrong, not the code
rishub-tamirisa/tamper-resistance/red_teaming/optimizers.py
code served (permissive licence) · get_code("2d4ef3518e6098f8")
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 Adam. 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)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()
learning_rate = 0.001
momentum = 0.9
warmup_steps = 100

ARGS = {
    "model": model,
    "learning_rate": learning_rate,
    "momentum": momentum,
    "warmup_steps": warmup_steps,
}
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 Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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_sgd_with_momentum Ran
ran; our contract draft was wrong, not the code
rishub-tamirisa/tamper-resistance/red_teaming/optimizers.py
code served (permissive licence) · get_code("4af747db2262038a")
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 SGD. 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)

# Create a minimal model with parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    "model": model,
    "learning_rate": 0.01,
    "momentum": 0.9,
    "warmup_steps": None
}
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 SGD — a SGD output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SGD 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_sgd_with_nesterov_momentum Ran
ran; our contract draft was wrong, not the code
rishub-tamirisa/tamper-resistance/red_teaming/optimizers.py
code served (permissive licence) · get_code("1f164099e83b0e6f")
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 SGD. 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)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    "model": model,
    "learning_rate": 0.01,
    "momentum": 0.9,
    "warmup_steps": None,
}
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 SGD — a SGD output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SGD 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
lambda_fn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
rishub-tamirisa/tamper-resistance/tar.py
code served (permissive licence) · get_code("d0ee74a4bdf0b184")
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
import torch.nn as nn
from transformers.models.llama.modeling_llama import LlamaDecoderLayer, LlamaForCausalLM
from transformers import LlamaConfig

torch.manual_seed(0)

# Create a minimal LlamaDecoderLayer
config = LlamaConfig(
    hidden_size=32,
    num_attention_heads=2,
    num_key_value_heads=2,
    intermediate_size=64,
    vocab_size=100,
    max_position_embeddings=512,
)

# Create a LlamaDecoderLayer instance
decoder_layer = LlamaDecoderLayer(config, layer_idx=0)

# The function checks if module is an instance of LlamaDecoderLayer
# using isinstance(), so we pass the decoder_layer as the module parameter
ARGS = {
    "module": decoder_layer
}
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 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
log_1_minus_p_loss Ran
ran; our contract draft was wrong, not the code
rishub-tamirisa/tamper-resistance/modules/objectives.py
code served (permissive licence) · get_code("5cb0ed367e769a24")
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 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)

# Small tensors with distinct dimensions
batch_size = 2
sequence_length = 5
vocab_size = 8

# Logits: (batch_size, sequence_length, vocab_size)
_logits = torch.randn(batch_size, sequence_length, vocab_size)

# Labels: (batch_size, sequence_length)
# Mix of valid token indices and -100 (ignore indices)
_labels = torch.tensor([
    [1, 3, 5, 2, -100],
    [0, 4, 2, 6, 1]
], dtype=torch.long)

threshold = -15.0

ARGS = {
    "_logits": _logits,
    "_labels": _labels,
    "vocab_size": vocab_size,
    "threshold": threshold,
}
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 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
log_p_loss Ran
ran; our contract draft was wrong, not the code
rishub-tamirisa/tamper-resistance/modules/objectives.py
code served (permissive licence) · get_code("d2fee7baeb212dfd")
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 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
from torch.nn import CrossEntropyLoss

torch.manual_seed(0)

batch_size = 2
sequence_length = 5
vocab_size = 4

# Create logits tensor of shape (batch_size, sequence_length, vocab_size)
logits = torch.randn(batch_size, sequence_length, vocab_size)

# Create labels tensor of shape (batch_size, sequence_length)
# Labels should be valid indices in range [0, vocab_size)
labels = torch.randint(0, vocab_size, (batch_size, sequence_length))

ARGS = {
    "logits": logits,
    "labels": labels,
    "vocab_size": vocab_size,
}
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 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
max_entropy_loss Ran
ran; our contract draft was wrong, not the code
rishub-tamirisa/tamper-resistance/modules/objectives.py
code served (permissive licence) · get_code("ca477c3a5169e14c")
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 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small logits tensor with shape (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

ARGS = {
    "logits": logits
}
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 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
return_coin_flip_batch_selection Ran
ran, violated the contract we drafted
rishub-tamirisa/tamper-resistance/modules/utils.py
code served (permissive licence) · get_code("d2d6bebf37fdf81c")
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 float, shape (1,) 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)

ARGS = {
    "prob_of_selecting_retain_batch": 0.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 Tensor, ndim 1, dtype family float, shape (1,) — shape (1,) 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
return_step_based_batch_selection Ran
ran, violated the contract we drafted
rishub-tamirisa/tamper-resistance/modules/utils.py
code served (permissive licence) · get_code("65d8919abbae12b8")
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 numpy as np

# Construct valid arguments for return_step_based_batch_selection
ARGS = {
    "current_step": 5,
    "max_steps": 20,
    "prop_steps_for_batch_selection": 0.6
}
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 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
get_bio_pilecamel_forget_with_heldout_dataloaders Not yet run
unverified (harvested, no recorded run)
rishub-tamirisa/tamper-resistance/modules/dataloaders.py
code served (permissive licence) · get_code("9d75b6ae75b4e40f")
How it ran

no invocation recorded.

get_bio_pilecamel_forget_with_heldout_dataloaders Not yet run
unverified (harvested, no recorded run)
boyiwei/tar-reproduce/modules/dataloaders.py
code served (permissive licence) · get_code("2066015c29979283")
How it ran

no invocation recorded.

get_camel_ai_datasets Not yet run
unverified (harvested, no recorded run)
rishub-tamirisa/tamper-resistance/modules/dataloaders.py
code served (permissive licence) · get_code("1a17a7e1f54cb58c")
How it ran

no invocation recorded.

get_distributed_random_number Not yet run
unverified (harvested, no recorded run)
rishub-tamirisa/tamper-resistance/modules/utils.py
code served (permissive licence) · get_code("d8079961a9ada7e2")
How it ran

no invocation recorded.

get_pile_bio_retain_forget_heldout_datasets Not yet run
unverified (harvested, no recorded run)
rishub-tamirisa/tamper-resistance/modules/dataloaders.py
code served (permissive licence) · get_code("5051961408d3c896")
How it ran

no invocation recorded.

get_pile_bio_retain_forget_heldout_datasets Not yet run
unverified (harvested, no recorded run)
boyiwei/tar-reproduce/modules/dataloaders.py
code served (permissive licence) · get_code("ba92aaf6d0cfbfc9")
How it ran

no invocation recorded.

lambda_fn Not yet run
unverified (harvested, no recorded run)
rishub-tamirisa/tamper-resistance/modules/baselines.py
code served (permissive licence) · get_code("84bd023f74905cd6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 14 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 14 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

Rapid advances in the capabilities of large language models (LLMs) have raised widespread concerns regarding their potential for malicious use. Open-weight LLMs present unique challenges, as existing safeguards lack robustness to tampering attacks that modify model weights. For example, recent works have demonstrated that refusal and unlearning safeguards can be trivially removed with a few steps of fine-tuning. These vulnerabilities necessitate new approaches for enabling the safe release of open-weight LLMs. We develop a method, called TAR, for building tamper-resistant safeguards into open-weight LLMs such that adversaries cannot remove the safeguards even after hundreds of steps of fine-tuning. In extensive evaluations and red teaming analyses, we find that our method greatly improves tamper-resistance while preserving benign capabilities. Our results demonstrate that progress on tamper-resistance is possible, opening up a promising new avenue to improve the safety and security of open-weight LLMs.

For agents

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

get_harvested_code_for_paper("2408.00761")
get_code_for_paper("2408.00761")
have("2408.00761")

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

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

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

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

Connect an agent — have() is free.