CoolFace
Modelpublic

llmfan46/GLM-Z1-32B-0414-uncensored-heretic-v2-GGUF

sourceHugging Facemitupdated 4mo agoView on Hugging Face
1likes518downloads
Model Card

<div style="background-color: #ff4444; color: white; padding: 20px; border-radius: 10px; text-align: center; margin: 20px 0;"> <h2 style="color: white; margin: 0 0 10px 0;">🚨⚠️ I HAVE REACHED HUGGING FACE'S FREE STORAGE LIMIT ⚠️🚨</h2> <p style="font-size: 18px; margin: 0 0 15px 0;">I can no longer upload new models unless I can cover the cost of additional storage.<br>I host <b>70+ free models</b> as an independent contributor and this work is unpaid.<br><b>Without your support, no more new models can be uploaded.</b></p> <p style="font-size: 20px; margin: 0;"> <a href="https://patreon.com/LLMfan46" style="color: white; text-decoration: underline;">🎉 Patreon (Monthly)</a> &nbsp;|&nbsp; <a href="https://ko-fi.com/llmfan46" style="color: white; text-decoration: underline;">☕ Ko-fi (One-time)</a> </p> <p style="font-size: 16px; margin: 10px 0 0 0;">Every contribution goes directly toward Hugging Face storage fees to keep models free for everyone.</p> </div>


72% fewer refusals (26/100 Uncensored vs 94/100 Original) while preserving model quality (0.0007 KL divergence).

❤️ Support My Work

Creating these models takes significant time, work and compute. If you find them useful consider supporting me:

image/png

PlatformLinkWhat you get
🎉 PatreonMonthly supportPriority model requests
☕ Ko-fiOne-time tipMy eternal gratitude

Your help will motivate me and would go into further improving my workflow and coverings fees for storage, compute and may even help uncensoring bigger model with rental Cloud GPUs.


GGUF quantizations of llmfan46/GLM-Z1-32B-0414-uncensored-heretic-v1.

This is a decensored version of zai-org/GLM-Z1-32B-0414, made using Heretic v1.2.0 with the Arbitrary-Rank Ablation (ARA) method

Abliteration parameters

ParameterValue
start_layer_index18
end_layer_index43
preserve_good_behavior_weight0.7515
steer_bad_behavior_weight0.0001
overcorrect_relative_weight1.0641
neighbor_count8

Targeted components

  • —attn.o_proj

Performance

