{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/permutation-invariant-graph-to-sequence-model-1","title":"Permutation invariant graph-to-sequence model for template-free retrosynthesis and reaction prediction","arxiv_id":"2110.09681","date":"2021-10-19","proceeding":null,"authors":["Zhengkai Tu","Connor W. Coley"],"abstract":"Synthesis planning and reaction outcome prediction are two fundamental problems in computer-aided organic chemistry for which a variety of data-driven approaches have emerged. Natural language approaches that model each problem as a SMILES-to-SMILES translation lead to a simple end-to-end formulation, reduce the need for data preprocessing, and enable the use of well-optimized machine translation model architectures. However, SMILES representations are not an efficient representation for capturing information about molecular structures, as evidenced by the success of SMILES augmentation to boost empirical performance. Here, we describe a novel Graph2SMILES model that combines the power of Transformer models for text generation with the permutation invariance of molecular graph encoders that mitigates the need for input data augmentation. As an end-to-end architecture, Graph2SMILES can be used as a drop-in replacement for the Transformer in any task involving molecule(s)-to-molecule(s) transformations. In our encoder, an attention-augmented directed message passing neural network (D-MPNN) captures local chemical environments, and the global attention encoder allows for long-range and intermolecular interactions, enhanced by graph-aware positional embedding. Graph2SMILES improves the top-1 accuracy of the Transformer baselines by $1.7\\%$ and $1.9\\%$ for reaction outcome prediction on USPTO_480k and USPTO_STEREO datasets respectively, and by $9.8\\%$ for one-step retrosynthesis on the USPTO_50k dataset.","url_abs":"https://arxiv.org/abs/2110.09681v1","url_pdf":"https://arxiv.org/pdf/2110.09681v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"permutation-invariant-graph-to-sequence-model-1","repo_url":"https://github.com/coleygroup/graph2smiles","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"graph-to-sequence","task_name":"Graph-to-Sequence"},{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"retrosynthesis","task_name":"Retrosynthesis"},{"task_slug":"single-step-retrosynthesis","task_name":"Single-step retrosynthesis"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"translation","task_name":"Translation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/single-step-retrosynthesis-on-uspto-50k","task":"Single-step retrosynthesis","dataset":"USPTO-50k","model":"Graph2SMILES-D-GCN (reaction class unknown)","rank_in_archive_order":26,"of":35,"metrics":{"Top-1 accuracy":"52.9","Top-10 accuracy":"72.9","Top-3 accuracy":"66.5","Top-5 accuracy":"70.0"},"uses_additional_data":false},{"leaderboard":"/sota/single-step-retrosynthesis-on-uspto-50k","task":"Single-step retrosynthesis","dataset":"USPTO-50k","model":"Graph2SMILES-D-GAT (reaction class unknown)","rank_in_archive_order":30,"of":35,"metrics":{"Top-1 accuracy":"51.2","Top-10 accuracy":"73.9","Top-3 accuracy":"66.3","Top-5 accuracy":"70.4"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.09681","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.09681"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/coleygroup/graph2smiles","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"83a7b894e024a84e","entry":"get_seq_features_from_line","repo":"coleygroup/graph2smiles","repo_kind":"official","path":"preprocess.py","file_url":"https://github.com/coleygroup/graph2smiles/blob/HEAD/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"83a7b894e024a84e"}},{"code_sha256_prefix":"90a6779b5bfe7978","entry":"get_sin_encodings","repo":"coleygroup/graph2smiles","repo_kind":"official","path":"models/attention_xl.py","file_url":"https://github.com/coleygroup/graph2smiles/blob/HEAD/models/attention_xl.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"90a6779b5bfe7978"}},{"code_sha256_prefix":"0087614c4f578615","entry":"get_token_ids","repo":"coleygroup/graph2smiles","repo_kind":"official","path":"preprocess.py","file_url":"https://github.com/coleygroup/graph2smiles/blob/HEAD/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0087614c4f578615"}},{"code_sha256_prefix":"0971a9bc73485df2","entry":"index_scatter","repo":"coleygroup/graph2smiles","repo_kind":"official","path":"models/model_utils.py","file_url":"https://github.com/coleygroup/graph2smiles/blob/HEAD/models/model_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0971a9bc73485df2"}},{"code_sha256_prefix":"6cfa3e07a37cd10c","entry":"index_select_ND","repo":"coleygroup/graph2smiles","repo_kind":"official","path":"models/model_utils.py","file_url":"https://github.com/coleygroup/graph2smiles/blob/HEAD/models/model_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6cfa3e07a37cd10c"}},{"code_sha256_prefix":"0cbe25907544a30e","entry":"tokenize_smiles","repo":"coleygroup/graph2smiles","repo_kind":"official","path":"utils/data_utils.py","file_url":"https://github.com/coleygroup/graph2smiles/blob/HEAD/utils/data_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0cbe25907544a30e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}