SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.07931 · 2023

D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 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/2310.07931.json · badge: /api/ran/2310.07931.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
adymaharana/d2pruning canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
get_threshold Ran
ran, honoured the contract we drafted
adymaharana/d2pruning/select_d2_datacomp.py
code served (permissive licence) · get_code("d4f631114e46d039")
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 float64, ndim 0, 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 tempfile
import os
import pandas as pd
import numpy as np
import pyarrow.parquet as pq
import pyarrow as pa

# Create a temporary directory with mock parquet files
temp_dir = tempfile.mkdtemp()

# Create a few small parquet files with test data
for i in range(3):
    data = {
        'score': np.random.rand(10) * 100,
        'id': np.arange(10)
    }
    df = pd.DataFrame(data)
    parquet_path = os.path.join(temp_dir, f'metadata_{i}.parquet')
    df.to_parquet(parquet_path)

ARGS = {
    'metadata_dir_path': temp_dir,
    'key': 'score',
    'fraction': 0.5,
    'num_workers': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
fsspec, numpy, pandas, pyarrow, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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_metadata Ran
ran; our contract draft was wrong, not the code
adymaharana/d2pruning/select_d2_datacomp.py
code served (permissive licence) · get_code("2f44f975b8f160a3")
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 DataFrame. 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 tempfile
import os
import pandas as pd
import numpy as np
import pyarrow.parquet as pq
import pyarrow as pa

# Create a temporary directory with mock parquet files
temp_dir = tempfile.mkdtemp()

# Create 2 small parquet files with sample data
df1 = pd.DataFrame({
    'col1': [1, 2, 3],
    'col2': ['a', 'b', 'c'],
    'col3': [1.1, 2.2, 3.3]
})

df2 = pd.DataFrame({
    'col1': [4, 5, 6],
    'col2': ['d', 'e', 'f'],
    'col3': [4.4, 5.5, 6.6]
})

parquet_file1 = os.path.join(temp_dir, 'data1.parquet')
parquet_file2 = os.path.join(temp_dir, 'data2.parquet')

df1.to_parquet(parquet_file1)
df2.to_parquet(parquet_file2)

ARGS = {
    'metadata_dir_path': temp_dir,
    'num_workers': 2,
    'columns': ['col1', 'col2']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
fsspec, numpy, pandas, pyarrow, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
plot_score_distribution Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
adymaharana/d2pruning/selection_mp.py
code served (permissive licence) · get_code("0a67c1f05b095acd")
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 float64, ndim 0, 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 numpy as np
import matplotlib.pyplot as plt
import tempfile
import os

# Create a small stand-in class for args
class Args:
    def __init__(self):
        self.n_neighbor = 5
        self.gamma = 0.3

# Generate sample data
np.random.seed(0)
scores = np.random.uniform(0, 100, size=100)
coreset_index = np.random.choice(100, size=20, replace=False)
coreset_index = np.sort(coreset_index)

# Create a temporary file for output
temp_dir = tempfile.gettempdir()
out_file = os.path.join(temp_dir, "score_distribution.png")

# Define ARGS dictionary with all parameters
ARGS = {
    'scores': scores,
    'coreset_index': coreset_index,
    'out_file': out_file,
    'n_bins': 25,
    'coreset_key': 'forgetting',
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
preact_resnet Ran
ran; our contract draft was wrong, not the code
adymaharana/d2pruning/core/model_generator/preact_resnet.py
code served (permissive licence) · get_code("5947774a4984f441")
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 PreActResNet. 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)

ARGS = {
    'name': 'preact-resnet18',
    'num_classes': 10,
    'pretrained': False,
    'device': 'cpu'
}
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 PreActResNet — a PreActResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PreActResNet 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
single_dim_flip Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
adymaharana/d2pruning/core/attack/utils.py
code served (permissive licence) · get_code("adf16a24fde1a1a2")
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 4, dtype family float, shape (2, 3, 4, 5) 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)

# Create a small tensor with distinct dimensions (2, 3, 4, 5)
x = torch.randn(2, 3, 4, 5)

# Create a dim parameter to flip along dimension 1
dim = 1

ARGS = {
    "x": x,
    "dim": dim
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
torch_allclose Ran
ran; our contract draft was wrong, not the code
adymaharana/d2pruning/core/attack/utils.py
code served (permissive licence) · get_code("d8da4c966b934936")
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; 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 numpy as np

torch.manual_seed(0)

# Create two similar torch tensors with small shapes
x = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

y = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

rtol = 1e-05
atol = 1e-08

ARGS = {
    "x": x,
    "y": y,
    "rtol": rtol,
    "atol": atol
}
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 bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (read:FileNotFoundError)
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
torch_flip Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
adymaharana/d2pruning/core/attack/utils.py
code served (permissive licence) · get_code("dc96569e5f40c282")
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 4, dtype family float, shape (2, 3, 4, 5) 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)

# Create a small tensor with distinct dimensions for probing
x = torch.randn(2, 3, 4, 5)

# dims parameter: list of dimensions to flip
dims = [0, 2]

ARGS = {
    "x": x,
    "dims": dims
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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_uids_with_clip_score Not yet run
unverified (harvested, no recorded run)
adymaharana/d2pruning/select_d2_datacomp.py
code served (permissive licence) · get_code("d4e2670376132cfb")
How it ran

no invocation recorded.

preprocess_wanli Not yet run
unverified (harvested, no recorded run)
adymaharana/d2pruning/train_nlp.py
code served (permissive licence) · get_code("26c92bf4720faf65")
How it ran

no invocation recorded.

preprocess_yelp Not yet run
unverified (harvested, no recorded run)
adymaharana/d2pruning/train_nlp.py
code served (permissive licence) · get_code("e2d698dc317d98d1")
How it ran

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
preact_resnet 3 other papers
1 dated earlier, 2 later
2110.09468 (2021-10)
Improving Robustness using Generated Data
2406.13283 (2024-06)
Large-Scale Dataset Pruning in Adversarial Training through Data Importance Extrapolation
2606.02267 (2026-06)
A combination of noise and bilateral filters achieve supralinear and scalable adversarial robustness in CNNs
single_dim_flip 1 other paper
1 dated earlier
2307.15157 (2023-07)
R-LPIPS: An Adversarially Robust Perceptual Similarity Metric
torch_allclose 1 other paper
1 dated earlier
2307.15157 (2023-07)
R-LPIPS: An Adversarially Robust Perceptual Similarity Metric
torch_flip 1 other paper
1 dated earlier
2307.15157 (2023-07)
R-LPIPS: An Adversarially Robust Perceptual Similarity Metric

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

Analytical theories suggest that higher-quality data can lead to lower test errors in models trained on a fixed data budget. Moreover, a model can be trained on a lower compute budget without compromising performance if a dataset can be stripped of its redundancies. Coreset selection (or data pruning) seeks to select a subset of the training data so as to maximize the performance of models trained on this subset, also referred to as coreset. There are two dominant approaches: (1) geometry-based data selection for maximizing data diversity in the coreset, and (2) functions that assign difficulty scores to samples based on training dynamics. Optimizing for data diversity leads to a coreset that is biased towards easier samples, whereas, selection by difficulty ranking omits easy samples that are necessary for the training of deep learning models. This demonstrates that data diversity and importance scores are two complementary factors that need to be jointly considered during coreset selection. We represent a dataset as an undirected graph and propose a novel pruning algorithm, D2 Pruning, that uses forward and reverse message passing over this dataset graph for coreset selection. D2 Pruning updates the difficulty scores of each example by incorporating the difficulty of its neighboring examples in the dataset graph. Then, these updated difficulty scores direct a graph-based sampling method to select a coreset that encapsulates both diverse and difficult regions of the dataset space. We evaluate supervised and self-supervised versions of our method on various vision and language datasets. Results show that D2 Pruning improves coreset selection over previous state-of-the-art methods for up to 70% pruning rates. Additionally, we find that using D2 Pruning for filtering large multimodal datasets leads to increased diversity in the dataset and improved generalization of pretrained models.

For agents

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

get_harvested_code_for_paper("2310.07931")
get_code_for_paper("2310.07931")
have("2310.07931")

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

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

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

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

Connect an agent — have() is free.