SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.02245 · 2020

Data Augmentation using Pre-trained Transformer Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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; 3 no recorded run), measured 2026-11-21; 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/2003.02245.json · badge: /api/ran/2003.02245.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
megagonlabs/rotom community (classifier label)
classifier basis not recorded on the link
6 ran · 3 no recorded run
FunctionStatusWhere it lives
auto_mixda Ran
ran on a synthesized input
megagonlabs/rotom/rotom/auto_mixda.py
code served (permissive licence) · get_code("10336645e650e18c")
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 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 torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

class MultiTaskNet(nn.Module):
    def __init__(self, num_classes=5):
        super().__init__()
        self.num_classes = num_classes
        self.device = 'cpu'
        self.encoder = nn.Linear(4, 8)
        self.classifier = nn.Linear(8, num_classes)
        
    def forward(self, x=None, y=None, task=None, get_enc=False, x_enc=None):
        if get_enc:
            # Return encoded representation
            enc = self.encoder(x)
            return enc
        elif x_enc is not None:
            # Use provided encoding
            logits = self.classifier(x_enc)
            return logits, y, None
        else:
            # Full forward pass
            enc = self.encoder(x)
            logits = self.classifier(enc)
            return logits, y, None

class AugmentPolicyNetV4(nn.Module):
    def __init__(self):
        super().__init__()
        self.policy_net = nn.Linear(8, 1)
    
    def forward(self, x, y, x_enc=None, prediction=None):
        # Return confidence scores as selection indicator
        batch_size = x_enc.shape[0] if x_enc is not None else x.shape[0]
        enc = x_enc if x_enc is not None else torch.randn(batch_size, 8)
        ind = torch.sigmoid(self.policy_net(enc)).squeeze(-1)
        return ind

# Create model
model = MultiTaskNet(num_classes=5)

# Create batch: (_, x, _, _, _, y, _, taskname)
batch_size = 20
x = torch.randn(batch_size, 4)
y = torch.randint(0, 5, (batch_size,))
taskname = ('classification_task',)
batch = (None, x, None, None, None, y, None, taskname)

# Create policy network
policy = AugmentPolicyNetV4()

ARGS = {
    'model': model,
    'batch': batch,
    'policy': policy,
    'get_ind': False,
    'no_ssl': False,
}
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 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
evaluate Ran
ran on a synthesized input
megagonlabs/rotom/ditto/dm.py
code served (permissive licence) · get_code("b75fcb376dd932d9")
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 numpy as np

torch.manual_seed(0)

# Define a minimal model that satisfies the function's usage
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(12, 2)  # 12 = 4+4+4 (x1+x2+x12 dims), output 2 classes
    
    def forward(self, x1, x2, x12):
        # Concatenate inputs and pass through linear layer
        x = torch.cat([x1, x2, x12], dim=1)
        return self.linear(x)

# Create model instance
model = DummyModel()

# Create a minimal iterator with batches of (x1, x2, x12, y)
# Each batch should have 2 samples to keep it tiny
batch1 = (
    torch.randn(2, 4),  # x1: batch_size=2, dim=4
    torch.randn(2, 4),  # x2: batch_size=2, dim=4
    torch.randn(2, 4),  # x12: batch_size=2, dim=4
    torch.tensor([0, 1])  # y: batch_size=2, binary labels
)

batch2 = (
    torch.randn(2, 4),  # x1
    torch.randn(2, 4),  # x2
    torch.randn(2, 4),  # x12
    torch.tensor([1, 0])  # y
)

iterator = [batch1, batch2]

# Arguments dictionary
ARGS = {
    "model": model,
    "iterator": iterator,
    "threshold": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
generate Ran
ran on a synthesized input
megagonlabs/rotom/invda/generate.py
code served (permissive licence) · get_code("d5838e93b4af1c05")
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, 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


torch.manual_seed(0)


class MockTokenizer:
    def encode_plus(self, text, max_length=256, truncation=True, pad_to_max_length=True):
        # Return mock encoding with input_ids and attention_mask
        input_ids = [101, 2054, 2003, 1037, 3231, 102] + [0] * (max_length - 6)
        attention_mask = [1] * 6 + [0] * (max_length - 6)
        return {
            'input_ids': input_ids,
            'attention_mask': attention_mask
        }
    
    def decode(self, token_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True):
        # Return a mock decoded string
        return "this is a generated sentence"


class MockT5Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def generate(self, input_ids, do_sample=True, max_length=256, top_k=120, 
                 top_p=0.98, early_stopping=True, num_return_sequences=50):
        # Return mock generated token sequences (batch of 50 sequences)
        # Each sequence is max_length tokens
        batch_size = num_return_sequences
        seq_length = max_length
        # Return tensor of shape (num_return_sequences, seq_length)
        return torch.randint(100, 1000, (batch_size, seq_length))


tokenizer = MockTokenizer()
model = MockT5Model()
device = 'cpu'
sentence = "the quick brown fox jumps"

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'device': device,
    'sentence': sentence
}
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, ndim 1, dtype family float — a list 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
sharpen Ran
ran on a synthesized input
megagonlabs/rotom/rotom/auto_filter_weight.py
code served (permissive licence) · get_code("05741498b43e4e31")
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 small probability distribution tensor
# Shape: (batch_size=2, num_classes=4)
# Values should sum to 1 along the last dimension for a valid probability distribution
logits = torch.tensor([
    [0.4, 0.3, 0.2, 0.1],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

ARGS = {
    "logits": logits,
    "T": 0.5
}
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
sharpen Ran
ran on a synthesized input
megagonlabs/rotom/rotom/auto_mixda.py
code served (permissive licence) · get_code("b82757d05d446661")
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

torch.manual_seed(0)

# Create a small logits tensor (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# Temperature parameter
T = 0.5

ARGS = {
    "logits": logits,
    "T": T,
}
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
sharpen_onehot Ran
ran on a synthesized input
megagonlabs/rotom/rotom/auto_filter_weight.py
code served (permissive licence) · get_code("d7b285f99ad179f7")
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

torch.manual_seed(0)

# Create a small logits tensor
# Shape: (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# Define the arguments dictionary
ARGS = {
    "logits": logits,
    "bar": 0.1
}
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_lm Not yet run
unverified (harvested, no recorded run)
megagonlabs/rotom/rotom/model.py
code served (permissive licence) · get_code("dfa300b83dc454b7")
How it ran

no invocation recorded.

get_ops Not yet run
unverified (harvested, no recorded run)
megagonlabs/rotom/train_any.py
code served (permissive licence) · get_code("4865d9d12d7048ee")
How it ran

no invocation recorded.

process_filter Not yet run
unverified (harvested, no recorded run)
megagonlabs/rotom/rotom/auto_filter_weight.py
code served (permissive licence) · get_code("44e9efdba5cd8f3c")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Language model based pre-trained models such as BERT have provided significant gains across different NLP tasks. In this paper, we study different types of transformer based pre-trained models such as auto-regressive models (GPT-2), auto-encoder models (BERT), and seq2seq models (BART) for conditional data augmentation. We show that prepending the class labels to text sequences provides a simple yet effective way to condition the pre-trained models for data augmentation. Additionally, on three classification benchmarks, pre-trained Seq2Seq model outperforms other data augmentation methods in a low-resource setting. Further, we explore how different pre-trained model based data augmentation differs in-terms of data diversity, and how well such methods preserve the class-label information.

For agents

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

get_harvested_code_for_paper("2003.02245")
get_code_for_paper("2003.02245")
have("2003.02245")

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

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

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

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

Connect an agent — have() is free.