{"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/algm-adaptive-local-then-global-token-merging-1","title":"ALGM: Adaptive Local-then-Global Token Merging for Efficient Semantic Segmentation with Plain Vision Transformers","arxiv_id":"2406.09936","date":"2024-06-14","proceeding":"CVPR 2024 1","authors":["Narges Norouzi","Svetlana Orlova","Daan de Geus","Gijs Dubbelman"],"abstract":"This work presents Adaptive Local-then-Global Merging (ALGM), a token reduction method for semantic segmentation networks that use plain Vision Transformers. ALGM merges tokens in two stages: (1) In the first network layer, it merges similar tokens within a small local window and (2) halfway through the network, it merges similar tokens across the entire image. This is motivated by an analysis in which we found that, in those situations, tokens with a high cosine similarity can likely be merged without a drop in segmentation quality. With extensive experiments across multiple datasets and network configurations, we show that ALGM not only significantly improves the throughput by up to 100%, but can also enhance the mean IoU by up to +1.1, thereby achieving a better trade-off between segmentation quality and efficiency than existing methods. Moreover, our approach is adaptive during inference, meaning that the same model can be used for optimal efficiency or accuracy, depending on the application. Code is available at https://tue-mps.github.io/ALGM.","url_abs":"https://arxiv.org/abs/2406.09936v1","url_pdf":"https://arxiv.org/pdf/2406.09936v1.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":"algm-adaptive-local-then-global-token-merging-1","repo_url":"https://github.com/tue-mps/algm-segmenter","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"token-reduction","task_name":"Token Reduction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.09936","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.09936"}},"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/tue-mps/algm-segmenter","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":5,"ran_honours":1,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"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":12,"samples":[{"code_sha256_prefix":"f63b55edf664ebb2","entry":"dataset_prepare","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"segm/flops.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/segm/flops.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"f63b55edf664ebb2"}},{"code_sha256_prefix":"969e8250d805a154","entry":"do_nothing","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/global_merge.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/global_merge.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"969e8250d805a154"}},{"code_sha256_prefix":"3869ab58c2773dbd","entry":"generate_colormap","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/vis.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/vis.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"3869ab58c2773dbd"}},{"code_sha256_prefix":"6a84e03ae16e5898","entry":"get_dataset_validaion_path","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"segm/flops.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/segm/flops.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"6a84e03ae16e5898"}},{"code_sha256_prefix":"7de1b6333a4490bc","entry":"merge_source","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/local_merge.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/local_merge.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7de1b6333a4490bc"}},{"code_sha256_prefix":"94e8f254ce489a4b","entry":"parse_r","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/utils.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"94e8f254ce489a4b"}},{"code_sha256_prefix":"2cc3699f9a695af9","entry":"accuracy","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"segm/metrics.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/segm/metrics.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":"2cc3699f9a695af9"}},{"code_sha256_prefix":"eaef07a98678e866","entry":"benchmark","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/utils.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"eaef07a98678e866"}},{"code_sha256_prefix":"4c1e01e17e20d12d","entry":"conditional_pooling","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/local_merge.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/local_merge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"4c1e01e17e20d12d"}},{"code_sha256_prefix":"9726524f57061ce3","entry":"make_visualization","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/vis.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/vis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9726524f57061ce3"}},{"code_sha256_prefix":"4b48cbe3332fcb0c","entry":"merge_wavg","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/local_merge.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/local_merge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"4b48cbe3332fcb0c"}},{"code_sha256_prefix":"6c05551946f3b904","entry":"turbo_matching","repo":"tue-mps/algm-segmenter","repo_kind":"official","path":"algm/algm/global_merge.py","file_url":"https://github.com/tue-mps/algm-segmenter/blob/HEAD/algm/algm/global_merge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"6c05551946f3b904"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}