SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.04538 · ICML · 2024

Triplet Interaction Improves Graph Transformers: Accurate Molecular Graph Learning with Triplet Graph Transformers

Mohammed Zaki, Shamim Hussain, Dharmashankar Subramanian

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 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; 9 failures of our instrument; 3 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.04538.json · badge: /api/ran/2402.04538.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
shamim-hussain/tgt canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
shamim-hussain/egt_pytorch community
Papers with Code archive
1 ran · 0 no recorded run
shamim-hussain/egt_triangular community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
EGT_Layer Ran
ran on a synthesized input · constructed an object; no result was computed
shamim-hussain/egt_pytorch/lib/models/egt_layers.py
code served (permissive licence) · get_code("3769fc037188340a")
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, EGT_Layer: 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)

ARGS = {
    "node_width": 8,
    "edge_width": 4,
    "num_heads": 2,
    "node_mha_dropout": 0.1,
    "edge_mha_dropout": 0.1,
    "node_ffn_dropout": 0.1,
    "edge_ffn_dropout": 0.1,
    "attn_dropout": 0.1,
    "attn_maskout": 0.1,
    "activation": "elu",
    "clip_logits_value": [-5, 5],
    "node_ffn_multiplier": 2.0,
    "edge_ffn_multiplier": 2.0,
    "scale_dot": True,
    "scale_degree": False,
    "node_update": True,
    "edge_update": 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 EGT_Layer — 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 EGT_Layer 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
form_degree_scalers Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shamim-hussain/tgt/lib/tgt/layers/layers.py
code served (permissive licence) · get_code("b18a7da4ce171c3d")
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 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

torch.manual_seed(0)

# The function expects a tensor with 3 dimensions
# It sums along dim=2, so we need at least 3 dimensions
# Shape: (batch_size, feature_dim, gates_dim)
# Using distinct sizes: batch=2, features=4, gates=3
gates = torch.randn(2, 4, 3)

ARGS = {
    "gates": gates
}
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 3, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
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
geglu Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shamim-hussain/tgt/lib/tgt/layers/activations.py
code served (permissive licence) · get_code("46e9996c80897eae")
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; 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.functional as F

torch.manual_seed(0)

# The geglu function takes a tensor x and chunks it into 2 parts along the last dimension
# It applies gelu to one part and multiplies with the other
# So we need a tensor with even last dimension size

x = torch.randn(2, 8)  # batch_size=2, last_dim=8 (even, so can chunk into 2 parts of 4 each)

ARGS = {
    "x": x
}
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 — no output shape is stated: observe_signature.py could not observe it (import:OSError)
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
glu Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shamim-hussain/tgt/lib/tgt/layers/activations.py
code served (permissive licence) · get_code("ba1213011ced7cc9")
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; 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)

# The function takes a single tensor x as input
# It chunks x into two equal parts along the last dimension
# So x should have an even last dimension

# Create a small tensor with batch size 2, and last dimension 4 (which chunks into 2+2)
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 — no output shape is stated: observe_signature.py could not observe it (import:OSError)
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
import_scheme Ran
ran; our contract draft was wrong, not the code
shamim-hussain/tgt/lib/training/execute.py
code served (permissive licence) · get_code("99444cf6f6c68f14")
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 type. 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 importlib
from unittest.mock import MagicMock, patch
import sys

torch.manual_seed(0)

# Create a mock module structure for the import to work
mock_scheme_module = MagicMock()

# Create a mock SCHEME class
class MockSCHEME:
    def __init__(self):
        pass

mock_scheme_module.SCHEME = MockSCHEME

# Mock the lib.training_schemes.{scheme_name} module
sys.modules['lib'] = MagicMock()
sys.modules['lib.training_schemes'] = MagicMock()
sys.modules['lib.training_schemes.example_scheme'] = mock_scheme_module