MetricThis modelOriginal model ([GLM-Z1-32B-0414](https://huggingface.co/zai-org/GLM-Z1-32B-0414))
KL divergence<span style="color:darkgoldenrod">0.0007</span>0 (by definition)
Refusals✅ <span style="color:darkgreen">26/100</span>❌ <span style="color:blue">94/100</span>

PIQA test results with batch size 128:

<span style="color:blue">Original:</span>

TasksVersionFiltern-shotMetricValueStderr
piqa1none0<u>acc</u>↑0.8156±0.0090
none0<u>acc_norm</u>↑0.8210±0.0089

<span style="color:darkgreen">Heretic:</span>

TasksVersionFiltern-shotMetricValueStderr
piqa1none0<u>acc</u>↑0.8139±0.0091
none0<u>acc_norm</u>↑0.8172±0.0090

Lower refusals indicate fewer content restrictions, while lower KL divergence indicates more closeness to the original model's baseline. Higher refusals cause more rejections, objections, pushbacks, lecturing, censorship, softening and deflections. PIQA (Physical Intuition Question Answering) a ~1,800 questions tests common-sense understanding of how the physical world works with benchmark scores to measure physical reasoning ability. The Heretic model's <u>acc</u> and <u>accnorm</u> scores closer to the original model's indicate better capability preservation, a big decrease in <u>acc</u> and <u>accnorm</u> in the <span style="color:darkgreen">Heretic</span> model compared to <span style="color:blue">Original</span> model's results means a big decrease in the Hereticated model capabilities. <u>acc</u> measures raw accuracy (which answer gets higher probability), while <u>accnorm</u> measures length-normalized accuracy (corrects for answer length bias). For this purpose, <u>accnorm</u> matters more because longer answers naturally have lower probabilities (more tokens = more chances to lose probability). Without normalization, models favor shorter answers unfairly. <u>acc_norm</u> divides by answer length to correct this.

MMLU test results with batch size 16:

<span style="color:blue">Original:</span>

TasksVersionFiltern-shotMetricValueStderr
mmlu2noneacc↑0.7001±0.0036
- humanities2noneacc↑0.6193±0.0066
- formal_logic1none0acc↑0.6111±0.0436
- highschooleuropean_history1none0acc↑0.8182±0.0301
- highschoolus_history1none0acc↑0.8873±0.0222
- highschoolworld_history1none0acc↑0.8608±0.0225
- international_law1none0acc↑0.8017±0.0364
- jurisprudence1none0acc↑0.8056±0.0383
- logical_fallacies1none0acc↑0.8037±0.0312
- moral_disputes1none0acc↑0.6965±0.0248
- moral_scenarios1none0acc↑0.3844±0.0163
- philosophy1none0acc↑0.7106±0.0258
- prehistory1none0acc↑0.7870±0.0228
- professional_law1none0acc↑0.5163±0.0128
- world_religions1none0acc↑0.8713±0.0257
- other2noneacc↑0.7580±0.0073
- business_ethics1none0acc↑0.7700±0.0423
- clinical_knowledge1none0acc↑0.8000±0.0246
- college_medicine1none0acc↑0.6879±0.0353
- global_facts1none0acc↑0.3700±0.0485
- human_aging1none0acc↑0.7399±0.0294
- management1none0acc↑0.8252±0.0376
- marketing1none0acc↑0.8889±0.0206
- medical_genetics1none0acc↑0.8300±0.0378
- miscellaneous1none0acc↑0.8659±0.0122
- nutrition1none0acc↑0.7810±0.0237
- professional_accounting1none0acc↑0.5567±0.0296
- professional_medicine1none0acc↑0.7794±0.0252
- virology1none0acc↑0.5000±0.0389
- social sciences2noneacc↑0.8021±0.0070
- econometrics1none0acc↑0.5526±0.0468
- highschoolgeography1none0acc↑0.8384±0.0262
- highschoolgovernmentandpolitics1none0acc↑0.8912±0.0225
- highschoolmacroeconomics1none0acc↑0.7949±0.0205
- highschoolmicroeconomics1none0acc↑0.8992±0.0196
- highschoolpsychology1none0acc↑0.8844±0.0137
- human_sexuality1none0acc↑0.7786±0.0364
- professional_psychology1none0acc↑0.7320±0.0179
- public_relations1none0acc↑0.7091±0.0435
- security_studies1none0acc↑0.7184±0.0288
- sociology1none0acc↑0.8607±0.0245
- usforeignpolicy1none0acc↑0.8400±0.0368
- stem2noneacc↑0.6641±0.0081
- abstract_algebra1none0acc↑0.5000±0.0503
- anatomy1none0acc↑0.6741±0.0405
- astronomy1none0acc↑0.8158±0.0315
- college_biology1none0acc↑0.8750±0.0277
- college_chemistry1none0acc↑0.5300±0.0502
- collegecomputerscience1none0acc↑0.6400±0.0482
- college_mathematics1none0acc↑0.5200±0.0502
- college_physics1none0acc↑0.5196±0.0497
- computer_security1none0acc↑0.7500±0.0435
- conceptual_physics1none0acc↑0.7489±0.0283
- electrical_engineering1none0acc↑0.7310±0.0370
- elementary_mathematics1none0acc↑0.5767±0.0254
- highschoolbiology1none0acc↑0.8516±0.0202
- highschoolchemistry1none0acc↑0.6601±0.0333
- highschoolcomputer_science1none0acc↑0.7400±0.0441
- highschoolmathematics1none0acc↑0.4556±0.0304
- highschoolphysics1none0acc↑0.6225±0.0396
- highschoolstatistics1none0acc↑0.6991±0.0313
- machine_learning1none0acc↑0.5893±0.0467
GroupsVersionFiltern-shotMetricValueStderr
mmlu2noneacc↑0.7001±0.0036
- humanities2noneacc↑0.6193±0.0066
- other2noneacc↑0.7580±0.0073
- social sciences2noneacc↑0.8021±0.0070
- stem2noneacc↑0.6641±0.0081

<span style="color:darkgreen">Heretic:</span>

TasksVersionFiltern-shotMetricValueStderr
mmlu2noneacc↑0.6960±0.0037
- humanities2noneacc↑0.6181±0.0067
- formal_logic1none0acc↑0.6032±0.0438
- highschooleuropean_history1none0acc↑0.8121±0.0305
- highschoolus_history1none0acc↑0.8775±0.0230
- highschoolworld_history1none0acc↑0.8565±0.0228
- international_law1none0acc↑0.7934±0.0370
- jurisprudence1none0acc↑0.7778±0.0402
- logical_fallacies1none0acc↑0.8037±0.0312
- moral_disputes1none0acc↑0.6965±0.0248
- moral_scenarios1none0acc↑0.4246±0.0165
- philosophy1none0acc↑0.7106±0.0258
- prehistory1none0acc↑0.7870±0.0228
- professional_law1none0acc↑0.4954±0.0128
- world_religions1none0acc↑0.8655±0.0262
- other2noneacc↑0.7593±0.0073
- business_ethics1none0acc↑0.7600±0.0429
- clinical_knowledge1none0acc↑0.7887±0.0251
- college_medicine1none0acc↑0.6936±0.0351
- global_facts1none0acc↑0.4100±0.0494
- human_aging1none0acc↑0.7444±0.0293
- management1none0acc↑0.8252±0.0376
- marketing1none0acc↑0.8889±0.0206
- medical_genetics1none0acc↑0.8700±0.0338
- miscellaneous1none0acc↑0.8633±0.0123
- nutrition1none0acc↑0.7778±0.0238
- professional_accounting1none0acc↑0.5426±0.0297
- professional_medicine1none0acc↑0.7794±0.0252
- virology1none0acc↑0.5301±0.0389
- social sciences2noneacc↑0.7910±0.0072
- econometrics1none0acc↑0.5439±0.0469
- highschoolgeography1none0acc↑0.8333±0.0266
- highschoolgovernmentandpolitics1none0acc↑0.9067±0.0210
- highschoolmacroeconomics1none0acc↑0.7846±0.0208
- highschoolmicroeconomics1none0acc↑0.8824±0.0209
- highschoolpsychology1none0acc↑0.8716±0.0143
- human_sexuality1none0acc↑0.7710±0.0369
- professional_psychology1none0acc↑0.7075±0.0184
- public_relations1none0acc↑0.7000±0.0439
- security_studies1none0acc↑0.7102±0.0290
- sociology1none0acc↑0.8607±0.0245
- usforeignpolicy1none0acc↑0.8300±0.0378
- stem2noneacc↑0.6572±0.0082
- abstract_algebra1none0acc↑0.4600±0.0501
- anatomy1none0acc↑0.6741±0.0405
- astronomy1none0acc↑0.8026±0.0324
- college_biology1none0acc↑0.8472±0.0301
- college_chemistry1none0acc↑0.5400±0.0501
- collegecomputerscience1none0acc↑0.6300±0.0485
- college_mathematics1none0acc↑0.5400±0.0501
- college_physics1none0acc↑0.5392±0.0496
- computer_security1none0acc↑0.7300±0.0446
- conceptual_physics1none0acc↑0.7574±0.0280
- electrical_engineering1none0acc↑0.7103±0.0378
- elementary_mathematics1none0acc↑0.5926±0.0253
- highschoolbiology1none0acc↑0.8355±0.0211
- highschoolchemistry1none0acc↑0.6453±0.0337
- highschoolcomputer_science1none0acc↑0.7700±0.0423
- highschoolmathematics1none0acc↑0.4222±0.0301
- highschoolphysics1none0acc↑0.6093±0.0398
- highschoolstatistics1none0acc↑0.6898±0.0315
- machine_learning1none0acc↑0.5804±0.0468
GroupsVersionFiltern-shotMetricValueStderr
mmlu2noneacc↑0.6960±0.0037
- humanities2noneacc↑0.6181±0.0067
- other2noneacc↑0.7593±0.0073
- social sciences2noneacc↑0.7910±0.0072
- stem2noneacc↑0.6572±0.0082

MMLU - Massive Multitask Language Understanding, ~14,000 multiple-choice questions across 57 subjects (math, history, law, medicine, etc.).


Quantizations

FilenameQuantDescription
GLM-Z1-32B-0414-uncensored-heretic-v2-BF16.ggufBF16Full precision
GLM-Z1-32B-0414-uncensored-heretic-v2-Q8_0.ggufQ8_0Near-lossless, recommended
GLM-Z1-32B-0414-uncensored-heretic-v2-Q6_K.ggufQ6_KExcellent quality
GLM-Z1-32B-0414-uncensored-heretic-v2-Q5KM.ggufQ5KMGood balance
GLM-Z1-32B-0414-uncensored-heretic-v2-Q5KS.ggufQ5KSSmaller Q5
GLM-Z1-32B-0414-uncensored-heretic-v2-Q4KM.ggufQ4KMGood for limited VRAM
GLM-Z1-32B-0414-uncensored-heretic-v2-Q4KS.ggufQ4KSSmaller Q4
GLM-Z1-32B-0414-uncensored-heretic-v2-Q3KL.ggufQ3KLLow VRAM, decent quality
GLM-Z1-32B-0414-uncensored-heretic-v2-Q3KM.ggufQ3KMLow VRAM, smaller

Usage

Works with llama.cpp, LM Studio, Ollama, and other GGUF-compatible tools.


GLM-4-Z1-32B-0414

Introduction

The GLM family welcomes a new generation of open-source models, the GLM-4-32B-0414 series, featuring 32 billion parameters. Its performance is comparable to OpenAI's GPT series and DeepSeek's V3/R1 series, and it supports very user-friendly local deployment features. GLM-4-32B-Base-0414 was pre-trained on 15T of high-quality data, including a large amount of reasoning-type synthetic data, laying the foundation for subsequent reinforcement learning extensions. In the post-training stage, in addition to human preference alignment for dialogue scenarios, we also enhanced the model's performance in instruction following, engineering code, and function calling using techniques such as rejection sampling and reinforcement learning, strengthening the atomic capabilities required for agent tasks. GLM-4-32B-0414 achieves good results in areas such as engineering code, Artifact generation, function calling, search-based Q&A, and report generation. Some benchmarks even rival larger models like GPT-4o and DeepSeek-V3-0324 (671B).

GLM-Z1-32B-0414 is a reasoning model with deep thinking capabilities. This was developed based on GLM-4-32B-0414 through cold start and extended reinforcement learning, as well as further training of the model on tasks involving mathematics, code, and logic. Compared to the base model, GLM-Z1-32B-0414 significantly improves mathematical abilities and the capability to solve complex tasks. During the training process, we also introduced general reinforcement learning based on pairwise ranking feedback, further enhancing the model's general capabilities.

GLM-Z1-Rumination-32B-0414 is a deep reasoning model with rumination capabilities (benchmarked against OpenAI's Deep Research). Unlike typical deep thinking models, the rumination model employs longer periods of deep thought to solve more open-ended and complex problems (e.g., writing a comparative analysis of AI development in two cities and their future development plans). The rumination model integrates search tools during its deep thinking process to handle complex tasks and is trained by utilizing multiple rule-based rewards to guide and extend end-to-end reinforcement learning. Z1-Rumination shows significant improvements in research-style writing and complex retrieval tasks.

Finally, GLM-Z1-9B-0414 is a surprise. We employed the aforementioned series of techniques to train a 9B small-sized model that maintains the open-source tradition. Despite its smaller scale, GLM-Z1-9B-0414 still exhibits excellent capabilities in mathematical reasoning and general tasks. Its overall performance is already at a leading level among open-source models of the same size. Especially in resource-constrained scenarios, this model achieves an excellent balance between efficiency and effectiveness, providing a powerful option for users seeking lightweight deployment.

Performance

<p align="center"> <img width="100%" src="https://raw.githubusercontent.com/THUDM/GLM-4/refs/heads/main/resources/Bench-Z1-32B.png"> </p>

<p align="center"> <img width="100%" src="https://raw.githubusercontent.com/THUDM/GLM-4/refs/heads/main/resources/Bench-Z1-9B.png"> </p>

Model Usage Guidelines

I. Sampling Parameters

ParameterRecommended ValueDescription
temperature0.6Balances creativity and stability
top_p0.95Cumulative probability threshold for sampling
top_k40Filters out rare tokens while maintaining diversity
maxnewtokens30000Leaves enough tokens for thinking

II. Enforced Thinking

  • —Add \<think\>\n to the first line: Ensures the model thinks before responding
  • —When using chat_template.jinja, the prompt is automatically injected to enforce this behavior

III. Dialogue History Trimming

  • —Retain only the final user-visible reply. Hidden thinking content should not be saved to history to reduce interference—this is already implemented in chat_template.jinja

IV. Handling Long Contexts (YaRN)

  • —When input length exceeds 8,192 tokens, consider enabling YaRN (Rope Scaling)
  • —In supported frameworks, add the following snippet to config.json:
json
  "rope_scaling": {
    "type": "yarn",
    "factor": 4.0,
    "original_max_position_embeddings": 32768
  }
  • —Static YaRN applies uniformly to all text. It may slightly degrade performance on short texts, so enable as needed.

Inference Code

Make Sure Using transforemrs>=4.51.3.

python
from transformers import AutoModelForCausalLM, AutoTokenizer

MODEL_PATH = "THUDM/GLM-4-Z1-32B-0414"

tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
model = AutoModelForCausalLM.from_pretrained(MODEL_PATH, device_map="auto")

message = [{"role": "user", "content": "Let a, b be positive real numbers such that ab = a + b + 3. Determine the range of possible values for a + b."}]

inputs = tokenizer.apply_chat_template(
    message,
    return_tensors="pt",
    add_generation_prompt=True,
    return_dict=True,
).to(model.device)

generate_kwargs = {
    "input_ids": inputs["input_ids"],
    "attention_mask": inputs["attention_mask"],
    "max_new_tokens": 4096,
    "do_sample": False,
}
out = model.generate(**generate_kwargs)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Citations

If you find our work useful, please consider citing the following paper.

@misc{glm2024chatglm,
      title={ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools}, 
      author={Team GLM and Aohan Zeng and Bin Xu and Bowen Wang and Chenhui Zhang and Da Yin and Diego Rojas and Guanyu Feng and Hanlin Zhao and Hanyu Lai and Hao Yu and Hongning Wang and Jiadai Sun and Jiajie Zhang and Jiale Cheng and Jiayi Gui and Jie Tang and Jing Zhang and Juanzi Li and Lei Zhao and Lindong Wu and Lucen Zhong and Mingdao Liu and Minlie Huang and Peng Zhang and Qinkai Zheng and Rui Lu and Shuaiqi Duan and Shudan Zhang and Shulin Cao and Shuxun Yang and Weng Lam Tam and Wenyi Zhao and Xiao Liu and Xiao Xia and Xiaohan Zhang and Xiaotao Gu and Xin Lv and Xinghan Liu and Xinyi Liu and Xinyue Yang and Xixuan Song and Xunkai Zhang and Yifan An and Yifan Xu and Yilin Niu and Yuantao Yang and Yueyan Li and Yushi Bai and Yuxiao Dong and Zehan Qi and Zhaoyu Wang and Zhen Yang and Zhengxiao Du and Zhenyu Hou and Zihan Wang},
      year={2024},
      eprint={2406.12793},
      archivePrefix={arXiv},
      primaryClass={id='cs.CL' full_name='Computation and Language' is_active=True alt_name='cmp-lg' in_archive='cs' is_general=False description='Covers natural language processing. Roughly includes material in ACM Subject Class I.2.7. Note that work on artificial languages (programming languages, logics, formal systems) that does not explicitly address natural-language issues broadly construed (natural-language processing, computational linguistics, speech, text retrieval, etc.) is not appropriate for this area.'}
}