SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.16987 · 2026

Twisted Schrödinger Bridge Matching

Alain Durmus, Eric Moulines, Mbzuai, Maxence Noble, Polytechnique, Yazid Janati, Marie Scheid, Ecole Cmap

arXiv · PDF · Open in the Atlas

Code that ran

10 of 16 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2607.16987.json · badge: /api/ran/2607.16987.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
maxencenoble/twisted-sb-matching canonical (classifier label)
classifier basis: census
10 ran · 6 no recorded run
FunctionStatusWhere it lives
build_loss_fn Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/spline/gaussian_path.py
code served (permissive licence) · get_code("dd8e2f4a0d7f1fed")
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 function. 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)

# Define a minimal V module that satisfies the function's usage
class ValueFunction(nn.Module):
    def __init__(self, K=None):
        super().__init__()
        self.K = K if K is not None else 5
        self.linear = nn.Linear(4, 1)
    
    def forward(self, x, index, cond_sampler=None):
        # x shape: (B, N, T, D) or (B, N, K, D)
        # index shape: (T,) or (K,)
        # Returns shape that can be viewed as (B, N, T) or (B, N, K)
        B, N, T_or_K, D = x.shape
        x_flat = x.view(B * N * T_or_K, D)
        out = self.linear(x_flat)
        return out.view(B, N, T_or_K)

# Define a minimal gpath (cond_sampler) - just needs to be callable or None
class GPath:
    def __call__(self, *args, **kwargs):
        return None

# Create instances
gpath = GPath()

# Continuous setting case
V_continuous = ValueFunction()

# Discrete setting case with K attribute
V_discrete = ValueFunction(K=5)

