SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.06866 · ICML · 2025

SAFE: Finding Sparse and Flat Minima to Improve Pruning

Namhoon Lee, Jinseok Chung, Dongyeop Lee, Kwanhee Lee

arXiv · PDF · Open in the Atlas

Code that ran

10 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 6 failures of our instrument; 8 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2506.06866.json · badge: /api/ran/2506.06866.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
log-postech/safe-jax canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
LOG-postech/safe-torch marked official in Papers with Code
Papers with Code archive
5 ran · 8 no recorded run
FunctionStatusWhere it lives
SAFEState Ran
ran on a synthesized input · constructed an object; no result was computed
log-postech/safe-jax/sparsify/safe.py
code served (permissive licence) · get_code("9e8f2bae04b225dd")
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 an instance of its own class, SAFEState: the run constructed the object and did not call it, so no result was computed. 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 jax
import jax.numpy as jnp
import optax
import chex

# Create sample data for SAFEState components

# count: chex.Array - a scalar counter
count = jnp.array(0, dtype=jnp.int32)

# z: optax.Updates - a dict-like structure mapping parameter names to update tensors
z = {
    'layer1': jnp.zeros((4, 3)),
    'layer2': jnp.zeros((3, 2)),
    'bias': jnp.zeros((2,))
}

# u: optax.Updates - another dict-like structure similar to z
u = {
    'layer1': jnp.zeros((4, 3)),
    'layer2': jnp.zeros((3, 2)),
    'bias': jnp.zeros((2,))
}

