Inferensys

Glossary

Energy-Based Models

A class of models that learn an energy function assigning low energy to in-distribution data and high energy to out-of-distribution data, using the Helmholtz free energy as a discriminative score for novelty.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
OPEN SET SIGNAL RECOGNITION

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.

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.

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.

OPEN SET SIGNAL RECOGNITION

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.

01

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.

02

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.
03

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.
04

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.
05

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.
06

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.
ENERGY-BASED MODELS

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.

Prasad Kumkar

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.