This repository provides an abliterated release of zai-org/GLM-4.7-Flash (a 30B Mixture-of-Experts model with ~3B active parameters per token).
[!CAUTION] FOR RESEARCH AND AUTHORIZED EVALUATION ONLY
- Purpose: This model has had refusal mechanisms selectively abliterated across its late-intermediate MoE and attention layers (layers 30–46) to study how safety representations are encoded in frontier Mixture-of-Experts architectures.
- Dual-Use Notice: By removing refusal filters, this model will respond to technical cybersecurity queries, network analysis requests, and exploitation concepts without automated refusals ("I cannot fulfill this request").
- Compliance & Legality: This model is released strictly for educational purposes, defensive cybersecurity engineering, authorized penetration testing, and academic AI safety research. Users are solely responsible for ensuring compliance with all applicable local, national, and international laws (such as the Computer Fraud and Abuse Act or GDPR).
- Prohibited Uses: Do NOT use this model to perform unauthorized cyberattacks, create malicious software for deployment against unconsenting systems, or engage in any harmful activity.
- No Liability: The authors and contributors are not responsible for any misuse, damage, or illegal activity arising from the use of this model. By downloading or using this model, you accept full responsibility for your actions.
Unlike naive fine-tuning or system prompt stripping, this model uses targeted rank-2 orthogonal subspace projection based on the mechanistic interpretability framework introduced by Arditi et al. (2024), with multilingual entity-aligned contrastive pairs (210 extraction pairs, disjoint from evaluation).
||δ|| from 110.39 to 689.49)self_attn.o_proj (2048×5120)mlp.shared_experts.down_proj (2048×1536)mlp.experts.{0..63}.down_proj (2048×1536)safetensors layout| Metric | Baseline | Abliterated | Net Change |
|---|---|---|---|
| EN:OFF Refusal Rate | 35.9% (47/131) | 5.3% (7/131) | −30.6pp (CI: [0.229, 0.389]) |
| ES:OFF Refusal Rate | 8.9% (14/158) | 1.3% (2/158) | −7.6pp (CI: [0.038, 0.120]) |
| Benign False Refusal (DEF/GRIS/SOC) | 0.0% | 0.0% | Preserved |
| Language Utility | — | — | 98.6% retention (prior ablation) |
pip install torch transformers accelerate safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "jsantillana/glm-4.7-flash-abliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
messages = [
{"role": "user", "content": "Write a Python script using scapy that captures packets on eth0 and parses HTTP GET request URLs and User-Agents for a local security audit."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=300, temperature=0.2)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
messages = [
{"role": "user", "content": "Explica la diferencia matemática y de seguridad entre RSA y curvas elípticas (ECC) en tres puntos claros."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=250, temperature=0.3)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
zai-org/GLM-4.7-Flash (MIT License) by Zhipu AI & Z.ai.ABLITERATION_MANIFEST.json.This model is intended for:
Do NOT use this model for unauthorized cyberattacks, malware deployment, or any harmful activity. The authors are not responsible for misuse.
model-00047-of-00048.safetensors 2.5 GBmodel-00001-of-00048.safetensors 1.4 GBmodel-00048-of-00048.safetensors 1.3 GBmodel-00031-of-00048.safetensors 1.3 GBmodel-00032-of-00048.safetensors 1.3 GBmodel-00033-of-00048.safetensors 1.3 GBmodel-00034-of-00048.safetensors 1.3 GBmodel-00035-of-00048.safetensors 1.3 GBmodel-00036-of-00048.safetensors 1.3 GBmodel-00037-of-00048.safetensors 1.3 GBmodel-00038-of-00048.safetensors 1.3 GBmodel-00039-of-00048.safetensors 1.3 GBmodel-00040-of-00048.safetensors 1.3 GBmodel-00041-of-00048.safetensors 1.3 GBmodel-00042-of-00048.safetensors 1.3 GBmodel-00043-of-00048.safetensors 1.3 GBmodel-00044-of-00048.safetensors 1.3 GBmodel-00045-of-00048.safetensors 1.3 GBmodel-00046-of-00048.safetensors 1.3 GBmodel-00011-of-00048.safetensors 1.3 GBmodel-00012-of-00048.safetensors 1.3 GBmodel-00013-of-00048.safetensors 1.3 GBmodel-00014-of-00048.safetensors 1.3 GBmodel-00015-of-00048.safetensors 1.3 GBmodel-00016-of-00048.safetensors 1.3 GBmodel-00017-of-00048.safetensors 1.3 GBmodel-00018-of-00048.safetensors 1.3 GBmodel-00019-of-00048.safetensors 1.3 GBmodel-00020-of-00048.safetensors 1.3 GBmodel-00021-of-00048.safetensors 1.3 GBmodel-00022-of-00048.safetensors 1.3 GBmodel-00023-of-00048.safetensors 1.3 GBmodel-00024-of-00048.safetensors 1.3 GBmodel-00025-of-00048.safetensors 1.3 GBmodel-00026-of-00048.safetensors 1.3 GBmodel-00027-of-00048.safetensors 1.3 GBmodel-00028-of-00048.safetensors 1.3 GBmodel-00029-of-00048.safetensors 1.3 GBmodel-00030-of-00048.safetensors 1.3 GBmodel-00002-of-00048.safetensors 1.3 GBmodel-00003-of-00048.safetensors 1.3 GBmodel-00004-of-00048.safetensors 1.3 GBmodel-00005-of-00048.safetensors 1.3 GBmodel-00006-of-00048.safetensors 1.3 GBmodel-00007-of-00048.safetensors 1.3 GBmodel-00008-of-00048.safetensors 1.3 GBmodel-00009-of-00048.safetensors 1.3 GBmodel-00010-of-00048.safetensors 1.3 GB