Energy-Based NLP Models for Calibration and Robustness

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Deep learning systems for natural language processing face challenges in achieving balanced performance in accuracy, calibration, and adversarial robustness, often compromising on these metrics in downstream tasks.

Innovation Solution

The implementation of energy-based models (EBMs) with noise contrastive estimation (NCE) procedures to compute an exponentially-weighted energy-like term in the loss function for training NLP classifiers, using various energy functions such as scalar, hidden, and sharp-hidden transformations to improve prediction confidences and robustness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If deep learning approaches are used to improve accuracy, then prediction accuracy is improved, but calibration and adversarial robustness deteriorate

Engineering Contradiction:
Improveprediction accuracyVSAvoidcalibration and adversarial robustness
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The patent changes the parameter being optimized from standard cross-entropy loss to an energy-based loss function with temperature scaling. By modifying the loss function parameters (energy computation, temperature parameter τ), the model learns to produce better-calibrated probability estimates while maintaining accuracy. The energy function E(x, y) = -log p(y|x) transforms the optimization objective to directly target calibration quality.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces an energy-based model as an intermediary between the neural network predictions and the final probability outputs. The energy function acts as a mediator that transforms raw predictions into well-calibrated probabilities through the softmax with temperature scaling: p(y|x) = exp(-E(x, y)/τ) / Σ exp(-E(x, y')/τ). This intermediary layer decouples accuracy optimization from calibration optimization.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If deep learning approaches are used to improve accuracy, then prediction accuracy is improved, but adversarial robustness deteriorates

Engineering Contradiction:
Improveprediction accuracyVSAvoidadversarial robustness
Core Design Contradiction:
Measurement precisionVSObject-affected harmful factors

Solution Approach 1:

The patent modifies the optimization parameter from standard classification loss to energy-based loss with temperature scaling. This parameter change fundamentally alters the decision boundaries and confidence calibration, making the model less sensitive to adversarial perturbations. The temperature parameter τ controls the sharpness of predictions, with higher values producing softer, more robust probability distributions.

Inventive Principle:
Principle #35Parameter changes

3Ease of manufacture

If standard cross-entropy loss is used for training, then training simplicity is maintained, but calibration quality deteriorates

Engineering Contradiction:
Improvetraining simplicityVSAvoidcalibration quality
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

The patent changes the loss function parameter from standard cross-entropy to energy-based loss with temperature scaling. While this modifies the training objective, it maintains compatibility with standard neural network architectures and optimization algorithms. The energy function E(x, y) can be computed directly from existing network outputs, requiring only additive computational overhead.

Inventive Principle:
Principle #35Parameter changes

4Reliability

If energy-based models with NCE procedures are implemented, then calibration and robustness are improved, but computational complexity increases

Engineering Contradiction:
Improvecalibration and robustnessVSAvoidcomputational complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the calibration problem into separate energy computation and probability transformation steps. The energy function E(x, y) is computed independently for each class, then transformed to probabilities through softmax with temperature scaling. This segmentation allows efficient computation by reusing intermediate energy values across different probability calculations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The energy-based framework serves multiple functions simultaneously: it provides calibrated probability estimates, enables robust optimization against adversarial examples, and maintains compatibility with various neural network architectures. The same energy function can be used for both training optimization and test-time probability calibration, eliminating the need for separate calibration procedures.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS11934952B2Systems and methods for natural language processing using joint energy-based models
Publication Date: 2024.03.19 SALESFORCE INC
  • US11934952B2 patent drawing
  • US11934952B2 patent drawing
  • US11934952B2 patent drawing

AI summary

Embodiments described herein provide natural language processing (NLP) systems and methods that utilize energy-based models (EBMs) to compute an exponentially-weighted energy-like term in the loss function to train an NLP classifier. Specifically, noise contrastive estimation (NCE) procedures are applied together with the EBM-based loss objectives for training the NLPs.