{"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/improving-post-training-neural-quantization","title":"Improving Post Training Neural Quantization: Layer-wise Calibration and Integer Programming","arxiv_id":"2006.10518","date":"2020-06-14","proceeding":null,"authors":["Itay Hubara","Yury Nahshan","Yair Hanani","Ron Banner","Daniel Soudry"],"abstract":"Lately, post-training quantization methods have gained considerable attention, as they are simple to use, and require only a small unlabeled calibration set. This small dataset cannot be used to fine-tune the model without significant over-fitting. Instead, these methods only use the calibration set to set the activations' dynamic ranges. However, such methods always resulted in significant accuracy degradation, when used below 8-bits (except on small datasets). Here we aim to break the 8-bit barrier. To this end, we minimize the quantization errors of each layer separately by optimizing its parameters over the calibration set. We empirically demonstrate that this approach is: (1) much less susceptible to over-fitting than the standard fine-tuning approaches, and can be used even on a very small calibration set; and (2) more powerful than previous methods, which only set the activations' dynamic ranges. Furthermore, we demonstrate how to optimally allocate the bit-widths for each layer, while constraining accuracy degradation or model compression by proposing a novel integer programming formulation. Finally, we suggest model global statistics tuning, to correct biases introduced during quantization. Together, these methods yield state-of-the-art results for both vision and text models. For instance, on ResNet50, we obtain less than 1\\% accuracy degradation --- with 4-bit weights and activations in all layers, but the smallest two. We open-sourced our code.","url_abs":"https://arxiv.org/abs/2006.10518v2","url_pdf":"https://arxiv.org/pdf/2006.10518v2.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":"improving-post-training-neural-quantization","repo_url":"https://github.com/itayhubara/CalibTIP","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"model-compression","task_name":"Model Compression"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2006.10518","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2006.10518"}},"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/itayhubara/CalibTIP","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":7,"ran":0,"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":"9c78f4848d2df0cb","entry":"conv","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"models/mobilenet_v2_old.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/models/mobilenet_v2_old.py","link_basis":"first_harvest_node","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":"9c78f4848d2df0cb"}},{"code_sha256_prefix":"1775197fd615680a","entry":"conv3x3","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/models/resnet.py","link_basis":"first_harvest_node","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":"1775197fd615680a"}},{"code_sha256_prefix":"9ee14cbba4386d2e","entry":"depBatchNorm2d","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"models/inception.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/models/inception.py","link_basis":"first_harvest_node","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":"9ee14cbba4386d2e"}},{"code_sha256_prefix":"7be99c438ebdedf8","entry":"inception_v3","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"models/inception.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/models/inception.py","link_basis":"first_harvest_node","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":"7be99c438ebdedf8"}},{"code_sha256_prefix":"800fc61832114933","entry":"mpip_compression","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"mpip_compression_pytorch_multi.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/mpip_compression_pytorch_multi.py","link_basis":"first_harvest_node","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":"800fc61832114933"}},{"code_sha256_prefix":"f0e3c7e07f4ec4a8","entry":"nearby_int","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"models/mobilenet_v2_old.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/models/mobilenet_v2_old.py","link_basis":"first_harvest_node","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":"f0e3c7e07f4ec4a8"}},{"code_sha256_prefix":"318278bbb49c6d02","entry":"weight_decay_config","repo":"itayhubara/CalibTIP","repo_kind":"official","path":"models/mobilenet_v2_old.py","file_url":"https://github.com/itayhubara/CalibTIP/blob/HEAD/models/mobilenet_v2_old.py","link_basis":"first_harvest_node","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":"318278bbb49c6d02"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}