method

Contrastive Learning

Contrastive learning is a machine learning method that trains models by comparing similar and dissimilar examples.
37 related articles · 6 who worked here

Description

Contrastive learning is an approach in machine learning that allows building high-quality data representations without labels (self-supervised learning). It relies on the concept of contrastive loss: the model attracts representations (embeddings) of semantically close objects (positive pairs) and repels representations of unrelated ones (negative pairs). For example, in images, positive pairs are different views (augmentations) of the same photo, while negatives are all other images in the mini-batch. This way, the neural network learns to extract invariant features, ignoring irrelevant variations in lighting, rotation, scale. The method underpins many modern recognition systems, where it often outperforms supervised learning when labels are scarce.

History

The roots trace back to metric learning: Siamese networks (Bromley et al., 1993) for signature comparison. In 2006, Hadsell and LeCun proposed contrastive loss for learning invariant representations. Revival of interest is linked to progress in self-supervised learning for images: in 2018, the InstDisc model (Wu et al.) used a memory bank; breakthroughs came with MoCo (He et al., 2020) with a queue of negative examples and SimCLR (Chen et al., 2020) with large batch sizes and strong augmentation. These works showed that contrastive pretraining achieves accuracy close to supervised learning, and sometimes surpasses it when fine-tuning on small datasets. The approach was later adapted for video, audio, graphs, and multimodal data (CLIP, 2021).

How it works

The algorithm includes three stages: (1) stochastic data augmentation creates two independent representations of the same input (e.g., random cropping, color distortion); (2) an encoder (ResNet, ViT) maps them into vectors in a latent space; (3) a projection head (MLP) transforms them into a lower-dimensional space where the contrastive InfoNCE loss is computed: L = -log[ exp(sim(z_i, z_j)/τ) / ∑_{k=1}^{2N} 1_{k≠i} exp(sim(z_i, z_k)/τ) ], where sim is cosine similarity, τ is a temperature parameter. Optimization reduces the cross-entropy between the distributions of positive and negative pairs. To prevent representational collapse (all vectors degenerating to a single point), mechanisms are employed: negative pairs from a queue (MoCo), stop-gradient and predictor (BYOL), clustering (SwAV). As a result, the latent space acquires semantic structure invariant to the specified transformations.

In practice

Face recognition without labels, searching for similar photos in large archives, improving diagnoses from medical images when labeled data is scarce.

Fun fact

OpenAI's CLIP system, trained contrastively on image-text pairs, can generate images from descriptions even though it was never directly taught artistic style — it simply captured the correlations.

Concept graph →

Related articles · 76

