SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.16349 · 2022

BARTSmiles: Generative Masked Language Models for Molecular Representations

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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 6 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/2211.16349.json · badge: /api/ran/2211.16349.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
yerevann/bartsmiles canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_auc Ran
ran on a synthesized input
yerevann/bartsmiles/utils/utils.py
code served (permissive licence) · get_code("fd29169c736bf8ed")
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 float, ndim 0, dtype family float, shape () 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
import numpy as np
from sklearn.metrics import roc_auc_score

torch.manual_seed(0)

# y_pred: predicted probabilities for binary classification (1D array or list of floats between 0 and 1)
y_pred = np.array([0.1, 0.4, 0.9, 0.8, 0.2, 0.7])

# y: true binary labels (1D array or list of 0s and 1s)
y = np.array([0, 0, 1, 1, 0, 1])

ARGS = {
    'y_pred': y_pred,
    'y': y
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
compute_rmse Ran
ran on a synthesized input
yerevann/bartsmiles/utils/utils.py
code served (permissive licence) · get_code("d7842ae864cb12d6")
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 float64, ndim 0, 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 numpy as np

# Analyze the function compute_rmse:
# - y_pred: list/array of predictions (used in list comprehension)
# - y: list/array of actual values (used in list comprehension)
# - ma: maximum value (scalar, used in arithmetic)
# - mi: minimum value (scalar, used in arithmetic)

# Create small test data
y_pred = [0.2, 0.5, 0.8, 0.3]
y = [0.1, 0.6, 0.7, 0.4]
ma = 100.0
mi = 0.0

ARGS = {
    'y_pred': y_pred,
    'y': y,
    'ma': ma,
    'mi': mi
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
cross_val Ran
ran on a synthesized input
yerevann/bartsmiles/preprocess/process.py
code served (permissive licence) · get_code("3d9f245915edd0a4")
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 4, 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 pandas as pd
from sklearn.model_selection import KFold

# Create a small sample dataframe with SMILES and Classification columns
df = pd.DataFrame({
    'SMILES': ['CCO', 'CC(C)O', 'c1ccccc1', 'CCN'],
    'Classification': [0, 1, 0, 1]
})

ARGS = {
    'df': df,
    'smiles_col_name': 'SMILES',
    'label_col_name': 'Classification',
    'k_fold': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, 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
multi_task_predict Ran
ran on a synthesized input
yerevann/bartsmiles/utils/utils.py
code served (permissive licence) · get_code("f25396a600d1ff6a")
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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Stand-in classes for required objects
class SourceDictionary:
    def eos(self):
        return 2  # End-of-sequence token id

class Task:
    def __init__(self):
        self.source_dictionary = SourceDictionary()

class ClassificationHead(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

class ModelWithHeads(nn.Module):
    def __init__(self):
        super().__init__()
        self.classification_heads = nn.ModuleDict({
            'task0': ClassificationHead(4, 3),
            'task1': ClassificationHead(4, 3),
        })

class SelfObject(nn.Module):
    def __init__(self):
        super().__init__()
        self.device = torch.device('cpu')
        self.task = Task()
        self.model = ModelWithHeads()
    
    def extract_features(self, tokens):
        # Return features with shape (batch_size, seq_len, feature_dim)
        # batch_size from tokens, seq_len arbitrary, feature_dim=4
        batch_size = tokens.shape[0]
        seq_len = tokens.shape[1]
        return torch.randn(batch_size, seq_len, 4)

# Create instance
self_obj = SelfObject()

# Prepare arguments
tokens = torch.tensor([[1, 0, 2], [1, 1, 2]])  # batch=2, seq_len=3

dataset_js = {
    'class_index': {0: 'class_a', 1: 'class_b'}  # len > 1, so range produces [0]
}

ARGS = {
    'self': self_obj,
    'head': 'task',
    'tokens': tokens,
    'return_logits': False,
    'dataset_js': dataset_js,
}
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 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
scaff Ran
ran on a synthesized input
yerevann/bartsmiles/preprocess/process.py
code served (permissive licence) · get_code("b5de51b8647b164e")
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 DataFrame. 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 os
import tempfile
import pandas as pd

# Create a temporary directory structure with test data
temp_root = tempfile.mkdtemp()
dataset_name = "test_dataset"
type_param = "train"

# Create the directory structure
data_dir = os.path.join(temp_root, 'chemical', 'checkpoints', 'evaluation_data', dataset_name, dataset_name)
os.makedirs(data_dir, exist_ok=True)

# Create a test CSV file
csv_content = """index,Classification,SMILES
0,1.0,CC(=O)O
1,0.0,c1ccccc1
2,1.0,CCO
"""

csv_path = os.path.join(data_dir, f'{type_param}_{dataset_name}.csv')
with open(csv_path, 'w') as f:
    f.write(csv_content)

ARGS = {
    'root': temp_root,
    'dataset_name': dataset_name,
    'type': type_param
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
split_train_val_test Ran
ran on a synthesized input
yerevann/bartsmiles/preprocess/process.py
code served (permissive licence) · get_code("9c90ce3e5de0a4ba")
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. 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 pandas as pd
from sklearn.model_selection import train_test_split

# Create a sample dataframe with SMILES strings and classification labels
df = pd.DataFrame({
    'SMILES': [
        'CCO',
        'CC(C)O',
        'c1ccccc1',
        'CC(=O)O',
        'C1CCCCC1',
        'CCN',
        'CC(C)C',
        'c1ccc(O)cc1',
        'CC(C)CC',
        'c1cccnc1'
    ],
    'Classification': [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
})

ARGS = {
    'df': df,
    'smiles_col_name': 'SMILES',
    'label_col_name': 'Classification'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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

Also present in other papers' code

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

We discover a robust self-supervised strategy tailored towards molecular representations for generative masked language models through a series of tailored, in-depth ablations. Using this pre-training strategy, we train BARTSmiles, a BART-like model with an order of magnitude more compute than previous self-supervised molecular representations. In-depth evaluations show that BARTSmiles consistently outperforms other self-supervised representations across classification, regression, and generation tasks setting a new state-of-the-art on 11 tasks. We then quantitatively show that when applied to the molecular domain, the BART objective learns representations that implicitly encode our downstream tasks of interest. For example, by selecting seven neurons from a frozen BARTSmiles, we can obtain a model having performance within two percentage points of the full fine-tuned model on task Clintox. Lastly, we show that standard attribution interpretability methods, when applied to BARTSmiles, highlight certain substructures that chemists use to explain specific properties of molecules. The code and the pretrained model are publicly available.

For agents

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

get_harvested_code_for_paper("2211.16349")
get_code_for_paper("2211.16349")
have("2211.16349")

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

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

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

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

Connect an agent — have() is free.