SMolInstruct is a large-scale, comprehensive, and high-quality instruction tuning dataset crafted for chemistry. It centers around small molecules, and contains 14 meticulously selected tasks and over 3M samples.
51
13 commits
2 linked in READMEs
updated Sep 18, 2024
SMolInstruct is a large-scale, comprehensive, and high-quality instruction tuning dataset crafted for chemistry. It centers around small molecules, and contains 14 meticulously selected tasks and over 3M samples.
This dataset has both SMILES and SELFIES versions, and you could switch to SELFIES by using use_selfies=True when loading.
Version History
sample_id in each sample. Also added doc for insert_core_tags which you can control if core information is wraped with core tags (e.g., <SMILES> ... </SMILES>).use_test_subset=True. Also added use_first to load the first specific number of samples for each task. See below for details.<SMILES> <SMILES> ... </SMILES> </SMILES>) for retrosynthesis. We recommend all to use this or newer version.Page: https://osu-nlp-group.github.io/LlaSMol
Code: https://github.com/OSU-NLP-Group/LlaSMol
Models: https://huggingface.co/osunlp/LlaSMol
The following figure illustrates the tasks and corresponding examples.

The following table shows the tasks and statistics over the SMolInstruct dataset, where “Qry.” and “Resp.” are average lengths of queries and responses, respectively.

An example is shown below:
{
'sample_id': 'forward_synthesis.train.1'
'input': 'Based on the given reactants and reagents: <SMILES> CCCCCCCC/C=C\\CCCCCCCC(=O)OCCNCCOC(=O)CCCCCCC/C=C\\CCCCCCCC.CCN=C=NCCCN(C)C.CN(C)C1=CC=NC=C1.CN(C)CCSCC(=O)O.CO.Cl.ClCCl.O.O=C(O)C(F)(F)F.O=C([O-])[O-].[K+] </SMILES>, what product could potentially be produced?',
'output': 'The product can be <SMILES> CCCCCCCC/C=C\\CCCCCCCC(=O)OCCN(CCOC(=O)CCCCCCC/C=C\\CCCCCCCC)C(=O)CSCCN(C)C </SMILES> .',
'raw_input': 'CCCCCCCC/C=C\\CCCCCCCC(=O)OCCNCCOC(=O)CCCCCCC/C=C\\CCCCCCCC.CCN=C=NCCCN(C)C.CN(C)C1=CC=NC=C1.CN(C)CCSCC(=O)O.CO.Cl.ClCCl.O.O=C(O)C(F)(F)F.O=C([O-])[O-].[K+]',
'raw_output': 'CCCCCCCC/C=C\\CCCCCCCC(=O)OCCN(CCOC(=O)CCCCCCC/C=C\\CCCCCCCC)C(=O)CSCCN(C)C',
'split': 'train',
'task': 'forward_synthesis',
'input_core_tag_left': '<SMILES>',
'input_core_tag_right': '</SMILES>',
'output_core_tag_left': '<SMILES>',
'output_core_tag_right': '</SMILES>',
'target': None
}
You can use the following lines to load the dataset:
from datasets import load_dataset
dataset = load_dataset('osunlp/SMolInstruct')
train_set = dataset['train']
validation_set = dataset['validation']
test_set = dataset['test']
A SELFIES version could also be used, by simplying adding an argument:
dataset = load_dataset('osunlp/SMolInstruct', use_selfies=True)
You can also specify what tasks to load:
ALL_TASKS = (
'forward_synthesis',
'retrosynthesis',
'molecule_captioning',
'molecule_generation',
'name_conversion-i2f',
'name_conversion-i2s',
'name_conversion-s2f',
'name_conversion-s2i',
'property_prediction-esol',
'property_prediction-lipo',
'property_prediction-bbbp',
'property_prediction-clintox',
'property_prediction-hiv',
'property_prediction-sider',
)
train_set = load_dataset('osunlp/SMolInstruct', tasks=ALL_TASKS)
You could use use_test_subset=True to use a subset of the test set, to quickly evaluate your models. In this subset, each task has at most 200 samples.
test_set = load_dataset('osunlp/SMolInstruct', split='test', use_test_subset=True)
You could also use_first=INTEGER to load only first at most INTEGER samples for each task.
# load first 500 samples for each task
test_set = load_dataset('osunlp/SMolInstruct', split='test', use_first=500)
The argument insert_core_tags can control whether the core tags should be added. By default, it's True.
test_set = load_dataset('osunlp/SMolInstruct', split='test', insert_core_tags=False)
The evaluation code will be at https://github.com/OSU-NLP-Group/LlaSMol.
The construction of SMolInstruct goes through a four-step pipeline:
The SMolInstruct dataset is licensed under CC BY 4.0.
We emphatically urge all users to adhere to the highest ethical standards when using our dataset, including maintaining fairness, transparency, and responsibility in their research. Any usage of the dataset that may lead to harm or pose a detriment to society is strictly forbidden.
If our paper or related resources prove valuable to your research, we kindly ask for citation. Please feel free to contact us with any inquiries.
@inproceedings{
yu2024llasmol,
title={Lla{SM}ol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset},
author={Botao Yu and Frazier N. Baker and Ziqi Chen and Xia Ning and Huan Sun},
booktitle={First Conference on Language Modeling},
year={2024},
url={https://openreview.net/forum?id=lY6XTF9tPv}
}
Thank you for your interest in our work.
13 commits
SMolInstruct is a large-scale, comprehensive, and high-quality instruction tuning dataset crafted for chemistry. It centers around small molecules, and contains 14 meticulously selected tasks and over 3M samples.
51
13 commits
2 linked in READMEs
updated Sep 18, 2024
SMolInstruct is a large-scale, comprehensive, and high-quality instruction tuning dataset crafted for chemistry. It centers around small molecules, and contains 14 meticulously selected tasks and over 3M samples.
This dataset has both SMILES and SELFIES versions, and you could switch to SELFIES by using use_selfies=True when loading.
Version History
sample_id in each sample. Also added doc for insert_core_tags which you can control if core information is wraped with core tags (e.g., <SMILES> ... </SMILES>).use_test_subset=True. Also added use_first to load the first specific number of samples for each task. See below for details.<SMILES> <SMILES> ... </SMILES> </SMILES>) for retrosynthesis. We recommend all to use this or newer version.Page: https://osu-nlp-group.github.io/LlaSMol
Code: https://github.com/OSU-NLP-Group/LlaSMol
Models: https://huggingface.co/osunlp/LlaSMol
The following figure illustrates the tasks and corresponding examples.

