SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.00172 · ICML · 2023

Learning for Edge-Weighted Online Bipartite Matching with Robustness Guarantees

Jianyi Yang, Shaolei Ren, Pengfei Li

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 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; 2 no recorded run), measured 2026-11-23; 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/2306.00172.json · badge: /api/ran/2306.00172.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
ren-research/lomar canonical (classifier label)
classifier basis: classifier_2025
3 ran · 2 no recorded run
FunctionStatusWhere it lives
GraphAttentionEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
ren-research/lomar/policy/gnn_hist.py
code served (permissive licence) · get_code("c034ee0e1aebf879")
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 an instance of its own class, GraphAttentionEncoder: the run constructed the object and did not call it, so no result was computed. 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 torch import nn
import torch.nn.functional as F

torch.manual_seed(0)

# Stand-in class for opts that provides u_size attribute
class OptsStandIn:
    def __init__(self):
        self.u_size = 2

# Create a small stand-in problem object
class ProblemStandIn:
    def __init__(self):
        self.name = "test_problem"

# Construct input tensor
# batch_size=2, graph_size=5, embed_dim=4
batch_size = 2
graph_size = 5
embed_dim = 4
n_heads = 2

x = torch.randn(batch_size, graph_size, embed_dim)

# Create adjacency matrix (graph_size x graph_size)
# For GAT, adj is used as a mask where adj[i,j] = True means no edge
adj = torch.zeros(graph_size, graph_size, dtype=torch.bool)
# Set some edges as False (connected nodes)
adj[0, 1] = False
adj[1, 0] = False
adj[0, 2] = False

# Create weights tensor
# Used in forward as weights.float().unsqueeze(3)
# Shape should be compatible with the computation
u = 3  # u_size + 1 = 2 + 1
v = graph_size - u  # 5 - 3 = 2
weights = torch.randn(batch_size, u, v, 1)

# Create opts object
opts = OptsStandIn()

# Create problem object
problem = ProblemStandIn()

# Construct ARGS dictionary with all parameters for GraphAttentionEncoder
ARGS = {
    "n_heads": n_heads,
    "embed_dim": embed_dim,
    "n_layers": 2,
    "problem": problem,
    "opts": opts,
    "dropout": 0.1,
    "alpha": 0.01,
    "node_dim": 1,
    "normalization": "batch",
    "feed_forward_hidden": 512
}
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 GraphAttentionEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphAttentionEncoder 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
GraphAttentionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
ren-research/lomar/policy/gnn_hist.py
code served (permissive licence) · get_code("1e0a32bd5e09cc68")
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 an instance of its own class, GraphAttentionLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

# Create a small stand-in opts class that has u_size attribute
class Opts:
    def __init__(self, u_size):
        self.u_size = u_size

# Set up dimensions
batch_size = 2
in_features = 4
out_features = 3
u_size = 2  # number of U nodes
v_size = 1  # number of V nodes
graph_size = u_size + v_size  # total nodes = 3
dropout = 0.2
alpha = 0.2

# Create input tensors
# h shape: (batch_size, graph_size, in_features)
h = torch.randn(batch_size, graph_size, in_features)

# adj shape: (batch_size, graph_size, graph_size) - boolean adjacency matrix
adj = torch.zeros(batch_size, graph_size, graph_size, dtype=torch.bool)
adj[0, 0, 1] = True
adj[1, 1, 2] = True

# weights - can be any tensor, seems to be unused in forward pass
weights = torch.randn(batch_size, graph_size)

# Create opts with u_size
opts = Opts(u_size=u_size)

# Construct the ARGS dictionary with all parameters
ARGS = {
    'opts': opts,
    'in_features': in_features,
    'out_features': out_features,
    'dropout': dropout,
    'alpha': alpha,
    'concat': 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 GraphAttentionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphAttentionLayer 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
MultiHeadAttentionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
ren-research/lomar/policy/gnn_hist.py
code served (permissive licence) · get_code("920be8d8cd13257f")
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 an instance of its own class, MultiHeadAttentionLayer: the run constructed the object and did not call it, so no result was computed. 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 torch import Tensor

torch.manual_seed(0)

# Create a minimal opts object with required attributes
class OptsStub:
    def __init__(self):
        self.u_size = 2

opts = OptsStub()

# Set up dimensions
batch_size = 2
n_heads = 3
embed_dim = 4
u_size = opts.u_size + 1  # 3
v_size = 2
total_nodes = u_size + v_size  # 5

# Create input tensor: (batch_size, n_heads, total_nodes, embed_dim)
x = torch.randn(batch_size, n_heads, total_nodes, embed_dim)

# Create adjacency matrix
# Shape: (batch_size, total_nodes, total_nodes) for masking in forward
adj = torch.zeros(batch_size, total_nodes, total_nodes, dtype=torch.bool)
# Mark some positions as True (these will be masked with -9e15 in forward)
adj[0, 0, 1] = True
adj[1, 2, 3] = True

# Create weights tensor
weights = torch.randn(batch_size, total_nodes)

# Problem parameter (appears in signature but not used in body)
problem = "test_problem"

ARGS = {
    "opts": opts,
    "n_heads": n_heads,
    "embed_dim": embed_dim,
    "problem": problem,
    "dropout": 0.1,
    "alpha": 0.01,
    "node_dim": None,
    "normalization": "batch",
    "feed_forward_hidden": 512,
}

# For forward pass, we'd call:
# layer = MultiHeadAttentionLayer(**ARGS)
# output = layer(x, adj, weights)
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 MultiHeadAttentionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiHeadAttentionLayer 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
GNNHist Not yet run
unverified (harvested, no recorded run)
ren-research/lomar/policy/gnn_hist.py
code served (permissive licence) · get_code("16ef43417ef04fd2")
How it ran

no invocation recorded.

MPNN Not yet run
unverified (harvested, no recorded run)
ren-research/lomar/policy/gnn_hist.py
code served (permissive licence) · get_code("bb8ec591ce7c1725")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 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.

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

Many problems, such as online ad display, can be formulated as online bipartite matching. The crucial challenge lies in the nature of sequentiallyrevealed online item information, based on which we make irreversible matching decisions at each step. While numerous expert online algorithms have been proposed with bounded worst-case competitive ratios, they may not offer satisfactory performance in average cases. On the other hand, reinforcement learning (RL) has been applied to improve the average performance, but it lacks robustness and can perform arbitrarily poorly. In this paper, we propose a novel RL-based approach to edge-weighted online bipartite matching with robustness guarantees (LOMAR), achieving both good average-case and worst-case performance. The key novelty of LOMAR is a new online switching operation which, based on a judicious condition to hedge against future uncertainties, decides whether to follow the expert's decision or the RL decision for each online item. We prove that for any ρ ∈ [0, 1], LOMAR is ρ-competitive against any given expert online algorithm. To improve the average performance, we train the RL policy by explicitly considering the online switching operation. Finally, we run empirical experiments to demonstrate the advantages of LOMAR compared to existing baselines. Our code is available

For agents

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

get_harvested_code_for_paper("2306.00172")
get_code_for_paper("2306.00172")
have("2306.00172")

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

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

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

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

Connect an agent — have() is free.