{"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/fastvar-linear-visual-autoregressive-modeling","title":"FastVAR: Linear Visual Autoregressive Modeling via Cached Token Pruning","arxiv_id":"2503.23367","date":"2025-03-30","proceeding":null,"authors":["Hang Guo","Yawei Li","Taolin Zhang","Jiangshan Wang","Tao Dai","Shu-Tao Xia","Luca Benini"],"abstract":"Visual Autoregressive (VAR) modeling has gained popularity for its shift towards next-scale prediction. However, existing VAR paradigms process the entire token map at each scale step, leading to the complexity and runtime scaling dramatically with image resolution. To address this challenge, we propose FastVAR, a post-training acceleration method for efficient resolution scaling with VARs. Our key finding is that the majority of latency arises from the large-scale step where most tokens have already converged. Leveraging this observation, we develop the cached token pruning strategy that only forwards pivotal tokens for scale-specific modeling while using cached tokens from previous scale steps to restore the pruned slots. This significantly reduces the number of forwarded tokens and improves the efficiency at larger resolutions. Experiments show the proposed FastVAR can further speedup FlashAttention-accelerated VAR by 2.7$\\times$ with negligible performance drop of <1%. We further extend FastVAR to zero-shot generation of higher resolution images. In particular, FastVAR can generate one 2K image with 15GB memory footprints in 1.5s on a single NVIDIA 3090 GPU. Code is available at https://github.com/csguoh/FastVAR.","url_abs":"https://arxiv.org/abs/2503.23367v1","url_pdf":"https://arxiv.org/pdf/2503.23367v1.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":"fastvar-linear-visual-autoregressive-modeling","repo_url":"https://github.com/csguoh/fastvar","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"2k","task_name":"2k"},{"task_slug":null,"task_name":"GPU"}],"methods":[{"method_slug":"pruning","method_name":"Pruning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2503.23367","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2503.23367"}},"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/csguoh/fastvar","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"unverified":11},"by_repo_kind":{"official":{"samples":14,"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":0,"samples":[{"code_sha256_prefix":"42125baaa5c021b6","entry":"apply_rotary_emb","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/basic.py","link_basis":"harvester_set","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":"42125baaa5c021b6"}},{"code_sha256_prefix":"b4a8295838aac5c1","entry":"get_dropout_layer","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/fastvar_basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/fastvar_basic.py","link_basis":"harvester_set","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":"b4a8295838aac5c1"}},{"code_sha256_prefix":"94b02b98b65ce1b4","entry":"precompute_rope2d_freqs_grid","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/basic.py","link_basis":"harvester_set","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":"94b02b98b65ce1b4"}},{"code_sha256_prefix":"9e16906b7f949f04","entry":"apply_rotary_emb_fastvar","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/fastvar_basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/fastvar_basic.py","link_basis":"harvester_set","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":"9e16906b7f949f04"}},{"code_sha256_prefix":"bb07b7c6bc141e2d","entry":"compute_merge","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/fastvar_utils.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/fastvar_utils.py","link_basis":"harvester_set","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":"bb07b7c6bc141e2d"}},{"code_sha256_prefix":"974751f30ae5dccd","entry":"compute_merge","repo":"csguoh/fastvar","repo_kind":"official","path":"HART/hart/modules/networks/fastvar_utils.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/HART/hart/modules/networks/fastvar_utils.py","link_basis":"harvester_set","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":"974751f30ae5dccd"}},{"code_sha256_prefix":"942c492abe601d24","entry":"do_nothing","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/fastvar_utils.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/fastvar_utils.py","link_basis":"harvester_set","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":"942c492abe601d24"}},{"code_sha256_prefix":"0a9d5c3882889998","entry":"features2image","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/bitwise_self_correction.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/bitwise_self_correction.py","link_basis":"harvester_set","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":"0a9d5c3882889998"}},{"code_sha256_prefix":"9bd25e1e6d3188a3","entry":"get_position_ids","repo":"csguoh/fastvar","repo_kind":"official","path":"HART/hart/modules/networks/fastvar_basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/HART/hart/modules/networks/fastvar_basic.py","link_basis":"harvester_set","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":"9bd25e1e6d3188a3"}},{"code_sha256_prefix":"82c722b23631ab21","entry":"get_position_ids_1d","repo":"csguoh/fastvar","repo_kind":"official","path":"HART/hart/modules/networks/fastvar_basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/HART/hart/modules/networks/fastvar_basic.py","link_basis":"harvester_set","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":"82c722b23631ab21"}},{"code_sha256_prefix":"9ba6c0e0e8e4e50e","entry":"labels2image","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/bitwise_self_correction.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/bitwise_self_correction.py","link_basis":"harvester_set","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":"9ba6c0e0e8e4e50e"}},{"code_sha256_prefix":"a2661ae675e65815","entry":"masked_previous_scale_cache","repo":"csguoh/fastvar","repo_kind":"official","path":"Infinity/infinity/models/fastvar_utils.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/Infinity/infinity/models/fastvar_utils.py","link_basis":"harvester_set","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":"a2661ae675e65815"}},{"code_sha256_prefix":"c24fea416022c9ec","entry":"masked_previous_scale_cache","repo":"csguoh/fastvar","repo_kind":"official","path":"HART/hart/modules/networks/fastvar_utils.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/HART/hart/modules/networks/fastvar_utils.py","link_basis":"harvester_set","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":"c24fea416022c9ec"}},{"code_sha256_prefix":"f85408c04c9c626f","entry":"slow_attn","repo":"csguoh/fastvar","repo_kind":"official","path":"HART/hart/modules/networks/fastvar_basic.py","file_url":"https://github.com/csguoh/fastvar/blob/HEAD/HART/hart/modules/networks/fastvar_basic.py","link_basis":"harvester_set","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":"f85408c04c9c626f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}