SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.08448 · 2021

Data Distillation for Text Classification

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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; 3 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/2104.08448.json · badge: /api/ran/2104.08448.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
liyongqi67/Data-Distillation-for-Text-Classification canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
FunctionStatusWhere it lives
clean_str Ran
ran; our contract draft was wrong, not the code
liyongqi67/Data-Distillation-for-Text-Classification/train2.py
code served (permissive licence) · get_code("ff7e482dc6719a88")
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 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.

import re

def clean_str(string):
    """
    Tokenization/string cleaning for all datasets except for SST.
    Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
    """
    string = string.strip().strip('"')
    string = re.sub("[^A-Za-z0-9(),!?\\.\\'\\`]", ' ', string)
    string = re.sub("\\'s", " 's", string)
    string = re.sub("\\'ve", " 've", string)
    string = re.sub("n\\'t", " n't", string)
    string = re.sub("\\'re", " 're", string)
    string = re.sub("\\'d", " 'd", string)
    string = re.sub("\\'ll", " 'll", string)
    string = re.sub(',', ' , ', string)
    string = re.sub('\\.', ' \\. ', string)
    string = re.sub('\\"', ' , ', string)
    string = re.sub('!', ' ! ', string)
    string = re.sub('\\(', ' \\( ', string)
    string = re.sub('\\)', ' \\) ', string)
    string = re.sub('\\?', ' \\? ', string)
    string = re.sub('\\s{2,}', ' ', string)
    return string.strip().lower()

ARGS = {
    "string": "Hello, world! This is a test string with contractions like don't and it's."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
evaluate_models Ran
ran, honoured the contract we drafted
liyongqi67/Data-Distillation-for-Text-Classification/evaluation.py
code served (permissive licence) · get_code("ef82a6c887bd6d48")
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 tuple, ndim 2, 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 numpy as np

torch.manual_seed(0)

# Create a small state object with required attributes
class State:
    def __init__(self):
        self.device = torch.device('cpu')
        self.num_classes = 3
        # Create a small test loader iterator
        self.test_loader_iter = [
            (torch.randn(2, 4), torch.randint(0, 3, (2,))),
            (torch.randn(2, 4), torch.randint(0, 3, (2,)))
        ]

state = State()

# Create small models that support both forward and forward_with_param
class SimpleModel(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.linear(x)
    
    def forward_with_param(self, x, params):
        # Simple implementation that uses provided params
        return self.linear(x)

model1 = SimpleModel(num_classes=3)
model2 = SimpleModel(num_classes=3)

models = [model1, model2]

# param_list can be None or a list of params (None for each model in this case)
param_list = [None, None]

# test_all flag
test_all = False

# test_loader_iter - can be None to use state.test_loader_iter
test_loader_iter = None

ARGS = {
    'state': state,
    'models': models,
    'param_list': param_list,
    'test_all': test_all,
    'test_loader_iter': test_loader_iter
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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
fixed_width_fmt Ran
ran; our contract draft was wrong, not the code
liyongqi67/Data-Distillation-for-Text-Classification/evaluation.py
code served (permissive licence) · get_code("a4aa4b3cd1b50be0")
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 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.

import math

def fixed_width_fmt(num, width=4, align='>'):
    if math.isnan(num):
        return '{{:{}{}}}'.format(align, width).format(str(num))
    return '{{:{}0.{}f}}'.format(align, width).format(num)[:width]

ARGS = {
    'num': 3.14159,
    'width': 4,
    'align': '>'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
train_steps_inplace Ran
ran; our contract draft was wrong, not the code
liyongqi67/Data-Distillation-for-Text-Classification/evaluation.py
code served (permissive licence) · get_code("c9237bb0935c2ac3")
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 list. 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 minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def get_param(self):
        # Return a parameter tensor that can be optimized
        param = torch.nn.Parameter(torch.randn(4, 3))
        param.grad = None
        return param
    
    def forward_with_param(self, data, w):
        # Use the provided parameter w to compute output
        # data shape: (batch, 4), w shape: (4, 3)
        output = torch.nn.functional.linear(data, w.t())
        # Return log probabilities for NLLLoss
        return torch.nn.functional.log_softmax(output, dim=1)

# Create model instance
model = MinimalModel()

# Create steps as an iterable of (data, label, lr) tuples
# Each step contains: data (batch_size=2, features=4), label (batch_size=2), lr (scalar)
steps = [
    (
        torch.randn(2, 4),           # data
        torch.randint(0, 3, (2,)),   # label (3 classes)
        torch.tensor([0.01])         # learning rate
    ),
    (
        torch.randn(2, 4),
        torch.randint(0, 3, (2,)),
        torch.tensor([0.01])
    )
]

# Create a simple callback function
def simple_callback(step_idx, params):
    pass

# Create state (can be any object, not used in function body)
state = {}

ARGS = {
    "state": state,
    "models": model,
    "steps": steps,
    "params": None,
    "callback": simple_callback
}
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 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

Also present in other papers' code

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

Deep learning techniques have achieved great success in many fields, while at the same time deep learning models are getting more complex and expensive to compute. It severely hinders the wide applications of these models. In order to alleviate this problem, model distillation emerges as an effective means to compress a large model into a smaller one without a significant drop in accuracy. In this paper, we study a related but orthogonal issue, data distillation, which aims to distill the knowledge from a large training dataset down to a smaller and synthetic one. It has the potential to address the large and growing neural network training problem based on the small dataset. We develop a novel data distillation method for text classification. We evaluate our method on eight benchmark datasets. The results that the distilled data with the size of 0.1% of the original text data achieves approximately 90% performance of the original is rather impressive.

For agents

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

get_harvested_code_for_paper("2104.08448")
get_code_for_paper("2104.08448")
have("2104.08448")

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

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

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

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

Connect an agent — have() is free.