{"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/psaq-vit-v2-towards-accurate-and-general-data","title":"PSAQ-ViT V2: Towards Accurate and General Data-Free Quantization for Vision Transformers","arxiv_id":"2209.05687","date":"2022-09-13","proceeding":null,"authors":["Zhikai Li","Mengjuan Chen","Junrui Xiao","Qingyi Gu"],"abstract":"Data-free quantization can potentially address data privacy and security concerns in model compression, and thus has been widely investigated. Recently, PSAQ-ViT designs a relative value metric, patch similarity, to generate data from pre-trained vision transformers (ViTs), achieving the first attempt at data-free quantization for ViTs. In this paper, we propose PSAQ-ViT V2, a more accurate and general data-free quantization framework for ViTs, built on top of PSAQ-ViT. More specifically, following the patch similarity metric in PSAQ-ViT, we introduce an adaptive teacher-student strategy, which facilitates the constant cyclic evolution of the generated samples and the quantized model (student) in a competitive and interactive fashion under the supervision of the full-precision model (teacher), thus significantly improving the accuracy of the quantized model. Moreover, without the auxiliary category guidance, we employ the task- and model-independent prior information, making the general-purpose scheme compatible with a broad range of vision tasks and models. Extensive experiments are conducted on various models on image classification, object detection, and semantic segmentation tasks, and PSAQ-ViT V2, with the naive quantization strategy and without access to real-world data, consistently achieves competitive results, showing potential as a powerful baseline on data-free quantization for ViTs. For instance, with Swin-S as the (backbone) model, 8-bit quantization reaches 82.13 top-1 accuracy on ImageNet, 50.9 box AP and 44.1 mask AP on COCO, and 47.2 mIoU on ADE20K. We hope that accurate and general PSAQ-ViT V2 can serve as a potential and practice solution in real-world applications involving sensitive data. Code is released and merged at: https://github.com/zkkli/PSAQ-ViT.","url_abs":"https://arxiv.org/abs/2209.05687v2","url_pdf":"https://arxiv.org/pdf/2209.05687v2.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":"psaq-vit-v2-towards-accurate-and-general-data","repo_url":"https://github.com/zkkli/psaq-vit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"data-free-quantization","task_name":"Data Free Quantization"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"model-compression","task_name":"Model Compression"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"quantization","task_name":"Quantization"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2209.05687","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2209.05687"}},"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/zkkli/psaq-vit","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_fixture":3,"ran_draft_wrong":1,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":7,"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":1,"samples":[{"code_sha256_prefix":"18badd533b52adb3","entry":"accuracy","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"18badd533b52adb3"}},{"code_sha256_prefix":"3bf709271b1e8d32","entry":"attention_forward","repo":"zkkli/psaq-vit","repo_kind":"official","path":"utils/build_model.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/utils/build_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3bf709271b1e8d32"}},{"code_sha256_prefix":"3e69f59a60befe42","entry":"str2model","repo":"zkkli/psaq-vit","repo_kind":"official","path":"test_quant.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/test_quant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3e69f59a60befe42"}},{"code_sha256_prefix":"5132539cd8e7f9b0","entry":"validate","repo":"zkkli/psaq-vit","repo_kind":"official","path":"test_quant.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/test_quant.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5132539cd8e7f9b0"}},{"code_sha256_prefix":"0772c5bcc39fc675","entry":"window_attention_forward","repo":"zkkli/psaq-vit","repo_kind":"official","path":"utils/build_model.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/utils/build_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0772c5bcc39fc675"}},{"code_sha256_prefix":"6648bb7d83d992ca","entry":"deit_base_patch16_224","repo":"zkkli/psaq-vit","repo_kind":"official","path":"models/vit_quant.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/models/vit_quant.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":"6648bb7d83d992ca"}},{"code_sha256_prefix":"4ad232e463484c01","entry":"deit_small_patch16_224","repo":"zkkli/psaq-vit","repo_kind":"official","path":"models/vit_quant.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/models/vit_quant.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":"4ad232e463484c01"}},{"code_sha256_prefix":"1af7645b46407155","entry":"deit_tiny_patch16_224","repo":"zkkli/psaq-vit","repo_kind":"official","path":"models/vit_quant.py","file_url":"https://github.com/zkkli/psaq-vit/blob/HEAD/models/vit_quant.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":"1af7645b46407155"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}