UINT4 - 4-Bit Unsigned Integer

Sub-byte unsigned integer: quantization packing and nibble-level data

Bit Layout

Value
V
V
V
V
4 bits

A 4-bit unsigned integer (also called a nibble) uses all 4 bits for magnitude, giving a range of 0 to 15 (24 - 1). Two UINT4 values pack into a single byte, and each corresponds to one hexadecimal digit (0–F).

Overview

UINT4 is a sub-byte format primarily used as a packing container for quantized ML weights. While INT4 (signed) is more common in quantization schemes like GPTQ and AWQ, UINT4 appears in frameworks that use asymmetric quantization with a non-zero zero-point offset.

With only 16 possible values (0–15), UINT4 achieves the same 8× compression over FP32 as INT4. Two UINT4 values are packed into a single byte, with the first element in the least-significant nibble.

UINT4 in Quantization

In asymmetric quantization, the float-to-integer mapping includes a zero point:

quantized_value = round(float_value / scale) + zero_point

The zero point shifts the mapping so that zero maps to a non-zero integer, allowing the full 0–15 range to cover an asymmetric distribution of float values.

See also: INT4 For the signed variant using two's complement (range -8 to 7), which is more common in symmetric weight quantization schemes.

Range & Properties

PropertyValue
Total Bits4
Minimum Value0
Maximum Value15
Representable Values16

All Representable Values

With only 16 possible bit patterns, here is the complete set:

ValueBit PatternSignedUnsigned
Zero000000
One000111
Max Unsigned1111-115
Max Signed011177
All Ones (-1)1111-115
Min Signed (-8)1000-88

Interactive Bit Visualizer

With only 4 bits, you can click through every possible value. Each nibble corresponds to one hex digit.

Format Comparison

PropertyUINT4UINT8UINT16UINT32
Total Bits481632
Signed Min-8-128-32,768-2,147,483,648
Signed Max712732,7672,147,483,647
Unsigned Max1525565,5354,294,967,295
Step (ULP)1111
Values1625665,5364,294,967,296

Where UINT4 Is Used