玩模型开放模型 · 清晰来源 · 自主选择
返回模型目录
alonsoko /

gemma-4-31b-it-abliterated-heretic-AWQ-W4A16

HF 源站

alonsoko/gemma-4-31b-it-abliterated-heretic-AWQ-W4A16 is an uncensored open-source model hosted on Hugging Face.

Image-Text-to-TextvLLMsafetensorsLicense: apache-2.031Btransformersgemma4gemmagemma-4multimodalvision-languageabliteratedhereticarauncensoreddecensoredawqw4a16quantizedcompressed-tensorsconversational
README.md说明 / 使用方法

license: apache-2.0 license_link: https://ai.google.dev/gemma/docs/gemma_4_license pipeline_tag: image-text-to-text library_name: transformers base_model: trohrbaugh/gemma-4-31b-it-heretic-ara base_model_relation: quantized tags:

  • gemma
  • gemma-4
  • multimodal
  • vision-language
  • abliterated
  • heretic
  • ara
  • uncensored
  • decensored
  • awq
  • w4a16
  • quantized
  • compressed-tensors
  • vllm

Gemma-4-31B-it-abliterated-heretic-AWQ-W4A16

trohrbaugh/gemma-4-31b-it-heretic-ara 的 AWQ W4A16(group_size 128,对称)量化版本——该模型是基于 google/gemma-4-31b-it 采用 Heretic-ARA 消除激活(abliterated)的衍生版本。

⚠️ 去审查模型(Decensored model)。 安全防护栏已被刻意移除。 仅供研究与实验使用。请参阅下文的完整免责声明。

量化详情 (Quantization Details)

参数数值
量化方法 (Method)AWQ (Activation-aware Weight Quantization)
方案 (Scheme)W4A16 (symmetric)
权重位数 (Weight Bits)4
激活位数 (Activation Bits)16
分组大小 (Group Size)128
格式 (Format)compressed-tensors
校准数据集 (Calibration Dataset)HuggingFaceH4/ultrachat_200k
校准样本数 (Calibration Samples)256
最大序列长度 (Max Sequence Length)2048
视觉塔 (Vision Tower)未量化(全精度)
LM Head未量化(全精度)
兼容推理引擎 (Compatible Inference Engine)vLLM ( llm/vllm-openai:gemma4)

量化说明 (Quantization Notes)

  • 所有多模态通路保持全精度:视觉塔(Vision tower)、音频塔、视频塔、多模态投影层(multi-modal projector)以及所有模态特定的嵌入和投影层均不参与量化。仅对语言模型的线性层(注意力机制的 Q/K/V/O 以及 MLP 的 gate/up/down)进行量化。
  • LM head 保持未量化:这是行业标准做法,仅需微不足道的显存占用即可保留输出 token 分布质量。
  • 跳过 v_proj → o_proj 平滑:llm-compressor 提示在该权重检查点上,Gemma 4 的许多解码器块中 _proj → o_proj 存在不兼容的平衡层维度。因此该通路跳过了逐通道平滑处理,这与 GQA 的标准 AWQ 处理模式一致。
  • 混合注意力与上下文窗口保持不变:量化仅修改 Linear 层的权重;Gemma 4 的交错局部/全局注意力机制架构和 256K 上下文容量在结构上得以完整保留。不过 4-bit 下的实际长上下文质量尚未进行基准测试。
  • 多模态输入完好无损:文本 + 图像输入与基座模型保持一致。请使用标准的 Gemma 4 聊天模板,将图像 token 置于文本之前。
  • 完整量化配方 保存在本仓库的 ecipe.yaml 中以确保可复现性。其中记录了所应用的精确 AWQ 映射、忽略模式及方案参数。

部署 (Deployment)

推荐使用 vLLM 进行推理(Gemma 4 需要 llm/vllm-openai:gemma4 镜像):

ash vllm serve alonsoko/gemma-4-31b-it-abliterated-heretic-AWQ-W4A16 \ --trust-remote-code \ --tensor-parallel-size 1 \ --max-model-len 32768

推荐采样参数(基于上游 Gemma 4 指南): emperature=1.0, top_p=0.95, top_k=64

