SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.15212 · NeurIPS · 2020

Hybrid Models for Learning to Branch

Yoshua Bengio, Prateek Gupta, Maxime Gasse, Elias Khalil, M Pawan Kumar, Andrea Lodi

arXiv · PDF · Open in the Atlas

Code that ran

5 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 11 no recorded run), measured 2026-11-21; 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/2006.15212.json · badge: /api/ran/2006.15212.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
pg2455/hybrid-learn2branch canonical (classifier label)
classifier basis: classifier_2025
4 ran · 3 no recorded run
pg2455/Hybrid-learn2branch canonical (classifier label)
classifier basis: census
1 ran · 8 no recorded run
FunctionStatusWhere it lives
BaseModel Ran
ran on a synthesized input · constructed an object; no result was computed
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("32a993f121a70da5")
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, BaseModel: 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

torch.manual_seed(0)

# BaseModel doesn't take any __init__ parameters based on the code shown
# It only has methods, no __init__ that takes arguments
# So ARGS should be empty dict since BaseModel() is instantiated with no args

ARGS = {}
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 BaseModel — 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 BaseModel 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
BipartiteGraphConvolution Ran
ran on a synthesized input · constructed an object; no result was computed
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("5953c5ecd35e3c6c")
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, BipartiteGraphConvolution: 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

torch.manual_seed(0)

# Define a simple activation function
activation = nn.ReLU()

# Define a simple initializer (callable that initializes weights)
def initializer(tensor):
    nn.init.xavier_uniform_(tensor)

# Create an instance of BipartiteGraphConvolution to understand its constructor
emb_size = 4
bgc = nn.Module()  # placeholder

# Now construct the ARGS dict for BipartiteGraphConvolution.__init__
ARGS = {
    'emb_size': 4,
    'activation': nn.ReLU(),
    'initializer': initializer,
    'right_to_left': False,
}
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 BipartiteGraphConvolution — 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 BipartiteGraphConvolution 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
MLP Ran
ran on a synthesized input · constructed an object; no result was computed
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("1405c5b3fe3c07a3")
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, MLP: 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

torch.manual_seed(0)

class MLP(nn.Module):

    def __init__(self, in_size, out_size, activation):
        super(MLP, self).__init__()
        self.out = nn.Linear(in_size, out_size, bias=True)
        self.activation = activation

    def forward(self, input, betagamma):
        x = self.activation(self.out(input))
        x = x * betagamma[:, 0] + betagamma[:, 1]
        return x


# Set up arguments
in_size = 4
out_size = 3
activation = nn.ReLU()

ARGS = {
    'in_size': in_size,
    'out_size': out_size,
    'activation': activation
}
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 MLP — 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 MLP 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
PreNormLayer Ran
ran on a synthesized input · constructed an object; no result was computed
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("5262341c42986c96")
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, PreNormLayer: 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

torch.manual_seed(0)

# The PreNormLayer.__init__ takes these parameters:
# - n_units: int specifying the number of units
# - shift: bool, whether to use shift parameter (default True)
# - scale: bool, whether to use scale parameter (default True)

