Ripple-65B-Preview, 3.54 bits per weight (agent-evolved quantization)
This is a weight-only quantization of ricursiveAI/Ripple-65B-Preview (revision b172323f). The quantization program was written by a coding agent running in an OpenEvolve loop. Each candidate program was scored on the full 80-layer model.
| Bits per linear weight | Linear + BF16 parts | KL vs BF16 (eval set) | |
|---|---|---|---|
| BF16 original | 16 | 130 GB | 0 |
| RTN 4-bit, g128 (baseline) | 4.25 | 35.9 GB | 0.149 |
| This model | 3.54 | 30.3 GB | 0.089 |
| Larger sibling: Ripple-65B-Preview-AQ-4.38bit | 4.38 | 37.0 GB | 0.043 |
KL is the mean per-token KL(BF16 || quantized) over 8 x 4096 tokens. The token mix is 50% agentic coding traces (SWE-Gym OpenHands), 25% OpenCodeReasoning, 15% UltraChat and 10% WikiText-103, all in the chat template. The calibration data (16k tokens) does not overlap with the eval set.
What is quantized
- Quantized: all 640 decoder linears (q, k, v, g, o, gate, up, down in 80 layers). Asymmetric uniform grid, groups of 128 input columns.
- Kept in BF16: embeddings,
lm_head, all norms and the other small tensors. - Not quantized: activations and the KV cache.
Per-module bits (from quantize_program.py):
- Layers 0 and 1: 6 bits
- Layers 2 and 3: 4 bits
- Layer 4: 5 bits
- Other layers: k_proj and v_proj 6 bits, other attention 4 bits, gate_proj, up_proj and down_proj 3 bits (down_proj 4 bits in layers 78 and 79)
Method, found by the search:
- Clip search weighted by activations. For modules at 6 bits or fewer, 17 shrink factors of each group's min/max range (1.0 down to 0.6) are tried. Each is scored by the weight error weighted by the mean of x^2 per input column, from the calibration activations. 8-bit modules use plain min/max.
- Scale and zero refit. A weighted least-squares refit of scale and zero is done with the codes held fixed. It is kept only for groups where it lowers the error.
- Cheaper zeros. Scales are fp16. The integer zeros of modules at 4 bits or fewer are stored exactly in fp8 (e4m3), so a 4-bit g128 module costs 4.19 bits per weight instead of 4.25.
The exact per-module layout is in quant_config.json, and the program that produced it is in quantize_program.py.
How to load
# pip install torch transformers accelerate safetensors huggingface_hub
from huggingface_hub import hf_hub_download
import importlib.util
repo = "kkkamur07/Ripple-65B-Preview-AQ-3.54bit"
path = hf_hub_download(repo, "ripple_aq_loader.py")
spec = importlib.util.spec_from_file_location("ripple_aq_loader", path)
loader = importlib.util.module_from_spec(spec); spec.loader.exec_module(loader)
model, tok = loader.load(repo, device="cuda") # one 192 GB GPU, or device="cpu", device_map="auto"
The loader unpacks each linear and dequantizes it to BF16 with the same formula the evaluator used.
Limitations, read before using
- This is a storage format, not a fast kernel. The download is about 31 GB instead of 130 GB, but after loading the model runs in BF16 (about 130 GB of GPU memory) at BF16 speed. There are no fused low-bit kernels, and vLLM, llama.cpp and similar runtimes cannot read this format.
- Measured on one eval mix only. KL was measured on 32k tokens of the mix above. We have not run downstream benchmarks (for example SWE-bench or HumanEval) on this checkpoint.
- The search used the eval set for selection. Programs were selected on this eval set, so the KL above is optimistic as an estimate on new text. The calibration tokens were separate, and a held-out set has not been reported yet.
- The base model is a preview release, and its license and terms apply.