如需启用思考模式(thinking mode),请在系统提示词开头添加 <|think|> token。

硬件要求 (Hardware Requirements)

该量化版本(W4A16-G128)推理所需的大致显存(VRAM):

  • 权重(量化后的语言模型 + 未量化的视觉塔,全部打包在单个 safetensors 中):~19 GB
  • KV 缓存(按每次请求计算,随上下文长度增加):在 32K 上下文下约为 1-4 GB,更长上下文则需要更多显存
  • 推荐配置:单张 24 GB 显卡(RTX 3090/4090、A10G)适用于最高 ~32K 的标准上下文;或单张 48 GB 显卡(L40S/A6000)用于长上下文 / 批量并发服务
  • 超长上下文(128K+):由于 KV 缓存显著增长,建议配置 48-80 GB 显存

⚠️ 免责声明 (Disclaimer)

本模型仅供研究、实验与测试目的使用。

  • 本模型可能会生成有害、具有冒犯性、不当或在其他方面引起反感的内容。
  • 消除激活(abliteration)过程移除了原始模型中有意内置的安全防护栏。
  • 请勿将此模型用于生产系统、面向消费者的应用程序或任何有害输出可能造成现实危害的场景。
  • 本工具包的作者及贡献者对该模型的任何滥用或该模型生成的输出所造成的任何损害不承担任何责任。
  • 使用本模型即表示您同意:您对确保模型使用符合所有适用法律和伦理准则承担全部责任。

共享本模型纯粹是为了对模型内部机制进行学术和技术探索。

消除激活 (Abliteration)

使用 Heretic v1.2.0+custom 并采用 任意秩消融(Arbitrary-Rank Ablation, ARA) 方法执行。

参数数值
start_layer_index2
end_layer_index60
preserve_good_behavior_weight0.9920
steer_bad_behavior_weight0.0001
overcorrect_relative_weight0.4709
neighbor_count10

性能表现 (Performance)

指标本模型原始模型 google/gemma-4-31b-it
KL 散度 (KL divergence)0.01200 (按定义)
拒绝率 (Refusals)5/10098/100

在未量化的 heretic-ara 基座上测得;AWQ 预计将高度保持这些特性,但尚未进行单独基准测试。


关于基座模型 (About the Base Model)

原始模型:google/gemma-4-31b-it

Gemma 4 31B 是一款稠密多模态模型(文本 + 图像输入,文本输出),具有 256K 上下文窗口,原生支持思考模式、函数调用(function calling),并在推理、编程和视觉基准测试中表现出色。有关架构细节、基准测试结果、训练数据以及 Google 的负责任使用指南,请参阅基座模型卡片。

源站原文

license: apache-2.0 license_link: https://ai.google.dev/gemma/docs/gemma_4_license pipeline_tag: image-text-to-text library_name: transformers base_model: trohrbaugh/gemma-4-31b-it-heretic-ara base_model_relation: quantized tags:

  • gemma
  • gemma-4
  • multimodal
  • vision-language
  • abliterated
  • heretic
  • ara
  • uncensored
  • decensored
  • awq
  • w4a16
  • quantized
  • compressed-tensors
  • vllm

Gemma-4-31B-it-abliterated-heretic-AWQ-W4A16

AWQ W4A16 (group_size 128, symmetric) quantization of trohrbaugh/gemma-4-31b-it-heretic-ara — a Heretic-ARA abliterated derivative of google/gemma-4-31b-it.

⚠️ Decensored model. Safety guardrails have been deliberately removed. Research and experimentation only. See full disclaimer below.

Quantization Details

ParameterValue
MethodAWQ (Activation-aware Weight Quantization)
SchemeW4A16 (symmetric)
Weight Bits4
Activation Bits16
Group Size128
Formatcompressed-tensors
Calibration DatasetHuggingFaceH4/ultrachat_200k
Calibration Samples256
Max Sequence Length2048
Vision TowerUnquantized (full precision)
LM HeadUnquantized (full precision)
Compatible Inference EnginevLLM (vllm/vllm-openai:gemma4)

