{"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/differentiable-product-quantization-for-end","title":"Differentiable Product Quantization for End-to-End Embedding Compression","arxiv_id":"1908.09756","date":"2019-08-26","proceeding":null,"authors":["Ting Chen","Lala Li","Yizhou Sun"],"abstract":"Embedding layers are commonly used to map discrete symbols into continuous embedding vectors that reflect their semantic meanings. Despite their effectiveness, the number of parameters in an embedding layer increases linearly with the number of symbols and poses a critical challenge on memory and storage constraints. In this work, we propose a generic and end-to-end learnable compression framework termed differentiable product quantization (DPQ). We present two instantiations of DPQ that leverage different approximation techniques to enable differentiability in end-to-end learning. Our method can readily serve as a drop-in alternative for any existing embedding layer. Empirically, DPQ offers significant compression ratios (14-238$\\times$) at negligible or no performance cost on 10 datasets across three different language tasks.","url_abs":"https://arxiv.org/abs/1908.09756v3","url_pdf":"https://arxiv.org/pdf/1908.09756v3.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":"differentiable-product-quantization-for-end","repo_url":"https://github.com/chentingpc/dpq_embedding_compression","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"differentiable-product-quantization-for-end","repo_url":"https://github.com/badranX/dpq-embedding-compression-torch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1908.09756","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1908.09756"}},"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/chentingpc/dpq_embedding_compression","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/badranX/dpq-embedding-compression-torch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":21},"by_repo_kind":{"official":{"samples":19,"ran":0,"repositories":1},"listed":{"samples":2,"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":"ea4b66669118df2a","entry":"create_attention_mechanism","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/attention_model.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/attention_model.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":"ea4b66669118df2a"}},{"code_sha256_prefix":"832ca854f7902512","entry":"create_hparams","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/nmt.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/nmt.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":"832ca854f7902512"}},{"code_sha256_prefix":"88f3138a4297b1a4","entry":"create_train_model","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/model_helper.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/model_helper.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":"88f3138a4297b1a4"}},{"code_sha256_prefix":"b5cf13bcd19f3b4f","entry":"ensure_compatible_hparams","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/nmt.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/nmt.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":"b5cf13bcd19f3b4f"}},{"code_sha256_prefix":"83180a35260f562c","entry":"extend_hparams","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/nmt.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/nmt.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":"83180a35260f562c"}},{"code_sha256_prefix":"c50945e9a7543186","entry":"full_embed","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"core/kdq_embedding.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/core/kdq_embedding.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":"c50945e9a7543186"}},{"code_sha256_prefix":"2a36567acaec78fc","entry":"get_device_str","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/model_helper.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/model_helper.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":"2a36567acaec78fc"}},{"code_sha256_prefix":"a37117218aee8b75","entry":"get_initializer","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/model_helper.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/model_helper.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":"a37117218aee8b75"}},{"code_sha256_prefix":"13a71c88520430e1","entry":"get_model_creator","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/inference.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/inference.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":"13a71c88520430e1"}},{"code_sha256_prefix":"c983781db93a0034","entry":"gnmt_residual_fn","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/gnmt_model.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/gnmt_model.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":"c983781db93a0034"}},{"code_sha256_prefix":"6c3e8d655ba4f96f","entry":"import_state_tuples","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"lm/util.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/lm/util.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":"6c3e8d655ba4f96f"}},{"code_sha256_prefix":"103f4f775fb6e2a1","entry":"load_data","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/inference.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/inference.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":"103f4f775fb6e2a1"}},{"code_sha256_prefix":"04184dc6f54720cb","entry":"ptb_producer","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"lm/reader.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/lm/reader.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":"04184dc6f54720cb"}},{"code_sha256_prefix":"561a2b80babeec15","entry":"ptb_raw_data","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"lm/reader.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/lm/reader.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":"561a2b80babeec15"}},{"code_sha256_prefix":"ca301ee7fca5613b","entry":"safer_log","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"core/kd_quantizer.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/core/kd_quantizer.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":"ca301ee7fca5613b"}},{"code_sha256_prefix":"738a6c900ea8fbb6","entry":"safer_log","repo":"badranX/dpq-embedding-compression-torch","repo_kind":"listed","path":"dpq/kd_quantizer.py","file_url":"https://github.com/badranX/dpq-embedding-compression-torch/blob/HEAD/dpq/kd_quantizer.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":"738a6c900ea8fbb6"}},{"code_sha256_prefix":"021c15a57e72960e","entry":"sample_gumbel","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"core/kd_quantizer.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/core/kd_quantizer.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":"021c15a57e72960e"}},{"code_sha256_prefix":"374759d95c8eb54c","entry":"sample_gumbel","repo":"badranX/dpq-embedding-compression-torch","repo_kind":"listed","path":"dpq/kd_quantizer.py","file_url":"https://github.com/badranX/dpq-embedding-compression-torch/blob/HEAD/dpq/kd_quantizer.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":"374759d95c8eb54c"}},{"code_sha256_prefix":"ac479d3b7f4ad5dc","entry":"start_sess_and_load_model","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"nmt/inference.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/nmt/inference.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":"ac479d3b7f4ad5dc"}},{"code_sha256_prefix":"35837a902c6818e0","entry":"with_autoparallel_prefix","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"lm/util.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/lm/util.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":"35837a902c6818e0"}},{"code_sha256_prefix":"d8bb8f7714a59b82","entry":"with_prefix","repo":"chentingpc/dpq_embedding_compression","repo_kind":"official","path":"lm/util.py","file_url":"https://github.com/chentingpc/dpq_embedding_compression/blob/HEAD/lm/util.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":"d8bb8f7714a59b82"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}