SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.15020 · 2020

Pre-training via Paraphrasing

arXiv · PDF · Open in the Atlas

Code that ran

15 of 18 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; 3 honoured the contract we drafted, 2 violated it and 7 have no contract verdict; 3 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/2006.15020.json · badge: /api/ran/2006.15020.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
lucidrains/marge-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
12 ran · 3 no recorded run
copy not recorded community
not in the paper's declared repositories
3 ran · 0 no recorded run
FunctionStatusWhere it lives
AutoregressiveWrapper Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("a23d31dcc7838ddb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn
import torch.nn.functional as F

# Define a minimal mock network that satisfies the interface expected by AutoregressiveWrapper
class MockNet(nn.Module):
    def __init__(self, vocab_size=16, max_seq_len=32, d_model=4):
        super().__init__()
        self.vocab_size = vocab_size
        self.max_seq_len = max_seq_len
        self.d_model = d_model
        self.embedding = nn.Embedding(vocab_size, d_model)
        self.transformer = nn.TransformerEncoderLayer(
            d_model=d_model,
            nhead=2,
            dim_feedforward=8,
            batch_first=True,
            dropout=0.0
        )
        self.output_proj = nn.Linear(d_model, vocab_size)
    
    def forward(self, x, src_mask=None, **kwargs):
        x = self.embedding(x)
        if src_mask is not None:
            x = self.transformer(x, src_key_padding_mask=~src_mask)
        else:
            x = self.transformer(x)
        logits = self.output_proj(x)
        return logits,

# Helper functions from the class
def exists(x):
    return x is not None

def default(x, d):
    return x if exists(x) else d

def log(t, eps=1e-09):
    return torch.log(t + eps)

def top_k(logits, thres=0.9):
    k = int((1 - thres) * logits.shape[-1])
    val, ind = torch.topk(logits, k)
    probs = torch.full_like(logits, float('-inf'))
    probs.scatter_(1, ind, val)
    return probs

# Import the AutoregressiveWrapper class
from functools import partial
from torch.nn.utils.rnn import pad_sequence

class AutoregressiveWrapper(nn.Module):

    def __init__(self, net, ignore_index=None, pad_value=0):
        super().__init__()
        self.pad_value = pad_value
        self.ignore_index = default(ignore_index, pad_value)
        self.net = net
        self.max_seq_len = net.max_seq_len

    @torch.no_grad()
    def generate(self, start_tokens, seq_len, eos_token=None, temperature=1.0, filter_logits_fn=top_k, filter_thres=0.9, **kwargs):
        was_training = self.net.training
        num_dims = len(start_tokens.shape)
        if num_dims == 1:
            start_tokens = start_tokens[None, :]
        b, t = start_tokens.shape
        self.net.eval()
        out = start_tokens
        input_mask = kwargs.pop('src_mask', None)
        if input_mask is None:
            input_mask = torch.full_like(out, True, dtype=torch.bool, device=out.device)
        for _ in range(seq_len):
            x = out[:, -self.max_seq_len:]
            input_mask = input_mask[:, -self.max_seq_len:]
            logits, *_ = self.net(x, src_mask=input_mask, **kwargs)
            logits = logits[:, -1, :]
            filtered_logits = filter_logits_fn(logits, thres=filter_thres)
            gumbel_noise = -log(-log(torch.zeros_like(filtered_logits).uniform_(0, 1)))
            sample = (filtered_logits / temperature + gumbel_noise).argmax(dim=-1)
            out = torch.cat((out, sample[:, None]), dim=-1)
            input_mask = F.pad(input_mask, (1, 0), value=True)
            if eos_token is not None and (sample == eos_token).all():
                break
        out = out[:, t:]
        if num_dims == 1:
            out = out.squeeze(0)
        self.net.train(was_training)
        return out

    def forward(self, x, *args, **kwargs):
        pad = partial(pad_sequence, batch_first=True, padding_value=self.pad_value)
        m = kwargs.pop('input_mask', None)
        xi, xo = (x[:, :-1], x[:, 1:])
        if m is not None:
            assert m.shape == x.shape[0:2], 'input mask must be the same shape as the input of the auto-regressive wrapper to automatically handle'
            kwargs.update(input_mask=m[:, :-1])
        out, *rest = self.net(xi, *args, **kwargs)
        loss = F.cross_entropy(out.transpose(1, 2), xo, ignore_index=self.ignore_index)
        return (loss, *rest)

# Setup
mock_net = MockNet(vocab_size=16, max_seq_len=32, d_model=4)

INIT_ARGS = {
    'net': mock_net,
    'ignore_index': None,
    'pad_value': 0,
}

ARGS = {
    'x': torch.randint(0, 16, (2, 8)),
}

# Construct and call
wrapper = AutoregressiveWrapper(**INIT_ARGS)
result = wrapper(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
CrossAttention Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("fb7817bba2fe0a0b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn
from einops import rearrange, repeat
import torch.nn.functional as F

def exists(x):
    return x is not None

def max_neg_value(tensor):
    return -torch.finfo(tensor.dtype).max

class CrossAttention(nn.Module):

    def __init__(self, dim, heads=8, dropout=0.0):
        super().__init__()
        self.scale = dim ** (-0.5)
        self.heads = heads
        self.to_q = nn.Linear(dim, dim, bias=False)
        self.to_kv = nn.Linear(dim, dim * 2, bias=False)
        self.beta = nn.Parameter(torch.tensor(1.0), requires_grad=True)
        self.to_out = nn.Linear(dim, dim)
        self.dropout = nn.Dropout(dropout)

    def forward(self, x, context, doc_similarities, mask=None, context_mask=None):
        b, n, _, h, device = (*x.shape, self.heads, x.device)
        q = self.to_q(x)
        q = rearrange(q, 'b n (h d) -> b h n d', h=h)
        context_len = context.shape[2]
        context = rearrange(context, 'b m n d -> b (m n) d')
        context_mask = rearrange(context_mask, 'b m n -> b (m n)') if exists(context_mask) else None
        doc_similarities = repeat(doc_similarities, 'b m -> b m n', n=context_len)
        doc_similarities = rearrange(doc_similarities, 'b m n -> b (m n)')
        doc_similarities = doc_similarities[:, None, None, :] * self.beta
        kv = self.to_kv(context)
        k, v = rearrange(kv, 'b n (kv h d) -> kv b h n d', h=h, kv=2)
        dots = torch.einsum('bhid,bhjd->bhij', q, k) * self.scale
        pre_attn_dots = dots
        dots = dots + doc_similarities
        if any(map(exists, (mask, context_mask))):
            if not exists(mask):
                mask = torch.full((b, n), True, dtype=torch.bool, device=device)
            if not exists(context_mask):
                context_mask = torch.full(context.shape[:2], True, dtype=torch.bool, device=device)
            cross_mask = mask[:, None, :, None] * context_mask[:, None, None, :]
            mask_value = max_neg_value(dots)
            dots.masked_fill_(~cross_mask, mask_value)
            del cross_mask
        attn = dots.softmax(dim=-1)
        attn = self.dropout(attn)
        out = torch.einsum('bhij,bhjd->bhid', attn, v)
        out = rearrange(out, 'b h n d -> b n (h d)')
        out = self.to_out(out)
        return (out, pre_attn_dots)


INIT_ARGS = {
    'dim': 4,
    'heads': 2,
    'dropout': 0.1,
}

ARGS = {
    'x': torch.randn(2, 3, 4),
    'context': torch.randn(2, 5, 6, 4),
    'doc_similarities': torch.randn(2, 5),
    'mask': None,
    'context_mask': None,
}

if __name__ == '__main__':
    model = CrossAttention(**INIT_ARGS)
    output, pre_attn = model(**ARGS)
    print("Output shape:", output.shape)
    print("Pre-attention dots shape:", pre_attn.shape)
    print("Success!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FeedForward Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("2f5068b67b6e8ba9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn
import torch.nn.functional as F

class GEGLU(nn.Module):

    def forward(self, x):
        x, gates = x.chunk(2, dim=-1)
        return F.gelu(gates) * x

class FeedForward(nn.Module):

    def __init__(self, dim, mult=4, dropout=0.0):
        super().__init__()
        mult = int(mult / 3 * 2)
        self.net = nn.Sequential(nn.Linear(dim, dim * mult * 2), GEGLU(), nn.Dropout(dropout), nn.Linear(dim * mult, dim))

    def forward(self, x):
        return self.net(x)


INIT_ARGS = {
    'dim': 4,
    'mult': 4,
    'dropout': 0.1,
}

ARGS = {
    'x': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = FeedForward(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GEGLU Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("5f34e2fdaf110b16")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn, einsum
import torch.nn.functional as F

class GEGLU(nn.Module):

    def forward(self, x):
        x, gates = x.chunk(2, dim=-1)
        return F.gelu(gates) * x


INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 8)
}

if __name__ == '__main__':
    module = GEGLU(**INIT_ARGS)
    output = module(**ARGS)
    print(output.shape)
    print(output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
PreNorm Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("91253a4da85ebfde")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 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
from torch import nn, einsum

class PreNorm(nn.Module):

    def __init__(self, dim, fn):
        super().__init__()
        self.norm = nn.LayerNorm(dim)
        self.fn = fn

    def forward(self, x, *args, **kwargs):
        x = self.norm(x)
        return self.fn(x, *args, **kwargs)


# Stand-in function that takes normalized input and returns output
def dummy_fn(x, extra_arg=None):
    return x * 2 + (extra_arg if extra_arg is not None else 0)


# Construction arguments
INIT_ARGS = {
    'dim': 4,
    'fn': dummy_fn
}

# Computation arguments
ARGS = {
    'x': torch.randn(2, 3, 4),
    'extra_arg': torch.randn(2, 3, 4)
}

# Construct and call
prenorm = PreNorm(**INIT_ARGS)
output = prenorm(**ARGS)
print(output.shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SelfAttention Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("2420acac5ce29a6d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 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
from torch import nn
from einops import rearrange, repeat

def exists(x):
    return x is not None

def max_neg_value(tensor):
    return -torch.finfo(tensor.dtype).max

class SelfAttention(nn.Module):

    def __init__(self, dim, heads=8, causal=True, dropout=0.0):
        super().__init__()
        self.scale = dim ** (-0.5)
        self.heads = heads
        self.causal = causal
        self.to_qkv = nn.Linear(dim, dim * 3, bias=False)
        self.to_out = nn.Linear(dim, dim)
        self.dropout = nn.Dropout(dropout)

    def forward(self, x, mask=None):
        _, n, _, h, device = (*x.shape, self.heads, x.device)
        qkv = self.to_qkv(x)
        q, k, v = rearrange(qkv, 'b n (qkv h d) -> qkv b h n d', h=h, qkv=3)
        dots = einsum('bhid,bhjd->bhij', q, k) * self.scale
        mask_value = max_neg_value(dots)
        if exists(mask):
            mask = mask[:, None, :, None] * mask[:, None, None, :]
            dots.masked_fill_(~mask, mask_value)
            del mask
        if self.causal:
            causal_mask = torch.ones(n, n, device=device).triu_(1).bool()
            dots.masked_fill_(causal_mask, mask_value)
            del causal_mask
        attn = dots.softmax(dim=-1)
        attn = self.dropout(attn)
        out = einsum('bhij,bhjd->bhid', attn, v)
        out = rearrange(out, 'b h n d -> b n (h d)')
        out = self.to_out(out)
        return out

def einsum(*args, **kwargs):
    return torch.einsum(*args, **kwargs)

INIT_ARGS = {
    'dim': 4,
    'heads': 2,
    'causal': True,
    'dropout': 0.1,
}

ARGS = {
    'x': torch.randn(2, 3, 4),
    'mask': None,
}

if __name__ == '__main__':
    model = SelfAttention(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 3, 4)")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerWrapper Ran
ran on a synthesized input
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("85f155dff8d3e5f1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn, einsum

def identity(x, *args, **kwargs):
    return x

class TransformerWrapper(nn.Module):

    def __init__(self, num_tokens, dim, max_seq_len, layers, return_logits=False):
        super().__init__()
        self.token_emb = nn.Embedding(num_tokens, dim)
        self.pos_emb = nn.Embedding(max_seq_len, dim)
        self.max_seq_len = max_seq_len
        self.layers = layers
        self.to_logits = nn.Linear(dim, num_tokens) if return_logits else identity

    def forward(self, x, *args, **kwargs):
        b, n, device = (*x.shape, x.device)
        assert n <= self.max_seq_len, f'your sequence length {n} needs to be less than or equal to the max sequence length {self.max_seq_len}'
        x = self.token_emb(x)
        x += self.pos_emb(torch.arange(n, device=device))
        x, *out = self.layers(x, *args, **kwargs)
        return (self.to_logits(x), *out)


class DummyLayers(nn.Module):
    def __init__(self, dim):
        super().__init__()
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, x, *args, **kwargs):
        x = self.linear(x)
        return (x,)


INIT_ARGS = {
    'num_tokens': 16,
    'dim': 4,
    'max_seq_len': 8,
    'layers': DummyLayers(dim=4),
    'return_logits': True,
}

ARGS = {
    'x': torch.randint(0, 16, (2, 5)),
}

if __name__ == '__main__':
    model = TransformerWrapper(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output[0].shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
default Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from lucidrains/marge-pytorch
pointer only · get_code("d1003e60be6533a9")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. A run is recorded.

default Ran
ran, honoured the contract we drafted
lucidrains/marge-pytorch/marge_pytorch/autoregressive_wrapper.py
code served (permissive licence) · get_code("00cc1741a5867494")
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 int, ndim 0, dtype family int, 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

# The function 'default' takes two parameters: value and default
# It returns value if value is not None, otherwise returns default

# Construct arguments that demonstrate the function's behavior
ARGS = {
    "value": None,
    "default": 42
}
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 int, ndim 0, dtype family int, 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
distill_attn_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("b2cc37d9d1652bf0")
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 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.functional as F
from einops import rearrange, repeat

torch.manual_seed(0)

# Construct tensors for the function
# evi_dots shape: 'b l h i n j -> b (l h i) n j'
# Let's use: b=2, l=1, h=2, i=2, n=3, j=4
# So evi_dots input shape: (2, 1, 2, 2, 3, 4)
evi_dots = torch.randn(2, 1, 2, 2, 3, 4)

# doc_similarities should have shape compatible with normed_evi_dots
# After rearrange and mean operations, normed_evi_dots will have shape (b, n)
# where b=2, n=3
# doc_similarities needs to be (b, n) for softmax and log operations
doc_similarities = torch.randn(2, 3)

# mask shape: 'b n j -> b () n j'
# So mask input shape: (2, 3, 4)
mask = torch.ones(2, 3, 4, dtype=torch.bool)

ARGS = {
    'evi_dots': evi_dots,
    'doc_similarities': doc_similarities,
    'mask': mask,
    'eps': 1e-05
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, 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
exists Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from lucidrains/bit-diffusion
pointer only · get_code("608e364a9d2376a3")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. A run is recorded.

identity Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from lucidrains/marge-pytorch
pointer only · get_code("caeb28d34b34bc2a")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. A run is recorded.

log Ran
ran, honoured the contract we drafted
lucidrains/marge-pytorch/marge_pytorch/autoregressive_wrapper.py
code served (permissive licence) · get_code("6269424d608eba34")
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 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)

# The function log takes a tensor t and an optional eps parameter
# It computes torch.log(t + eps) to avoid log(0)
# We need to provide a valid tensor as argument t

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

eps = 1e-09

ARGS = {
    't': t,
    'eps': eps
}
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 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
top_k Ran
ran; our contract draft was wrong, not the code
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("3b65d5d77510c964")
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 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, vocab_size=4
logits = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    "logits": logits,
    "thres": 0.9
}
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 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
top_p Ran
ran; our contract draft was wrong, not the code
lucidrains/marge-pytorch/marge_pytorch/autoregressive_wrapper.py
code served (permissive licence) · get_code("6061c7c2f893c5a4")
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.functional as F

torch.manual_seed(0)

# Construct logits tensor: (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# Threshold parameter
thres = 0.9

ARGS = {
    "logits": logits,
    "thres": thres,
}
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
Decoder Not yet run
unverified (harvested, no recorded run)
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("94e14679f0392a49")
How it ran

no invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("2d3108123a370798")
How it ran

no invocation recorded.

Marge Not yet run
unverified (harvested, no recorded run)
lucidrains/marge-pytorch/marge_pytorch/marge_pytorch.py
code served (permissive licence) · get_code("8cd72863751d5967")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 6 later) and 12 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
exists
brick of this paper's assembly: helper
144 other papers
2 dated earlier, 1 the same month, 141 later · 40 only as an assembly brick
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
and 141 more not named here
top_k
brick of this paper's assembly: helper
6 other papers
1 dated earlier, 5 later
1812.01243 (2018-12)
Efficient Attention: Attention with Linear Complexities
2107.11906 (2021-07)
H-Transformer-1D: Fast One-Dimensional Hierarchical Attention for Sequences
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
and 3 more not named here
identity
brick of this paper's assembly: helper
5 other papers
3 dated earlier, 1 the same month, 1 later
1912.11554 (2019-12)
Composable Effects for Flexible and Accelerated Probabilistic Programming in NumPyro
2002.05202 (2020-02)
GLU Variants Improve Transformer
2003.05997 (2020-03)
Efficient Content-Based Sparse Attention with Routing Transformers
and 2 more not named here
log
brick of this paper's assembly: helper
4 other papers
1 dated earlier, 3 later
2003.10555 (2020-03)
ELECTRA: PRE-TRAINING TEXT ENCODERS AS DISCRIMINATORS RATHER THAN GENERATORS
2102.08473 (2021-02)
COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining
2201.08239 (2022-01)
LaMDA: Language Models for Dialog Applications
and 1 more not named here
GEGLU
brick of this paper's assembly: model
1 other paper
1 later
2604.15377 (2026-04)
M3R: Localized Rainfall Nowcasting with Meteorology-Informed MultiModal Attention
default
brick of this paper's assembly: helper
1 other paper
1 later
2505.12500 (2025-05)
MARGE: Improving Math Reasoning for LLMs with Guided Exploration

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

We introduce MARGE, a pre-trained sequence-to-sequence model learned with an unsupervised multi-lingual multi-document paraphrasing objective. MARGE provides an alternative to the dominant masked language modeling paradigm, where we self-supervise the reconstruction of target text by retrieving a set of related texts (in many languages) and conditioning on them to maximize the likelihood of generating the original. We show it is possible to jointly learn to do retrieval and reconstruction, given only a random initialization. The objective noisily captures aspects of paraphrase, translation, multi-document summarization, and information retrieval, allowing for strong zero-shot performance on several tasks. For example, with no additional task-specific training we achieve BLEU scores of up to 35.8 for document translation. We further show that fine-tuning gives strong performance on a range of discriminative and generative tasks in many languages, making MARGE the most generally applicable pre-training method to date.

For agents

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

get_harvested_code_for_paper("2006.15020")
get_code_for_paper("2006.15020")
have("2006.15020")

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

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

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

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

Connect an agent — have() is free.