Text Generation
GGUF
Safetensors
Transformers
English
Chinese
gemma4_unified
image-text-to-text
humanizer
text-rewriting
rewriting
paraphrase
style-transfer
llama.cpp
gemma4
conversational
Instructions to use jialinyyzz/humanizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jialinyyzz/humanizer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jialinyyzz/humanizer")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("jialinyyzz/humanizer") model = AutoModelForMultimodalLM.from_pretrained("jialinyyzz/humanizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use jialinyyzz/humanizer with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf jialinyyzz/humanizer:Q4_K_M # Run inference directly in the terminal: llama cli -hf jialinyyzz/humanizer:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jialinyyzz/humanizer:Q4_K_M # Run inference directly in the terminal: llama cli -hf jialinyyzz/humanizer:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf jialinyyzz/humanizer:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf jialinyyzz/humanizer:Q4_K_M
Use Docker
docker model run hf.co/jialinyyzz/humanizer:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use jialinyyzz/humanizer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jialinyyzz/humanizer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jialinyyzz/humanizer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jialinyyzz/humanizer:Q4_K_M
- SGLang
How to use jialinyyzz/humanizer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jialinyyzz/humanizer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jialinyyzz/humanizer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jialinyyzz/humanizer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jialinyyzz/humanizer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use jialinyyzz/humanizer with Ollama:
ollama run hf.co/jialinyyzz/humanizer:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use jialinyyzz/humanizer with Docker Model Runner:
docker model run hf.co/jialinyyzz/humanizer:Q4_K_M
- Lemonade
How to use jialinyyzz/humanizer with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jialinyyzz/humanizer:Q4_K_M
Run and chat with the model
lemonade run user.humanizer-Q4_K_M
List all available models
lemonade list
- Atomic Chat
model card and docs for RLRt2: new results, Q4_K_M released, checksums, new before/after images
Browse files- .gitattributes +1 -0
- AGENTS.md +12 -11
- README.md +36 -33
- USAGE.md +23 -21
- USAGE.zh.md +23 -21
- assets/compare-en-email.png +2 -2
- assets/{compare-en-reddit.png → compare-en-forum.png} +2 -2
- assets/compare-zh-email.png +2 -2
- assets/compare-zh-zhihu.png +2 -2
- assets/results-detector-en.png +2 -2
- assets/results-detector-zh.png +2 -2
- assets/results-fidelity-en.png +2 -2
- assets/results-fidelity-zh.png +2 -2
- assets/training-en.png +2 -2
- assets/training-zh.png +2 -2
.gitattributes
CHANGED
|
@@ -61,3 +61,4 @@ assets/app-en.png filter=lfs diff=lfs merge=lfs -text
|
|
| 61 |
assets/app-zh.png filter=lfs diff=lfs merge=lfs -text
|
| 62 |
assets/results-fidelity-zh.png filter=lfs diff=lfs merge=lfs -text
|
| 63 |
humanizer-12b-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 61 |
assets/app-zh.png filter=lfs diff=lfs merge=lfs -text
|
| 62 |
assets/results-fidelity-zh.png filter=lfs diff=lfs merge=lfs -text
|
| 63 |
humanizer-12b-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
assets/compare-en-forum.png filter=lfs diff=lfs merge=lfs -text
|
AGENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ Instructions for AI agents (Claude Code, Codex, Cursor, etc.) setting up **human
|
|
| 6 |
|
| 7 |
- **What it does:** rewrites one AI-written draft (English or Chinese) so it reads like a person wrote it. It is trained to keep every number, unit, date, name and quote, and to add nothing. Output = the rewritten text only.
|
| 8 |
- **Kind of model:** 12B **text-completion** model (fine-tuned from `google/gemma-4-12B`). **Not a chat model.** Never use a chat template, a system prompt, or `/v1/chat/completions`.
|
| 9 |
-
- **Weights:** Hugging Face repo `jialinyyzz/humanizer`. Recommended file: `humanizer-12b-Q8_0.gguf` (12,669,627,840 bytes, about 12.7 GB); `humanizer-12b-Q6_K.gguf` (10,029,797,088 bytes, about 10.0 GB) for 16 GB machines. You also need `prompt_format.json` from the same repo.
|
| 10 |
- **Runtime:** `llama-server` from llama.cpp (macOS, Windows, Linux). Alternatives in section 10.
|
| 11 |
- **Sampling:** temperature 1.0, top_p 0.95, and nothing else: top_k 0, min_p 0, repeat_penalty 1.0. Stop on EOS only. No stop strings.
|
| 12 |
- **License:** Apache 2.0.
|
|
@@ -29,10 +29,10 @@ powershell -c "(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory/1GB"
|
|
| 29 |
| Memory | Use |
|
| 30 |
|---|---|
|
| 31 |
| 32 GB or more | `humanizer-12b-Q8_0.gguf` (12,669,627,840 bytes) |
|
| 32 |
-
| 16 GB | `humanizer-12b-Q6_K.gguf` (10,029,797,088 bytes) |
|
| 33 |
-
| 8 GB | `lite/humanizer-lite-Q6_K.gguf` (about 6.2 GB): the
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
## 3. Install llama.cpp
|
| 38 |
|
|
@@ -59,10 +59,11 @@ Check the download:
|
|
| 59 |
|
| 60 |
```bash
|
| 61 |
head -c 4 ./humanizer-model/humanizer-12b-Q8_0.gguf; echo # must print GGUF
|
| 62 |
-
wc -c ./humanizer-model/*.gguf # Q8_0: 12669627840 bytes; Q6_K: 10029797088 bytes
|
| 63 |
shasum -a 256 ./humanizer-model/*.gguf # macOS (Linux: sha256sum)
|
| 64 |
-
# Q8_0:
|
| 65 |
-
# Q6_K:
|
|
|
|
| 66 |
# lite/humanizer-lite-Q6_K.gguf: baa27697697d87c85f5347b7673c357ff760ed6f7419ce459744c37026f7603c
|
| 67 |
```
|
| 68 |
|
|
@@ -191,9 +192,9 @@ if missing: print("NOTE: numbers not found in this sample:", missing,
|
|
| 191 |
|
| 192 |
- Send **one draft per request**. Our setup uses an 8192-token context, so the draft plus the rewrite must fit. For long or structured documents, use `hz` ([section 12](#12-long-and-complex-documents-use-hz)); it splits them for you. For a folder of `.txt` files, [USAGE.md section 9](https://github.com/sgaofen/humanize-model/blob/main/docs/USAGE.md#9-rewrite-a-whole-folder) has a batch script.
|
| 193 |
- **Never edit the output silently**, and never tell the user the result is guaranteed to pass an AI detector. Detection numbers in the README are one measurement on one date.
|
| 194 |
-
- **Ask the user to proofread** numbers, dates, names and the direction of each claim. On the evaluation set a strict judge found no factual problem in
|
| 195 |
- If an output copies most of the draft, or a number differs, **sample again** (same prompt; sampling is random).
|
| 196 |
-
- Chinese is still catching up with English (no factual problem in
|
| 197 |
- Formatting can change: paragraph breaks, lists and headings are sometimes dropped or merged.
|
| 198 |
|
| 199 |
## 10. Other runtimes
|
|
@@ -214,9 +215,9 @@ All of them need the same prompt (step 6) and the same sampling (step 7). Comple
|
|
| 214 |
| Output is cut off at `###` | A stop string was set | Remove all stop strings; rely on EOS |
|
| 215 |
| Output is almost the same as the draft | Sampling bad luck, or temperature too low | Check temperature 1.0 and sample again |
|
| 216 |
| Rambling or repeated phrases | Wrong sampler settings | Set `top_k: 0, min_p: 0, repeat_penalty: 1.0` explicitly |
|
| 217 |
-
| Out of memory while loading | Not enough RAM or VRAM for Q8_0 | Use Q6_K (16 GB) or the lite model (8 GB); lower `-ngl` |
|
| 218 |
| Very slow | Running on the CPU | Check `offloaded N/N layers` in the log; install the Metal, CUDA or Vulkan build |
|
| 219 |
-
| 404 when downloading a file | Wrong name
|
| 220 |
|
| 221 |
## 12. Long and complex documents: use `hz`
|
| 222 |
|
|
|
|
| 6 |
|
| 7 |
- **What it does:** rewrites one AI-written draft (English or Chinese) so it reads like a person wrote it. It is trained to keep every number, unit, date, name and quote, and to add nothing. Output = the rewritten text only.
|
| 8 |
- **Kind of model:** 12B **text-completion** model (fine-tuned from `google/gemma-4-12B`). **Not a chat model.** Never use a chat template, a system prompt, or `/v1/chat/completions`.
|
| 9 |
+
- **Weights:** Hugging Face repo `jialinyyzz/humanizer`. Recommended file: `humanizer-12b-Q8_0.gguf` (12,669,627,840 bytes, about 12.7 GB); `humanizer-12b-Q6_K.gguf` (10,029,797,088 bytes, about 10.0 GB) for 16 GB machines; `humanizer-12b-Q4_K_M.gguf` (7,625,158,368 bytes, about 7.6 GB) when memory or disk is tight. You also need `prompt_format.json` from the same repo.
|
| 10 |
- **Runtime:** `llama-server` from llama.cpp (macOS, Windows, Linux). Alternatives in section 10.
|
| 11 |
- **Sampling:** temperature 1.0, top_p 0.95, and nothing else: top_k 0, min_p 0, repeat_penalty 1.0. Stop on EOS only. No stop strings.
|
| 12 |
- **License:** Apache 2.0.
|
|
|
|
| 29 |
| Memory | Use |
|
| 30 |
|---|---|
|
| 31 |
| 32 GB or more | `humanizer-12b-Q8_0.gguf` (12,669,627,840 bytes) |
|
| 32 |
+
| 16 GB | `humanizer-12b-Q6_K.gguf` (10,029,797,088 bytes); `humanizer-12b-Q4_K_M.gguf` (7,625,158,368 bytes) if memory or disk is tight |
|
| 33 |
+
| 8 GB | `lite/humanizer-lite-Q6_K.gguf` (about 6.2 GB): the earlier, smaller E4B release. Same prompt format. |
|
| 34 |
|
| 35 |
+
You also need free disk space for the file you pick. In the commands below, replace the Q8_0 file name if you picked another file.
|
| 36 |
|
| 37 |
## 3. Install llama.cpp
|
| 38 |
|
|
|
|
| 59 |
|
| 60 |
```bash
|
| 61 |
head -c 4 ./humanizer-model/humanizer-12b-Q8_0.gguf; echo # must print GGUF
|
| 62 |
+
wc -c ./humanizer-model/*.gguf # Q8_0: 12669627840 bytes; Q6_K: 10029797088 bytes; Q4_K_M: 7625158368 bytes
|
| 63 |
shasum -a 256 ./humanizer-model/*.gguf # macOS (Linux: sha256sum)
|
| 64 |
+
# Q8_0: 74d0e61d62c1c9d472002b9175cc71b9e725d5b5a4236383d89b04bdc29f05b9
|
| 65 |
+
# Q6_K: bc2259fabf2a03de6894bdca0c65092608e52fefe48ba6b624a51c82c1e522c5
|
| 66 |
+
# Q4_K_M: 5f0fd4bf39401e58c1d4b4a3eda3fc42f64cb9f28d7cd80bcfccca568b215a2f
|
| 67 |
# lite/humanizer-lite-Q6_K.gguf: baa27697697d87c85f5347b7673c357ff760ed6f7419ce459744c37026f7603c
|
| 68 |
```
|
| 69 |
|
|
|
|
| 192 |
|
| 193 |
- Send **one draft per request**. Our setup uses an 8192-token context, so the draft plus the rewrite must fit. For long or structured documents, use `hz` ([section 12](#12-long-and-complex-documents-use-hz)); it splits them for you. For a folder of `.txt` files, [USAGE.md section 9](https://github.com/sgaofen/humanize-model/blob/main/docs/USAGE.md#9-rewrite-a-whole-folder) has a batch script.
|
| 194 |
- **Never edit the output silently**, and never tell the user the result is guaranteed to pass an AI detector. Detection numbers in the README are one measurement on one date.
|
| 195 |
+
- **Ask the user to proofread** numbers, dates, names and the direction of each claim. On the evaluation set a strict judge found no factual problem in 376 of 420 English rewrites; where it found one, more than 9 in 10 fixes are a single word or phrase (for example "37 complaints" became "37% of complaints"). Compare the numbers in the draft and the output yourself and point out any that differ.
|
| 196 |
- If an output copies most of the draft, or a number differs, **sample again** (same prompt; sampling is random).
|
| 197 |
+
- Chinese is still catching up with English (no factual problem in 149 of 204 Chinese rewrites; about 9 in 10 fixes are a single word or phrase).
|
| 198 |
- Formatting can change: paragraph breaks, lists and headings are sometimes dropped or merged.
|
| 199 |
|
| 200 |
## 10. Other runtimes
|
|
|
|
| 215 |
| Output is cut off at `###` | A stop string was set | Remove all stop strings; rely on EOS |
|
| 216 |
| Output is almost the same as the draft | Sampling bad luck, or temperature too low | Check temperature 1.0 and sample again |
|
| 217 |
| Rambling or repeated phrases | Wrong sampler settings | Set `top_k: 0, min_p: 0, repeat_penalty: 1.0` explicitly |
|
| 218 |
+
| Out of memory while loading | Not enough RAM or VRAM for Q8_0 | Use Q6_K (16 GB), Q4_K_M, or the lite model (8 GB); lower `-ngl` |
|
| 219 |
| Very slow | Running on the CPU | Check `offloaded N/N layers` in the log; install the Metal, CUDA or Vulkan build |
|
| 220 |
+
| 404 when downloading a file | Wrong file name | Use the file names in step 2 |
|
| 221 |
|
| 222 |
## 12. Long and complex documents: use `hz`
|
| 223 |
|
README.md
CHANGED
|
@@ -45,20 +45,21 @@ tags:
|
|
| 45 |
|---|---|---|
|
| 46 |
| `humanizer-12b-Q8_0.gguf` | 12,669,627,840 bytes (about 12.7 GB) | 32 GB of memory or more. Recommended. |
|
| 47 |
| `humanizer-12b-Q6_K.gguf` | 10,029,797,088 bytes (about 10.0 GB) | 16 GB of memory. |
|
| 48 |
-
| `humanizer-12b-Q4_K_M.gguf` | about 7.6 GB |
|
| 49 |
| `model.safetensors` + `config.json`, `generation_config.json`, `tokenizer.json`, `tokenizer_config.json` | about 24 GB (bf16) | transformers, vLLM, converting to MLX. |
|
| 50 |
| `prompt_format.json` | tiny | The instruction and separator, verbatim. |
|
| 51 |
-
| `lite/` | `humanizer-lite-Q8_0.gguf` about 8.0 GB · `humanizer-lite-Q6_K.gguf` about 6.2 GB · `humanizer-lite-bf16.gguf` about 14.9 GB · safetensors (4 shards) about 15.9 GB, with config, tokenizer and `prompt_format.json` | The
|
| 52 |
|
| 53 |
-
Q6_K and Q4_K_M are imatrix-calibrated on our own rewriting data
|
| 54 |
|
| 55 |
-
| File | Mean KL vs. bf16 | Top token same as bf16 | Perplexity |
|
| 56 |
-
|---|---|---|---|
|
| 57 |
-
|
|
| 58 |
-
|
|
| 59 |
-
|
|
|
|
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
## Prompt format
|
| 64 |
|
|
@@ -243,51 +244,53 @@ Never the Chat tab or `/v1/chat/completions`.
|
|
| 243 |
|
| 244 |
## Before and after
|
| 245 |
|
| 246 |
-
First samples from the held-out evaluation set, not edited. Hand-picked and fact-checked by hand;
|
| 247 |
|
| 248 |
<img src="assets/compare-en-email.png" alt="Work email: draft and rewrite" width="100%">
|
| 249 |
|
| 250 |
<img src="assets/compare-zh-email.png" alt="Chinese work email: draft and rewrite" width="100%">
|
| 251 |
|
| 252 |
-
More examples (a
|
| 253 |
|
| 254 |
## Results
|
| 255 |
|
| 256 |
Evaluation set: 312 drafts (210 English, 102 Chinese), 18 genres, written from scratch by GLM-5.3, GPT-5.6 luna and Claude Sonnet (about a third each), never used in training. Two samples per draft.
|
| 257 |
|
| 258 |
-
**AI detection (external check only).** Originality.ai, API v3, AI Allowance 0% (strictest), 2026-10-
|
| 259 |
|
| 260 |
| Model | Flagged as AI | Judged human |
|
| 261 |
|---|---|---|
|
| 262 |
-
| **humanizer 12B
|
| 263 |
-
| humanizer
|
| 264 |
-
|
|
| 265 |
|
| 266 |
-
|
| 267 |
|
| 268 |
-
|
| 269 |
|
| 270 |
-
|
| 271 |
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
|
| 275 |
-
|
|
| 276 |
-
|
|
| 277 |
-
|
|
|
|
|
|
|
|
| 278 |
|
| 279 |
-
Where the judge did find a problem, the fix is usually small: a second pass re-read each flagged rewrite against its draft and listed every problem, down to small wording nuances, and
|
| 280 |
|
| 281 |
-
<img src="assets/results-fidelity-en.png" alt="Fact fidelity
|
| 282 |
|
| 283 |
## Training
|
| 284 |
|
| 285 |
**No AI detector was used anywhere in training**: not as a reward, not as a filter, not to pick a checkpoint.
|
| 286 |
|
| 287 |
1. **SFT, 28,598 pairs** of AI draft → real human original. The human side is always real human writing (paper abstracts, government reports, student essays, company and mailing-list email, Reddit, Hacker News, Zhihu…); the AI side is a draft a frontier model wrote back from the human text.
|
| 288 |
-
2. **DPO,
|
| 289 |
-
3. **GRPO**
|
| 290 |
-
4. Release = the final
|
| 291 |
|
| 292 |
<img src="assets/training-en.png" alt="Training pipeline" width="100%">
|
| 293 |
|
|
@@ -297,10 +300,10 @@ Measured on an M5 Max. llama.cpp Q8_0 with Metal (what the app uses): about 36
|
|
| 297 |
|
| 298 |
## Limitations
|
| 299 |
|
| 300 |
-
- It can still change a detail: on our set the judge found no factual problem in
|
| 301 |
-
- Chinese is still catching up with English (no factual problem in
|
| 302 |
-
- Templated genres
|
| 303 |
-
- Formatting can change:
|
| 304 |
- In casual genres it sometimes adds slang or profanity that wasn't in the draft.
|
| 305 |
- Detector results change over time. Nothing here guarantees any detector outcome.
|
| 306 |
- It is a writing tool for your own drafts. Where a school, employer or publication has rules about AI assistance, follow them.
|
|
|
|
| 45 |
|---|---|---|
|
| 46 |
| `humanizer-12b-Q8_0.gguf` | 12,669,627,840 bytes (about 12.7 GB) | 32 GB of memory or more. Recommended. |
|
| 47 |
| `humanizer-12b-Q6_K.gguf` | 10,029,797,088 bytes (about 10.0 GB) | 16 GB of memory. |
|
| 48 |
+
| `humanizer-12b-Q4_K_M.gguf` | 7,625,158,368 bytes (about 7.6 GB) | The smallest 12B file, when memory or disk is tight. |
|
| 49 |
| `model.safetensors` + `config.json`, `generation_config.json`, `tokenizer.json`, `tokenizer_config.json` | about 24 GB (bf16) | transformers, vLLM, converting to MLX. |
|
| 50 |
| `prompt_format.json` | tiny | The instruction and separator, verbatim. |
|
| 51 |
+
| `lite/` | `humanizer-lite-Q8_0.gguf` about 8.0 GB · `humanizer-lite-Q6_K.gguf` about 6.2 GB · `humanizer-lite-bf16.gguf` about 14.9 GB · safetensors (4 shards) about 15.9 GB, with config, tokenizer and `prompt_format.json` | The earlier E4B release (formerly `jialinyyzz/humanizer-gemma-4-e4b`), for 8 GB machines. Same prompt format. |
|
| 52 |
|
| 53 |
+
In all three GGUF files the token embeddings and the output layer stay at 8-bit; Q6_K and Q4_K_M are also imatrix-calibrated on our own rewriting data. How close each is to bf16: KL over about 33,000 tokens of drafts and rewrites from the evaluation set (no overlap with the calibration data), and the fact judge from [Results](#results) on all 420 English rewrites:
|
| 54 |
|
| 55 |
+
| File | Mean KL vs. bf16 | Top token same as bf16 | Perplexity | No factual problem (English) |
|
| 56 |
+
|---|---|---|---|---|
|
| 57 |
+
| bf16 (reference) | | | | 368 / 420 |
|
| 58 |
+
| Q8_0 | 0.0015 | 98.4% | +0.3% | 376 / 420 |
|
| 59 |
+
| Q6_K | 0.0031 | 97.7% | +0.6% | 364 / 420 |
|
| 60 |
+
| Q4_K_M | 0.0215 | 93.9% | +2.5% | 363 / 419 |
|
| 61 |
|
| 62 |
+
Compared draft by draft with bf16, all three files are within noise on the fact judge. sha256 checksums are in [USAGE.md](https://github.com/sgaofen/humanize-model/blob/main/docs/USAGE.md#2-pick-a-file).
|
| 63 |
|
| 64 |
## Prompt format
|
| 65 |
|
|
|
|
| 244 |
|
| 245 |
## Before and after
|
| 246 |
|
| 247 |
+
First samples of this release (the Q8_0 file) on drafts from the held-out evaluation set, not edited. Hand-picked and fact-checked by hand; results over the whole set are below.
|
| 248 |
|
| 249 |
<img src="assets/compare-en-email.png" alt="Work email: draft and rewrite" width="100%">
|
| 250 |
|
| 251 |
<img src="assets/compare-zh-email.png" alt="Chinese work email: draft and rewrite" width="100%">
|
| 252 |
|
| 253 |
+
More examples (a forum answer, a Zhihu answer) are in the [GitHub README](https://github.com/sgaofen/humanize-model#before-and-after).
|
| 254 |
|
| 255 |
## Results
|
| 256 |
|
| 257 |
Evaluation set: 312 drafts (210 English, 102 Chinese), 18 genres, written from scratch by GLM-5.3, GPT-5.6 luna and Claude Sonnet (about a third each), never used in training. Two samples per draft.
|
| 258 |
|
| 259 |
+
**AI detection (external check only): 95% judged human.** Originality.ai, API v3, AI Allowance 0% (strictest), 2026-10-02, 210 English drafts, first sample each, bf16 weights: 11 of 210 rewrites flagged as AI.
|
| 260 |
|
| 261 |
| Model | Flagged as AI | Judged human |
|
| 262 |
|---|---|---|
|
| 263 |
+
| **humanizer 12B, this release (RLRt2, bf16)** | **11 / 210 (5%)** | **95%** |
|
| 264 |
+
| humanizer 12B, previous release (RLRt) | 26 / 210 (12%) | 88% |
|
| 265 |
+
| humanizer E4B (r7, now in `lite/`) | 26 / 210 (12%) | 88% |
|
| 266 |
|
| 267 |
+
Flagged less than half as often as the previous release: on the same drafts, 20 were flagged only for the previous release and 5 only for this one (paired test, p = 0.004). The `humanizer-12b-Q8_0.gguf` file measured 15 / 210 (7%), within noise of bf16 (p = 0.48).
|
| 268 |
|
| 269 |
+
Public baseline: the `blader/humanizer` skill (v3.1.0, 53k GitHub stars), applied by Claude Sonnet to the same 60 drafts: 60 / 60 flagged as AI (median AI score 100%). This release (bf16) on those 60: **4 / 60** flagged. Flagged as AI by genre (all 210 drafts, bf16, same setting): social posts with emoji, hashtags or "1/ 2/" threads **3 / 16**, formal policy memos **2 / 13**, paper sections 2 / 22, essays 2 / 38, work reports 1 / 20, forum answers 1 / 18, blog posts 0 / 16, Reddit posts 0 / 18, emails 0 / 35, product reviews 0 / 14 (total 11 / 210). The most templated genres are still the hardest. Detectors change; this is one measurement on one date, not a promise.
|
| 270 |
|
| 271 |
+
<img src="assets/results-detector-en.png" alt="Originality.ai: 95% of rewrites judged human" width="100%">
|
| 272 |
|
| 273 |
+
**Fact fidelity.** **376 of 420 English rewrites came back with no factual problem** from a strict LLM judge (GLM-5.3, one vote per rewrite), measured on the `humanizer-12b-Q8_0.gguf` file you download. The previous release: 369 of 420.
|
| 274 |
+
|
| 275 |
+
| | **This release (RLRt2, Q8_0 file)** | Previous 12B (RLRt) | E4B (r7, `lite/`) |
|
| 276 |
+
|---|---|---|---|
|
| 277 |
+
| No factual problem found (higher is better) | **376 / 420** | 369 / 420 | 341 / 409 |
|
| 278 |
+
| Dropped a format element (lower is better) | **28 / 420** | 35 / 420 | 53 / 409 |
|
| 279 |
+
| Median reuse, overlap with the draft (lower is better) | **0.165** | 0.19 | 0.31 |
|
| 280 |
+
| Outputs with reuse > 0.5 (lower is better) | **0.2%** | 1.0% | 5.5% |
|
| 281 |
|
| 282 |
+
Where the judge did find a problem, the fix is usually small: a second pass re-read each flagged rewrite against its draft and listed every problem, down to small wording nuances, and more than 9 in 10 of those fixes (125 of 135) are a single word or phrase (for example, the draft's "The remaining 37 complaints" came out as "The other 37% of complaints"). Chinese is still catching up with English: no factual problem in 149 of 204 Chinese rewrites (previous release: 135); where there was one, about 9 in 10 fixes (212 of 236) are a single word or phrase ("本月20日前后", around the 20th of this month, became "20号以前", before the 20th). **Still, read the result before you send it, especially numbers, dates and names.**
|
| 283 |
|
| 284 |
+
<img src="assets/results-fidelity-en.png" alt="Fact fidelity compared with the previous releases" width="100%">
|
| 285 |
|
| 286 |
## Training
|
| 287 |
|
| 288 |
**No AI detector was used anywhere in training**: not as a reward, not as a filter, not to pick a checkpoint.
|
| 289 |
|
| 290 |
1. **SFT, 28,598 pairs** of AI draft → real human original. The human side is always real human writing (paper abstracts, government reports, student essays, company and mailing-list email, Reddit, Hacker News, Zhihu…); the AI side is a draft a frontier model wrote back from the human text.
|
| 291 |
+
2. **DPO, 3,918 preference pairs**, chosen only on fact fidelity and copying (LLM judge GLM-5.3).
|
| 292 |
+
3. **GRPO in three rounds, 500 steps in total**: 200 steps with a strict single-vote fact judge, then 150 steps of **RLRt** and 150 more of **RLRt2** (16 drafts × 8 samples per step, temperature 1.0). Reward: an LLM judge reads the whole rewrite against the draft (severe errors, invented content, changed meaning and dropped formatting cost), plus a copy penalty on 5-gram and syntactic-skeleton reuse (free below .22, then linear). Round 3 drew its drafts from a genre-balanced pool of 8,268. In all, RL produced 41,600 rewrites, each scored by an LLM judge against its draft.
|
| 293 |
+
4. Release = the final RLRt2 checkpoint.
|
| 294 |
|
| 295 |
<img src="assets/training-en.png" alt="Training pipeline" width="100%">
|
| 296 |
|
|
|
|
| 300 |
|
| 301 |
## Limitations
|
| 302 |
|
| 303 |
+
- It can still change a detail: on our set the judge found no factual problem in 376 of 420 English rewrites, and more than 9 in 10 of the fixes it did list are a single word or phrase. Proofread numbers, dates and names.
|
| 304 |
+
- Chinese is still catching up with English (no factual problem in 149 of 204 Chinese rewrites; about 9 in 10 fixes are a single word or phrase).
|
| 305 |
+
- Templated genres are still the hardest for detectors: emoji/hashtag social posts (3 / 16 flagged) and policy memos (2 / 13).
|
| 306 |
+
- Formatting can change: 28 of 420 outputs dropped a format element; paragraph breaks, lists and headings sometimes merge or disappear.
|
| 307 |
- In casual genres it sometimes adds slang or profanity that wasn't in the draft.
|
| 308 |
- Detector results change over time. Nothing here guarantees any detector outcome.
|
| 309 |
- It is a writing tool for your own drafts. Where a school, employer or publication has rules about AI assistance, follow them.
|
USAGE.md
CHANGED
|
@@ -75,40 +75,42 @@ All files are in [`jialinyyzz/humanizer`](https://huggingface.co/jialinyyzz/huma
|
|
| 75 |
|---|---|---|
|
| 76 |
| 32 GB or more | `humanizer-12b-Q8_0.gguf` | 12,669,627,840 bytes (about 12.7 GB) |
|
| 77 |
| 16 GB | `humanizer-12b-Q6_K.gguf` | 10,029,797,088 bytes (about 10.0 GB) |
|
| 78 |
-
|
|
| 79 |
-
|
|
| 80 |
|
| 81 |
Also in the repo:
|
| 82 |
|
| 83 |
- `model.safetensors` (bf16, about 24 GB) with `config.json`, `generation_config.json`, `tokenizer.json`, `tokenizer_config.json` and `prompt_format.json` at the root: what transformers, vLLM and the MLX converter use.
|
| 84 |
-
- `lite/` (
|
| 85 |
|
| 86 |
-
**How much the quantised files differ from bf16.**
|
| 87 |
|
| 88 |
-
| File | Mean KL vs. bf16 | Top token same as bf16 | Perplexity |
|
| 89 |
-
|---|---|---|---|
|
| 90 |
-
|
|
| 91 |
-
|
|
| 92 |
-
|
|
|
|
|
| 93 |
|
| 94 |
-
|
| 95 |
|
| 96 |
**Download:**
|
| 97 |
|
| 98 |
```bash
|
| 99 |
pip install -U "huggingface_hub[cli]"
|
| 100 |
hf download jialinyyzz/humanizer humanizer-12b-Q8_0.gguf prompt_format.json --local-dir ./humanizer-model
|
| 101 |
-
# 16 GB machine: humanizer-12b-Q6_K.gguf instead of humanizer-12b-Q8_0.gguf
|
| 102 |
# Slow from mainland China: put HF_ENDPOINT=https://hf-mirror.com in front of the command
|
| 103 |
-
wc -c ./humanizer-model/*.gguf # Q8_0: 12669627840 bytes, Q6_K: 10029797088 bytes
|
| 104 |
```
|
| 105 |
|
| 106 |
sha256 (`shasum -a 256 FILE` on macOS, `sha256sum FILE` on Linux, `certutil -hashfile FILE SHA256` on Windows):
|
| 107 |
|
| 108 |
| File | sha256 |
|
| 109 |
|---|---|
|
| 110 |
-
| `humanizer-12b-Q8_0.gguf` | `
|
| 111 |
-
| `humanizer-12b-Q6_K.gguf` | `
|
|
|
|
| 112 |
| `lite/humanizer-lite-Q6_K.gguf` | `baa27697697d87c85f5347b7673c357ff760ed6f7419ce459744c37026f7603c` |
|
| 113 |
|
| 114 |
## 3. llama.cpp (recommended)
|
|
@@ -523,19 +525,19 @@ The copy ratio here is a rough measure (share of the rewrite's 5-word or 5-chara
|
|
| 523 |
## 11. Chinese
|
| 524 |
|
| 525 |
- Use **the same English instruction**; don't translate it.
|
| 526 |
-
- Chinese is **still catching up with English**: our fact judge found no factual problem in
|
| 527 |
-
- Chinese rewrites copy the draft more often.
|
| 528 |
- **Numbers change form** more often in Chinese: Chinese numerals become digits (三 → 3) and dates get reformatted (6月14日 → 6.14). Digit-only checks, like the one in the app and in the batch script, can't see this. Check the numbers by reading.
|
| 529 |
- Full-width and half-width punctuation may switch, and greeting, body and sign-off lines are sometimes merged into one paragraph. Fix the layout before sending.
|
| 530 |
- Speed is similar to English. With llama.cpp Q8_0 on an M5 Max, a Chinese email of about 300 characters takes about 8.5 seconds.
|
| 531 |
|
| 532 |
## 12. Quality checklist
|
| 533 |
|
| 534 |
-
- **Read the rewrite once.** Check every number, date, unit and name, and the direction of every claim (who did what, more or less, before or after). On our evaluation set a strict judge found no factual problem in
|
| 535 |
-
- **Restore formatting** you need: subject lines, lists, headings and sign-offs are sometimes dropped (
|
| 536 |
- **Too close to the draft? Sample again.** Each run is a fresh sample.
|
| 537 |
- **Casual genres can drift in register.** In Reddit-style posts it sometimes adds slang or profanity that wasn't in the draft; edit it out.
|
| 538 |
-
- **No detector guarantee.** Our detector numbers are one measurement on one date with one detector; templated genres (emoji or hashtag social posts, policy memos) are still often flagged. Nothing here promises any detector outcome.
|
| 539 |
- It is a writing tool for your own drafts. Where a school, employer or publication has rules about AI assistance, follow them.
|
| 540 |
|
| 541 |
## 13. Troubleshooting
|
|
@@ -548,9 +550,9 @@ The copy ratio here is a rough measure (share of the rewrite's 5-word or 5-chara
|
|
| 548 |
| Output is almost the same as the draft | Sampling luck, or temperature too low | Check temperature 1.0 and sample again |
|
| 549 |
| Rambling, odd word choices, or repeated phrases | Wrong samplers (llama.cpp's default top-k 40 / min-p 0.05, the top-k 64 from `generation_config.json`, or a repetition penalty) | Set top-k 0, min-p 0, repetition penalty 1.0 explicitly |
|
| 550 |
| Rewrite cut off mid-sentence | Output limit or context too small | Raise `n_predict` / `max_tokens`; give llama-server `-c 8192 -np 1`; split long drafts |
|
| 551 |
-
| Out of memory while loading | File too large for your RAM or VRAM | Use Q6_K (16 GB) or the lite model (8 GB); lower `-ngl` |
|
| 552 |
| Very slow | Running on the CPU | Look for `offloaded N/N layers` in the llama.cpp log; install the Metal, CUDA or Vulkan build |
|
| 553 |
-
| 404 when downloading | Wrong file name
|
| 554 |
| Self-test fingerprint fails | The prompt builder differs from training | Copy `build_prompt` from [section 1](#the-prompt) |
|
| 555 |
|
| 556 |
**Self-test.** [AGENTS.md, section 8](https://github.com/sgaofen/humanize-model/blob/main/AGENTS.md#8-self-test-verify-the-install) has a standard-library script that sends a real draft from the evaluation set to llama-server and checks the prompt format, the endpoint, chat-template leaks and copying. It prints `PASS` when the setup is right.
|
|
|
|
| 75 |
|---|---|---|
|
| 76 |
| 32 GB or more | `humanizer-12b-Q8_0.gguf` | 12,669,627,840 bytes (about 12.7 GB) |
|
| 77 |
| 16 GB | `humanizer-12b-Q6_K.gguf` | 10,029,797,088 bytes (about 10.0 GB) |
|
| 78 |
+
| 16 GB, or short on disk | `humanizer-12b-Q4_K_M.gguf`, the smallest 12B file | 7,625,158,368 bytes (about 7.6 GB) |
|
| 79 |
+
| 8 GB | `lite/humanizer-lite-Q6_K.gguf`, the earlier, smaller E4B release | about 6.2 GB |
|
| 80 |
|
| 81 |
Also in the repo:
|
| 82 |
|
| 83 |
- `model.safetensors` (bf16, about 24 GB) with `config.json`, `generation_config.json`, `tokenizer.json`, `tokenizer_config.json` and `prompt_format.json` at the root: what transformers, vLLM and the MLX converter use.
|
| 84 |
+
- `lite/` (earlier E4B release): `humanizer-lite-Q8_0.gguf` (about 8.0 GB), `humanizer-lite-Q6_K.gguf` (about 6.2 GB), `humanizer-lite-bf16.gguf` (about 14.9 GB), and four safetensors shards (about 15.9 GB) with config, tokenizer and `prompt_format.json`. Same prompt format.
|
| 85 |
|
| 86 |
+
**How much the quantised files differ from bf16.** In all three GGUF files the token embeddings and the output layer stay at 8-bit; Q6_K and Q4_K_M are also imatrix-calibrated on our own rewriting data. KL was measured over about 33,000 tokens of drafts and rewrites from the evaluation set (no overlap with the calibration data). The last column is the strict fact judge from the README on all 420 English rewrites of the evaluation set, run on each file with llama.cpp.
|
| 87 |
|
| 88 |
+
| File | Mean KL vs. bf16 | Top token same as bf16 | Perplexity | No factual problem (English) |
|
| 89 |
+
|---|---|---|---|---|
|
| 90 |
+
| bf16 (reference) | | | | 368 / 420 |
|
| 91 |
+
| Q8_0 | 0.0015 | 98.4% | +0.3% | 376 / 420 |
|
| 92 |
+
| Q6_K | 0.0031 | 97.7% | +0.6% | 364 / 420 |
|
| 93 |
+
| Q4_K_M | 0.0215 | 93.9% | +2.5% | 363 / 419 |
|
| 94 |
|
| 95 |
+
Compared draft by draft with bf16, all three files are within noise on the fact judge.
|
| 96 |
|
| 97 |
**Download:**
|
| 98 |
|
| 99 |
```bash
|
| 100 |
pip install -U "huggingface_hub[cli]"
|
| 101 |
hf download jialinyyzz/humanizer humanizer-12b-Q8_0.gguf prompt_format.json --local-dir ./humanizer-model
|
| 102 |
+
# 16 GB machine: humanizer-12b-Q6_K.gguf instead of humanizer-12b-Q8_0.gguf (or humanizer-12b-Q4_K_M.gguf if disk is tight)
|
| 103 |
# Slow from mainland China: put HF_ENDPOINT=https://hf-mirror.com in front of the command
|
| 104 |
+
wc -c ./humanizer-model/*.gguf # Q8_0: 12669627840 bytes, Q6_K: 10029797088 bytes, Q4_K_M: 7625158368 bytes
|
| 105 |
```
|
| 106 |
|
| 107 |
sha256 (`shasum -a 256 FILE` on macOS, `sha256sum FILE` on Linux, `certutil -hashfile FILE SHA256` on Windows):
|
| 108 |
|
| 109 |
| File | sha256 |
|
| 110 |
|---|---|
|
| 111 |
+
| `humanizer-12b-Q8_0.gguf` | `74d0e61d62c1c9d472002b9175cc71b9e725d5b5a4236383d89b04bdc29f05b9` |
|
| 112 |
+
| `humanizer-12b-Q6_K.gguf` | `bc2259fabf2a03de6894bdca0c65092608e52fefe48ba6b624a51c82c1e522c5` |
|
| 113 |
+
| `humanizer-12b-Q4_K_M.gguf` | `5f0fd4bf39401e58c1d4b4a3eda3fc42f64cb9f28d7cd80bcfccca568b215a2f` |
|
| 114 |
| `lite/humanizer-lite-Q6_K.gguf` | `baa27697697d87c85f5347b7673c357ff760ed6f7419ce459744c37026f7603c` |
|
| 115 |
|
| 116 |
## 3. llama.cpp (recommended)
|
|
|
|
| 525 |
## 11. Chinese
|
| 526 |
|
| 527 |
- Use **the same English instruction**; don't translate it.
|
| 528 |
+
- Chinese is **still catching up with English**: our fact judge found no factual problem in 149 of 204 Chinese rewrites; where it found one, about 9 in 10 fixes are a single word or phrase.
|
| 529 |
+
- Chinese rewrites copy the draft more often. With the Q8_0 file, 14 of 204 Chinese rewrites copied more than 35% of the draft, against 1 of 420 English ones. If a rewrite looks too close to the draft, sample again; the batch script does this automatically.
|
| 530 |
- **Numbers change form** more often in Chinese: Chinese numerals become digits (三 → 3) and dates get reformatted (6月14日 → 6.14). Digit-only checks, like the one in the app and in the batch script, can't see this. Check the numbers by reading.
|
| 531 |
- Full-width and half-width punctuation may switch, and greeting, body and sign-off lines are sometimes merged into one paragraph. Fix the layout before sending.
|
| 532 |
- Speed is similar to English. With llama.cpp Q8_0 on an M5 Max, a Chinese email of about 300 characters takes about 8.5 seconds.
|
| 533 |
|
| 534 |
## 12. Quality checklist
|
| 535 |
|
| 536 |
+
- **Read the rewrite once.** Check every number, date, unit and name, and the direction of every claim (who did what, more or less, before or after). On our evaluation set a strict judge found no factual problem in 376 of 420 English rewrites; where it found one, more than 9 in 10 fixes are a single word or phrase, like "37 complaints" becoming "37% of complaints".
|
| 537 |
+
- **Restore formatting** you need: subject lines, lists, headings and sign-offs are sometimes dropped (28 of 420 outputs).
|
| 538 |
- **Too close to the draft? Sample again.** Each run is a fresh sample.
|
| 539 |
- **Casual genres can drift in register.** In Reddit-style posts it sometimes adds slang or profanity that wasn't in the draft; edit it out.
|
| 540 |
+
- **No detector guarantee.** Our detector numbers are one measurement on one date with one detector; templated genres (emoji or hashtag social posts, policy memos) are still the most often flagged. Nothing here promises any detector outcome.
|
| 541 |
- It is a writing tool for your own drafts. Where a school, employer or publication has rules about AI assistance, follow them.
|
| 542 |
|
| 543 |
## 13. Troubleshooting
|
|
|
|
| 550 |
| Output is almost the same as the draft | Sampling luck, or temperature too low | Check temperature 1.0 and sample again |
|
| 551 |
| Rambling, odd word choices, or repeated phrases | Wrong samplers (llama.cpp's default top-k 40 / min-p 0.05, the top-k 64 from `generation_config.json`, or a repetition penalty) | Set top-k 0, min-p 0, repetition penalty 1.0 explicitly |
|
| 552 |
| Rewrite cut off mid-sentence | Output limit or context too small | Raise `n_predict` / `max_tokens`; give llama-server `-c 8192 -np 1`; split long drafts |
|
| 553 |
+
| Out of memory while loading | File too large for your RAM or VRAM | Use Q6_K (16 GB), Q4_K_M, or the lite model (8 GB); lower `-ngl` |
|
| 554 |
| Very slow | Running on the CPU | Look for `offloaded N/N layers` in the llama.cpp log; install the Metal, CUDA or Vulkan build |
|
| 555 |
+
| 404 when downloading | Wrong file name | Use the names in [section 2](#2-pick-a-file) |
|
| 556 |
| Self-test fingerprint fails | The prompt builder differs from training | Copy `build_prompt` from [section 1](#the-prompt) |
|
| 557 |
|
| 558 |
**Self-test.** [AGENTS.md, section 8](https://github.com/sgaofen/humanize-model/blob/main/AGENTS.md#8-self-test-verify-the-install) has a standard-library script that sends a real draft from the evaluation set to llama-server and checks the prompt format, the endpoint, chat-template leaks and copying. It prints `PASS` when the setup is right.
|
USAGE.zh.md
CHANGED
|
@@ -75,40 +75,42 @@ assert hashlib.sha256(build_prompt("X").encode("utf-8")).hexdigest()[:16] == "cc
|
|
| 75 |
|---|---|---|
|
| 76 |
| 32 GB 及以上 | `humanizer-12b-Q8_0.gguf` | 12,669,627,840 字节(约 12.7 GB) |
|
| 77 |
| 16 GB | `humanizer-12b-Q6_K.gguf` | 10,029,797,088 字节(约 10.0 GB) |
|
| 78 |
-
|
|
| 79 |
-
|
|
| 80 |
|
| 81 |
仓库里还有:
|
| 82 |
|
| 83 |
- 根目录的 `model.safetensors`(bf16,约 24 GB),以及 `config.json`、`generation_config.json`、`tokenizer.json`、`tokenizer_config.json`、`prompt_format.json`:transformers、vLLM 和 MLX 转换都用它们。
|
| 84 |
-
- `lite/`(
|
| 85 |
|
| 86 |
-
**量化版和 bf16 差多少。**
|
| 87 |
|
| 88 |
-
| 文件 | 与 bf16 的平均 KL | 首选词与 bf16 一致 | 困惑度 |
|
| 89 |
-
|---|---|---|---|
|
| 90 |
-
|
|
| 91 |
-
|
|
| 92 |
-
|
|
|
|
|
| 93 |
|
| 94 |
-
|
| 95 |
|
| 96 |
**下载:**
|
| 97 |
|
| 98 |
```bash
|
| 99 |
pip install -U "huggingface_hub[cli]"
|
| 100 |
hf download jialinyyzz/humanizer humanizer-12b-Q8_0.gguf prompt_format.json --local-dir ./humanizer-model
|
| 101 |
-
# 16 GB 的机器:把 humanizer-12b-Q8_0.gguf 换成 humanizer-12b-Q6_K.gguf
|
| 102 |
# 国内下载慢:在命令前面加 HF_ENDPOINT=https://hf-mirror.com
|
| 103 |
-
wc -c ./humanizer-model/*.gguf # Q8_0 应为 12669627840 字节,Q6_K 应为 10029797088 字节
|
| 104 |
```
|
| 105 |
|
| 106 |
sha256 校验值(macOS 用 `shasum -a 256 文件名`,Linux 用 `sha256sum 文件名`,Windows 用 `certutil -hashfile 文件名 SHA256`):
|
| 107 |
|
| 108 |
| 文件 | sha256 |
|
| 109 |
|---|---|
|
| 110 |
-
| `humanizer-12b-Q8_0.gguf` | `
|
| 111 |
-
| `humanizer-12b-Q6_K.gguf` | `
|
|
|
|
| 112 |
| `lite/humanizer-lite-Q6_K.gguf` | `baa27697697d87c85f5347b7673c357ff760ed6f7419ce459744c37026f7603c` |
|
| 113 |
|
| 114 |
## 3. llama.cpp(推荐)
|
|
@@ -523,19 +525,19 @@ if __name__ == "__main__":
|
|
| 523 |
## 11. 中文
|
| 524 |
|
| 525 |
- 用**同一段英文指令**,不要翻译。
|
| 526 |
-
- 中文**还在追赶英文**:204 篇中文改写里,事实判官在
|
| 527 |
-
- 中文改写更容易照抄草稿。
|
| 528 |
- 中文里**数字更常换写法**:汉字数字变成阿拉伯数字(三 → 3),日期改格式(6月14日 → 6.14)。App 和批处理脚本里那种只看阿拉伯数字的核对发现不了这类问题,请读一遍核对。
|
| 529 |
- 全角、半角标点可能互换;问候、正文、落款有时会被并成一段。发出去之前把格式理一理。
|
| 530 |
- 速度和英文差不多:llama.cpp Q8_0 在 M5 Max 上,一封 300 字左右的中文邮件约 8.5 秒。
|
| 531 |
|
| 532 |
## 12. 质量检查清单
|
| 533 |
|
| 534 |
-
- **通读一遍改写。**核对每个数字、日期、单位和人名,以及每个论断的方向(谁做了什么、多还是少、先还是后)。在我们的评测集上,英文 420 篇改写里有
|
| 535 |
-
- **补回需要的格式:**主题行、列表、标题、落款有时会丢(420 发里有
|
| 536 |
- **和草稿太像?再采一次。**每次都是重新采样。
|
| 537 |
- **随意体裁里语气会跑。**Reddit 一类的帖子里,它有时会加上原文没有的俚语或粗口,请删掉。
|
| 538 |
-
- **不保证过检测器。**我们的检测数字是一个检测器在某一天的一次测量;模板化的体裁(带 emoji、井号的社交帖,政策备忘)仍然常被判 AI。这里不对任何检测结果做承诺。
|
| 539 |
- 这是给你改自己草稿的写作工具。学校、单位或出版方对 AI 辅助有规定的,请按规定来。
|
| 540 |
|
| 541 |
## 13. 排错
|
|
@@ -548,9 +550,9 @@ if __name__ == "__main__":
|
|
| 548 |
| 改写和草稿几乎一样 | 采样运气不好,或温度太低 | 确认 temperature 1.0,再采一次 |
|
| 549 |
| 胡言乱语、用词古怪或反复重复 | 采样参数不对(llama.cpp 默认的 top-k 40 / min-p 0.05、`generation_config.json` 里的 top-k 64,或者开了重复惩罚) | 显式设 top-k 0、min-p 0、重复惩罚 1.0 |
|
| 550 |
| 改写在句子中间断了 | 输出上限或上下文太小 | 调大 `n_predict` / `max_tokens`;llama-server 加 `-c 8192 -np 1`;长稿分段 |
|
| 551 |
-
| 加载时内存不够 | 文件对你的内存或显存太大 | 16 GB 用 Q6_K,8 GB 用 lite;调低 `-ngl` |
|
| 552 |
| 很慢 | 在用 CPU 跑 | 看 llama.cpp 日志里有没有 `offloaded N/N layers`;装 Metal、CUDA 或 Vulkan 版 |
|
| 553 |
-
| 下载时 404 | 文件名写错
|
| 554 |
| 指纹自检不过 | 提示词拼法和训练时不一样 | 直接复制[第 1 节](#提示词)里的 `build_prompt` |
|
| 555 |
|
| 556 |
**自检。**[AGENTS.md 第 8 节](https://github.com/sgaofen/humanize-model/blob/main/AGENTS.md#8-self-test-verify-the-install)有一个只用标准库的脚本:它把评测集里的一篇真实草稿发给 llama-server,检查提示词格式、接口、聊天模板有没有漏进来、有没有照抄。设置正确会打印 `PASS`。
|
|
|
|
| 75 |
|---|---|---|
|
| 76 |
| 32 GB 及以上 | `humanizer-12b-Q8_0.gguf` | 12,669,627,840 字节(约 12.7 GB) |
|
| 77 |
| 16 GB | `humanizer-12b-Q6_K.gguf` | 10,029,797,088 字节(约 10.0 GB) |
|
| 78 |
+
| 16 GB,或硬盘紧张 | `humanizer-12b-Q4_K_M.gguf`,最小的 12B 文件 | 7,625,158,368 字节(约 7.6 GB) |
|
| 79 |
+
| 8 GB | `lite/humanizer-lite-Q6_K.gguf`,即更早、更小的 E4B 版 | 约 6.2 GB |
|
| 80 |
|
| 81 |
仓库里还有:
|
| 82 |
|
| 83 |
- 根目录的 `model.safetensors`(bf16,约 24 GB),以及 `config.json`、`generation_config.json`、`tokenizer.json`、`tokenizer_config.json`、`prompt_format.json`:transformers、vLLM 和 MLX 转换都用它们。
|
| 84 |
+
- `lite/`(更早的 E4B 版):`humanizer-lite-Q8_0.gguf`(约 8.0 GB)、`humanizer-lite-Q6_K.gguf`(约 6.2 GB)、`humanizer-lite-bf16.gguf`(约 14.9 GB),以及 4 个 safetensors 分片(约 15.9 GB)和 config、tokenizer、`prompt_format.json`。提示词格式一样。
|
| 85 |
|
| 86 |
+
**量化版和 bf16 差多少。**三个 GGUF 文件的词表和输出层都保留 8 bit;Q6_K 和 Q4_K_M 另外用我们自己的改写数据做了 imatrix 校准。KL 在评测集草稿和改写上测了约 33,000 个 token(和校准数据不重叠)。最后一栏是 README 里那个从严的事实判官,用 llama.cpp 分别跑每个文件、判评测集全部 420 篇英文改写。
|
| 87 |
|
| 88 |
+
| 文件 | 与 bf16 的平均 KL | 首选词与 bf16 一致 | 困惑度 | 没挑出事实问题(英文) |
|
| 89 |
+
|---|---|---|---|---|
|
| 90 |
+
| bf16(基准) | | | | 368 / 420 |
|
| 91 |
+
| Q8_0 | 0.0015 | 98.4% | +0.3% | 376 / 420 |
|
| 92 |
+
| Q6_K | 0.0031 | 97.7% | +0.6% | 364 / 420 |
|
| 93 |
+
| Q4_K_M | 0.0215 | 93.9% | +2.5% | 363 / 419 |
|
| 94 |
|
| 95 |
+
逐篇和 bf16 对比,三档在事实判官上的差别都在噪声范围内。
|
| 96 |
|
| 97 |
**下载:**
|
| 98 |
|
| 99 |
```bash
|
| 100 |
pip install -U "huggingface_hub[cli]"
|
| 101 |
hf download jialinyyzz/humanizer humanizer-12b-Q8_0.gguf prompt_format.json --local-dir ./humanizer-model
|
| 102 |
+
# 16 GB 的机器:把 humanizer-12b-Q8_0.gguf 换成 humanizer-12b-Q6_K.gguf(硬盘紧张就用 humanizer-12b-Q4_K_M.gguf)
|
| 103 |
# 国内下载慢:在命令前面加 HF_ENDPOINT=https://hf-mirror.com
|
| 104 |
+
wc -c ./humanizer-model/*.gguf # Q8_0 应为 12669627840 字节,Q6_K 应为 10029797088 字节,Q4_K_M 应为 7625158368 字节
|
| 105 |
```
|
| 106 |
|
| 107 |
sha256 校验值(macOS 用 `shasum -a 256 文件名`,Linux 用 `sha256sum 文件名`,Windows 用 `certutil -hashfile 文件名 SHA256`):
|
| 108 |
|
| 109 |
| 文件 | sha256 |
|
| 110 |
|---|---|
|
| 111 |
+
| `humanizer-12b-Q8_0.gguf` | `74d0e61d62c1c9d472002b9175cc71b9e725d5b5a4236383d89b04bdc29f05b9` |
|
| 112 |
+
| `humanizer-12b-Q6_K.gguf` | `bc2259fabf2a03de6894bdca0c65092608e52fefe48ba6b624a51c82c1e522c5` |
|
| 113 |
+
| `humanizer-12b-Q4_K_M.gguf` | `5f0fd4bf39401e58c1d4b4a3eda3fc42f64cb9f28d7cd80bcfccca568b215a2f` |
|
| 114 |
| `lite/humanizer-lite-Q6_K.gguf` | `baa27697697d87c85f5347b7673c357ff760ed6f7419ce459744c37026f7603c` |
|
| 115 |
|
| 116 |
## 3. llama.cpp(推荐)
|
|
|
|
| 525 |
## 11. 中文
|
| 526 |
|
| 527 |
- 用**同一段英文指令**,不要翻译。
|
| 528 |
+
- 中文**还在追赶英文**:204 篇中文改写里,事实判官在 149 篇里没挑出问题;有问题的,约 9 成改一个词或短语就好。
|
| 529 |
+
- 中文改写更容易照抄草稿。用 Q8_0 文件时,中文 204 发里有 14 ��照抄草稿超过 35%,英文 420 发里只有 1 发。改写看着和草稿太像就再采一次;批处理脚本会自动这样做。
|
| 530 |
- 中文里**数字更常换写法**:汉字数字变成阿拉伯数字(三 → 3),日期改格式(6月14日 → 6.14)。App 和批处理脚本里那种只看阿拉伯数字的核对发现不了这类问题,请读一遍核对。
|
| 531 |
- 全角、半角标点可能互换;问候、正文、落款有时会被并成一段。发出去之前把格式理一理。
|
| 532 |
- 速度和英文差不多:llama.cpp Q8_0 在 M5 Max 上,一封 300 字左右的中文邮件约 8.5 秒。
|
| 533 |
|
| 534 |
## 12. 质量检查清单
|
| 535 |
|
| 536 |
+
- **通读一遍改写。**核对每个数字、日期、单位和人名,以及每个论断的方向(谁做了什么、多还是少、先还是后)。在我们的评测集上,英文 420 篇改写里有 376 篇判官没挑出事实问题;有问题的,9 成以上改一个词或短语就好,比如“37 complaints”(37 条投诉)变成了“37% of complaints”(37% 的投诉)。
|
| 537 |
+
- **补回需要的格式:**主题行、列表、标题、落款有时会丢(420 发里有 28 发)。
|
| 538 |
- **和草稿太像?再采一次。**每次都是重新采样。
|
| 539 |
- **随意体裁里语气会跑。**Reddit 一类的帖子里,它有时会加上原文没有的俚语或粗口,请删掉。
|
| 540 |
+
- **不保证过检测器。**我们的检测数字是一个检测器在某一天的一次测量;模板化的体裁(带 emoji、井号的社交帖,政策备忘)仍然最常被判 AI。这里不对任何检测结果做承诺。
|
| 541 |
- 这是给你改自己草稿的写作工具。学校、单位或出版方对 AI 辅助有规定的,请按规定来。
|
| 542 |
|
| 543 |
## 13. 排错
|
|
|
|
| 550 |
| 改写和草稿几乎一样 | 采样运气不好,或温度太低 | 确认 temperature 1.0,再采一次 |
|
| 551 |
| 胡言乱语、用词古怪或反复重复 | 采样参数不对(llama.cpp 默认的 top-k 40 / min-p 0.05、`generation_config.json` 里的 top-k 64,或者开了重复惩罚) | 显式设 top-k 0、min-p 0、重复惩罚 1.0 |
|
| 552 |
| 改写在句子中间断了 | 输出上限或上下文太小 | 调大 `n_predict` / `max_tokens`;llama-server 加 `-c 8192 -np 1`;长稿分段 |
|
| 553 |
+
| 加载时内存不够 | 文件对你的内存或显存太大 | 16 GB 用 Q6_K 或 Q4_K_M,8 GB 用 lite;调低 `-ngl` |
|
| 554 |
| 很慢 | 在用 CPU 跑 | 看 llama.cpp 日志里有没有 `offloaded N/N layers`;装 Metal、CUDA 或 Vulkan 版 |
|
| 555 |
+
| 下载时 404 | 文件名写错 | 用[第 2 节](#2-选哪个文件)里的文件名 |
|
| 556 |
| 指纹自检不过 | 提示词拼法和训练时不一样 | 直接复制[第 1 节](#提示词)里的 `build_prompt` |
|
| 557 |
|
| 558 |
**自检。**[AGENTS.md 第 8 节](https://github.com/sgaofen/humanize-model/blob/main/AGENTS.md#8-self-test-verify-the-install)有一个只用标准库的脚本:它把评测集里的一篇真实草稿发给 llama-server,检查提示词格式、接口、聊天模板有没有漏进来、有没有照抄。设置正确会打印 `PASS`。
|
assets/compare-en-email.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/{compare-en-reddit.png → compare-en-forum.png}
RENAMED
|
File without changes
|
assets/compare-zh-email.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/compare-zh-zhihu.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/results-detector-en.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/results-detector-zh.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/results-fidelity-en.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/results-fidelity-zh.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/training-en.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/training-zh.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|