{"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/quantization-without-tears","title":"Quantization without Tears","arxiv_id":"2411.13918","date":"2024-11-21","proceeding":"CVPR 2025 1","authors":["Minghao Fu","Hao Yu","Jie Shao","Junjie Zhou","Ke Zhu","Jianxin Wu"],"abstract":"Deep neural networks, while achieving remarkable success across diverse tasks, demand significant resources, including computation, GPU memory, bandwidth, storage, and energy. Network quantization, as a standard compression and acceleration technique, reduces storage costs and enables potential inference acceleration by discretizing network weights and activations into a finite set of integer values. However, current quantization methods are often complex and sensitive, requiring extensive task-specific hyperparameters, where even a single misconfiguration can impair model performance, limiting generality across different models and tasks. In this paper, we propose Quantization without Tears (QwT), a method that simultaneously achieves quantization speed, accuracy, simplicity, and generality. The key insight of QwT is to incorporate a lightweight additional structure into the quantized network to mitigate information loss during quantization. This structure consists solely of a small set of linear layers, keeping the method simple and efficient. More importantly, it provides a closed-form solution, allowing us to improve accuracy effortlessly under 2 minutes. Extensive experiments across various vision, language, and multimodal tasks demonstrate that QwT is both highly effective and versatile. In fact, our approach offers a robust solution for network quantization that combines simplicity, accuracy, and adaptability, which provides new insights for the design of novel quantization paradigms.","url_abs":"https://arxiv.org/abs/2411.13918v2","url_pdf":"https://arxiv.org/pdf/2411.13918v2.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":"quantization-without-tears","repo_url":"https://github.com/wujx2001/QwT","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"GPU"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2411.13918","atlas_url":"https://app.syntology.ai/?focus=2411.13918","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.13918"}},"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/wujx2001/QwT","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":3,"ran_fixture":2,"unverified":4},"by_repo_kind":{"official":{"samples":9,"ran":5,"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":"2a80220dabcb742a","entry":"conv1x1","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-RepQ-ViT/utils/resnet.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-RepQ-ViT/utils/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a80220dabcb742a"}},{"code_sha256_prefix":"600ff2c45e0de056","entry":"conv3x3","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-RepQ-ViT/utils/resnet.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-RepQ-ViT/utils/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"600ff2c45e0de056"}},{"code_sha256_prefix":"0772c5bcc39fc675","entry":"window_attention_forward","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-RepQ-ViT/utils/build_model.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-RepQ-ViT/utils/build_model.py","link_basis":"plan_row","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":"80c66c535be6f491","entry":"window_partition","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-latency-test/models/quant_swin_transformer.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-latency-test/models/quant_swin_transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"80c66c535be6f491"}},{"code_sha256_prefix":"b83f31fb8b7c976a","entry":"window_reverse","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-latency-test/models/quant_swin_transformer.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-latency-test/models/quant_swin_transformer.py","link_basis":"plan_row","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":"b83f31fb8b7c976a"}},{"code_sha256_prefix":"537453ba638574e2","entry":"attention_forward","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-RepQ-ViT/utils/build_model.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-RepQ-ViT/utils/build_model.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":"537453ba638574e2"}},{"code_sha256_prefix":"5dac11fdc41c896b","entry":"checkpoint_filter_fn","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-latency-test/models/quant_vision_transformer.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-latency-test/models/quant_vision_transformer.py","link_basis":"harvester_set","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":"5dac11fdc41c896b"}},{"code_sha256_prefix":"36f8a6a7e6ca1052","entry":"quant_model_resnet","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-RepQ-ViT/quant/quant_model_resnet.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-RepQ-ViT/quant/quant_model_resnet.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":"36f8a6a7e6ca1052"}},{"code_sha256_prefix":"1dbef2d4da4ee10f","entry":"resize_pos_embed","repo":"wujx2001/QwT","repo_kind":"official","path":"QwT-cls-latency-test/models/quant_vision_transformer.py","file_url":"https://github.com/wujx2001/QwT/blob/HEAD/QwT-cls-latency-test/models/quant_vision_transformer.py","link_basis":"harvester_set","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":"1dbef2d4da4ee10f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}