Softmax Function Piecewise Approximation Integer Operations

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The SoftMax function in neural networks requires exponential operations, which are computationally expensive and energy-intensive, posing challenges for efficient computation, especially in resource-constrained processors like microcontrollers and digital signal processors.

Innovation Solution

The method employs piecewise approximation and integer-based operations to compute the SoftMax function, avoiding exponential calculations by converting them into exponentiations of two using the natural logarithm of two, and utilizing binary shifts and integer arithmetic for efficient computation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If exponential operations are used to compute the SoftMax function, then accuracy is maintained, but computational time and energy consumption increase significantly

Engineering Contradiction:
Improvecomputation accuracyVSAvoidcomputational time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent transforms the SoftMax computation from using natural exponential operations to using base-2 exponential operations. This parameter change in the mathematical basis allows the computation to be performed using efficient binary shift operations and lookup tables, dramatically reducing computational time while maintaining accuracy through carefully designed approximation functions and correction terms

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces the traditional floating-point exponential computation mechanism with an integer-based computation mechanism using binary shifts, additions, and pre-computed lookup tables. This substitution eliminates the need for complex floating-point arithmetic units and exponential function implementations, reducing both computational time and hardware complexity

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Measurement precision

If exponential operations are used to compute the SoftMax function, then correct probability distribution is obtained, but energy consumption increases

Engineering Contradiction:
Improveprobability distribution accuracyVSAvoidenergy consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent changes the computational parameter from natural exponential (e^x) to base-2 exponential (2^x), enabling the use of efficient bit-shift operations and integer arithmetic. This parameter transformation maintains the mathematical correctness of the SoftMax function while dramatically reducing energy consumption by avoiding complex floating-point exponential calculations

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent performs preliminary computations by pre-calculating and storing exponential values in lookup tables, and by pre-computing normalization constants. This preliminary action eliminates the need for real-time exponential calculations during inference, significantly reducing energy consumption while maintaining accuracy through the use of pre-computed reference values

Inventive Principle:
Principle #10Preliminary action

3Productivity

If integer-based operations with piecewise approximation are used, then computational efficiency improves, but implementation complexity increases

Engineering Contradiction:
Improvecomputation efficiencyVSAvoidimplementation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the SoftMax computation into distinct stages: input normalization, base-2 conversion using piecewise approximation, exponential calculation via binary shifts, and final normalization. Each segment is implemented using simple integer operations and lookup tables, making the overall complex function manageable and efficient to compute while maintaining high productivity

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20240370722A1Computer-Implemented Method to Execute a Softmax Function Using Piecewise Approximation
Publication Date: 2024.11.07 APTIV TECHNOLOGIES AG
  • US20240370722A1 patent drawing
  • US20240370722A1 patent drawing
  • US20240370722A1 patent drawing

AI summary

A computer-implemented method of processing a classification output of a neural network. The method includes, for each input number yi, determining, using an approximation of a SoftMax function that uses integer-based operations without using an exponential operation, a binary number qi that represents a probability distribution of the input number yi, each input number being an offset of a respective classification output of the neural network. The method includes for each input number yi, determining a normalized probability pi from the binary numbers qi.