{"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/mambamil-enhancing-long-sequence-modeling","title":"MambaMIL: Enhancing Long Sequence Modeling with Sequence Reordering in Computational Pathology","arxiv_id":"2403.06800","date":"2024-03-11","proceeding":null,"authors":["Shu Yang","Yihui Wang","Hao Chen"],"abstract":"Multiple Instance Learning (MIL) has emerged as a dominant paradigm to extract discriminative feature representations within Whole Slide Images (WSIs) in computational pathology. Despite driving notable progress, existing MIL approaches suffer from limitations in facilitating comprehensive and efficient interactions among instances, as well as challenges related to time-consuming computations and overfitting. In this paper, we incorporate the Selective Scan Space State Sequential Model (Mamba) in Multiple Instance Learning (MIL) for long sequence modeling with linear complexity, termed as MambaMIL. By inheriting the capability of vanilla Mamba, MambaMIL demonstrates the ability to comprehensively understand and perceive long sequences of instances. Furthermore, we propose the Sequence Reordering Mamba (SR-Mamba) aware of the order and distribution of instances, which exploits the inherent valuable information embedded within the long sequences. With the SR-Mamba as the core component, MambaMIL can effectively capture more discriminative features and mitigate the challenges associated with overfitting and high computational overhead. Extensive experiments on two public challenging tasks across nine diverse datasets demonstrate that our proposed framework performs favorably against state-of-the-art MIL methods. The code is released at https://github.com/isyangshu/MambaMIL.","url_abs":"https://arxiv.org/abs/2403.06800v1","url_pdf":"https://arxiv.org/pdf/2403.06800v1.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":"mambamil-enhancing-long-sequence-modeling","repo_url":"https://github.com/isyangshu/mambamil","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"mambamil-enhancing-long-sequence-modeling","repo_url":"https://github.com/isyangshu/surgformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"mamba","task_name":"Mamba"},{"task_slug":"multiple-instance-learning","task_name":"Multiple Instance Learning"},{"task_slug":"whole-slide-images","task_name":"whole slide images"}],"methods":[{"method_slug":"aware","method_name":"AWARE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2403.06800","atlas_url":"https://app.syntology.ai/?focus=2403.06800","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.06800"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/isyangshu/mambamil","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/isyangshu/surgformer","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_violates":1,"ran":2,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":6,"ran":4,"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":6,"samples":[{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"isyangshu/mambamil","repo_kind":"official","path":"models/TransMIL.py","file_url":"https://github.com/isyangshu/mambamil/blob/HEAD/models/TransMIL.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"69da3a752922295c","entry":"find_func","repo":"isyangshu/mambamil","repo_kind":"official","path":"utils/core_utils.py","file_url":"https://github.com/isyangshu/mambamil/blob/HEAD/utils/core_utils.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":"69da3a752922295c"}},{"code_sha256_prefix":"369ca48ec835bd84","entry":"load_pkl","repo":"isyangshu/mambamil","repo_kind":"official","path":"utils/file_utils.py","file_url":"https://github.com/isyangshu/mambamil/blob/HEAD/utils/file_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"369ca48ec835bd84"}},{"code_sha256_prefix":"7acefd0931bba0fe","entry":"nll_loss","repo":"isyangshu/mambamil","repo_kind":"official","path":"utils/survival_loss.py","file_url":"https://github.com/isyangshu/mambamil/blob/HEAD/utils/survival_loss.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":"7acefd0931bba0fe"}},{"code_sha256_prefix":"1aa879b87d59c39f","entry":"moore_penrose_iter_pinv","repo":"isyangshu/mambamil","repo_kind":"official","path":"models/TransMIL.py","file_url":"https://github.com/isyangshu/mambamil/blob/HEAD/models/TransMIL.py","link_basis":"harvester_set","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":"1aa879b87d59c39f"}},{"code_sha256_prefix":"8f418c25315c7549","entry":"validate","repo":"isyangshu/mambamil","repo_kind":"official","path":"utils/core_utils.py","file_url":"https://github.com/isyangshu/mambamil/blob/HEAD/utils/core_utils.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":"8f418c25315c7549"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}