SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.15975 · 2025

Sparsity May Be All You Need: Sparse Random Parameter Adaptation

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 6 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2502.15975.json · badge: /api/ran/2502.15975.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
IBM/SpaRTA canonical (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
combine_two_sentences_map Ran
ran on a synthesized input
IBM/SpaRTA/sparta/tasks.py
code served (permissive licence) · get_code("c0e4061a4ffd40d2")
How it ran

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

import torch
import numpy as np

def combine_two_sentences_map(example):
    """ Combine two sentences:
    sentence1 = example['text']
    sentence2 = example['text2']
    example['text'] = "{sentence1}<sep>{sentence2}"
    """
    sent1 = example['text'].strip()
    sent2 = example['text2'].strip()
    SEP_TOKEN = '<sep>'
    example['text'] = SEP_TOKEN.join([sent1, sent2])
    return example

# Create a minimal example dict with required keys
example = {
    'text': '  hello world  ',
    'text2': '  foo bar  '
}

ARGS = {
    'example': example
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
f1_score Ran
ran on a synthesized input
IBM/SpaRTA/sparta/utils.py
code served (permissive licence) · get_code("bf5cd77dea835a0c")
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 float, 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 numpy as np

torch.manual_seed(0)

# The function takes a confusion matrix (cm) with shape (2, 2)
# and computes F1 score from it
# cm[1, 1] = true positives
# cm[0, 1] = false positives
# cm[1, 0] = false negatives

# Create a simple 2x2 confusion matrix as a torch tensor
cm = torch.tensor([
    [5, 2],      # [true negatives, false positives]
    [1, 8]       # [false negatives, true positives]
], dtype=torch.float32)

ARGS = {
    "cm": cm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
find_head Ran
ran on a synthesized input
IBM/SpaRTA/sparta/models.py
code served (permissive licence) · get_code("91259adf3be2fdea")
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 torch
import torch.nn as nn
import os
import json
import tempfile
from pathlib import Path

torch.manual_seed(0)

# Create a minimal mock model with the required config structure
class MockConfig:
    def __init__(self, name_or_path):
        self._name_or_path = name_or_path

class MockModel(nn.Module):
    def __init__(self, config):
        super().__init__()
        self.config = config
        # Add a dummy embedding layer for gemma-2b-it
        self.embed_tokens = nn.Embedding(10, 4)

# Create a temporary directory structure that mimics HuggingFace cache
temp_dir = tempfile.mkdtemp()
model_cache_dir = os.path.join(temp_dir, 'models--google--gemma-2b-it')
snapshots_dir = os.path.join(model_cache_dir, 'snapshots')
refs_dir = os.path.join(model_cache_dir, 'refs')

os.makedirs(snapshots_dir, exist_ok=True)
os.makedirs(refs_dir, exist_ok=True)

# Create a fake revision hash
revision = 'abc123def456'
revision_dir = os.path.join(snapshots_dir, revision)
os.makedirs(revision_dir, exist_ok=True)

# Write the refs/main file
with open(os.path.join(refs_dir, 'main'), 'w') as f:
    f.write(revision)

# Create model.safetensors.index.json with weight mapping
index_data = {
    'weight_map': {
        'model.embed_tokens.weight': 'model.safetensors'
    }
}
with open(os.path.join(revision_dir, 'model.safetensors.index.json'), 'w') as f:
    json.dump(index_data, f)

# Create a dummy safetensors file
dummy_safetensors = os.path.join(revision_dir, 'model.safetensors')
with open(dummy_safetensors, 'w') as f:
    f.write('dummy')

# Set HF_HOME to point to our temp directory
os.environ['HF_HOME'] = temp_dir

# Create the model with the mocked config
config = MockConfig('google/gemma-2b-it')
model = MockModel(config)

ARGS = {
    'model': model
}
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, 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
instruction_generator Ran
ran on a synthesized input
IBM/SpaRTA/sparta/tasks.py
code served (permissive licence) · get_code("ded19a9203a66303")
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

# Set seed for reproducibility
torch.manual_seed(0)

# Define the arguments for instruction_generator

# obj: can be a string describing what we're determining
obj = "the following sentences"

# criteria: condition or property to check
criteria = "are similar in meaning"

# answer: expected response format
answer = "yes or no"

# format: optional formatting template
format = "google/gemma-2b-it"

# nli: boolean flag for Natural Language Inference mode
nli = False

# The create_instruction function expects a dict with 'text' and optionally 'text2' keys
# We don't need to pass the actual function that processes examples - we're just
# constructing the arguments for instruction_generator itself

ARGS = {
    'obj': obj,
    'criteria': criteria,
    'answer': answer,
    'format': format,
    'nli': nli
}
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
load_classification_model Ran
ran on a synthesized input
IBM/SpaRTA/sparta/models.py
code served (permissive licence) · get_code("f1c8e6dba88170ab")
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. 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 and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a minimal tokenizer mock
class MockTokenizer:
    def __init__(self):
        self.pad_token = None
        self.eos_token = "<eos>"
        self.sep_token = None
        self.sep_token_id = None
        self.pad_token_id = None
        self.vocab_size = 32000
    
    def get_vocab(self):
        return {
            '▁No': 100,
            '▁Yes': 101,
            '1': 102,
            '2': 103,
            '3': 104,
            '4': 105,
            '5': 106,
        }
    
    def add_special_tokens(self, special_tokens):
        if 'sep_token' in special_tokens:
            self.sep_token = special_tokens['sep_token']
            self.sep_token_id = 31999
            return 1
        return 0

# Create a minimal model mock
class MockScore(torch.nn.Module):
    def __init__(self, in_features=768, num_classes=2):
        super().__init__()
        self.in_features = in_features
        self.weight = torch.nn.Parameter(torch.randn(num_classes, in_features))
    
    def forward(self, x):
        return torch.nn.functional.linear(x, self.weight)

class MockModel(torch.nn.Module):
    def __init__(self, num_classes=2, vocab_size=32000):
        super().__init__()
        self.config = Mock()
        self.config._name_or_path = 'mock-model'
        self.config.vocab_size = vocab_size
        self.config.initializer_range = 0.02
        self.config.pad_token_id = None
        self.config.eos_token_id = 0
        
        self.score = MockScore(in_features=768, num_classes=num_classes)
        self.embeddings = torch.nn.Embedding(vocab_size, 768)
        self.device = 'cpu'
    
    def get_input_embeddings(self):
        return self.embeddings
    
    @classmethod
    def from_pretrained(cls, model_name, **kwargs):
        num_labels = kwargs.get('num_labels', 2)
        model = cls(num_classes=num_labels)
        return model

# Patch AutoTokenizer and AutoModelForSequenceClassification
import transformers
original_AutoTokenizer = transformers.AutoTokenizer
original_AutoModel = transformers.AutoModelForSequenceClassification

def mock_auto_tokenizer(model_name):
    return MockTokenizer()

def mock_auto_model(model_name, **kwargs):
    return MockModel.from_pretrained(model_name, **kwargs)

transformers.AutoTokenizer.from_pretrained = staticmethod(mock_auto_tokenizer)
transformers.AutoModelForSequenceClassification.from_pretrained = staticmethod(mock_auto_model)

ARGS = {
    'model_name': 'mock-model',
    'num_classes': 2,
    'head_init': 'random',
    'sep_token': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
safetensors, torch, transformers — 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
mcc Ran
ran on a synthesized input
IBM/SpaRTA/sparta/utils.py
code served (permissive licence) · get_code("c4cb73db0b4bf345")
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 float, 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 numpy as np

torch.manual_seed(0)

# The function expects a 2x2 confusion matrix tensor
# It calls: cm.shape, cm[0,0], cm[1,1], cm[0,1], cm[1,0], cm.sum(0), cm.sum(1), prod(), sqrt(), item()
# So cm must be a torch tensor with shape (2, 2)

cm = torch.tensor([
    [45, 5],
    [10, 40]
], dtype=torch.float32)

ARGS = {
    "cm": cm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
load_classification_data Not yet run
unverified (harvested, no recorded run)
IBM/SpaRTA/sparta/tasks.py
code served (permissive licence) · get_code("523c87d6ca392629")
How it ran

no invocation recorded.

Also present in other papers' code

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

Full fine-tuning of large language models for alignment and task adaptation has become prohibitively expensive as models have grown in size. Parameter-Efficient Fine-Tuning (PEFT) methods aim at significantly reducing the computational and memory resources needed for fine-tuning these models by only training on a small number of parameters instead of all model parameters. Currently, the most popular PEFT method is the Low-Rank Adaptation (LoRA), which freezes the parameters of the model and introduces a small set of trainable parameters in the form of low-rank matrices. We propose simply reducing the number of trainable parameters by randomly selecting a small proportion of the model parameters to train on, while fixing all other parameters, without any additional prior assumptions such as low-rank structures. In this paper, we compare the efficiency and performance of our proposed approach to other PEFT methods as well as full parameter fine-tuning. We find our method to be competitive with LoRA when using a similar number of trainable parameters. Our findings suggest that what truly matters for a PEFT technique to perform well is not necessarily the specific adapter structure, but rather the number of trainable parameters being used.

For agents

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

get_harvested_code_for_paper("2502.15975")
get_code_for_paper("2502.15975")
have("2502.15975")

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

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

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

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

Connect an agent — have() is free.