SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.10934 · NAACL · 2024

Shears: Unstructured Sparsity with Neural Low-rank Adapter Search

Jinjie Yuan, Nilesh Jain, J Pablo Muñoz

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2404.10934.json · badge: /api/ran/2404.10934.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
IntelLabs/Hardware-Aware-Automated-Machine-Learning canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
OP0 Ran
ran, honoured the contract we drafted
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/gp_func_defs.py
code served (permissive licence) · get_code("f7ff106fbef86943")
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 2, dtype family float, shape (2, 4) 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)

# OP0 performs simple addition of A and B
# Both should be tensors of compatible shapes
A = torch.randn(2, 4)
B = torch.randn(2, 4)

ARGS = {
    "A": A,
    "B": B,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
OP1 Ran
ran, honoured the contract we drafted
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/gp_func_defs.py
code served (permissive licence) · get_code("97118ebc057ed780")
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 2, dtype family float, shape (2, 4) 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)

# OP1 multiplies A and B element-wise
# Both should be tensors of compatible shapes

A = torch.randn(2, 4)
B = torch.randn(2, 4)

ARGS = {
    "A": A,
    "B": B
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
OP2 Ran
ran, honoured the contract we drafted
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/gp_func_defs.py
code served (permissive licence) · get_code("fd901ff4848326e1")
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 2, dtype family float, shape (2, 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)

# OP2 performs matrix multiplication (@) on A and B
# It unsqueezes 0-d tensors to 1-d first
# We need A and B to be compatible for matrix multiplication

# Create two 2D tensors with distinct dimensions for probing
A = torch.randn(2, 4)  # shape (2, 4)
B = torch.randn(4, 3)  # shape (4, 3) - compatible for matmul with A

ARGS = {
    "A": A,
    "B": B,
}
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 2, dtype family float, shape (2, 3) — shape (2, 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
eval_layer Ran
ran, honoured the contract we drafted
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/evol_utilities.py
code served (permissive licence) · get_code("4482f4a802de0a2e")
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 2, dtype family float, shape (2, 4) 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)

# Create a simple function that takes 22 arguments and returns a tensor
def dummy_func(*args):
    # The function receives 22 tensors and returns their sum
    result = torch.stack(args).sum(dim=0)
    return result

# Create net_stats dict with 22 entries (keys don't matter, we care about order via fixed_ordering)
net_stats = {
    f'layer_{i}': torch.randn(2, 4) for i in range(22)
}

# Device
device = torch.device('cpu')

ARGS = {
    'func': dummy_func,
    'net_stats': net_stats,
    '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 2, dtype family float, shape (2, 4) — shape (2, 4) 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_imagenet_224_train_loader Ran
ran; our contract draft was wrong, not the code
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/dataset_utils.py
code served (permissive licence) · get_code("bbffcbb6be4577ac")
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 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 os
from unittest.mock import Mock, patch
import tempfile

torch.manual_seed(0)

# Create a temporary directory to mock the ImageNet path
temp_dir = tempfile.mkdtemp()
val_dir = os.path.join(temp_dir, 'val')
os.makedirs(val_dir, exist_ok=True)

# Set the environment variable
os.environ['ilsvrc2012_PATH'] = temp_dir

# Create a mock ImageFolder that returns dummy data
class MockImageFolder:
    def __init__(self, root, transform):
        self.root = root
        self.transform = transform
        self.samples = [(f"dummy_{i}", i % 10) for i in range(4)]
    
    def __len__(self):
        return len(self.samples)
    
    def __getitem__(self, idx):
        # Return a dummy image tensor and label
        dummy_image = torch.rand(3, 224, 224)
        label = idx % 10
        if self.transform:
            dummy_image = self.transform(dummy_image)
        return dummy_image, label

# Mock datasets.ImageFolder to use our MockImageFolder
original_imagefolder = None

def mock_imagefolder(root, transform):
    return MockImageFolder(root, transform)

import torchvision.datasets as datasets
datasets.ImageFolder = mock_imagefolder

ARGS = {
    'batch_size': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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: none by the harness; any seed is in the setup block
populate Ran
ran; our contract draft was wrong, not the code
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/evol_utilities.py
code served (permissive licence) · get_code("f5a26cfba435a262")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. 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 expects:
# 1. runtime_addrs_space: a dict that will be populated with integer keys (0 to 21)
# 2. net_stats: a dict with at least 22 entries (keys don't matter, but values do)

# The function iterates through STATIC_ADDRS (22), accesses net_stats by keys
# in a specific order defined by fixed_ordering, and stores values in runtime_addrs_space

# Create runtime_addrs_space as an empty dict
runtime_addrs_space = {}

# Create net_stats with 22 entries
# The keys can be anything (strings, ints, etc.) - the function just iterates through list(net_stats.keys())
# The values should be anything (tensors, scalars, etc.)
net_stats = {
    f"addr_{i}": torch.randn(2, 4) for i in range(22)
}

ARGS = {
    "runtime_addrs_space": runtime_addrs_space,
    "net_stats": net_stats,
}
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 tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate_ppl Not yet run
unverified (harvested, no recorded run)
IntelLabs/Hardware-Aware-Automated-Machine-Learning/Mamba-Shedder/utils.py
code served (permissive licence) · get_code("223cec6edf2ce733")
How it ran

no invocation recorded.

get_cifar100_train_loader Not yet run
unverified (harvested, no recorded run)
IntelLabs/Hardware-Aware-Automated-Machine-Learning/EZNAS/dataset_utils.py
code served (permissive licence) · get_code("f9ae64ad50769fad")
How it ran

no invocation recorded.

get_dataset Not yet run
unverified (harvested, no recorded run)
IntelLabs/Hardware-Aware-Automated-Machine-Learning/Mamba-Shedder/utils.py
code served (permissive licence) · get_code("243565ed1729f7a2")
How it ran

no invocation recorded.

map_tensors Not yet run
unverified (harvested, no recorded run)
IntelLabs/Hardware-Aware-Automated-Machine-Learning/Mamba-Shedder/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from MrGGLS/BlockPruner, is pointer only (licence: NONE) · get_code("f4933cb17b9eab96")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from MrGGLS/BlockPruner, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
map_tensors 1 other paper
1 later
2406.10594 (2024-06)
BlockPruner: Fine-grained Pruning for Large Language Models

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-23.

Repositories linked to this paper

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

Abstract

Recently, several approaches successfully demonstrated that weight-sharing Neural Architecture Search (NAS) can effectively explore a search space of elastic low-rank adapters (LoRA), allowing the parameter-efficient fine-tuning (PEFT) and compression of large language models. In this paper, we introduce a novel approach called Shears, demonstrating how the integration of cost-effective sparsity and a proposed Neural Low-rank adapter Search (NLS) algorithm can further improve the efficiency of PEFT approaches. Results demonstrate the benefits of Shears compared to other methods, reaching high sparsity levels while improving or with little drop in accuracy, utilizing a single GPU for a pair of hours.

For agents

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

get_harvested_code_for_paper("2404.10934")
get_code_for_paper("2404.10934")
have("2404.10934")

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

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

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

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

Connect an agent — have() is free.