Representation, Self-Supervision & Paired Modalities

Representation objectives need an explicit invariance, pairing contract and held-out evaluator. A falling pretraining loss alone does not show useful transfer.

Section 5 of 8 · 7 units · about 26 hours

0/7

By the end you can Derive a contrastive objective, build a compact representation learner, detect a seeded pair leak, and defend held-out retrieval or transfer evidence with explicit limits.

Units

Build it

Mini project · about 10 to 14 hours

Compact contrastive learner with a seeded leak audit

Train a small SimCLR-style encoder on a CIFAR-10 subset, evaluate it with a frozen linear probe and held-out retrieval against a random-encoder baseline, and show that your split audit catches a pair leak you planted yourself.

  1. 1Implement NT-Xent from your derivation. Pass Deep-ML 384 and the CS231n Assignment 3 simclr_loss_naive and simclr_loss_vectorized checks, and add tests for identical embeddings (), temperature extremes and unnormalized inputs.
  2. 2Train a small encoder with a projector on a fixed CIFAR-10 subset at a stated temperature and batch size. Log loss, positive-pair accuracy and the collapse check (per-dimension spread of normalized embeddings and numerical rank) every epoch.
  3. 3Evaluate with a frozen linear probe on and on , and with nearest-neighbour retrieval on a held-out split, against a frozen random-encoder baseline with matched budgets, over two seeds.
  4. 4Split by source image before augmenting, and write a split audit that combines exact hashes with a near-duplicate check, such as cosine similarity of downsampled pixels above a stated threshold.
  5. 5Plant a leak: copy a few hundred test images, lightly augmented, into the training set. Show what the audit flags and misses, and measure how much the leak inflates retrieval and probe scores.
  6. 6Run one ablation, such as dropping color jitter, and report probe accuracy and the collapse check for both runs.
  7. 7Write the limits: what your subset, resolution and budget cannot show about large-scale pretraining or paired image-text alignment.
What you hand in
  • Training and evaluation code with the loss tests, the collapse check and the split audit.
  • A results table with seeds: probe on h and z, retrieval, the random-encoder baseline, the ablation, and leaked versus clean scores.
  • A one-page limits note.
How to check it
How it's graded

Objective

Pass: NT-Xent passes Deep-ML 384, the CS231n loss checks and your edge tests.

Great: Your tests also cover duplicate images in one batch and show how they change the loss.

Evaluation protocol

Pass: The frozen probe and retrieval beat the random-encoder baseline at matched budgets.

Great: The result holds on both seeds, and the gap between probing and is reported.

Leak detection

Pass: The audit flags the planted near-duplicates.

Great: You report the audit's misses and false alarms on the planted set, and the score inflation the leak caused.

Collapse

Pass: Spread and rank are logged for every run.

Great: A deliberately collapsed run, such as a constant projector output, trips the check.

Limits

Pass: The note names what the compact run cannot show.

Great: Each limit names the measurement that would settle it.

Resources