ARGS = {
    'n_units': 4,
    'shift': True,
    'scale': 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 PreNormLayer — 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 PreNormLayer 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
load_batch_gcnn_minimal Ran
ran on a synthesized input
pg2455/Hybrid-learn2branch/utilities_hybrid.py
code served (permissive licence) · get_code("62ce4a248978c550")
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. 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 numpy as np
import torch

torch.manual_seed(0)

# Create constraint features for 2 samples
c_features_sample1 = np.random.randn(3, 4).astype(np.float32)  # 3 constraints, 4 features
c_features_sample2 = np.random.randn(2, 4).astype(np.float32)  # 2 constraints, 4 features
c_features = [c_features_sample1, c_features_sample2]

# Create variable features for 2 samples
v_features_sample1 = np.random.randn(5, 4).astype(np.float32)  # 5 variables, 4 features
v_features_sample2 = np.random.randn(4, 4).astype(np.float32)  # 4 variables, 4 features
v_features = [v_features_sample1, v_features_sample2]

# Create edge indices for 2 samples
# Each edge index is shape (2, num_edges) with constraint and variable indices
e_indices_sample1 = np.array([[0, 1, 2], [0, 1, 2]], dtype=np.int64)  # 3 edges
e_indices_sample2 = np.array([[0, 1], [1, 2]], dtype=np.int64)  # 2 edges
e_indices = [e_indices_sample1, e_indices_sample2]

# Create edge features for 2 samples
e_features_sample1 = np.random.randn(3, 4).astype(np.float32)  # 3 edges, 4 features
e_features_sample2 = np.random.randn(2, 4).astype(np.float32)  # 2 edges, 4 features
e_features = [e_features_sample1, e_features_sample2]

# Create candidates for 2 samples
candss_sample1 = np.array([0, 2, 4], dtype=np.int64)  # 3 candidates
candss_sample2 = np.array([1, 3], dtype=np.int64)  # 2 candidates
candss = [candss_sample1, candss_sample2]

# Create batch tuple
batch = (c_features, e_indices, e_features, v_features, candss)

ARGS = {
    "batch": batch
}
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 — a list 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
GCNPolicy Not yet run
unverified (harvested, no recorded run)
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("87f6886035ac0757")
How it ran

no invocation recorded.

Policy Not yet run
unverified (harvested, no recorded run)
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("2d9532467e473d7e")
How it ran

no invocation recorded.

PreNormException Not yet run
unverified (harvested, no recorded run)
pg2455/hybrid-learn2branch/models/film/model.py
code served (permissive licence) · get_code("4c335c2ac6bd0f5e")
How it ran

no invocation recorded.

load_batch Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/utilities_hybrid.py
code served (permissive licence) · get_code("01d962ccce151759")
How it ran

no invocation recorded.

pretrain Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/03_train_hybrid.py
code served (permissive licence) · get_code("8a1bc164bad6b1ee")
How it ran

no invocation recorded.

pretrain Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/03_train_gcnn_torch.py
code served (permissive licence) · get_code("8ec2bdad43e420bf")
How it ran

no invocation recorded.

process Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/04_test_hybrid.py
code served (permissive licence) · get_code("e6ac98604045bf21")
How it ran

no invocation recorded.

process Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/03_train_gcnn_torch.py
code served (permissive licence) · get_code("df842ea8c5a19e80")
How it ran

no invocation recorded.

process Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/03_train_mlp.py
code served (permissive licence) · get_code("6bba154b3f9e639b")
How it ran

no invocation recorded.

process Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/04_test_gcnn_torch.py
code served (permissive licence) · get_code("ce3326ede28ef913")
How it ran

no invocation recorded.

process Not yet run
unverified (harvested, no recorded run)
pg2455/Hybrid-learn2branch/04_test_mlp.py
code served (permissive licence) · get_code("b24e2eb594f07e54")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 15 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
PreNormException
brick of this paper's assembly: helper
1 other paper
1 later
2201.10328 (2022-01)
ML4CO-KIDA: Knowledge Inheritance in Dataset Aggregation

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

Repositories linked to this paper

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

Abstract

A recent Graph Neural Network (GNN) approach for learning to branch has been shown to successfully reduce the running time of branch-and-bound (B&B) algorithms for Mixed Integer Linear Programming (MILP). While the GNN relies on a GPU for inference, MILP solvers are purely CPU-based. This severely limits its application as many practitioners may not have access to high-end GPUs. In this work, we ask two key questions. First, in a more realistic setting where only a CPU is available, is the GNN model still competitive? Second, can we devise an alternate computationally inexpensive model that retains the predictive power of the GNN architecture? We answer the first question in the negative, and address the second question by proposing a new hybrid architecture for efficient branching on CPU machines. The proposed architecture combines the expressive power of GNNs with computationally inexpensive multi-layer perceptrons (MLP) for branching. We evaluate our methods on four classes of MILP problems, and show that they lead to up to 26% reduction in solver running time compared to state-of-the-art methods without a GPU, while extrapolating to harder problems than it was trained on. The code for this project is publicly available at https: //github.com/pg2455/Hybrid-learn2branch.

For agents

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

get_harvested_code_for_paper("2006.15212")
get_code_for_paper("2006.15212")
have("2006.15212")

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

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

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

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

Connect an agent — have() is free.