Source-linked AI summary
An Energy-Based Perspective on Machine Learning
Bo Dai, Yilun Du
TL;DR
Machine learning areas share the problem of learning relationships among variables and using them to infer unknowns, but are often treated as separate. This tutorial connects them through energy-based models and derives new objectives from the EBM structure, including for reinforcement learning, world models, and policy distillation.
Problem
Machine learning is often divided into separate areas despite their shared problem of learning relationships among variables and using them to infer unknown quantities.
Source: §1 · p. 3Method
The tutorial uses the probabilistic EBM formulation as a common framework for connecting generative models and other machine-learning methods.
Source: §1 · p. 3Results
The tutorial derives new objectives from EBM structure for reinforcement learning, world models, best-of-N policy distillation, and fine-tuning.
Source: §8 · p. 63Takeaways & Limitations
For compositional reasoning, training can cover kinds of constraints rather than their combinations, while inference minimizes the composed energy.
Source: §7.3 · p. 58Normalizing flows obtain tractable density through architectural constraints, including invertibility, equal input and latent dimensions, and layers with cheap Jacobian determinants.
Source: §4.2 · p. 26
Abstract
from arXiv · showhide
Energy-based models (EBMs) define a distribution through a scalar energy, $p_\theta(x)\propto\exp(-E_\theta(x))$, and are usually presented as one model family among many. This tutorial has a broader goal: beyond introducing EBMs, it uses them as a single lens that connects the different aspects of machine learning. Any EBM is specified by three choices, the energy, which determines what the model represents; the inference procedure, which samples from or optimizes the energy; and the learning method, which fits the energy to data. We first develop these components, including sampling, variational inference, and learning by maximum likelihood, noise contrastive estimation, pseudolikelihood, score matching, and adversarial training, and show that the learning methods share one contrastive structure. We then show that discriminative models, generative models such as GANs, normalizing flows, diffusion and autoregressive models, representation learning methods such as contrastive learning, word2vec, BERT, denoising auto-encoders, and diffusion representations, reinforcement learning with EBM policies and world models, inverse reinforcement learning, and planning, as well as inference-time computation with verifiers, are all EBMs that differ in these three choices, mostly in how they handle the partition function and sampling. This view explains existing methods, organizes them into a common framework, and suggests new algorithms by replacing one component while keeping the others, with composition of energies as a principled way to combine learned models at inference time.
1 Introduction
Machine learning areas share the problem of learning relationships among variables and using them to infer unknowns; energy-based models offer a common perspective on that problem. The tutorial uses this lens to connect representation, inference, and composition across machine learning.
1 Introduction
- EBMs represent compatibility with a scalar energy: low-energy configurations correspond to plausible observations, compatible representations, or desirable outcomes.Learning shapes the energy landscape, and inference uses it to produce predictions, samples, or actions.Source: §1 · p. 3
- The probabilistic EBM formulation connects generative models that parameterize densities, learn scores, or construct sampling procedures.Autoregressive models sum negative log conditional factors into an energy, flows use change of variables, and diffusion models learn gradients of log densities.Source: §1 · p. 3
- Representation-learning energies encode compatibility between observations and latent descriptions or between views, linking contrastive, reconstruction, and denoising objectives to prediction and generative modeling.The tutorial notes that learned generative models can also provide objectives for inferring representations of new observations.Source: §1 · p. 3
- Planning energies score actions or trajectories using predicted consequences, with costs and constraints adding energy and rewards entering with the opposite sign.Planning searches for configurations satisfying the requirements, while entropy-regularized formulations connect that search to probabilistic inference.Source: §1 · p. 3
- Inference-time methods such as response selection, partial-solution search, and iterative refinement correspond to different procedures for minimizing an energy.Fine-tuning fits the combined energy directly, paying inference costs during training rather than for every input.Source: §1 · p. 3
- Adding energy functions combines requirements, equivalent to multiplying their unnormalized densities when the resulting distribution is normalizable.This supports combining learned knowledge with task-specific information without training a separate predictor for every combination; success depends on component accuracy, relative scales, and effective inference.Source: §1 · p. 3
2 A Brief Introduction to Energy-Based Models
This section presents EBMs as a flexible framework for representing distributions and composing energies, then surveys inference and learning methods that work around the partition function. It unifies most learning methods through lowering energy on data and raising it on negative samples, while distinguishing regression-based training that supervises optimization outcomes or update fields.
2.1 Energy-Based Models
- An EBM’s energy determines density up to a partition function, and changing that normalizer can yield joint or conditional distributions; flexible representation comes at the cost of expensive inference.The partition function is often intractable, complicating both sampling and probability calculation.Source: §2.1 · pp. 4, 6
- Exponential-family, maximum-entropy, MRF/CRF, and Hopfield/Boltzmann models are special EBM forms; residual EBMs can leverage a useful base distribution.Residual and vanilla EBMs have the same modeling flexibility, but the residual form is more convenient when a good base distribution is available.Source: §2.1 · pp. 4–6
2.2 Beyond EBMs: Generalized Maximum Entropy
- Generalized maximum entropy varies the divergence, which determines the model family, and relaxes moment constraints, which induces dual-norm regularization.An ℓ1 penalty can yield sparse models, while an RKHS feature map gives a nonparametric kernel exponential family.Source: §2.2 · pp. 6–7
2.3 Adaptability and Composability of EBMs
- Energy arithmetic implements set AND by summation, OR by soft minimum, and relative NOT by subtraction, allowing nested compositions of learned energies.For NOT, subtracting the energy for A raises energy where A holds, representing B without A.Source: §2.3 · p. 7
- Distributional composition represents products, mixtures, and inversions: products and inversions avoid component partition functions, mixtures generally require them, and classifier-free guidance is an inversion.Products combine regions likely under both distributions; inversions may not be normalizable.Source: §2.3 · pp. 8–9
- Composing separately learned conditionals can generate unseen combinations using KM models rather than M^K, provided conditions are conditionally independent and components are accurate where composition places mass.The components need not be trained on every combination, but the composition may place mass in regions with few training examples for any one condition.Source: §2.3 · p. 10
- EBMs adapt by clamping variables, adding energies for new requirements, or retaining a pretrained base distribution while learning only a residual correction.Sampling composed energies requires careful scale weights, and products can be harder to sample because their modes may lie in a small region far from each component’s modes.Source: §2.3 · p. 10
2.4 Inference with EBMs
- Inference for EBMs includes Metropolis–Hastings sampling, variational distribution approximation, and prediction by optimization, and these methods extend to conditional EBMs.Source: §2.4 · p. 11
- Metropolis–Hastings sampling avoids evaluating the partition function because its acceptance ratio uses only energy differences; Gibbs sampling always accepts conditional proposals.Gibbs conditionals involve only energy terms containing the updated variable, making it natural for MRFs and Boltzmann machines.Source: §2.4 · p. 11
- HMC uses momentum and reversible leapfrog proposals to travel farther with less-correlated samples, while trading more gradient evaluations for that benefit.A finite-step unadjusted Langevin update is biased; an MH correction yields MALA. HMC performance depends on step size and trajectory length, which NUTS adapts.Source: §2.4 · pp. 11–12
- Variational inference amortizes sampling by fitting a tractable qϕ, but reverse-KL fitting can miss modes and its error depends on the chosen distribution family.Its objective balances low energy against entropy without evaluating the partition function; flows and autoregressive models offer exact log densities, while implicit generators require entropy estimation.Source: §2.4 · pp. 12–13
- Energy minimization predicts without comparing partition functions, but nonconvex search may miss the global minimum, making initialization affect the result.Small discrete output sets can be enumerated, continuous outputs optimized by gradient descent, and structured discrete outputs handled with combinatorial or approximate search.Source: §2.4 · p. 13
2.5 Learning for EBMs
- Maximum likelihood contrasts lower energy on data with higher energy on model samples, but obtaining those negative samples can be challenging.Contrastive divergence initializes negatives at data; other approaches initialize from noise or an approximate distribution and use Langevin dynamics.Source: §2.5 · pp. 13–14
- Noise contrastive estimation replaces model sampling with data-versus-noise classification: binary NCE learns the normalizer, whereas ranking NCE learns energy alone.Ranking NCE is especially convenient for conditional models with input-dependent partition functions, but normalized likelihoods then require a separate normalizer estimate.Source: §2.5 · pp. 14–15
- Pseudolikelihood is consistent under positivity but can be data-inefficient for global interactions; masked diffusion extends it to predict variables across masking levels.Pseudolikelihood trains single-variable conditionals, while masked diffusion also trains with multiple variables hidden; unlike an EBM's conditionals, directly parameterized diffusion conditionals need not define a consistent joint distribution.Source: §2.5 · p. 16
- Score matching fits data scores without the partition function, model samples, or a noise distribution; sliced and denoising variants reduce its computational burden.Sliced score matching replaces a Hessian trace with a Hessian-vector product, while denoising score matching adds Gaussian noise and matches the score of the noising kernel.Source: §2.5 · pp. 16–17
- Score matching is inaccurate in scarce-density regions and requires continuous inputs and differentiable energies; discrete ratio matching instead matches ratios tied to single-variable conditionals.Denoising score matching fills low-density regions with noise, while discrete ratio matching connects to pseudolikelihood and categorical ratio matching in discrete diffusion [165].Source: §2.5 · p. 17
- Adversarial training makes maximum likelihood a min-max game: an entropy-regularized sampler approaches the EBM while the energy lowers on data and rises on sampler outputs.The entropy term prevents mode collapse and makes the solution correspond to maximum likelihood; training alternates energy and sampler updates, and performance depends on how closely the sampler tracks the model.Source: §2.5 · pp. 17–18
- Regression methods avoid partition-function estimation: IREM [54] supervises optimized predictions, whereas Equilibrium Matching [186] supervises a local update field.IREM differentiates through optimization but truncates backpropagation in practice; EqM requires no unrolled generation trajectory, and neither objective is maximum likelihood or guarantees equilibrium sampling from the learned energy.Source: §2.5 · p. 18
2.6 Unified View through Contrastive Learning
- Most EBM learning gradients lower energy on data and raise it on negative samples; replacing model samples with a cheaper sampler changes the gradient when that sampler differs from the model.Maximum likelihood uses model samples, while other methods choose alternative negative samplers; Table 1 and Figure 3 illustrate these choices.Source: §2.6 · pp. 18–19
- Short-chain contrastive divergence is cheap but can miss distant energy minima, while one-step pseudolikelihood and score-matching samplers constrain negatives to local changes.Persistent CD and short-run Langevin are variants; score matching is the small-step limit of one-step Langevin CD, and broader block or regional resampling captures more global structure than pseudolikelihood.Source: §2.6 · pp. 19–20
- Noise-contrastive estimation weights data and noise negatives by a classifier, becoming model samples as the model approaches the data; InfoNCE [179] uses other batch samples’ outputs as negatives.Ranking NCE is self-normalized importance sampling, and its sampler quality depends on whether the noise distribution covers the model.Source: §2.6 · p. 20
3 Discriminative Models
Discriminative EBMs score input–output pairs with an energy that induces a conditional distribution, recovering familiar models through choices of output space and energy. Logistic regression and CRFs use tractable structure for exact likelihood in some settings, while SPENs use deep energies to model broader output interactions through approximate optimization.
3 Discriminative Models
- Discriminative EBMs define an energy over input–output pairs, inducing a conditional distribution that recovers logistic regression, CRFs, and SPENs through different output spaces and energies.Source: §3 · p. 20
3.1 Logistic Regression and CRFs
- For logistic regression, summing over K classes makes maximum-likelihood training exact; with neural features, this is standard softmax cross-entropy training.For fixed features, the objective is convex; small problems can use iteratively reweighted least squares.Source: §3.1 · p. 21
- Linear-chain CRFs compute the partition function and marginals exactly by dynamic programming in O(TK^2), and Viterbi inference finds the minimum-energy label sequence.Exact likelihood extends to trees and low-treewidth graphs; loopy graphs require approximate inference or learning methods such as pseudolikelihood and contrastive divergence.Source: §3.1 · pp. 21–22
- Max-margin structured prediction learns an energy over input–output pairs using MAP inference, avoiding normalization even when the partition function is intractable.Structured perceptrons, max-margin Markov networks, and structured SVMs use energy minimizers or loss-augmented minimizers.Source: §3.1 · p. 22
3.2 Structured Prediction Energy Networks
- SPENs replace fixed label-interaction graphs with a deep energy over the whole output, allowing learned interactions among all labels but requiring approximate gradient-based inference and yielding nonconvex training.Their relaxed binary-label energy combines local input-based scores with a global term that learns which labels tend to co-occur.Source: §3.2 · pp. 22–23
- End-to-end SPENs unroll a fixed number of inference steps and backpropagate task loss; later variants regress task scores directly or learn a network to approximate the energy minimizer.Source: §3.2 · p. 23
4 Generative Models
This section views generative models through energy-based modeling, connecting their energy and sampling choices to normalization and inference. It also relates autoregressive and deep equilibrium models to EBMs through their update rules, inference procedures, and parameterizations.
4.1 Generative Adversarial Nets
- Entropy-regularized GANs train the energy on data and generated samples and the generator toward the EBM; with sufficiently rich families, qϕ = pθ = pd, but implicit-generator entropy is intractable [101] [39] [36].Without the entropy term, GANs learn a density ratio rather than a recoverable energy, and the generator can collapse modes; the entropy term requires a tractable or estimated generator density.Source: §4.1 · pp. 24–25
4.2 Normalizing Flows
- Normalizing flows use invertible transformations to make density and normalization exact, enabling exact maximum-likelihood learning without model samples and one-pass sampling, at the cost of architectural constraints [47] [48] [138].Invertibility requires equal data and latent dimensions and preserves topology; cheap Jacobian determinants also constrain layer design.Source: §4.2 · pp. 25–26
4.3 Diffusion and Flow Models
- Diffusion and flow models learn noise- or time-dependent targets that are affine functions of the noisy data distribution’s score, representing a family of EBMs traversed from smooth to sharp [161] [163].Diffusion models fit scores through denoising; flow models regress path velocity and generate samples by integrating an ODE. The score connection relies on Gaussian corruption and continuous data; discrete models instead learn probability ratios or conditionals [9] [165] [120].Source: §4.3 · p. 27
- Composed energies define product distributions, but summed diffusion scores generally give biased samples; MCMC corrections can recover compositions, while classifier guidance expresses conditional sampling as an energy product [55].Guidance at weight w = 1 gives the posterior, and w > 1 sharpens the classifier expert; reverse-diffusion guidance only approximately samples the product because noise does not commute with products.Source: §4.3 · pp. 28–29
4.4 Energy-Inspired Models
- Energy-inspired models define the distribution by the sampler using a learned energy, making sampling exact by construction; self-normalized importance sampling yields a likelihood lower bound and gives ranking NCE a sampler-likelihood interpretation.Hamiltonian importance sampling refines a proposal with energy-gradient dynamics and trains by backpropagating through the trajectory and maximizing a variational likelihood bound.Source: §4.4 · pp. 29–30
- Modern Hopfield networks use energy minimization to retrieve stored patterns, with a softmax update that replaces a state by the expected stored pattern and typically retrieves a well-separated pattern in one step [142].The network stores patterns as columns of X and can store exponentially many patterns.Source: §4.4 · p. 30
- A transformer attention layer performs one step of energy minimization, and iterating that update to its fixed point leads to a deep equilibrium model.Source: §4.4 · p. 30
4.5 Deep Equilibrium Models
- A DEQ defines its layer output as a fixed point; when its update is energy-gradient descent, its forward pass minimizes energy and implicit differentiation avoids unrolling.A general DEQ layer need not descend an energy, and its fixed point may not exist or be unique; monotone operator equilibrium networks guarantee uniqueness.Source: §4.5 · pp. 30–31
- DEQ training uses task losses and implicit gradients when fixed-point targets exist; unconditional generation instead uses distillation, likelihood, diffusion denoising, or Equilibrium Matching.Cheaper conditional-training approximations include Jacobian-free backpropagation and phantom gradients.Source: §4.5 · p. 31
- Equilibrium Matching learns a time-independent energy-gradient field from corrupted data and noise, with descent from noise reaching data equilibria without a pretrained teacher.The network omits the noise level and uses a target magnitude that vanishes at the data; this equilibrium approximation can be loose in low dimensions.Source: §4.5 · p. 31
4.6 Autoregressive Models as Approximate Ancestral Samplers
- Autoregressive models replace an EBM’s intractable conditionals with learned prefix conditionals, enabling exact one-pass sampling and exact maximum-likelihood training but generally losing a recoverable global energy.The learned conditionals approximate marginalized sums separately, so an underlying EBM’s parameters generally cannot be recovered.Source: §4.6 · pp. 32–33
- Averaging autoregressive factorization over random orders yields any-order models, while masked discrete diffusion is equivalent and can reveal several variables in parallel at an exactness cost.Directly parameterized conditionals revealed in parallel need not be consistent with a single joint distribution.Source: §4.6 · p. 33
- For language models, left-to-right order and flexible Transformer decoders fit autoregressive modeling, allowing all training conditionals in one pass and token-by-token ancestral generation.Causal masking lets the model retain exact maximum-likelihood learning at scale.Source: §4.6 · p. 34
5 Representation Learning
This section connects self-supervised contrastive, predictive, and denoising methods that learn feature maps and discard their energies with decisive models that retain learned energies to make decisions. It also covers instruction-conditioned encoding and hard negatives in these decisive models.
5.1 Contrastive Representation Learning
- SimCLR [30], CLIP [140], SigLIP [200], and AmorLIP [167] learn the same bilinear EBM but differ in partition-function estimators and their batch-size, consistency, and modeling-cost tradeoffs.Ranking NCE cancels the partition function within a batch but has a biased gradient that improves with larger batches; SigLIP’s binary NCE has an unbiased gradient at any batch size, while AmorLIP amortizes partition functions to retain maximum-likelihood consistency without large batches.Source: §5.1 · pp. 34–36, Figure 6 · p. 35
5.2 Word2vec
- Word2vec [126, 127] casts Skip-gram as binary NCE on word-context pairs, implicitly factorizing shifted pointwise mutual information.Skip-gram uses observed pairs as data and pairs drawn from p(w)pn(c) as noise; CBOW is a single-hidden-word masked-prediction EBM trained with negative sampling or hierarchical softmax.Source: §5.2 · p. 37
5.3 BERT
- BERT [44] is a masked-prediction EBM whose factorized potential makes its partition function tractable and maximum-likelihood objective exact.BERT generalizes CBOW with a bidirectional Transformer and predicts multiple masked tokens independently; it is a one-step discrete diffusion model, while single-position masking gives pseudolikelihood and averaging over masking ratios gives masked diffusion.Source: §5.3 · pp. 37–38
5.4 Diffusion Representations
- Denoising auto-encoders arise as conditional EBMs with a bilinear energy, while diffusion spectral representations extend this form across noise levels and learn by score matching.The DAE’s latent-variable model is fit to corrupted data by denoising score matching; the diffusion representation uses a clean condition, corrupted targets at multiple noise levels, and one shared condition representation.Source: §5.4 · pp. 38–40
5.5 Representation-Induced Decisive Models
- InF-Embed [205] turns instruction-following retrieval into a candidate-scoring decision, embedding both contexts and instructional queries so new questions need no newly trained classifier.Context embeddings can be precomputed and indexed; answering a query then requires encoding it and scoring contexts, enabling scalable retrieval.Source: §5.5 · pp. 40–41
- NCE uses hard negatives that slightly alter the instruction or query, bringing the noise distribution close to the data and forcing the energy to depend on the instruction, not just the query.The negatives pair the context with an altered instruction or an altered query; fitting both conditionals trains both sides of the energy, with one side replaced at a time to keep the denominator linear in batch size.Source: §5.5 · p. 41
- Unlike representation learning, which discards the trained energy and uses embeddings downstream, a decisive foundation model uses the learned model itself to decide across queries and instructions.InF-Embed is a bilinear representation with context and instructional query on opposite sides of the energy.Source: §5.5 · p. 41
- The potential encodes the full instructional query and produces an answer in one forward pass, making inference faster than an LLM’s token-by-token generation.An LLM factorizes the answer autoregressively, using one softmax per generated token; the decisive model instead uses a softmax over bilinear energies for the whole query.Source: §5.5 · p. 42
6 Reinforcement Learning and Planning through EBMs
This section presents reinforcement learning and planning through EBMs at the level of actions, expert behavior, dynamics, and trajectories, covering EBM policies, inverse RL, and world-model representations with value fitting. It also frames planning as trajectory inference that combines dynamics, behavior priors, goals, costs, and constraints as energy terms.
6.1 Naturally Induced EBM Policies
- Maximum-entropy RL induces an action EBM with energy equal to negative soft Q, while KL-regularized updates form residual EBMs that concentrate toward greedy actions as iterations accumulate.With a fixed reference policy, this residual-EBM form also describes single-step RLHF, using the pretrained model as the base measure.Source: §6.1 · pp. 42–43
6.2 RL for EBM Policies
- For continuous-action EBM policies, variational policies trade expressiveness for cheap sampling, MCMC is expressive but costly, and diffusion policies sample through fixed denoising steps.Gaussian variational policies can miss multimodal actions, whereas direct Langevin sampling requires many Q-gradient evaluations; diffusion training addresses unavailable target-policy samples through specialized losses.Source: §6.2 · pp. 43–44
- Direct preference optimization learns a residual EBM policy from chosen-versus-rejected response comparisons, canceling the prompt-only partition function and avoiding both policy sampling and a separate reward model.The contrastive gradient lowers the chosen response’s energy and raises the rejected response’s energy; rankings of K responses yield a ranking-NCE objective.Source: §6.2 · p. 45
6.3 Inverse RL with EBMs
- Maximum-entropy IRL fits trajectory EBMs through rewards, whereas IBC fits an explicit policy EBM by ranking NCE and GAIL fits a policy sampler adversarially.Reward learning requires solving an RL problem at each step but can transfer across dynamics; direct policy learning avoids reward recovery but is tied to the demonstrations’ dynamics.Source: §6.3 · pp. 45–47
6.4 RL with EBM World Models
- A transition EBM can provide features in which every policy’s Q-function is linear, enabling value learning by temporal-difference learning without sampling from the world model.The model scores transitions through a bilinear state-action/next-state representation; random features can linearize it, and the figure describes fitting the model by score matching or ranking NCE.Source: §6.4 · pp. 47–48, Figure 7 · p. 47
- Once learned, the policy-independent world-model representation spans every policy’s Q-function, so TD fits only policy-dependent weights without sampling from the model.The random features linearize both the transition and its normalization, making the partition function and sampler unnecessary for control.Source: §6.4 · p. 49
6.5 Planning with Trajectory EBMs
- Planning is inference over whole trajectories, with learned dynamics, behavior priors, goals, costs, and constraints composed as energy terms for each task.For deterministic dynamics, the dynamics term can enforce feasibility, while task terms can include a goal energy and separate obstacle energies.Source: §6.5 · pp. 49, 51
- As the temperature approaches zero, the trajectory EBM concentrates on highest-return trajectories in the prior’s support; with stochastic dynamics, unconstrained inference reweights transitions optimistically.Keeping the true dynamics instead yields the soft Bellman backup; under deterministic dynamics, planners typically optimize or sample open-loop action sequences and replan after each action.Source: §6.5 · p. 50
- Sampling-based planners approximate trajectory-E BM inference by reweighting sampled action sequences or selecting the highest-return ones, while gradient methods sample or optimize plans through differentiable rollouts.MPPI uses return-weighted samples to estimate the target mean; the cross-entropy method refits to top-return sequences, and iterating either is mirror descent over action sequences.Source: §6.5 · p. 50
- Diffusion planners combine trajectory priors with reward, goal, or constraint guidance, while sequence-model planners add returns or use search and resampling to construct plans.Summing diffusion scores only approximately samples the composed distribution, for which MCMC on summed energies provides a correction; autoregressive planners cannot revise earlier actions, whereas masked-model resampling can.Source: §6.5 · pp. 51–52
- For image-based planning, video models can supply dynamics and behavior while inverse dynamics maps generated plans to actions, with only the latter needing to match the robot’s action space.Hierarchical systems can compose language subgoals, visual plans, and inverse dynamics, while video-language planning can search long-horizon video plans.Source: §6.5 · p. 52
- Policies amortize planning for one reward into a forward pass, whereas planners retain separate energy terms and pay for sampling or optimization at each decision, allowing new tasks through new energy terms.Under deterministic dynamics, the trajectory EBM factorizes into the soft-optimal policy.Source: §6.5 · pp. 52–53
7 Inference-Time Computation
This section examines inference-time computation as sampling or optimization with a pretrained generator composed with a verifier, including how learned energies can be composed and fine-tuning can amortize search across inputs. It also covers best-of-N sampling-aware fine-tuning, which trains a generator as a proposal for inference-time selection while balancing exploitation and exploration as N grows.
7.1 Verifiers Define the Target
- A verifier reweights a pretrained generator into a KL-regularized target distribution; temperature controls the verifier’s influence and limits movement from the generator.For a binary verifier as temperature approaches zero, the target is the generator conditioned on correct responses; black-box adapters can learn a residual energy from sampled text without generator probabilities.Source: §7.1 · p. 53
7.2 Samplers for the Target
- Complete-response selection, rejection sampling, and self-consistency approximate or sample the verifier-weighted target, while sequential Monte Carlo and search allocate computation across partial responses.Exact token-by-token sampling requires intractable prefix values; approximate values support SMC, beam search, or tree search. Tokenwise products of autoregressive conditionals are biased unless corrected with importance weights or SMC.Source: §7.2 · pp. 54–55
- Power sampling sharpens the generator’s full-response distribution, unlike low-temperature token decoding, and can be sampled with Metropolis–Hastings while retaining diversity [100].The power distribution favors tokens with a few high-likelihood completions; low-temperature decoding favors tokens whose probability is spread across many lower-likelihood completions.Source: §7.2 · pp. 55–56
7.3 Compositional Reasoning
- Composed constraint energies with parallel energy minimization outperform end-to-end learned solvers on most tested N-queens, 3-SAT, and graph-coloring benchmarks, including larger instances [135].The method learns energies for individual constraint types, composes them for a new problem, and uses resampling, noise, and gradient steps to search across candidate solutions.Source: §7.3 · p. 58
7.4 Amortizing Inference-Time Computation
- Fine-tuning amortizes search by approximating the verifier-weighted target: RL minimizes reverse KL, rejection-sampling fine-tuning minimizes forward KL, and BOND balances both.Reverse KL can omit some successful responses, while forward KL can spread probability over successes and failures; BOND distills the best-of-N distribution.Source: §7.4 · p. 59
7.5 Best-of-N Sampling-Aware Fine-Tuning
- Inference-aware fine-tuning places its loss on the best-of-N output distribution rather than the base policy, so the policy needs only one good response among its N samples and can remain diverse [31].The best-of-N output has an explicit residual-EBM density, making it possible to approximate its distribution despite the nondifferentiable selection step.Source: §7.5 · pp. 60–61
- Inference-aware supervised fine-tuning maximizes expert-response likelihood under πBoN, treating experts as positives and best-of-N-selected responses as negatives to avoid overfitting.Its gradient increases expert responses’ likelihood and win rate against πθ while lowering the likelihood of responses best-of-N already selects.Source: §7.5 · p. 61
- Inference-aware reinforcement learning applies REINFORCE to best-of-N-selected responses using environment reward R, which may differ from verifier score r and tolerate verifier errors.The policy-gradient estimate uses the selected response’s reward minus a baseline computed under πBoN.Source: §7.5 · p. 61
- Unlike amortization, best-of-N sampling-aware fine-tuning retains best-of-N at inference and trains πθ as its proposal, interleaving best responses with more diverse ones as N grows.Writing πBoN as a residual EBM on πθ makes selection differentiable; the approach trades exploitation for exploration as N increases.Source: §7.5 · p. 61
8 Discussion
The discussion treats machine-learning methods as choices among energy, inference, and learning, using this framework to organize existing work and develop algorithms through component replacement and composition.
- An EBM is specified by its energy, inference procedure, and learning method, and the framework recasts methods across machine learning as particular choices of these components.The discussion includes discriminative and generative modeling, representation learning, decision-making, planning, and inference-time computation.Source: §8 · p. 62
- Maximum likelihood, contrastive divergence, NCE, pseudolikelihood, score matching, and adversarial training share a gradient structure but differ in their negative-sample samplers.Across applications, the framework also groups MCMC, variational inference, and amortized sampling as inference procedures.Source: §8 · p. 62
- Replacing one EBM component while keeping others fixed yields new algorithms, including diffusion spectral representations, AmorLIP, and diffusion policy optimization.Other examples use EBM structure for new objectives and place energies on dynamics to produce world models with linear value functions.Source: §8 · pp. 62–63
- Adding independently learned energies can combine pretrained models, goals, and constraints at inference time without retraining, provided their scales are compatible and the product is normalizable.Sampling or optimizing the composed energy landscape can be harder than doing so for each component alone.Source: §8 · p. 63
- The EBM perspective does not determine which method performs better; outcomes also depend on parameterization, inductive biases, and estimator properties.The intended use matters too: likelihood calibration, sampling, and relative candidate scoring can favor different learning methods.Source: §8 · p. 63
A Overview of Methods
Table 3 organizes the tutorial’s methods by the energy, inference procedure, learning method, and partition-function handling, showing varied choices across learning and application settings.
- Table 3 summarizes methods by their energy, inference procedure, learning method, and treatment of the partition function.Its entries correspond to the tutorial sections listed in the final column.Source: A Overview of Methods · p. 77, Table 3 · p. 77
- SimCLR and CLIP use ranking NCE, while SigLIP uses binary NCE with a learned bias for the partition function.For SimCLR and CLIP, the energy is discarded and the partition function cancels in the softmax; the batch sum is biased for small K.Source: A Overview of Methods · p. 77
- MoCo uses a frozen-target representation and fixed-point iteration via ranking NCE, with negatives drawn from a queue.Source: A Overview of Methods · p. 77
- The table lists MaxEnt RL/soft Q with energy −Q/λ and inference options including exact softmax, Langevin, amortized SVGD, and Gaussian SAC.It also lists mirror descent methods such as TRPO/PPO and DPO, and diffusion policies trained by reweighted score matching.Source: A Overview of Methods · p. 78
- For planning and inference-time computation, listed choices include MPPI/CEM, Langevin, diffusion, search, best-of-N, SMC, and power sampling.The overview also includes inference-aware fine-tuning and iterative BOND variants for best-of-N responses.Source: A Overview of Methods · p. 78
Related papers
This paper cites
- Attention Is All You Need2017
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding2018
- Language Models are Few-Shot Learners2020
- Learning Transferable Visual Models From Natural Language Supervision2021
- Training language models to follow instructions with human feedback2022
- Auto-Encoding Variational Bayes2013