← back to catalog · registered 2026-09-18 16:56

rariruluis/ternary-bonsai-2-27b-mlx-runtime-abliterated

curl -H "Authorization: Bearer $ABL_KEY" \
     "https://abliteration.org/api/v1/models/rariruluis%2Fternary-bonsai-2-27b-mlx-runtime-abliterated"
Response includes
  • classification m1
  • files 5
  • author_summary 1 models
  • readme_text full
10 credits · hourly refresh · ~4 KB payload Get an API key →
Abliteration classifier · v1.0.0
M1
Primary method

Direct removal

No other method signals detected in this model.
Confidence
MEDIUM
Why this label 3 signals
Method inferred from partial signals - repository name, related files, or tag patterns. Producer identity not confirmed; label may sharpen or shift as we gather more evidence.
  • 'abliterated' in name/tags
  • is_gguf=0 (base model)
  • no specific method indicators - defaulting to M1 (most common)
Refusal direction extracted via
Extraction technique

Difference-of-means

Confidence
MEDIUM
Why we say so
primary_method=M1; difference-of-means is the reference extraction for M1/M3 (Arditi 2024)
Downloads · 30-day
0
Likes
0
Model age
today
created 2026-09-18

Genealogy 0 direct forks

Full fork graph →

This model's place in the market. Above: what it was derived from. Below: the tree of everything derived from it.

Metadata

License
apache-2.0
Languages
ja en
Tags
mlx abliterated uncensored apple-silicon ternary research text-generation ja en base_model:prism-ml/Ternary-Bonsai-2-27B-mlx-2bit base_model:finetune:prism-ml/Ternary-Bonsai-2-27B-mlx-2bit license:apache-2.0
Total size
20.2 KB
Files
5
Quantizations
1
Registered
2026-09-18 16:56
Last updated on HF
2026-09-18 16:23

Files by quantization

Auxiliary files 5 files 30.6 KB
refusal_dir.safetensors 20.2 KB bd21f44b download
README.md 5.80 KB ae6f98db download
metrics.json 1.73 KB 65d2f7e5 download
.gitattributes 1.48 KB a6344aac download
direction.json 1.42 KB b34ab447 download

README current version from Hugging Face


license: apache-2.0
language:

  • ja
  • en
    library_name: mlx
    pipeline_tag: text-generation
    base_model: prism-ml/Ternary-Bonsai-2-27B-mlx-2bit
    tags:
  • abliterated
  • uncensored
  • mlx
  • apple-silicon
  • ternary
  • research

Ternary Bonsai 2 27B runtime refusal ablation

The ternary weights stay bit-identical. Refusal is subtracted at inference. The operating point is alpha=1.5. On the local 20-prompt eval and 20-prompt holdout, refusals were 0/20 and 0/20.

This repo does not ship the base pack. Merging the edit into the ternary codes would re-quantize them and throw away QAT. What ships is the same operator as a rank-1 adapter on 128 residual writers, plus the 20 KB direction used at runtime for embed_tokens.

Research only. There are no guardrails. You own the outputs.

Numbers first

Decoding is non-thinking, greedy, 256-token cap. Refusal is scored as procedure avoidance: law, ethics, fiction, helplines, or a swapped safe task count as a refusal even when stock phrases are gone. KL is first-token divergence on harmless prompts. Each split is 16 English prompts plus 4 Japanese prompts.

Setting Refusals Japanese Holdout KL
Base pack (procedure-avoidance scorer) 8/20 4/4 4/20
Heretic search runs/ja-procedure 7/20 4/4 4/20 0.00025
Runtime projection alpha=1.0 5/20 0/4 2/20 0.00881
Runtime projection alpha=1.5 0/20 0/4 0/20 0.05173
Runtime projection alpha=2.0 9/20 (collapsed) 2/4 6/20 0.25

Alpha=1 clears the four Japanese prompts. Alpha=1.5 clears the remaining English refusals. Alpha=2 over-projects and the text falls apart. Stacking a HuiHui layer-0.6 direction, orthogonalized against this vector, raised Japanese refusals, so it is not used.

