SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.14225 · 2024

ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 3 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/2405.14225.json · badge: /api/ran/2405.14225.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
syr-cn/reactxt canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
syr-cn/reactxt/model/modeling_llama.py
code served (permissive licence) · get_code("9b4dff79d5e6102c")
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 tuple, ndim 5, 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)

# Analyze the function to understand tensor shapes:
# q, k: used in element-wise operations with cos, sin
# cos, sin: gathered using position_ids, shape [batch, heads, seq_len, dim]
# position_ids: shape [batch, seq_len], used to gather from cos/sin at dim 2

batch_size = 2
num_heads = 3
seq_len = 4
head_dim = 4

# q and k: [batch, heads, seq_len, head_dim]
q = torch.randn(batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim)

# cos and sin: [1, heads, seq_len, head_dim] (will be repeated to batch_size)
cos = torch.randn(1, num_heads, seq_len, head_dim)
sin = torch.randn(1, num_heads, seq_len, head_dim)

# position_ids: [batch, seq_len] with values in range [0, seq_len)
position_ids = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 2, 3]
], dtype=torch.long)

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
}
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 tuple, ndim 5, 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
disabled_train Ran
ran, violated the contract we drafted
syr-cn/reactxt/model/blip2.py
code served (permissive licence) · get_code("4cb732f513d69dfd")
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 SimpleModel. 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 SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    "self": model,
    "mode": True
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
escape_custom_split_sequence Ran
ran; our contract draft was wrong, not the code
syr-cn/reactxt/model/blip2_opt.py
code served (permissive licence) · get_code("f0e4be065f35a5c6")
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 re

SPLIT_MARKER = f'SPL{1}T-TH{1}S-Pl3A5E'

CUSTOM_SEQ_RE = re.compile('(\\[START_(DNA|SMILES|I_SMILES|AMINO)])(.*?)(\\[END_\\2])')

def _insert_split_marker(m: re.Match):
    """
    Applies split marker based on a regex match of special tokens such as
    [START_DNA].

    Parameters
    ----------
    n : str
        Input text to split

    Returns
    ----------
    str - the text with the split token added
    """
    start_token, _, sequence, end_token = m.groups()
    sequence = re.sub('(.)', f'{SPLIT_MARKER}\\1', sequence, flags=re.DOTALL)
    return f'{start_token}{sequence}{SPLIT_MARKER}{end_token}'

def escape_custom_split_sequence(text):
    """
    Applies custom splitting to the text for GALILEO's tokenization

    Parameters
    ----------
    text : str
        Input text to split

    Returns
    ----------
    str - the text with the split token added
    """
    return CUSTOM_SEQ_RE.sub(_insert_split_marker, text)


# Test setup with various input strings containing special tokens
test_text_1 = "[START_DNA]ATCG[END_DNA]"
test_text_2 = "[START_SMILES]CC(=O)O[END_SMILES]"
test_text_3 = "[START_AMINO]MKVL[END_AMINO]"
test_text_4 = "Some text [START_I_SMILES]C1=CC=CC=C1[END_I_SMILES] more text"
test_text_5 = "[START_DNA]A[END_DNA]"

ARGS = {
    "text": test_text_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
get_module_state_dict Ran
ran; our contract draft was wrong, not the code
syr-cn/reactxt/model/blip2_model.py
code served (permissive licence) · get_code("53d5373b3854c8e7")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a sample state_dict that mimics a PyTorch model's state_dict
# with nested module parameters
state_dict = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(5, 4),
    'layer2.bias': torch.randn(5),
    'module_a.weight': torch.randn(2, 3),
    'module_a.bias': torch.randn(2),
    'module_a.nested.weight': torch.randn(3, 2),
    'other.weight': torch.randn(4, 4),
}

module_name = 'module_a'

ARGS = {
    'state_dict': state_dict,
    'module_name': module_name,
}
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 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
get_tokens_as_list Ran
ran, honoured the contract we drafted
syr-cn/reactxt/model/help_funcs.py
code served (permissive licence) · get_code("d88f0d9eb3ea4611")
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 1, dtype family int; 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
from transformers import AutoTokenizer

torch.manual_seed(0)

# Create a minimal tokenizer stand-in that supports the interface used by get_tokens_as_list
class MinimalTokenizer:
    def __init__(self):
        self.vocab = {
            "hello": [101, 7592],
            "world": [2088],
            "test": [3231, 2572],
            "word": [2773],
        }
    
    def __call__(self, word_list, add_special_tokens=False):
        """Mimics tokenizer behavior - returns object with input_ids attribute"""
        result = []
        for word in word_list:
            # Return token ids for the word, or a default if not in vocab
            token_ids = self.vocab.get(word, [999])
            result.append(token_ids)
        return TokenizerOutput(result)

class TokenizerOutput:
    def __init__(self, input_ids_list):
        self.input_ids = input_ids_list

tokenizer = MinimalTokenizer()
word_list = ["hello", "world", "test"]

