SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.10773 · 2023

Gotta be SAFE: A New Framework for Molecular Design

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 0 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/2310.10773.json · badge: /api/ran/2310.10773.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
MorganCThomas/SMILES-RNN community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
FunctionStatusWhere it lives
calculate_nlls_from_model Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/dataset.py
code served (permissive licence) · get_code("7896e2eeab07a5c2")
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
import torch.nn as nn
import torch.utils.data as tud

torch.manual_seed(0)

class SimpleTokenizer:
    """Minimal tokenizer for SMILES strings"""
    def tokenize(self, smiles):
        # Simple character-level tokenization
        return list(smiles)

class SimpleVocabulary:
    """Minimal vocabulary for encoding tokens"""
    def __init__(self):
        self.token_to_id = {
            'C': 1, 'O': 2, 'N': 3, '=': 4, 
            '(': 5, ')': 6, 'c': 7, 'n': 8, 'o': 9, '[PAD]': 0
        }
    
    def encode(self, tokens):
        # Convert tokens to IDs, using 0 for unknown
        return [self.token_to_id.get(t, 0) for t in tokens]

class SimpleModel(nn.Module):
    """Minimal model that implements the interface used by calculate_nlls_from_model"""
    def __init__(self, vocab_size=10, hidden_dim=4):
        super().__init__()
        self.vocabulary = SimpleVocabulary()
        self.tokenizer = SimpleTokenizer()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, 1)
    
    def likelihood(self, batch):
        # batch shape: (batch_size, seq_length)
        # Return NLL values for each sequence in batch
        embedded = self.embedding(batch)  # (batch_size, seq_length, hidden_dim)
        # Average pooling over sequence dimension
        pooled = embedded.mean(dim=1)  # (batch_size, hidden_dim)
        # Compute likelihood (use as negative log-likelihood proxy)
        nlls = self.linear(pooled)  # (batch_size, 1)
        return nlls.squeeze(-1)  # (batch_size,)

# Create test data
model = SimpleModel(vocab_size=10, hidden_dim=4)
smiles_list = ['CCO', 'c1ccccc1', 'CC(=O)O', 'CN']
batch_size = 2

ARGS = {
    'model': model,
    'smiles': smiles_list,
    'batch_size': batch_size,
}
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
create_vocabulary Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/vocabulary.py
code served (permissive licence) · get_code("906993dde8a42e8c")
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 Vocabulary. 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
from tqdm import tqdm

class MockTokenizer:
    """Stand-in tokenizer that implements the tokenize method."""
    def tokenize(self, smi, with_begin_and_end=False):
        # Return a set of tokens extracted from the SMILES string
        # For testing, just split into characters
        return set(list(smi))

# Create test data
smiles_list = [
    "CCO",
    "CC(C)O",
    "c1ccccc1",
    "CC(=O)O"
]

tokenizer = MockTokenizer()

