Mungert commited on
Commit
a5ddd93
·
verified ·
0 Parent(s):

Super-squash history to reclaim storage

Browse files
.gitattributes ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ f16/LongWriter-Zero-32B-f16-00001-of-00002.gguf filter=lfs diff=lfs merge=lfs -text
37
+ f16/LongWriter-Zero-32B-f16-00002-of-00002.gguf filter=lfs diff=lfs merge=lfs -text
38
+ LongWriter-Zero-32B-f16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
39
+ LongWriter-Zero-32B-bf16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
40
+ LongWriter-Zero-32B-f16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
41
+ LongWriter-Zero-32B-bf16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
42
+ LongWriter-Zero-32B-f16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
43
+ LongWriter-Zero-32B-bf16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
44
+ LongWriter-Zero-32B-q2_k_l.gguf filter=lfs diff=lfs merge=lfs -text
45
+ LongWriter-Zero-32B-q3_k_l.gguf filter=lfs diff=lfs merge=lfs -text
46
+ LongWriter-Zero-32B-q4_k_l.gguf filter=lfs diff=lfs merge=lfs -text
47
+ LongWriter-Zero-32B-q5_k_l.gguf filter=lfs diff=lfs merge=lfs -text
48
+ LongWriter-Zero-32B-q6_k_l.gguf filter=lfs diff=lfs merge=lfs -text
49
+ LongWriter-Zero-32B-q2_k_m.gguf filter=lfs diff=lfs merge=lfs -text
50
+ LongWriter-Zero-32B-q2_k_s.gguf filter=lfs diff=lfs merge=lfs -text
51
+ LongWriter-Zero-32B-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
52
+ LongWriter-Zero-32B-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
53
+ LongWriter-Zero-32B-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
54
+ LongWriter-Zero-32B-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
55
+ LongWriter-Zero-32B-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
56
+ LongWriter-Zero-32B-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
57
+ LongWriter-Zero-32B-q6_k_m.gguf filter=lfs diff=lfs merge=lfs -text
58
+ LongWriter-Zero-32B-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
59
+ LongWriter-Zero-32B-q4_0.gguf filter=lfs diff=lfs merge=lfs -text
60
+ LongWriter-Zero-32B-q4_1.gguf filter=lfs diff=lfs merge=lfs -text
61
+ LongWriter-Zero-32B-q4_0_l.gguf filter=lfs diff=lfs merge=lfs -text
62
+ LongWriter-Zero-32B-q4_1_l.gguf filter=lfs diff=lfs merge=lfs -text
63
+ LongWriter-Zero-32B-q5_0.gguf filter=lfs diff=lfs merge=lfs -text
64
+ LongWriter-Zero-32B-q5_1.gguf filter=lfs diff=lfs merge=lfs -text
65
+ LongWriter-Zero-32B-q5_0_l.gguf filter=lfs diff=lfs merge=lfs -text
66
+ LongWriter-Zero-32B-q5_1_l.gguf filter=lfs diff=lfs merge=lfs -text
67
+ LongWriter-Zero-32B-iq1_s.gguf filter=lfs diff=lfs merge=lfs -text
68
+ LongWriter-Zero-32B-iq1_m.gguf filter=lfs diff=lfs merge=lfs -text
69
+ LongWriter-Zero-32B-iq2_xs.gguf filter=lfs diff=lfs merge=lfs -text
70
+ LongWriter-Zero-32B-iq2_xxs.gguf filter=lfs diff=lfs merge=lfs -text
71
+ LongWriter-Zero-32B-iq2_s.gguf filter=lfs diff=lfs merge=lfs -text
72
+ LongWriter-Zero-32B-iq2_m.gguf filter=lfs diff=lfs merge=lfs -text
73
+ LongWriter-Zero-32B-iq3_xs.gguf filter=lfs diff=lfs merge=lfs -text
74
+ LongWriter-Zero-32B-iq3_xxs.gguf filter=lfs diff=lfs merge=lfs -text
75
+ LongWriter-Zero-32B-iq3_s.gguf filter=lfs diff=lfs merge=lfs -text
76
+ LongWriter-Zero-32B-iq3_m.gguf filter=lfs diff=lfs merge=lfs -text
77
+ LongWriter-Zero-32B-iq4_xs.gguf filter=lfs diff=lfs merge=lfs -text
78
+ LongWriter-Zero-32B-iq4_nl.gguf filter=lfs diff=lfs merge=lfs -text
79
+ LongWriter-Zero-32B.imatrix filter=lfs diff=lfs merge=lfs -text
80
+ bf16/LongWriter-Zero-32B-bf16-00001-of-00002.gguf filter=lfs diff=lfs merge=lfs -text
81
+ bf16/LongWriter-Zero-32B-bf16-00002-of-00002.gguf filter=lfs diff=lfs merge=lfs -text
LongWriter-Zero-32B-bf16_q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffe1bd46c5a0525cf75823fb526e95a6bde33440346d2bd11f25725d1bfb5675
3
+ size 46661602272
LongWriter-Zero-32B-f16_q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc882959966fb028a18d8ce96e8fedd480744dff4f4830544d76cde52d8c31d8
3
+ size 46661602272
LongWriter-Zero-32B-iq1_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d5f6e474ed84c0bee02d83db6d1f905141c3c01d911b0f3eae69fa6ffc89c06
3
+ size 9742306560
LongWriter-Zero-32B-iq1_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:538cd21c080a547eb29648f27c52a22e170492a6b4d5d0da8b3882b551695801
3
+ size 8992492800
LongWriter-Zero-32B-iq2_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c720d78caf2402c4df2c09b15f536ed79485c6d4e2daba2fccb54242903265e
3
+ size 11985849600
LongWriter-Zero-32B-iq2_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31c1e1da0868e3e1bad7a76f25393d04b6c742c082547ebef74369136ecea9b4
3
+ size 11382263040
LongWriter-Zero-32B-iq2_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1970ff73b890088929dd63f85e959b987dab1a78eacb633e5837a5e9299b292e
3
+ size 11016326400
LongWriter-Zero-32B-iq2_xxs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e4aa16662f564c482c71b4fbfd1d54cce7293e5a161d5604a893587cffe9ffa
3
+ size 10124954880
LongWriter-Zero-32B-iq3_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0df5566d29cc629367f1993a627a9678cbbe43a4d21364d9937b425d37f34ca
3
+ size 15545355520
LongWriter-Zero-32B-iq3_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9262884b201fdecaa4279d4ba31f71ef8206ff212778d9a5c979d8f36e9669b3
3
+ size 15545355520
LongWriter-Zero-32B-iq3_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e51922ad5505387583d5590198dfb47ed10f130bb7322e793c4a6d8cd3131dea
3
+ size 13967002880
LongWriter-Zero-32B-iq3_xxs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:105fff24b4291d85032d27ba31e71133c89daaa0e6af5b0c389beb862d5f1318
3
+ size 13628837120
LongWriter-Zero-32B-iq4_nl.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c0965c737a6ccd4095ef81b1bcbaef9621860af0a110166312e7b84f463b765
3
+ size 18682174720
LongWriter-Zero-32B-iq4_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b45492501420e4355d5d3259ba41e12b30b56916a22eb4efbc4ef1075ef759a
3
+ size 17693154560
LongWriter-Zero-32B-q2_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddaa451160a84de6196455063ba0e1a479df65e9f44be2367065121bec0117eb
3
+ size 12590296320
LongWriter-Zero-32B-q2_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:581fcb2328a176ba4d112e7f656f262ce34bbf499b3d8b0433ceadda465b3155
3
+ size 12383489280
LongWriter-Zero-32B-q3_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b79d6a9b8f3ea3eba4e123a0c56486be4c129e86a4ac4b55bd4f3325779d263
3
+ size 16126127360
LongWriter-Zero-32B-q3_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2c06b41f38f5bc33e3e179c52823d80724d180e6b60f758efa6b93206dea105
3
+ size 15919320320
LongWriter-Zero-32B-q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19f051f56333011f2dd5cbfbfecfda43acff8cc23c93de6a90e34e15a01a9da0
3
+ size 18439507200
LongWriter-Zero-32B-q4_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1499f60a5bc80c8ca8eb1ca285e9dbf6de81b9fbd214c11fca82921449b5f12e
3
+ size 20487179520
LongWriter-Zero-32B-q4_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:475ba12c5ce8ac8f7ed8d4d3a8d7ec26e410879ee9df0b7456389d19930dd16c
3
+ size 19824979200
LongWriter-Zero-32B-q4_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f609f62cfeb37d46f9857d66fbfcd407d147ffd180aa98070719ea3ecafcfca1
3
+ size 19161427200
LongWriter-Zero-32B-q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc91f1654fd889d9e3c8ce7b76ac7cbe5d7c4b75e6b6dc5c042c189dc87b1677
3
+ size 22534851840
LongWriter-Zero-32B-q5_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec7e7f6f82b660141a3dc1e96bd58d8214cca180378ec8f0ed5c0bea29b6189f
3
+ size 24582524160
LongWriter-Zero-32B-q5_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0c7350ce9d8ecc6f9fe5ec6bd8675419b6e5f07060ab6bda68a296ed3fc56c6
3
+ size 23414304000
LongWriter-Zero-32B-q5_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2886b1f674ed7baf51953be4b76bff277f5b8683a900e91789e253fa37cea2c2
3
+ size 23063358720
LongWriter-Zero-32B-q6_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:566bf3515c8a9b20618424e696f954797cc43df2a6e7342cca530a8ddf1b78db
3
+ size 26886155520
LongWriter-Zero-32B-q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6afc827b0d3589c3ef911bb773093d2e45a6c2974f46633dae1ab9b162d5ec26
3
+ size 34820885472
LongWriter-Zero-32B.imatrix ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0f1a93c8108d2b331ff897bd7f1705da3b244d0e9508c2710eb051be708a748
3
+ size 14957098
README.md ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - THU-KEG/LongWriter-Zero-RLData
5
+ base_model:
6
+ - Qwen/Qwen2.5-32B
7
+ tags:
8
+ - reinforcement-learning
9
+ - writing
10
+ - Long Context
11
+ language:
12
+ - en
13
+ - zh
14
+ pipeline_tag: text-generation
15
+ library_name: transformers
16
+ ---
17
+
18
+ # <span style="color: #7FFF7F;">LongWriter-Zero-32B GGUF Models</span>
19
+
20
+
21
+ ## <span style="color: #7F7FFF;">Model Generation Details</span>
22
+
23
+ This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`63a7bb3c`](https://github.com/ggerganov/llama.cpp/commit/63a7bb3c7e1c6b0a92d03b0a594d3cd501d6ed3e).
24
+
25
+
26
+
27
+
28
+
29
+ ---
30
+
31
+ ## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
32
+
33
+ I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
34
+
35
+ In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
36
+ 👉 [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
37
+
38
+ While this does increase model file size, it significantly improves precision for a given quantization level.
39
+
40
+ ### **I'd love your feedback—have you tried this? How does it perform for you?**
41
+
42
+
43
+
44
+
45
+ ---
46
+
47
+ <a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
48
+ Click here to get info on choosing the right GGUF model format
49
+ </a>
50
+
51
+ ---
52
+
53
+
54
+
55
+ <!--Begin Original Model Card-->
56
+
57
+
58
+ # LongWriter-Zero ✍️ — Mastering Ultra-Long Text Generation via Reinforcement Learning
59
+
60
+ <p align="center">
61
+ 🤗 <a href="https://huggingface.co/datasets/THU-KEG/LongWriter-Zero-RLData" target="_blank">HF Dataset</a> • 📃 <a href="https://arxiv.org/abs/2506.18841" target="_blank">Paper</a>
62
+ </p>
63
+
64
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63369da91ba5d5ece24118a4/TLTwlGYvPZ1-99MgiveAA.png)
65
+
66
+ ## 🔍 Table of Contents
67
+ - [🚀 LongWriter-Zero](#longwriter_zero)
68
+ - [📊 Benchmarks & Evaluation](#evaluation)
69
+ - [⚡ Quick Start](#quick_start)
70
+ - [📝 Citation](#citation)
71
+
72
+ <a name="longwriter_zero"></a>
73
+ ## 🚀 LongWriter-Zero
74
+
75
+ **LongWriter-Zero** is a *purely reinforcement learning (RL)-based* large language model capable of generating coherent passages exceeding **10,000 tokens**.
76
+
77
+ Built upon **Qwen 2.5-32B-Base**, the training process includes:
78
+
79
+ - **30 billion-token continual pretraining** on long-form books and technical reports to enhance fundamental writing capabilities;
80
+ - Application of **Group Relative Policy Optimization (GRPO)** with a composite reward function:
81
+ - *Length Reward Model (RM)* enforces the desired output length,
82
+ - *Writing RM* scores fluency, coherence, and helpfulness,
83
+ - *Format RM* ensures strict adherence to the `<think>…</think><answer>…</answer>` structure, and also detects repeated content to avoid redundancy;
84
+ - A dedicated prompting strategy that encourages models to *explicitly reflect* before answering, thereby improving structural planning and fine-grained length control.
85
+
86
+ The resulting model, **LongWriter-Zero-32B**, matches or surpasses the performance of 100B-scale models in ultra-long-form generation.
87
+
88
+ <a name="evaluation"></a>
89
+ ## 📊 Benchmarks & Evaluation
90
+
91
+ LongWriter-Zero’s effectiveness is demonstrated on two fronts: **WritingBench** and **Arena-Write** for automatic scoring and a **human-in-the-loop win-rate study** for pairwise quality comparison.
92
+
93
+ ---
94
+
95
+ ### 📝 WritingBench & Arena-Write Results
96
+
97
+
98
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63369da91ba5d5ece24118a4/XF1LI5Kjuytmfrfg6ot2p.png)
99
+
100
+ > WritingBench (scale 1–10) & Arena-write (Elo) performance of different LLMs .
101
+
102
+
103
+ ---
104
+
105
+ ### 🏆 Win-Rate Results
106
+
107
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63369da91ba5d5ece24118a4/_uWmcqnMFWGLN_iQb1bdx.png)
108
+
109
+ > Donut charts showing win/tie/loss proportions against six baselines (left) and aggregated human evaluation (right).
110
+
111
+ **Summary:** LongWriter-Zero achieves the highest automatic WritingBench score among open models and secures dominant win-rates in pairwise GPT-4.1 evaluations, confirming its superior quality in ultra-long-form generation while maintaining efficiency.
112
+
113
+
114
+ <a name="quick_start"></a>
115
+ ## ⚡ Quick Start&nbsp;(HF generate)
116
+
117
+ ```python
118
+ import re
119
+ model_name = "THU-KEG/LongWriter-Zero-32B"
120
+
121
+ model = AutoModelForCausalLM.from_pretrained(
122
+ model_name,
123
+ torch_dtype="auto",
124
+ device_map="auto"
125
+ )
126
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
127
+ def format_prompt_with_template(prompt):
128
+
129
+ base_format_zn = r"用户与助手之间的对话。用户提供一个写作/通用任务,助手完成它。助手首先在脑海中深入思考写作/回答过程,然后向用户提供最终的书面作品。助手应进行全面而深入的规划,确保写作/通用任务的每个方面都详细且结构合理。如果写作要求存在任何不确定性或歧义,助手应反思,向自己提出澄清性问题,并探索多种写作方式,以确保最终作品达到最高质量标准。由于写作是一个既富有创造性又需要结构性的任务,助手应从多个角度进行分析,考虑连贯性、清晰度、风格、语气、受众和目的,等等因素。此外,助手还应对作品进行审查和优化,以增强其表达效果。写作思考过程和最终的书面作品分别用 <think> </think> 和 <answer> </answer> 标签包裹,如下所示:<think>详细的写作规划和结构设计,可能包括头脑风暴、大纲制定、风格选择、受众适配、反思以及质量检查等等。</think> <answer>经过充分优化和润色的最终书面作品。</answer> <|用户|>: {question} <|助手|>:"
130
+ base_format_en = r"A conversation between the user and the assistant. The user provides a writing/general task, and the assistant completes it. The assistant first deeply thinks through the writing/answering process in their mind before providing the final written work to the user. The assistant should engage in comprehensive and in-depth planning to ensure that every aspect of the writing/general task is detailed and well-structured. If there is any uncertainty or ambiguity in the writing request, the assistant should reflect, ask themselves clarifying questions, and explore multiple writing approaches to ensure the final output meets the highest quality standards. Since writing is both a creative and structured task, the assistant should analyze it from multiple perspectives, considering coherence, clarity, style, tone, audience, purpose, etc.. Additionally, the assistant should review and refine the work to enhance its expressiveness. The writing thought process and the final written work should be enclosed within <think> </think> and <answer> </answer> tags, respectively, as shown below: <think>A comprehensive strategy for writing that encompasses detailed planning and structural design—including brainstorming, outlining, style selection, audience adaptation, self-reflection, quality assurance, etc..</think> <answer>The final written work after thorough optimization and refinement.</answer> <|user|>: {question} <|assistant|>:"
131
+ base_format = base_format_zn if re.search(r'[\u4e00-\u9fff]', prompt) else base_format_en
132
+ formatted_prompt = base_format.format(question=prompt)
133
+ return formatted_prompt
134
+
135
+ prompt = "Write a 500-word story."
136
+ messages = [
137
+ {"role": "user", "content": format_prompt_with_template(prompt)}
138
+ ]
139
+ text = tokenizer.apply_chat_template(
140
+ messages,
141
+ tokenize=False,
142
+ add_generation_prompt=True
143
+ )
144
+
145
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
146
+
147
+ generated_ids = model.generate(
148
+ **model_inputs,
149
+ max_new_tokens=2048,
150
+ temperature=0.6,
151
+ do_sample=True,
152
+ stop_strings=["<|user|>", "<|endoftext|>", "</answer>"],
153
+ tokenizer=tokenizer
154
+ )
155
+ generated_ids = [
156
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
157
+ ]
158
+
159
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
160
+
161
+ print(response)
162
+ ```
163
+ *Note: We use a slightly different tokenizer and chat template compared to the original Qwen2.5-32B-Instruct model.*
164
+
165
+ ## ⚡ Quick Start&nbsp;(SGlang)
166
+
167
+ The snippet below shows how to format prompts with LongWriter-Zero’s `<think> … </think><answer> … </answer>` protocol and call the model through an SGlang-powered endpoint supporting streaming responses.
168
+
169
+ ```python
170
+ import json, requests, re
171
+
172
+ def format_prompt_with_template(prompt):
173
+
174
+ base_format_zn = r"用户与助手之间的对话。用户提供一个写作/通用任务,助手完成它。助手首先在脑海中深入思考写作/回答过程,然后向用户提供最终的书面作品。助手应进行全面而深入的规划,确保写作/通用任务的每个方面都详细且结构合理。如果写作要求存在任何不确定性或歧义,助手应反思,向自己提出澄清性问题,并探索多种写作方式,以确保最终作品达到最高质量标准。由于写作是一个既富有创造性又需要结构性的任务,助手应从多个角度进行分析,考虑连贯性、清晰度、风格、语气、受众和目的,等等因素。此外,助手还应对作品进行审查和优化,以增强其表达效果。写作思考过程和最终的书面作品分别用 <think> </think> 和 <answer> </answer> 标签包裹,如下所示:<think>详细的写作规划和结构设计,可能包括头脑风暴、大纲制定、风格选择、受众适配、反思以及质量检查等等。</think> <answer>经过充分优化和润色的最终书面作品。</answer> <|用户|>: {question} <|助手|>:"
175
+ base_format_en = r"A conversation between the user and the assistant. The user provides a writing/general task, and the assistant completes it. The assistant first deeply thinks through the writing/answering process in their mind before providing the final written work to the user. The assistant should engage in comprehensive and in-depth planning to ensure that every aspect of the writing/general task is detailed and well-structured. If there is any uncertainty or ambiguity in the writing request, the assistant should reflect, ask themselves clarifying questions, and explore multiple writing approaches to ensure the final output meets the highest quality standards. Since writing is both a creative and structured task, the assistant should analyze it from multiple perspectives, considering coherence, clarity, style, tone, audience, purpose, etc.. Additionally, the assistant should review and refine the work to enhance its expressiveness. The writing thought process and the final written work should be enclosed within <think> </think> and <answer> </answer> tags, respectively, as shown below: <think>A comprehensive strategy for writing that encompasses detailed planning and structural design—including brainstorming, outlining, style selection, audience adaptation, self-reflection, quality assurance, etc..</think> <answer>The final written work after thorough optimization and refinement.</answer> <|user|>: {question} <|assistant|>:"
176
+ base_format = base_format_zn if re.search(r'[\u4e00-\u9fff]', prompt) else base_format_en
177
+ formatted_prompt = base_format.format(question=prompt)
178
+ return formatted_prompt
179
+
180
+
181
+
182
+ prompt = "XXXX" # ← replace with your writing task
183
+ data = {
184
+ "model": "LongWriter-Zero-32B",
185
+ "prompt": format_prompt_with_template(prompt),
186
+ "temperature": 0.6,
187
+ "top_p": 0.95,
188
+ "max_tokens": 15500,
189
+ "stop": ["<|user|>", "<|endoftext|>", "</answer>"],
190
+ "stream": True,
191
+ }
192
+
193
+ # SGlang Gateway (example)
194
+ response = requests.post(
195
+ "http://XXXX:9999/v1/completions", # ← replace with your IP
196
+ json=data,
197
+ headers={"Content-Type": "application/json"},
198
+ timeout=1200,
199
+ stream=True,
200
+ )
201
+
202
+ for chunk in response.iter_lines():
203
+ if chunk and chunk.startswith(b"data:"):
204
+ if chunk == b"data: [DONE]":
205
+ break
206
+ payload = json.loads(chunk[5:])
207
+ print(payload["choices"][0]["text"], end="", flush=True)
208
+ ```
209
+ <a name="citation"></a>
210
+ ## 📝 Citation
211
+
212
+ ```bibtex
213
+ @misc{wu2025longwriterzeromasteringultralongtext,
214
+ title={LongWriter-Zero: Mastering Ultra-Long Text Generation via Reinforcement Learning},
215
+ author={Yuhao Wu and Yushi Bai and Zhiqiang Hu and Roy Ka-Wei Lee and Juanzi Li},
216
+ year={2025},
217
+ eprint={2506.18841},
218
+ archivePrefix={arXiv},
219
+ primaryClass={cs.CL},
220
+ url={https://arxiv.org/abs/2506.18841},
221
+ }
222
+
223
+ <!--End Original Model Card-->
224
+
225
+ ---
226
+
227
+ # <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
228
+
229
+ Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
230
+
231
+ 👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
232
+
233
+
234
+ The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
235
+
236
+ 💬 **How to test**:
237
+ Choose an **AI assistant type**:
238
+ - `TurboLLM` (GPT-4.1-mini)
239
+ - `HugLLM` (Hugginface Open-source models)
240
+ - `TestLLM` (Experimental CPU-only)
241
+
242
+ ### **What I’m Testing**
243
+ I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
244
+ - **Function calling** against live network services
245
+ - **How small can a model go** while still handling:
246
+ - Automated **Nmap security scans**
247
+ - **Quantum-readiness checks**
248
+ - **Network Monitoring tasks**
249
+
250
+ 🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
251
+ - ✅ **Zero-configuration setup**
252
+ - ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
253
+ - 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
254
+
255
+ ### **Other Assistants**
256
+ 🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
257
+ - **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
258
+ - **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
259
+ - **Real-time network diagnostics and monitoring**
260
+ - **Security Audits**
261
+ - **Penetration testing** (Nmap/Metasploit)
262
+
263
+ 🔵 **HugLLM** – Latest Open-source models:
264
+ - 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
265
+
266
+ ### 💡 **Example commands you could test**:
267
+ 1. `"Give me info on my websites SSL certificate"`
268
+ 2. `"Check if my server is using quantum safe encyption for communication"`
269
+ 3. `"Run a comprehensive security audit on my server"`
270
+ 4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
271
+
272
+ ### Final Word
273
+
274
+ I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
275
+
276
+ If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
277
+
278
+ I'm also open to job opportunities or sponsorship.
279
+
280
+ Thank you! 😊
bf16/LongWriter-Zero-32B-bf16-00001-of-00002.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a60329e189a9479921cd55ff939111aef8a51d69d8a156c4e45fe4e58636a6c
3
+ size 45902462976
bf16/LongWriter-Zero-32B-bf16-00002-of-00002.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba30b74ffbb366baba855169dfb1e9c71476cc98ab2a1cc2628d46362834f48a
3
+ size 19633507296
f16/LongWriter-Zero-32B-f16-00001-of-00002.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a6b281b3e6ce9e2e12ed89a9a67d425e6b0e27471e6feab257617e2d11970aa
3
+ size 45902462976
f16/LongWriter-Zero-32B-f16-00002-of-00002.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69571c76657a623c3991ec7d166d32875b09bb0dd4309a4aa4eca1ad26851413
3
+ size 19633507296