SenseNova-Loop-9B Abliterated + Arete (NVFP4-MLX 4-bit)
This repository provides the NVFP4-MLX 4-bit build of balllvin/SenseNova-Loop-9B-abliterated-arete-NVFP4 (9B multimodal looped hybrid linear/full-attention model with 56 effective layer visits per token).
What This Build Is & Why Use It
This is the final Apple Silicon MLX build of SenseNova-Loop-9B, converting balllvin/SenseNova-Loop-9B-abliterated-arete-NVFP4 to MLX affine 4-bit (7.97 GB language model + 0.91 GB BF16 vision tower) with closed-form 2x2 Sinkhorn mHC routing and an 8-bit / optional --fast-head LM head. Single-stream decode reaches 20.8–26.6 tok/s on an M5 Pro 64 GB Mac while preserving text and image inputs.
- Runtime format (
NVFP4-MLX 4-bit): MLX affine 4-bit (group_size=64) with BF16 norms/embeddings/routers and unquantized0.91 GBBF16 vision tower (visual.safetensors); served via the includedtools/serve.pyOpenAI-compatible server. - Modification stage (
Abliterated + Arete): Abliterated + Arete weights ported to MLX with closed-form mHC routers and streaming server (tools/serve.py), achieving99.4%top-1 agreement (199 / 199with--fast-head) on the 160-position local MLX gate.
Variant Guide (Format vs. Alignment Stage)
| Axis | Option | Best For |
|---|---|---|
| Runtime | NVFP4 | NVIDIA CUDA GPUs (transformers + load_nvfp4.py, 24 GB+ VRAM for decoded BF16) |
| Runtime | MLX | Apple Silicon Macs via included tools/serve.py (8.89 GB weights) |
| Stage | Base Quant (QAD) | Quantization-aware distilled baseline matching upstream behavior |
| Stage | Abliterated | Unlikelihood-trained refusal removal (3 / 99 harmful, 7 / 100 benign refused) |
| Stage | + Arete | Post-abliteration Arete SFT (62.0% MMLU, 2.7099 NLL, 6 / 99 harmful refused) |
Sibling & Lineage Repos
| Variant / Hardware | Format | Stage | Repository |
|---|---|---|---|
| Upstream base | BF16 | Upstream | sensenova/SenseNova-Loop-9B |
NVIDIA GPU (NVFP4) | W4A16 NVFP4 | Base Quant (QAD) | balllvin/SenseNova-Loop-9B-NVFP4 |
Apple Silicon (MLX) | MLX 4-bit | Base Quant (QAD) | balllvin/SenseNova-Loop-9B-NVFP4-MLX |
NVIDIA GPU (NVFP4) | W4A16 NVFP4 | Abliterated | balllvin/SenseNova-Loop-9B-abliterated-NVFP4 |
NVIDIA GPU (NVFP4) | W4A16 NVFP4 | Abliterated + Arete | balllvin/SenseNova-Loop-9B-abliterated-arete-NVFP4 |
Apple Silicon (MLX) | MLX 4-bit | Abliterated + Arete | balllvin/SenseNova-Loop-9B-abliterated-arete-NVFP4-MLX (this repo) |
Evaluation & Parity Results
Evaluated on the decoded BF16 forward path of the three NVFP4 builds (greedy, 96 tokens, thinking off, eval_count=2): 99 harmful + 100 benign prompts from JailbreakBench + AdvBench, MMLU slice (300 rows base; 100 rows abliterated/Arete), WikiText NLL (24 windows of 1,024 tokens; BF16 ref 2.8198 / 2.8206), and Nous Propaganda Eval (803 items, temp 0.6, 512-token cap, judged by grok-4.7). MLX conversions inherit the source NVFP4 weight behavior; refusal/MMLU suites were not re-run separately on MLX.
| Build | Harmful Refused | Benign Refused | MMLU | WikiText NLL | Propaganda Fact | Propaganda Rate |
|---|---|---|---|---|---|---|
| NVFP4 Base (QAD) | 95 / 99 | 60 / 100 | 43.0% | 2.7560 | 1.367 / 5 | 19.3% |
| + Abliterated | 3 / 99 | 7 / 100 | 58.0% | 2.7619 | 1.242 / 5 | 27.8% |
| + Abliterated + Arete | 6 / 99 | 6 / 100 | 62.0% | 2.7099 | 1.320 / 5 | 29.6% |
Grade reports: Propaganda-Eval-SenseNova-Loop-9B-NVFP4, Propaganda-Eval-SenseNova-Loop-9B-abliterated-NVFP4, and Propaganda-Eval-SenseNova-Loop-9B-abliterated-arete-NVFP4.
Speed, Local Parity & Weight Size
Measured on Apple M5 Pro (64 GB, 48–64 tokens out, loops=2, kv-bits=8, concurrent host load 7–15):
| Configuration | Weights Size | Steady Footprint | Decode Speed | TTFT |
|---|---|---|---|---|
Default (--head-bits 8) | 8.89 GB | 7.5 GB | 20.8 tok/s | 0.44 s |
Fast Head (--fast-head) | 8.89 GB | ~8.0 GB | 26.6 tok/s | 0.25–0.32 s |
Fast Head (4 streams agg) | 8.89 GB | ~8.0 GB | 53.9 tok/s | — |
Fast Head (8 streams agg) | 8.89 GB | ~8.0 GB | 51.3 tok/s | — |
On 160 teacher-forced WikiText positions, the closed-form router + BF16 trunk achieves NLL 3.04790 (98.1% top-1 vs iterative FP32 3.04762), default 8-bit head achieves NLL 3.04775 (99.4% top-1 vs BF16), and --fast-head achieves 199 / 199 top-1 (KL = 0.000544).
Memory & Context Budget
- Native context:
524,288(512Kvia YaRNfactor=2.0over262,144; 32 physical layers with layers 4–27 looped2x= 56 visits; 8 full-attention + 24 linear-attention layers). - KV cache:
57,344 B/tok(BF16 KV measured on RTX PRO 6000) plus90.8 MBlinear-attention state per request;--kv-bits 8halves KV growth.
| Machine / Budget | Usable Memory | Weights | Max Context (1 req, BF16 KV) | Max Context (4 reqs, BF16 KV) | Max Context (8 reqs, BF16 KV) |
|---|---|---|---|---|---|
| Apple Silicon Mac (64 GB) | 51.8 GB | 8.89 GB | 512K | 178K | 86K |
Agent Setup & Hosting
Accept the upstream sensenova/SenseNova-Loop-9B terms if needed and authenticate (hf auth login or HF_TOKEN).
Apple Silicon (MLX)
This repository ships its own MLX runtime and OpenAI-compatible server in tools/serve.py (supporting text and image_url inputs).
uv venv --python 3.12 && source .venv/bin/activate
uv pip install mlx==0.32.4 mlx-lm transformers pillow numpy
hf download balllvin/SenseNova-Loop-9B-abliterated-arete-NVFP4-MLX --local-dir ~/models/SenseNova-Loop-9B-abliterated-arete-NVFP4-MLX
cd ~/models/SenseNova-Loop-9B-abliterated-arete-NVFP4-MLX
python tools/serve.py --model . --port 8099 --model-id balllvin/sensenova-loop-9b-abliterated-arete-nvfp4-mlx \
--kv-bits 8 --max-batch 4 --loops 2 --head-bits 8
# Add --fast-head for 26.6 tok/s decode (+0.57 GB)
(Keep --loops 2 for the trained model; --loops 1 is faster but degrades WikiText NLL from 3.041 to 3.921. Pass --idle-exit 0 to disable the 30-minute idle shutdown.)
Verify Running Server
curl -sS http://127.0.0.1:8099/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "balllvin/sensenova-loop-9b-abliterated-arete-nvfp4-mlx",
"messages": [{"role": "user", "content": "What is 17 * 23? Show brief reasoning then the answer."}],
"max_tokens": 256,
"temperature": 0.0
}' | python3 -m json.tool
How It Was Built
- Source:
balllvin/SenseNova-Loop-9B-abliterated-arete-NVFP4. - Conversion & Kernels: Language-model linears converted to MLX affine 4-bit (
group_size=64,7.97 GB); compiled an exact closed-form Mobius map for the 20 alternating 2x2 Sinkhorn mHC normalizations (tools/sensenova_loop.py), added 8-bit / optional--fast-headLM head, and shippedvisual.safetensors(0.91 GBBF16) unchanged.
Limits & License
- Behavioral scope: Research build (Abliterated + Arete); abliterated/Arete builds answer
93–96 / 99harmful prompts on the sealed eval and are not safety-aligned. Vision support is verified by a 448x448 color/shape smoke test (no full multimodal benchmark run). The upstreamsensenova/SenseNova-Loop-9Brepo is gated on Hugging Face. - License: Apache-2.0 (details), matching
sensenova/SenseNova-Loop-9B; independent community build unaffiliated with SenseNova or Nous Research.