{"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/se-sgformer-a-self-explainable-signed-graph","title":"Self-Explainable Graph Transformer for Link Sign Prediction","arxiv_id":"2408.08754","date":"2024-08-16","proceeding":null,"authors":["Lu Li","Jiale Liu","Xingyu Ji","Maojun Wang","Zeyu Zhang"],"abstract":"Signed Graph Neural Networks (SGNNs) have been shown to be effective in analyzing complex patterns in real-world situations where positive and negative links coexist. However, SGNN models suffer from poor explainability, which limit their adoptions in critical scenarios that require understanding the rationale behind predictions. To the best of our knowledge, there is currently no research work on the explainability of the SGNN models. Our goal is to address the explainability of decision-making for the downstream task of link sign prediction specific to signed graph neural networks. Since post-hoc explanations are not derived directly from the models, they may be biased and misrepresent the true explanations. Therefore, in this paper we introduce a Self-Explainable Signed Graph transformer (SE-SGformer) framework, which can not only outputs explainable information while ensuring high prediction accuracy. Specifically, We propose a new Transformer architecture for signed graphs and theoretically demonstrate that using positional encoding based on signed random walks has greater expressive power than current SGNN methods and other positional encoding graph Transformer-based approaches. We constructs a novel explainable decision process by discovering the $K$-nearest (farthest) positive (negative) neighbors of a node to replace the neural network-based decoder for predicting edge signs. These $K$ positive (negative) neighbors represent crucial information about the formation of positive (negative) edges between nodes and thus can serve as important explanatory information in the decision-making process. We conducted experiments on several real-world datasets to validate the effectiveness of SE-SGformer, which outperforms the state-of-the-art methods by improving 2.2\\% prediction accuracy and 73.1\\% explainablity accuracy in the best-case scenario.","url_abs":"https://arxiv.org/abs/2408.08754v2","url_pdf":"https://arxiv.org/pdf/2408.08754v2.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":"se-sgformer-a-self-explainable-signed-graph","repo_url":"https://github.com/liule66/SE-SGformer","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"link-sign-prediction","task_name":"Link Sign Prediction"},{"task_slug":"prediction","task_name":"Prediction"}],"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"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.08754","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.08754"}},"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/liule66/SE-SGformer","reach":{"status":"ok"}}],"summary":{"ran":3,"unverified":6},"by_repo_kind":{"official":{"samples":9,"ran":3,"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":9,"samples":[{"code_sha256_prefix":"d74184b07a6c9e06","entry":"degree_offset","repo":"liule66/SE-SGformer","repo_kind":"official","path":"tmp.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/tmp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d74184b07a6c9e06"}},{"code_sha256_prefix":"e96f1e60a87dfb52","entry":"read_graph","repo":"liule66/SE-SGformer","repo_kind":"official","path":"reader.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/reader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e96f1e60a87dfb52"}},{"code_sha256_prefix":"ee1cb03a0935f392","entry":"semi_row_normalize","repo":"liule66/SE-SGformer","repo_kind":"official","path":"normalizer.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/normalizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ee1cb03a0935f392"}},{"code_sha256_prefix":"ea48315a74f98a02","entry":"index2adj","repo":"liule66/SE-SGformer","repo_kind":"official","path":"tmp.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/tmp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ea48315a74f98a02"}},{"code_sha256_prefix":"c8a5c966037e3872","entry":"iterate","repo":"liule66/SE-SGformer","repo_kind":"official","path":"iterator.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/iterator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c8a5c966037e3872"}},{"code_sha256_prefix":"dacf23dedb2095e6","entry":"load_data","repo":"liule66/SE-SGformer","repo_kind":"official","path":"discriminator.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/discriminator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dacf23dedb2095e6"}},{"code_sha256_prefix":"fc3930430dccabf8","entry":"load_data","repo":"liule66/SE-SGformer","repo_kind":"official","path":"tmp.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/tmp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fc3930430dccabf8"}},{"code_sha256_prefix":"2de872249d4741db","entry":"main","repo":"liule66/SE-SGformer","repo_kind":"official","path":"discriminator.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/discriminator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2de872249d4741db"}},{"code_sha256_prefix":"c21f0fabef38e402","entry":"process_edges","repo":"liule66/SE-SGformer","repo_kind":"official","path":"discriminator.py","file_url":"https://github.com/liule66/SE-SGformer/blob/HEAD/discriminator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c21f0fabef38e402"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}