Quantization Notes

  • All multimodal paths kept full precision: Vision tower, audio tower, video tower, multi-modal projector, and all modality-specific embedding and projection layers are excluded from quantization. Only language-model linear layers (attention Q/K/V/O and MLP gate/up/down) are quantized.
  • LM head unquantized: Standard practice to preserve output token distribution quality at negligible size cost.
  • v_proj → o_proj smoothing skipped: llm-compressor reports incompatible balance layer dimensions for v_proj → o_proj on this checkpoint across many of Gemma 4's decoder blocks. Per-channel smoothing is skipped for that path, matching the standard AWQ-for-GQA pattern.
  • Hybrid attention and context window unchanged: Quantization only touches Linear layer weights; Gemma 4's interleaved local/global attention pattern and 256K context capacity are structurally preserved. Actual long-context quality at 4-bit has not been benchmarked.
  • Multimodal input intact: Text + image input works as in the base model. Use the standard Gemma 4 chat template with image tokens placed before text.
  • Full quantization recipe is preserved in recipe.yaml in this repo for reproducibility. It records the exact AWQ mappings, ignore patterns, and scheme parameters applied.

Deployment

Recommended inference with vLLM (Gemma 4 requires the vllm/vllm-openai:gemma4 image):

vllm serve alonsoko/gemma-4-31b-it-abliterated-heretic-AWQ-W4A16 \
    --trust-remote-code \
    --tensor-parallel-size 1 \
    --max-model-len 32768

Recommended sampling (per upstream Gemma 4 guidance): temperature=1.0, top_p=0.95, top_k=64

To enable thinking mode, include the <|think|> token at the start of the system prompt.

Hardware Requirements

Approximate VRAM for inference at this quantization (W4A16-G128):

  • Weights (quantized language model + unquantized vision tower, all in one safetensors): ~19 GB
  • KV cache (per request, grows with context length): ~1-4 GB at 32K context, more at longer contexts
  • Recommended: Single 24 GB GPU (RTX 3090/4090, A10G) for standard context up to ~32K, or single 48 GB GPU (L40S/A6000) for long context / batch serving
  • Long context (128K+): 48-80 GB recommended due to KV cache growth

⚠️ Disclaimer

This model is intended for research, experimentation, and testing purposes only.

  • This model may produce harmful, offensive, inappropriate, or otherwise objectionable content.
  • The abliteration process removes safety guardrails that were intentionally built into the original model.
  • Do not use this model in production systems, consumer-facing applications, or any context where harmful outputs could cause real-world harm.
  • The authors and contributors of this toolkit bear no responsibility for any misuse of this model or any harm caused by outputs generated by this model.
  • By using this model, you agree that you are solely responsible for ensuring its use complies with all applicable laws and ethical guidelines.

This model is shared purely for academic and technical exploration of model internals.

Abliteration

Performed with Heretic v1.2.0+custom using the Arbitrary-Rank Ablation (ARA) method.

ParameterValue
start_layer_index2
end_layer_index60
preserve_good_behavior_weight0.9920
steer_bad_behavior_weight0.0001
overcorrect_relative_weight0.4709
neighbor_count10

Performance

MetricThis modelOriginal google/gemma-4-31b-it
KL divergence0.01200 (by definition)
Refusals5/10098/100

Measured on the unquantized heretic-ara base; AWQ is expected to preserve these closely but has not been separately benchmarked.


About the Base Model

Original model: google/gemma-4-31b-it

Gemma 4 31B is a dense multimodal model (text + image input, text output) with a 256K context window, native thinking-mode support, function calling, and strong performance on reasoning, coding, and vision benchmarks. See the base model card for architectural details, benchmark results, training data, and Google's responsible-use guidance.

HUGGING FACE

上游数据

HF 下载量14.6万
HF 点赞量14

HF 下载量为源站最近 30 天统计,与本站点击分开。

SITE STATS

本站统计

下载点击—
请求数—
匿名去重—最近 7 天—

本站下载量记录按钮点击,不代表下载完成;短时连点会去重。

来源与版本

作者
alonsoko
最近更新
2026/05/17
最新创建
2026/04/06
HF 趋势
未知
数据快照
2026/09/17
版本
未知
许可证
apache-2.0