Stellar2026-08-223 minarXiv:2608.22065
Two Voices of One Wind
An interpreter in a room where three languages are spoken simultaneously first hears only a general noise. But if they start asking clarifying questions, listening to intonations, and repeatedly confirming who answered with which phrase, individual voices gradually emerge from the cacophony.
Mesoscale2026-08-201 minarXiv:2608.20245express
Platinum Dots Bring Transistor Memory to Life
A plastic film as thin as a hair, and inside it — platinum dots smaller than a millionth of a millimeter. These dots sit at the boundary between two transistor layers and catch electric charge like a sponge catches water. As charge accumulates, the transistor changes its resistance, and remembers that state.
Weather vs. Climate: How to Tell Noise from Signal
In winter, one part of town gets three times as much snow as the neighborhood next door. One year is a scorcher, the next is a cold snap. That's the whims of weather. But over decades, a different, slow shift emerges: winters, on average, get milder. Telling the two apart is the central challenge for climate scientists.
Computer Vision2026-08-081 minarXiv:2608.08319express
Brain MRI Learns Not to Forget
A doctor spends years learning to recognize diseases from brain scans. First, they excel at spotting signs of aging, then they master tumors, and suddenly they start confusing what they knew before. Many neural networks behave much the same way: new knowledge overwrites the old.
A Bias That Needs No Teacher
In a warehouse, there are boxes of apples and pears. There are many apples and few pears. But when the stock clerk says "a fruit with smooth skin," we are somehow more likely to recall the rare pear than the common apple. This is the inverse base-rate effect — a persistent glitch in how the brain resolves ambiguity between categories.
math.NT2026-08-012 minarXiv:2608.00615express
Numbers Hide Patterns
In 1998, mathematician David Boyd noticed something strange. He was studying the Mahler measure of polynomials, a quantity that gauges the "complexity" of their roots, and found that for a family of curves, it always equals a special rational number times the derivative of an L-function.
Machine Learning2026-08-011 minarXiv:2608.00776express
Chemistry Looks at Molecules Through the Eyes of a Computer
Predicting the yield of a chemical reaction is a bit like trying to guess the harvest knowing only the soil composition. Traditionally, chemists have relied on long columns of numbers, quantum descriptors, that describe electron energies but say nothing about molecular shape.
Statistical ML2026-08-012 minarXiv:2608.00675express
Round Trip: How a Neural Network Checks Itself Without Hints
A neural network predicts the future of a system — say, how plasma will swirl in a magnetic field or how a face in a video will change. Errors are inevitable, and the further it looks ahead, the more they accumulate. Checking against the correct answer during operation is impossible: it simply doesn't exist.
Stellar2026-07-273 minarXiv:2607.24525
How a Neural Network Learns to Read the Sun’s Magnetic Tapestry
Each morning, dozens of telescopes swing toward the Sun. Their cameras catch a narrow band of red light — the Hα line, discovered by Johann Balmer. The images reveal dark, whimsically curved threads. They look like stitches in a giant tapestry sewn through the blazing corona.
cs.HC2026-07-262 minarXiv:2607.23889express
An Electronic Guide for Artificial Vision
An eye prosthesis sends the brain not a photograph but a sparse pattern of bright dots — phosphenes. To make out a cup or keys in this flickering noise, a person has to move their head like a flashlight in the dark, piecing together the object's outline bit by bit. It's a slow process, like assembling a puzzle where most pieces have been thrown away.
Machine Learning2026-07-161 minarXiv:2607.14995express
How to Teach AI Not to Confuse Similar MRI Scans
Ordinary AI looks at medical images like puzzles made of unfamiliar pieces: it considers any two unmatched pictures completely different. It's like trying to tell twins apart without knowing they're related. In medicine, however, patients with the same condition look nearly identical on MRI, and the algorithm mistakes 'relatives'.
Signal Processing2026-07-151 minarXiv:2607.13463express
Untangling Layered Radio Modulation: The TSDN Method
A radio signal with layered modulation resembles the cultural layer of an ancient city: each level carries its own information, but over time they get jumbled by interference. Conventional algorithms get lost in this mess. The new TSDN method acts as a neural network archaeologist.
Image Processing2026-07-151 minarXiv:2607.13812express
A Fresh Perspective on 3D Medicine
The data from a single CT scan is comparable to several feature-length films. TCAM-Diff bypasses this bottleneck: the program compresses the 3D scene into three shadow projections — like a sculptor reconstructing a solid statue from silhouettes on three walls.
math.OC2026-07-151 minarXiv:2607.13701express
How to Keep a Problem from Ballooning: A Fast Method for Machine Learning
The standard approach to a certain class of machine learning problems is like a spring that's been stretched and then forgotten: standard methods artificially inflate the problem's size, turning computations into a black hole for memory and time.
Machine Learning2026-07-151 minarXiv:2607.14086express
Brain Signals: Learning to Understand Without a Teacher
The brain communicates in short electrical clicks. Previously, to learn this language, thousands of examples with translations from the experimenter were needed. MOJO takes a different path: like learning a language through immersion, it first listens to the 'stream of consciousness' without any hints and finds recurring patterns on its own.
eess.SY2026-07-141 minarXiv:2607.12343express
How a Smart Algorithm Learns Not to Crash
A driver on a slippery road doesn't know exactly how the car will respond to the steering wheel, and learns on the go, leaving room for error. A smart control algorithm behaves in a similar way.
Machine Learning2026-07-142 minarXiv:2607.12382express
gradCSCG: How an Algorithm Maps a Room by Mimicking a Child and Brain Neurons
A child exploring an unfamiliar apartment crawls from object to object and remembers what is visible from each corner. This is how the brain builds a mental map — an internal model of space. The gradCSCG algorithm works on the same principle: it receives a video stream from a camera and independently draws a map of the room, relying only on the changing images.
Information Theory2026-07-141 minarXiv:2607.13119express
Dual Hints: How Smartphones Learn Without Glitches
When you type 'salad' and the keyboard suggests 'Caesar,' behind the scenes millions of phones are jointly learning to predict words. They share not your messages, but only improvements to the common algorithm, like a coach who sends athletes only the tweaks to the plan: 'add 5 push-ups to yesterday’s routine.' Information entropy helps send only unexpected, valuable updates.
Signal Processing2026-07-141 minarXiv:2607.12744express
Position-savvy neural network improves connectivity
In a kitchen with gas burners, each heats differently. If the cook moves the pots, food may burn. Just so in a wireless network: the antenna-burners and user-pots require precise placement. Ordinary neural networks don’t distinguish positions, treating all burners as identical. So they struggle to estimate signal quality or adjust transmission.
cs.AR2026-07-141 minarXiv:2607.13106express
Teaching Cameras to See Faster and Cheaper: On-Chip Neuromorphic Video Processing
Modern machine vision systems are gaining autonomy: engineers have managed to implement an image recognition algorithm directly on a miniature chip, freeing the camera from having to send data to a bulky computer.
eess.SY2026-07-131 minarXiv:2607.11072express
Electric Cosmos on Rails
The railway overhead contact line resembles a galaxy: energy flows through it like gravity, with trains becoming planets. The more trains draw current simultaneously, the stronger the voltage fluctuations — gravitational waves ripple through the system, threatening blackouts.
Machine Learning2026-07-131 minarXiv:2607.11091express
Neighbor molecules improve prediction accuracy
Predicting the properties of a new molecule is like guessing the flavor of an unfamiliar dish. The program works like an experienced chef: it “tastes” similar molecules whose properties are already known, and based on their “flavor,” it refines its guess.
Language Amnesia in Neural Networks: A Solution Exists!
A large neural network like Whisper masters hundreds of languages and resembles the standard model of the universe: everything is balanced. But training on a rare language disrupts this equilibrium — it turns into a black hole, pulling in all training resources. The network starts forgetting the other languages.
Materials2026-07-103 minarXiv:2607.09304
Warm Start for a Quantum Engine: How Machine Learning Accelerates Molecular Calculations
DFTB is a high-speed train in the world of quantum chemistry: hundreds of times faster than classical DFT, yet still on electronic rails. But its engine — iterative self-consistency of charges — sometimes resembles an orchestra where each instrument starts from an arbitrary note.
Digital Polisher: How a Neural Network Unveils the Secrets of Binary Gravitational Lenses
Gravitational microlensing is a fascinating cosmic effect predicted by Einstein and developed by Zwicky. A massive body passing between us and a distant star bends its light like a lens, creating characteristic magnifications and distortions.
Cosmic Cryptanalyst: Neural Network Deciphers the Secret Codes of Variable Stars
The depths of space are not silent — they are full of encrypted messages. Every star, every quasar sends its flickering light code: rhythmic like the Morse of a Cepheid, or chaotic like a cracked cipher of a supernova. Astronomers intercept these signals by the millions each night — but how to read them without a key?
cs.DB2026-06-303 minarXiv:2607.00254
Melody, Harmony, Rhythm: How AI Learns to Listen to Stellar Music
For centuries, astronomers gazed at the night sky, catching the slightest changes in stellar brightness. These uneven sequences, light curves, are like musical staves: each star performs its own unique melody.
Materials2026-06-244 minarXiv:2606.25502
The Aroma of Matter: How a Quantum Perfumer Finds Alloys with Perfect Properties
Creating a material with desired properties is an art that long relied on intuition and luck. Nature gives no hints: dozens of elements in the periodic table, and the number of their combinations tends to infinity. Previously, materials scientists resembled alchemists, trying everything in a row, or relied on statistical models that lost power beyond the known.
Materials2026-06-243 minarXiv:2606.25742
The neural network tuner: how five quantum calculations open the door to Freon-free fridges
Today's Freon-based refrigerators and air conditioners silently poison the atmosphere. An alternative is solid-state caloric materials that cool under rapid pressure changes via the barocaloric effect.
Computer Vision2026-06-242 minarXiv:2606.26279express
How the Brain Shares Experience Between Tasks
The brain doesn't learn every task from scratch: it transfers experience from one activity to another. But how do you know which tasks are truly related? Neuroscientists came up with a clever trick: let an artificial network "peek" at brain activity during one task and try to predict activity during another. If it works well, the tasks are close.
Instrumentation2026-06-151 minarXiv:2606.16922express
A neural network learns to see invisible polarization
X-ray detectors work like honeycombs: particles flash here and there in hexagonal cells. Conventional algorithms stretch these combs onto a square grid, creating ghostly polarization artifacts. Scientists used a neural network that lives by the rules of the hive — it processes the hexagonal structure directly, preserving the natural pattern.
Molecular Ballet Without a Choreographer
A dance of hundreds of particles: some pairs spin slowly and gracefully, others twitch in a frantic rhythm. To understand the essence of the dance, you need to watch the slow movements: they are the main choreography of the system. In molecular science, such slow movements are called 'slow modes,' and they determine how a protein folds into a ball or how a drug binds to its target.
Materials2026-06-061 minarXiv:2606.08148express
How Clever Sampling Teaches Metal to Predict Strength
A chef doesn't waste ingredients cooking the whole dish to check the taste: they just taste a drop of sauce. The same logic underlies the "information matching" method for predicting metal strength. Instead of expensive calculations of every atom's behavior, scientists "taste" only simple indicators linked to plasticity — a metal's ability to bend without breaking.
physics.ed-ph2026-06-021 minarXiv:2606.03622express
Game or simulation: what’s the best way to learn the photoelectric effect?
Understanding the photoelectric effect — where light knocks electrons out of a material — is like learning to cook without a recipe. That’s where digital tools help: games provide intuition, and simulations provide precision.
q-bio.GN2026-05-242 minarXiv:2605.25242express
How a protein teaches DNA to speak
A translator doesn't learn a language from a textbook but by listening to live speech and immediately seeing what people do in response to words. That's exactly how the new method C3P reads bacterial DNA. Standard genomic models try to learn the rules by simply "rereading" billions of letters of the genetic code, and often get confused.
Machine Learning2026-05-201 minarXiv:2605.21164express
Quantum Assistant Detects Rare Frauds
In the ocean of bank transactions, fraud is rarer than neutron stars in space, just 0.1% of all operations. A conventional detector gets used to the clean flow and loses vigilance. Enter Q-SYNTH, a hybrid system with a quantum generator. It creates plausible fake transactions itself, drawing on scraps of real data.
Machine Learning2026-05-082 minarXiv:2605.07878express
Why Some Questions Work and Others Don't
You're trying a dish at a restaurant, but you haven't seen the menu. You ask the waiter questions — too salty? what spices?—and from the answers you try to guess what kind of chef prepared it.
General Relativity2026-05-042 minarXiv:2605.02453express
How to Hear a Crack in the Fabric of the Universe
The symphony plays, but a barely perceptible wrong note has crept into the score. This is roughly how physicists search for deviations from general relativity in the 'sounds' of the universe — gravitational waves from merging black holes.