ARGS = {
    'count': count,
    'z': z,
    'u': u
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
chex, jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SAFEState — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SAFEState output the recorded ndim 1 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
TensorData Ran
ran on a synthesized input
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("fd586c59f72d66ff")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

INIT_ARGS = {
    'data': torch.randn(2, 4),
    'targets': torch.tensor([0, 1]),
    'device': 'cpu'
}

ARGS = {
    'index': 0
}

METHOD = '__getitem__'

if __name__ == '__main__':
    dataset = torch.utils.data.Dataset.__new__(type('TensorData', (torch.utils.data.Dataset,), {
        '__init__': lambda self, data, targets, device: (
            setattr(self, 'data', data),
            setattr(self, 'targets', targets),
            setattr(self, 'device', device)
        ),
        '__getitem__': lambda self, index: (
            self.data[index].to(self.device),
            self.targets[index].to(self.device)
        ),
        '__len__': lambda self: len(self.targets)
    }))
    
    dataset.__init__(**INIT_ARGS)
    result = dataset.__getitem__(**ARGS)
    print(f"Result: {result}")
    print(f"Length: {len(dataset)}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TensorDataLoader Ran
ran on a synthesized input
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("b399ee426cead852")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned DataLoader. 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

# Create a simple tensor dataset
class SimpleTensorDataset(torch.utils.data.Dataset):
    def __init__(self, data, labels):
        self.data = data
        self.labels = labels
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx], self.labels[idx]

# Create sample data
data_tensor = torch.randn(10, 4)  # 10 samples, 4 features
labels_tensor = torch.randint(0, 3, (10,))  # 10 labels, 3 classes

dataset = SimpleTensorDataset(data_tensor, labels_tensor)

INIT_ARGS = {
    'dataset': dataset,
    'batch_size': 2,
    'shuffle': True,
    'num_workers': 0
}

ARGS = {}

METHOD = 'get_loader'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
WrappedGPT Ran
ran on a synthesized input
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("c5a1e00bdf2e981f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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

# Create a small Linear layer to wrap
layer = nn.Linear(in_features=4, out_features=6)

INIT_ARGS = {
    'layer': layer,
    'layer_id': 0,
    'layer_name': 'test_layer'
}

METHOD = 'add_batch'

ARGS = {
    'inp': torch.randn(2, 3, 4),  # batch=2, seq_len=3, features=4
    'out': torch.randn(2, 3, 6)   # batch=2, seq_len=3, out_features=6
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
compute_mask Ran
ran; our contract draft was wrong, not the code
log-postech/safe-jax/sparsify/safe.py
code served (permissive licence) · get_code("9c8aa55ec9a22c0c")
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 jax.numpy as jnp
from typing import Sequence

# Create a simple scores structure with 'kernel' and 'bias' fields
# The function expects a pytree structure where some leaves have 'kernel' keys

# For global scope test
scores_global = {
    'layer1': {
        'kernel': jnp.array([[1.0, 2.0, 3.0, 4.0],
                             [5.0, 6.0, 7.0, 8.0],
                             [9.0, 10.0, 11.0, 12.0]]),
        'bias': jnp.array([0.1, 0.2, 0.3, 0.4])
    },
    'layer2': {
        'kernel': jnp.array([[0.5, 1.5, 2.5, 3.5],
                             [4.5, 5.5, 6.5, 7.5]]),
        'bias': jnp.array([0.05, 0.15])
    }
}

# For layerwise scope test - need multiple layers with kernels
scores_layerwise = {
    'layer1': {
        'kernel': jnp.array([[1.0, 2.0, 3.0, 4.0],
                             [5.0, 6.0, 7.0, 8.0]]),
        'bias': jnp.array([0.1, 0.2])
    },
    'layer2': {
        'kernel': jnp.array([[0.5, 1.5, 2.5, 3.5],
                             [4.5, 5.5, 6.5, 7.5],
                             [8.5, 9.5, 10.5, 11.5]]),
        'bias': jnp.array([0.05, 0.15, 0.25])
    }
}

ARGS = {
    'scores': scores_global,
    'target_sparsity': 0.5,
    'scope': 'global',
    'by_count': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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
find_layers Ran
ran; our contract draft was wrong, not the code
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("6644b68819429769")
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) 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

torch.manual_seed(0)

# Create a simple nested module structure
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.conv1 = nn.Conv2d(1, 2, 3)
        self.nested = nn.Sequential(
            nn.Linear(2, 5),
            nn.ReLU(),
            nn.Linear(5, 1)
        )

model = SimpleModel()

ARGS = {
    'module': model,
    'layers': [nn.Linear],
    'name': ''
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
only_weights Ran
ran; our contract draft was wrong, not the code
log-postech/safe-jax/sparsify/safe.py
code served (permissive licence) · get_code("17c71a4396facf51")
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 jax
import jax.numpy as jnp
from jax.tree_util import tree_map, tree_flatten, tree_unflatten

# Create a simple nested parameter structure that mimics what a JAX model would have
# The function tree_flatten with a predicate looks for nodes where 'bias' is in the leaf name
params = {
    'layer1': {
        'weights': jnp.array([[1.0, 2.0, 3.0, 4.0],
                              [5.0, 6.0, 7.0, 8.0],
                              [9.0, 10.0, 11.0, 12.0]]),
        'bias': jnp.array([0.1, 0.2, 0.3, 0.4])
    },
    'layer2': {
        'weights': jnp.array([[1.0, 2.0],
                              [3.0, 4.0],
                              [5.0, 6.0],
                              [7.0, 8.0]]),
        'bias': jnp.array([0.5, 0.6])
    }
}

ARGS = {
    'params': params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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
projection Ran
ran; our contract draft was wrong, not the code
log-postech/safe-jax/sparsify/safe.py
code served (permissive licence) · get_code("5ce6dac896cdfdbd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jax
import jax.numpy as jnp
from jax import tree_util

# Set seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Create a simple nested structure of parameters with 'kernel' and 'bias' keys
# This mimics what a neural network parameter structure might look like

# Layer 1: kernel and bias
layer1_params = {
    'kernel': jnp.array([[1.5, -2.3, 0.8, 1.2],
                         [0.5, -1.1, 2.3, 0.3],
                         [1.8, 0.2, -0.9, 1.5]]),
    'bias': jnp.array([0.1, 0.2, 0.3, 0.4])
}

# Layer 2: kernel and bias
layer2_params = {
    'kernel': jnp.array([[-0.5, 1.2, 0.7],
                         [0.3, -2.1, 0.9],
                         [1.1, 0.4, -1.3],
                         [0.2, 0.8, 1.5]]),
    'bias': jnp.array([0.05, 0.15, 0.25])
}

# Nested params structure
params = {
    'layer1': layer1_params,
    'layer2': layer2_params
}

# Test case 1: Global scope with sparsity as fraction
ARGS = {
    'params': params,
    'target_sparsity': 0.5,
    'scope': 'global',
    'by_count': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
projection Ran
ran; our contract draft was wrong, not the code
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("f2be2a9f4b2b8076")
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. 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

torch.manual_seed(0)

# Create small weight tensors (2x4 matrices)
w1 = torch.randn(2, 4)
w2 = torch.randn(3, 4)
w = [w1, w2]

# Create importance matrices - can be diagonal (mxm) or vector (1xm)
# For w1 (2x4): importance is 1x4 vector
# For w2 (3x4): importance is 1x4 vector
importance_matrix = [
    torch.ones(1, 4),
    torch.ones(1, 4)
]

sparsity = 0.5
prune_n = 0
prune_m = 0

ARGS = {
    "w": w,
    "sparsity": sparsity,
    "prune_n": prune_n,
    "prune_m": prune_m,
    "importance_matrix": importance_matrix
}
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 list — a list 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
safe Ran
ran; our contract draft was wrong, not the code
log-postech/safe-jax/sparsify/safe.py
code served (permissive licence) · get_code("5c2d5462f95decf7")
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) and returned GradientTransformation. 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 jax
import jax.numpy as jnp
import optax
import copy
from typing import NamedTuple

class SAFEState(NamedTuple):
    """State for the SAFE algorithm."""
    count: jnp.ndarray
    z: dict
    u: dict

def only_weights(params):
    """Remove bias terms from params."""
    def _remove_bias(x):
        if isinstance(x, dict) and 'bias' in x:
            return {k: (jnp.zeros_like(v) if k == 'bias' else v) for k, v in x.items()}
        return x
    return jax.tree_util.tree_map(_remove_bias, params)

def compute_mask(scores, target_sparsity, scope='global', by_count=False):
    """Generate pruning mask based on scores."""
    from jax.tree_util import tree_flatten, tree_unflatten
    from jax.flatten_util import ravel_pytree
    
    assert scope in {'global', 'layerwise'}
    if not by_count:
        assert 0 <= target_sparsity <= 1
    
    def _mask_dict(sc, thr):
        if isinstance(sc, dict) and 'kernel' in sc:
            mask_dict = {'kernel': sc['kernel'] >= thr}
            if 'bias' in sc:
                mask_dict['bias'] = jnp.full(sc['bias'].shape, True)
            return mask_dict
        return jnp.full(sc.shape, True) if hasattr(sc, 'shape') else sc
    
    flat_tr, trdef = tree_flatten(scores, lambda tr: isinstance(tr, dict) and 'kernel' in tr)
    
    if scope == 'global':
        kernels = [sc['kernel'] for sc in flat_tr if isinstance(sc, dict) and 'kernel' in sc]
        if kernels:
            flat_sc, _ = ravel_pytree(kernels)
            idx = target_sparsity if by_count else int(target_sparsity * len(flat_sc))
            idx = jnp.minimum(idx, len(flat_sc) - 1)
            thr = jnp.sort(flat_sc)[idx]
            flat_mask = [_mask_dict(sc, thr) for sc in flat_tr]
        else:
            flat_mask = flat_tr
    else:
        flat_mask = flat_tr
    
    mask = tree_unflatten(trdef, flat_mask)
    return mask

def projection(params, target_sparsity, scope='global', by_count=False):
    """Project params to target sparsity."""
    scores = jax.tree_util.tree_map(lambda w: jnp.abs(w), params)
    masks = compute_mask(scores, target_sparsity, scope=scope, by_count=by_count)
    projected_params = jax.tree_util.tree_map(lambda p, m: p * m, params, masks)
    return (projected_params, masks)

# Create a simple primal optimizer
primal_tx = optax.adam(learning_rate=0.001)

# Create sample parameters with kernel and bias structure
sample_params = {
    'layer1': {
        'kernel': jnp.ones((4, 3)),
        'bias': jnp.ones((3,))
    },
    'layer2': {
        'kernel': jnp.ones((3, 2)),
        'bias': jnp.ones((2,))
    }
}

# Define a simple loss function
def loss_fn(params):
    return jnp.sum(jax.tree_util.tree_leaves(params)[0])

ARGS = {
    'lmda': 0.1,
    'primal_tx': primal_tx,
    'target_sparsity': 0.5,
    'sp_scope': 'global',
    'dual_update_interval': 1,
    'total_steps': 100,
    'lmda_schedule': 'cosine',
    'rho': 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
chex, jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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
SAFE Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("b68d0d9cbeb82b3c")
How it ran

no invocation recorded.

SAM Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("e75a622bc571e165")
How it ran

no invocation recorded.

TokenizerWrapper Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("dab11c061575d561")
How it ran

no invocation recorded.

get_c4 Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("d53a6dae4f8104ea")
How it ran

no invocation recorded.

get_loaders Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("d6ccfa34fac6df39")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("041beaad3085295f")
How it ran

no invocation recorded.

prepare_calibration_input Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("c9b68ea3948eb9de")
How it ran

no invocation recorded.

prune_safe Not yet run
unverified (harvested, no recorded run)
LOG-postech/safe-torch/language/lib/prune.py
code served (permissive licence) · get_code("5b1ee320f0a5541e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 17 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
find_layers
brick of this paper's assembly: helper
1 other paper
1 later
2510.01650 (2025-10)
The Unseen Frontier: Pushing the Limits of LLM Sparsity with Surrogate-Free ADMM

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

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

Abstract

Sparsifying neural networks often suffers from seemingly inevitable performance degradation, and it remains challenging to restore the original performance despite much recent progress. Motivated by recent studies in robust optimization, we aim to tackle this problem by finding subnetworks that are both sparse and flat at the same time. Specifically, we formulate pruning as a sparsity-constrained optimization problem where flatness is encouraged as an objective. We solve it explicitly via an augmented Lagrange dual approach and extend it further by proposing a generalized projection operation, resulting in novel pruning methods called SAFE and its extension, SAFE + . Extensive evaluations on standard image classification and language modeling tasks reveal that SAFE consistently yields sparse networks with improved generalization performance, which compares competitively to well-established baselines. In addition, SAFE demonstrates resilience to noisy data, making it well-suited for real-world conditions.

For agents

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

get_harvested_code_for_paper("2506.06866")
get_code_for_paper("2506.06866")
have("2506.06866")

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

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

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

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

Connect an agent — have() is free.