An Energy-Based Model (EBM) learns an energy function E(x) that maps input data x to a scalar energy value, where lower energy corresponds to higher probability density under the model. Unlike traditional classifiers that output normalized probabilities, EBMs capture the unnormalized likelihood of data, making them inherently suited for out-of-distribution detection by identifying samples with anomalously high energy scores.
Glossary
Energy-Based Models

What is Energy-Based Models?
Energy-Based Models (EBMs) are a class of generative and discriminative frameworks that learn a scalar energy function to assign low energy values to in-distribution data and high energy to out-of-distribution samples, using the Helmholtz free energy as a discriminative score for novelty detection.
For open set signal recognition, the Helmholtz free energy is derived from the logits of a discriminative classifier and used as a scoring function, where in-distribution modulation types exhibit low free energy and unknown signal schemes produce high energy values. This approach avoids the overconfidence of SoftMax probabilities on novel inputs and provides a theoretically grounded, thresholdable metric for rejecting unknown modulation schemes in dynamic spectrum environments.
Key Features of Energy-Based Models
Energy-Based Models (EBMs) provide a principled framework for open set recognition by learning an energy landscape that assigns low energy to in-distribution modulation types and high energy to unknown or anomalous signals.
Helmholtz Free Energy Scoring
EBMs use the Helmholtz free energy as a discriminative score for novelty detection. For a given input x, the free energy E(x) is computed as the negative log of the partition function summed over all known classes. Lower energy indicates higher compatibility with the learned distribution. During inference, if E(x) exceeds a calibrated threshold, the sample is rejected as an unknown modulation scheme. This formulation naturally aligns with the conditional probability density learned by discriminative classifiers, allowing a standard neural network to be reinterpreted as an energy model without architectural changes.
Contrastive Divergence Training
Training EBMs involves contrastive methods that shape the energy landscape by contrasting positive examples (real training data) against negative examples (generated or noise samples). The objective is to push down energy on real modulation constellations while pushing up energy everywhere else. Key techniques include:
- Stochastic Gradient Langevin Dynamics (SGLD) for sampling negative examples from the model's current energy surface
- Noise contrastive estimation to avoid computing the intractable partition function
- Score matching which minimizes the gradient of the energy function rather than the energy itself This training paradigm explicitly creates an energy gap between known and unknown signal types.
Joint Energy-Based Models (JEM)
A Joint Energy-Based Model unifies a discriminative classifier and a generative model within a single architecture. The same neural network simultaneously outputs class logits for known modulation types and defines an energy function over the input space. This dual nature provides:
- Improved calibration: The generative objective regularizes the classifier, producing better-calibrated probabilities
- Built-in OOD detection: The energy score serves directly as a novelty metric without additional heads or branches
- Hybrid discriminative-generative training that leverages both labeled and unlabeled data JEMs have demonstrated state-of-the-art performance on out-of-distribution detection benchmarks while maintaining competitive closed-set accuracy.
Energy-Based Out-of-Distribution Detection
EBMs offer a principled alternative to SoftMax-based OOD detection. Unlike methods that rely on maximum SoftMax probability—which can produce overconfident predictions on unknown inputs—energy scores provide a density-aligned metric. The energy-based OOD score is computed as:
- E(x) = -T · log Σᵢ exp(fᵢ(x)/T) where fᵢ(x) are logits and T is temperature This score is theoretically connected to the log-likelihood of the input under the model's learned distribution. In spectrum monitoring applications, this means an EBM can reliably distinguish between a known QPSK signal and a novel modulation never seen during training, even when both produce similar SoftMax outputs.
Energy Regularization for Open Set Learning
Energy-based regularization explicitly shapes the energy surface during training to create a tight boundary around known classes. The training loss combines:
- Standard cross-entropy for correct classification of known modulation types
- Energy regularization term that penalizes low energy on out-of-distribution samples generated through SGLD or drawn from an auxiliary outlier dataset
- Margin-based ranking loss ensuring that in-distribution samples have energy below a margin m_in while OOD samples exceed a margin m_out This explicit energy shaping prevents the feature collapse problem where unknown signals inadvertently map to low-energy regions near known class prototypes.
Langevin Dynamics for Anomaly Refinement
EBMs enable iterative refinement of anomaly scores through Langevin dynamics sampling. Starting from an input signal's IQ samples, the model can perform gradient-based updates that move the sample toward lower-energy regions of the learned manifold. This process reveals:
- Reconstruction-based anomaly scores: The difference between the original and refined signal indicates the degree of novelty
- Energy trajectory analysis: The path taken during Langevin sampling provides a richer signal for OOD detection than a single energy evaluation
- Generative verification: Unknown modulation types can be visualized by observing how the model attempts to reconstruct them toward known constellations This capability is particularly valuable for spectrum forensics where analysts need to understand why a signal was flagged as anomalous.
Frequently Asked Questions
Explore the core concepts behind Energy-Based Models (EBMs) and their application in open set signal recognition, where distinguishing known modulation schemes from unknown, out-of-distribution signals is critical for robust spectrum monitoring.
An Energy-Based Model (EBM) is a generative framework that learns a scalar energy function E(x) which assigns low energy values to in-distribution data and high energy values to out-of-distribution (OOD) data. For novelty detection in signal recognition, an EBM is trained to minimize the energy of known modulation types (e.g., QPSK, 16-QAM). During inference, the Helmholtz free energy F(x) = -T * log(∫ exp(-E(x)/T)) is computed as a discriminative score. If the free energy of an incoming IQ sample exceeds a calibrated threshold, the signal is flagged as a novel or unknown modulation scheme. This approach provides a theoretically grounded alternative to softmax-based confidence scores, which are often poorly calibrated for OOD inputs.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Key concepts and techniques that intersect with energy-based models for open set signal recognition, providing a comprehensive toolkit for novelty detection in dynamic spectrum environments.
Helmholtz Free Energy
The discriminative score derived from an energy-based model that separates in-distribution from out-of-distribution data. For a given input x, the free energy is computed as:
- Formula: E(x) = -T · log Σᵢ exp(-E(x, yᵢ)/T)
- Temperature parameter T controls the smoothness of the energy landscape
- Lower free energy indicates higher likelihood of belonging to known classes
- Unlike SoftMax probabilities, free energy does not require normalization over all possible classes, making it inherently suitable for open set rejection
Score Matching
An alternative training objective for energy-based models that avoids the intractable partition function by matching the gradient of the log-density (score) rather than the density itself. Key properties:
- Minimizes the Fisher divergence between model and data score functions
- Denoising score matching adds noise to data points and learns to denoise, providing a tractable objective
- Forms the theoretical foundation for diffusion models and score-based generative modeling
- Enables energy function learning without requiring negative sampling or MCMC
Joint Energy Models
A unified framework where a single neural network outputs an energy value for any (input, label) pair, enabling simultaneous classification and generation. For open set recognition:
- Discriminative mode: Predict class by finding the label that minimizes energy
- Generative mode: Sample new inputs via Langevin dynamics on the energy landscape
- The marginal energy E(x) = -log Σᵧ exp(-E(x, y)) serves as a novelty score
- Outperforms hybrid discriminative-generative models by maintaining a calibrated energy surface across all inputs
Langevin Dynamics Sampling
A Markov Chain Monte Carlo method used to sample from the probability distribution defined by an energy-based model. The iterative update rule:
- xₜ₊₁ = xₜ - ε · ∇ₓE(xₜ) + √(2ε) · N(0, I)
- Combines gradient descent on the energy with injected Gaussian noise
- The noise term prevents collapse to local minima and ensures proper exploration
- Used at inference time to generate synthetic signal samples or refine noisy IQ inputs toward low-energy configurations
Noise Contrastive Estimation
A training technique that transforms density estimation into a binary classification problem between real data and a known noise distribution. For energy-based models:
- The model learns to distinguish true signal samples from artificially generated noise
- Avoids computing the partition function by treating it as a learnable parameter
- The ratio of model density to noise density yields the unnormalized energy
- Particularly effective when the noise distribution is chosen to match the support of the data manifold

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us