Abstract
While supervised learning has enabled great progress in many applications, unsupervised learning has not seen such widespread adoption, and remains an important and challenging endeavor for artificial intelligence. In this work, we propose a universal unsupervised learning approach to extract useful representations from high-dimensional data, which we call Contrastive Predictive Coding (CPC). The key insight of our model is to learn such representations by predicting the future in latent space using powerful autoregressive models. We use a probabilistic contrastive loss which induces the latent space to capture information that is maximally useful to predict future samples. It also makes the model tractable by using negative sampling. While most prior work has focused on evaluating representations for a particular modality, we demonstrate that our approach is able to learn useful representations achieving strong performance on four distinct domains: speech, images, text, and reinforcement learning in 3D environments.
Introduction
Supervised learning has revolutionized AI but remains constrained by the need for massive labeled datasets. Unsupervised learning (UL) offers a path to leverage raw data, yet it faces the fundamental challenge of defining what a model should learn. Traditional generative approaches often focus on reconstructing every detail of the input, such as individual pixels. This is computationally intensive and often misdirects model capacity toward low-level noise rather than high-level semantic features. CPC addresses this by proposing that effective representations should capture "slow features"—information spanning long time scales or large spatial areas, such as phonemes in speech or objects in images.
Methodology
The CPC architecture consists of two primary components:
- The Encoder ($g_{enc}$): A non-linear network mapping raw input $x_t$ (e.g., audio windows or image patches) into a compact latent vector $z_t$.
- The Autoregressive Model ($g_{ar}$): A model, such as a Gated Recurrent Unit (GRU), that summarizes the sequence of latent vectors $z_{\leq t}$ into a context vector $c_t$.
Instead of predicting the future raw signal $x_{t+k}$, CPC predicts the future latent representation $z_{t+k}$. To prevent the model from learning trivial solutions, the authors employ the InfoNCE loss. This contrastive loss requires the model to distinguish a "positive" sample (the true future latent) from multiple "negative" distractors sampled from other parts of the data. Minimizing the InfoNCE loss is mathematically equivalent to maximizing the lower bound of the Mutual Information between the current context and the future signal.
Experimental Results
The authors evaluated CPC across four distinct domains to demonstrate its universal applicability:
Speech
Using a 100-hour subset of LibriSpeech, CPC was trained on raw 16kHz waveforms. The resulting representations captured both phonetic content and speaker identity. As shown in the results table, CPC features significantly outperformed random initialization and traditional MFCC features, approaching supervised performance levels in speaker classification.
Computer Vision
On ImageNet, CPC defined "future" prediction spatially, predicting lower rows of image patches from upper rows. A linear classifier trained on frozen CPC features achieved 48.7% top-1 accuracy, surpassing the previous unsupervised state-of-the-art by 9% absolute.
Reinforcement Learning and Text
CPC was applied to the BookCorpus dataset for text and five 3D environments in DeepMind Lab. In RL, CPC served as an auxiliary task, significantly improving sample efficiency by forcing agents to develop a deeper understanding of their environment.
Discussion and Conclusion
CPC represents a significant advancement in universal unsupervised learning. By predicting in latent space and utilizing contrastive estimation, it effectively ignores irrelevant high-frequency noise while capturing global structure. However, challenges remain. The performance is sensitive to the negative sampling strategy; distractors must be sufficiently difficult to drive meaningful learning. Additionally, while the framework is universal, the choice of encoder architecture still requires domain-specific tuning. Future research may focus on more unified architectures, such as Transformers, to further generalize the approach.
Summary updated