Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Representation Learning with Contrastive Predictive Coding

Contrastive predictive coding learns representations by predicting future latent codes

  • Problem Generative models must rebuild every detail of a raw signal, which wastes capacity on information the context does not share. Predicting the signal itself is hard to make useful for learning features without labels.
  • Method CPC predicts future latent codes and scores them with a contrastive loss instead of generating signals.
  • Results On ImageNet with a ResNet v2 101 encoder, CPC scored 48.7 top-1, compared to 39.6 for colorization.

Why generative prediction stalls

Predicting what is missing is an old and attractive way to learn features without labels. The difficulty starts when the thing to be predicted is a raw signal such as an image or a waveform. A generative model asked to produce such a signal has to reconstruct every detail, and much of that detail is unrelated to the context. An image holds thousands of bits, while a class label carries about 10 bits for 1,024 categories, so the mismatch is large.

The authors instead target the information that a future signal x and its context c have in common, measured as mutual information. Predicting further ahead leaves less shared information, so the model has to learn longer-range structure. Such slow features, like phonemes and intonation in speech or objects in images, are often the most useful ones.

Predicting latents with a density ratio

The key idea is to compress each signal into a latent vector first, then predict future latents from a summary of the past. The model then only has to tell whether a candidate future latent matches the context, using sampled comparison values. An encoder genc turns each observation x_t into z_t, possibly at a lower temporal resolution. An autoregressive model gar reads all latents up to time t and produces the context c_t.

The model doesn't generate the future distribution directly, and instead learns a score that is proportional to a density ratio between the conditional and the marginal density. The score is an exponential of a bilinear form, \[ f_k(x_{t+k}, c_t) = \exp\left(z_{t+k}^{T} W_k c_t\right) \] Each step k gets its own matrix W_k, so predicting further ahead uses different weights.

Any positive score would work in principle, and the authors chose this log-bilinear form for its simplicity.

Either z_t or c_t can serve as the representation, depending on the task. The context c_t helps when past information matters, as in speech recognition, while z_t may be enough when no extra context is needed. For whole-image or whole-sequence tasks, the representations are pooled over all locations.

Training with InfoNCE

Training uses InfoNCE over a set X of N samples, with one positive from the conditional distribution and N−1 negatives from the proposal distribution. The loss is \[ L_N = -\,\mathbb{E}_X\left[\log \frac{f_k(x_{t+k}, c_t)}{\sum_{x_j \in X} f_k(x_j, c_t)}\right] \] It is a categorical cross-entropy, so the model learns to pick out the positive sample among the candidates.

The optimal posterior that x_i is the positive is its ratio p(x_i|c_t)/p(x_i) divided by the sum of that ratio over all N candidates. Because of this, the optimal score is proportional to the density ratio, and it doesn't depend on how many negatives are drawn.

The loss also gives a bound, I(x_{t+k}, c_t) ≥ log(N) − L_N, which tightens as N grows. So minimizing L_N maximizes a lower bound on the mutual information between c_t and x_{t+k}. The encoder and the autoregressive model are trained jointly, so the whole model learns end to end.

Speech probing results

The audio experiments use a 100-hour subset of LibriSpeech, with phone labels obtained by forced alignment with Kaldi. The encoder has five strided convolutions on the 16KHz waveform, with a feature every 10ms of speech. A GRU with a 256-dimensional hidden state provides the context, and the model predicts 12 steps ahead from it. The model trains on audio windows of length 20480 until convergence, which the authors report at roughly 300,000 updates.

For probing, the GRU outputs are extracted for the whole dataset, and only a multi-class linear logistic regression is trained on them. On phone classification with 41 classes, CPC scored 64.6, compared to 39.7 for MFCC features and 27.6 for a randomly initialized model. The supervised model with the same architecture scored 74.6, so CPC closes much of the gap without labels.

On speaker identity among 251 speakers, CPC scored 97.4, compared to 17.6 for MFCC features. The supervised model scored 98.5, so the linear probe comes close to the fully supervised network. The authors read this as CPC capturing both speaker identity and speech content. A single hidden layer lifts phone accuracy from 64.6 to 72.5, so some encoded information isn't linearly accessible.

Prediction horizon and negative sampling

