ScoreCLR replaces batch negatives with a score network; CIFAR-10 projector rank rises from 96 to 229

Contrastive latent representation learning with denoising score matching

Christopher Marouani, Grigory Bartosh, Christian A. Naesseth

stat.ML, cs.LG

2026-11-14

ScoreCLR learns repulsion with a small score net and a linear batch cost. Probe trails SimCLR by 0.4 pts on CIFAR-10 and 1.2 on ImageNet-100; projector rank is 229/256 vs 96.

What problem this solves

Contrastive learning pulls two augmented views of the same image together and pushes other images away. The pull is a distance between codes. The push needs negatives. SimCLR's InfoNCE scores every pair in the batch, so the cost grows with the square of the batch size B. Few negatives make the mutual-information bound noisy. In high dimension, that kernel-density estimate of entropy breaks down.

Methods that skip the push stop collapse with architecture or a regularizer. BYOL uses a predictor and a momentum encoder. VICReg penalizes variance and covariance. LeJEPA's SIGReg runs a characteristic-function test on random one-dimensional projections and drives codes toward an isotropic Gaussian. The shape this leaves is unclear. On CIFAR-10, LeJEPA's projector output has effective rank 58 out of 256. A Gaussianity test on random projections is easy for a low-dimensional subspace to pass, because most one-dimensional projections of a high-dimensional cloud already look Gaussian.

ScoreCLR still maximizes the mutual information of two latent views, I(Z1; Z2) = H(Z1) − H(Z1|Z2). It replaces the parameter gradient of the entropy with the score of the latent distribution, ∇z log p(z). Negating that score pushes a code out of crowded regions.

Method

The training loss is conditional entropy minus entropy. A Gaussian model Z1 | Z2 N(Z2, σ²I) lower-bounds the conditional term, so the alignment piece is mean squared error between the two views. The weight λ stands in for 1/(2σ²): 5 on CIFAR-10 and 2 on ImageNet-100. Entropy alone does not bound the norm, so an L2 penalty pulls codes toward N(0, I). Together with −H(Z), that penalty is KL(pZ ‖ N(0, I)), the same maximum-entropy prior SIGReg uses.

Gradient descent only sees gradients, so entropy can be replaced by a surrogate that shares them. Proposition 3.1 assumes a positive density, finite Fisher information, and derivatives that pass inside the expectation. The minimized objective is conditional entropy minus entropy, so the repulsion regresses z toward a stop-gradient copy of z − score, a step away from high density. With the Gaussian prior the target shifts by another −z.

The score is fit by denoising score matching. Gaussian noise of scale t is added to the code, a small network predicts the noise, and Tweedie's formula s = −ε/t recovers the score of the smoothed density. log t is drawn from N(−1.2, 1.2²) on CIFAR-10 and N(−1.2, 1.0²) on ImageNet-100. Each code averages K independent noise levels.

The score network sees only the noisy code and t. It is a three-layer MLP of width 256 with SiLU and FiLM, 0.28M parameters, about 2.2% of the encoder plus projector. Each batch detaches the codes, updates the score network for S steps, then applies the repulsion and updates the encoder. CIFAR-10 uses S=1 and K=1. ImageNet-100 uses S=5 and K=3. The projector is a 2048/256 MLP without BatchNorm, because BatchNorm by itself slows collapse and would muddy the regularizer.

The leading term in InfoNCE's repulsion gradient is a kernel-density score at a fixed bandwidth. It touches the other codes in the batch and costs O(B²). ScoreCLR runs each code once through a stop-gradient score network and costs O(B).

Results

The backbone is ResNet-18, trained with AdamW, matched augmentations, and gradient clipping at 1.0. CIFAR-10 runs for 1000 epochs at batch 128. ImageNet-100 runs for 400 epochs at 2×128 images per step. Linear probes and weighted k-NN (k=20) read frozen backbone features. AdamW entries are means over three seeds. Projector effective rank is listed as CIFAR-10 / ImageNet-100.

MethodCIFAR-10 linearCIFAR-10 k-NNImageNet-100 linearImageNet-100 k-NNProjector rank z/256
SimCLR89.26±0.3888.73±0.1872.39±0.6266.41±0.4496 / 143
LeJEPA89.67±0.1388.40±0.13not runnot run58 / not run
BYOL88.96±0.3088.44±0.22not runnot run98±5 / not run
Barlow Twins88.05±0.1587.17±0.09not runnot run73 / not run
ScoreCLR88.87±0.4488.27±0.1371.23±0.0666.05±0.39229 / 244

On CIFAR-10, ScoreCLR's linear accuracy is 0.4 points under SimCLR, inside one standard deviation, 0.8 under LeJEPA, about 0.1 from BYOL, and 0.8 above Barlow Twins. k-NN stays within 0.5 of SimCLR, LeJEPA, and BYOL. On ImageNet-100 the linear probe is 1.2 points lower and k-NN 0.4 lower, with a tighter seed spread (0.06 versus 0.62).

