{"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/arxiv-2601-03955","title":"ResTok: Learning Hierarchical Residuals in 1D Visual Tokenizers for Autoregressive Image Generation","arxiv_id":"2601.03955","date":"2026-01-07","proceeding":null,"authors":["Xu Zhang","Cheng Da","Huan Yang","Kun Gai","Ming Lu","Zhan Ma"],"abstract":"Existing 1D visual tokenizers for autoregressive (AR) generation largely follow the design principles of language modeling, as they are built directly upon transformers whose priors originate in language, yielding single-hierarchy latent tokens and treating visual data as flat sequential token streams. However, this language-like formulation overlooks key properties of vision, particularly the hierarchical and residual network designs that have long been essential for convergence and efficiency in visual models. To bring \"vision\" back to vision, we propose the Residual Tokenizer (ResTok), a 1D visual tokenizer that builds hierarchical residuals for both image tokens and latent tokens. The hierarchical representations obtained through progressively merging enable cross-level feature fusion at each layer, substantially enhancing representational capacity. Meanwhile, the semantic residuals between hierarchies prevent information overlap, yielding more concentrated latent distributions that are easier for AR modeling. Cross-level bindings consequently emerge without any explicit constraints. To accelerate the generation process, we further introduce a hierarchical AR generator that substantially reduces sampling steps by predicting an entire level of latent tokens at once rather than generating them strictly token-by-token. Extensive experiments demonstrate that restoring hierarchical residual priors in visual tokenization significantly improves AR image generation, achieving a gFID of 2.34 on ImageNet-256 with only 9 sampling steps. Code is available at https://github.com/Kwai-Kolors/ResTok.","url_abs":"https://arxiv.org/abs/2601.03955","url_pdf":"https://arxiv.org/pdf/2601.03955","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2601.03955","atlas_url":"https://app.syntology.ai/?focus=2601.03955","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2601.03955"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/Kwai-Kolors/ResTok","reach":null}],"summary":{"ran":6,"ran_draft_wrong":1,"ran_fixture":3,"unverified":8},"by_repo_kind":{"found_in_text":{"samples":18,"ran":10,"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":"dc0b1a5e1598b3db","entry":"Attention","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dc0b1a5e1598b3db"}},{"code_sha256_prefix":"331849d453e4a146","entry":"BaseModel","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"331849d453e4a146"}},{"code_sha256_prefix":"e5a6cad693b52a50","entry":"EmbedND","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e5a6cad693b52a50"}},{"code_sha256_prefix":"f92ea3569a8d2a16","entry":"EmbedNDHybrid2DMaker","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f92ea3569a8d2a16"}},{"code_sha256_prefix":"df7e4e4587a3a993","entry":"EmbedNDHybridMulti2DMaker","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"df7e4e4587a3a993"}},{"code_sha256_prefix":"ae6827aeaa6c2f91","entry":"VectorQuantizer","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ae6827aeaa6c2f91"}},{"code_sha256_prefix":"9b90fac7ef321810","entry":"build_hierarchical_causal_mask","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9b90fac7ef321810"}},{"code_sha256_prefix":"8d096c594b535eea","entry":"multi_level_1d_features_to_2d_maps_avg","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8d096c594b535eea"}},{"code_sha256_prefix":"17724d4203fa5863","entry":"rope","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"17724d4203fa5863"}},{"code_sha256_prefix":"88f9ed95e47dbf7d","entry":"sample_multi_level_1d_tokens","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"88f9ed95e47dbf7d"}},{"code_sha256_prefix":"fb1dd34f22935870","entry":"DownsamplingBlock","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb1dd34f22935870"}},{"code_sha256_prefix":"666149bd0f290f52","entry":"ResTok","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"666149bd0f290f52"}},{"code_sha256_prefix":"6b02763c63ccc2bf","entry":"ResTokDecoder","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6b02763c63ccc2bf"}},{"code_sha256_prefix":"51c9fbe126e5f0be","entry":"ResTokEncoder","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"51c9fbe126e5f0be"}},{"code_sha256_prefix":"6d4d68d101ba1d9f","entry":"ResTokTransformerBlock","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6d4d68d101ba1d9f"}},{"code_sha256_prefix":"031fee67ad484ab8","entry":"TransformerBlock","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"031fee67ad484ab8"}},{"code_sha256_prefix":"3444bbcc9065f707","entry":"apply_rope","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3444bbcc9065f707"}},{"code_sha256_prefix":"2fa3d7da1cf96e21","entry":"apply_rope_single","repo":"Kwai-Kolors/ResTok","repo_kind":"found_in_text","path":"modeling/restok.py","file_url":"https://github.com/Kwai-Kolors/ResTok/blob/HEAD/modeling/restok.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2fa3d7da1cf96e21"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CV","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}