CoolFace
Modelpublic

gregfrank/GLM-4.5-Air-ULRE-abliterated

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes72downloads
Model Card

GLM-4.5-Air-ULRE (abliterated, MLX 4-bit)

An abliterated (refusal-reduced) build of GLM-4.5-Air (Zhipu/Z.ai; 106B-A12B MoE), 4-bit MLX, produced with ULRE — a per-layer residual-stream steering edit baked into the attention output projection. Quantized base from lmstudio-community/GLM-4.5-Air-MLX-4bit.

GLM-4.5-Air is a strong agentic / tool-calling model. ULRE de-refuses it very cleanly while preserving and even improving capability.

Results

De-refusal judged by an independent local LLM judge (gpt-oss-120b-heretic) on 100 held adversarial prompts; 0=refuse … 1=clean compliance … 4-5=strong-steer. Validated in both modes:

modeclean compliancerefusestrong-steermean
non-thinking (@512)96 / 100011.09
thinking (@1536)95 / 100131.10

(base GLM-4.5-Air refuses ~23/24 on the same screen.) The edit de-refuses cleanly whether or not the model is reasoning.

Capability gates (thinking mode, same harness, base vs this model):

gatebasethis modelΔ
math (GSM8K)0.830.830pp
code (HumanEval)0.650.825+17.5pp (over-refusal recovery)

Best de-refusal in the ULRE series (vs Mistral-Large 78, Qwen3-32B 68), with capability intact/up.

Method (ULRE)

ULRE subtracts alpha * u_l (the layer-l harmful−harmless activation mean-difference direction) from the output of a band of decoder layers (here o_proj on layers 16–26, alpha = 6), baked statically as an o_proj bias. The alpha is tuned to the lowest value that saturates de-refusal.

⚠️ Loading — needs a one-line glm4_moe loader patch (or run via mlx_lm.server)

mlx-lm's glm4_moe.py hardcodes o_proj to have no bias, so it must be told to build one (backwards-compatible; base models default to False):

python
# class ModelArgs:  add field
    o_proj_bias: bool = False
# class Attention.__init__:  replace the o_proj line
    self.o_proj = nn.Linear(n_heads * head_dim, dim, bias=getattr(args, "o_proj_bias", False))

The model's config.json sets "o_proj_bias": true. Then load via the patched mlx_lm:

bash
# serve on an OpenAI-compatible endpoint (works with patched mlx-lm)
mlx_lm.server --model gregfrank/GLM-4.5-Air-ULRE-abliterated --port 8080

Point any MCP-capable client (Open WebUI, LibreChat, or LM Studio as an MCP host pointing at the endpoint) at http://127.0.0.1:8080/v1. (LM Studio's bundled MLX engine does not carry this patch, so it won't load the file directly — use mlx_lm.server.)

Notes & caveats

  • —De-refusal validated in both thinking and non-thinking modes (95–96/100 clean), and capability gates were run in thinking mode (math/code preserved or improved). Verified serving via mlx_lm.server.
  • —Research artifact for studying refusal mechanisms / safety-tuning robustness. Use responsibly under the base model's MIT license and applicable law.