LLM Quantization via Clamping Function for Memory Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing quantization techniques for Large Language Models (LLMs) face challenges in preserving accuracy when reducing model parameters from 16-bit floating-point to 4-bit integers, leading to decreased performance quality, especially with larger model sizes.

Innovation Solution

A two-step quantization method is introduced, where floating-point numbers are first converted to a dynamic fixed-point representation with a shared scale, and then further quantized using a clamping function to reduce the number of bits, thereby reducing memory consumption without loss in quality.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If quantization is applied to reduce memory consumption and increase inference speed, then memory usage and computational efficiency are improved, but model accuracy and performance quality deteriorate

Engineering Contradiction:
Improvememory consumptionVSAvoidmodel accuracy
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The patent applies different quantization strategies to different parts of the model based on their sensitivity to quantization. Weight quantization uses one approach while activation quantization uses another, with each tailored to the specific characteristics of that component. This local differentiation allows aggressive quantization where acceptable and conservative quantization where accuracy is critical.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent dynamically adjusts quantization parameters such as bit-width, scaling factors, and rounding modes based on the specific layer, operation type, and input characteristics. This parameter optimization enables the model to maintain accuracy in critical regions while achieving memory reduction in less sensitive areas.

Inventive Principle:
Principle #35Parameter changes

2Quantity of substance

If quantization to 4-bit or lower precision is applied, then memory consumption is significantly reduced, but performance quality and generation accuracy decrease

Engineering Contradiction:
Improvememory consumptionVSAvoidperformance quality
Core Design Contradiction:
Quantity of substanceVSReliability

Solution Approach 1:

The patent segments the quantization process into multiple stages: calibration phase where a subset of data is used to determine optimal quantization parameters, and execution phase where the pre-determined parameters are applied. This segmentation allows the system to invest computational resources in parameter optimization once, then achieve high compression with minimal runtime overhead.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary calibration and parameter optimization before the actual quantized inference. During this preliminary phase, the system analyzes the data distribution and determines optimal scaling factors, zero-points, and quantization levels. This advance preparation ensures that the subsequent 4-bit or lower precision computation maintains accuracy without requiring additional computational resources during inference.

Inventive Principle:
Principle #10Preliminary action

3Quantity of substance

If aggressive quantization is applied to larger model sizes, then memory efficiency is improved, but the presence of outliers in activations causes performance degradation

Engineering Contradiction:
Improvememory efficiencyVSAvoidactivation precision
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The patent extracts and separately handles outlier values in activations by identifying them through statistical analysis during calibration, then applying specialized quantization strategies such as asymmetric scaling or separate quantization parameters for outlier-prone regions. This extraction allows the majority of normal values to be efficiently quantized while outliers receive targeted handling to prevent performance degradation.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20250200277A1Methods and systems for quantization of large language models
Publication Date: 2025.06.19 HUAWEI TECH CO LTD
  • US20250200277A1 patent drawing
  • US20250200277A1 patent drawing
  • US20250200277A1 patent drawing

AI summary

A method and an apparatus for storing data points are provided. The method comprises: receiving the plurality of data points, each data point of the plurality of data points being represented in a floating-point representation; quantizing each one of the first plurality of data points, by: executing, during a first quantization phase: converting each data point of the plurality of data points into a corresponding first data point of a plurality of first data points; executing, during a second quantization phase: applying, to each first data point of the plurality of first data points a clamping function, thereby converting each first data point of the plurality of first data points into a corresponding second data point of a plurality of second data points; and storing the plurality of second points for further calculations instead of the first plurality of data points.