Rank is where the runs separate. SimCLR's projector fills 96 of 256 dimensions on CIFAR-10, about a third, the dimensional collapse known for InfoNCE, and 143 of 256 on ImageNet-100. ScoreCLR fills 229 and 244. Backbone features, in 512 dimensions, stay close: 332 versus 336 on CIFAR-10, and 346 versus 329 on ImageNet-100. LeJEPA is the flattest of the group, with backbone rank 253 and projector rank 58.

Uniformity on CIFAR-10 matches (ScoreCLR −3.802, SimCLR −3.804) while alignment is looser (0.514 versus 0.367), so positive pairs sit farther apart. On ImageNet-100 uniformity is −3.931 versus −3.855 and alignment is 0.378 versus 0.235. A Poincaré-constant estimate on whitened CIFAR-10 codes, equal to 1 for a standard Gaussian, is 7.8±0.8 for ScoreCLR, 13.5±1.5 for LeJEPA, and 25.0±1.4 for SimCLR. It was not computed on ImageNet-100.

Transfer follows in-domain accuracy, not projector rank. After CIFAR-10 pretraining, STL-10 is 75.21 versus SimCLR's 76.12 and DTD is 28.01 versus 30.46. After ImageNet-100 pretraining the gaps are 1.5 on STL-10 (82.87 versus 84.35), 3.1 on DTD (56.28 versus 59.38), and 4.4 back on CIFAR-10 (71.23 versus 75.64).

Larger batches do not close the gap. On CIFAR-10, one seed, ScoreCLR stays within 0.9 points of SimCLR from batch 128 through 2048. At 4096 it is 87.50 versus 88.88, 1.4 points lower, while projector rank stays near 230. S has to rise from 1 to 10 as iterations per epoch shrink. On ImageNet-100, S=1 and K=1 drops the linear probe from 71.23 to 57.14.

On one H100 in fp32, timing the objective alone, InfoNCE takes 0.6 ms at batch 128 and ScoreCLR 2.3 ms. At batch 32768, InfoNCE takes 228 ms and 48.3 GiB. ScoreCLR takes 7.6 ms with S=1 and 30 ms with S=5, K=3, at 1.1 GiB either way. In a full step the encoder dominates: at 4096 images per device, ScoreCLR takes 508 ms and 43.1 GiB, SimCLR 531 ms and 48.7 GiB. fp16 linear accuracy is 88.82±0.04, against 88.87±0.44 in fp32, with projector rank still 229.

Why it matters

Under a shared recipe the linear probe is slightly worse. What changes is a projector that nearly fills its dimensions, and an objective whose cost scales linearly with batch size. At B=32768 with S=5 and K=3, the analytical objective is about 0.66 TFLOPs and 1.29 GB, against 6.60 TFLOPs and 68.7 GB for InfoNCE. At B=65536 the InfoNCE objective alone is 275 GB, past one 80 GB GPU. A measured full step saves only about 11% memory, because encoder activations dominate. In the analytical model the full-step memory ratio at 224 pixels falls only to 0.92. Small batches still pay a fixed overhead: with S=1, objective time stays between 2.3 and 2.9 ms from batch 128 to 8192.

A linear classifier on a frozen backbone does not convert the higher projector rank into accuracy. Concurrent work uses the same entropy-score identity, trains ResNet and ViT encoders on ImageNet-1K, and adapts corrupted images with the learned score at test time. That setup normalizes embeddings, uses one noise level, and takes 16 score-network updates per encoder step. ScoreCLR uses 1 to 5.

Limitations

The return is geometry and objective cost. The probe does not improve. Evidence stops at ResNet-18 on CIFAR-10 and ImageNet-100. There is no ImageNet-1K run and no ViT. Holding accuracy at large batches meant raising S to 10, so the constant in the linear cost grows with batch size. ScoreCLR does not shrink the batch size needed for a given accuracy.

Conditional entropy is a Gaussian lower bound, not a conditional law read out of the score. No prior other than the isotropic Gaussian is compared. The Poincaré estimate exists only for CIFAR-10 and only inside a fixed random-feature class. Whitening keeps 174 directions for SimCLR, so that comparison is not made in the same coordinates as a near-full-rank code.

On ImageNet-100, S=1 and K=1 scores 57.14 linear. A score network that also sees the other view, or another sample, scores 83.83 and 85.27 on CIFAR-10, with no retune. K=3 without gradient clipping spreads across three seeds to 78.62±4.97. Proposition 3.1 assumes a strictly positive density. Nothing checks that on the network outputs.

The recipe is not fully aligned. On CIFAR-10 the ScoreCLR encoder uses learning rate 1e-4; the other AdamW runs use 2e-4. Restoring BYOL's BatchNorm predictor reaches 89.96 linear accuracy on one seed. LARS SimCLR reaches 89.99 on CIFAR-10 from a different data pipeline. The small-batch overhead was not cut with a fused kernel. Generative tools were used in the code and in drafting; the tables were checked against training logs.

Terms

Source

What people are saying

Related papers

All paper explainers