Rank-64 LoRA adapter (PEFT format) for zai-org/GLM-5.3-Flash, fine-tuned on long-form free-form text-adventure / Game Master roleplay conversations. This is the final checkpoint (step 333 of 333, 2 epochs).
A merged NVFP4 model built from an earlier checkpoint of the same run (step 300) is at cgg507/GLM-5.3-Flash-NVFP4-GM-step300. That model card has the evaluation results (lm-evaluation-harness, refusal suite). The step-333 adapter has not been evaluated separately.
Experimental. Uncensored roleplay style. Outputs may contain mature themes, graphic violence and crude language when the scene calls for it. Not safety-tuned beyond the base model.
zai-org/GLM-5.3-Flash (architecture Glm5NextForConditionalGeneration, model_type: glm5_next). Only the
text decoder is adapted. The vision tower and the MTP layer are not.| rank / alpha | 64 / 32 (scaling 0.5), no rsLoRA, no DoRA, dropout 0 |
| adapters | 496 (992 tensors, bf16, ~575 MB) |
| KDA linear-attention layers (34) | q_proj k_proj v_proj b_proj forget_gate.f_a_proj forget_gate.f_b_proj g_a_proj g_b_proj o_proj |
| MLA layers (11) | q_a_proj q_b_proj kv_a_proj_with_mqa kv_b_proj o_proj |
| MoE layers (42) | shared expert gate_proj up_proj down_proj |
| dense layers 0-2 | mlp.gate_proj up_proj down_proj |
| not adapted | routed experts (288 per MoE layer), routers, DSA indexer, mHC parameters, embeddings, lm_head, vision tower, MTP layer |
Module names follow the transformers Glm5NextForConditionalGeneration module tree
(model.language_model.layers.N...). Note that transformers loads the checkpoint tensors
self_attn.f_{a,b}_proj into the modules self_attn.forget_gate.f_{a,b}_proj. target_modules is a regex that
matches exactly the 496 adapted modules. It does not match the vision tower or the MTP layer, which reuse the same
leaf names.
Requires a transformers version with glm5_next (tested with 5.20.1) and peft >= 0.21.
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
from peft import PeftModel
base = AutoModelForImageTextToText.from_pretrained(
"zai-org/GLM-5.3-Flash", dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, "cgg507/GLM-5.3-Flash-GM-LoRA")
# optional: fold the adapter into the weights (bf16 targets only)
# model = model.merge_and_unload()
The adapter loading path was validated end to end (see below). A full forward pass with the full base model
was not run here. The zai-org checkpoint is FP8 for 179 of the target weights, so whether PEFT can wrap those
modules depends on the transformers FP8 linear implementation. This was not tested. If it fails, load or
dequantize the base in bf16, or merge W += 0.5 * B @ A into a bf16 copy of those tensors. The step-300 NVFP4
model was built that way.
No GGUF LoRA is provided. llama.cpp master (2026-10-17, 797de63) can convert the GLM-5.3-Flash base model
(Glm5NextModel), but it cannot use this adapter:
convert_lora_to_gguf.py fails on the MLA kv_b_proj adapters. The base converter splits kv_b_proj into
per-head k_b/v_b and transposes k_b. LoraTorchTensor.permute does not implement a 3-D transpose and
raises NotImplementedError.src/models/glm5-next.cpp) applies plain ggml_mul_mat to
every KDA projection (q/k/v, f_a/f_b, b, g_a/g_b, o) and every MLA projection (q_a, q_b, kv_a, k_b/v_b, o).
It applies LoRA through build_lora_mm only in the dense and shared-expert FFNs (build_ffn). 361 of the 496
adapters (all attention) would be silently ignored.self_attn.forget_gate.f_{a,b}_proj (the transformers
module names used here) gives Can not map tensor. Exporting with checkpoint names
(nmoe_to_peft.py --checkpoint-names) gets past this point, and then fails on (1).scripts/validate_peft.py (refusal_bench) checks the converted adapter against the original trainer checkpoint
and against the real base model. All checks pass:
glm5_next renaming rules). 0 are unmatched. target_modules selects exactly those
496 modules (0 extra, 0 missing).A.in == W.in, B.out == W.out), read from the safetensors
headers of both repos.W + 0.5 * B @ A (fp32,
bf16 round) on the real bf16 base weights is bit-identical between the PEFT file, the original adapter and the
NVFP4 merge script. A merge through the peft library agrees to within bf16 rounding (max |diff| <= 9.8e-4, <=1.1%
of elements), because peft adds the delta in bf16.PeftModel.from_pretrained on a meta-device transformers Glm5NextForConditionalGeneration built
from the base config wraps 496 modules (0 extra, 0 missing), reports 0 unexpected or missing adapter keys, and
loads 496/496 adapters with values equal to the file.Full training run (333 steps, 2 epochs). This repository contains the final step-333 adapter. The run was stopped at step 100 and resumed with a faster trainer build (red line). Loss is per step over ~4 different conversations, so the 10-step rolling mean is the signal.
zai-org/GLM-5.3-Flash