SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.11624 · CVPR · 2021

Multimodal Motion Prediction with Stacked Transformers

Bolei Zhou, Yicheng Liu, Jinghuai Zhang, Liangji Fang, Qinhong Jiang

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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 3 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2103.11624.json · badge: /api/ran/2103.11624.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
decisionforce/mmTransformer marked official in Papers with Code
Papers with Code archive
3 ran · 0 no recorded run
FunctionStatusWhere it lives
LaneNet Ran
ran on a synthesized input
decisionforce/mmTransformer/lib/models/mmTransformer.py
code served (permissive licence) · get_code("a34bb32457f047c6")
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; 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

# INIT_ARGS for LaneNet.__init__(in_channels, hidden_unit, num_subgraph_layers)
INIT_ARGS = {
    'in_channels': 7,
    'hidden_unit': 8,
    'num_subgraph_layers': 2
}

# ARGS for LaneNet.forward(lane)
# lane shape: [batch size, max_lane_num, 9, 7]
# Based on the docstring: [batch size, max_lane_num, 9, 7] (vectorized representation)
ARGS = {
    'lane': torch.randn(2, 5, 9, 7)
}
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
MLP Ran
ran on a synthesized input
decisionforce/mmTransformer/lib/models/mmTransformer.py
code served (permissive licence) · get_code("1999ed3b0b689eaf")
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, 8) 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

class MLP(nn.Module):

    def __init__(self, in_channels, hidden_unit, verbose=False):
        super(MLP, self).__init__()
        self.mlp = nn.Sequential(nn.Linear(in_channels, hidden_unit), nn.LayerNorm(hidden_unit), nn.ReLU())

    def forward(self, x):
        x = self.mlp(x)
        return x


INIT_ARGS = {
    'in_channels': 4,
    'hidden_unit': 8,
    'verbose': False,
}

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

if __name__ == '__main__':
    model = MLP(**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, 8) — shape (2, 8) 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)
mmTrans Ran
ran on a synthesized input
decisionforce/mmTransformer/lib/models/mmTransformer.py
code served (permissive licence) · get_code("0c1e40441b32a6fb")
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 4, 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

class MLP(nn.Module):
    def __init__(self, in_channels, hidden_unit, verbose=False):
        super(MLP, self).__init__()
        self.mlp = nn.Sequential(nn.Linear(in_channels, hidden_unit), nn.LayerNorm(hidden_unit), nn.ReLU())

    def forward(self, x):
        x = self.mlp(x)
        return x

class LaneNet(nn.Module):
    def __init__(self, in_channels, hidden_unit, num_subgraph_layers):
        super(LaneNet, self).__init__()
        self.num_subgraph_layers = num_subgraph_layers
        self.layer_seq = nn.Sequential()
        for i in range(num_subgraph_layers):
            self.layer_seq.add_module(f'lmlp_{i}', MLP(in_channels, hidden_unit))
            in_channels = hidden_unit * 2

    def forward(self, lane):
        x = lane
        for name, layer in self.layer_seq.named_modules():
            if isinstance(layer, MLP):
                x = layer(x)
                x_max = torch.max(x, -2)[0]
                x_max = x_max.unsqueeze(2).repeat(1, 1, x.shape[2], 1)
                x = torch.cat([x, x_max], dim=-1)
        x_max = torch.max(x, -2)[0]
        return x_max

class DummyTransformer(nn.Module):
    def __init__(self, cfg):
        super(DummyTransformer, self).__init__()
        self.cfg = cfg

    def forward(self, trajs, pos, max_agent_num, social_mask, lane_enc, lane_mask):
        batch_size = trajs.shape[0]
        future_len = self.cfg['future_num_frames']
        return torch.randn(batch_size, 2, future_len, 2)

class mmTrans(nn.Module):
    def __init__(self, stacked_transformer, cfg):
        super(mmTrans, self).__init__()
        self.stacked_transformer = stacked_transformer(cfg)
        lane_channels = cfg['lane_channels']
        self.hist_feature_size = cfg['in_channels']
        self.polyline_vec_shape = 2 * cfg['subgraph_width']
        self.subgraph = LaneNet(lane_channels, cfg['subgraph_width'], cfg['num_subgraph_layres'])
        self.FUTURE_LEN = cfg['future_num_frames']
        self.OBS_LEN = cfg['history_num_frames'] - 1
        self.lane_length = cfg['lane_length']

    def preprocess_traj(self, traj):
        social_valid_len = self.traj_valid_len
        social_mask = torch.zeros((self.B, 1, int(self.max_agent_num))).to(traj.device)
        for i in range(self.B):
            social_mask[i, 0, :social_valid_len[i]] = 1
        return social_mask

    def preprocess_lane(self, lane):
        lane_v = torch.cat([lane[:, :, :-1, :2], lane[:, :, 1:, :2], lane[:, :, 1:, 2:]], dim=-1)
        lane_valid_len = self.lane_valid_len
        lane_mask = torch.zeros((self.B, 1, int(self.max_lane_num))).to(lane_v.device)
        for i in range(lane_valid_len.shape[0]):
            lane_mask[i, 0, :lane_valid_len[i]] = 1
        lane_feature = self.subgraph(lane_v)
        return (lane_feature, lane_mask)

    def forward(self, data: dict):
        self.B = data['HISTORY'].shape[0]
        self.traj_valid_len = data['VALID_LEN'][:, 0]
        self.max_agent_num = torch.max(self.traj_valid_len)
        self.lane_valid_len = data['VALID_LEN'][:, 1]
        self.max_lane_num = torch.max(self.lane_valid_len)
        pos = data['POS']
        trajs = data['HISTORY']
        social_mask = self.preprocess_traj(data['HISTORY'])
        lane_enc, lane_mask = self.preprocess_lane(data['LANE'])
        out = self.stacked_transformer(trajs, pos, self.max_agent_num, social_mask, lane_enc, lane_mask)
        return out

INIT_ARGS = {
    'stacked_transformer': DummyTransformer,
    'cfg': {
        'lane_channels': 7,
        'in_channels': 4,
        'subgraph_width': 8,
        'num_subgraph_layres': 2,
        'future_num_frames': 6,
        'history_num_frames': 20,
        'lane_length': 10,
    }
}

ARGS = {
    'data': {
        'HISTORY': torch.randn(2, 3, 19, 4),
        'POS': torch.randn(2, 3, 2),
        'LANE': torch.randn(2, 4, 10, 5),
        'VALID_LEN': torch.tensor([[3, 4], [3, 4]], dtype=torch.long),
    }
}
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 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

Predicting multiple plausible future trajectories of the nearby vehicles is crucial for the safety of autonomous driving. Recent motion prediction approaches attempt to achieve such multimodal motion prediction by implicitly regularizing the feature or explicitly generating multiple candidate proposals. However, it remains challenging since the latent features may concentrate on the most frequent mode of the data while the proposal-based methods depend largely on the prior knowledge to generate and select the proposals. In this work, we propose a novel transformer framework for multimodal motion prediction, termed as mmTransformer. A novel network architecture based on stacked transformers is designed to model the multimodality at feature level with a set of fixed independent proposals. A region-based training strategy is then developed to induce the multimodality of the generated proposals. Experiments on Argoverse dataset show that the proposed model achieves the state-of-the-art performance on motion prediction, substantially improving the diversity and the accuracy of the predicted trajectories. Demo video and code are available at https://decisionforce. github.io/mmTransformer.

For agents

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

get_harvested_code_for_paper("2103.11624")
get_code_for_paper("2103.11624")
have("2103.11624")

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

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

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

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

Connect an agent — have() is free.