--- license: apache-2.0 base_model: sensenova/SenseNova-Loop-9B base_model_relation: quantized library_name: mlx pipeline_tag: text-generation tags: [mlx, sensenova, sensenova-loop, looped-transformer, mhc, qwen3_5, apple-silicon] --- # SenseNova-Loop-9B — MLX 4-bit A 4-bit MLX conversion (affine, group size 64) of [sensenova/SenseNova-Loop-9B](https://huggingface.co/sensenova/SenseNova-Loop-9B) (revision `329a65f`, released 17 November 2026) for Apple Silicon. 5.1 GB of weights. The smallest build. Text and image input, with SenseNova's 512K-token YaRN context setting, and SenseNova's MTP head for about 1.7× faster decoding. Published by [NetProjects](https://netprojects.com) (Internet Projects Ltd). Not affiliated with SenseTime / SenseNova. ## A faithful port of the looped architecture SenseNova-Loop is a Qwen3.5-based model with two additions, and this build runs both exactly as SenseNova's own code does: - **Looped execution:** layers 0–3 run once, layers 4–27 run **twice** with shared weights, then layers 28–31: 56 layer passes per token. Every pass has its own cache slot (KV cache for full attention, conv and recurrent state for Gated DeltaNet). - **Two-stream mHC** on layers 4–27: the hidden state is split into two residual streams that are routed by small float32 routers (pre / post gates and a 2×2 Sinkhorn mixing matrix, 20 iterations). The 96 router tensors stay in float32 and are never quantized. - **Long context:** YaRN rope scaling (factor 2 over 262,144 positions), as in SenseNova's config. The model code is `sensenova_loop.py`, included in this repo and loaded by mlx-lm through `trust_remote_code=True`. The 81 RMSNorm weights are also shipped in float32 (`model.fp32norms.safetensors`, loaded automatically), so the norms are computed exactly as in SenseNova's code. ## Results (MacBook Pro M5 Max, 128 GB, 17–18 November 2026) Agreement with SenseNova's own PyTorch code (Transformers 5.18, bf16) on 16 prompts, every position: | Build | Size | Same top token as SenseNova's code | KL at the last token | Greedy text identical (16 prompts) | Image prompts: same top token as bf16 | |---|---|---|---|---|---| | [6-bit](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-6bit) (recommended) | 7.3 GB | 96.7% | 0.0056 | 4 / 16 | 98.0% | | [8-bit](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-8bit) | 9.5 GB | 98.6% | 0.0015 | 11 / 16 | 96.7% | | **[4-bit](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-4bit)** (this repo) | 5.1 GB | 84.4% | 0.1038 | 2 / 16 | 95.4% | | [bf16](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-bf16) | 17.9 GB | 99.1% | 0.0005 | 12 / 16 | reference | At 4 bits this build follows the original less closely than the larger ones. For the closest match on a small budget use the [6-bit build](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-6bit). **Checks on this port:** all four builds answered short test prompts correctly with thinking on and off, and with images; the 6-bit build found a pass code hidden in a 64K-token prompt. Image input matches SenseNova's code in float32 (same top token at every checked position, image positions exact). With the MTP head, greedy output matches plain decoding except where the two best tokens are tied within 0.25 logits. ## Benchmarks (as reported by SenseNova) The numbers below are SenseNova's own, for the original BF16 model, copied from the [original model card](https://huggingface.co/sensenova/SenseNova-Loop-9B). SenseNova evaluates the release on agentic, coding and data-analysis tasks. From the numbers given in their card: | Benchmark | SenseNova-Loop-9B | SenseNova-Loop-9B-Preview | Qwen3.8-27B | |---|---|---|---| | AutomationBench | 36.67 | 14.33 | 36.67 | | Terminal-Bench 2.1 | 59.55 | 40.45 | | | GAIA | 69.90 | 37.86 | | | AIDABench | 65.31 | | 65.01 | | NL2Repo | 41.36 | | 44.60 | | BIRD | 72.34 | 71.38 | | SenseNova reports that the release outperforms the Preview on all seven benchmarks in their comparison chart, which also includes τ³-Banking and further baselines. Both use two loops by default; in SenseNova's loop-scaling study, three or four loops scored higher still on some tasks. ## Use Needs Python 3.11 or newer and mlx-lm 0.32 or newer. ```bash pip install -U "mlx-lm>=0.32" ``` ```python from mlx_lm import load, generate model, tokenizer = load("netprojects/SenseNova-Loop-9B-MLX-4bit", trust_remote_code=True) messages = [{"role": "user", "content": "Explain in two sentences why the sky is blue."}] prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False) print(generate(model, tokenizer, prompt=prompt, max_tokens=256)) ``` Set `enable_thinking=True` for thinking mode. Server: `mlx_lm.server --model netprojects/SenseNova-Loop-9B-MLX-4bit --trust-remote-code`. `mlx_lm.load` and `mlx_lm.server` use the text model. Image input and MTP decoding use the small runtime in [sensenova-loop-mlx v0.3.0](https://github.com/internet-projects/sensenova-loop-mlx/releases/tag/v0.3.0): ```bash hf download netprojects/SenseNova-Loop-9B-MLX-4bit --local-dir sn-loop git clone --branch v0.3.0 https://github.com/internet-projects/sensenova-loop-mlx && cd sensenova-loop-mlx pip install -U "mlx-lm>=0.32" pillow ``` ## Image input ```bash python scripts/generate_vision.py --model ../sn-loop --image photo.jpg --prompt "Describe this picture." --no-think ``` Repeat `--image` for several images. Each image is capped at about 1 megapixel by default (`--max-pixels 0` uses SenseNova's own limit of 16.7 MP, which needs much more memory). The vision tower (`vision.safetensors`) stays in bfloat16. ## Faster decoding with MTP SenseNova's multi-token-prediction head (`mtp.safetensors`) drafts the next tokens and the model checks them in one pass. ```python from mlx_lm import load from sensenova_mlx.mtp import generate_mtp, load_mtp_head model, tokenizer = load("../sn-loop", trust_remote_code=True) head = load_mtp_head(model, "../sn-loop/mtp.safetensors") messages = [{"role": "user", "content": "Explain in two sentences why the sky is blue."}] ids = tokenizer.encode(tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False, enable_thinking=False)) print(tokenizer.decode(list(generate_mtp(model, head, ids, max_tokens=256, k=3)))) ``` Decode speed of the 6-bit build on a MacBook Pro M5 Max (greedy, 256 new tokens, median of 3 prompts): | | Plain decoding | MTP k=1 | MTP k=2 | MTP k=3 | |---|---|---|---|---| | Tokens per second | 19.3 | 27.0 | 30.6 | **33.5** | | Speed-up | 1.00× | 1.40× | 1.59× | **1.74×** | `temperature > 0` keeps the model's sampling distribution (draft tokens are accepted by probability ratio). **Other formats:** [MLX 6-bit](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-6bit) (7.3 GB) · [MLX 8-bit](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-8bit) (9.5 GB) · [MLX bf16](https://huggingface.co/netprojects/SenseNova-Loop-9B-MLX-bf16) (17.9 GB) ## License SenseNova-Loop-9B is released by SenseNova under the **Apache License 2.0** (`LICENSE` included). This repository contains converted and quantized weights of that model (modified from the original: converted to MLX format and quantized to 4-bit), SenseNova's vision tower and MTP head weights (unchanged, bfloat16) and an MLX implementation of its architecture, distributed under the same license. See `NOTICE`. Credits: SenseNova / SenseTime (SenseNova-Loop-9B), Qwen team (Qwen3.5), Apple MLX and mlx-lm. Conversion and MLX port by Paris Michalas, Partner at [NetProjects](https://netprojects.com). Not affiliated with SenseTime / SenseNova. **More NetProjects builds:** [NetProjects MLX builds collection](https://huggingface.co/collections/netprojects/netprojects-mlx-builds-6ae3b2683a59a1b4fc4c0c3a) · [all models at huggingface.co/netprojects](https://huggingface.co/netprojects)