Papers › MOCA: Self-supervised Representation Learning by Predicting Masked Online Codebook Assignments

MOCA: Self-supervised Representation Learning by Predicting Masked Online Codebook Assignments

18 Jul 2023arXiv:2307.09361archive 2025-07-28

Spyros Gidaris, Andrei Bursuc, Oriane Simeoni, Antonin Vobecky, Nikos Komodakis, Matthieu Cord, Patrick Pérez

Self-supervised learning can be used for mitigating the greedy needs of Vision Transformer networks for very large fully-annotated datasets. Different classes of self-supervised learning offer representations with either good contextual reasoning properties, e.g., using masked image modeling strategies, or invariance to image perturbations, e.g., with contrastive methods. In this work, we propose a single-stage and standalone method, MOCA, which unifies both desired properties using novel mask-and-predict objectives defined with high-level features (instead of pixel-level details). Moreover, we show how to effectively employ both learning paradigms in a synergistic and computation-efficient way. Doing so, we achieve new state-of-the-art results on low-shot settings and strong experimental results in various evaluation protocols with a training that is at least 3 times faster than prior methods. We provide the implementation code at https://github.com/valeoai/MOCA.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2307.09361")

Code

Syntology Ran 13 of 15 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · fixture could not drive it; 11 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

valeoai/moca officialmentioned in papermentioned on GitHubpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 13 ran; 1 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · fixture could not drive it
11ran
2unverified

Licence: 15 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from valeoai/moca. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

adjust_learning_rate valeoai/moca/eval_finetune.py official repository ran · honoured contract no licence file found · pointer only · bd3578806ecf5ac2 · report
all_reduce_mean valeoai/moca/util/misc.py official repository ran fingerprinted no licence file found · pointer only · 3dc19396537db789 · report
buildLabelIndex valeoai/moca/util/data_utils.py official repository ran fingerprinted licence not identified · pointer only · 57889d72f516d105 · report
build_dataset valeoai/moca/eval_finetune.py official repository ran licence not identified · pointer only · 9d24fe78509853ec · report
build_transform valeoai/moca/eval_finetune.py official repository ran licence not identified · pointer only · ae21f98447467f18 · report
concat_all_gather valeoai/moca/util/misc.py official repository ran fingerprinted licence not identified · pointer only · 3c7b9c20481fa62f · report
get_1d_sincos_pos_embed_from_grid valeoai/moca/util/model_utils.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · 5c8ea92d43ead77d · report
get_2d_sincos_pos_embed valeoai/moca/util/model_utils.py official repository ran fingerprinted no licence file found · pointer only · 77e8a3ac46f3afec · report
knn_classifier valeoai/moca/util/knn_utils.py official repository ran licence not identified · pointer only · d5a2c7c5c6f12965 · report
prepare_knn_imagenet_datasets valeoai/moca/util/data_utils.py official repository ran licence not identified · pointer only · d9dc385a3c9e906e · report
preprocess_embeddings valeoai/moca/eval_lowshot_logistic.py official repository ran fingerprinted licence not identified · pointer only · a532283a514e44c5 · report
reduce_all valeoai/moca/util/misc.py official repository ran fingerprinted licence not identified · pointer only · 3aa8a268d0817a99 · report
subset_of_ImageNet_train_split valeoai/moca/util/data_utils.py official repository ran licence not identified · pointer only · 3fcd69d9585e3775 · report
get_2d_sincos_pos_embed_from_grid valeoai/moca/util/model_utils.py official repository unverified no licence file found · pointer only · 2884deadbb637c3e · report
init_data valeoai/moca/eval_lowshot_logistic.py official repository unverified licence not identified · pointer only · 6ce1dce0cfb1a538 · report

Tasks

Representation LearningSelf-Supervised Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerVision Transformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections