{"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/trained-ternary-quantization","title":"Trained Ternary Quantization","arxiv_id":"1612.01064","date":"2016-12-04","proceeding":null,"authors":["Chenzhuo Zhu","Song Han","Huizi Mao","William J. Dally"],"abstract":"Deep neural networks are widely used in machine learning applications.\nHowever, the deployment of large neural networks models can be difficult to\ndeploy on mobile devices with limited power budgets. To solve this problem, we\npropose Trained Ternary Quantization (TTQ), a method that can reduce the\nprecision of weights in neural networks to ternary values. This method has very\nlittle accuracy degradation and can even improve the accuracy of some models\n(32, 44, 56-layer ResNet) on CIFAR-10 and AlexNet on ImageNet. And our AlexNet\nmodel is trained from scratch, which means it's as easy as to train normal full\nprecision model. We highlight our trained quantization method that can learn\nboth ternary values and ternary assignment. During inference, only ternary\nvalues (2-bit weights) and scaling factors are needed, therefore our models are\nnearly 16x smaller than full-precision models. Our ternary models can also be\nviewed as sparse binary weight networks, which can potentially be accelerated\nwith custom circuit. Experiments on CIFAR-10 show that the ternary models\nobtained by trained quantization method outperform full-precision models of\nResNet-32,44,56 by 0.04%, 0.16%, 0.36%, respectively. On ImageNet, our model\noutperforms full-precision AlexNet model by 0.3% of Top-1 accuracy and\noutperforms previous ternary models by 3%.","url_abs":"http://arxiv.org/abs/1612.01064v3","url_pdf":"http://arxiv.org/pdf/1612.01064v3.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":"trained-ternary-quantization","repo_url":"https://github.com/VeritasXu/Ternary-Federated","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"trained-ternary-quantization","repo_url":"https://github.com/czhu95/ternarynet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"trained-ternary-quantization","repo_url":"https://github.com/tensorpack/tensorpack/tree/master/examples/DoReFa-Net","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"trained-ternary-quantization","repo_url":"https://github.com/vinsis/ternary-quantization","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"trained-ternary-quantization","repo_url":"https://github.com/yamilvindas/aTTQ","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"trained-ternary-quantization","repo_url":"https://github.com/yamilvindas/pTTQ","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"grouped-convolution","method_name":"Grouped Convolution"},{"method_slug":"local-response-normalization","method_name":"Local Response Normalization"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1612.01064","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1612.01064"}},"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/VeritasXu/Ternary-Federated","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yamilvindas/aTTQ","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tensorpack/tensorpack/tree/master/examples/DoReFa-Net","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vinsis/ternary-quantization","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yamilvindas/pTTQ","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/czhu95/ternarynet","reach":null}],"summary":{"ran_fixture":1,"ran_draft_wrong":3,"ran_honours":1,"unverified":2},"by_repo_kind":{"listed":{"samples":7,"ran":5,"repositories":3}},"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":3,"samples":[{"code_sha256_prefix":"bd0565df4c59e38b","entry":"computeMeanMetricsLastEpochs","repo":"yamilvindas/aTTQ","repo_kind":"listed","path":"src/utils/plot_results_classification.py","file_url":"https://github.com/yamilvindas/aTTQ/blob/HEAD/src/utils/plot_results_classification.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"bd0565df4c59e38b"}},{"code_sha256_prefix":"262b8057646d1be3","entry":"get_data","repo":"czhu95/ternarynet","repo_kind":"listed","path":"examples/Ternary-Net/tw-cifar10-resnet.py","file_url":"https://github.com/czhu95/ternarynet/blob/HEAD/examples/Ternary-Net/tw-cifar10-resnet.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":"262b8057646d1be3"}},{"code_sha256_prefix":"b834150b9d445a4f","entry":"get_quantization_grads","repo":"vinsis/ternary-quantization","repo_kind":"listed","path":"quantification.py","file_url":"https://github.com/vinsis/ternary-quantization/blob/HEAD/quantification.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b834150b9d445a4f"}},{"code_sha256_prefix":"0ba505651b8b7e1c","entry":"load_results_data","repo":"yamilvindas/aTTQ","repo_kind":"listed","path":"src/utils/plot_results_classification.py","file_url":"https://github.com/yamilvindas/aTTQ/blob/HEAD/src/utils/plot_results_classification.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0ba505651b8b7e1c"}},{"code_sha256_prefix":"d68f2c13b2387a62","entry":"quantize","repo":"vinsis/ternary-quantization","repo_kind":"listed","path":"quantification.py","file_url":"https://github.com/vinsis/ternary-quantization/blob/HEAD/quantification.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d68f2c13b2387a62"}},{"code_sha256_prefix":"6986da09c8c85488","entry":"get_data","repo":"czhu95/ternarynet","repo_kind":"listed","path":"examples/Ternary-Net/p-cifar10-resnet.py","file_url":"https://github.com/czhu95/ternarynet/blob/HEAD/examples/Ternary-Net/p-cifar10-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":"6986da09c8c85488"}},{"code_sha256_prefix":"cca5ba3ad019a6c9","entry":"plotMeanMetrics","repo":"yamilvindas/aTTQ","repo_kind":"listed","path":"src/utils/plot_results_classification.py","file_url":"https://github.com/yamilvindas/aTTQ/blob/HEAD/src/utils/plot_results_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"cca5ba3ad019a6c9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}