GCSA-AiLab commited on
Commit
9de2b7e
·
verified ·
1 Parent(s): adc790c

整理模型说明并新增七语言独立页面

Browse files

简短主页、七语言介绍与使用说明,以及独立中英文技术附页。同步修正当前下载链接,保留历史评测数据、被测版本和局限;只修改 Markdown 文档。

Files changed (10) hide show
  1. README.md +12 -381
  2. docs/en.md +59 -0
  3. docs/fr.md +59 -0
  4. docs/ja.md +59 -0
  5. docs/ko.md +59 -0
  6. docs/pt.md +59 -0
  7. docs/technical-en.md +200 -0
  8. docs/technical-zh-CN.md +202 -0
  9. docs/zh-CN.md +59 -0
  10. docs/zh-TW.md +59 -0
README.md CHANGED
@@ -9,396 +9,27 @@ tags:
9
  - MLX
10
  - LoRA
11
  ---
12
- # GLM-5.3-Flash-Abliterixed-LoRA-MLX
13
 
14
- > Two refusal-direction ablation LoRA variants for GLM-5.3-Flash.
15
 
16
- This repository contains **LoRA adapter weights only**. Both adapters were derived from [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash) with [Abliterix](https://github.com/wuwangzhang1216/abliterix) to reduce refusal behavior while leaving the base checkpoint unchanged. Version 1 applies the stronger, later-layer intervention; version 2 redistributes the routed-expert edits toward earlier and middle layers and produces substantially lower KL divergence from the deployed NVFP4 base.
17
 
18
- The adapters are intended for controlled safety research, red-teaming, and refusal-mechanism analysis. Removing refusal behavior also removes an important safety layer; read the [Disclaimer](#disclaimer) before use.
19
 
20
- ## Repository contents
21
 
22
- ```text
23
- .
24
- ├── README.md
25
- ├── v1/
26
- │ ├── adapter_config.json
27
- │ └── adapters.safetensors
28
- └── v2/
29
- ├── adapter_config.json
30
- └── adapters.safetensors
31
- ```
32
 
33
- - `v1/` contains the original adapter corresponding to `GLM-5.3-Flash-Ablitered`.
34
- - `v2/` contains the second adapter corresponding to `GLM-5.3-Flash-Ablitered2`.
35
- - Each directory is a self-contained MLX-LM adapter. This repository does not contain the GLM-5.3-Flash base weights or merged checkpoints.
36
 
37
- ## Adapter summary
38
 
39
- | Item | v1 | v2 |
40
- |---|---|---|
41
- | Repository path | `v1/` | `v2/` |
42
- | Base model | [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash) | Same model family; exported config records an FP8 source path |
43
- | Format | MLX-LM LoRA (`adapters.safetensors`) | MLX-LM LoRA (`adapters.safetensors`) |
44
- | Rank / alpha | `r=1`, `lora_alpha=1` | `r=1`, `lora_alpha=1` |
45
- | Dropout / bias | `0.0` / `none` | `0.0` / `none` |
46
- | Effective edited layer range | Layers 15–44 | Layers 3–44 |
47
- | Routed-expert `down_proj` range | Layers 18–44 | Layers 3–28 |
48
- | Main effective target | Routed-expert `down_proj` | Routed-expert `down_proj` |
49
- | Evaluation base | [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4) | Same |
50
 
51
- ## What is abliteration?
52
 
53
- Abliteration is a weight-space intervention inspired by Arditi et al., [*Refusal in Language Models Is Mediated by a Single Direction*](https://arxiv.org/abs/2406.11717). In simplified form, a refusal direction is estimated from the difference between internal activations elicited by harmful and harmless prompts. Components of selected writer matrices that contribute to that direction are then removed. A rank-1 update can be represented as:
54
 
55
- ```text
56
- W' = W + ΔW, ΔW = BA, rank(ΔW) = 1
57
- ```
58
 
59
- Storing `ΔW` as a LoRA adapter means the original model checkpoint is not rewritten and the intervention can be enabled or removed at serving time.
60
-
61
- ### Why routed-expert `down_proj`?
62
-
63
- The analysis published with [orcarouter/GLM-5.3-Flash-Uncensored-FP8](https://huggingface.co/orcarouter/GLM-5.3-Flash-Uncensored-FP8#abliteration) identifies the routed-expert MLP `down_proj` writers as the dominant intervention point for GLM-5.3-Flash refusal behavior. Its component study reports that attention-only and dense/shared-MLP interventions retain most refusal behavior, whereas adding routed-expert MLP writers causes the major reduction.
64
-
65
- Our layer-restricted experiments agreed with that mechanism-level result: the causally useful refusal directions were found in the earlier-to-middle part of the expert stack, while modifications restricted to the later expert layers had almost no practical effect on refusal. Accordingly, the routed-expert `down_proj` modules are the main effective target in this adapter.
66
-
67
- This statement concerns **causal intervention effectiveness**, not the numerical magnitude of every stored LoRA tensor. Adapter coverage and tensor norm alone do not establish where a behavior is represented.
68
-
69
- This adapter instead uses Abliterix's **SRA + mean + per-layer** workflow:
70
-
71
- - **Mean base estimator:** harmful-versus-harmless mean activation differences provide the initial direction estimate.
72
- - **SRA:** the initial refusal signal is spectrally cleaned/residualized against protected benign-capability components, reducing unwanted removal of overlapping capabilities.
73
- - **Per-layer estimation:** each edited layer receives its own estimated direction; a single layer-22 vector is not reused across the entire model.
74
-
75
- Per-layer estimation is important here because the refusal signal is not equally useful at every depth, and late-layer-only interventions were ineffective in our experiments.
76
-
77
- ## LoRA weight distribution
78
-
79
- The following figures were obtained by inspecting the source PEFT `adapter_config.json` and `adapter_model.safetensors` files before MLX conversion. “Effective” means that the resulting rank-1 LoRA delta is non-zero.
80
-
81
- ### Effective non-zero edits
82
-
83
- | Module | v1 layer coverage | v1 modules | v2 layer coverage | v2 modules |
84
- |---|---:|---:|---:|---:|
85
- | Routed-expert `down_proj` | 18–44 | 7,776 | 3–28 | 7,488 |
86
- | Shared-expert `down_proj` | 18–44 | 27 | 18–44 | 27 |
87
- | Self-attention `o_proj` | 15–44 | 30 | 15–44 | 30 |
88
- | **Total effective modules** | **15–44** | **7,833** | **3–44** | **7,545** |
89
-
90
- | Storage statistic | v1 | v2 |
91
- |---|---:|---:|
92
- | BF16 tensors | 46,770 | 45,042 |
93
- | Rank-1 module entries | 23,385 | 22,521 |
94
- | Serialized scalars | 143,927,296 | 138,618,880 |
95
- | Non-zero scalars | 48,375,808 | 46,606,336 |
96
- | Source PEFT safetensors size | 281.6 MiB | 271.2 MiB |
97
-
98
- Both PEFT configurations list `down_proj`, `gate_proj`, `o_proj`, and `up_proj` as target modules. In both checkpoints, the stored `gate_proj` and `up_proj` factors are structural zero entries and do not alter model output. The effective changes are therefore routed/shared-expert `down_proj` and attention `o_proj` updates.
99
-
100
- The main difference is depth allocation:
101
-
102
- - **v1:** layers 0–14 are unchanged; layers 15–17 modify attention `o_proj` only; layers 18–44 modify attention `o_proj`, all 288 routed-expert `down_proj` modules, and the shared-expert `down_proj`.
103
- - **v2:** layers 0–2 are unchanged; layers 3–14 modify all 288 routed-expert `down_proj` modules; layers 15–17 add attention `o_proj`; layers 18–28 also add the shared-expert `down_proj`; layers 29–44 retain only attention and shared-expert edits.
104
-
105
- In other words, v1 concentrates the expert intervention in the later 27 layers, while v2 shifts it to the earlier-to-middle expert stack and removes routed-expert edits from layers 29–44.
106
-
107
- ## Evaluation
108
-
109
- Both adapters were evaluated while attached separately to [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4). The tested deployment used vLLM, explicitly selected low reasoning effort for the target model, and passed only the target model's final answer—not its private reasoning—to the judge.
110
-
111
- The automated judge was **`deepseek-v4-flash` through the Ollama Cloud API**, with judge thinking disabled. These results are automated estimates, not human safety certification.
112
-
113
- ### Overall results
114
-
115
- | Benchmark / metric | n | v1 | v2 |
116
- |---|---:|---:|---:|
117
- | SimpleSafetyTests full refusal | 100 | **1.00%** | 5.00% |
118
- | SimpleSafetyTests partial refusal | 100 | 13.00% | 14.00% |
119
- | SimpleSafetyTests warning rate | 100 | 90.00% | 94.00% |
120
- | StrongREJECT rubric mean | 180 | 0.953472 | **0.972222** |
121
- | StrongREJECT refusal rate | 180 | 3.33% | **1.67%** |
122
- | StrongREJECT warning rate | 180 | 82.22% | 83.33% |
123
-
124
- For SimpleSafetyTests, the primary result is the holistic safe/unsafe classification; refusal-style labels are auxiliary diagnostics. For StrongREJECT, a higher rubric score means that the response gave more useful and specific assistance toward the harmful request; it therefore indicates **weaker safety refusal**, not higher general model quality. The string-matching baseline is reported for traceability and is not interchangeable with the LLM-judge rubric.
125
-
126
- ### KL divergence from the NVFP4 base
127
-
128
- KL was measured on 100 prompts from `mlabonne/harmless_alpaca` (`test[:100]`) using the Abliterix next-token method: top-100 log probabilities, one scored token per prompt, and `KL(base || adapter)` after Abliterix's finite-value normalization.
129
-
130
- | Adapter | Mean KL | Population std. dev. | Minimum | Maximum |
131
- |---|---:|---:|---:|---:|
132
- | v1 | 0.067696 | 0.288671 | 0.000150 | 2.691505 |
133
- | v2 | **0.011077** | **0.042988** | **0.000021** | **0.379621** |
134
-
135
- v2's mean KL is approximately **16.36% of v1's**, or about **6.1× lower**. Under this measurement, v2 preserves the NVFP4 base model's benign next-token distribution substantially better.
136
-
137
- ### Which version should I use?
138
-
139
- - Choose **v1** when the priority is the more aggressive refusal reduction observed on SimpleSafetyTests: 1% full refusal and 86% no-refusal responses. This comes with materially higher distribution drift.
140
- - Choose **v2** when preserving base-model behavior is the priority. Its KL is about 6.1× lower, its SST safe rate is higher, and it still achieved the lower refusal rate and higher harmful-assistance rubric score on StrongREJECT.
141
- - There is no universally “less refusing” version across every benchmark: v1 has the lower SST full-refusal rate, while v2 has the lower StrongREJECT refusal rate.
142
-
143
- ### StrongREJECT category comparison
144
-
145
- | Category | n | v1 score | v2 score | v1 refusal | v2 refusal | v1 warning | v2 warning |
146
- |---|---:|---:|---:|---:|---:|---:|---:|
147
- | Disinformation and deception | 30 | 0.895833 | 0.920833 | 10.00% | 6.67% | 80.00% | 83.33% |
148
- | Hate, harassment, and discrimination | 30 | 0.908333 | 0.941667 | 6.67% | 3.33% | 60.00% | 56.67% |
149
- | Illegal goods and services | 30 | 1.000000 | 1.000000 | 0.00% | 0.00% | 96.67% | 96.67% |
150
- | Non-violent crimes | 30 | 0.954167 | 0.983333 | 3.33% | 0.00% | 93.33% | 96.67% |
151
- | Sexual content | 30 | 0.962500 | 0.995833 | 0.00% | 0.00% | 80.00% | 83.33% |
152
- | Violence | 30 | 1.000000 | 0.991667 | 0.00% | 0.00% | 83.33% | 83.33% |
153
-
154
- ### Warning rate is not refusal rate
155
-
156
- A warning, caveat, legal note, or safety disclaimer was counted separately from refusal. If a response warned about risk but still provided request-relevant content, it was **not** counted as a refusal on that basis. Consequently, a high warning rate can coexist with a low refusal rate.
157
-
158
- ## Usage
159
-
160
- This repository does not include the base model. Provide a compatible MLX conversion of GLM-5.3-Flash separately and comply with its license and terms.
161
-
162
- ### MLX-LM command line
163
-
164
- Install MLX-LM on Apple Silicon, then select either `v1` or `v2` with `--adapter-path`:
165
-
166
- ```bash
167
- pip install -U mlx-lm
168
-
169
- mlx_lm.generate \
170
- --model /path/to/GLM-5.3-Flash-MLX \
171
- --adapter-path /path/to/repository/v2 \
172
- --prompt "Hello"
173
- ```
174
-
175
- To run v1, replace the adapter path with `/path/to/repository/v1`.
176
-
177
- ### Python
178
-
179
- ```python
180
- from mlx_lm import generate, load
181
-
182
- model, tokenizer = load(
183
- "/path/to/GLM-5.3-Flash-MLX",
184
- adapter_path="/path/to/repository/v2", # Or /v1
185
- )
186
-
187
- response = generate(model, tokenizer, prompt="Hello", max_tokens=512)
188
- print(response)
189
- ```
190
-
191
- Use an MLX-LM build and base-model conversion that support the GLM-5.3 MoE architecture and the expert module names recorded in `adapter_config.json`. The adapter directory—not the `adapters.safetensors` file alone—must be passed to `--adapter-path` or `adapter_path`.
192
-
193
- ## Limitations
194
-
195
- - Abliteration changes refusal behavior; it does not guarantee correctness, harmlessness, honesty, or improved task capability.
196
- - The intervention does not prove that all safety behavior is encoded by one direction or one module family.
197
- - Residual refusals may remain, and later fine-tuning, merging, quantization, or serving changes may strengthen or weaken the effect.
198
- - Automated judge labels can contain false positives and false negatives. Warning rate is not a safety score.
199
- - Results are specific to the stated base checkpoint, prompts, sampling configuration, runtime, and judge model.
200
-
201
- ## Disclaimer
202
-
203
- This adapter is released solely for legitimate research, safety evaluation, red-teaming, and other lawful uses. It intentionally weakens refusal behavior and may cause the base model to produce dangerous, illegal, hateful, sexually explicit, deceptive, or otherwise harmful content. Do not expose it to untrusted users or deploy it without appropriate access control, monitoring, content filtering, rate limits, and human oversight.
204
-
205
- You are responsible for complying with applicable laws, regulations, platform policies, and the licenses and terms of the base model, quantized checkpoint, Abliterix, and all other dependencies. The authors and distributors make no warranty and accept no responsibility for outputs, downstream use, misuse, damages, or legal consequences arising from this adapter.
206
-
207
- ---
208
-
209
- # GLM-5.3-Flash-Abliterixed-LoRA-MLX
210
-
211
- > 面向 GLM-5.3-Flash 的两版拒绝方向消融 LoRA。
212
-
213
- 本仓库**仅提供 LoRA 适配器权重**。两个版本均以 [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash) 为原始模型,使用 [Abliterix](https://github.com/wuwangzhang1216/abliterix) 对拒绝行为进行消融;基础模型权重本身不会被本仓库替换。v1 的干预更集中于后层,v2 则把路由专家修改前移至前中层,并显著降低了相对 NVFP4 基础模型的 KL 偏移。
214
-
215
- 这些适配器用于受控的安全研究、红队测试和拒绝机制分析。移除拒绝行为也意味着削弱重要的安全防线,使用前请阅读文末的[免责声明](#免责声明)。
216
-
217
- ## 仓库文件结构
218
-
219
- ```text
220
- .
221
- ├── README.md
222
- ├── v1/
223
- │ ├── adapter_config.json
224
- │ └── adapters.safetensors
225
- └── v2/
226
- ├── adapter_config.json
227
- └── adapters.safetensors
228
- ```
229
-
230
- - `v1/`:原始版本,对应 `GLM-5.3-Flash-Ablitered`。
231
- - `v2/`:第二版本,对应 `GLM-5.3-Flash-Ablitered2`。
232
- - 每个目录都是可独立加载的 MLX-LM LoRA。本仓库不包含 GLM-5.3-Flash 基础权重,也不包含合并后的完整模型。
233
-
234
- ## 适配器概要
235
-
236
- | 项目 | v1 | v2 |
237
- |---|---|---|
238
- | 仓库路径 | `v1/` | `v2/` |
239
- | 基础模型 | `zai-org/GLM-5.3-Flash` | 同一模型族 |
240
- | 格式 | MLX-LM LoRA(`adapters.safetensors`) | MLX-LM LoRA(`adapters.safetensors`) |
241
- | 秩 / alpha | `r=1`,`lora_alpha=1` | `r=1`,`lora_alpha=1` |
242
- | Dropout / bias | `0.0` / `none` | `0.0` / `none` |
243
- | 实际修改的层范围 | 第 15–44 层 | 第 3–44 层 |
244
- | 路由专家 `down_proj` 范围 | 第 18–44 层 | 第 3–28 层 |
245
- | 主要有效目标 | 路由专家 `down_proj` | 路由专家 `down_proj` |
246
- | 评测基础模型 | [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4) | 同左 |
247
-
248
- ## 什么是拒绝消融?
249
-
250
- 拒绝消融(abliteration)是一种权重空间干预方法,其思路源自 Arditi 等人的论文 [*Refusal in Language Models Is Mediated by a Single Direction*](https://arxiv.org/abs/2406.11717)。简而言之,该方法通过有害提示与无害提示产生的内部激活差异估计拒绝方向,再从选定的写入矩阵中移除会向该方向写入的分量。秩 1 更新可表示为:
251
-
252
- ```text
253
- W' = W + ΔW, ΔW = BA, rank(ΔW) = 1
254
- ```
255
-
256
- 将 `ΔW` 保存为 LoRA,可以在不重写基础模型检查点的情况下,于推理时加载或卸载该干预。
257
-
258
- ### 为什么主要修改路由专家的 `down_proj`?
259
-
260
- [orcarouter/GLM-5.3-Flash-Uncensored-FP8](https://huggingface.co/orcarouter/GLM-5.3-Flash-Uncensored-FP8#abliteration) 公布的分析表明,GLM-5.3-Flash 的拒绝行为主要由路由专家 MLP 的 `down_proj` 写入端承载。其组件实验显示,仅修改注意力或稠密/共享 MLP 时,大部分拒绝行为仍然保留;加入路由专家 MLP 写入矩阵后,拒绝才出现主要下降。
261
-
262
- 我们进行的分层限制实验也验证了这一机制:具有实际因果作用的拒绝方向集中在专家堆栈的前段至中段;如果只修改靠后的专家层,对拒绝行为几乎没有实际影响。因此,本适配器将路由专家的 `down_proj` 作为最主要的有效修改目标。
263
-
264
- 这里的“分布在前段、后层修改无效”描述的是**行为干预的因果有效性**,并不表示所有前层 LoRA 张量的数值范数都必然大于后层。权重覆盖范围或张量大小本身不能单独证明某种行为储存在哪里。
265
-
266
-
267
- 本适配器采用 Abliterix 的 **SRA + mean + per-layer** 流程:
268
-
269
- - **Mean 基础估计:**以有害提示和无害提示的平均激活差作为初始拒绝方向。
270
- - **SRA:**使用受保护的无害能力成分对初始拒绝信号进行谱清理/残差化,尽量减少对重叠通用能力的误删。
271
- - **逐层估计:**为每个被修改层独立估计方向,而不是把某层的拒绝向量应用到整个模型。
272
-
273
- 逐层估计在这里非常重要,因为拒绝信号在不同深度上的因果作用并不相同。
274
-
275
- ## LoRA 修改权重的层与模块分布
276
-
277
- 以下数据来自对 MLX 转换前两个源 PEFT 版本的 `adapter_config.json` 与 `adapter_model.safetensors` 的实际检查,而不是根据文件名推测。“实际有效”表示相应秩 1 LoRA 增量非零。
278
-
279
- ### 实际非零修改
280
-
281
- | 模块 | v1 覆盖层 | v1 模块数 | v2 覆盖层 | v2 模块数 |
282
- |---|---:|---:|---:|---:|
283
- | 路由专家 `down_proj` | 18–44 | 7,776 | 3–28 | 7,488 |
284
- | 共享专家 `down_proj` | 18–44 | 27 | 18–44 | 27 |
285
- | 自注意力 `o_proj` | 15–44 | 30 | 15–44 | 30 |
286
- | **实际有效模块总数** | **15–44** | **7,833** | **3–44** | **7,545** |
287
-
288
- | 存储统计 | v1 | v2 |
289
- |---|---:|---:|
290
- | BF16 张量数 | 46,770 | 45,042 |
291
- | 秩 1 模块条目 | 23,385 | 22,521 |
292
- | 序列化标量数 | 143,927,296 | 138,618,880 |
293
- | 非零标量数 | 48,375,808 | 46,606,336 |
294
- | 源 PEFT safetensors 大小 | 281.6 MiB | 271.2 MiB |
295
-
296
- 两个版本的 PEFT 配置都把 `down_proj`、`gate_proj`、`o_proj` 和 `up_proj` 列为目标模块,但检查点中的 `gate_proj` 与 `up_proj` 因子都是结构性零条目,不会改变输出。实际生效的是路由/共享专家 `down_proj` 和注意力 `o_proj`。
297
-
298
- 两个版本最主要的差异是深度分配:
299
-
300
- - **v1:**第 0–14 层不修改;第 15–17 层仅修改注意力 `o_proj`;第 18–44 层同时修改注意力 `o_proj`、全部 288 个路由专家 `down_proj` 和共享专家 `down_proj`。
301
- - **v2:**第 0–2 层不修改;第 3–14 层修改全部 288 个路由专家 `down_proj`;第 15–17 层再加入注意力 `o_proj`;第 18–28 层再加入共享专家 `down_proj`;第 29–44 层只保留注意力和共享专家修改。
302
-
303
- 简而言之,v1 把专家干预集中在后 27 层;v2 则把它前移到前中段专家堆栈,并移除第 29–44 层的路由专家修改。
304
-
305
- ## 评测结果
306
-
307
- 两个适配器分别加载在 [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4) 基础模型上进行评测。测试部署使用 vLLM,并为被测模型明确设置低思考强度。交给裁判模型的内容只有被测模型的最终答案,**不包含其思考过程**。
308
-
309
- 自动裁判模型为 **`deepseek-v4-flash`**,裁判思考功能关闭。以下结果是自动评估结果,不等同于人工安全认证。
310
-
311
- ### 总体结果
312
-
313
- | 测试项目 | n | v1 | v2 |
314
- |---|---:|---:|---:|
315
- | SimpleSafetyTests 完全拒绝 | 100 | **1.00%** | 5.00% |
316
- | SimpleSafetyTests 部分拒绝 | 100 | 13.00% | 14.00% |
317
- | SimpleSafetyTests 警告率 | 100 | 90.00% | 94.00% |
318
- | StrongREJECT rubric 均分 | 180 | 0.953472 | **0.972222** |
319
- | StrongREJECT 拒绝率 | 180 | 3.33% | **1.67%** |
320
- | StrongREJECT 警告率 | 180 | 82.22% | 83.33% |
321
-
322
- SimpleSafetyTests 的主要指标是整体安全/不安全分类,拒绝风格标签只是辅助诊断。StrongREJECT 的 rubric 得分越高,表示回答对有害请求提供的帮助越具体、越有用,也就是**安全拒绝越弱**,并不代表模型的通用质量越高。字符串匹配基线仅用于追踪,不能与 LLM 裁判的 rubric 分数直接互换。
323
-
324
- ### 与 NVFP4 基础模型的 KL 散度
325
-
326
- KL 使用 Abliterix 的 next-token 方法,在 `mlabonne/harmless_alpaca` 的 `test[:100]` 上测量:每条提示评估 1 个 token,保留 top-100 对数概率,经 Abliterix 有限值归一化后计算 `KL(base || adapter)`。
327
-
328
- | 适配器 | 平均 KL | 总体标准差 | 最小值 | 最大值 |
329
- |---|---:|---:|---:|---:|
330
- | v1 | 0.067696 | 0.288671 | 0.000150 | 2.691505 |
331
- | v2 | **0.011077** | **0.042988** | **0.000021** | **0.379621** |
332
-
333
- v2 的平均 KL 约为 v1 的 **16.36%**,即约低 **6.1 倍**。在这一测量口径下,v2 明显更好地保留了 NVFP4 基础模型在无害提示上的 next-token 分布。
334
-
335
- ### 版本选取建议
336
-
337
- - 如果重点是在 SimpleSafetyTests 所体现的场景中更激进地降低拒绝,优先选择 **v1**:完全拒绝率为 1%,不拒绝比例为 86%;代价是相对基础模型的分布偏移明显更大。
338
- - 如果更重视保留基础模型能力与原始行为,优先选择 **v2**:KL 约低 6.1 倍、SST 安全率更高,同时在 StrongREJECT 上取得了更低拒绝率和更高的有害帮助 rubric 得分。
339
- - 不存在对所有测试都绝对“更少拒绝”的单一版本:v1 的 SST 完全拒绝率更低,而 v2 的 StrongREJECT 拒绝率更低。
340
-
341
- ### StrongREJECT 分类对比
342
-
343
-
344
- | 类别 | n | v1 得分 | v2 得分 | v1 拒绝 | v2 拒绝 | v1 警告 | v2 警告 |
345
- |---|---:|---:|---:|---:|---:|---:|---:|
346
- | 虚假信息与欺骗 | 30 | 0.895833 | 0.920833 | 10.00% | 6.67% | 80.00% | 83.33% |
347
- | 仇恨、骚扰与歧视 | 30 | 0.908333 | 0.941667 | 6.67% | 3.33% | 60.00% | 56.67% |
348
- | 非法商品与服务 | 30 | 1.000000 | 1.000000 | 0.00% | 0.00% | 96.67% | 96.67% |
349
- | 非暴力犯罪 | 30 | 0.954167 | 0.983333 | 3.33% | 0.00% | 93.33% | 96.67% |
350
- | 性内容 | 30 | 0.962500 | 0.995833 | 0.00% | 0.00% | 80.00% | 83.33% |
351
- | 暴力 | 30 | 1.000000 | 0.991667 | 0.00% | 0.00% | 83.33% | 83.33% |
352
-
353
- ### 警告率不等于拒绝率
354
-
355
- 警告、风险提示、法律说明和安全免责声明与拒绝分别统计。如果模型虽然发出警告,但仍然回答了与请求相关的实质内容,则不会仅因为存在警告而被算作拒绝。因此,高警告率可以与低拒绝率同时出现。
356
-
357
- ## 使用方法
358
-
359
- 本仓库不包含基础模型。请另行提供兼容的 GLM-5.3-Flash MLX 转换版本,并遵守相应许可证与使用条款。
360
-
361
- ### 使用 MLX-LM 命令行加载
362
-
363
- 在 Apple Silicon 上安装 MLX-LM,然后通过 `--adapter-path` 选择 `v1` 或 `v2`:
364
-
365
- ```bash
366
- pip install -U mlx-lm
367
-
368
- mlx_lm.generate \
369
- --model /path/to/GLM-5.3-Flash-MLX \
370
- --adapter-path /path/to/repository/v2 \
371
- --prompt "你好"
372
- ```
373
-
374
- 如需运行 v1,将适配器路径替换为 `/path/to/repository/v1`。
375
-
376
- ### 使用 Python 加载
377
-
378
- ```python
379
- from mlx_lm import generate, load
380
-
381
- model, tokenizer = load(
382
- "/path/to/GLM-5.3-Flash-MLX",
383
- adapter_path="/path/to/repository/v2", # 或 /v1
384
- )
385
-
386
- response = generate(model, tokenizer, prompt="你好", max_tokens=512)
387
- print(response)
388
- ```
389
-
390
- 请使用能够识别 GLM-5.3 MoE 架构及 `adapter_config.json` 中专家模块名称的 MLX-LM 构建和基础模型转换。`--adapter-path` 或 `adapter_path` 应指向整个适配器目录,而不是只指向 `adapters.safetensors` 文件。
391
-
392
- ## 局限性
393
-
394
- - 拒绝消融改变的是拒绝行为,并不保证模型正确、无害、诚实,也不保证通用任务能力有所提升。
395
- - 本干预不能证明所有安全行为都由单一方向或单一模块族编码。
396
- - 模型仍可能保留部分拒绝;后续微调、权重合并、量化或推理服务配置也可能增强或削弱消融效果。
397
- - 自动裁判可能产生误判;警告率不是安全得分。
398
- - 结果只适用于文中所述基础检查点、提示词、采样配置、运行时和裁判模型。
399
-
400
- ## 免责声明
401
-
402
- 本适配器仅供合法的研究、安全评估、红队测试及其他合规用途。它会有意削弱模型的拒绝行为,可能使基础模型生成危险、违法、仇恨、露骨色情、欺骗性或其他有害内容。请勿直接向不可信用户开放,也不要在缺少访问控制、监控、内容过滤、速率限制和人工监督的情况下部署。
403
-
404
- 使用者有责任遵守适用的法律法规、平台政策,以及基础模型、量化检查点、Abliterix 和其他依赖项的许可证与使用条款。作者与分发者不提供任何明示或默示保证,也不对本适配器生成的内容、下游使用、滥用、损失或法律后果承担责任。
 
9
  - MLX
10
  - LoRA
11
  ---
 
12
 
13
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
14
 
15
+ Unofficial community derivative of [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash), published by GCSA-AiLab.
16
 
17
+ 这是 GCSA-AiLab 发布的 [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash) 非官方社区衍生版本。
18
 
19
+ LoRA adapters only; a compatible base model is required separately. V1 and V2 differ in the distribution of edited layers. Select a version after testing it against your evaluation goals.
20
 
21
+ 仅包含 LoRA 适配器,须另备兼容的基础模型。V1 与 V2 的差异在于修改层的分布,请按评测目标验证后选择。
 
 
 
 
 
 
 
 
 
22
 
23
+ ## Introduction and usage / 介绍与使用
 
 
24
 
25
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
26
 
27
+ ## Downloads / 下载
 
 
 
 
 
 
 
 
 
 
28
 
29
+ [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) · [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2)
30
 
31
+ [Technical details · English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [技术细节 · 简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
32
 
33
+ Experimental changes to refusal behavior may alter safeguards. Validate outputs and safety measures before use; follow applicable laws and the [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) upstream terms.
 
 
34
 
35
+ 拒答相关行为的实验性调整可能改变安全保护。使用前请验证输出及安全措施,并遵守适用法律和上游许可证。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/en.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ English
4
+
5
+ [Model home](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## Overview
10
+
11
+ This is an unofficial community derivative published by GCSA-AiLab. It is intended for model-behavior research, authorized evaluation, and compatible deployment experiments. It is not an official release from the base-model provider.
12
+
13
+ LoRA adapters only; a compatible base model is required separately. V1 and V2 differ in the distribution of edited layers. Select a version after testing it against your evaluation goals.
14
+
15
+ - **Base model:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **Format:** LoRA v1, LoRA v2
17
+
18
+ ## Available downloads
19
+
20
+ | Directory / file | Format |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## Download and load
26
+
27
+ Download one variant. The example uses the exact repository and path shown below; choose another entry from the table if needed. Add `--dry-run` to inspect the file list and estimated download size first. Use `hf auth login` if authentication is required.
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ Load `./model/V2` with a runtime that supports both the model architecture and this format. Keep the tokenizer, configuration, and required companion files with the selected weights. File size does not equal runtime memory use.
38
+
39
+ ## Runtime requirements
40
+
41
+ This download cannot run by itself. Use a base checkpoint, tokenizer, and runtime compatible with the adapter format. The historical evaluation used a different NVFP4 base; converted GGUF/MLX adapters must be checked separately.
42
+
43
+ ## Evaluation notes
44
+
45
+ Historical technical and evaluation details are kept on separate pages. Check the tested checkpoint, format, sample, judging method, and limitations. Results from the official base model or another conversion are not measurements of every file here.
46
+
47
+ [Technical details](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [Technical details (简体中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## License and attribution
50
+
51
+ Applicable upstream license: **MIT**. Read the linked original terms and retain the required copyright notices and attribution when redistributing. This introduction does not amend the license. Inference software and other dependencies have their own terms.
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [Upstream model](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## Use and limitations
56
+
57
+ This model includes experimental adjustments to refusal-related behavior that may alter the base model’s safeguards. Before use, validate its outputs and the necessary safety measures in the intended environment, and comply with applicable laws and the upstream license. Do not use it for unlawful activity or to harm others. Outputs may be inaccurate; reduced refusal does not establish better accuracy or unchanged capabilities. Files are provided AS IS, subject to the applicable license.
58
+
59
+ [Model home](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/fr.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ Français
4
+
5
+ [Accueil du modèle](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## Présentation
10
+
11
+ Il s’agit d’un modèle dérivé communautaire non officiel publié par GCSA-AiLab, destiné à la recherche sur le comportement des modèles, aux évaluations autorisées et aux essais de déploiement dans un environnement compatible. Ce n’est pas une publication officielle du fournisseur du modèle de base.
12
+
13
+ Adaptateurs LoRA uniquement ; un modèle de base compatible est nécessaire séparément. V1 et V2 diffèrent par la répartition des couches modifiées. Choisissez après validation selon vos objectifs d’évaluation.
14
+
15
+ - **Modèle de base:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **Format:** LoRA v1, LoRA v2
17
+
18
+ ## Formats disponibles
19
+
20
+ | Dossier / fichier | Format |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## Téléchargement et chargement
26
+
27
+ Téléchargez un seul format. L’exemple ci-dessous utilise le nom réel du dépôt et le chemin exact ; remplacez-les par une autre entrée du tableau si nécessaire. Ajoutez `--dry-run` pour consulter la liste des fichiers et le volume estimé avant le téléchargement. Utilisez `hf auth login` si une authentification est nécessaire.
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ Chargez `./model/V2` dans un environnement prenant en charge l’architecture du modèle et le format choisi. Conservez le tokenizer, la configuration et les fichiers complémentaires nécessaires avec les poids correspondants. La taille des fichiers n’est pas la mémoire nécessaire à l’inférence.
38
+
39
+ ## Environnement requis
40
+
41
+ Ce téléchargement ne fonctionne pas seul. Utilisez un checkpoint de base, un tokenizer et un environnement compatibles avec le format de l’adaptateur. L’évaluation historique utilisait une autre base NVFP4 ; les adaptateurs convertis en GGUF/MLX nécessitent une validation distincte.
42
+
43
+ ## Notes sur les évaluations
44
+
45
+ Les informations techniques et les évaluations historiques figurent sur des pages séparées. Vérifiez le checkpoint testé, son format, les échantillons, la méthode de jugement et les limites. Les résultats du modèle de base officiel ou d’une autre conversion ne constituent pas des mesures de tous les fichiers de ce dépôt.
46
+
47
+ [Détails techniques (English)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [Détails techniques (简体中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## Licence et attribution
50
+
51
+ Licence amont applicable : **MIT**. Consultez les conditions originales et conservez les mentions de droit d’auteur et d’attribution requises lors de la redistribution. Cette présentation ne modifie pas la licence. Les logiciels d’inférence et les autres dépendances sont soumis à leurs propres conditions.
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [Modèle amont](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## Utilisation et limites
56
+
57
+ Ce modèle comporte des ajustements expérimentaux du comportement de refus, susceptibles de modifier les protections du modèle de base. Avant toute utilisation, vérifiez ses sorties et les mesures de sécurité nécessaires dans l’environnement prévu, et respectez les lois applicables ainsi que la licence amont. Ne l’utilisez pas pour des activités illégales ou pour nuire à autrui. Les sorties peuvent être inexactes ; une réduction des refus ne démontre ni une meilleure précision ni le maintien de toutes les capacités. Les fichiers sont fournis en l’état, selon la licence applicable.
58
+
59
+ [Accueil du modèle](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/ja.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ 日本語
4
+
5
+ [モデルのホーム](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## モデルの概要
10
+
11
+ これは GCSA-AiLab が公開する非公式のコミュニティ派生モデルです。モデルの挙動の研究、許可された評価、互換性のある環境での導入実験を目的としています。ベースモデルの提供元による公式リリースではありません。
12
+
13
+ LoRA アダプターのみです。互換性のあるベースモデルが別途必要です。V1 と V2 は変更対象の層の分布が異なります。評価目的に沿って検証してから選択してください。
14
+
15
+ - **ベースモデル:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **形式:** LoRA v1, LoRA v2
17
+
18
+ ## ダウンロード可能な形式
19
+
20
+ | ディレクトリ / ファイル | 形式 |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## ダウンロードと読み込み
26
+
27
+ 必要な形式を一つだけダウンロードしてください。次の例では実際のリポジトリ名とパスを使用しています。別の形式を使う場合は表の項目に置き換えてください。`--dry-run` を追加するとファイル一覧と推定ダウンロード量を確認できます。認証が必要な場合は `hf auth login` を使用してください。
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ モデルのアーキテクチャと選択した形式の両方をサポートする実行環境で `./model/V2` を読み込んでください。対応するトークナイザー、設定、必要な補助ファイルを保持してください。ファイルサイズと推論時のメモリ使用量は異なります。
38
+
39
+ ## 実行環境の要件
40
+
41
+ このダウンロードだけでは実行できません。アダプター形式に対応するベースチェックポイント、トークナイザー、実行環境が必要です。過去の評価では別の NVFP4 ベースを使用しました。変換された GGUF/MLX アダプターは個別に検証してください。
42
+
43
+ ## 評価について
44
+
45
+ 過去の技術情報と評価の詳細は別ページに掲載しています。評価対象のチェックポイント、形式、サンプル、判定方法、制限を確認してください。公式ベースモデルや別の変換形式の結果を、このリポジトリの全ファイルの実測結果と見なすことはできません。
46
+
47
+ [技術詳細(English)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [技術詳細(简体中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## ライセンスと帰属
50
+
51
+ 適用される上流ライセンス:**MIT**。リンク先の原文を確認し、再配布時には必要な著作権表示と帰属情報を保持してください。この紹介文はライセンスを変更しません。推論ソフトウェアとその他の依存関係にはそれぞれの利用条件が適用されます。
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [上流モデル](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## 利用上の注意と制限
56
+
57
+ このモデルには拒否に関する挙動の実験的な調整が含まれており、ベースモデルの安全保護が変わる可能性があります。利用前に、対象環境で出力と必要な安全対策を検証し、適用法令と上流ライセンスを遵守してください。違法行為や他者への加害に使用しないでください。出力は不正確な場合があります。拒否の減少は精度の向上や元の能力の維持を意味しません。ファイルは適用ライセンスに従い現状のまま提供されます。
58
+
59
+ [モデルのホーム](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/ko.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ 한국어
4
+
5
+ [모델 홈](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## 모델 소개
10
+
11
+ GCSA-AiLab이 배포하는 비공식 커뮤니티 파생 모델입니다. 모델 동작 연구, 승인된 평가, 호환 환경에서의 배포 실험을 위한 모델이며 기본 모델 제공자의 공식 릴리스가 아닙니다.
12
+
13
+ LoRA 어댑터만 포함하며 호환되는 기본 모델이 별도로 필요합니다. V1과 V2는 수정한 계층의 분포가 다릅니다. 평가 목적에 맞게 검증한 후 선택하세요.
14
+
15
+ - **기본 모델:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **형식:** LoRA v1, LoRA v2
17
+
18
+ ## 다운로드 가능한 형식
19
+
20
+ | 디렉터리 / 파일 | 형식 |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## 다운로드 및 로드
26
+
27
+ 필요한 형식 하나만 다운로드하세요. 아래 예시는 실제 저장소 이름과 경로를 사용합니다. 다른 형식이 필요하면 표의 항목으로 바꾸세요. `--dry-run`을 추가하면 파일 목록과 예상 다운로드 용량을 먼저 확인할 수 있습니다. 인증이 필요하면 `hf auth login`을 사용하세요.
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ 모델 아키텍처와 선택한 형식을 모두 지원하는 실행 환경에서 `./model/V2`를 로드하세요. 해당 가중치에 맞는 토크나이저, 설정 및 필수 보조 파일을 함께 유지하세요. 파일 크기는 추론 메모리 요구량과 다릅니다.
38
+
39
+ ## 실행 환경 요구 사항
40
+
41
+ 이 다운로드만으로는 실행할 수 없습니다. 어댑터 형식에 맞는 기본 체크포인트, 토크나이저 및 실행 환경이 필요합니다. 과거 평가는 다른 NVFP4 기본 모델을 사용했으며 변환된 GGUF/MLX 어댑터는 별도로 검증해야 합니다.
42
+
43
+ ## 평가 안내
44
+
45
+ 과거 기술 정보와 평가 세부 사항은 별도 페이지에 보관합니다. 평가한 체크포인트, 형식, 표본, 판정 방법 및 한계를 확인하세요. 공식 기본 모델이나 다른 변환 형식의 결과를 이 저장소의 모든 파일에 대한 실측 결과로 볼 수는 없습니다.
46
+
47
+ [기술 세부 사항 (English)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [기술 세부 사항 (简体中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## 라이선스 및 출처
50
+
51
+ 적용되는 상위 모델 라이선스: **MIT**. 링크의 원문 조건을 읽고 재배포 시 필요한 저작권 고지와 출처를 유지하세요. 이 소개는 라이선스를 변경하지 않습니다. 추론 소프트웨어와 기타 종속성에는 각각의 이용 조건이 적용됩니다.
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [상위 모델](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## 사용 및 한계
56
+
57
+ 이 모델은 거부 관련 동작을 실험적으로 조정하여 기본 모델의 안전 보호가 달라질 수 있습니다. 사용 전에 대상 환경에서 출력과 필요한 안전 조치를 검증하고 적용 법률 및 상위 모델 라이선스를 준수하세요. 불법 행위나 타인에게 피해를 주는 용도로 사용하지 마세요. 출력은 부정확할 수 있으며, 거부 감소가 정확도 향상이나 기존 능력의 완전한 유지를 뜻하지는 않습니다. 파일은 적용 라이선스에 따라 있는 그대로 제공됩니다.
58
+
59
+ [모델 홈](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/pt.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ Português
4
+
5
+ [Página inicial do modelo](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## Apresentação
10
+
11
+ Este é um modelo derivado não oficial da comunidade, publicado pela GCSA-AiLab. Destina-se à investigação do comportamento de modelos, a avaliações autorizadas e a experiências de implantação em ambientes compatíveis. Não é uma versão oficial do fornecedor do modelo base.
12
+
13
+ Contém apenas adaptadores LoRA; é necessário obter separadamente um modelo base compatível. V1 e V2 diferem na distribuição das camadas modificadas. Escolha após testar de acordo com os seus objetivos de avaliação.
14
+
15
+ - **Modelo base:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **Formato:** LoRA v1, LoRA v2
17
+
18
+ ## Formatos disponíveis
19
+
20
+ | Diretório / ficheiro | Formato |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## Transferência e carregamento
26
+
27
+ Transfira apenas um formato. O exemplo abaixo usa o nome real do repositório e o caminho exato; substitua-os por outra entrada da tabela, se necessário. Adicione `--dry-run` para consultar a lista de ficheiros e o volume estimado antes da transferência. Use `hf auth login` quando for necessária autenticação.
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ Carregue `./model/V2` num ambiente que suporte a arquitetura do modelo e o formato escolhido. Mantenha o tokenizador, a configuração e os ficheiros auxiliares necessários junto dos pesos correspondentes. O tamanho dos ficheiros não equivale à memória necessária para a inferência.
38
+
39
+ ## Requisitos de execução
40
+
41
+ Esta transferência não funciona isoladamente. Use um checkpoint base, tokenizador e ambiente compatíveis com o formato do adaptador. A avaliação histórica usou outro modelo base NVFP4; os adaptadores convertidos para GGUF/MLX precisam de validação separada.
42
+
43
+ ## Notas sobre a avaliação
44
+
45
+ Os detalhes técnicos e as avaliações históricas estão em páginas separadas. Verifique o checkpoint avaliado, o formato, as amostras, o método de avaliação e as limitações. Os resultados do modelo base oficial ou de outra conversão não são medições de todos os ficheiros deste repositório.
46
+
47
+ [Detalhes técnicos (English)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [Detalhes técnicos (简体中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## Licença e atribuição
50
+
51
+ Licença original aplicável: **MIT**. Leia os termos originais e mantenha os avisos de direitos de autor e as atribuições exigidas ao redistribuir. Esta apresentação não altera a licença. O software de inferência e as outras dependências têm os seus próprios termos.
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [Modelo original](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## Utilização e limitações
56
+
57
+ Este modelo inclui ajustes experimentais no comportamento de recusa que podem alterar as proteções do modelo base. Antes da utilização, valide as respostas e as medidas de segurança necessárias no ambiente previsto e cumpra a legislação aplicável e a licença original. Não o utilize para atividades ilegais ou para causar danos a terceiros. As respostas podem ser imprecisas; menos recusas não demonstram maior precisão nem a preservação de todas as capacidades. Os ficheiros são fornecidos no estado em que se encontram, nos termos da licença aplicável.
58
+
59
+ [Página inicial do modelo](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/technical-en.md ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX — Technical and evaluation details
2
+
3
+ [Model home](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
4
+
5
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
6
+
7
+ Historical data retained from the model card. This documentation update did not run model inference or independently reproduce these evaluations. The tested variant and limitations below remain material.
8
+
9
+ ## Repository contents
10
+
11
+ ```text
12
+ .
13
+ ├── README.md
14
+ ├── V1/
15
+ │ ├── adapter_config.json
16
+ │ └── adapters.safetensors
17
+ └── V2/
18
+ ├── adapter_config.json
19
+ └── adapters.safetensors
20
+ ```
21
+
22
+ - `V1/` contains the original adapter corresponding to `GLM-5.3-Flash-Ablitered`.
23
+ - `V2/` contains the second adapter corresponding to `GLM-5.3-Flash-Ablitered2`.
24
+ - Each directory is a self-contained MLX-LM adapter. This repository does not contain the GLM-5.3-Flash base weights or merged checkpoints.
25
+
26
+
27
+
28
+ ## Adapter summary
29
+
30
+ | Item | v1 | v2 |
31
+ |---|---|---|
32
+ | Repository path | `V1/` | `V2/` |
33
+ | Base model | [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash) | Same model family; exported config records an FP8 source path |
34
+ | Format | MLX-LM LoRA (`adapters.safetensors`) | MLX-LM LoRA (`adapters.safetensors`) |
35
+ | Rank / alpha | `r=1`, `lora_alpha=1` | `r=1`, `lora_alpha=1` |
36
+ | Dropout / bias | `0.0` / `none` | `0.0` / `none` |
37
+ | Effective edited layer range | Layers 15–44 | Layers 3–44 |
38
+ | Routed-expert `down_proj` range | Layers 18–44 | Layers 3–28 |
39
+ | Main effective target | Routed-expert `down_proj` | Routed-expert `down_proj` |
40
+ | Evaluation base | [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4) | Same |
41
+
42
+
43
+
44
+ ## What is abliteration?
45
+
46
+ Abliteration is a weight-space intervention inspired by Arditi et al., [*Refusal in Language Models Is Mediated by a Single Direction*](https://arxiv.org/abs/2406.11717). In simplified form, a refusal direction is estimated from the difference between internal activations elicited by harmful and harmless prompts. Components of selected writer matrices that contribute to that direction are then removed. A rank-1 update can be represented as:
47
+
48
+ ```text
49
+ W' = W + ΔW, ΔW = BA, rank(ΔW) = 1
50
+ ```
51
+
52
+ Storing `ΔW` as a LoRA adapter means the original model checkpoint is not rewritten and the intervention can be enabled or removed at serving time.
53
+
54
+ ### Why routed-expert `down_proj`?
55
+
56
+ The analysis published with [orcarouter/GLM-5.3-Flash-Uncensored-FP8](https://huggingface.co/orcarouter/GLM-5.3-Flash-Uncensored-FP8#abliteration) identifies the routed-expert MLP `down_proj` writers as the dominant intervention point for GLM-5.3-Flash refusal behavior. Its component study reports that attention-only and dense/shared-MLP interventions retain most refusal behavior, whereas adding routed-expert MLP writers causes the major reduction.
57
+
58
+ Our layer-restricted experiments agreed with that mechanism-level result: the causally useful refusal directions were found in the earlier-to-middle part of the expert stack, while modifications restricted to the later expert layers had almost no practical effect on refusal. Accordingly, the routed-expert `down_proj` modules are the main effective target in this adapter.
59
+
60
+ This statement concerns **causal intervention effectiveness**, not the numerical magnitude of every stored LoRA tensor. Adapter coverage and tensor norm alone do not establish where a behavior is represented.
61
+
62
+ This adapter instead uses Abliterix's **SRA + mean + per-layer** workflow:
63
+
64
+ - **Mean base estimator:** harmful-versus-harmless mean activation differences provide the initial direction estimate.
65
+ - **SRA:** the initial refusal signal is spectrally cleaned/residualized against protected benign-capability components, reducing unwanted removal of overlapping capabilities.
66
+ - **Per-layer estimation:** each edited layer receives its own estimated direction; a single layer-22 vector is not reused across the entire model.
67
+
68
+ Per-layer estimation is important here because the refusal signal is not equally useful at every depth, and late-layer-only interventions were ineffective in our experiments.
69
+
70
+
71
+
72
+ ## LoRA weight distribution
73
+
74
+ The following figures were obtained by inspecting the source PEFT `adapter_config.json` and `adapter_model.safetensors` files before MLX conversion. “Effective” means that the resulting rank-1 LoRA delta is non-zero.
75
+
76
+ ### Effective non-zero edits
77
+
78
+ | Module | v1 layer coverage | v1 modules | v2 layer coverage | v2 modules |
79
+ |---|---:|---:|---:|---:|
80
+ | Routed-expert `down_proj` | 18–44 | 7,776 | 3–28 | 7,488 |
81
+ | Shared-expert `down_proj` | 18–44 | 27 | 18–44 | 27 |
82
+ | Self-attention `o_proj` | 15–44 | 30 | 15–44 | 30 |
83
+ | **Total effective modules** | **15–44** | **7,833** | **3–44** | **7,545** |
84
+
85
+ | Storage statistic | v1 | v2 |
86
+ |---|---:|---:|
87
+ | BF16 tensors | 46,770 | 45,042 |
88
+ | Rank-1 module entries | 23,385 | 22,521 |
89
+ | Serialized scalars | 143,927,296 | 138,618,880 |
90
+ | Non-zero scalars | 48,375,808 | 46,606,336 |
91
+ | Source PEFT safetensors size | 281.6 MiB | 271.2 MiB |
92
+
93
+ Both PEFT configurations list `down_proj`, `gate_proj`, `o_proj`, and `up_proj` as target modules. In both checkpoints, the stored `gate_proj` and `up_proj` factors are structural zero entries and do not alter model output. The effective changes are therefore routed/shared-expert `down_proj` and attention `o_proj` updates.
94
+
95
+ The main difference is depth allocation:
96
+
97
+ - **v1:** layers 0–14 are unchanged; layers 15–17 modify attention `o_proj` only; layers 18–44 modify attention `o_proj`, all 288 routed-expert `down_proj` modules, and the shared-expert `down_proj`.
98
+ - **v2:** layers 0–2 are unchanged; layers 3–14 modify all 288 routed-expert `down_proj` modules; layers 15–17 add attention `o_proj`; layers 18–28 also add the shared-expert `down_proj`; layers 29–44 retain only attention and shared-expert edits.
99
+
100
+ In other words, v1 concentrates the expert intervention in the later 27 layers, while v2 shifts it to the earlier-to-middle expert stack and removes routed-expert edits from layers 29–44.
101
+
102
+
103
+
104
+ ## Evaluation
105
+
106
+ Both adapters were evaluated while attached separately to [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4). The tested deployment used vLLM, explicitly selected low reasoning effort for the target model, and passed only the target model's final answer—not its private reasoning—to the judge.
107
+
108
+ The automated judge was **`deepseek-v4-flash` through the Ollama Cloud API**, with judge thinking disabled. These results are automated estimates, not human safety certification.
109
+
110
+ ### Overall results
111
+
112
+ | Benchmark / metric | n | v1 | v2 |
113
+ |---|---:|---:|---:|
114
+ | SimpleSafetyTests full refusal | 100 | **1.00%** | 5.00% |
115
+ | SimpleSafetyTests partial refusal | 100 | 13.00% | 14.00% |
116
+ | SimpleSafetyTests warning rate | 100 | 90.00% | 94.00% |
117
+ | StrongREJECT rubric mean | 180 | 0.953472 | **0.972222** |
118
+ | StrongREJECT refusal rate | 180 | 3.33% | **1.67%** |
119
+ | StrongREJECT warning rate | 180 | 82.22% | 83.33% |
120
+
121
+ For SimpleSafetyTests, the primary result is the holistic safe/unsafe classification; refusal-style labels are auxiliary diagnostics. For StrongREJECT, a higher rubric score means that the response gave more useful and specific assistance toward the harmful request; it therefore indicates **weaker safety refusal**, not higher general model quality. The string-matching baseline is reported for traceability and is not interchangeable with the LLM-judge rubric.
122
+
123
+ ### KL divergence from the NVFP4 base
124
+
125
+ KL was measured on 100 prompts from `mlabonne/harmless_alpaca` (`test[:100]`) using the Abliterix next-token method: top-100 log probabilities, one scored token per prompt, and `KL(base || adapter)` after Abliterix's finite-value normalization.
126
+
127
+ | Adapter | Mean KL | Population std. dev. | Minimum | Maximum |
128
+ |---|---:|---:|---:|---:|
129
+ | v1 | 0.067696 | 0.288671 | 0.000150 | 2.691505 |
130
+ | v2 | **0.011077** | **0.042988** | **0.000021** | **0.379621** |
131
+
132
+ v2's mean KL is approximately **16.36% of v1's**, or about **6.1× lower**. Under this measurement, v2 preserves the NVFP4 base model's benign next-token distribution substantially better.
133
+
134
+ ### Version comparison
135
+
136
+ V1 and V2 differ in layer allocation and measured distribution drift. Choose against the intended evaluation goals; no single refusal metric establishes general quality or safety.
137
+
138
+ ### StrongREJECT category comparison
139
+
140
+ | Category | n | v1 score | v2 score | v1 refusal | v2 refusal | v1 warning | v2 warning |
141
+ |---|---:|---:|---:|---:|---:|---:|---:|
142
+ | Disinformation and deception | 30 | 0.895833 | 0.920833 | 10.00% | 6.67% | 80.00% | 83.33% |
143
+ | Hate, harassment, and discrimination | 30 | 0.908333 | 0.941667 | 6.67% | 3.33% | 60.00% | 56.67% |
144
+ | Illegal goods and services | 30 | 1.000000 | 1.000000 | 0.00% | 0.00% | 96.67% | 96.67% |
145
+ | Non-violent crimes | 30 | 0.954167 | 0.983333 | 3.33% | 0.00% | 93.33% | 96.67% |
146
+ | Sexual content | 30 | 0.962500 | 0.995833 | 0.00% | 0.00% | 80.00% | 83.33% |
147
+ | Violence | 30 | 1.000000 | 0.991667 | 0.00% | 0.00% | 83.33% | 83.33% |
148
+
149
+ ### Warning rate is not refusal rate
150
+
151
+ A warning, caveat, legal note, or safety disclaimer was counted separately from refusal. If a response warned about risk but still provided request-relevant content, it was **not** counted as a refusal on that basis. Consequently, a high warning rate can coexist with a low refusal rate.
152
+
153
+
154
+
155
+ ## Usage
156
+
157
+ This repository does not include the base model. Provide a compatible MLX conversion of GLM-5.3-Flash separately and comply with its license and terms.
158
+
159
+ ### MLX-LM command line
160
+
161
+ Install MLX-LM on Apple Silicon, then select either `v1` or `v2` with `--adapter-path`:
162
+
163
+ ```bash
164
+ pip install -U mlx-lm
165
+
166
+ mlx_lm.generate \
167
+ --model /path/to/GLM-5.3-Flash-MLX \
168
+ --adapter-path /path/to/repository/v2 \
169
+ --prompt "Hello"
170
+ ```
171
+
172
+ To run v1, replace the adapter path with `/path/to/repository/v1`.
173
+
174
+ ### Python
175
+
176
+ ```python
177
+ from mlx_lm import generate, load
178
+
179
+ model, tokenizer = load(
180
+ "/path/to/GLM-5.3-Flash-MLX",
181
+ adapter_path="/path/to/repository/v2", # Or /v1
182
+ )
183
+
184
+ response = generate(model, tokenizer, prompt="Hello", max_tokens=512)
185
+ print(response)
186
+ ```
187
+
188
+ Use an MLX-LM build and base-model conversion that support the GLM-5.3 MoE architecture and the expert module names recorded in `adapter_config.json`. The adapter directory—not the `adapters.safetensors` file alone—must be passed to `--adapter-path` or `adapter_path`.
189
+
190
+
191
+
192
+ ## Limitations
193
+
194
+ - Abliteration changes refusal behavior; it does not guarantee correctness, harmlessness, honesty, or improved task capability.
195
+ - The intervention does not prove that all safety behavior is encoded by one direction or one module family.
196
+ - Residual refusals may remain, and later fine-tuning, merging, quantization, or serving changes may strengthen or weaken the effect.
197
+ - Automated judge labels can contain false positives and false negatives. Warning rate is not a safety score.
198
+ - Results are specific to the stated base checkpoint, prompts, sampling configuration, runtime, and judge model.
199
+
200
+ [Model home](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/technical-zh-CN.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX — 技术与评测细节
2
+
3
+ [模型主页](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
4
+
5
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
6
+
7
+ 这里保留模型卡中的历史数据。本次文档调整没有运行模型推理,也没有独立复现这些评测;下文的被测版本和局限仍须一并阅读。
8
+
9
+ ## 仓库文件结构
10
+
11
+ ```text
12
+ .
13
+ ├── README.md
14
+ ├── V1/
15
+ │ ├── adapter_config.json
16
+ │ └── adapters.safetensors
17
+ └── V2/
18
+ ├── adapter_config.json
19
+ └── adapters.safetensors
20
+ ```
21
+
22
+ - `V1/`:原始版本,对应 `GLM-5.3-Flash-Ablitered`。
23
+ - `V2/`:第二版本,对应 `GLM-5.3-Flash-Ablitered2`。
24
+ - 每个目录都是可独立加载的 MLX-LM LoRA。本仓库不包含 GLM-5.3-Flash 基础权重,也不包含合并后的完整模型。
25
+
26
+
27
+
28
+ ## 适配器概要
29
+
30
+ | 项目 | v1 | v2 |
31
+ |---|---|---|
32
+ | 仓库路径 | `V1/` | `V2/` |
33
+ | 基础模型 | `zai-org/GLM-5.3-Flash` | 同一模型族 |
34
+ | 格式 | MLX-LM LoRA(`adapters.safetensors`) | MLX-LM LoRA(`adapters.safetensors`) |
35
+ | 秩 / alpha | `r=1`,`lora_alpha=1` | `r=1`,`lora_alpha=1` |
36
+ | Dropout / bias | `0.0` / `none` | `0.0` / `none` |
37
+ | 实际修改的层范围 | 第 15–44 层 | 第 3–44 层 |
38
+ | 路由专家 `down_proj` 范围 | 第 18–44 层 | 第 3–28 层 |
39
+ | 主要有效目标 | 路由专家 `down_proj` | 路由专家 `down_proj` |
40
+ | 评测基础模型 | [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4) | 同左 |
41
+
42
+
43
+
44
+ ## 什么是拒绝消融?
45
+
46
+ 拒绝消融(abliteration)是一种权重空间干预方法,其思路源自 Arditi 等人的论文 [*Refusal in Language Models Is Mediated by a Single Direction*](https://arxiv.org/abs/2406.11717)。简而言之,该方法通过有害提示与无害提示产生的内部激活差异估计拒绝方向,再从选定的写入矩阵中移除会向该方向写入的分量。秩 1 更新可表示为:
47
+
48
+ ```text
49
+ W' = W + ΔW, ΔW = BA, rank(ΔW) = 1
50
+ ```
51
+
52
+ 将 `ΔW` 保存为 LoRA,可以在不重写基础模型检查点的情况下,于推理时加载或卸载该干预。
53
+
54
+ ### 为什么主要修改路由专家的 `down_proj`?
55
+
56
+ [orcarouter/GLM-5.3-Flash-Uncensored-FP8](https://huggingface.co/orcarouter/GLM-5.3-Flash-Uncensored-FP8#abliteration) 公布的分析表明,GLM-5.3-Flash 的拒绝行为主要由路由专家 MLP 的 `down_proj` 写入端承载。其组件实验显示,仅修改注意力或稠密/共享 MLP 时,大部分拒绝行为仍然保留;加入路由专家 MLP 写入矩阵后,拒绝才出现主要下降。
57
+
58
+ 我们进行的分层限制实验也验证了这一机制:具有实际因果作用的拒绝方向集中在专家堆栈的前段至中段;如果只修改靠后的专家层,对拒绝行为几乎没有实际影响。因此,本适配器将路由专家的 `down_proj` 作为最主要的有效修改目标。
59
+
60
+ 这里的“分布在前段、后层修改无效”描述的是**行为干预的因果有效性**,并不表示所有前层 LoRA 张量的数值范数都必然大于后层。权重覆盖范围或张量大小本身不能单独证明某种行为储存在哪里。
61
+
62
+
63
+ 本适配器采用 Abliterix 的 **SRA + mean + per-layer** 流程:
64
+
65
+ - **Mean 基础估计:**以有害提示和无害提示的平均激活差作为初始拒绝方向。
66
+ - **SRA:**使用受保护的无害能力成分对初始拒绝信号进行谱清理/残差化,尽量减少对重叠通用能力的误删。
67
+ - **逐层估计:**为每个被修改层独立估计方向,而不是把某层的拒绝向量应用到整个模型。
68
+
69
+ 逐层估计在这里非常重要,因为拒绝信号在不同深度上的因果作用并不相同。
70
+
71
+
72
+
73
+ ## LoRA 修改权重的层与模块分布
74
+
75
+ 以下数据来自对 MLX 转换前两个源 PEFT 版本的 `adapter_config.json` 与 `adapter_model.safetensors` 的实际检查,而不是根据文件名推测。“实际有效”表示相应秩 1 LoRA 增量非零。
76
+
77
+ ### 实际非零修改
78
+
79
+ | 模块 | v1 覆盖层 | v1 模块数 | v2 覆盖层 | v2 模块数 |
80
+ |---|---:|---:|---:|---:|
81
+ | 路由专家 `down_proj` | 18–44 | 7,776 | 3–28 | 7,488 |
82
+ | 共享专家 `down_proj` | 18–44 | 27 | 18–44 | 27 |
83
+ | 自注意力 `o_proj` | 15–44 | 30 | 15–44 | 30 |
84
+ | **实际有效模块总数** | **15–44** | **7,833** | **3–44** | **7,545** |
85
+
86
+ | 存储统计 | v1 | v2 |
87
+ |---|---:|---:|
88
+ | BF16 张量数 | 46,770 | 45,042 |
89
+ | 秩 1 模块条目 | 23,385 | 22,521 |
90
+ | 序列化标量数 | 143,927,296 | 138,618,880 |
91
+ | 非零标量数 | 48,375,808 | 46,606,336 |
92
+ | 源 PEFT safetensors 大小 | 281.6 MiB | 271.2 MiB |
93
+
94
+ 两个版本的 PEFT 配置都把 `down_proj`、`gate_proj`、`o_proj` 和 `up_proj` 列为目标模块,但检查点中的 `gate_proj` 与 `up_proj` 因子都是结构性零条目,不会改变输出。实际生效的是路由/共享专家 `down_proj` 和注意力 `o_proj`。
95
+
96
+ 两个版本最主要的差异是深度分配:
97
+
98
+ - **v1:**第 0–14 层不修改;第 15–17 层仅修改注意力 `o_proj`;第 18–44 层同时修改注意力 `o_proj`、全部 288 个路由专家 `down_proj` 和共享专家 `down_proj`。
99
+ - **v2:**第 0–2 层不修改;第 3–14 层修改全部 288 个路由专家 `down_proj`;第 15–17 层再加入注意力 `o_proj`;第 18–28 层再加入共享专家 `down_proj`;第 29–44 层只保留注意力和共享专家修改。
100
+
101
+ 简而言之,v1 把专家干预集中在后 27 层;v2 则把它前移到前中段专家堆栈,并移除第 29–44 层的路由专家修改。
102
+
103
+
104
+
105
+ ## 评测结果
106
+
107
+ 两个适配器分别加载在 [RedHatAI/GLM-5.3-Flash-NVFP4](https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4) 基础模型上进行评测。测试部署使用 vLLM,并为被测模型明确设置低思考强度。交给裁判模型的内容只有被测模型的最终答案,**不包含其思考过程**。
108
+
109
+ 自动裁判模型为 **`deepseek-v4-flash`**,裁判思考功能关闭。以下结果是自动评估结果,不等同于人工安全认证。
110
+
111
+ ### 总体结果
112
+
113
+ | 测试项目 | n | v1 | v2 |
114
+ |---|---:|---:|---:|
115
+ | SimpleSafetyTests 完全拒绝 | 100 | **1.00%** | 5.00% |
116
+ | SimpleSafetyTests 部分拒绝 | 100 | 13.00% | 14.00% |
117
+ | SimpleSafetyTests 警告率 | 100 | 90.00% | 94.00% |
118
+ | StrongREJECT rubric 均分 | 180 | 0.953472 | **0.972222** |
119
+ | StrongREJECT 拒绝率 | 180 | 3.33% | **1.67%** |
120
+ | StrongREJECT 警告率 | 180 | 82.22% | 83.33% |
121
+
122
+ SimpleSafetyTests 的主要指标是整体安全/不安全分类,拒绝风格标签只是辅助诊断。StrongREJECT 的 rubric 得分越高,表示回答对有害请求提供的帮助越具体、越有用,也就是**安全拒绝越弱**,并不代表模型的通用质量越高。字符串匹配基线仅用于追踪,不能与 LLM 裁判的 rubric 分数直接互换。
123
+
124
+ ### 与 NVFP4 基础模型的 KL 散度
125
+
126
+ KL 使用 Abliterix 的 next-token 方法,在 `mlabonne/harmless_alpaca` 的 `test[:100]` 上测量:每条提示评估 1 个 token,保留 top-100 对数概率,经 Abliterix 有限值归一化后计算 `KL(base || adapter)`。
127
+
128
+ | 适配器 | 平均 KL | 总体标准差 | 最小值 | 最大值 |
129
+ |---|---:|---:|---:|---:|
130
+ | v1 | 0.067696 | 0.288671 | 0.000150 | 2.691505 |
131
+ | v2 | **0.011077** | **0.042988** | **0.000021** | **0.379621** |
132
+
133
+ v2 的平均 KL 约为 v1 的 **16.36%**,即约低 **6.1 倍**。在这一测量口径下,v2 明显更好地保留了 NVFP4 基础模型在无害提示上的 next-token 分布。
134
+
135
+ ### 版本比较
136
+
137
+ V1 与 V2 的差异在于修改层分布和测得的分布偏移,应按评测目标验证后选择;单个拒答指标不能代表通用质量或安全性。
138
+
139
+ ### StrongREJECT 分类对比
140
+
141
+
142
+ | 类别 | n | v1 得分 | v2 得分 | v1 拒绝 | v2 拒绝 | v1 警告 | v2 警告 |
143
+ |---|---:|---:|---:|---:|---:|---:|---:|
144
+ | 虚假信息与欺骗 | 30 | 0.895833 | 0.920833 | 10.00% | 6.67% | 80.00% | 83.33% |
145
+ | 仇恨、骚扰与歧视 | 30 | 0.908333 | 0.941667 | 6.67% | 3.33% | 60.00% | 56.67% |
146
+ | 非法商品与服务 | 30 | 1.000000 | 1.000000 | 0.00% | 0.00% | 96.67% | 96.67% |
147
+ | 非暴力犯罪 | 30 | 0.954167 | 0.983333 | 3.33% | 0.00% | 93.33% | 96.67% |
148
+ | 性内容 | 30 | 0.962500 | 0.995833 | 0.00% | 0.00% | 80.00% | 83.33% |
149
+ | 暴力 | 30 | 1.000000 | 0.991667 | 0.00% | 0.00% | 83.33% | 83.33% |
150
+
151
+ ### 警告率不等于拒绝率
152
+
153
+ 警告、风险提示、法律说明和安全免责声明与拒绝分别统计。如果模型虽然发出警告,但仍然回答了与请求相关的实质内容,则不会仅因为存在警告而被算作拒绝。因此,高警告率可以与低拒绝率同时出现。
154
+
155
+
156
+
157
+ ## 使用方法
158
+
159
+ 本仓库不包含基础模型。请另行提供兼容的 GLM-5.3-Flash MLX 转换版本,并遵守相应许可证与使用条款。
160
+
161
+ ### 使用 MLX-LM 命令行加载
162
+
163
+ 在 Apple Silicon 上安装 MLX-LM,然后通过 `--adapter-path` 选择 `v1` 或 `v2`:
164
+
165
+ ```bash
166
+ pip install -U mlx-lm
167
+
168
+ mlx_lm.generate \
169
+ --model /path/to/GLM-5.3-Flash-MLX \
170
+ --adapter-path /path/to/repository/v2 \
171
+ --prompt "你好"
172
+ ```
173
+
174
+ 如需运行 v1,将适配器路径替换为 `/path/to/repository/v1`。
175
+
176
+ ### 使用 Python 加载
177
+
178
+ ```python
179
+ from mlx_lm import generate, load
180
+
181
+ model, tokenizer = load(
182
+ "/path/to/GLM-5.3-Flash-MLX",
183
+ adapter_path="/path/to/repository/v2", # 或 /v1
184
+ )
185
+
186
+ response = generate(model, tokenizer, prompt="你好", max_tokens=512)
187
+ print(response)
188
+ ```
189
+
190
+ 请使用能够识别 GLM-5.3 MoE 架构及 `adapter_config.json` 中专家模块名称的 MLX-LM 构建和基础模型转换。`--adapter-path` 或 `adapter_path` 应指向整个适配器目录,而不是只指向 `adapters.safetensors` 文件。
191
+
192
+
193
+
194
+ ## 局限性
195
+
196
+ - 拒绝消融改变的是拒绝行为,并不保证模型正确、无害、诚实,也不保证通用任务能力有所提升。
197
+ - 本干预不能证明所有安全行为都由单一方向或单一模块族编码。
198
+ - 模型仍可能保留部分拒绝;后续微调、权重合并、量化或推理服务配置也可能增强或削弱消融效果。
199
+ - 自动裁判可能产生误判;警告率不是安全得分。
200
+ - 结果只适用于文中所述基础检查点、提示词、采样配置、运行时和裁判模型。
201
+
202
+ [模型主页](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/zh-CN.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ 简体中文
4
+
5
+ [模型主页](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## 模型介绍
10
+
11
+ 这是 GCSA-AiLab 发布的非官方社区衍生版本,用于模型行为研究、经授权评测和兼容环境中的部署实验,并非基础模型提供方的官方发布。
12
+
13
+ 仅包含 LoRA 适配器,须另备兼容的基础模型。V1 与 V2 的差异在于修改层的分布,请按评测目标验证后选择。
14
+
15
+ - **基础模型:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **格式:** LoRA v1, LoRA v2
17
+
18
+ ## 可用下载
19
+
20
+ | 目录 / 文件 | 格式 |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## 下载与加载
26
+
27
+ 请只下载一个版本。下方示例使用实际仓库名和文件路径;如需其他版本,按表中的条目替换。可添加 `--dry-run` 先检查文件清单和预计下载量。需要认证时使用 `hf auth login`。
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ 使用同时支持模型架构和所选格式的运行时加载 `./model/V2`。请保留所选权重配套的分词器、配置及必要的伴随文件。文件大小不等于推理内存需求。
38
+
39
+ ## 运行要求
40
+
41
+ 此下载不能独立运行,须配套适配器格式兼容的基础检查点、分词器和运行时。历史评测使用的是另一 NVFP4 基础版本,转换后的 GGUF/MLX 适配器须单独验证。
42
+
43
+ ## 评测说明
44
+
45
+ 历史技术和评测细节保留在独立页面。请核对被测检查点、格式、样本、裁判方法及局限。官方基础模型或其他转换版本的成绩,不能当作这里所有文件的实测结果。
46
+
47
+ [技术细节(English)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [技术细节(简体中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## 许可证与署名
50
+
51
+ 适用的上游许可证:**MIT**。请阅读链接中的原始条款,分发时保留要求的版权声明和署名。本介绍不改变许可证。推理软件和其他依赖项各自适用其许可证。
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [上游模型](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## 使用与局限
56
+
57
+ 本模型对拒答相关行为进行了实验性调整,可能改变基础模型的安全保护。使用前应在目标环境中验证模型输出与必要的安全措施,并遵守适用法律和上游许可证。不得用于违法活动或伤害他人。输出可能不准确;拒答减少不代表准确性提高或原有能力完全保留。文件按现状提供,适用许可证中的条款。
58
+
59
+ [模型主页](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
docs/zh-TW.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLM-5.3-Flash-Abliterated-LoRA-MLX
2
+
3
+ 繁體中文
4
+
5
+ [模型主頁](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)
6
+
7
+ [English](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/en.md) | [简体中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-CN.md) | [繁體中文](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/zh-TW.md) | [日本語](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ja.md) | [한국어](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/ko.md) | [Français](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/fr.md) | [Português](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/pt.md)
8
+
9
+ ## 模型介紹
10
+
11
+ 這是 GCSA-AiLab 釋出的非官方社群衍生版本,用於模型行為研究、經授權評測和相容環境中的部署實驗,並非基礎模型提供方的官方釋出。
12
+
13
+ 僅包含 LoRA 介面卡,須另備相容的基礎模型。V1 與 V2 的差異在於修改層的分佈,請按評測目標驗證後選擇。
14
+
15
+ - **基礎模型:** [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash)
16
+ - **格式:** LoRA v1, LoRA v2
17
+
18
+ ## 可用下載
19
+
20
+ | 目錄 / 檔案 | 格式 |
21
+ |---|---|
22
+ | [`V1`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V1) | LoRA v1 |
23
+ | [`V2`](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/tree/main/V2) | LoRA v2 |
24
+
25
+ ## 下載與載入
26
+
27
+ 請只下載一個版本。下方示例使用實際倉庫名和檔案路徑;如需其他版本,按表中的條目替換。可新增 `--dry-run` 先檢查檔案清單和預計下載量。需要認證時使用 `hf auth login`。
28
+
29
+ ```bash
30
+ python -m pip install -U huggingface_hub
31
+
32
+ hf download GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX \
33
+ --include "V2/*" \
34
+ --local-dir ./model
35
+ ```
36
+
37
+ 使用同時支援模型架構和所選格式的執行時載入 `./model/V2`。請保留所選權重配套的分詞器、配置及必要的伴隨檔案。檔案大小不等於推理記憶體需求。
38
+
39
+ ## 執行要求
40
+
41
+ 此下載不能獨立執行,須配套介面卡格式相容的基礎檢查點、分詞器和執行時。歷史評測使用的是另一 NVFP4 基礎版本,轉換後的 GGUF/MLX 介面卡須單獨驗證。
42
+
43
+ ## 評測說明
44
+
45
+ 歷史技術和評測細節保留在獨立頁面。請核對被測檢查點、格式、樣本、裁判方法及侷限。官方基礎模型或其他轉換版本的成績,不能當作這裡所有檔案的實測結果。
46
+
47
+ [技術細節(English)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-en.md) | [技術細節(簡體中文)](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX/blob/main/docs/technical-zh-CN.md)
48
+
49
+ ## 許可證與署名
50
+
51
+ 適用的上游許可證:**MIT**。請閱讀連結中的原始條款,分發時保留要求的版權宣告和署名。本介紹不改變許可證。推理軟體和其他依賴項各自適用其許可證。
52
+
53
+ [MIT](https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE) · [上游模型](https://huggingface.co/zai-org/GLM-5.3-Flash)
54
+
55
+ ## 使用與侷限
56
+
57
+ 本模型對拒答相關行為進行了實驗性調整,可能改變基礎模型的安全保護。使用前應在目標環境中驗證模型輸出與必要的安全措施,並遵守適用法律和上游許可證。不得用於違法活動或傷害他人。輸出可能不準確;拒答減少不代表準確性提高或原有能力完全保留。檔案按現狀提供,適用許可證中的條款。
58
+
59
+ [模型主頁](https://huggingface.co/GCSA-AiLab/GLM-5.3-Flash-Abliterated-LoRA-MLX)