{"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/triplet-interaction-improves-graph","title":"Triplet Interaction Improves Graph Transformers: Accurate Molecular Graph Learning with Triplet Graph Transformers","arxiv_id":"2402.04538","date":"2024-02-07","proceeding":null,"authors":["Md Shamim Hussain","Mohammed J. Zaki","Dharmashankar Subramanian"],"abstract":"Graph transformers typically lack third-order interactions, limiting their geometric understanding which is crucial for tasks like molecular geometry prediction. We propose the Triplet Graph Transformer (TGT) that enables direct communication between pairs within a 3-tuple of nodes via novel triplet attention and aggregation mechanisms. TGT is applied to molecular property prediction by first predicting interatomic distances from 2D graphs and then using these distances for downstream tasks. A novel three-stage training procedure and stochastic inference further improve training efficiency and model performance. Our model achieves new state-of-the-art (SOTA) results on open challenge benchmarks PCQM4Mv2 and OC20 IS2RE. We also obtain SOTA results on QM9, MOLPCBA, and LIT-PCBA molecular property prediction benchmarks via transfer learning. We also demonstrate the generality of TGT with SOTA results on the traveling salesman problem (TSP).","url_abs":"https://arxiv.org/abs/2402.04538v2","url_pdf":"https://arxiv.org/pdf/2402.04538v2.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":"triplet-interaction-improves-graph","repo_url":"https://github.com/shamim-hussain/tgt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"triplet-interaction-improves-graph","repo_url":"https://github.com/shamim-hussain/egt_pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"triplet-interaction-improves-graph","repo_url":"https://github.com/shamim-hussain/egt_triangular","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"drug-discovery","task_name":"Drug Discovery"},{"task_slug":"graph-learning","task_name":"Graph Learning"},{"task_slug":"graph-property-prediction","task_name":"Graph Property Prediction"},{"task_slug":"graph-regression","task_name":"Graph Regression"},{"task_slug":"initial-structure-to-relaxed-energy-is2re-1","task_name":"Initial Structure to Relaxed Energy (IS2RE), Direct"},{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"molecular-property-prediction","task_name":"Molecular Property Prediction"},{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"property-prediction","task_name":"Property Prediction"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"},{"task_slug":"traveling-salesman-problem","task_name":"Traveling Salesman Problem"},{"task_slug":null,"task_name":"Triplet"}],"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":"graph-transformer","method_name":"Graph Transformer"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"lapeigen","method_name":"LapEigen"},{"method_slug":"laplacian-pe","method_name":"Laplacian PE"},{"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"},{"method_slug":"triplet-attention","method_name":"Triplet Attention"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/drug-discovery-on-lit-pcba-aldh1","task":"Drug Discovery","dataset":"LIT-PCBA(ALDH1)","model":"EGT+TGT-At-DP","rank_in_archive_order":1,"of":4,"metrics":{"AUC":"0.806"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-lit-pcba-kat2a","task":"Drug Discovery","dataset":"LIT-PCBA(KAT2A)","model":"EGT+TGT-At-DP","rank_in_archive_order":1,"of":4,"metrics":{"AUC":"0.746"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-lit-pcba-mapk1","task":"Drug Discovery","dataset":"LIT-PCBA(MAPK1)","model":"EGT+TGT-At-DP","rank_in_archive_order":1,"of":4,"metrics":{"AUC":"0.743"},"uses_additional_data":false},{"leaderboard":"/sota/graph-property-prediction-on-ogbg-molpcba","task":"Graph Property Prediction","dataset":"ogbg-molpcba","model":"TGT-Ag+TGT-At-DP","rank_in_archive_order":4,"of":36,"metrics":{"Ext. data":"Yes","Number of params":"47000000","Test AP":"0.3167 ± 0.0031"},"uses_additional_data":true},{"leaderboard":"/sota/graph-regression-on-pcqm4mv2-lsc","task":"Graph Regression","dataset":"PCQM4Mv2-LSC","model":"TGT-At","rank_in_archive_order":3,"of":20,"metrics":{"Test MAE":"0.0683","Validation MAE":"0.0671"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-tsp-hcp-benchmark-set","task":"Link Prediction","dataset":"TSP/HCP Benchmark set","model":"TGT-Agx4","rank_in_archive_order":1,"of":4,"metrics":{"F1":"0.871"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.04538","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.04538"}},"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":"deterministic:regex_extraction","url":"https://github.com/shamim-hussain/tgt","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shamim-hussain/egt_triangular","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shamim-hussain/egt_pytorch","reach":null}],"summary":{"ran":10,"unverified":3},"by_repo_kind":{"official":{"samples":11,"ran":9,"repositories":1},"listed":{"samples":2,"ran":1,"repositories":2}},"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":"3769fc037188340a","entry":"EGT_Layer","repo":"shamim-hussain/egt_pytorch","repo_kind":"listed","path":"lib/models/egt_layers.py","file_url":"https://github.com/shamim-hussain/egt_pytorch/blob/HEAD/lib/models/egt_layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3769fc037188340a"}},{"code_sha256_prefix":"b18a7da4ce171c3d","entry":"form_degree_scalers","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/tgt/layers/layers.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/tgt/layers/layers.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":"b18a7da4ce171c3d"}},{"code_sha256_prefix":"46e9996c80897eae","entry":"geglu","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/tgt/layers/activations.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/tgt/layers/activations.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":"46e9996c80897eae"}},{"code_sha256_prefix":"ba1213011ced7cc9","entry":"glu","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/tgt/layers/activations.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/tgt/layers/activations.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":"ba1213011ced7cc9"}},{"code_sha256_prefix":"99444cf6f6c68f14","entry":"import_scheme","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/training/execute.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/training/execute.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":"99444cf6f6c68f14"}},{"code_sha256_prefix":"76cce8eb1d1df68c","entry":"safe_load","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/training/config.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/training/config.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":"76cce8eb1d1df68c"}},{"code_sha256_prefix":"600b01d18d7e780d","entry":"safe_load_str","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/training/config.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/training/config.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":"600b01d18d7e780d"}},{"code_sha256_prefix":"9c6fd2a384f6f803","entry":"siglin","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/tgt/layers/triplet.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/tgt/layers/triplet.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":"9c6fd2a384f6f803"}},{"code_sha256_prefix":"ec3a6e8533e97e72","entry":"str_presenter","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/training/config.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/training/config.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":"ec3a6e8533e97e72"}},{"code_sha256_prefix":"c724368b1b6a04e0","entry":"swiglu","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/tgt/layers/activations.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/tgt/layers/activations.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":"c724368b1b6a04e0"}},{"code_sha256_prefix":"ad3053a477c51b49","entry":"TripletAttention","repo":"shamim-hussain/egt_triangular","repo_kind":"listed","path":"lib/tgt/layers/triplet.py","file_url":"https://github.com/shamim-hussain/egt_triangular/blob/HEAD/lib/tgt/layers/triplet.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":"ad3053a477c51b49"}},{"code_sha256_prefix":"923e416970ed8684","entry":"get_configs_from_args","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/training/execute.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/training/execute.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":"923e416970ed8684"}},{"code_sha256_prefix":"3fe477d09a32f159","entry":"get_triplet_layer","repo":"shamim-hussain/tgt","repo_kind":"official","path":"lib/tgt/layers/triplet.py","file_url":"https://github.com/shamim-hussain/tgt/blob/HEAD/lib/tgt/layers/triplet.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":"3fe477d09a32f159"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}