Skip to content
AI360Xpert
Beta

SimSiam Twin Predictor

Use one shared encoder on two crops, predict one side from the other, and freeze the second side. That freeze alone stops total collapse.

SimSiam stops one branch and predicts across two views with shared weights
SimSiam stops one branch and predicts across two views with shared weights

Why Does This Exist?

BYOL needs a momentum encoder, which adds code and state. SimSiam asks for less: share weights exactly, add a predictor on one side, and stop gradient on the other. With that alone, positives train without queues or slow copies. Readers of siamese networks already know the twin shape; this page adds the freeze that makes it work alone.

This page covers shared twins plus stop-gradient only. Momentum variants are covered by the momentum pages, reachable from contrastive loss.

The one idea you need first.

Symmetric loss runs both directions: predict view 22 from view 11, then view 11 from view 22, and average. Sharing weights means one encoder ff serves both views.

Think of It Like This

Two mirrors with one covered halfway

Two mirrors face each other and one person stands between them. You cover half of the right mirror, then ask the left reflection to guess the hidden half. Because the mirrors are the same glass, the guess trains your eye for faces, not for mirror marks.

Shared weights are the same glass, stop-gradient is the cover, and the predictor is the guess. Where it stops: mirrors reflect at once, while SimSiam alternates which side is frozen.

How It Actually Works

Let z1=f(v1)z_1 = f(v_1) and z2=f(v2)z_2 = f(v_2) from shared ff. Predict p1=h(z1)p_1 = h(z_1) and p2=h(z2)p_2 = h(z_2) with head hh. Loss is L=(D(p1,z2)+D(p2,z1))/2L = (D(p_1, z_2) + D(p_2, z_1))/2 where D(p,z)=−sim(p,z)D(p,z) = -\mathrm{sim}(p,z) and zz takes no gradient. Only ff and hh update through pp.

In plain words: hh is the small predictor, DD is negative cosine, and the frozen zz is the temporary teacher.

Worked example

Take unit p1=[1,0]p_1 = [1, 0] and frozen z2=[0.9,0.436]z_2 = [0.9, 0.436]. Norm of z2z_2 is 0.81+0.19=1.0\sqrt{0.81+0.19} = 1.0. Cosine is 0.90.9. Term one is −0.9-0.9. Reverse gives −0.88-0.88 for a slightly worse angle. Loss is (−0.9−0.88)/2=−0.89(-0.9-0.88)/2 = -0.89, minimized at −1-1. A constant output cannot stay at −1-1 once views vary, so features must track crops.

Watch Out For

Allowing gradient into both sides at once

Removing stop-gradient lets both sides drift together to a constant and loss still falls. Probes then sit at chance. The symptom is fine loss with dead features. Keep the freeze and test with a linear probe on image classification.

The Quick Version

  • SimSiam shares one encoder across two views with a small predictor head.
  • One side is frozen per term and the loss runs both ways.
  • No momentum encoder, queue, or negatives are used.
  • Stop-gradient is the part that stops collapse.
  • Check probes, not loss, to confirm features live.