Skip to main content
QUICK REVIEW

[Paper Review] Learning K-way D-dimensional Discrete Code For Compact Embedding Representations

Ting Chen, Martin Renqiang Min|arXiv (Cornell University)|Nov 8, 2017
Topic ModelingComputer Science28 references11 citations
TL;DR

This paper proposes KD encoding, a K-way D-dimensional discrete code scheme that replaces traditional one-hot encoding for symbol embeddings, enabling logarithmic parameter growth instead of linear. By learning semantically meaningful discrete codes via relaxed stochastic gradient descent, the method reduces embedding parameters by 97% in language modeling while maintaining or improving performance.

ABSTRACT

Embedding methods such as word embedding have become pillars for many applications containing discrete structures. Conventional embedding methods directly associate each symbol with a continuous embedding vector, which is equivalent to applying linear transformation based on "one-hot" encoding of the discrete symbols. Despite its simplicity, such approach yields number of parameters that grows linearly with the vocabulary size and can lead to overfitting. In this work we propose a much more compact K-way D-dimensional discrete encoding scheme to replace the "one-hot" encoding. In "KD encoding", each symbol is represented by a $D$-dimensional code, and each of its dimension has a cardinality of $K$. The final symbol embedding vector can be generated by composing the code embedding vectors. To learn the semantically meaningful code, we derive a relaxed discrete optimization technique based on stochastic gradient descent. By adopting the new coding system, the efficiency of parameterization can be significantly improved (from linear to logarithmic), and this can also mitigate the over-fitting problem. In our experiments with language modeling, the number of embedding parameters can be reduced by 97\% while achieving similar or better performance.

Motivation & Objective

  • Address the linear parameter growth in conventional one-hot encoding-based embedding methods, which hinders scalability and increases overfitting risk.
  • Develop a more compact and efficient coding scheme to reduce model parameters while preserving semantic expressiveness.
  • Learn semantically meaningful discrete codes from data using a differentiable relaxation of discrete optimization.
  • Enable deployment of large-scale embedding models on memory-constrained devices such as mobile platforms.
  • Improve code space utilization by replacing near-zero efficiency of one-hot encoding with a high-utilization discrete code system.

Proposed method

  • Propose KD encoding: each symbol is represented by a D-dimensional code where each dimension has K possible values, forming a K^D code space.
  • Generate symbol embeddings by composing learned embeddings of individual code dimensions through a differentiable transformation function f(·).
  • Use a relaxed discrete optimization technique based on stochastic gradient descent with a straight-through estimator (STE) and temperature scheduling to backpropagate through discrete codes.
  • Train the code mapping function φ(s) via end-to-end learning, storing it as a hash table for fast lookup.
  • Reduce parameter count from O(Nd) to O((K/log K)d′log N + C), achieving logarithmic scaling with respect to vocabulary size.
  • Apply temperature annealing to stabilize training and improve convergence of discrete code learning.

Experimental results

Research questions

  • RQ1Can a discrete code system with K-way D-dimensional codes significantly reduce the number of parameters in embedding layers while maintaining performance?
  • RQ2How does the choice of K and D affect the quality of learned embeddings and code semantics?
  • RQ3Can a differentiable relaxation of discrete optimization effectively learn meaningful, semantically coherent codes from data?
  • RQ4Does KD encoding mitigate overfitting in low-resource or long-tailed vocabulary scenarios?
  • RQ5How does the temperature scheduling in the relaxed optimization process influence code stability and convergence?

Key findings

  • The proposed KD encoding reduces the number of embedding parameters by 97% in language modeling tasks while achieving similar or better performance compared to standard one-hot encoding.
  • With K=6 and D=4, the model learns discrete codes that group semantically similar words—e.g., time-related words like 'week' and 'month' are assigned similar codes.
  • Experiments show that small values of K or D degrade performance even when K^D ≫ N, indicating that code redundancy aids learning.
  • Temperature scheduling in the relaxed optimization process leads to better convergence and more stable code assignments than fixed temperature or continuous code approximations.
  • The method achieves high code space utilization: for N=10,000, K=2, D=100, the code space is 2^9900 times more efficient than one-hot encoding.
  • The learned code mapping function φ(s) successfully captures semantic similarity, as demonstrated by clustering results on synthetic and real-world GloVe embeddings.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.