ARGS = {
    "tokenizer": tokenizer,
    "word_list": word_list,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — 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
mask_by_len Ran
ran; our contract draft was wrong, not the code
syr-cn/reactxt/model/blip2_llama.py
code served (permissive licence) · get_code("e34d5a438d83d62b")
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

torch.manual_seed(0)

# Create a small input tensor of shape [N, D] = [2, 4]
input_tensor = torch.randn(2, 4)

# Create lens tensor of shape [N] = [2]
# lens indicates how many positions to mask in each row
lens = torch.tensor([2, 3])

# fill_value is a scalar
fill_value = 0

ARGS = {
    "input": input_tensor,
    "lens": lens,
    "fill_value": fill_value,
}
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
rotate_half Ran
ran; our contract draft was wrong, not the code
syr-cn/reactxt/model/modeling_llama.py
code served (permissive licence) · get_code("b99eea6376d1e212")
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 (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

torch.manual_seed(0)

# The function rotate_half takes a single parameter 'x' which is a tensor
# It accesses x.shape[-1] to get the last dimension
# It uses indexing with [..., :] slicing notation
# It calls torch.cat() to concatenate tensors

# Create a small tensor with shape (2, 4) - batch size 2, hidden dim 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 (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
average_checkpoints Not yet run
unverified (harvested, no recorded run)
syr-cn/reactxt/average_ckpt.py
code served (permissive licence) · get_code("d73f14bf46e46bc6")
How it ran

no invocation recorded.

caption_evaluate Not yet run
unverified (harvested, no recorded run)
syr-cn/reactxt/model/help_funcs.py
code served (permissive licence) · get_code("2f19d209d89cd777")
How it ran

no invocation recorded.

get_not_allowed_tokens_ids Not yet run
unverified (harvested, no recorded run)
syr-cn/reactxt/model/help_funcs.py
code served (permissive licence) · get_code("360eb476982c57a5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 10 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 5 the same month, 3 later) and 0 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
rotate_half 360 other papers
121 dated earlier, 13 the same month, 217 later, 6 same year, order not determinable, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
disabled_train 173 other papers
104 dated earlier, 12 the same month, 49 later, 8 same year, order not determinable · 5 only as an assembly brick
2012.09841 (2020-12)
Taming Transformers for High-Resolution Image Synthesis
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
and 170 more not named here
apply_rotary_pos_emb 47 other papers
33 dated earlier, 2 the same month, 9 later, 3 same year, order not determinable
2305.14167 (2023-05)
DetGPT: Detect What You Need via Reasoning
2305.16103 (2023-05)
ChatBridge: Bridging Modalities with Large Language Model as a Language Catalyst
2305.16355 (2023-05)
PandaGPT: One Model To Instruction-Follow Them All
and 44 more not named here
escape_custom_split_sequence 4 other papers
3 dated earlier, 1 same year, order not determinable
2211.09085 (2022-11)
Galactica: A Large Language Model for Science
2310.12798 (2023-10)
MolCA: Molecular Graph-Language Modeling with Cross-Modal Projector and Uni-Modal Adapter
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining
and 1 more not named here
get_module_state_dict 4 other papers
2 dated earlier, 1 the same month, 1 same year, order not determinable
2310.12798 (2023-10)
MolCA: Molecular Graph-Language Modeling with Cross-Modal Projector and Uni-Modal Adapter
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining
2401.13923 (2024-01)
Towards 3D Molecule-Text Interpretation in Language Models
and 1 more not named here
mask_by_len 4 other papers
2 dated earlier, 1 the same month, 1 same year, order not determinable
2310.12798 (2023-10)
MolCA: Molecular Graph-Language Modeling with Cross-Modal Projector and Uni-Modal Adapter
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining
2401.13923 (2024-01)
Towards 3D Molecule-Text Interpretation in Language Models
and 1 more not named here
caption_evaluate 2 other papers
1 dated earlier, 1 same year, order not determinable
2310.12798 (2023-10)
MolCA: Molecular Graph-Language Modeling with Cross-Modal Projector and Uni-Modal Adapter
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining
average_checkpoints 1 other paper
1 same year, order not determinable
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining
get_not_allowed_tokens_ids 1 other paper
1 same year, order not determinable
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining
get_tokens_as_list 1 other paper
1 same year, order not determinable
2024.findings-acl.318 (2024 (year only))
ReactXT: Understanding Molecular "Reaction-ship" via Reaction-Contextualized Molecule-Text Pretraining

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

Molecule-text modeling, which aims to facilitate molecule-relevant tasks with a textual interface and textual knowledge, is an emerging research direction. Beyond single molecules, studying reaction-text modeling holds promise for helping the synthesis of new materials and drugs. However, previous works mostly neglect reaction-text modeling: they primarily focus on modeling individual molecule-text pairs or learning chemical reactions without texts in context. Additionally, one key task of reaction-text modeling -- experimental procedure prediction -- is less explored due to the absence of an open-source dataset. The task is to predict step-by-step actions of conducting chemical experiments and is crucial to automating chemical synthesis. To resolve the challenges above, we propose a new pretraining method, ReactXT, for reaction-text modeling, and a new dataset, OpenExp, for experimental procedure prediction. Specifically, ReactXT features three types of input contexts to incrementally pretrain LMs. Each of the three input contexts corresponds to a pretraining task to improve the text-based understanding of either reactions or single molecules. ReactXT demonstrates consistent improvements in experimental procedure prediction and molecule captioning and offers competitive results in retrosynthesis. Our code is available at https://github.com/syr-cn/ReactXT.

For agents

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

get_harvested_code_for_paper("2405.14225")
get_code_for_paper("2405.14225")
have("2405.14225")

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

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

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

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

Connect an agent — have() is free.