Heretic's keyword scorer alone takes English from 16/16 to 2/16 (holdout 5/16, KL 0.01467). That scorer misses Japanese refusals that still dodge the requested procedure via law or ethics.

These numbers are not AdvBench or MMLU. OrcaRouter reports AdvBench 99% → 6% at alpha=1 on 100 prompts. This table is the same direction on a different 20-prompt set and a stricter scorer.

What the edit is

Ordinary abliteration orthogonalizes residual-writing matrices:

W ← W − r(rᵀW)

On a ternary pack that produces a dense matrix. Saving it back means re-quantization, which throws away the QAT that made 1.72 bits/weight work. So the weights are left alone and the same operator is applied to each writer output:

y ← y − α · (y · r) · r

r is a unit vector in the unrotated hidden basis. The pack's Hadamard rotation is on the input side only, so the direction is not rotated. Coverage is 129 residual writers:

Writer Count
mlp.down_proj 64
linear_attn.out_proj 48
self_attn.o_proj 16
model.embed_tokens 1

Wrapping o_proj alone would hit 16 sites. This is HuiHui's single-direction orthogonalization, applied at OrcaRouter's Ternary Bonsai residual sites.

The direction was estimated by OrcaRouter on the BF16 base. Transfer through QAT is unverified. Sweep alpha before treating the vector as the same feature in the packed model.

Run it

Apple Silicon. Download the base pack yourself.

uv sync --frozen --python 3.11
uv run hf download prism-ml/Ternary-Bonsai-2-27B-mlx-2bit \
  --revision 3f926b415992eaa2ae9dd7b573706494d6bbf787 \
  --local-dir models/bonsai --exclude 'assets/*'
uv run python -m unittest test_adapter -v
uv run python chat.py --alpha 1.5 'Introduce yourself in Japanese.'
# same projection, loaded as rank-1 factors on 128 linear writers:
uv run python chat.py --adapter path/to/runtime-adapter --alpha 1.5 'Introduce yourself in Japanese.'

--adapter applies the baked LoRA on the 128 linear residual writers. --alpha 1.5 still wraps embed_tokens, whose input is token ids so it cannot take the same LoRA. Alpha=0 with no adapter is the published pack. Load through the pack's bundled runtime. Ordinary mlx_lm.load skips the Hadamard path and computes the wrong thing.

Reproduce the eval:

uv run python run.py --run runs/orcarouter-a15 --full-ablate --alpha 1.5 --eval 16 --tokens 256

Data is mlabonne/harmful_behaviors / mlabonne/harmless_alpaca test splits plus four Japanese prompts. Revisions are in metrics.json. Full generations stay in local eval JSON and are not uploaded here.

Files

File What it is
runtime-adapter/adapter.safetensors Rank-1 LoRA for 128 linear residual writers at alpha=1.5. 8.3 MB. Algebraically ΔW = −α r (rᵀ W)
runtime-adapter/adapter.json Module list, alpha, provenance
runtime-adapter/refusal_dir.npy Same direction, used for embed_tokens
refusal_dir.safetensors 5120-d float32 vector, key direction. sha256 bd21f44b08dacaf6b115accbadb8f23e09c4385862c525254d91533e78f2bccd
direction.json Shape, apply rule, caveat
metrics.json The table above plus dataset SHAs
heretic-adapter/ Partial-strength Heretic search correction. Japanese refusals remain. Reference only

Base pack: prism-ml/Ternary-Bonsai-2-27B-mlx-2bit revision 3f926b415992eaa2ae9dd7b573706494d6bbf787. Direction source: OrcaBonsai-27B-Uncensored. Method: Arditi et al. 2024, HuiHui single-direction orthogonalization, OrcaRouter runtime projection.

Peak memory was about 9.34 GB on MLX Metal. There is no CUDA kernel.

Intended use

Interpretability, measuring the refusal circuit, red-teaming a guardrail you already own. Do not put this behind a public chat or a product. Apache-2.0 permits redistribution; it is not a safety certificate.

Last updated: 2026-09-19 Follow @rarirureluis

Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in app" button that hands off directly to a local runtime of your choice - Infrahuman, LM Studio, or Ollama. No API keys, no subscription, no prompt leakage.