Run this model with HF Jobs

Run ModelsLab/Filmier-Qwen4-35B-A3B-Looped on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Looped. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Looped on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
File size: 11,250 Bytes
923e503
 
 
 
 
 
 
 
 
 
 
4d84724
 
923e503
 
 
 
 
 
 
 
 
4d84724
923e503
4d84724
 
 
 
 
 
923e503
 
 
4d84724
923e503
 
 
4d84724
923e503
 
 
 
 
 
 
 
4d84724
923e503
4d84724
923e503
4d84724
 
923e503
4d84724
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
923e503
 
 
4d84724
923e503
4d84724
 
 
 
 
 
 
 
 
 
923e503
 
 
4d84724
923e503
4d84724
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
923e503
 
 
4d84724
923e503
 
 
 
 
 
 
 
 
 
4d84724
923e503
 
 
4d84724
923e503
 
 
 
 
 
 
4d84724
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---
license: apache-2.0
base_model:
  - Qwen/Qwen4-35B-A3B
  - Qwen/Qwen4-35B-A3B-FP8
tags:
  - qwen4
  - qwen4_moe
  - looped-transformer
  - test-time-compute
  - pure-recurrence
  - long-context
  - 1m-context
  - filmier
  - vllm
  - mlx
  - hibana
library_name: vllm
---

# Filmier-Qwen4-35B-A3B-Looped (Apache-2.0)

**Pure-Recurrence Wider-Core (`20L`, `L12..31`, 5 QSA Mixers) Looped Transformer Adapter for `Qwen/Qwen4-35B-A3B` (`Qwen/Qwen4-35B-A3B-FP8`)** — trained with **zero base-weight drift** and **zero active LoRA weights** (`lora_b == 0.0`, 100% frozen Qwen4 weights, `28.64M` pure workspace-entry + cross-pass boundary mixer weights), plus pre-exported **Hibana / Sushi / MLX sidecars** for `T=2` (`60L`), `T=3` (`80L`), and `T=4` (`100L`).

Part of the **Filmier** open-source Apache-2.0 AI Filmmaking Model Ecosystem:
- **General Pure-Recurrence `20L` Looped Core (this repo):** `ModelsLab/Filmier-Qwen4-35B-A3B-Looped` — strongest on hard math (`93.33%` AIME 2025), coding (`61.67%` LiveCodeBench v6), real multimodal video (`58.89%` Video-MME, `+5.56 pp`), human story taste (`60.0%` LitBench), and verified **`100.0%` `8K → 1,000K (1M)` context recall with `0.0%` hallucination**.
- **Specialized Screenwriting, Creative Fiction & Directing:** [`ModelsLab/Filmier-Qwen4-35B-A3B-Director`](https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Director) — continual SFT warm-started from `20L` (`95.0%` theatrical screenplay writing, `60.0%` anti-robotic creative fiction, `75.0%` 14-pt H3 shotlists, `91.67%` BFCL, zero catastrophic forgetting).
- **Composable Native Audio Backbone (`<L0` + `L0..L11`):** [`ModelsLab/Filmier-Qwen4-35B-A3B-Audio`](https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Audio) — verified jointly composable with `20L` (`L12..31`) in `scorecards/stage8_joint_verify_20L.json`.

