Quantizing Neural Networks with Batch Normalization Correction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Training neural networks for quantized inference with batch normalization is challenging due to jitter introduced by variations in batch statistics, leading to poor inference performance and resource inefficiency.

Innovation Solution

The system applies a correction factor to floating-point weights for batch normalized layers, switching from batch statistics to long-term moving averages after sufficient training, which stabilizes layer outputs and reduces jitter, enabling efficient quantization and improved performance during inference.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If batch normalization uses batch statistics during training, then normalization adapts to current batch distribution, but jitter is introduced in quantized weights during training

Engineering Contradiction:
Improveadaptation to batch distributionVSAvoidaccuracy of quantized neural network
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent pre-computes normalization statistics from the entire training dataset before the actual training process begins. These pre-computed statistics are then used throughout training instead of computing batch statistics during each training iteration. This preliminary action eliminates the jitter problem while maintaining the benefits of normalization.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediate step of pre-computing statistics from the full training dataset. This intermediate statistical representation serves as a mediator between the training data and the normalization process, providing stable reference statistics that eliminate jitter while still capturing the data distribution characteristics.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If conventional batch normalization is used during training, then normalization is computed efficiently per batch, but outputs during training differ from inference outputs

Engineering Contradiction:
Improvetraining efficiencyVSAvoidconsistency of layer outputs
Core Design Contradiction:
ProductivityVSStability of the object's composition

Solution Approach 1:

The patent performs the statistics computation in advance using the entire training dataset before training begins. This preliminary computation ensures that the same stable statistics are used during both training and inference, eliminating the discrepancy between training and inference outputs while maintaining training efficiency.

Inventive Principle:
Principle #10Preliminary action

3Use of energy by moving object

If quantized inference is used, then computational resources are reduced, but training for quantized inference is challenging with batch normalization

Engineering Contradiction:
Improvecomputational resource consumptionVSAvoidease of training
Core Design Contradiction:
Use of energy by moving objectVSEase of manufacture

Solution Approach 1:

The patent pre-computes normalization statistics from the entire training dataset before training begins. This preliminary action creates stable reference statistics that eliminate jitter during quantized training, making training easier while preserving the resource efficiency benefits of quantized inference.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent converts the potential harm of quantization jitter into a benefit by using pre-computed statistics. The same quantization process that would normally cause jitter is instead stabilized by the pre-computed statistics, turning the challenge of quantized training into an opportunity for improved performance.

Inventive Principle:
Principle #22Blessing in disguise (Convert harm into benefit)

Data Source

PatentUS12033067B2Quantizing neural networks with batch normalization
Publication Date: 2024.07.09 GOOGLE LLC
  • US12033067B2 patent drawing
  • US12033067B2 patent drawing
  • US12033067B2 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for training a neural network that has one or more batch normalized neural network layers for use by a quantized inference system. One of the methods includes receiving a first batch of training data; determining batch normalization statistics for the first batch of training data; determining a correction factor from the batch normalization statistics for the first batch of training data and the long-term moving averages of the batch normalization statistics; generating batch normalized weights from the floating point weights for the batch normalized first neural network layer, comprising applying the correction factor to the floating point weights of the batch normalized first neural network layer; quantizing the batch normalized weights; determining a gradient of an objective function; and updating the floating point weights using the gradient.