The first ablation varies the number of predicted steps, and phone accuracy rises from 28.5 with 2 steps to 64.6 with 12. Accuracy then slips to 63.8 with 16 steps, so 12 steps gave the best value in this sweep. The authors conclude that predicting multiple steps matters for learning useful features.

The second ablation keeps 12 steps and changes where the negatives come from. Mixed-speaker negatives scored 64.6, and same-speaker negatives scored 65.5. When the current sequence is excluded, mixed-speaker negatives drop to 57.3, while same-speaker negatives stay at 64.6. Drawing all negatives from the current sequence gives 65.2. So the source of negatives matters most when the current sequence is excluded and negatives come from mixed speakers.

ImageNet linear probing

The image encoder is a ResNet v2 101 trained without pretraining and without Batch-Norm. Each 256x256 image gives a 7x7 grid of 64x64 crops with 32 pixels of overlap. The third residual block output is spatially mean-pooled, so each crop becomes a 1024-dimensional vector and the image becomes a 7x7x1024 tensor.

A PixelCNN-style autoregressive model predicts up to five rows of latents from the top down. The contrastive loss is applied to each patch in the predicted rows. For evaluation, the 7x7x1024 features are pooled into one 1024-dimensional vector, and a linear layer is trained on ImageNet labels. The earlier setup in [36] used a 3x3x1024 representation without pooling, which gives its linear mapping more parameters.

CPC scored 48.7 top-1, compared to 39.6 for colorization, the best ResNet-V2 entry listed. Top-5 accuracy was 73.6, compared to 69.3 for the combination of four earlier methods. The authors report gains of 9% absolute in top-1 and 4% absolute in top-5 over the state of the art. The Jigsaw entry in the AlexNet block isn't directly comparable, because its architecture differs.

Sentence transfer on BookCorpus

The text model trains on BookCorpus, using a 1D-convolution sentence encoder that maps each sentence to a 2400-dimensional vector. Evaluation follows the skip-thought protocol, with logistic regression trained on the sentence features for five benchmarks.

On TREC, CPC scored 96.8, compared to 91.4 for skip-thought vectors. On MR, CPC scored 76.9, compared to 79.5 for skip-thought with layer normalization. The authors argue that the method is about as accurate as skip-thought and trains faster, because it needs no LSTM word decoder. They also found that better children's book relationships didn't always transfer to these targets.

Reinforcement learning with the auxiliary loss

The authors add CPC as an auxiliary loss to a batched A2C agent on five DeepMind Lab tasks, without a replay buffer. The unroll length is 100 steps, and predictions reach up to 30 steps ahead. Hyperparameters are searched randomly over entropy regularization, learning rate and RMSProp epsilon.

After 1 billion frames, four of the five tasks improve with the auxiliary loss. On lasertag_three_opponents_small the loss neither helps nor hurts. The authors suspect the task doesn't need memory, so a purely reactive policy suffices there.

Limitations

Linear probes measure only part of what the features hold, since a hidden layer raises phone accuracy from 64.6 to 72.5. The linear-probe numbers therefore understate what the features contain.

The audio model's context was capped at 20480 timesteps, slightly more than a second. The authors state that longer segments would likely give better results.

The ImageNet comparison isn't a controlled match with [36], because the probe pooling differs. The sentence results cover five benchmarks with BookCorpus as source, and the RL results cover five DeepMind Lab tasks. The lasertag explanation is the authors' suspicion, and the text reports no test of it.

Paper info

Authors
Aaron van den Oord, Yazhe Li, Oriol Vinyals
Venue
arXiv · Preprint
First published
2018-7-10
Added
2026-11-11
Updated
2019-1-22
Version
v2
arXiv
1807.03748
Category
cs.LG · stat.ML
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Aaron van den Oord, Yazhe Li, Oriol Vinyals (2018). Representation Learning with Contrastive Predictive Coding. arXiv:1807.03748v2. https://arxiv.org/abs/1807.03748v2

BibTeX
@misc{oord2018representation,
  title = {{Representation Learning with Contrastive Predictive Coding}},
  author = {Aaron van den Oord and Yazhe Li and Oriol Vinyals},
  year = {2018},
  eprint = {1807.03748},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.03748v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up