Int4 quantizations of
stanford-star/rt-j,
the Relational Transformer foundation model for in-context learning over
relational databases. Produced and consumed by the
RelativeDB native inference engine
(
cpp/rt_quantize --type q4). Weights stay
quantized-resident at
inference: the engine's CPU (Accelerate / portable SIMD) and Metal/MPS
kernels dequantize inside the GEMM, so DRAM weight traffic is the int4
payload.
(vs. 171 MB bf16 upstream, 342 MB fp32 in memory.)
Measured on the RelativeDB golden batch (B=5, S=16) against the PyTorch
reference; identical on CPU and Metal/MPS:
Int4 is the aggressive end for an 86M-param model: per-score drift is a few
hundredths. Use int8 when scores must track fp32 tightly; use int4 when
footprint/bandwidth dominates.
1# direct path (looser golden gate for int4)
2./build/rt_test testdata classification/model.q4.safetensors --tol 100 --device mps
3
4# via the Java / Python / Rust bindings: place the .q4 file next to the fp32
5# checkpoint (or point at a directory containing it) and opt in with
6export RELATIVEDB_RT_QUANTIZED=q4
1cmake -B build -S cpp && cmake --build build -j
2./build/rt_quantize <rt-j>/classification/model.safetensors classification/model.q4.safetensors --type q4
3./build/rt_quantize <rt-j>/regression/model.safetensors regression/model.q4.safetensors --type q4
Derivative of
stanford-star/rt-j
(Stanford STAR lab), redistributed under the same
CC-BY-NC-SA-4.0
license. Architecture and training details are described in the upstream
model card; only the weight storage format differs here.