Qwen4-35B-A3B — Language-Adaptive PLE Pack for Strata
Engine Fork: github.com/code-martin/Strata
Upstream Strata: github.com/Niko1221/Strata
A modular companion pack (~220 MB total) for running Qwen4-35B-A3B (works with any base quant — GSQ-RCO-IQ3_S, GSQ-RCO-IQ3_XXS, UD-Q4_K_XL, UD-Q5_K_XL, and any PLE shard Q4_K_XL / Q8_0 / BF16) with Language-Adaptive PLE, Universal Foreign-Script Filtering, and a compact F16 Abliteration Control Vector with smooth 0–100% runtime scaling.
Why This Pack Exists
Qwen4-35B-A3B introduces a massive 160,003,584-row Per-Layer N-gram Embedding (PLE) table (~11.4 GiB in IQ4_NL, ~20.3 GiB in Q8_0). Keeping the entire table in RAM wastes gigabytes on scripts and n-grams your workload never touches, while reading cold rows from SSD adds I/O latency.
This pack solves three practical problems at once:
- Language-Adaptive PLE (
.plemask+.plebundle) — Any Language Mix, Zero SSD I/O- Splits the 160M-row PLE table into Hot (
IQ4_NL/Q5_0), Warm (Q4_0), and Cold (Q2_NL2.5 bpw Lloyd-Max) tiers directly in RAM. - Languages are completely orthogonal and composable: every
.plemaskis a compact19.1 MiBbitmap over the 160M PLE rows. Combine any subset via comma-separated flags (--ple-hot,--ple-warm) — the engine merges them by bitwise OR and builds a cached.aplefile once (~40 s). - Cache-line N-gram Bundles (
.plebundle): packs all 8 PLE heads of frequent 2-grams/3-grams contiguously in RAM so 40–50% of lookups finish in a single sequential cache-line burst (~0.2 mstotal PLE latency).
- Splits the 160M-row PLE table into Hot (
- Universal Foreign-Script Filter (
--script-ban-file)- Prevents unwanted script bleed (e.g., stray CJK/Kana/Arabic characters in long-context European or Cyrillic chats) at the logit level (
--ban-scripts on|auto|off). - Built per language combination — allow Latin only, Latin + Cyrillic, Latin + Japanese, Latin + Chinese, or generate your own in 1 second.
- Prevents unwanted script bleed (e.g., stray CJK/Kana/Arabic characters in long-context European or Cyrillic chats) at the logit level (
- F16 Abliteration Control Vector (
qwen4-35b-a3b-cvec-f16.gguf) + Smooth0–100%Scale- Converted from
alesha-pro/Qwen4-35B-A3B-GSQ-RCO-Uncensored-GGUF(qwen4-35b-a3b-cvec-nht.gguf) to F16 (157.8 KB, 39 layers, max quantization delta1.21e-4). - Works with our fork's smooth fractional scale (
cvec=0.00..1.00, OpenAI APIexperimental_speed_projection: 0..1or0..100, and the Web UI slider0%..100%) without rebuilding CUDA graphs and with per-scale KV cache isolation.
- Converted from
Included Languages & Files
The included languages are ready-to-use examples spanning Latin, Cyrillic, and CJK/Kana scripts. Mix and match any combination you actually use:
| Folder | File | Role |
|---|---|---|
masks/ |
ple_mask_code.plemask |
Source code (C/C++/CUDA/Python/JS/TS/Rust/Go/Markdown/JSON) |
masks/ |
ple_mask_en.plemask |
English (en) |
masks/ |
ple_mask_ru.plemask |
Russian (ru — Cyrillic) |
masks/ |
ple_mask_de.plemask |
German (de — Latin) |
masks/ |
ple_mask_fr.plemask |
French (fr — Latin) |
masks/ |
ple_mask_es.plemask |
Spanish (es — Latin) |
masks/ |
ple_mask_ja.plemask |
Japanese (ja — CJK + Kana) |
masks/ |
ple_mask_zh.plemask |
Chinese (zh — CJK) |
bundles/ |
ple_bundles_{code,en,ru,de,fr,es,ja,zh}.bin |
Contiguous 8-head cache-line bursts matching each mask |
script-filters/ |
foreign_scripts_latin.bin |
Allows Latin (en/de/fr/es/code); bans Cyrillic, CJK, Kana, Hangul, Arabic, Devanagari, Hebrew, Thai |
script-filters/ |
foreign_scripts_en_ru.bin |
Allows Latin + Cyrillic (en, ru, uk, bg, sr, …) |
script-filters/ |
foreign_scripts_en_ja.bin |
Allows Latin + CJK + Kana (en, ja) |
script-filters/ |
foreign_scripts_en_zh.bin |
Allows Latin + CJK (en, zh) |
cvec/ |
qwen4-35b-a3b-cvec-f16.gguf |
F16 projection abliteration vector (layers 1..39, 157.8 KB) |
configs/ |
strata-qwen4-35b-gsq-rco-iq3s-{en-ru,en-de,en-ja}.json |
Ready Strata serve configs for 3 example language profiles |
Quick Start
1. Build the Strata Fork
git clone https://github.com/code-martin/Strata.git
cd Strata
cmake -S engine -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DSTRATA_ENABLE_CUDA=ON -DSTRATA_GEOMETRY=q4_lite
cmake --build build --target strata -j
2. Pick Your Base Model + PLE Shard
- Model shard 1 (recommended):
Qwen4-35B-A3B-GSQ-RCO-IQ3_S-00001-of-00002.gguf(15.47 GiB) from ISTA-DASLab/Qwen4-35B-A3B-GSQ-RCO-GGUF - PLE shard 2:
Qwen4-35B-A3B-UD-Q4_K_XL-00002-of-00002.gguf(11.4 GiB,IQ4_NL) orQ8_0/BF16shard
3. Compose Any Language Profile
Example A — Code + English (Hot) + Russian (Warm) + Cold Q2_NL:
--ple-hot ple-pack/masks/ple_mask_code.plemask,ple-pack/masks/ple_mask_en.plemask \
--ple-warm ple-pack/masks/ple_mask_ru.plemask \
--ple-cold-q2 \
--ple-bundles ple-pack/bundles/ple_bundles_code.bin,ple-pack/bundles/ple_bundles_en.bin,ple-pack/bundles/ple_bundles_ru.bin \
--script-ban-file ple-pack/script-filters/foreign_scripts_en_ru.bin --ban-scripts on
Example B — Code + English (Hot) + German + French (Warm):
--ple-hot ple-pack/masks/ple_mask_code.plemask,ple-pack/masks/ple_mask_en.plemask \
--ple-warm ple-pack/masks/ple_mask_de.plemask,ple-pack/masks/ple_mask_fr.plemask \
--ple-cold-q2 \
--ple-bundles ple-pack/bundles/ple_bundles_code.bin,ple-pack/bundles/ple_bundles_en.bin,ple-pack/bundles/ple_bundles_de.bin,ple-pack/bundles/ple_bundles_fr.bin \
--script-ban-file ple-pack/script-filters/foreign_scripts_latin.bin --ban-scripts on
Example C — Code + English (Hot) + Japanese (Warm):
--ple-hot ple-pack/masks/ple_mask_code.plemask,ple-pack/masks/ple_mask_en.plemask \
--ple-warm ple-pack/masks/ple_mask_ja.plemask \
--ple-cold-q2 \
--ple-bundles ple-pack/bundles/ple_bundles_code.bin,ple-pack/bundles/ple_bundles_en.bin,ple-pack/bundles/ple_bundles_ja.bin \
--script-ban-file ple-pack/script-filters/foreign_scripts_en_ja.bin --ban-scripts on
4. Build Your Own Language Mask in ~20 Seconds
Need Korean, Polish, Arabic, Ukrainian, Hindi, or a private domain codebase? terminal/tools/ple_mask_build.py builds any language mask + bundle + script filter automatically:
# Build a Polish mask + bundle from Leipzig Wikipedia 300K
python terminal/tools/ple_mask_build.py \
--tokenizer packs/qwen4-35b-a3b-gsq-rco-iq3_s/tokenizer \
--model-gguf models/Qwen4-35B-A3B-GSQ-RCO-IQ3_S-00001-of-00002.gguf \
--ple-gguf models/Qwen4-35B-A3B-UD-Q4_K_XL-00002-of-00002.gguf \
--leipzig pol:300K:2021 \
--out ple_mask_pl.plemask \
--out-bundles ple_bundles_pl.bin
# Export a matching foreign-script filter (e.g., allow English + Korean)
python terminal/tools/ple_mask_build.py \
--tokenizer packs/qwen4-35b-a3b-gsq-rco-iq3_s/tokenizer \
--export-script-ban foreign_scripts_en_ko.bin \
--allow-langs en,ko
Verified Benchmark Snapshot (GSQ-RCO-IQ3_S + Adaptive PLE v2)
Measured on RTX 3090 (4,096 ctx + 400 eval, temp=0.7, no DFlash2):
| Metric | UD-Q5_K_XL (baseline) |
GSQ-RCO-IQ3_S + Adaptive PLE |
|---|---|---|
| Resident experts in VRAM | 2,179 (21.3%) | 4,490 (43.8% — 2.06×) |
| Peak System RAM | 33.22 GiB | 23.56 GiB (-9.66 GiB) |
| Prefill / Decode (EN / RU / CODE) | ~2,700 / ~78 tok/s | 2,801–2,864 / 83.2–84.7 tok/s (PLE 0.2 ms) |
| Perplexity (EN / RU / CODE) | 6.189 / 7.383 / 1.495 | 6.378 / 7.263 / 1.531 |
| Foreign-script leaks (52K ctx) | — | 0 |
Credits & Links
- Strata Fork (Language-Adaptive PLE, Script Filter, F16 cvec + Smooth Scale): github.com/code-martin/Strata
- Original Strata Engine: github.com/Niko1221/Strata
- GSQ-RCO Base Quants: ISTA-DASLab/Qwen4-35B-A3B-GSQ-RCO-GGUF
- Original NHT Refusal Vector: alesha-pro/Qwen4-35B-A3B-GSQ-RCO-Uncensored-GGUF