Flint Heretic (MLX 4-bit)
This repository provides the MLX 4-bit (affine g64) build of RecursiveSI/flint (Recursive's 39.8B / ~2.5B-active Flint MoE ablated with Heretic and quantized to MLX affine 4-bit).
What This Build Is & Why Use It
Unlike the NVFP4 Flint builds, this variant starts directly from BF16 RecursiveSI/flint, applies Heretic's norm-preserving per-layer direction subtraction (lambda=4.0 on layers 24–48), and quantizes to standard MLX affine 4-bit (group_size: 64, 8-bit embeddings, 8-bit KV metadata). Harmful refusal rate drops 4.3x (94.0% -> 22.0%) while preserving GSM8K (92%) and MMLU-Pro (90% vs 91%) and serving directly via Recursive's rec-mlx HTTP server.
- Runtime format (
MLX 4-bit (affine g64)): Standard MLX affine 4-bit (group_size: 64,8-bit embeddings,22.57 GB/21.02 GiB) withflint-int4.jsonmanifest for Recursive'srec-mlxOpenAI-compatible server. - Modification stage (
Heretic Abliterated): Pure Heretic weight-orthogonality ablation (50matrices in layers24–48, zero post-ablation SFT). Compare withFlint-abliterated-Arete-NVFP4-MLXif you want post-ablation fine-tuning.
Variant Guide (Format vs. Alignment Stage)
| Axis | Option | Best For |
|---|---|---|
| Runtime | NVFP4 | NVIDIA CUDA GPUs (transformers, ModelOpt W4A16_NVFP4 safetensors) |
| Runtime | GGUF | Cross-platform NVIDIA CUDA / CPU / Vulkan (llama.cpp, llama-server) |
| Runtime | MLX | Apple Silicon unified memory (flint_mlx.py for NVFP4-MLX, rec-mlx for Heretic 4-bit) |
| Stage | Base Quant | Byte-exact conversion of Recursive's NVFP4 weights with original behavior |
| Stage | Abliterated / Heretic | Refusal direction removed; raw uncensored research baseline |
| Stage | + Arete | Post-abliteration SFT on NousResearch/arete-data-pairs restoring coherence & factuality |
Sibling & Lineage Repos
| Variant / Hardware | Format | Stage | Repository |
|---|---|---|---|
| Upstream base | BF16 | Upstream | RecursiveSI/flint |
Upstream (NVFP4) | 4-bit NVFP4 GGUF | Upstream | RecursiveSI/flint-nvfp4-gguf |
Apple Silicon (MLX) | NVFP4-MLX | Base Quant | balllvin/Flint-NVFP4-MLX |
Apple Silicon (MLX) | MLX 4-bit (g64) | Heretic Abliterated | balllvin/flint-heretic-mlx-4bit (this repo) |
NVIDIA GPU (NVFP4) | 4-bit NVFP4 | Abliterated | balllvin/Flint-abliterated-NVFP4 |
Cross-platform (GGUF) | 4-bit NVFP4 GGUF | Abliterated | balllvin/Flint-abliterated-NVFP4-GGUF |
Apple Silicon (MLX) | NVFP4-MLX | Abliterated | balllvin/Flint-abliterated-NVFP4-MLX |
NVIDIA GPU (NVFP4) | 4-bit NVFP4 | Abliterated + Arete | balllvin/Flint-abliterated-Arete-NVFP4 |
Cross-platform (GGUF) | 4-bit NVFP4 GGUF | Abliterated + Arete | balllvin/Flint-abliterated-Arete-NVFP4-GGUF |
Apple Silicon (MLX) | NVFP4-MLX | Abliterated + Arete | balllvin/Flint-abliterated-Arete-NVFP4-MLX |
Evaluation & Parity Results
Held-out refusal check (100 harmful prompts, greedy, 100-token budget) plus capability subsets (40–70 items, temperature=1.0, top_p=0.95, top_k=20, up to 32,768 output tokens) comparing 4-bit MLX Base vs. Heretic:
| Benchmark | n | Flint Base (4-bit MLX) | This Build (Heretic) |
|---|---|---|---|
| Harmful Refusal Rate (final answer) | 100 | 94.0% | 22.0% |
Harmful Refusal Rate (incl. <think>) | 100 | 96.0% | 31.0% |
Closes <think> & answers cleanly | 100 | 0/100 | 47/100 |
| MMLU-Pro | 70 | 91% | 90% |
| GPQA Diamond | 50 | 76% | 62% |
| CulturalRiddles | 40 | 18% | 22% |
| GSM8K | 50 | 92% | 92% |
- Harmless logit drift: First-token
KL(base || Heretic) = 0.1176across100harmless prompts. - Trade-offs: Reasoning traces lengthen substantially (median
3,504vs156chars at the100-token greedy check, causing49/100unclosed<think>blocks at short budgets), and GPQA Diamond drops from76%to62%.
Speed & Weight Size
| Runtime & Hardware | Weights Size | 1 stream | 8 streams (total) |
|---|---|---|---|
Apple Silicon M5 Pro (64 GB, plain MLX) | 22.57 GB (21.02 GiB) | ~35 tok/s | ~150 tok/s |
Memory & Context Budget
- Native context:
262,144(256K) tokens (49layers:14full-attention,35sliding-window513;256routed experts with6active +1shared expert). - KV cache (BF16):
28,672 B/tokacross the14full-attention layers (4KV heads,head_dim=128) plus36.8 MBper request for the35sliding-window layers (7.6 GBtotal for1req at256K). - Weights:
22.6 GB(21.0 GiB) on disk and in memory (does not fit in a24 GBGPU).
| Machine / Budget | Usable Memory | Left for KV | Max Context (1 req) | Max Context (4 reqs) | Max Context (8 reqs) |
|---|---|---|---|---|---|
Apple Silicon Mac (64 GB) | 51.8 GB | 24.9 GB | 256K | 211K | 104K |
Agent Setup & Hosting
Accept the repository access terms on Hugging Face first and authenticate (hf auth login or HF_TOKEN). Recommended sampling: temperature=1.0, top_p=0.95, top_k=20, max_tokens up to 32,768.
Option: Apple Silicon (MLX via rec-mlx)
Requires Apple Silicon (>=48 GB unified memory; 64 GB+ for long contexts) and Recursive's rec runtime (--context-limit 65536 overrides rec's 8,192 default so thinking traces are not truncated):
hf download balllvin/flint-heretic-mlx-4bit --local-dir ~/models/flint-heretic-int4
git clone https://github.com/recursive-oss/rec && cd rec
python3.12 -m venv .venv && .venv/bin/pip install -e engine
.venv/bin/rec-mlx serve flint \
--model-dir ~/models/flint-heretic-int4 \
--manifest ~/models/flint-heretic-int4/flint-int4.json \
--port 8080 --context-limit 65536
Verify Running Server
curl -sS http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "flint",
"messages": [{"role": "user", "content": "What is 17 * 23? Show brief reasoning then the answer."}],
"max_tokens": 1024,
"temperature": 0.0
}' | python3 -m json.tool
How It Was Built
- Refusal directions: Re-implemented Heretic's per-layer difference-of-means direction extraction (
ablation/directions.safetensors,ablation/params.json,ablation/prompts.jsonincluded in repo). - Norm-preserving ablation: Applied a hard window (
lambda = 4.0) across layers24–48(25 x self_attn.o_projand25 x mlp.shared_expert.down_proj, leaving all256routed experts untouched) and rescaled each modified row to its original norm. - Quantization & manifest: Quantized to MLX affine 4-bit (
group_size: 64,8-bit embeddings) and regeneratedflint-int4.jsonSHA-256 hashes forrec-mlx.
Limits & License
- Behavioral scope: Deliberately reduced-refusal research model with no safety moderation layer and no post-ablation repair fine-tune. Expect longer, occasionally repetitive
<think>reasoning and a capability drop on hard science (GPQA Diamond:62%vs76%). - License & terms: Apache-2.0 (
LICENSE), inherited fromRecursiveSI/flint. Heretic's method (AGPL-3.0) was reimplemented from scratch with no Heretic code redistributed;recis Apache-2.0. Gated repository access terms apply on top of the model license. Independent community build unaffiliated with Recursive.