AnyLearn
All lessons
AIadvanced

EBMs as a Unifying Lens

Why LeCun treats energy as the common language of machine learning. This lesson shows how classification, generative models, self-supervised learning, JEPA, and diffusion all read as energy-based models, ties the contrastive-versus-regularized split back to self-supervised learning, and gives an honest account of where explicit EBMs help and where they do not.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 8

One framework, many methods

The first two lessons built the energy-based model as a specific technique: a scalar energy, inference by minimization, training by shaping a landscape. This lesson makes the larger claim that motivates the whole framework for LeCun. The energy-based view is not just one more method; it is a lens through which a large fraction of machine learning turns out to be the same thing.

The recurring pattern is this: define an energy that scores compatibility, arrange for low energy at the correct configurations, and read prediction, generation, or representation-learning off the resulting landscape. Once you see it, classification, generative modeling, self-supervised learning, JEPA, and diffusion all reveal themselves as different faces of energy-based learning. This lesson walks that unification, then closes with an honest account of what the lens does and does not buy you in practice.

Full lesson text

All 8 steps on one page, for reading, reference, and search.

Show

1. One framework, many methods

The first two lessons built the energy-based model as a specific technique: a scalar energy, inference by minimization, training by shaping a landscape. This lesson makes the larger claim that motivates the whole framework for LeCun. The energy-based view is not just one more method; it is a lens through which a large fraction of machine learning turns out to be the same thing.

The recurring pattern is this: define an energy that scores compatibility, arrange for low energy at the correct configurations, and read prediction, generation, or representation-learning off the resulting landscape. Once you see it, classification, generative modeling, self-supervised learning, JEPA, and diffusion all reveal themselves as different faces of energy-based learning. This lesson walks that unification, then closes with an honest account of what the lens does and does not buy you in practice.

2. Classification and regression as energy

Start with the familiar. A standard classifier outputs a score per class, usually turned into probabilities by a softmax. Read this through the energy lens: the negative of each class score is an energy E(x,y)E(x, y) for pairing input xx with class yy, and the softmax is exactly the Boltzmann formula eE/Ze^{-E}/Z from lesson 1, where the sum over the handful of classes makes ZZ trivial to compute. Classification is an energy-based model where the partition function happens to be cheap.

Regression fits too: predicting a value by minimizing squared error is the same as placing a simple parabolic energy valley around the target and descending to its bottom. These everyday methods are not usually described this way because their ZZ is easy and their landscape is simple. The energy view does not change how you train them; it reveals that they are the tractable corner of a much larger space, the corner where normalization is free.

3. Self-supervised learning is energy-based

The tightest connection, and the reason these two cursus are companions, is that self-supervised learning is energy-based learning applied to representations. The mapping is exact.

Define the energy of a pair of inputs as the distance between their embeddings: matching views should have low energy (close embeddings), non-matching should have high energy. Training the representation is then sculpting this energy landscape, and the collapse problem, everything mapping to one point, is precisely the flat-landscape failure from lesson 2. Now the two SSL families line up perfectly with the two EBM training strategies. Contrastive SSL (SimCLR, MoCo) pushes up the energy of negative pairs, exactly the contrastive push-up. Non-contrastive SSL (VICReg, Barlow Twins) constrains the embedding statistics to cap the low-energy volume, exactly the regularized strategy. The two literatures are not analogous; they are the same mathematics viewed from representation-learning and energy-modeling angles respectively.

4. JEPA as an energy-based architecture

This unification is exactly why LeCun frames his flagship architecture, JEPA (the Joint-Embedding Predictive Architecture, covered in its own cursus), in energy terms. A JEPA takes two related inputs, encodes both, and predicts one embedding from the other. Read as an EBM, its energy is the prediction error in embedding space: configurations the model can predict well have low energy; surprising ones have high energy.

Because JEPA is a joint-embedding method, it faces the collapse problem, and because it is LeCun's design, it uses the regularized (non-contrastive) strategy to avoid it, rather than contrastive negatives. JEPA is thus a concrete instance of everything in this cursus: an energy defined by predictability, inference as finding low-energy (predictable) configurations, and regularized training to keep the landscape from flattening. It also predicts in representation space rather than pixels, which sidesteps the wasted-capacity problem of pixel reconstruction, the reason LeCun argues it is a better route to world models than generative pixel prediction.

5. Generative and diffusion models

Generative modeling is energy-based at its core: a generator should assign high probability, hence low energy, to realistic samples and low probability to unrealistic ones. Producing a sample is finding or sampling from a low-energy region of the landscape.

Diffusion models, today's leading image and video generators, are the vivid case. As lesson 2 noted, training a diffusion model by denoising is a form of score matching: it learns the gradient of the log-density, which is the negative gradient of an energy. Generation then works by starting from noise and repeatedly stepping in the direction that lowers energy, descending the learned landscape toward realistic data. So the most powerful generative models in use are, mechanically, learning and then descending an energy landscape, even when they are never described with the word energy. The lens reveals a shared skeleton beneath methods that look unrelated on the surface.

6. The energy lens over machine learning

