SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.00402 · 2023

mPLUG-2: A Modularized Multi-modal Foundation Model Across Text, Image and Video

arXiv · PDF · Open in the Atlas

Code that ran

17 of 19 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 7 have no contract verdict; 10 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2302.00402.json · badge: /api/ran/2302.00402.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
X-PLUG/mPLUG-2 community (classifier label)
classifier basis not recorded on the link
15 ran · 2 no recorded run
x-plug/mplug-owl extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
whitespace_tokenize Ran
ran; our contract draft was wrong, not the code
X-PLUG/mPLUG-2/models/tokenization_bert.py
code served (permissive licence) · get_code("cf9ffa02a42184af")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T02:55:57Z). 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

def whitespace_tokenize(text):
    """Runs basic whitespace cleaning and splitting on a piece of text."""
    text = text.strip()
    if not text:
        return []
    tokens = text.split()
    return tokens

# Setup code
torch.manual_seed(0)

# The function takes a single parameter: text (a string)
# It performs basic whitespace cleaning and splitting
# We need to provide a valid string argument

ARGS = {
    "text": "  hello world  this is a test  "
}
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 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
clamp_inf Ran
ran on a synthesized input
X-PLUG/mPLUG-2/models/modeling_mplug2.py
code served (permissive licence) · get_code("21aff36aa456493f")
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 1, dtype family float, shape (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)

# Construct a small float16 tensor with some inf values to test the clamping logic
tensor_with_inf = torch.tensor([1.0, float('inf'), -float('inf'), 2.0], dtype=torch.float16)

ARGS = {
    "tensor": tensor_with_inf
}
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 1, dtype family float, shape (4,) — shape (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
compute_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
X-PLUG/mPLUG-2/utils.py
code served (permissive licence) · get_code("aa81d03f07735ab8")
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

torch.manual_seed(0)

# Create small tensors for testing
# logits: shape (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# label: shape (batch_size=2,) with class indices
label = torch.tensor([1, 3])

# reduction: string parameter
reduction = 'mean'

ARGS = {
    'logits': logits,
    'label': label,
    'reduction': reduction
}
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 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
compute_n_params Ran
ran; our contract draft was wrong, not the code
X-PLUG/mPLUG-2/utils.py
code served (permissive licence) · get_code("ad12a494674d23fb")
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 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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model,
    "return_str": True
}
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 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
decode_int32 Ran
ran on a synthesized input
X-PLUG/mPLUG-2/dataset/caption_dataset.py
code served (permissive licence) · get_code("96590457ad0c455c")
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 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 torch
import numpy as np

torch.manual_seed(0)

# The function decode_int32 takes a single parameter 'ann'
# It converts ann to a string, performs string manipulation,
# and returns a formatted string with server and id components.
# The parameter can be any value that can be converted to string and then to int.

# Valid test cases for ann:
# - An integer
# - A float
# - A string representation of a number
# - A tensor containing a single integer value

ARGS = {
    "ann": 12345
}
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 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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
X-PLUG/mPLUG-2/models/clip_video.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from fudan-zvg/SeaFormer, is pointer only (licence: NONE) · get_code("3ac6b7d76e8e3584")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from fudan-zvg/SeaFormer, and GitHub detected no licence in that repository when it was checked. 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.

get_ltor_masks_and_position_ids_from_embeddings Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
x-plug/mplug-owl/mPLUG-Owl/mplug_owl/modeling_mplug_owl.py
code served (permissive licence) · get_code("45567e61fe09093a")
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. 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)

# The function expects:
# - data: a tensor with at least 2 dimensions where data.size()[:2] gives (micro_batch_size, seq_length)
#   The function also accesses data.device and data[..., 0]
# Create a small tensor: shape (2, 3, 4) where batch=2, seq_length=3, embedding_dim=4
data = torch.randn(2, 3, 4, device='cpu')

ARGS = {
    'data': data
}
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 — 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: none by the harness; any seed is in the setup block
get_media_indices Ran
ran; our contract draft was wrong, not the code
x-plug/mplug-owl/mPLUG-Owl/mplug_owl/modeling_mplug_owl.py
code served (permissive licence) · get_code("265f4d55ccd60d18")
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 int; 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

torch.manual_seed(0)

# The function takes a list (or tensor that can be converted to list)
# It iterates through the list and finds indices where:
# 1. i == 0 and my_list[i] < 0, OR
# 2. my_list[i] != my_list[i-1] and my_list[i] < 0
# So we need a list with some negative values and transitions

my_list = torch.tensor([-1, -1, 2, -3, -3, -5], dtype=torch.float32)

ARGS = {
    "my_list": my_list
}
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 int — 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
initialize_clip Ran
ran on a synthesized input
X-PLUG/mPLUG-2/models/visual_transformers.py
code served (permissive licence) · get_code("3295906672ecb8a4")
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 math

