SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.09391 · 2024

LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 0 have no contract verdict; 8 failures of our instrument; 1 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.09391.json · badge: /api/ran/2402.09391.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
osu-nlp-group/llm4chem canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
extract_answer_part Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/extract_prediction.py
code served (permissive licence) · get_code("2e77e03994ffa26f")
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 torch
import numpy as np

torch.manual_seed(0)

# Construct valid arguments for extract_answer_part
ARGS = {
    'outputs': [
        'Some text <answer>correct response</answer> more text',
        'Another text <answer>another answer</answer> end',
        'Text without tags here',
        '<answer>answer at start</answer> with text after'
    ],
    'left_tag': '<answer>',
    'right_tag': '</answer>',
    'mode': 'tag'
}
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, 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
find_sub_sequence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
osu-nlp-group/llm4chem/utils/core_tagger.py
code served (permissive licence) · get_code("567166dd32d98725")
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 int, ndim 0, dtype family int, 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

torch.manual_seed(0)

# The function find_sub_sequence searches for a subsequence within a sequence
# It takes two parameters:
# - whole: a list to search within
# - sub: a list to search for (the subsequence)

# Test case 1: subsequence found at the beginning
whole_list = [1, 2, 3, 4, 5, 6]
sub_list = [1, 2, 3]

ARGS = {
    "whole": whole_list,
    "sub": sub_list
}
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 int, ndim 0, dtype family int, 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
generate_chat Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/utils/chat_generation.py
code served (permissive licence) · get_code("48d115e8555fdcc7")
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 torch

torch.manual_seed(0)

ARGS = {
    'input_text': 'What is the capital of France?',
    'output_text': 'The capital of France is Paris.',
    'prefix_chat': [
        {'role': 'user', 'content': 'Hello'},
        {'role': 'assistant', 'content': 'Hi there!'}
    ]
}
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, 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_chat_content Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/utils/general_prompter.py
code served (permissive licence) · get_code("78558afc3dc5a615")
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 torch

torch.manual_seed(0)

conversation = [
    {'role': 'user', 'content': 'Hello, how are you?'},
    {'role': 'assistant', 'content': 'I am doing well, thank you for asking.'},
    {'role': 'user', 'content': 'What is your name?'},
    {'role': 'assistant', 'content': 'I am an AI assistant.'}
]