The following table shows the tasks and statistics over the SMolInstruct dataset, where “Qry.” and “Resp.” are average lengths of queries and responses, respectively.

An example is shown below:
{
'sample_id': 'forward_synthesis.train.1'
'input': 'Based on the given reactants and reagents: <SMILES> CCCCCCCC/C=C\\CCCCCCCC(=O)OCCNCCOC(=O)CCCCCCC/C=C\\CCCCCCCC.CCN=C=NCCCN(C)C.CN(C)C1=CC=NC=C1.CN(C)CCSCC(=O)O.CO.Cl.ClCCl.O.O=C(O)C(F)(F)F.O=C([O-])[O-].[K+] </SMILES>, what product could potentially be produced?',
'output': 'The product can be <SMILES> CCCCCCCC/C=C\\CCCCCCCC(=O)OCCN(CCOC(=O)CCCCCCC/C=C\\CCCCCCCC)C(=O)CSCCN(C)C </SMILES> .',
'raw_input': 'CCCCCCCC/C=C\\CCCCCCCC(=O)OCCNCCOC(=O)CCCCCCC/C=C\\CCCCCCCC.CCN=C=NCCCN(C)C.CN(C)C1=CC=NC=C1.CN(C)CCSCC(=O)O.CO.Cl.ClCCl.O.O=C(O)C(F)(F)F.O=C([O-])[O-].[K+]',
'raw_output': 'CCCCCCCC/C=C\\CCCCCCCC(=O)OCCN(CCOC(=O)CCCCCCC/C=C\\CCCCCCCC)C(=O)CSCCN(C)C',
'split': 'train',
'task': 'forward_synthesis',
'input_core_tag_left': '<SMILES>',
'input_core_tag_right': '</SMILES>',
'output_core_tag_left': '<SMILES>',
'output_core_tag_right': '</SMILES>',
'target': None
}
You can use the following lines to load the dataset:
from datasets import load_dataset
dataset = load_dataset('osunlp/SMolInstruct')
train_set = dataset['train']
validation_set = dataset['validation']
test_set = dataset['test']
A SELFIES version could also be used, by simplying adding an argument:
dataset = load_dataset('osunlp/SMolInstruct', use_selfies=True)
You can also specify what tasks to load:
ALL_TASKS = (
'forward_synthesis',
'retrosynthesis',
'molecule_captioning',
'molecule_generation',
'name_conversion-i2f',
'name_conversion-i2s',
'name_conversion-s2f',
'name_conversion-s2i',
'property_prediction-esol',
'property_prediction-lipo',
'property_prediction-bbbp',
'property_prediction-clintox',
'property_prediction-hiv',
'property_prediction-sider',
)
train_set = load_dataset('osunlp/SMolInstruct', tasks=ALL_TASKS)
You could use use_test_subset=True to use a subset of the test set, to quickly evaluate your models. In this subset, each task has at most 200 samples.
test_set = load_dataset('osunlp/SMolInstruct', split='test', use_test_subset=True)
You could also use_first=INTEGER to load only first at most INTEGER samples for each task.
# load first 500 samples for each task
test_set = load_dataset('osunlp/SMolInstruct', split='test', use_first=500)
The argument insert_core_tags can control whether the core tags should be added. By default, it's True.
test_set = load_dataset('osunlp/SMolInstruct', split='test', insert_core_tags=False)
The evaluation code will be at https://github.com/OSU-NLP-Group/LlaSMol.
The construction of SMolInstruct goes through a four-step pipeline:
The SMolInstruct dataset is licensed under CC BY 4.0.
We emphatically urge all users to adhere to the highest ethical standards when using our dataset, including maintaining fairness, transparency, and responsibility in their research. Any usage of the dataset that may lead to harm or pose a detriment to society is strictly forbidden.
If our paper or related resources prove valuable to your research, we kindly ask for citation. Please feel free to contact us with any inquiries.
@inproceedings{
yu2024llasmol,
title={Lla{SM}ol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset},
author={Botao Yu and Frazier N. Baker and Ziqi Chen and Xia Ning and Huan Sun},
booktitle={First Conference on Language Modeling},
year={2024},
url={https://openreview.net/forum?id=lY6XTF9tPv}
}
Thank you for your interest in our work.
13 commits