EdgeRock-4B-GPTQ: 4-bit Constant-Memory Reasoning

GPTQ W4A16 weights for Rock Matrix's EdgeRock-4B, with a packed INT4 CUDA runtime.

EdgeRock combines recurrent state, sliding-window attention and Rock Memory Anchors (RMA) to retain selected distant information within constant-size persistent history. This 4-bit text-generation release preserves the source architecture and memory capacities: a 1,024-token local window, 1,024 anchors per KV group and 256-token commit boundaries.

EdgeRock-4B 的 GPTQ 四位量化版本,保留 RMA 记忆锚点和恒定容量的历史状态,附 GPU 加载、推理与验证代码。

Quick start · Original model · Model collection · GitHub · Technical report · arXiv

Package

Item Configuration
Source rockmatrix-ai/EdgeRock
Quantization algorithm sequential Hessian-based GPTQ, 1% damping, block size 128
Weights / activations INT4 / BF16
Group size 128
Quantized matrices 256 large backbone and RMA linear matrices
Packed weight files 3.400 GB
Calibration WikiText-2 training split, 128 sequences of 512 tokens
Verified runtime Linux, NVIDIA Hopper GPU, supplied Triton runtime
Inputs Text; the original visual frontend remains in the source project

The embedding/output head, admission networks, small recurrent gates and normalization parameters retain their source precision. Weight groups use a symmetric zero point of 8 and FP32 scales. Storage follows GPTQ v1 qweight / qzeros / scales / g_idx layout, symmetric groups and no activation reordering. The supplied loader handles EdgeRock's custom RMA architecture and these tensors; generic AWQ/GPTQ engine loading has not been validated.

Quick start

hf download hkust-aaron/EdgeRock-4B-GPTQ --local-dir ./EdgeRock-4B-GPTQ
python -m pip install -r ./EdgeRock-4B-GPTQ/requirements.txt
import sys
from transformers import AutoTokenizer

folder = "./EdgeRock-4B-GPTQ"
sys.path.insert(0, folder)
from packed_int4 import load_int4

tokenizer = AutoTokenizer.from_pretrained(folder, trust_remote_code=True)
model = load_int4(folder)
text = tokenizer.apply_chat_template(
    [{"role": "user", "content": "Calculate 17 * 23. Give only the answer."}],
    tokenize=False, add_generation_prompt=True,
)
inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=2048, do_sample=False)
print(tokenizer.decode(outputs[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))

Large linear weights remain packed in GPU memory during generation. The Triton matrix multiplication decodes each tile as it is used, with BF16 activations and standard FP32 accumulation. It does not expand the complete checkpoint into persistent BF16 weights.

Validation

Conversion checks cover all 256 packed linear matrices, GPU matrix multiplication against their dense representations, arithmetic, a long-context memory update beyond the local window, and deterministic fresh-process reload. Full prompts and generated answers are in validation.json.

Check Result
Functional generation checks 3/3
Unquantized tensors matching the source exactly 290
Fresh-process reload, maximum probe-logit difference 0
Maximum linear-kernel relative error in conversion checks 0.004673

These are conversion and runtime checks. Original-model benchmark results are available in the technical report; this quantized package has not been evaluated on the complete benchmark suite.

Reproduce

python -m pip install -r requirements-conversion.txt
python quantize.py --method gptq --source /path/to/EdgeRock --output /path/to/EdgeRock-4B-GPTQ

calibration.json records the dataset revision, seed, token offsets and token-ID hash. provenance.json records the source revision, package versions and quantization configuration. SHA256SUMS lists release file hashes.

License

Weights retain the EdgeRock Model License 1.0; code retains Apache-2.0. See NOTICE for source notices. Changes comprise GPTQ weight quantization, the packed INT4 runtime and release validation.

Downloads last month
-
Safetensors
Model size
5B params
Tensor type
I32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for hkust-aaron/EdgeRock-4B-GPTQ

Quantized
(16)
this model

Collection including hkust-aaron/EdgeRock-4B-GPTQ

Paper for hkust-aaron/EdgeRock-4B-GPTQ