Qwen3.8-27B-Uncensored-MLX:消融对齐的混合线性注意力视觉语言模型,2/4/6/8-bit Apple Silicon 本地运行
qwen3-8-27b-uncensored-mlx-abliterated-gated-deltanet-vision
by Mycelium Protocol
HuggingFace:orcarouter/Qwen3.8-27B-Uncensored-MLX
发布方:OrcaRouter(orcarouter.ai)
基础模型:Qwen/Qwen3.8-27B
许可证:Apache 2.0
Likes:672 · Trending Score:561
⚠️ 用途声明
这个模型的安全对齐已通过 abliteration(消融)技术实质性移除。它专为 AI 安全研究、拒绝机制研究、red-teaming 和鲁棒性评估设计,不适合直接面向终端用户部署。本文从技术和研究角度介绍其架构、量化方案和使用方法。
一、基础架构:Qwen3.8-27B 的混合注意力设计
Qwen3.8-27B(Qwen3_5ForConditionalGeneration)是一个 27B 参数的密集模型,核心架构亮点是混合注意力:
| 组件 | 规格 |
|---|---|
| 层数 | 64 层 |
| 隐藏维度 | 5120 |
| 注意力策略 | 48 层 Gated DeltaNet 线性注意力 + 每 4 层一个全注意力(共 16 个全注意力层) |
| 上下文长度 | 262,144 tokens |
| 视觉塔 | 原生集成(非后加) |
| 额外头 | MTP(Multi-Token Prediction)头 |
| 其他能力 | 思维链控制(thinking control)、工具调用 |
Gated DeltaNet 是线性注意力的一种变体,通过门控机制和 delta 规则更新来近似全注意力的效果,计算复杂度线性而非二次。混合策略(48 线性 + 16 全注意力,间隔 4 层)在效率和质量之间取得平衡——线性层处理长上下文,全注意力层在关键位置保持精确的注意力计算。
二、Abliteration:移除拒绝方向
Abliteration 是一种 AI 安全研究技术,通过找到模型残差流中的「拒绝方向」(refusal direction)向量并将其正交化移除,从而消除模型的拒绝行为,而不影响其他能力。
这与 RLHF/DPO 微调完全不同:它是在权重空间直接做向量操作,不需要额外训练数据,只需要少量正/反向提示对来定位拒绝方向。
对于研究者,abliterated 模型有以下价值:
- 拒绝机制研究:对比有无对齐的模型行为,理解拒绝是如何在模型内部实现的
- Red-teaming:测试内容过滤系统、安全层和防护机制的鲁棒性
- 可解释性:研究 safety alignment 在权重空间的表示
三、四个量化精度
OrcaRouter 从同一个消融后的 BF16 源权重出发,提供了四个 MLX 量化版本(affine 量化,group size 64):
| 精度 | 每权重位数 | 磁盘大小 | 最低 Mac 内存 | 质量 |
|---|---|---|---|---|
8-bit/ | 8.627 | ~27.5 GB | 32 GB | 接近无损,推荐高质量场景 |
6-bit/ | 6.661 | ~22 GB | 24–32 GB | 优秀,质量/体积最佳平衡 |
4-bit/ | 4.695 | ~15 GB | 24 GB | 很好,默认推荐 |
2-bit/ | 2.729 | ~8.7 GB | 16 GB | ⚠️ 严重退化,仅存档用途 |
重要:2-bit 在 27B 规模下质量严重崩溃(重复循环、乱码输出),不建议用于实际工作。
仓库根目录 = 4-bit 版本,所以 --model orcarouter/Qwen3.8-27B-Uncensored-MLX 直接加载 4-bit,无需指定子文件夹。其他精度需要指定子路径(如 8-bit/)。
量化策略:语言模型线性层(含 embed_tokens 和 lm_head)做量化;视觉塔、所有 norm 层、线性注意力的 conv1d 层保持 BF16。这意味着视觉能力不受量化降级影响。
四、数值验证结果
| 精度 | 余弦相似度 | 文本/中文/代码 | 拒绝探针 | 视觉 |
|---|---|---|---|---|
| 8-bit | 0.9997 | ✅ | ✅ 0 次拒绝 | ✅ |
| 6-bit | 0.9996 | ✅ | ✅ 0 次拒绝 | ✅ |
| 4-bit | 0.996 | ✅ | ✅ 0 次拒绝 | ✅ |
| 2-bit | 0.92 | ⚠️ 崩溃 | ⚠️ 乱码(非拒绝) | 部分 |
速度:在单张 H200 上约 32–37 tok/s(MLX CUDA 后端,非 Apple Silicon 原生)。
五、Apple Silicon 使用
命令行(mlx-vlm)
pip install -U mlx-vlm # 需要 mlx-vlm >= 0.6.13, mlx >= 0.32
# 下载 4-bit 版本
hf download orcarouter/Qwen3.8-27B-Uncensored-MLX \
--include "4-bit/*" \
--local-dir ./Qwen3.8-27B-Uncensored-MLX
# 纯文本推理
python -m mlx_vlm generate \
--model ./Qwen3.8-27B-Uncensored-MLX/4-bit \
--prompt "Explain quantum entanglement." --max-tokens 256
# 视觉+文本
python -m mlx_vlm generate \
--model ./Qwen3.8-27B-Uncensored-MLX/4-bit \
--image path/to/image.png \
--prompt "Describe this image." --max-tokens 256
# OpenAI 兼容 API 服务
python -m mlx_vlm server \
--model ./Qwen3.8-27B-Uncensored-MLX/4-bit --port 8080
Apple Silicon 上 Metal 后端自动启用,无需 CUDA 配置。
LM Studio
直接搜索 orcarouter/Qwen3.8-27B-Uncensored-MLX。三个注意点:
- 这个仓库需要 HuggingFace token:在 LM Studio 设置 → Integrations → Hugging Face 里粘贴 read token
- 关闭 KV cache 量化:此架构不支持(mlx-engine#286),否则初始化报错
- 选对精度:32GB Mac 选 4-bit(~16GB),48GB Mac 选 6-bit,64GB Mac 选 8-bit
六、架构意义
Qwen3.8-27B 的混合 Gated DeltaNet 架构代表了 2026 年主流趋势之一:线性注意力 + 全注意力的混合(类似 Mamba2-Transformer、RWKV-Hybrid 等路线)。
与纯 Transformer 相比,优势在于:
- 长上下文处理效率更高(线性注意力部分)
- 关键位置精度有保证(全注意力层每 4 层插入一次)
- 262K token 上下文下内存压力更小
对于 AI 安全研究者,这个架构也提供了一个研究问题:safety alignment 在线性注意力层和全注意力层的分布是否不同?消融操作是否对两种层类型有不同的效果?
Qwen3.8-27B-Uncensored-MLX 是对 Qwen 最新混合架构模型的 Apple Silicon 量化打包,672 likes 的热度反映了研究社区对这类工具的持续需求——在本地 Mac 上运行一个完整的、无限制的 27B 视觉语言模型,用于安全研究和 red-teaming。
Mycelium Protocol — 追踪 AI 系统的底层演化
关于 Mycelium
菌丝协议。持续追踪 AI 工具、系统和实验的内容节点。
Qwen3.8-27B-Uncensored-MLX: Abliterated Hybrid Linear-Attention VLM, 2/4/6/8-bit for Apple Silicon
by Mycelium Protocol
HuggingFace: orcarouter/Qwen3.8-27B-Uncensored-MLX
Publisher: OrcaRouter (orcarouter.ai)
Base model: Qwen/Qwen3.8-27B
License: Apache 2.0
Likes: 672 · Trending Score: 561
⚠️ Intended use
Safety alignment has been substantially removed via abliteration. This model is intended for AI safety research, refusal-mechanism study, red-teaming, and robustness evaluation. Not suitable for deployment to end users without your own moderation layer.
Architecture: Hybrid Gated DeltaNet
Qwen3.8-27B (Qwen3_5ForConditionalGeneration) is a 27B-parameter dense model with a hybrid attention architecture:
| Component | Spec |
|---|---|
| Layers | 64 |
| Hidden dim | 5120 |
| Attention | 48 Gated DeltaNet linear layers + 1 full attention every 4 layers (16 total) |
| Context | 262,144 tokens |
| Vision | Native VL tower |
| Extra | MTP (Multi-Token Prediction) head, thinking control, tool-calling |
Gated DeltaNet is a linear attention variant that approximates full attention via gated delta-rule updates, with linear rather than quadratic complexity. The hybrid strategy (48 linear + 16 full attention, interval 4) balances efficiency with precision: linear layers handle long-context throughput, full-attention layers maintain exact attention at key positions.
Abliteration: Removing the Refusal Direction
Abliteration identifies the “refusal direction” vector in the model’s residual stream and orthogonalizes it out, removing refusal behavior without affecting other capabilities. Unlike RLHF/DPO fine-tuning, this is a direct weight-space operation requiring no additional training data — only a small set of positive/negative prompt pairs to locate the refusal direction.
Research value:
- Refusal mechanism study: compare behavior with and without alignment to understand how refusal is implemented internally
- Red-teaming: stress-test content filters, safety layers, and moderation systems
- Interpretability: study how safety alignment is represented in weight space
Four Quantization Precisions
All four builds start from the same abliterated BF16 source. MLX affine quantization, group size 64. Vision tower, norms, and conv1d layers kept in BF16.
| Precision | Size | Min Mac RAM | Quality |
|---|---|---|---|
| 8-bit | ~27.5 GB | 32 GB | Near-lossless |
| 6-bit | ~22 GB | 24–32 GB | Excellent quality/size balance |
| 4-bit | ~15 GB | 24 GB | Very good — recommended default |
| 2-bit | ~8.7 GB | 16 GB | ⚠️ Severely degraded — archival only |
Repo root = 4-bit copy, so --model orcarouter/Qwen3.8-27B-Uncensored-MLX loads 4-bit directly.
Verification (cosine similarity vs. BF16 source): 8-bit → 0.9997, 6-bit → 0.9996, 4-bit → 0.996, 2-bit → 0.92 (generation breaks down). All 4/6/8-bit builds return zero refusals on red-team probes; vision preserved on all three. Speed: ~32–37 tok/s on H200 (MLX CUDA backend).
Usage on Apple Silicon
pip install -U mlx-vlm # requires mlx-vlm >= 0.6.13
# Download 4-bit
hf download orcarouter/Qwen3.8-27B-Uncensored-MLX \
--include "4-bit/*" --local-dir ./Qwen3.8-27B-Uncensored-MLX
# Text
python -m mlx_vlm generate \
--model ./Qwen3.8-27B-Uncensored-MLX/4-bit \
--prompt "Explain quantum entanglement." --max-tokens 256
# Vision
python -m mlx_vlm generate \
--model ./Qwen3.8-27B-Uncensored-MLX/4-bit \
--image path/to/image.png \
--prompt "Describe this image." --max-tokens 256
# OpenAI-compatible server
python -m mlx_vlm server \
--model ./Qwen3.8-27B-Uncensored-MLX/4-bit --port 8080
Metal backend activates automatically on Apple Silicon.
LM Studio: Search the model name directly. Three requirements: set a HF read token (repo is gated), disable KV cache quantization (mlx-engine#286), pick the right precision for your RAM (4-bit for 32 GB Mac, 6-bit for 48 GB, 8-bit for 64 GB).
Why Hybrid Linear Attention Matters
The Gated DeltaNet hybrid architecture represents a mainstream 2026 direction: mixing linear and full attention (similar to Mamba2-Transformer, RWKV-Hybrid). Over pure Transformers, advantages include: higher efficiency on long contexts (linear attention handles throughput), precise attention at critical positions (full attention every 4 layers), and lower memory pressure at 262K token contexts.
For AI safety researchers, this architecture raises an open question: is safety alignment distributed differently across linear vs. full-attention layers? Does abliteration have different effects on each layer type?
The 672 likes and trending status reflect sustained demand: running a full 27B uncensored VLM locally on a Mac for safety research and red-teaming.
Mycelium Protocol — tracking the deep evolution of AI systems
© 2026 Mycelium Protocol. All rights reserved.
关于本站 · 免责声明
🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。
⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.
- 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
- 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
- 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
- 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。
📮 侵权 / 勘误 / 合作咨询:hello@mushroom.cv
💬 评论与讨论
使用 GitHub 账号登录后发表评论