{"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/training-free-watermarking-for-autoregressive","title":"Training-Free Watermarking for Autoregressive Image Generation","arxiv_id":"2505.14673","date":"2025-05-20","proceeding":null,"authors":["Yu tong","Zihao Pan","Shuai Yang","Kaiyang Zhou"],"abstract":"Invisible image watermarking can protect image ownership and prevent malicious misuse of visual generative models. However, existing generative watermarking methods are mainly designed for diffusion models while watermarking for autoregressive image generation models remains largely underexplored. We propose IndexMark, a training-free watermarking framework for autoregressive image generation models. IndexMark is inspired by the redundancy property of the codebook: replacing autoregressively generated indices with similar indices produces negligible visual differences. The core component in IndexMark is a simple yet effective match-then-replace method, which carefully selects watermark tokens from the codebook based on token similarity, and promotes the use of watermark tokens through token replacement, thereby embedding the watermark without affecting the image quality. Watermark verification is achieved by calculating the proportion of watermark tokens in generated images, with precision further improved by an Index Encoder. Furthermore, we introduce an auxiliary validation scheme to enhance robustness against cropping attacks. Experiments demonstrate that IndexMark achieves state-of-the-art performance in terms of image quality and verification accuracy, and exhibits robustness against various perturbations, including cropping, noises, Gaussian blur, random erasing, color jittering, and JPEG compression.","url_abs":"https://arxiv.org/abs/2505.14673v1","url_pdf":"https://arxiv.org/pdf/2505.14673v1.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":"training-free-watermarking-for-autoregressive","repo_url":"https://github.com/maifoundations/indexmark","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2505.14673","atlas_url":"https://app.syntology.ai/?focus=2505.14673","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2505.14673"}},"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/maifoundations/indexmark","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":10,"ran_honours":2,"unverified":7},"by_repo_kind":{"official":{"samples":19,"ran":12,"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":"9780feca2753ce85","entry":"collate_fn","repo":"maifoundations/indexmark","repo_kind":"official","path":"Index_encoder/ft2_2loss.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/Index_encoder/ft2_2loss.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":"9780feca2753ce85"}},{"code_sha256_prefix":"f6ff7671338c9c92","entry":"find_multiple","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/gpt.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/gpt.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f6ff7671338c9c92"}},{"code_sha256_prefix":"f4971cc46e80bbe7","entry":"green_check","repo":"maifoundations/indexmark","repo_kind":"official","path":"attack_val.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/attack_val.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":"f4971cc46e80bbe7"}},{"code_sha256_prefix":"392c601621077a9c","entry":"image_distortion","repo":"maifoundations/indexmark","repo_kind":"official","path":"attack_val.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/attack_val.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":"392c601621077a9c"}},{"code_sha256_prefix":"013417e3304262ee","entry":"load_image_to_tensor","repo":"maifoundations/indexmark","repo_kind":"official","path":"Index_encoder/preprocess_for_finetuning_zq.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/Index_encoder/preprocess_for_finetuning_zq.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":"013417e3304262ee"}},{"code_sha256_prefix":"52d6aa62b8ee01d3","entry":"load_image_to_tensor","repo":"maifoundations/indexmark","repo_kind":"official","path":"verification.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/verification.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":"52d6aa62b8ee01d3"}},{"code_sha256_prefix":"551428d47bce5e23","entry":"load_pil_image_to_tensor","repo":"maifoundations/indexmark","repo_kind":"official","path":"attack_val.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/attack_val.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":"551428d47bce5e23"}},{"code_sha256_prefix":"ebbba64af32405e0","entry":"mscocojson2list","repo":"maifoundations/indexmark","repo_kind":"official","path":"generation.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/generation.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":"ebbba64af32405e0"}},{"code_sha256_prefix":"7f53b2cdcd16fad9","entry":"precompute_freqs_cis_2d","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/gpt.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/gpt.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7f53b2cdcd16fad9"}},{"code_sha256_prefix":"a3052bf4fc15d6da","entry":"sample","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/generatearcon.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/generatearcon.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":"a3052bf4fc15d6da"}},{"code_sha256_prefix":"72fe1f0d7fd26e7b","entry":"vectorized_replacement_process","repo":"maifoundations/indexmark","repo_kind":"official","path":"generation.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/generation.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":"72fe1f0d7fd26e7b"}},{"code_sha256_prefix":"723170b20751a59f","entry":"vectorized_replacement_process","repo":"maifoundations/indexmark","repo_kind":"official","path":"generation_c2i.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/generation_c2i.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":"723170b20751a59f"}},{"code_sha256_prefix":"5cceaa9d0edbce06","entry":"build_imagenet","repo":"maifoundations/indexmark","repo_kind":"official","path":"dataset/imagenet.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/dataset/imagenet.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":"5cceaa9d0edbce06"}},{"code_sha256_prefix":"b6635606f35f6a1a","entry":"build_imagenet_code","repo":"maifoundations/indexmark","repo_kind":"official","path":"dataset/imagenet.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/dataset/imagenet.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":"b6635606f35f6a1a"}},{"code_sha256_prefix":"4a1df45063de3ec2","entry":"load_prompts_from_csv","repo":"maifoundations/indexmark","repo_kind":"official","path":"generation.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/generation.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":"4a1df45063de3ec2"}},{"code_sha256_prefix":"9dac59261197935f","entry":"logits_to_probs","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/generate.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/generate.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":"9dac59261197935f"}},{"code_sha256_prefix":"0f0ff4e443413018","entry":"precompute_freqs_cis","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/gpt.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/gpt.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":"0f0ff4e443413018"}},{"code_sha256_prefix":"de8908ac0f302419","entry":"sample","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/generate.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/generate.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":"de8908ac0f302419"}},{"code_sha256_prefix":"f2fea48028c7ae80","entry":"top_k_top_p_filtering","repo":"maifoundations/indexmark","repo_kind":"official","path":"autoregressive/models/generate.py","file_url":"https://github.com/maifoundations/indexmark/blob/HEAD/autoregressive/models/generate.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":"f2fea48028c7ae80"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}