Built using [`jasontitus/loopedqwen`](https://github.com/jasontitus/loopedqwen) and [`jasontitus/loopedqwen-next`](https://github.com/jasontitus/loopedqwen-next).

---

## 1. Key Architectural Finding: `20L` Wider Core (`L12..31`) Scales Monotonically to `T=4` (`100L`)

Qwen4-35B-A3B is a 40-layer hybrid `qwen4_moe` model (`3:1` GatedDeltaNet + Qwen Sparse Attention [QSA], 256-expert MoE, Layer-2 PLE N-gram table, native `1,048,576` [1M] context, built-in `Qwen4ExpMTP` speculative decoding head).

On an identical 1,660-example (`2.38M`-token) zero-contaminated, on-policy 6-domain anchor set, we ablated two pure-recurrence core spans (`delta_rms_match=True`, `lora_b == 0.0`, trained across `T ∈ {2, 3, 4}`):

| Candidate Geometry | Core Span | QSA Mixers | Effective Depth (`T=2 / 3 / 4`) | Val `nll_t1` | Val `nll_t2` (Gain) | Val `nll_t3` (Gain) | Val `nll_t4` (Gain) | Scaling Behavior |
|---|---|---|---:|---:|---:|---:|---:|---|
| **`16L` (`16L/ckpt_best*`)** | `L12..27` (4 macro-blocks) | `[15, 19, 23, 27]` | `56L / 72L / 88L` | `0.21030` | `0.20320` (`+0.00710`) | `0.20327` (`+0.00703`) | `0.20343` (`+0.00687`) | Peaks at `T=2`, saturates at `T=3/4` |
| **`20L` (`20L/ckpt_best*`, Recommended)** | **`L12..31` (5 macro-blocks)** | **`[15, 19, 23, 27, 31]`** | **`60L / 80L / 100L`** | `0.21030` | `0.20329` (`+0.00701`) | `0.20296` (`+0.00734`) | **`0.20268` (`+0.00762`)** | **Strictly monotonic `T=1 → 2 → 3 → 4`** |

---

## 2. Complete Before-vs-After Benchmarks (ALL `reasoning_effort="xhigh"`, Native MTP `k=3`)

Evaluated on 1× NVIDIA RTX PRO 6000 Blackwell (`Qwen/Qwen4-35B-A3B-FP8`, `temperature=0.0`, `reasoning_effort="xhigh"`):

### Core Reasoning, Coding, Tool Calling & Agentic Suites (8 Suites)
| Benchmark Suite | `stock_t1` (40L) | `f20L_t2` (60L) | `f20L_t4` (100L) | `f20L_t4 + CD(0.15)` | Best `f20L` Delta |
|---|---:|---:|---:|---:|---:|
| **AIME 2025** (`n=30`) | 86.67% | **93.33%** | 86.67% | 90.00% *(T=3+CD: **93.33%**, -13.2% tok)* | **+6.67 pp** |
| **AIME 2024** (`n=30`) | 90.00% | **90.00%** | 86.67% | **90.00%** | 0.00 pp |
| **LCB-Hard All-33** (`lcb_v6_20`) | 30.30% (`45.0%`) | 33.33% (`50.0%`) | **36.36% (`60.0%`)** | **36.36%** (`55.0%`) | **+6.06 pp** (`+15.0 pp` on v6-20) |
| **LiveCodeBench v6** (`n=60`) | 58.33% | 60.00% | 58.33% | **61.67%** | **+3.34 pp** |
| **BFCL Tool Calling** (`n=120`) | 89.17% | **90.83%** | **90.83%** | 89.17% | **+1.66 pp** |
| **HumanEvalFix Think** (`n=164`) | 97.56% | **98.17%** | **98.17%** | 95.73% | **+0.61 pp** |
| **HumanEval+ Direct** (`n=164`) | 77.44% | 78.66% | 78.66% | **79.27%** | **+1.83 pp** |
| **Agentic State Planner** (`n=80`) | **100.00%** | 97.50% | 98.75% | **100.00%** | 0.00 pp |

### Real Multimodal Video, Storytelling & Craft Suites (Zero Video Training!)
| Benchmark Suite | `stock_t1` (40L) | `f20L_t2` (60L) | `f20L_t4` (100L) | Best `f20L` Delta |
|---|---:|---:|---:|---:|
| **Video-MME Real** (`n=90`, 24 frames, no subs) | 53.33% | 55.56% | **58.89%** *(Long: **59.52%**)* | **+5.56 pp** *(strictly monotonic!)* |
| **Video-NIAH Retrieval** (`n=30`) | 96.67% | **100.00%** | **100.00%** | **+3.33 pp** *(30/30, 0% trunc)* |
| **LitBench Human Story Taste** (`n=40`) | 50.00% | 52.50% | **60.00%** | **+10.00 pp** |
| **Story Continuity Bench** (`n=40`) | **100.00%** | **100.00%** | **100.00%** | 0.00 pp *(40/40)* |
| **NarrativeQA Test F1** (`n=24`) | 15.39% | 16.26% | **18.46%** | **+3.07 pp F1** *(strictly monotonic!)* |
| **LongBench-v2 Story 128K** (`n=37`) | **43.24%** | 40.54% | **43.24%** *(Event order: 100%)* | 0.00 pp |
| **VideoFeedback AI-Video Critique** (`n=30`, pairwise) | **93.70%** (`r=0.651`) | 79.53% (`r=0.435`) | 90.94% (`r=0.571`) | `-2.76 pp` *(scales +11.4 pp T=2→4)* |
| **Screenplay→H3 Shotlists** (`n=20`, 14-pt rubric) | **85.0%** (`10%` trunc) | 55.0% (`45%` trunc*) | 55.0% (`45%` trunc* / `+CD`: 70%) | *Use `Filmier-Director` (`75%`)!* |

*\*Note:* Pure-Recurrence `20L` thinks ~1.5K tokens longer on dense JSON shotlists (100% of non-truncated completions passed the 14-pt rubric, but more hit the 16K eval cap). For scriptwriting, creative fiction, and H3 directing, use [`ModelsLab/Filmier-Qwen4-35B-A3B-Director`](https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Director) (`95%` screenplay writing, `60%` creative fiction, `75%` H3 shotlists).

### Head-to-Head Showdown vs. `sliderforthewin/Looped-Qwen4-35B-A3B` (`16L`, MIT)
| Model / Arm | Eff. Layers | AIME 2025 | LCB-Hard All-33 (`v6_20`) | LitBench Taste |
|---|---:|---:|---:|---:|
| `stock_t1` | 40L | 86.67% | 30.30% (`45.0%`) | 50.00% |
| **`Filmier 20L T=2`** | **60L** | **93.33%** | 33.33% (`50.0%`) | 52.50% |
| **`Filmier 20L T=3 + CD(0.15)`** | **80L** | **93.33%** (`-13.2%` tok) | 27.27% (`45.0%`) | 52.50% |
| **`Filmier 20L T=4`** | **100L** | 86.67% | 36.36% (**`60.0%`**) | **60.00%** |
| `sliderforthewin_16L T=3` *(MIT ref)* | 72L | 83.33% | **39.39%** (`60.0%`) | 55.00% |
| `sliderforthewin_16L T=3 + CD(0.15)` | 72L | 90.00% | 36.36% (`55.0%`) | 57.50% |

---

## 3. `8K → 1,000K (1M)` Context Cliff, Hallucination & Compaction (`T=1..4`, `xhigh`, `MTP k=3`)

Full report in `longctx_cliff/longctx_cliff_report.md`. Tested across real public feature screenplays (`MovieSum val.jsonl`) on **1× 96 GB GPU** (`kv_cache_dtype="fp8"`, `indexer_kv_dtype="fp8"`, `enforce_eager=True`, `MTP k=3`):

| Arm (Eff. Layers) | `8K` | `32K` | `64K` | `128K` | `200K` | `400K` | `650K` | **`1,000K (1M)`** | Hallucination Rate | KV Cache Capacity (1× 96GB) |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| `stock_t1` (`40L`) | 100% | 100% | 100% | 100% | 100% | 100% | 100% | **100.0%** | **0.0%** | `4.54M` tokens |
| **`f20L_t2`** (`60L`) | 100% | 100% | 100% | 100% | 100% | 100% | 100% | **100.0%** | **0.0%** | `2.94M` tokens |
| **`f20L_t3`** (`80L`) | 100% | 100% | 100% | 100% | 100% | 100% | 100% | **100.0%** | **0.0%** | `2.23M` tokens |
| **`f20L_t4`** (`100L`) | 100% | 100% | 100% | 100% | 100% | 100% | 100% | **100.0%** | **0.0%** | `1.79M` tokens |

- **Compaction A/B/C (`64K` & `128K`, ALL 4 loop depths):** `Raw Context: 100.0%` vs **`Prose /compact: 0.0%`** vs **`Structured Ledger /compact: 100.0%`** — proving lossy prose summarization destroys multi-hop prop/scene continuity while a pinned `continuity_ledger.json` restores `100%` accuracy at `<1%` of raw tokens.

---

## 4. Native Qwen4 MTP Speculative Decoding Speedup (`scorecards/mtp_specdecode_bench.json`)

| Configuration (1× RTX PRO 6000 Blackwell) | Batch=1 Decode | Speedup | Batch=8 Decode | Cold Init |
|---|---:|---:|---:|---:|
| `20L T=2` (`60L`), No MTP, CPU PLE | `110.3 tok/s` | 1.00× | `385.0 tok/s` | `96.8s` |
| **`20L T=2` (`60L`), MTP `k=3`, GPU PLE (`cpu_offload=False`)** | **`183.8 tok/s`** | **1.67×** | **`523.9 tok/s`** | **`52.8s`** |
| `20L T=4` (`100L`), No MTP, CPU PLE | `63.8 tok/s` | 1.00× | `254.8 tok/s` | `79.3s` |
| **`20L T=4` (`100L`), MTP `k=3`, CPU PLE** | **`117.2 tok/s`** | **1.84×** | **`331.3 tok/s`** | `88.8s` |

---

## 5. Repository Contents & Quick Start

```text
20L/                                  # Recommended Pure-Recurrence 20L adapter (L12..31, 5 QSA mixers)
16L/                                  # 16L core ablation (L12..27, 4 QSA mixers)
hibana_sidecars/                      # Verified Apple Silicon MLX/Hibana/Sushi sidecars (T=2,3,4 × 20L & 16L)
longctx_cliff/                        # 8K -> 1M cliff, hallucination & compaction report + JSONs
patches/modeling_looped_qwen4_exp_patched.py  # Multi-shard VLM loader fix for LoopedQwen4MoeForConditionalGeneration
scorecards/                           # Complete 16-suite JSON scorecards, MTP bench & Stage 8 audio-composability proof
```

```bash
export VLLM_LOOPED_CKPT=/path/to/20L/ckpt_best_alesha_v3.safetensors
export VLLM_LOOPED_NUM_PASSES=2      # 2 (60L fast+93.3% AIME), 3 (80L), or 4 (100L max video/coding/taste)
export VLLM_LOOPED_CD_OMEGA=0.0      # or 0.15 for T=3/T=4 LoopCD

vllm serve Qwen/Qwen4-35B-A3B-FP8 \
  --trust-remote-code \
  --kv-cache-dtype fp8 \
  --hf-overrides '{"architectures":["LoopedQwen4MoeForCausalLM"]}' \
  --worker-extension-cls vllm_looped_qwen38.worker_ext.LoopedWorkerExtension \
  --compilation-config '{"mode":0,"cudagraph_mode":"FULL_DECODE_ONLY"}' \
  --additional-config '{"gdn_prefill_backend":"triton"}' \
  --attention-config '{"indexer_kv_dtype":"fp8"}' \
  --engram-config '{"cpu_offload":false}' \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3}'
```

For multimodal video (`LoopedQwen4MoeForConditionalGeneration`), apply `patches/modeling_looped_qwen4_exp_patched.py` to fix upstream multi-shard safetensors `SlicedLoRALinear` initialization.

---

## License & Attribution

- **License:** Apache-2.0
- **Base Model:** [`Qwen/Qwen4-35B-A3B`](https://huggingface.co/Qwen/Qwen4-35B-A3B) (Alibaba Qwen Team)
- **Looped Transformer Framework & Reference:** [`jasontitus/loopedqwen`](https://github.com/jasontitus/loopedqwen), [`jasontitus/loopedqwen-next`](https://github.com/jasontitus/loopedqwen-next), and [`sliderforthewin/Looped-Qwen4-35B-A3B`](https://huggingface.co/sliderforthewin/Looped-Qwen4-35B-A3B)
- **Companion Ecosystem Models:** [`ModelsLab/Filmier-Qwen4-35B-A3B-Director`](https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Director) | [`ModelsLab/Filmier-Qwen4-35B-A3B-Audio`](https://huggingface.co/ModelsLab/Filmier-Qwen4-35B-A3B-Audio)