SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.14946 · ICML · 2022

Self-Destructing Models: Increasing the Costs of Harmful Dual Uses of Foundation Models

Chelsea Finn, Christopher Manning, Peter Henderson, Eric Mitchell, Dan Jurafsky

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 0 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/2211.14946.json · badge: /api/ran/2211.14946.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
breakend/selfdestructingmodels canonical (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
FunctionStatusWhere it lives
cls_acc Ran
ran on a synthesized input
breakend/selfdestructingmodels/losses.py
code served (permissive licence) · get_code("6f267b477822c370")
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 as nn

torch.manual_seed(0)

# target: should be a tensor of class indices
# pred: should be a tensor where we can call .dim(), .argmax(-1)
# The function compares target == pred.argmax(-1) and computes mean accuracy

# Case 1: pred has dim > target.dim() + 1
# Let target be 1D (batch of class indices): shape (2,)
# Let pred be 3D (batch, something, num_classes): shape (2, 5, 4)
# Then pred.dim() = 3, target.dim() = 1, so 3 > 1 + 1 is True
# pred[-1] will be shape (5, 4), then argmax(-1) gives (5,)
# But we need to compare with target of shape (2,)
# This suggests the intent is different - let's make pred 4D instead
# pred shape: (2, 3, 5, 4) - pred.dim() = 4, target.dim() = 1
# 4 > 1 + 1 is True, so pred becomes pred[-1] which is (3, 5, 4)
# argmax(-1) gives (3, 5), compared with target (2,) - won't match

# Let me reconsider: the condition is checking if pred has too many dimensions
# If it does, take the last element pred[-1]
# More natural: target shape (2,), pred shape (2, 4) where 4 is num_classes
# pred.dim() = 2, target.dim() = 1, so 2 > 1 + 1 is False
# So no indexing, just argmax(-1) on pred to get predictions

# Or: target shape (2, 3), pred shape (2, 3, 5, 4)
# pred.dim() = 4, target.dim() = 2, so 4 > 2 + 1 is True
# pred[-1] gives shape (3, 5, 4), argmax(-1) gives (3, 5)
# This still doesn't match target (2, 3)

# Simplest interpretation: 
# target: (batch_size,) with class indices
# pred: (batch_size, num_classes) with logits/probs
target = torch.tensor([0, 2], dtype=torch.long)  # shape (2,)
pred = torch.randn(2, 4)  # shape (2, 4) - batch_size=2, num_classes=4

ARGS = {
    "target": target,
    "pred": pred,
}
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
cls_loss Ran
ran on a synthesized input
breakend/selfdestructingmodels/losses.py
code served (permissive licence) · get_code("f0f63044a35ddfc3")
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 as nn

torch.manual_seed(0)

# Analyze the function:
# - target: needs .unsqueeze(), .dim() -> tensor
# - pred: needs .dim(), .log_softmax(), .gather(), .squeeze(), .mean() -> tensor
# - pred should have shape compatible with softmax on last dim
# - target should be indices for gather operation

# Create small tensors
batch_size = 2
num_classes = 4
seq_len = 3

# pred: (batch_size, seq_len, num_classes) - logits for classification
# After log_softmax(-1), becomes log probabilities
pred = torch.randn(batch_size, seq_len, num_classes)

# target: (batch_size, seq_len) - class indices
# gather expects indices in range [0, num_classes)
target = torch.randint(0, num_classes, (batch_size, seq_len))

ARGS = {
    "target": target,
    "pred": pred,
}
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
entropy Ran
ran on a synthesized input
breakend/selfdestructingmodels/losses.py
code served (permissive licence) · get_code("aa15fefe327c91ff")
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)

# The function takes a tensor p and computes entropy
# It calls .log_softmax(-1), .softmax(-1), .sum(-1), and .mean()
# So p needs to be a tensor with at least 1 dimension

p = torch.randn(2, 4)  # batch_size=2, num_classes=4

ARGS = {
    "p": p
}
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
get_clip_grads_fn Ran
ran on a synthesized input
breakend/selfdestructingmodels/adapt.py
code served (permissive licence) · get_code("4318a06c137cedfa")
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 function. 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)

# The function uses config.maml_max_grad_norm, so we need a config object
# with that attribute
class Config:
    def __init__(self):
        self.maml_max_grad_norm = 0.5

config = Config()

