SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.18137 · ICML · 2024

DecisionNCE: Embodied Multimodal Representations via Implicit Preference Learning

Jingjing Liu, Sijie Cheng, Yu Liu, Haoyi Niu, Xianyuan Zhan, Ya-Qin Zhang, Jianxiong Li, Liyuan Mao, Xiao Hu, Yinan Zheng, K Chen, Jinliang Zheng, and 4 more

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 1 has no contract verdict; 2 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/2402.18137.json · badge: /api/ran/2402.18137.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
2toinf/DecisionNCE canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
DecisionNCELoss Ran
ran on a synthesized input
2toinf/DecisionNCE/DecisionNCE/losses.py
code served (permissive licence) · get_code("5cb20bf7ea19ead0")
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 0, 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 DecisionNCELoss.__init__
INIT_ARGS = {
    'logit_scale': 100,
    'loss_type': 'DecisionNCE-T'
}

# ARGS for DecisionNCELoss.forward
# visual_features: shape (batch_size, num_frames, feature_dim)
# text_features: shape (batch_size, feature_dim)
batch_size = 2
num_frames = 6  # Need at least 2 frames for chunking in DecisionNCE-P, more for temporal differences
feature_dim = 4

visual_features = torch.randn(batch_size, num_frames, feature_dim)
text_features = torch.randn(batch_size, feature_dim)

ARGS = {
    'visual_features': visual_features,
    'text_features': text_features
}
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 0, 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)
get_reward_matrix_P Ran
ran; our contract draft was wrong, not the code
2toinf/DecisionNCE/DecisionNCE/losses.py
code served (permissive licence) · get_code("1a95e67d3a627b8a")
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 1, dtype family float, shape (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)

# Analyze the function:
# - p_e_s: transposed to (1, 0), then normalized on dim=-1, then used in @ with p_e_text.t()
#   After transpose(0,1), shape should be (seq_len, embedding_dim)
#   So original p_e_s should be (embedding_dim, seq_len)
# - p_e_text: normalized on dim=-1, then transposed in @
#   Shape should be (num_texts, embedding_dim)
# - frame_logits: result of @ operation, shape (seq_len, num_texts)
# - torch.chunk(frame_logits, 2, dim=0): splits along dim 0, so seq_len must be even
# - logit_scale: float, default 100.0

# Let's use:
# - embedding_dim = 4
# - seq_len = 4 (even, so can be chunked into 2)
# - num_texts = 3

embedding_dim = 4
seq_len = 4
num_texts = 3

# p_e_s shape: (embedding_dim, seq_len) = (4, 4)
p_e_s = torch.randn(embedding_dim, seq_len)

# p_e_text shape: (num_texts, embedding_dim) = (3, 4)
p_e_text = torch.randn(num_texts, embedding_dim)

# logit_scale: float
logit_scale = 100.0

ARGS = {
    "p_e_s": p_e_s,
    "p_e_text": p_e_text,
    "logit_scale": logit_scale,
}
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 1, dtype family float, shape (3,) — shape (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
get_reward_matrix_T Ran
ran; our contract draft was wrong, not the code
2toinf/DecisionNCE/DecisionNCE/losses.py
code served (permissive licence) · get_code("520ff973e7deca7e")
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 (3, 5) 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)

# p_e_s: tensor that gets transposed (0, 1), then indexed [1:] and [:-1]
# After transpose, shape should be (seq_len, batch_size, embedding_dim)
# We need at least 2 in first dim to compute diff
# Let's use shape (3, 2, 4) so after transpose it's (2, 3, 4)
# Then diff will be (1, 2, 4)
p_e_s = torch.randn(3, 2, 4)

# p_e_text: tensor that gets normalized and used in matrix multiplication
# diff @ p_e_text.t() means p_e_text should have shape (num_texts, embedding_dim)
# Let's use (5, 4) so p_e_text.t() is (4, 5)
# Then (1, 2, 4) @ (4, 5) = (1, 2, 5)
p_e_text = torch.randn(5, 4)

# logit_scale: scalar float
logit_scale = 100.0

ARGS = {
    "p_e_s": p_e_s,
    "p_e_text": p_e_text,
    "logit_scale": logit_scale,
}
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 (3, 5) — shape (3, 5) 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

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

Multimodal pretraining is an effective strategy for the trinity of goals of representation learning in autonomous robots: 1) extracting both local and global task progressions; 2) enforcing temporal consistency of visual representation; 3) capturing trajectory-level language grounding. Most existing methods approach these via separate objectives, which often reach sub-optimal solutions. In this paper, we propose a universal unified objective that can simultaneously extract meaningful task progression information from image sequences and seamlessly align them with language instructions. We discover that via implicit preferences, where a visual trajectory inherently aligns better with its corresponding language instruction than mismatched pairs, the popular Bradley-Terry model can transform into representation learning through proper reward reparameterizations. The resulted framework, Decision-NCE, mirrors an InfoNCE-style objective but is distinctively tailored for decision-making tasks, providing an embodied representation learning framework that elegantly extracts both local and global task progression features, with temporal consistency enforced through implicit time contrastive learning, while ensuring trajectory-level instruction grounding via multimodal joint encoding. Evaluation on both simulated and real robots demonstrates that DecisionNCE effectively facilitates diverse downstream policy learning tasks, offering a versatile solution for unified representation and reward learning. Project

For agents

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

get_harvested_code_for_paper("2402.18137")
get_code_for_paper("2402.18137")
have("2402.18137")

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

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

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

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

Connect an agent — have() is free.