SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.04906 · ICLR · 2021

VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning

Yann Lecun, Adrien Bardes, Jean Ponce

arXiv · PDF · Open in the Atlas

Code that ran

15 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 8 have no contract verdict; 5 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2105.04906.json · badge: /api/ran/2105.04906.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
facebookresearch/vicreg canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
AnnaManasyan/VICReg community (classifier label)
classifier basis: plan_row
5 ran · 0 no recorded run
lightly-ai/lightly community
Papers with Code archive
4 ran · 1 no recorded run
FloCF/SSL_pytorch community
Papers with Code archive
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
FullGatherLayer Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/vicreg/main_vicreg.py
code served (permissive licence) · get_code("90bc3c3bb8e6523b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, FullGatherLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.distributed as dist
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Mock the distributed functions since we're not in a real distributed setting
def mock_get_world_size():
    return 2

def mock_get_rank():
    return 0

def mock_all_gather(output_list, tensor):
    # Simulate gathering: fill each output slot with the tensor
    for i in range(len(output_list)):
        output_list[i].copy_(tensor)

def mock_all_reduce(tensor):
    # Simulate all_reduce: just scale by world size
    tensor.mul_(2)

# Patch the distributed functions
with patch('torch.distributed.get_world_size', mock_get_world_size):
    with patch('torch.distributed.get_rank', mock_get_rank):
        with patch('torch.distributed.all_gather', mock_all_gather):
            with patch('torch.distributed.all_reduce', mock_all_reduce):
                # Create a small tensor: batch size 2, dimension 4
                x = torch.randn(2, 4)
                
                ARGS = {
                    'x': x
                }
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FullGatherLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FullGatherLayer output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GatherLayer Ran
ran on a synthesized input · constructed an object; no result was computed
lightly-ai/lightly/lightly/loss/vicreg_loss.py
code served (permissive licence) · get_code("4073146360f534c5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, GatherLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.distributed as dist
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Mock distributed environment since we're not in a real distributed setting
def mock_get_world_size():
    return 2

def mock_get_rank():
    return 0

def mock_all_gather(output_list, input_tensor):
    # Simulate gathering - fill output list with copies of input
    for i in range(len(output_list)):
        output_list[i].copy_(input_tensor)

def mock_all_reduce(tensor):
    # Simulate all_reduce - in mock, just keep the tensor as is
    pass

# Patch the distributed functions
dist.get_world_size = mock_get_world_size
dist.get_rank = mock_get_rank
dist.all_gather = mock_all_gather
dist.all_reduce = mock_all_reduce

# Create a small input tensor
input_tensor = torch.randn(2, 4, requires_grad=True)

ARGS = {
    "ctx": Mock(),
    "input": input_tensor,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GatherLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GatherLayer output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Projector Ran
ran; our contract draft was wrong, not the code
facebookresearch/vicreg/main_vicreg.py
code served (permissive licence) · get_code("19322d1e968e9137")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

class Args:
    def __init__(self):
        self.mlp = '64-32-16'

args = Args()
embedding = 128

ARGS = {
    'args': args,
    'embedding': embedding
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
VICReg Ran
ran on a synthesized input
FloCF/SSL_pytorch/torchselfsup/models/vicreg.py
code served (permissive licence) · get_code("c796daf86600fb9e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# Define a simple backbone network
class SimpleBackbone(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Create backbone
backbone = SimpleBackbone(input_dim=5, output_dim=4)

INIT_ARGS = {
    'backbone_net': backbone,
    'repre_dim': 4,
    'projector_hidden': (8, 8, 8),
    'λ': 25.0,
    'μ': 25.0,
    'ν': 1.0,
    'γ': 1.0,
    'ε': 0.0001,
}

ARGS = {
    'x1': torch.randn(2, 5),
    'x2': torch.randn(2, 5),
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
VICRegLoss Ran
ran on a synthesized input · constructed an object; no result was computed
lightly-ai/lightly/lightly/loss/vicreg_loss.py
code served (permissive licence) · get_code("23452a5a035b134a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, VICRegLoss: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.distributed as dist

torch.manual_seed(0)

# Initialize distributed environment in non-distributed mode
if not dist.is_available():
    pass
else:
    if not dist.is_initialized():
        pass

ARGS = {
    "lambda_param": 25.0,
    "mu_param": 25.0,
    "nu_param": 1.0,
    "gather_distributed": False,
    "eps": 0.0001,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VICRegLoss — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VICRegLoss output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from facebookresearch/barlowtwins
pointer only · get_code("b0f936d4d6ae3b8c")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

adjust_learning_rate Ran
ran, honoured the contract we drafted
facebookresearch/vicreg/main_vicreg.py
code served (permissive licence) · get_code("0a59c9ccf5135868")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.optim as optim
import math

torch.manual_seed(0)

# Create a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model and optimizer
model = MinimalModel()
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Create a minimal data loader (list of batches)
loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
]

# Create args object with required attributes
class Args:
    def __init__(self):
        self.epochs = 5
        self.base_lr = 0.1
        self.batch_size = 256

args = Args()

ARGS = {
    'args': args,
    'optimizer': optimizer,
    'loader': loader,
    'step': 15
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
augment Ran
ran on a synthesized input
AnnaManasyan/VICReg/utils.py
code served (permissive licence) · get_code("73fbb91c4b92324b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from PIL import Image
import numpy as np

# Create a small PIL Image (224x224 RGB)
# RandomResizedCrop expects a PIL Image or tensor
img_array = np.random.randint(0, 256, (224, 224, 3), dtype=np.uint8)
pil_image = Image.fromarray(img_array)

ARGS = {
    "image": pil_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cov_loss Ran
ran on a synthesized input
AnnaManasyan/VICReg/loss.py
code served (permissive licence) · get_code("0c5a6989161b85e9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# z_a and z_b are used as:
# - .shape[0] to get batch size N
# - .shape[1] to get feature dimension D
# - .mean(dim=0) to compute mean across batch
# - matrix operations (T @, /)
# They need to be 2D tensors of floats

N = 2  # batch size
D = 4  # feature dimension

z_a = torch.randn(N, D)
z_b = torch.randn(N, D)

ARGS = {
    "z_a": z_a,
    "z_b": z_b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
exclude_bias_and_norm Ran
ran, violated the contract we drafted
facebookresearch/vicreg/main_vicreg.py
code served (permissive licence) · get_code("28c640db8f721c0d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function exclude_bias_and_norm takes a parameter p and checks if p.ndim == 1
# So p needs to be a tensor or have an ndim attribute

# Create a simple parameter (tensor) with ndim == 1
p_1d = torch.randn(4)

# Create a simple parameter (tensor) with ndim != 1
p_2d = torch.randn(4, 3)

# Test with 1D parameter
ARGS = {
    "p": p_1d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
invariance_loss Ran
ran; our contract draft was wrong, not the code
lightly-ai/lightly/lightly/loss/vicreg_loss.py
code served (permissive licence) · get_code("48e54f52f61ab9b8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for x and y
# Shape: (batch_size=2, dim=4)
x = torch.randn(2, 4)
y = torch.randn(2, 4)

ARGS = {
    "x": x,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
off_diagonal Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AnnaManasyan/VICReg/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from neurai-lab/tamil, is pointer only (licence: NONE) · get_code("3e30d88eaef01190")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from neurai-lab/tamil, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

optim Ran
ran on a synthesized input
AnnaManasyan/VICReg/utils.py
code served (permissive licence) · get_code("1eeada3f42590ae7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned LARS. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Initialize gradients for parameters
for param in model.parameters():
    param.grad = torch.randn_like(param)

weight_decay = 0.0001

ARGS = {
    'model': model,
    'weight_decay': weight_decay
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LARS — a LARS output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LARS output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
std_loss Ran
ran on a synthesized input
AnnaManasyan/VICReg/loss.py
code served (permissive licence) · get_code("62a1a07b187aa7a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create two small tensors with batch size 2 and dimension 4
z_a = torch.randn(2, 4)
z_b = torch.randn(2, 4)

ARGS = {
    "z_a": z_a,
    "z_b": z_b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
variance_loss Ran
ran; our contract draft was wrong, not the code
lightly-ai/lightly/lightly/loss/vicreg_loss.py
code served (permissive licence) · get_code("adb0bbb17650f6fe")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small tensor with shape (batch_size, ..., dim)
# Using batch_size=2, and dim=4 as specified
# Adding an extra dimension to make it (2, 3, 4) to test the general case
x = torch.randn(2, 3, 4)

# eps parameter for numerical stability
eps = 0.0001

ARGS = {
    "x": x,
    "eps": eps,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
VICReg Not yet run
unverified (harvested, no recorded run)
facebookresearch/vicreg/main_vicreg.py
code served (permissive licence) · get_code("a8066cb8d5d3e19d")
How it ran

no invocation recorded.

gather Not yet run
unverified (harvested, no recorded run)
lightly-ai/lightly/lightly/loss/vicreg_loss.py
code served (permissive licence) · get_code("f4b990248d9c5170")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 11 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 11 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
accuracy 116 other papers
16 dated earlier, 2 the same month, 98 later · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
off_diagonal
brick of this paper's assembly: helper
23 other papers
4 dated earlier, 19 later · 5 only as an assembly brick
1908.10084 (2019-08)
Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
2004.04136 (2020-04)
CURL: Contrastive Unsupervised Representations for Reinforcement Learning
2007.16189 (2020-07)
Self-supervised learning through the eyes of a child
and 20 more not named here
exclude_bias_and_norm 7 other papers
7 later
2110.09348 (2021-10)
Understanding Dimensional Collapse in Contrastive Self-supervised Learning
2112.09164 (2021-12)
High Fidelity Visualization of What Your Self-Supervised Representation Knows About
2211.10831 (2022-11)
Joint Embedding Predictive Architectures Focus on Slow Features
and 4 more not named here
FullGatherLayer
brick of this paper's assembly: helper
3 other papers
3 later · 2 only as an assembly brick
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
2305.16789 (2023-05)
Modulate Your Spectrum in Self-Supervised Learning
2401.10474 (2024-01)
LDReg: Local Dimensionality Regularized Self-Supervised Learning
gather
brick of this paper's assembly: helper
2 other papers
2 later
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
2401.03145 (2024-01)
Self-supervised Feature Adaptation for 3D Industrial Anomaly Detection
GatherLayer
brick of this paper's assembly: helper
1 other paper
1 later
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
Projector
brick of this paper's assembly: model
1 other paper
1 later
2310.01012 (2023-10)
Unconstrained Stochastic CCA: Unifying Multiview and Self-Supervised Learning
VICRegLoss
brick of this paper's assembly: entry
1 other paper
1 later
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
adjust_learning_rate 1 other paper
1 later
2310.01012 (2023-10)
Unconstrained Stochastic CCA: Unifying Multiview and Self-Supervised Learning
invariance_loss
brick of this paper's assembly: loss
1 other paper
1 later
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
variance_loss
brick of this paper's assembly: loss
1 other paper
1 later
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent self-supervised methods for image representation learning maximize the agreement between embedding vectors produced by encoders fed with different views of the same image. The main challenge is to prevent a collapse in which the encoders produce constant or non-informative vectors. We introduce VICReg (Variance-Invariance-Covariance Regularization), a method that explicitly avoids the collapse problem with two regularizations terms applied to both embeddings separately: (1) a term that maintains the variance of each embedding dimension above a threshold, (2) a term that decorrelates each pair of variables. Unlike most other approaches to the same problem, VICReg does not require techniques such as: weight sharing between the branches, batch normalization, feature-wise normalization, output quantization, stop gradient, memory banks, etc., and achieves results on par with the state of the art on several downstream tasks. In addition, we show that our variance regularization term stabilizes the training of other methods and leads to performance improvements.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2105.04906")
get_code_for_paper("2105.04906")
have("2105.04906")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2105.04906.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2105.04906.svg)](https://syntology.ai/paper/2105.04906)

Connect an agent — have() is free.