SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.09756 · 2019

Differentiable Product Quantization for End-to-End Embedding Compression

arXiv · PDF · Open in the Atlas

Code that ran

6 of 21 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 15 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1908.09756.json · badge: /api/ran/1908.09756.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
chentingpc/dpq_embedding_compression canonical (classifier label)
classifier basis: census
4 ran · 15 no recorded run
badranX/dpq-embedding-compression-torch community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
FunctionStatusWhere it lives
get_device_str Ran
ran on a synthesized input
chentingpc/dpq_embedding_compression/nmt/model_helper.py
code served (permissive licence) · get_code("2a36567acaec78fc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'device_id': 0,
    'num_gpus': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_initializer Ran
ran on a synthesized input
chentingpc/dpq_embedding_compression/nmt/model_helper.py
code served (permissive licence) · get_code("a37117218aee8b75")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned GlorotNormal. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

ARGS = {
    'init_op': 'glorot_normal',
    'seed': 42,
    'init_weight': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GlorotNormal — a GlorotNormal output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GlorotNormal output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
safer_log Ran
ran on a synthesized input
badranX/dpq-embedding-compression-torch/dpq/kd_quantizer.py
code served (permissive licence) · get_code("738a6c900ea8fbb6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "x": torch.tensor([0.0, 1.5, 2.3, 0.0], dtype=torch.float32),
    "eps": 1e-10,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample_gumbel Ran
ran on a synthesized input
badranX/dpq-embedding-compression-torch/dpq/kd_quantizer.py
code served (permissive licence) · get_code("374759d95c8eb54c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function sample_gumbel takes a shape parameter
# and uses it to create tensors via torch.rand(shape)
# Shape should be a tuple or list of integers

ARGS = {
    "shape": (2, 4)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
with_autoparallel_prefix Ran
ran on a synthesized input
chentingpc/dpq_embedding_compression/lm/util.py
code served (permissive licence) · get_code("35837a902c6818e0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

def with_prefix(prefix, name):
    """Adds prefix to name."""
    return '/'.join((prefix, name))

def with_autoparallel_prefix(replica_id, name):
    return with_prefix('AutoParallel-Replica-%d' % replica_id, name)

ARGS = {
    'replica_id': 0,
    'name': 'layer1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
with_prefix Ran
ran on a synthesized input
chentingpc/dpq_embedding_compression/lm/util.py
code served (permissive licence) · get_code("d8bb8f7714a59b82")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "prefix": "model",
    "name": "layer1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_attention_mechanism Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/attention_model.py
code served (permissive licence) · get_code("ea4b66669118df2a")
How it ran

no invocation recorded.

create_hparams Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/nmt.py
code served (permissive licence) · get_code("832ca854f7902512")
How it ran

no invocation recorded.

create_train_model Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/model_helper.py
code served (permissive licence) · get_code("88f3138a4297b1a4")
How it ran

no invocation recorded.

ensure_compatible_hparams Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/nmt.py
code served (permissive licence) · get_code("b5cf13bcd19f3b4f")
How it ran

no invocation recorded.

extend_hparams Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/nmt.py
code served (permissive licence) · get_code("83180a35260f562c")
How it ran

no invocation recorded.

full_embed Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/core/kdq_embedding.py
code served (permissive licence) · get_code("c50945e9a7543186")
How it ran

no invocation recorded.

get_model_creator Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/inference.py
code served (permissive licence) · get_code("13a71c88520430e1")
How it ran

no invocation recorded.

gnmt_residual_fn Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/gnmt_model.py
code served (permissive licence) · get_code("c983781db93a0034")
How it ran

no invocation recorded.

import_state_tuples Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/lm/util.py
code served (permissive licence) · get_code("6c3e8d655ba4f96f")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/inference.py
code served (permissive licence) · get_code("103f4f775fb6e2a1")
How it ran

no invocation recorded.

ptb_producer Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/lm/reader.py
code served (permissive licence) · get_code("04184dc6f54720cb")
How it ran

no invocation recorded.

ptb_raw_data Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/lm/reader.py
code served (permissive licence) · get_code("561a2b80babeec15")
How it ran

no invocation recorded.

safer_log Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/core/kd_quantizer.py
code served (permissive licence) · get_code("ca301ee7fca5613b")
How it ran

no invocation recorded.

sample_gumbel Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/core/kd_quantizer.py
code served (permissive licence) · get_code("021c15a57e72960e")
How it ran

no invocation recorded.

start_sess_and_load_model Not yet run
unverified (harvested, no recorded run)
chentingpc/dpq_embedding_compression/nmt/inference.py
code served (permissive licence) · get_code("ac479d3b7f4ad5dc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 20 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
ptb_producer 1 other paper
1 dated earlier
1611.10176 (2016-11)
Effective Quantization Methods for Recurrent Neural Networks

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1908.09756")
get_code_for_paper("1908.09756")
have("1908.09756")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1908.09756.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1908.09756.svg)](https://syntology.ai/paper/1908.09756)

Connect an agent — have() is free.