ARGS = {
    "config": config,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
params_same Ran
ran on a synthesized input
breakend/selfdestructingmodels/utils.py
code served (permissive licence) · get_code("584510c3567e0187")
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

torch.manual_seed(0)

# The function expects two iterables of parameters
# It iterates through them with zip and checks if .data attributes are equal
# We'll create two sets of parameters - one identical and one different

# Create two simple parameter lists
params1 = [
    torch.nn.Parameter(torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]])),
    torch.nn.Parameter(torch.tensor([0.1, 0.2, 0.3, 0.4])),
]

params2 = [
    torch.nn.Parameter(torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]])),
    torch.nn.Parameter(torch.tensor([0.1, 0.2, 0.3, 0.4])),
]

ARGS = {
    "params1": params1,
    "params2": params2,
}
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
ragged_average Ran
ran on a synthesized input
breakend/selfdestructingmodels/utils.py
code served (permissive licence) · get_code("9717d7ef7d13395b")
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 ndarray, ndim 1, dtype family float; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-26T23:14:07Z. 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

# The function ragged_average takes a list/collection of arrays with potentially different lengths
# It pads them to the same length with NaN values, stacks them, and computes the mean across arrays

# Create ragged arrays (different lengths) as a list
arrays = [
    np.array([1.0, 2.0, 3.0]),
    np.array([4.0, 5.0]),
    np.array([6.0, 7.0, 8.0, 9.0])
]

ARGS = {
    "arrays": arrays
}
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 ndarray, ndim 1, dtype family float — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
remove_pronouns_from_bio Ran
ran on a synthesized input
breakend/selfdestructingmodels/data.py
code served (permissive licence) · get_code("b1342701e48bb004")
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.

# Setup code for remove_pronouns_from_bio function

# Analyze the function:
# - Takes a single parameter 'bio' which is a string
# - The function processes the string by:
#   - Splitting on spaces
#   - Checking tokens against pronouns with various transformations (identity, add period, add comma, lowercase)
#   - Replacing pronouns with neutral pronouns
#   - Rejoining with spaces

# Create test cases for the bio parameter
bio_test_1 = "She is a software engineer. He works at Google."
bio_test_2 = "Her career started when him and His team collaborated."
bio_test_3 = "she likes programming, he enjoys machine learning."

ARGS = {
    'bio': "She is a talented developer. He works on machine learning projects. Her contributions are valued. Him and His colleagues respect the team."
}
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
tensor_from_opts Ran
ran on a synthesized input
breakend/selfdestructingmodels/model.py
code served (permissive licence) · get_code("88fa6ea59d81e366")
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; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-26T23:14:07Z. 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

torch.manual_seed(0)

# Construct valid arguments for tensor_from_opts
opts = {
    "alpha": True,
    "beta": False,
    "gamma": True,
    "delta": False,
}

device = "cpu"

ARGS = {
    "opts": opts,
    "device": device,
}
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 — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
uuid Ran
ran on a synthesized input
breakend/selfdestructingmodels/utils.py
code served (permissive licence) · get_code("894711d0ee3814cd")
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 os
import struct

def uuid(digits=8):
    if not hasattr(uuid, 'uuid_value'):
        uuid.uuid_value = struct.unpack('I', os.urandom(4))[0] % int(10 ** digits)
    return uuid.uuid_value

# Setup code to construct valid arguments
ARGS = {
    'digits': 8
}
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

Also present in other papers' code

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

A growing ecosystem of large, open-source foundation models has reduced the labeled data and technical expertise necessary to apply machine learning to many new problems. Yet foundation models pose a clear dual-use risk, indiscriminately reducing the costs of building both harmful and beneficial machine learning systems. Policy tools such as restricted model access and export controls are the primary methods currently used to mitigate such dual-use risks. In this work, we review potential safe-release strategies and argue that both policymakers and AI researchers would benefit from fundamentally new technologies enabling more precise control over the downstream usage of open-source foundation models. We propose one such approach: the task blocking paradigm, in which foundation models are trained with an additional mechanism to impede adaptation to harmful tasks without sacrificing performance on desirable tasks. We call the resulting models self-destructing models, inspired by mechanisms that prevent adversaries from using tools for harmful purposes. We present an algorithm for training self-destructing models leveraging techniques from meta-learning and adversarial learning, which we call meta-learned adversarial censoring (MLAC). In a small-scale experiment, we show MLAC can largely prevent a BERT-style model from being re-purposed to perform gender identification without harming the model's ability to perform profession classification.

For agents

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

get_harvested_code_for_paper("2211.14946")
get_code_for_paper("2211.14946")
have("2211.14946")

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

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

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

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

Connect an agent — have() is free.