End-to-End Learning of Quantizable Representations

28 concepts20 papers1 proposal

In traditional machine learning pipelines, compression is an afterthought. A model is trained to produce high-dimensional, continuous embeddings, which are then passed to a separate quantization algorithm like Product Quantization (PQ) to be squashed into discrete, searchable codes. This two-stage approach creates a fundamental mismatch: the encoder is never told that its outputs will eventually be discretized, leading to significant "quantization error" where the nuances of the original feature space are lost during the transition to bits.

A growing body of research suggests a more integrated approach: joint feature-quantization optimization. By making the quantization process a first-class citizen during training, models learn to produce "quantizable" representations—embeddings that are inherently structured to be compressed without losing their semantic meaning.

The Post-Hoc Gap

The core problem with decoupled pipelines is that the continuous feature space and the discrete codebook are optimized for different objectives. As Zhang et al. observe in Anisotropic Additive Quantization for Fast Inner Product Search, applying compression to static, pre-trained embeddings often results in a mismatch between the feature distribution and the representative codewords.

When we optimize them jointly, the model undergoes a form of "co-evolution." The encoder learns to cluster data points in a way that aligns with the codebook's geometry, while the codebook adapts its centroids to better represent the encoder's output distribution. Cao et al. demonstrate this in Deep Visual-Semantic Quantization for Efficient Image Retrieval, where an end-to-end framework encourages the model to learn visual representations that are specifically tailored for discrete binary codes, significantly reducing information loss.

Differentiating Through the Discrete

The primary technical challenge in joint optimization is that quantization—mapping a continuous value to the nearest discrete neighbor—is a non-differentiable operation. To train these systems via stochastic gradient descent, researchers employ several clever workarounds:

  • Soft Assignments and Proxies: Instead of a hard "nearest neighbor" lookup, models can use soft-max distributions over codebook entries during training. Jeong et al. and Song frame this discrete optimization as a minimum cost flow problem, allowing for efficient end-to-end learning of hash tables.
  • Simulated Noise: In HPC: Hierarchical Progressive Coding Framework for Volumetric Video, Zheng et al. incorporate simulated quantization by adding uniform noise to feature grids during training. This forces the model to become robust to the distortions that will eventually be introduced by entropy encoding.
  • Composite Loss Functions: Most joint frameworks, such as the Node Identifier (NID) framework proposed by Luo, combine a downstream task loss (like classification or ranking) with a quantization loss. This dual-objective ensures that the resulting discrete codes preserve the predictive information essential for the task.

Bridging Retrieval and Compression

This paradigm has proven particularly transformative for Dense Retrieval (DR). In large-scale search, storing raw embeddings for billions of documents is prohibitively expensive. Zhan et al. show in their work on JPQ and RepCONC that by integrating vector quantization directly into the training loop of dual-encoders, the model can compensate for information loss. The encoder learns to "protect" the features most critical for ranking, allowing for compression ratios of several hundred-fold with almost no loss in retrieval accuracy.

Similarly, Wang et al. demonstrate in Hybrid Contrastive Quantization that aligning global and local semantic features during the quantization training process allows for a 200x reduction in storage while maintaining performance competitive with uncompressed models.

Beyond Retrieval: Model Compression

The benefits of joint optimization extend to the neural networks themselves. Rather than just quantizing the outputs of a model, researchers like Stock et al. in And the Bit Goes Down focus on quantizing the internal weights. By using global fine-tuning to refine codebooks across all layers simultaneously, the authors successfully compressed a ResNet-50 by 20x while maintaining high accuracy.

More recently, Yvinec et al. introduced JLCM, which allows weight-to-codebook mappings and the codebooks themselves to co-evolve. This joint learning process enabled the compression of a Llama 7B model down to a size that can run on a standard smartphone, proving that when features and their discrete representations are learned together, the efficiency gains are massive.

Key Foundational Work

Deep Visual-Semantic Quantization for Efficient Image Retrieval (2017) — contributed 2 concept elements to this direction.
Multiscale Quantization for Fast Similarity Search (2017) — contributed 2 concept elements to this direction.
Deep Quantization Network for Efficient Image Retrieval (2016) — contributed 1 concept elements to this direction.
History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 21 papers
  2. Version 1 · 2026-10-04 · 24 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_joint_feature_quantization_optimization_8c5159b6,
  title = {joint feature-quantization optimization},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/joint-feature-quantization-optimization/rdr_8c5159b60bc94ff38848a55b214acd06},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-24},
}

This exact version (version 2, frozen text):

@misc{lacuna_joint_feature_quantization_optimization_8c5159b6_v2,
  title = {joint feature-quantization optimization},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/joint-feature-quantization-optimization/rdr_8c5159b60bc94ff38848a55b214acd06/v/2},
  note = {Version 2, frozen 2026-10-04. Accessed 2026-11-24},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake