UINT4 - 4-Bit Unsigned Integer

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

Bit Layout

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

All Representable Values

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

Interactive Bit Visualizer

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

Format Comparison

Where UINT4 Is Used