torch.manual_seed(0)

# Mock the clip module since we can't download it
class MockCLIPModel(nn.Module):
    def __init__(self, embed_dim=768, pos_embed_size=241):
        super().__init__()
        self.visual = nn.Module()
        # Create a positional embedding that mimics ViT-B-16
        # Shape: (pos_embed_size, embed_dim)
        self.visual.positional_embedding = nn.Parameter(
            torch.randn(pos_embed_size, embed_dim)
        )
    
    def forward(self, x):
        return x

class MockPreprocess:
    def __call__(self, x):
        return x

# Create a minimal config dict
config = {
    'clip_name': 'ViT-B-16',
    'image_res': 224,
}

# Create mock clip module
class MockClip:
    @staticmethod
    def load(model_name, jit=False):
        if 'ViT-B-16' in model_name:
            model = MockCLIPModel(embed_dim=768, pos_embed_size=197)
        else:
            model = MockCLIPModel(embed_dim=1024, pos_embed_size=257)
        preprocess = MockPreprocess()
        return model, preprocess

# Mock the models.clip.clip module
import sys
from types import ModuleType

clip_module = ModuleType('clip')
clip_module.load = MockClip.load

models_module = ModuleType('models')
clip_submodule = ModuleType('clip')
clip_submodule.clip = clip_module
models_module.clip = clip_submodule

sys.modules['models'] = models_module
sys.modules['models.clip'] = clip_submodule
sys.modules['models.clip.clip'] = clip_module

