INT4 Low-Bit Quantization

INT4 Quantization Calculator

Quantize a decimal value to signed INT4 using a scale and zero point. Calculate the resulting 4-bit integer, binary representation, dequantized value and quantization difference.

Signed INT4 -8 to 7 4 Bits Scale Zero Point
INT4 Quantization Signed 4-bit
Enter the real-valued number to quantize.
Scale must be greater than zero.
Signed INT4 zero point from -8 to 7.
q = round(real value / scale) + zero point
q is clamped to the signed INT4 range -8 to 7.
INT4 Quantization Result
Input Value
INT4 Value
4-Bit Binary
Hex Digit
Scale
Zero Point
Dequantized
Difference

What Is INT4 Quantization?

INT4 quantization maps a real-valued number into a signed four-bit integer. Signed INT4 provides only 16 possible integer codes, ranging from -8 through 7.

Because the representation is extremely compact, INT4 can substantially reduce the amount of storage required for numerical data, but the small number of available integer levels also means that quantization error can be larger than with wider integer formats.

INT4 Quantization Formula

This calculator uses affine signed INT4 quantization:

q = round(x / scale) + zero_point

After calculation, q is limited to the valid signed INT4 range:

-8 ≤ q ≤ 7

The represented real value can then be estimated with:

x’ = (q – zero_point) × scale

INT4 Quantization Example

Real value:
1.25

Scale:
0.25

Zero point:
0

1.25 / 0.25 = 5

INT4:
5

Binary:
0101

Dequantized:
1.25

In this example, the value is represented exactly because the original value falls directly on one of the available quantization levels.

Signed INT4 Range

Minimum:
-8 = 1000

Maximum:
7 = 0111

Negative values are displayed using four-bit two’s-complement representation.

INT4 Clamping

If the calculated quantized code exceeds 7, it is clamped to 7. If it falls below -8, it is clamped to -8.

Calculated value:
12

INT4 maximum:
7

Stored result:
7 = 0111

Why INT4 Quantization Is Useful

Four-bit quantization can represent two numerical values within one byte when data is packed efficiently. This makes INT4 especially interesting for workloads where model size, memory bandwidth and data movement are major constraints.

The trade-off is precision. With only 16 integer codes available, scale selection has a strong effect on how accurately the original real value can be represented.

INT4 Quantization in AI

INT4 is increasingly used in low-precision machine-learning inference and model compression. Large weight matrices can require substantially less storage when values are represented with four bits instead of 16 or 32 bits.

Quantization parameters determine how those compact integer codes map back to approximate real numerical values during computation.

Important INT4 Notes

Important: this calculator performs signed INT4 affine quantization only.

The valid integer range is -8 through 7.

Only 16 signed INT4 codes are available.

The scale must be greater than zero.

The zero point must be an integer from -8 through 7.

Values outside the INT4 range are clamped.

Negative binary outputs use four-bit two’s complement.

INT4 Quantization Calculator FAQs

What is INT4 quantization?
INT4 quantization maps real-valued numbers to four-bit integer codes.
What is the signed INT4 range?
Signed INT4 ranges from -8 through 7.
How many values can INT4 represent?
Four bits provide 16 distinct bit patterns.
What is the INT4 quantization formula?
This calculator uses q = round(x / scale) + zero point, followed by clamping to -8 through 7.
What does scale mean?
Scale defines the real-value spacing between neighboring INT4 codes.
What is the zero point?
The zero point is the INT4 integer code associated with real zero.
How are negative INT4 values stored?
They are represented using four-bit two’s complement.
What happens if the quantized value is 10?
Because signed INT4 has a maximum of 7, the result is clamped to 7.
Why can INT4 introduce more error?
Only 16 integer codes are available, so there are fewer representable levels than with wider integer formats.
Scroll to Top