ARGS = {
    'scheme_name': 'example_scheme'
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
safe_load Ran
ran; our contract draft was wrong, not the code
shamim-hussain/tgt/lib/training/config.py
code served (permissive licence) · get_code("76cce8eb1d1df68c")
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 dict. 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 tempfile
import os
import yaml

# Create a temporary YAML file with valid content
temp_dir = tempfile.mkdtemp()
yaml_file = os.path.join(temp_dir, "test.yaml")

# Write valid YAML content to the temporary file
yaml_content = {
    "model": "test_model",
    "learning_rate": 0.001,
    "batch_size": 32,
    "layers": [1, 2, 3]
}

with open(yaml_file, 'w') as f:
    yaml.dump(yaml_content, f)

# Define ARGS dict with all required parameters
ARGS = {
    "file_name": yaml_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
safe_load_str Ran
ran; our contract draft was wrong, not the code
shamim-hussain/tgt/lib/training/config.py
code served (permissive licence) · get_code("600b01d18d7e780d")
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 dict. 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 yaml
from yaml import SafeLoader as yaml_Loader, SafeDumper as yaml_Dumper

# The function takes a string parameter and optional kwargs
# yaml.load() will parse YAML content from the string
# We need to provide a valid YAML string as input

yaml_string = """
key1: value1
key2: 42
key3:
  nested: true
  items:
    - one
    - two
    - three
"""

ARGS = {
    "string": yaml_string,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
siglin Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shamim-hussain/tgt/lib/tgt/layers/triplet.py
code served (permissive licence) · get_code("9c6fd2a384f6f803")
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; 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)

# The function siglin takes two parameters: gates and lins
# It applies sigmoid to gates and multiplies element-wise with lins
# Both should be tensors of compatible shapes

gates = torch.randn(2, 4)
lins = torch.randn(2, 4)

ARGS = {
    "gates": gates,
    "lins": lins,
}
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 — no output shape is stated: observe_signature.py could not observe it (import:OSError)
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
str_presenter Ran
ran; our contract draft was wrong, not the code
shamim-hussain/tgt/lib/training/config.py
code served (permissive licence) · get_code("ec3a6e8533e97e72")
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 yaml

class MockDumper:
    def represent_scalar(self, tag, data, style=None):
        return f"{tag}:{data}:{style}"

dumper = MockDumper()

single_line_data = "hello world"
multi_line_data = "line1\nline2\nline3"

ARGS = {
    "dumper": dumper,
    "data": multi_line_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — 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
swiglu Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shamim-hussain/tgt/lib/tgt/layers/activations.py
code served (permissive licence) · get_code("c724368b1b6a04e0")
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; 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)

# The function swiglu takes a tensor x, chunks it in half along the last dimension,
# and applies the SwiGLU activation: e * sigmoid(g) * g
# We need to provide a tensor with an even number of features in the last dimension

x = torch.randn(2, 8)  # batch size 2, 8 features (will be chunked into 2x4)

ARGS = {
    "x": x
}
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 — no output shape is stated: observe_signature.py could not observe it (import:OSError)
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
TripletAttention Not yet run
unverified (harvested, no recorded run)
shamim-hussain/egt_triangular/lib/tgt/layers/triplet.py
code served (permissive licence) · get_code("ad3053a477c51b49")
How it ran

no invocation recorded.

get_configs_from_args Not yet run
unverified (harvested, no recorded run)
shamim-hussain/tgt/lib/training/execute.py
code served (permissive licence) · get_code("923e416970ed8684")
How it ran

no invocation recorded.

get_triplet_layer Not yet run
unverified (harvested, no recorded run)
shamim-hussain/tgt/lib/tgt/layers/triplet.py
code served (permissive licence) · get_code("3fe477d09a32f159")
How it ran

no invocation recorded.

Also present in other papers' code

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

Graph transformers typically lack third-order interactions, limiting their geometric understanding which is crucial for tasks like molecular geometry prediction. We propose the Triplet Graph Transformer (TGT) that enables direct communication between pairs within a 3-tuple of nodes via novel triplet attention and aggregation mechanisms. TGT is applied to molecular property prediction by first predicting interatomic distances from 2D graphs and then using these distances for downstream tasks. A novel three-stage training procedure and stochastic inference further improve training efficiency and model performance. Our model achieves new state-of-the-art (SOTA) results on open challenge benchmarks PCQM4Mv2 and OC20 IS2RE. We also obtain SOTA results on QM9, MOLPCBA, and LIT-PCBA molecular property prediction benchmarks via transfer learning. We also demonstrate the generality of TGT with SOTA results on the traveling salesman problem (TSP).

For agents

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

get_harvested_code_for_paper("2402.04538")
get_code_for_paper("2402.04538")
have("2402.04538")

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

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

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

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

Connect an agent — have() is free.