One idea, many instances. A classifier is an EBM with a cheap partition function. Contrastive self-supervised learning is contrastive EBM training on embeddings; non-contrastive SSL is regularized EBM training. JEPA is an EBM whose energy is embedding-space prediction error. Diffusion models learn and descend an energy landscape via score matching. The center is always: low energy at compatible configurations.

flowchart TD
  E["Energy: low = compatible configurations"] --> CL["Classification: energy per class, cheap Z"]
  E --> SSLc["Contrastive SSL: push up negatives"]
  E --> SSLr["Non-contrastive SSL: regularize landscape"]
  E --> J["JEPA: energy = prediction error in embedding space"]
  E --> DIF["Diffusion: score matching, descend the landscape"]

7. Why LeCun favors the framing

Why insist on this lens rather than treating each method on its own terms? A few reasons follow directly from what we have built.

First, generality: one language covers prediction, generation, and representation learning, so an advance in one (say, a better anti-collapse regularizer) transfers to the others. Second, uncertainty and multiplicity: an energy landscape can have many valleys, so it represents situations with several valid answers, which a single-output function cannot, the point that recurred from robot policies to perception. Third, normalization-free reasoning: because inference only compares energies, you often avoid the intractable partition function entirely and just ask which configuration is most compatible. For LeCun, these properties make energy the right substrate for systems that perceive, predict, and plan: score the compatibility of possible world states and pick low-energy ones. It is a conceptual commitment about how to build machines that model the world, and it is the thread connecting his work on self-supervised learning, JEPA, and world models.

8. An honest accounting

The lens is powerful, but intellectual unification is not the same as practical dominance, and it is worth being clear-eyed.

Explicit, general energy-based models remain hard to train: sampling with MCMC is slow and unstable, and this is a real reason they are less common in production than their conceptual reach suggests. In practice, the winning systems are usually the ones where the energy structure is implicit and the hard parts are dodged: classifiers with a cheap ZZ, contrastive and regularized self-supervised methods, and diffusion models trained by denoising. These succeed precisely because they avoid computing the partition function head-on.

So the honest summary is twofold. As a unifying theory, the energy-based view is genuinely illuminating: it shows that classification, SSL, JEPA, and diffusion share one skeleton, and it guides design, especially around avoiding collapse. As a direct recipe, training a big explicit EBM is often harder than using one of its tractable special cases. Both statements are true at once, and holding them together is the mature way to understand why this framework is central to LeCun's thinking yet not the label on most deployed systems.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. How is a standard softmax classifier an energy-based model?
    • It has no relation to EBMs
    • The negative class scores are energies E(x,y), and the softmax is the Boltzmann formula with a cheap partition function summed over the few classes
    • It computes the intractable partition function over all images
    • It only works without any energy function
  2. How do the two self-supervised learning families map onto EBM training strategies?
    • Both map to computing Z exactly
    • Contrastive SSL is contrastive EBM training (push up negatives); non-contrastive SSL is regularized EBM training (cap low-energy volume)
    • Neither has any connection to EBMs
    • Contrastive SSL is regularized; non-contrastive SSL is contrastive
  3. In the energy-based reading of JEPA, what is the energy?
    • The number of parameters in the model
    • The prediction error in embedding space: well-predicted configurations have low energy
    • The pixel reconstruction error
    • The partition function Z
  4. Why are diffusion models an example of the energy-based view?
    • They compute Z exactly during sampling
    • Trained by denoising, they learn the score (gradient of an energy) and generate by stepping downhill on that learned landscape
    • They avoid landscapes entirely
    • They are purely supervised classifiers
  5. What is the honest limitation of explicit energy-based models in practice?
    • They are always the easiest models to train
    • General explicit EBMs are hard to train (slow, unstable MCMC sampling), so deployed systems usually use tractable special cases that dodge the partition function
    • They cannot represent any real data
    • They only work for regression

Related lessons

AI
intermediate

Streams, Actions, Rewards, and Thinking That Is Not Ours

The paper is concrete about what an experiential agent would differ on, and names four: it lives in a continuous stream rather than episodes, acts in the world rather than emitting text, takes rewards from grounded signals rather than human judgement, and plans in terms it worked out rather than imitating human chain of thought. This lesson works through each.

8 steps·~12 min
AI
intermediate

The Argument: Why Learning From Us Runs Out

David Silver and Richard Sutton argue that the current approach has a ceiling built into it, because a system trained to predict what humans wrote is aiming at human performance by construction. This lesson works through their three eras, the claim about data exhaustion, why they think superhuman performance needs a different learning signal, and the honest counter-arguments.

8 steps·~12 min
AI
advanced

Building Something That Holds Up

Given that the tradable-signal path is narrow and hard to evidence, the systems worth building are the ones the first lesson identified: extraction at scale. This lesson covers the engineering that makes them survive audit, the evaluation that does not depend on returns, and the governance obligations that apply once a model touches a regulated process.

8 steps·~12 min
AI
advanced

Where LLMs Actually Fit in a Trading Firm

The popular framing is a model that predicts prices. That is the one job the technology is worst suited to, and it obscures the one it is genuinely good at: turning unstructured text into structured data at a scale that was previously unaffordable. This lesson locates LLMs against the trading stack and rules out the places they cannot go.

8 steps·~12 min