{"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/reactxt-understanding-molecular-reaction-ship","title":"ReactXT: Understanding Molecular \"Reaction-ship\" via Reaction-Contextualized Molecule-Text Pretraining","arxiv_id":"2405.14225","date":"2024-05-23","proceeding":null,"authors":["Zhiyuan Liu","Yaorui Shi","An Zhang","Sihang Li","Enzhi Zhang","Xiang Wang","Kenji Kawaguchi","Tat-Seng Chua"],"abstract":"Molecule-text modeling, which aims to facilitate molecule-relevant tasks with a textual interface and textual knowledge, is an emerging research direction. Beyond single molecules, studying reaction-text modeling holds promise for helping the synthesis of new materials and drugs. However, previous works mostly neglect reaction-text modeling: they primarily focus on modeling individual molecule-text pairs or learning chemical reactions without texts in context. Additionally, one key task of reaction-text modeling -- experimental procedure prediction -- is less explored due to the absence of an open-source dataset. The task is to predict step-by-step actions of conducting chemical experiments and is crucial to automating chemical synthesis. To resolve the challenges above, we propose a new pretraining method, ReactXT, for reaction-text modeling, and a new dataset, OpenExp, for experimental procedure prediction. Specifically, ReactXT features three types of input contexts to incrementally pretrain LMs. Each of the three input contexts corresponds to a pretraining task to improve the text-based understanding of either reactions or single molecules. ReactXT demonstrates consistent improvements in experimental procedure prediction and molecule captioning and offers competitive results in retrosynthesis. Our code is available at https://github.com/syr-cn/ReactXT.","url_abs":"https://arxiv.org/abs/2405.14225v1","url_pdf":"https://arxiv.org/pdf/2405.14225v1.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":"reactxt-understanding-molecular-reaction-ship","repo_url":"https://github.com/syr-cn/reactxt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"molecule-captioning","task_name":"Molecule Captioning"},{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"retrosynthesis","task_name":"Retrosynthesis"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.14225","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14225"}},"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/syr-cn/reactxt","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"ran_violates":1,"ran":4,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":10,"ran":7,"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":"9b4dff79d5e6102c","entry":"apply_rotary_pos_emb","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/modeling_llama.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/modeling_llama.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9b4dff79d5e6102c"}},{"code_sha256_prefix":"4cb732f513d69dfd","entry":"disabled_train","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/blip2.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/blip2.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4cb732f513d69dfd"}},{"code_sha256_prefix":"f0e4be065f35a5c6","entry":"escape_custom_split_sequence","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/blip2_opt.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/blip2_opt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f0e4be065f35a5c6"}},{"code_sha256_prefix":"53d5373b3854c8e7","entry":"get_module_state_dict","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/blip2_model.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/blip2_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"53d5373b3854c8e7"}},{"code_sha256_prefix":"d88f0d9eb3ea4611","entry":"get_tokens_as_list","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/help_funcs.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/help_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d88f0d9eb3ea4611"}},{"code_sha256_prefix":"e34d5a438d83d62b","entry":"mask_by_len","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/blip2_llama.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/blip2_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e34d5a438d83d62b"}},{"code_sha256_prefix":"b99eea6376d1e212","entry":"rotate_half","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/modeling_llama.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/modeling_llama.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b99eea6376d1e212"}},{"code_sha256_prefix":"d73f14bf46e46bc6","entry":"average_checkpoints","repo":"syr-cn/reactxt","repo_kind":"official","path":"average_ckpt.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/average_ckpt.py","link_basis":"first_harvest_node","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":"d73f14bf46e46bc6"}},{"code_sha256_prefix":"2f19d209d89cd777","entry":"caption_evaluate","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/help_funcs.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/help_funcs.py","link_basis":"first_harvest_node","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":"2f19d209d89cd777"}},{"code_sha256_prefix":"360eb476982c57a5","entry":"get_not_allowed_tokens_ids","repo":"syr-cn/reactxt","repo_kind":"official","path":"model/help_funcs.py","file_url":"https://github.com/syr-cn/reactxt/blob/HEAD/model/help_funcs.py","link_basis":"first_harvest_node","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":"360eb476982c57a5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}