ARGS = {
    "smiles_list": smiles_list,
    "tokenizer": tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Vocabulary — a Vocabulary output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Vocabulary 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
fit_smiles_to_vocabulary Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/vocabulary.py
code served (permissive licence) · get_code("3fcdb8a0ea8f3cc4")
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 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.

class MockVocabulary:
    def __init__(self):
        self._tokens = {
            'C': 0,
            'c': 1,
            'N': 2,
            'O': 3,
            '[': 4,
            ']': 5,
            '(': 6,
            ')': 7,
            '=': 8,
            '#': 9,
        }


class MockTokenizer:
    def tokenize(self, smiles, with_begin_and_end=False):
        # Simple character-level tokenization
        tokens = list(smiles)
        if with_begin_and_end:
            tokens = ['<BEGIN>'] + tokens + ['<END>']
        return tokens


vocabulary = MockVocabulary()

smiles_list = [
    'CCO',           # ethanol - all tokens in vocabulary
    'c1ccccc1',      # benzene - all tokens in vocabulary
    'CC(=O)N',       # acetamide - all tokens in vocabulary
    'CCX',           # invalid token X not in vocabulary
]

tokenizer = MockTokenizer()

ARGS = {
    'vocabulary': vocabulary,
    'smiles_list': smiles_list,
    'tokenizer': tokenizer,
}
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 list, ndim 1, 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
get_device Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/utils.py
code served (permissive licence) · get_code("78e02a3c38f94ced")
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 device. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

ARGS = {
    '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 device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device 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
read_smiles Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/utils.py
code served (permissive licence) · get_code("3ca3d657a0d82b62")
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 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 tempfile
import os

# Create a temporary directory and a test SMILES file
temp_dir = tempfile.mkdtemp()

# Create a plain text SMILES file
smiles_file = os.path.join(temp_dir, 'test_smiles.txt')
with open(smiles_file, 'w') as f:
    f.write('CC(C)Cc1ccc(cc1)C(C)C(O)=O\n')
    f.write('CC(=O)Oc1ccccc1C(=O)O\n')
    f.write('CN1C=NC2=C1C(=O)N(C(=O)N2C)C\n')

ARGS = {
    'file_path': smiles_file
}
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 list, ndim 1, 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
to_tensor Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/utils.py
code served (permissive licence) · get_code("7b261d1aac82bb78")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np
import torch

torch.manual_seed(0)

# The function accepts a single parameter 'tensor' that can be either:
# - a numpy.ndarray
# - a torch tensor
# We'll test with a numpy array since the function explicitly handles conversion

numpy_array = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    "tensor": numpy_array
}
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 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
update_vocabulary Ran
ran on a synthesized input
MorganCThomas/SMILES-RNN/smilesrnn/vocabulary.py
code served (permissive licence) · get_code("7a5dba5e7482b545")
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 set. 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 numpy as np

class MockTokenizer:
    """Stand-in tokenizer that can tokenize SMILES strings."""
    def tokenize(self, smiles, with_begin_and_end=False):
        """Mock tokenization that splits SMILES into simple tokens."""
        # Simple tokenization: split on common SMILES characters
        tokens = []
        i = 0
        while i < len(smiles):
            if smiles[i] in 'CNOPSFClBr':
                tokens.append(smiles[i])
            elif smiles[i] in '()[]=#+-':
                tokens.append(smiles[i])
            elif smiles[i].isdigit():
                tokens.append(smiles[i])
            i += 1
        return tokens

torch.manual_seed(0)

# Create a small vocabulary (using a set that can be updated)
vocabulary = set(['C', 'N', 'O'])

# Create a list of SMILES strings
smiles_list = ['CCO', 'c1ccccc1', 'CC(=O)O']

# Create a tokenizer
tokenizer = MockTokenizer()

ARGS = {
    'vocabulary': vocabulary,
    'smiles_list': smiles_list,
    'tokenizer': tokenizer
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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

Also present in other papers' code

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

Traditional molecular string representations, such as SMILES, often pose challenges for AI-driven molecular design due to their non-sequential depiction of molecular substructures. To address this issue, we introduce Sequential Attachment-based Fragment Embedding (SAFE), a novel line notation for chemical structures. SAFE reimagines SMILES strings as an unordered sequence of interconnected fragment blocks while maintaining compatibility with existing SMILES parsers. It streamlines complex generative tasks, including scaffold decoration, fragment linking, polymer generation, and scaffold hopping, while facilitating autoregressive generation for fragment-constrained design, thereby eliminating the need for intricate decoding or graph-based models. We demonstrate the effectiveness of SAFE by training an 87-million-parameter GPT2-like model on a dataset containing 1.1 billion SAFE representations. Through targeted experimentation, we show that our SAFE-GPT model exhibits versatile and robust optimization performance. SAFE opens up new avenues for the rapid exploration of chemical space under various constraints, promising breakthroughs in AI-driven molecular design.

For agents

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

get_harvested_code_for_paper("2310.10773")
get_code_for_paper("2310.10773")
have("2310.10773")

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

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

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

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

Connect an agent — have() is free.