# Create ARGS for continuous setting (discrete_setting=None)
ARGS = {
    "gpath": gpath,
    "V": V_continuous,
    "discrete_setting": None,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
build_obstacle_cost Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/state_cost.py
code served (permissive licence) · get_code("be8877f51771fc92")
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 function. 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 math

torch.manual_seed(0)

ARGS = {
    'name': 'gmm'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
get_fig_axes Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/runners/plotters.py
code served (permissive licence) · get_code("faabf84d7b2b7cf9")
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 matplotlib.pyplot as plt

ARGS = {
    "ncol": 2,
    "nrow": 3,
    "ax_length_in": 0.5,
    "lim_x_up": 10.0,
    "lim_x_down": 0.0,
    "lim_y_up": 20.0,
    "lim_y_down": 5.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib — 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_sde_timesteps Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/sde/diffusion_bridge.py
code served (permissive licence) · get_code("ad5509fb21738b18")
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

torch.manual_seed(0)

ARGS = {
    't_final': 1.0,
    'num_steps': 10,
    'eps': 0.01,
    'device': 'cpu'
}
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, 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
get_state_dict Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/models/utils.py
code served (permissive licence) · get_code("5488cb5833c722ed")
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 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 torch
import torch.nn as nn
from collections import OrderedDict

torch.manual_seed(0)

# Create a sample state dict with 'module.' prefix (as would come from DataParallel)
state_dict = OrderedDict()
state_dict['module.layer1.weight'] = torch.randn(4, 3)
state_dict['module.layer1.bias'] = torch.randn(4)
state_dict['module.layer2.weight'] = torch.randn(5, 4)
state_dict['regular_key'] = torch.randn(2, 2)

ARGS = {
    'state_dict': state_dict
}
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 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
get_timestep_embedding Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/models/basic/time_embedding.py
code served (permissive licence) · get_code("668ce6544d96ba67")
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 math

torch.manual_seed(0)

ARGS = {
    "timesteps": torch.tensor([[0], [5]], dtype=torch.float32),
    "embedding_dim": 4,
    "max_period": 10000,
}
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
kaiming_uniform_zeros_ Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/models/utils.py
code served (permissive licence) · get_code("dffbfb0a413afade")
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 (4, 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
import torch.nn as nn
import math

torch.manual_seed(0)

init_weight_scale = 1e-06

def kaiming_uniform_zeros_(m):
    return torch.nn.init.kaiming_uniform_(m, a=math.sqrt(6.0 / init_weight_scale ** 2 - 1))

# The function expects a tensor or a module with a weight tensor
# kaiming_uniform_ modifies a tensor in-place, so we create a simple tensor
test_tensor = torch.empty(4, 3)

ARGS = {
    "m": test_tensor
}
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 (4, 3) — shape (4, 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
obstacle_cfg_gmm Ran
ran, honoured the contract we drafted
maxencenoble/twisted-sb-matching/bridge/state_cost.py
code served (permissive licence) · get_code("a501154ff2546c57")
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 2, 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 numpy as np

ARGS = {
    "dim": 2
}
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 list, ndim 2, 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
obstacle_cost_gmm Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/state_cost.py
code served (permissive licence) · get_code("05a3f85278929053")
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 (2,) 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

torch.manual_seed(0)

# Create a small tensor with batch size 2 and dimension 4
# Shape: (batch_size=2, dim=4)
xt = torch.randn(2, 4, dtype=torch.float32)

# Define ARGS with all parameters of obstacle_cost_gmm
ARGS = {
    "xt": xt,
    "mult_const": 2000.0,
    "scale_x": 1.5,
    "scale_y": 1.5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
save_fig Ran
ran; our contract draft was wrong, not the code
maxencenoble/twisted-sb-matching/bridge/runners/plotters.py
code served (permissive licence) · get_code("cc1e7a959444f42c")
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 os
import matplotlib.pyplot as plt
import tempfile

# Create a temporary directory for saving figures
temp_dir = tempfile.mkdtemp()

# Create a simple plot to have something to save
plt.figure(figsize=(4, 3))
plt.plot([1, 2, 3], [1, 2, 3])
plt.title("Test Plot")

ARGS = {
    'save_dir': temp_dir,
    'name': 'test_figure',
    'pdf': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib — 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
build_optim Not yet run
unverified (harvested, no recorded run)
maxencenoble/twisted-sb-matching/bridge/spline/gaussian_path.py
code served (permissive licence) · get_code("bd109c55b67dad8e")
How it ran

no invocation recorded.

fit Not yet run
unverified (harvested, no recorded run)
maxencenoble/twisted-sb-matching/bridge/spline/gaussian_path.py
code served (permissive licence) · get_code("2a6ce05c38a2af82")
How it ran

no invocation recorded.

get_colors Not yet run
unverified (harvested, no recorded run)
maxencenoble/twisted-sb-matching/bridge/runners/plotters.py
code served (permissive licence) · get_code("241ac1670aa7bf23")
How it ran

no invocation recorded.

get_plotter Not yet run
unverified (harvested, no recorded run)
maxencenoble/twisted-sb-matching/bridge/runners/config_getters.py
code served (permissive licence) · get_code("36bd6632d92f749a")
How it ran

no invocation recorded.

get_score_model Not yet run
unverified (harvested, no recorded run)
maxencenoble/twisted-sb-matching/bridge/runners/config_getters.py
code served (permissive licence) · get_code("ac6be51c4c0f60f3")
How it ran

no invocation recorded.

get_state_cost Not yet run
unverified (harvested, no recorded run)
maxencenoble/twisted-sb-matching/bridge/runners/config_getters.py
code served (permissive licence) · get_code("d95cdeee338460b3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 14 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
build_optim 1 other paper
1 dated earlier
2310.02233 (2023-10)
Generalized Schrödinger Bridge Matching
kaiming_uniform_zeros_ 1 other paper
1 dated earlier
2601.21026 (2026-01)
Diffusion-based Annealed Boltzmann Generators : benefits, pitfalls and hopes

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-23.

Repositories linked to this paper

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

Abstract

Over the past few years, diffusion-based Schrödinger bridge models have been proposed to approximate optimal transport dynamics between two prescribed boundary distributions, with successful applications to generative modeling. More precisely, these methods aim to estimate a path measure whose initial and terminal marginals match the two boundary distributions, while minimizing the Kullback-Leibler divergence with respect to a reference Markov process. In this work, we consider the generalized Schrödinger bridge problem, in which the reference process is a twisted Brownian motion, that is, a Feynman-Kac transform of a Brownian motion induced by a time-dependent differentiable potential. Building on the Iterative Markovian Fitting (IMF) paradigm, and in particular on its special case Diffusion Schrödinger Bridge Matching (DSBM), which corresponds to the zero potential case, we introduce Twisted Schrödinger Bridge Matching (TSBM), a diffusion-based method designed to handle both continuous-and discrete-time potentials. Unlike previous approaches, TSBM provides a rigorous extension of the IMF scheme to the generalized Schrödinger bridge problem. This derivation leads to a new bridge-matching loss that depends explicitly on the gradient of the potential and recovers the DSBM objective when the potential vanishes, yielding improved performance. We further introduce trajectory-based variance-reduction techniques that substantially stabilize optimization and may be useful beyond the present setting. Finally, we empirically demonstrate the benefits of TSBM for trajectory inference across increasingly high-dimensional settings, including crowd navigation and single-cell data. Code available at https://github.com/maxencenoble/twisted-sb-matching.

For agents

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

get_harvested_code_for_paper("2607.16987")
get_code_for_paper("2607.16987")
have("2607.16987")

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

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

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

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

Connect an agent — have() is free.