ARGS = {
    'conversation': conversation,
    'tokenize': 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 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
llama_forward_synthesis Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/prediction_extraction.py
code served (permissive licence) · get_code("6bb075d04572d7e3")
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

def llama_forward_synthesis(output_text):
    pattern = '(\\[|]|\\[[^\\]]+]|Br?|Cl?|H|N|O|S|P|F|I|b|c|n|o|s|p|\\(|\\)|\\.|;|=|#|-|\\+|\\\\|\\/|:|~|@|\\?|>|\\*|\\$|\\%[0-9]{2}|[0-9])+'
    output_text = output_text.strip()
    if re.match(pattern + '$', output_text):
        return output_text
    pos = output_text.rfind('Predicted product SMILES:')
    if pos != -1:
        output_text = output_text[pos + 1:].strip()
        return output_text
    pos = output_text.rfind(':')
    if pos != -1:
        m = re.match(pattern, output_text[pos + 1:].strip())
        if m is not None:
            output_text = output_text[pos + 1:].strip()
            return output_text[:m.span()[1]]
    match_begin = re.match(pattern, output_text)
    if match_begin is not None:
        return output_text[:match_begin.span()[1]]
    return ''


ARGS = {
    'output_text': 'CC(C)Cc1ccc(cc1)C(C)C(O)=O'
}
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
llama_molecule_generation Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/prediction_extraction.py
code served (permissive licence) · get_code("52df787328283db4")
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

def llama_molecule_generation(output_text):
    pattern = '(\\[|]|\\[[^\\]]+]|Br?|Cl?|H|N|O|S|P|F|I|b|c|n|o|s|p|\\(|\\)|\\.|;|=|#|-|\\+|\\\\|\\/|:|~|@|\\?|>|\\*|\\$|\\%[0-9]{2}|[0-9])+'
    output_text = output_text.strip()
    pos = output_text.find('\n')
    if pos != -1:
        first_line = output_text[:pos].strip()
    else:
        first_line = output_text
    m = re.match(pattern + '$', first_line)
    if m is not None:
        return first_line
    found = False
    titles = ('SMILES for the second molecule: ', 'the second input:', ' is:', 'molecules:', 'description:', 'you described:', 'SMILES:', 'described in the input:', 'Here is the SMILES representation of the molecule:', 'you provided:', 'the molecule is:')
    for title in titles:
        pos = output_text.lower().find(title.lower())
        if pos != -1:
            output_text = output_text[pos + len(title):].strip()
            found = True
            break
    if not found:
        titles = (':',)
        for title in titles:
            pos = output_text.lower().rfind(title.lower())
            if pos != -1:
                output_text = output_text[pos + len(title):].strip()
                found = True
                break
    if found:
        match_begin = re.match(pattern, output_text)
        if match_begin is None:
            pos = output_text.find(':')
            output_text = output_text[pos + 1:].strip()
        match_begin = re.match(pattern, output_text)
        if match_begin is not None:
            return output_text[:match_begin.span()[1]]
    return ''

ARGS = {
    "output_text": "SMILES: CC(C)Cc1ccc(cc1)C(C)C(O)=O"
}
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
llama_retrosynthesis Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/prediction_extraction.py
code served (permissive licence) · get_code("08641ffa37ef2d2f")
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

def llama_retrosynthesis(output_text):
    pattern = '(\\[|]|\\[[^\\]]+]|Br?|Cl?|H|N|O|S|P|F|I|b|c|n|o|s|p|\\(|\\)|\\.|;|=|#|-|\\+|\\\\|\\/|:|~|@|\\?|>|\\*|\\$|\\%[0-9]{2}|[0-9])+'
    output_text = output_text.strip()
    m = re.match(pattern, output_text)
    if m is not None:
        span = m.span()
        if span[1] == len(output_text):
            return output_text.strip()
        elif span[1] > 10:
            return output_text[:span[1]]
    titles = ('Reactant SMILES:', 'the predicted reactant molecules based on the product SMILES:', 'Here are the predicted reactant molecules in SMILES format:', 'Reactants SMILES:', 'Reactants:', 'the predicted reactants for the given product SMILES:', 'Here are the predicted reactants for the given product molecule:', 'following reactants:', 'Here are the predicted reactants for the given product molecule using the SMILES representation:', 'The predicted reactants for the given product molecule are:', 'the predicted reactants based on the product SMILES:', 'the predicted reactants for the given product:', 'the predicted reactants for the given reaction:')
    found = False
    for title in titles:
        pos = output_text.lower().rfind(title.lower())
        if pos != -1:
            output_text = output_text[pos + len(title):].strip()
            found = True
            break
    if not found:
        for title in ('predicted reactants for each product SMILES:', 'the predicted reactants for each product:', 'the predicted reactants for each product molecule:', 'Here are the predicted reactants for the given product molecules:'):
            pos = output_text.lower().rfind(title.lower())
            if pos != -1:
                output_text = output_text[pos + len(title):].strip()
                pos = output_text.lower().find('product 2:')
                if pos != -1:
                    output_text = output_text[pos + len('product 2:'):].strip().strip('*').strip()
                    found = True
    if found:
        match_begin = re.match(pattern, output_text)
        if match_begin is not None:
            return output_text[:match_begin.span()[1]]
    return ''

ARGS = {
    'output_text': 'Reactant SMILES: CC(C)Cc1ccc(cc1)C(C)C(O)=O'
}
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
read_result Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm4chem/compute_metrics.py
code served (permissive licence) · get_code("b8dc6f087d9f1731")
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 os
import json
import tempfile

# Create a temporary directory and a test JSONL file
temp_dir = tempfile.mkdtemp()
task_name = "test_task"
file_path = os.path.join(temp_dir, task_name + '.jsonl')

# Write test data to the JSONL file
test_data = [
    {
        "input": "What is the molecular weight?",
        "pred": ["100.5", "101.2"],
        "gold": "100.5"
    },
    {
        "input": "What is the structure?",
        "pred": ["C2H6", None],
        "gold": "C2H6"
    },
    {
        "input": "Describe the compound",
        "target": "specific_target",
        "pred": ["compound A; description", "compound B; details"],
        "gold": "compound A; description"
    }
]

with open(file_path, 'w') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "prediction_dir": temp_dir,
    "task": task_name,
    "replace_semicolon": False,
    "read_gold_from_dataset": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets — 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
tokenize Not yet run
unverified (harvested, no recorded run)
osu-nlp-group/llm4chem/generation.py
code served (permissive licence) · get_code("adcef27608cdbd15")
How it ran

no invocation recorded.

Also present in other papers' code

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

Chemistry plays a crucial role in many domains, such as drug discovery and material science. While large language models (LLMs) such as GPT-4 exhibit remarkable capabilities on natural language processing tasks, existing research indicates that their performance on chemistry tasks is discouragingly low. In this paper, however, we demonstrate that our developed LLMs can achieve very strong results on a comprehensive set of chemistry tasks, outperforming the most advanced GPT-4 and Claude 3 Opus by a substantial margin. To accomplish this, we propose SMolInstruct, a large-scale, comprehensive, and high-quality dataset for instruction tuning. It contains 14 selected chemistry tasks and over three million samples, laying a solid foundation for training and evaluating LLMs for chemistry. Using SMolInstruct, we fine-tune a set of open-source LLMs, among which, we find that Mistral serves as the best base model for chemistry tasks. Our analysis further demonstrates the critical role of the proposed dataset in driving the performance improvements.

For agents

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

get_harvested_code_for_paper("2402.09391")
get_code_for_paper("2402.09391")
have("2402.09391")

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

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

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

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

Connect an agent — have() is free.