# Define arguments for initialize_clip function
ARGS = {
    'config': config,
    'num_patches': 240,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
models, 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
initialize_clip_video Ran
ran on a synthesized input
X-PLUG/mPLUG-2/models/visual_transformers.py
code served (permissive licence) · get_code("53b733b2695e4c7f")
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 math

torch.manual_seed(0)

# Mock the clip_video module since we can't import it
class MockClipVideo:
    @staticmethod
    def load(model_path, jit, img_size, T, use_checkpoint, config):
        # Create a mock clip model with visual component
        clip_model = nn.Module()
        visual = nn.Module()
        
        # Create a small positional embedding tensor
        # For ViT-B-16: patches = (224*224)/(16*16) = 196, so 197 with class token
        # For ViT-L-14: patches = (224*224)/(14*14) = 256, so 257 with class token
        if config['clip_name'] == 'ViT-B-16':
            pos_embed_shape = (197, 768)
        else:  # ViT-L-14
            pos_embed_shape = (257, 1024)
        
        visual.positional_embedding = torch.zeros(pos_embed_shape)
        clip_model.visual = visual
        
        preprocess = lambda x: x
        return clip_model, preprocess

# Inject the mock into a module we can import from
import sys
from types import ModuleType
models = ModuleType('models')
clip_video = MockClipVideo()
models.clip_video = clip_video
sys.modules['models'] = models
sys.modules['models.clip_video'] = clip_video

# Now define the config dict
config = {
    'clip_name': 'ViT-B-16',
    'image_res': 224
}

ARGS = {
    'config': config,
    'num_patches': 240,
    'T': 8,
    'use_checkpoint': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
models, 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
interpolate_pos_embed Ran
ran; our contract draft was wrong, not the code
X-PLUG/mPLUG-2/models/vit.py
code served (permissive licence) · get_code("c6ec173f19f5c34d")
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 3, dtype family float, shape (1, 17, 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)

class PatchEmbed(nn.Module):
    def __init__(self, num_patches):
        super().__init__()
        self.num_patches = num_patches

class VisualEncoder(nn.Module):
    def __init__(self, num_patches, pos_embed_shape):
        super().__init__()
        self.patch_embed = PatchEmbed(num_patches)
        self.pos_embed = torch.randn(pos_embed_shape)

# Create a visual encoder with 16 patches (4x4 grid)
# pos_embed shape: (1, num_patches + num_extra_tokens, embedding_dim)
num_patches = 16
num_extra_tokens = 1
embedding_size = 4
visual_encoder = VisualEncoder(
    num_patches=num_patches,
    pos_embed_shape=(1, num_patches + num_extra_tokens, embedding_size)
)

# Create pos_embed_checkpoint with original size 2x2 (4 patches) + 1 extra token
# This will trigger interpolation from 2x2 to 4x4
orig_size = 2
orig_num_patches = orig_size * orig_size
pos_embed_checkpoint = torch.randn(1, orig_num_patches + num_extra_tokens, embedding_size)

ARGS = {
    "pos_embed_checkpoint": pos_embed_checkpoint,
    "visual_encoder": visual_encoder,
}
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 3, dtype family float, shape (1, 17, 4) — shape (1, 17, 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
load_vocab Ran
ran; our contract draft was wrong, not the code
X-PLUG/mPLUG-2/models/tokenization_bert.py
code served (permissive licence) · get_code("e7fbc7a74a3457c7")
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 OrderedDict. 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 collections
import tempfile
import os

# Create a temporary vocabulary file
temp_dir = tempfile.mkdtemp()
vocab_file = os.path.join(temp_dir, 'vocab.txt')

# Write some sample tokens to the vocab file
sample_tokens = ['[PAD]', '[UNK]', '[CLS]', '[SEP]', 'the', 'quick', 'brown', 'fox']
with open(vocab_file, 'w', encoding='utf-8') as f:
    for token in sample_tokens:
        f.write(token + '\n')

ARGS = {
    'vocab_file': vocab_file
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
resize_pos_embed Ran
ran on a synthesized input
X-PLUG/mPLUG-2/models/visual_transformers.py
code served (permissive licence) · get_code("01b33ff330828e1e")
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 3, dtype family float, shape (1, 17, 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 math
import torch.nn.functional as F

torch.manual_seed(0)

# posemb is a tensor with shape (batch, num_tokens, embedding_dim)
# It contains a class token at position 0, then grid tokens
# For a grid of size gs_old x gs_old, we have gs_old^2 grid tokens
# So num_tokens = 1 (class token) + gs_old^2

# Create posemb with grid size 3x3 (so 9 grid tokens + 1 class token = 10 tokens)
gs_old = 3
num_tokens_old = 1 + gs_old * gs_old  # 10 tokens
embedding_dim = 4
posemb = torch.randn(1, num_tokens_old, embedding_dim)

# Create posemb_new with grid size 4x4 (so 16 grid tokens + 1 class token = 17 tokens)
gs_new = 4
num_tokens_new = 1 + gs_new * gs_new  # 17 tokens
posemb_new = torch.randn(1, num_tokens_new, embedding_dim)

ARGS = {
    "posemb": posemb,
    "posemb_new": posemb_new,
}
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 3, dtype family float, shape (1, 17, 4) — shape (1, 17, 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
test_collect_fn Ran
ran on a synthesized input
X-PLUG/mPLUG-2/video_caption_mplug2.py
code served (permissive licence) · get_code("cfb25231bfbf746c")
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. 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

torch.manual_seed(0)

# The function expects a batch which is an iterable of tuples (video, video_id, caption)
# Each video should be a tensor that can be stacked
# video_id can be any hashable type (string, int, etc.)
# caption can be any type (string, list, etc.)

batch = [
    (torch.randn(4, 3), "video_1", "a cat is sleeping"),
    (torch.randn(4, 3), "video_2", "a dog is running"),
]

ARGS = {
    "batch": batch
}
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 — 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: none by the harness; any seed is in the setup block
tile Ran
ran; our contract draft was wrong, not the code
X-PLUG/mPLUG-2/models/model_video_caption_mplug.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from timmy-chan/miss, is pointer only (licence: NONE) · get_code("aa5a91226269bf75")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from timmy-chan/miss, and GitHub detected no licence in that repository when it was checked. 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.

tile Ran
ran; our contract draft was wrong, not the code
X-PLUG/mPLUG-2/models/predictor.py
code served (permissive licence) · get_code("69b8b31e44791260")
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 3, dtype family float, shape (2, 12, 3) 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, 4, 3)  # batch=2, feature_dim=4, spatial_dim=3

# Test with different count and dim values
count = 3
dim = 1

ARGS = {
    "x": x,
    "count": count,
    "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 3, dtype family float, shape (2, 12, 3) — shape (2, 12, 3) 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_top_p_filtering Ran
ran on a synthesized input
X-PLUG/mPLUG-2/models/predictor.py
code served (permissive licence) · get_code("63e2cc5fb0616ee9")
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)

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

ARGS = {
    'logits': logits,
    'top_k': 3,
    'top_p': 0.9,
    'filter_value': -float('Inf'),
    'min_tokens_to_keep': 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
build_predictor Not yet run
unverified (harvested, no recorded run)
X-PLUG/mPLUG-2/models/predictor.py
code served (permissive licence) · get_code("e496506b4b6756a4")
How it ran

no invocation recorded.

load_tf_weights_in_bert Not yet run
unverified (harvested, no recorded run)
X-PLUG/mPLUG-2/models/modeling_mplug2.py
code served (permissive licence) · get_code("26be70dca3249c0b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 14 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 5 the same month, 14 later) and 5 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
drop_path 224 other papers
71 dated earlier, 3 the same month, 143 later, 6 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
tile 84 other papers
4 dated earlier, 1 the same month, 79 later
2206.07699 (2022-06)
Write and Paint: Generative Vision-Language Models are Unified Modal Learners
2210.07795 (2022-10)
EfficientVLM: Fast and Accurate Vision-Language Models via Knowledge Distillation and Modal-adaptive Pruning
2210.08773 (2022-10)
Plug-and-Play VQA: Zero-shot VQA by Conjoining Large Pretrained Models with Zero Training
and 81 more not named here
interpolate_pos_embed 52 other papers
7 dated earlier, 1 the same month, 44 later
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2111.09452 (2021-11)
Open Vocabulary Object Detection with Pseudo Bounding-Box Labels
2205.11169 (2022-05)
PEVL: Position-enhanced Pre-training and Prompt Tuning for Vision-language Models
and 49 more not named here
whitespace_tokenize 43 other papers
25 dated earlier, 18 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 40 more not named here
compute_n_params 29 other papers
5 dated earlier, 1 the same month, 23 later
2111.09452 (2021-11)
Open Vocabulary Object Detection with Pseudo Bounding-Box Labels
2211.09790 (2022-11)
ConStruct-VL: Data-Free Continual Structured VL Concepts Learning
2211.13594 (2022-11)
Self-supervised vision-language pretraining for Medical visual question answering
and 26 more not named here
load_vocab 29 other papers
13 dated earlier, 16 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2004.09297 (2020-04)
MPNet: Masked and Permuted Pre-training for Language Understanding
and 26 more not named here
compute_acc 28 other papers
5 dated earlier, 1 the same month, 22 later
2111.09452 (2021-11)
Open Vocabulary Object Detection with Pseudo Bounding-Box Labels
2211.09790 (2022-11)
ConStruct-VL: Data-Free Continual Structured VL Concepts Learning
2211.13594 (2022-11)
Self-supervised vision-language pretraining for Medical visual question answering
and 25 more not named here
load_tf_weights_in_bert 28 other papers
12 dated earlier, 15 later, 1 same year, order not determinable
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2104.06599 (2021-04)
Learning How to Ask: Querying LMs with Mixtures of Soft Prompts
and 25 more not named here
tile 8 other papers
6 dated earlier, 2 later
1905.13164 (2019-05)
Hierarchical Transformers for Multi-Document Summarization
1906.10508 (2019-06)
Non-Parallel Sequence-to-Sequence Voice Conversion with Disentangled Linguistic and Speaker Representations
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
and 5 more not named here
get_ltor_masks_and_position_ids_from_embeddings 7 other papers
6 later, 1 same year, order not determinable
2023.findings-emnlp.187 (2023 (year only))
UReader: Universal OCR-free Visually-situated Language Understanding with Multimodal Large Language Model
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
2310.05126 (2023-10)
UReader: Universal OCR-free Visually-situated Language Understanding with Multimodal Large Language Model
and 4 more not named here
get_media_indices 6 other papers
6 later
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
2312.06742 (2023-12)
Honeybee: Locality-enhanced Projector for Multimodal LLM
2402.09801 (2024-02)
EFUF: Efficient Fine-Grained Unlearning Framework for Mitigating Hallucinations in Multimodal Large Language Models
and 3 more not named here
build_predictor 1 other paper
1 later
2306.04362 (2023-06)
Youku-mPLUG: A 10 Million Large-scale Chinese Video-Language Dataset for Pre-training and Benchmarks
clamp_inf 1 other paper
1 later
2306.04362 (2023-06)
Youku-mPLUG: A 10 Million Large-scale Chinese Video-Language Dataset for Pre-training and Benchmarks
top_k_top_p_filtering 1 other paper
1 later
2306.04362 (2023-06)
Youku-mPLUG: A 10 Million Large-scale Chinese Video-Language Dataset for Pre-training and Benchmarks

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

Recent years have witnessed a big convergence of language, vision, and multi-modal pretraining. In this work, we present mPLUG-2, a new unified paradigm with modularized design for multi-modal pretraining, which can benefit from modality collaboration while addressing the problem of modality entanglement. In contrast to predominant paradigms of solely relying on sequence-to-sequence generation or encoder-based instance discrimination, mPLUG-2 introduces a multi-module composition network by sharing common universal modules for modality collaboration and disentangling different modality modules to deal with modality entanglement. It is flexible to select different modules for different understanding and generation tasks across all modalities including text, image, and video. Empirical study shows that mPLUG-2 achieves state-of-the-art or competitive results on a broad range of over 30 downstream tasks, spanning multi-modal tasks of image-text and video-text understanding and generation, and uni-modal tasks of text-only, image-only, and video-only understanding. Notably, mPLUG-2 shows new state-of-the-art results of 48.0 top-1 accuracy and 80.3 CIDEr on the challenging MSRVTT video QA and video caption tasks with a far smaller model size and data scale. It also demonstrates strong zero-shot transferability on vision-language and video-language tasks. Code and models will be released in https://github.com/alibaba/AliceMind.

For agents

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

get_harvested_code_for_paper("2302.00402")
get_code_for_paper("2302.00402")
have("2302.00402")

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

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

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

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

Connect an agent — have() is free.