license: other
license_name: tencent-hy-license
license_link: https://huggingface.co/tencent/Hy4-flash/blob/main/LICENSE
base_model: alesha-pro/Hy4-flash-Uncensored-GGUF
base_model_relation: quantized
language: [en, zh]
tags: [gguf, hy4-flash, moe, multimodal, quantized, uncensored, text-generation, image-text-to-text]
pipeline_tag: image-text-to-text
inference: false
Hy4-flash-Uncensored-Compact
English | 中文
Format release, not a turnkey inference package.
This checkpoint uses custom GGUF tensor types and a modified Engram layout.
A compatible Runtime is required; stockllama.cppand the public Project Maya
build are not expected to load it as-is.Content Warning: the source model is an uncensored derivative. Outputs may
be unsafe or unlawful in some contexts. You are responsible for compliance and
for adding appropriate safeguards in any deployment.Quantization Source: this checkpoint is a quantized derivative of
alesha-pro/Hy4-flash-Uncensored-GGUF,
not a newly trained base model. The upstream base istencent/Hy4-flash.
This repository is a quantized derivative ofalesha-pro/Hy4-flash-Uncensored-GGUF,
which is derived from tencent/Hy4-flash.
The upstream license is the Tencent Hy License, Version 1.0; see LICENSE.
Overview
Hy4-flash-Uncensored-Compact is a two-part GGUF release plus a vision projector.
The Backbone is split into four precision tiers; the Engram Table is split into
four precision tiers with a per-row index. The vision projector is kept in
BF16/F32 after an FP8 evaluation.
| File | Contents | Size |
|---|---|---|
Hy4-flash-Uncensored-Compact-00001-of-00002.gguf |
Backbone: Attention/MLA, Shared Experts, Routed Experts (Hot/Warm/Cold groups), Embeddings, Output Head, MTP/nextn Tensors | 34.374 GiB |
Hy4-flash-Uncensored-Compact-00002-of-00002.gguf |
Engram Table: Hot, Warm, High-Cold, Low-Cold Tables + 660M-row Index | 26.355 GiB |
mmproj-Hy4-flash-Uncensored-Compact-bf16.gguf |
Vision Encoder and Projector, BF16/F32 | 0.973 GiB |
tokenizer/ |
Source Tokenizer Assets | ~4 MiB |
tools/ |
GGUF Inspector and C# Build Tools | small |
Total weights: about 61.7 GiB. The Engram File is intended to be streamed or
partially cached; it does not need to be fully resident for text-only decoding.
Architecture
The upstream model card describes Hy4-flash as a sparse multimodal MoE:
- 42-layer language Backbone: 1 Dense FFN Layer + 41 MoE Layers;
- Hidden Size 3,072; Vocabulary 120,832;
- 512 Routed Experts per MoE Layer, Top-16 Routing, plus one Shared Expert;
- LatentMoE: Latent Dimension 1,536, Expert Intermediate Size 1,536;
- MLA Attention with hybrid Sparse Attention / Sliding-Window Attention;
- identity Hyper-Connections (iHC) with four Residual Streams;
- Engram N-gram Embeddings at Backbone Layers 1/11/21/31: 8 Hash Heads per
Bigram/Trigram Order, 96 Dimensions per Head, about 63.4B Parameters; - Vision Encoder: 27 Layers, Hidden 1,152, Intermediate 4,304, 16 Heads,
Patch 16, 128×128 Position Grid, 2×2 Feature Merging; - an MTP/nextn Head, and a DFly2 Drafter (about 0.85B Parameters) in the
upstream release.
Approximate totals from the upstream card: ~220B Parameters including Engram,
~12B Activated Parameters per Token. This release keeps the MTP/nextn Tensors
present in the source GGUF; the DFly2 Drafter has not been separately validated.
Quantization
Backbone (File 00001)
The Backbone is rotated with a 512-Weight Normalized Walsh–Hadamard Transform
and explicit ±1 Signs before block quantization. The contract is stored inprism.hadamard.*: Block Size 512, weight_names, sign_widths, sign_values,
and inverse_weight_names (token_embd.weight uses the inverse order).
| Tier | Tensors | Type | Block | bpw | Size |
|---|---|---|---|---|---|
| T0 Critical | 478 | CSQ8 (144) |
512 Weights / 196 B | 3.0625 | 2.42 GiB |
| T1a Hot Experts | 126 | CSQ4 (145) |
512 / 132 B | 2.0625 | 12.02 GiB |
| T1b Warm Experts | 123 | VQ4_128 (146) |
512 / 116 B | 1.8125 | 5.88 GiB |
| T2 Cold Experts | 123 | VQ4_64 (147) |
512 / 100 B | 1.5625 | 13.51 GiB |
| Copy | 811 | Source Q8_0 / F32 | — | — | ~0.55 GiB |
Expert Groups are per Layer:
blk.L.ffn_{gate,up,down}_exps_hot.weight (1536, 1536, 160) CSQ4
blk.L.ffn_{gate,up,down}_exps_warm.weight (1536, 1536, 96) VQ4_128
blk.L.ffn_{gate,up,down}_exps_cold.weight (1536, 1536, 256) VQ4_64
Layers 1–41 use 160/96/256; Layer 42 (MTP) uses 512 Hot Experts. The global
Expert ID → (Group, Local Index) maps are in hy4f.expert_split.*.
Engram (File 00002)
The source Engram Table is (96, 660,006,416) FP8 E4M3. It is stored as four
precision tables plus a 660M-row Index:
| Tier | Rows | Type | Row Bytes | Size |
|---|---|---|---|---|
| Low-Cold | 508,036,986 | ENGRAM_Q2B12 (150) |
32 | 15.14 GiB |
| High-Cold | 123,653,086 | ENGRAM_Q4B12 (148) |
56 | 6.45 GiB |
| Hot | 13,200,128 | FP8 E4M3 (43) | 96 | 1.18 GiB |
| Warm | 15,116,216 | ENGRAM_Q6B12 (149) |
80 | 1.13 GiB |
| Index | 660,006,416 | UINT32 (4) |
4 | 2.46 GiB |
engram_index is one uint32 per Row: the top 2 Bits are the Tier
(0 = Low-Cold, 1 = High-Cold, 2 = Hot, 3 = Warm) and the low 30 Bits are the
Local Row Index. Each Row is eight 12-Value Blocks with eight 8-Bit Logarithmic
Block Scales; the global scale range is in hy4f.engram.scale_lo/scale_hi.
The Hot/Warm Rows were selected from an inferred N-gram heat distribution, not
from a production request trace. They are expected to be re-tuned after real
traffic is observed.
Quality Metrics
Weight Reconstruction
These are Weight Reconstruction metrics on sampled Tensors, not Model
Perplexity, task accuracy, or an end-to-end quality guarantee.
| Tier | Relative L2 | Cosine |
|---|---|---|
| Backbone CSQ8 | 0.185 | 0.983 |
| Backbone CSQ4 | 0.343 | 0.940 |
| Backbone VQ4-128 | 0.368 | 0.930 |
| Backbone VQ4-64 | 0.432 | 0.902 |
| Engram Low-Cold 2-Bit | 0.369 | 0.940 |
| Engram High-Cold 4-Bit | 0.075 | 0.997 |
| Engram Warm 6-Bit | ~0.019 | ~0.9998 |
| Engram Hot FP8 | 0 | 1.0 |
A Parameter-weighted Backbone estimate is roughly 0.38; a Routing-weighted
estimate is roughly 0.36. For Engram, the sampled Hit-weighted estimate is
about 0.05, but the 2-Bit Low-Cold Tier has a long tail that is not represented
well by the calibration sample.
Perplexity and Divergence
Model Perplexity is not reported. It cannot be measured reliably here
without a compatible Runtime and a fixed evaluation corpus; the Weight
Reconstruction numbers above are not a substitute.
As a coarse distribution check, we report the Jensen–Shannon Divergence in
Bits between the source and reconstructed Weight Values on sampled Tensors.
This is a Weight-level Divergence, not a Language-Model Perplexity.
| Tier | JS Divergence (Bits) |
|---|---|
| Backbone CSQ8 | 0.0009 |
| Backbone CSQ4 | 0.0012 |
| Backbone VQ4-128 | 0.0018 |
| Backbone VQ4-64 | 0.0038 |
| Engram Low-Cold 2-Bit | 0.529 |
| Engram High-Cold 4-Bit | 0.241 |
| Engram Warm 6-Bit | 0.147 |
| Engram Hot FP8 | 0 |
The Engram Divergence is larger because the four Tiers use different absolute
scale ranges; compare Divergence within a Tier, not across Tiers.
Vision Projector
The FP8 Vision Projector was evaluated and not quantized: FP8 E4M3 with
Per-32 Block Scales gave about 2.0–2.3% Relative Weight Error on sampled Vision
Tensors, while the File is only about 1 GiB and the same 8.5 bpw footprint as
Q8_0. Keeping BF16 avoids an unvalidated multimodal quality regression.
Memory and Runtime
- Backbone Weights: 34.374 GiB.
- KV Cache for 262,144 Tokens with Q4_0 MLA Latent Cache: roughly 3.4 GiB in the
reference plan; actual size depends on implementation and cache layout. - Compute/Workspace: roughly 1.4 GiB in the reference plan.
- Text-only Resident Estimate: about 39 GiB for Backbone + KV + Workspace,
before Engram caching. - Engram: 26.355 GiB on disk; the Hot and Warm Tables are small enough to keep
resident, while the Cold Tables can be memory-mapped or streamed.
These are planning estimates, not measured Runtime numbers. No Inference Engine
in this repository has been validated end-to-end on this checkpoint.
Inference Engine Guidance
A compatible Runtime needs to implement:
- New Block Types 144–150. Backbone Blocks are 512 Weights; Engram Blocks
are 96 Values (eight 12-Value Sub-Blocks). - Hadamard Rotation Contract for every name in
prism.hadamard.weight_names: applyH · (s ⊙ x)on the input side, and the
inverse order fortoken_embd.weight. - Expert Group Routing: map the Router's global Expert IDs through
hy4f.expert_split.*and dispatch Hot/Warm/Cold Groups separately. - Engram Row Lookup: read
engram_index[row], select the Tier Table, decode
2/4/6-Bit or read FP8, then apply the 96-Dimension Lookup Norm and the existing
Engram Gate/KV Path. - Vulkan-Oriented Kernels: 32-Bit Bitstream Unpack, FP16 Codebooks in Shared
Memory, fused GEMV Table Lookup, Tiled GEMM Decode, Subgroup Reductions. - Chunked Storage: a single Vulkan Storage Buffer may not cover the whole
File; split the 26 GiB Engram Table and the 34 GiB Backbone into Descriptor
Array Chunks.
Stock llama.cpp does not know Types 144–150, the split Expert Names, or the
Engram Index. The public Project Maya build has a different hy_v4_flash Loader
and does not implement these Types. Expect to bring your own Runtime.
Files and Inspection
tools/inspect_gguf.py prints GGUF Key-Values, Tensor Names, Types, and Byte
Sizes; it is a Format Inspection Helper, not a Loader.
License and Attribution
- Upstream Model: Tencent Hy4-flash, Tencent Hy License, Version 1.0.
- Uncensored GGUF Source:
alesha-pro/Hy4-flash-Uncensored-GGUF. - This Repository: a quantized derivative; see
NOTICEandLICENSE. - The Tencent Hy License includes additional commercial Terms for large
Model-as-a-Service businesses (Section 10). Review the License before serving
the Model to third parties.