jialinyyzz/humanizer
- License
- apache-2.0
- Size
- not mirrored yet
No official torrent yet — requesting it tells the flock what to host next. You cannot seed a catalog-only page.
Cataloged from jialinyyzz/humanizer
All models by jialinyyzz →No official torrent yet — requesting it tells the flock what to host next. You cannot seed a catalog-only page.
Cataloged from jialinyyzz/humanizer
All models by jialinyyzz →A 12B model that rewrites AI-written drafts (emails, essays, reports, forum posts; English and Chinese) so they read like a person wrote them. It is trained to keep every number, unit, date, name and quote, and to add nothing. It runs locally. No AI detector was used anywhere in training.
Usage without the app [blocked] · 不用 App 怎么用 [blocked] · AGENTS.md (for AI agents) [blocked] · GitHub · Desktop app (macOS, Windows) · Install guide · 中文说明
GGUF files now have their own repo: jialinyyzz/humanizer-GGUF: every quantization (Q8_0, Q6_K, Q4_K_M, 2-bit) with its size, memory, KL to bf16 and quality on the task, and how they were made. The same files stay here too, so existing download commands keep working.
Setting this up with an AI agent? Point it at AGENTS.md [blocked]: exact files, server command, prompt byte for byte, and a self-test.
App: download the .dmg (Mac with Apple silicon) or the Windows installer from Releases. On first run it picks a model size for your memory and downloads it once; after that it works offline.
Command line, for long documents and agents: pipx install git+https://github.com/sgaofen/humanize-model, then hz paper.md -o paper.out.md (also .txt and .docx). It uses the app or a llama-server, keeps headings, code, tables and links, rewrites the prose piece by piece and flags any piece where a number went missing. See USAGE.md, section 14 [blocked].
Without the app: pick a file below, then follow Usage without the app. The full guide, with a batch script, long documents, Chinese and troubleshooting, is USAGE.md [blocked] (中文 [blocked]).
What KL means: how far a file's next-word probabilities drift from the full bf16 model, averaged over every word of real drafts and rewrites. Lower is better; 0 means identical. "Top token same" is how often the file and bf16 would pick the same most likely next word. "Standard" means a plain llama-quantize run of the same type with the same importance matrix our build started from, with no extra training.
The Q4_K_M was refined with quantization-aware training on 2026-10-04: same size and format, about 1/3 lower KL than the standard Q4_K_M. The 2-bit build is closer to the full model than a standard 3-bit build that is 0.8 GB larger, and Chinese, which plain 2-bit quantization hurts most, comes out the same as English. It still makes more fact mistakes than the larger files (see ³), so use it only when memory is tight and check its output with extra care. A 3-bit build is coming.
¹ Maximum resident memory of llama-server (llama.cpp, Metal) on an Apple M5 Max with the app's settings (8,192-token context, one request at a time) while rewriting a 470-token draft; about the file size plus 1 GB. Q8_0 and 2-bit measured; the others are estimated the same way (est.). A 32,768-token context adds about 0.4 GB. Leave room for the system and other apps.
² llama.cpp llama-perplexity --kl-divergence, 30 chunks of 2,048 tokens per language (about 30,700 scored tokens each) of held-out drafts and rewrites from the evaluation set (no overlap with calibration or training data), reference = the bf16 GGUF, all on the same A100. Third-party quantizations were not measured. Q8_0, Q6_K and Q4_K_M keep the token embeddings and output layer at 8-bit; the IQ2_XS and IQ3_XXS comparison builds use 4-bit embeddings.
³ The strict fact judge from Results (GLM-5.3, one vote per rewrite) on all 420 English and 204 Chinese rewrites (two per draft; for bf16, 4 Chinese rewrites could not be judged). "Rewrites flagged" = rewrites it found a factual problem in; a second pass re-read each flagged rewrite against its draft and listed every problem ("spots"). Most spots are a single word, number or phrase: about 9 in 10 for every file (2-bit: 243 of 265 English, 330 of 361 Chinese). Compared draft by draft with Q8_0, Q6_K and Q4_K_M are within noise, and the quantization-aware Q4_K_M is within noise of the standard one. The 2-bit build is not: in English it was flagged on 70 rewrites against 44 for Q8_0 on the same drafts, a difference beyond noise; in Chinese 66 against 54, within noise. Against the Q4_K_M it is 70 vs. 58 and 66 vs. 51, within noise.
⁴ The 2-bit build keeps about 130,000 of the 262,144 vocabulary tokens: the ones English and Chinese text actually uses, plus everything needed to spell any input. Any text still encodes and decodes exactly; rare symbols, emoji and other scripts just take a few more tokens. Pruning alone moves the model by KL 0.0013 (English) / 0.0002 (Chinese), and the 2-bit KL above is measured against a bf16 with the same pruned vocabulary. Bits are spread by sensitivity (mostly IQ2_XS, with 3- and 4-bit types where they matter), then each layer is tuned with quantization-aware training and the scales are distilled from the bf16 model on English and Chinese rewriting data. The file reports its type as IQ2_XS, but it is not a plain IQ2_XS.
⁵ The 2-bit build had the best AI-detector result of all versions: 0/60 flagged (Q8_0 7/60, bf16 4/60; Originality.ai strictest setting). A likely reason: the small drift from quantization makes the wording a bit less predictable, which detectors read as less machine-like.
sha256 checksums are in USAGE.md.
Text completion, not chat. No system prompt, no turn markers. Send exactly this text and let the model continue:
prompt = instr + "\n\n" + draft.strip() + "\n\n### Rewritten:\n\n"; both strings are in prompt_format.json. Reproduce it byte for byte: the first 16 hex characters of sha256(prompt for the draft "X") must be cc51d66b4c593fbe."###".generation_config.json sets top-k 64, so switch them off explicitly./v1/chat/completions (with --jinja, the default in recent builds) then works, one draft per message: with the same seed it gave the same rewrite as the completion endpoint. Chat apps that use the file's template, such as LM Studio's Chat tab, should work the same way (not tested by us). Files downloaded earlier have no template, and the safetensors weights have none either.All snippets below build the prompt from prompt_format.json and use the sampling above. More detail for each runtime, a script that rewrites a whole folder, and a troubleshooting table: USAGE.md [blocked].
/completion works with every download. /v1/chat/completions also works with the GGUF files uploaded on or after 2026-10-04 (built-in chat template, see above), one draft per request. With curl and jq:
Pass a plain string; never apply the chat template (the mlx_lm.generate CLI needs --ignore-chat-template).
The bf16 weights are about 24 GB. Saved with transformers 5.14.1; on 4.x write torch_dtype= instead of dtype=.
This mirrors how our evaluation outputs were generated. As a server: vllm serve jialinyyzz/humanizer --dtype bfloat16 --max-model-len 8192 --generation-config vllm, then /v1/completions (never /v1/chat/completions) with the same parameters; --generation-config vllm keeps the top-k 64 from generation_config.json out of the defaults.
Ollama ignores the chat template stored in the GGUF and would apply its own Gemma template, which breaks this model. Use this Modelfile: its template takes the last user message as the draft and builds the prompt above (rendered with Go's text/template, byte for byte the same; not run in Ollama by us). Needs an Ollama version that supports Gemma 4 models.
Untested by us. Load the GGUF with an 8192-token context; in the model's sampling settings set Temperature 1.0, Top P 0.95, Top K 0, Min P 0, Repeat Penalty 1.0 and remove stop strings. With a file downloaded on or after 2026-10-04, the Chat tab should work: leave the system prompt empty and paste one draft per message (the built-in template ignores system prompts and earlier turns). With any download, start the local server and send the full prompt to the text-completion endpoint /v1/completions:
If a chat reply greets you, repeats the instruction or doesn't stop, the file has no built-in template (downloaded before 2026-10-04): download it again or use /v1/completions.
USAGE.md [blocked] also covers: a one-shot llama-completion run, a script that rewrites a whole folder (splitting long files, resampling over-copied pieces, listing numbers to check), long documents, Chinese specifics, a quality checklist and troubleshooting. To verify a setup, run the self-test in AGENTS.md [blocked].
Drafts from the held-out evaluation set. For each we generated 8 samples with the Q8_0 file (llama.cpp, the app's settings) and picked the one that reads best among those the fact judge passed; it is shown unedited, and all 8 samples are on GitHub. These are picks: across the whole set the judge flagged 44 of the 420 English rewrites, 135 problems in all, 125 of them a single word or phrase. Read the result before you send it, especially numbers, dates and names. Results over the whole set are below.
[Image blocked: Work email: draft and rewrite] [Image blocked: Chinese work email: draft and rewrite]More examples (a forum answer, a Zhihu answer) are in the GitHub README.
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.
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.
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).
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.
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.
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.
Note: the fact judge is deliberately strict. In a separate audit of the same judge model, a second judge (Claude Opus) re-read 150 rewrites it had flagged as serious (drawn from training, not from this evaluation set). On the fact the first judge pointed to, Opus agreed it was a serious error in 99, rated it minor in 41 (for example "may reduce" became "will help decrease", or a long name was shortened), and found the fact unchanged in 10. So some flags are harmless rewording. Still read numbers, dates and names before you send.
[Image blocked: Fact fidelity compared with the previous releases]No AI detector was used anywhere in training: not as a reward, not as a filter, not to pick a checkpoint.
Measured on an M5 Max. llama.cpp Q8_0 with Metal (what the app uses): about 36–38 tokens/s; a hundred-word email takes about 3.6 s, a Chinese email of about 300 characters about 8.5 s. MLX 8-bit: about 30 tokens/s in English and 38 tokens/s in Chinese; a hundred-word email takes about 9 s.
Apache License 2.0, for both the weights and the code. Fine-tuned from google/gemma-4-12B, which Google releases under Apache 2.0. This project is not affiliated with or endorsed by Google.
Rewrite the text below so it reads like a person wrote it, not a language model.
Reorganize it as you see fit. Vary sentence length on purpose. Cut hedging,throat-clearing, and any sentence that only announces what comes next.Prefer the concrete word over the abstract one. It is fine to sound uneven.
Every fact, number, unit, date, name and quotation must survive unchanged.
<YOUR DRAFT, with leading and trailing whitespace removed>
### Rewritten:brew install llama.cpp # or: winget install llama.cpp / a zip from github.com/ggml-org/llama.cpp/releasespip install -U "huggingface_hub[cli]"hf download jialinyyzz/humanizer humanizer-12b-Q8_0.gguf prompt_format.json --local-dir ./humanizer-model# 16 GB machine: humanizer-12b-Q6_K.gguf instead; smallest: humanizer-12b-IQ2_XS-QAT.ggufllama-server -m ./humanizer-model/humanizer-12b-Q8_0.gguf -c 8192 -np 1 -ngl 99 --host 127.0.0.1 --port 8080import json, urllib.request
PF = json.load(open("humanizer-model/prompt_format.json", encoding="utf-8"))
def humanize(draft: str, url: str = "http://127.0.0.1:8080") -> str: body = {"prompt": PF["instr"] + "\n\n" + draft.strip() + PF["sep"], "temperature": 1.0, "top_p": 0.95, "top_k": 0, "min_p": 0, "repeat_penalty": 1.0, "n_predict": 2048} # no "stop": the model ends at EOS req = urllib.request.Request(url + "/completion", json.dumps(body).encode("utf-8"), {"Content-Type": "application/json"}) with urllib.request.urlopen(req, timeout=900) as r: return json.load(r)["content"].strip()
print(humanize(open("draft.txt", encoding="utf-8").read()))jq -n --rawfile d draft.txt --slurpfile f humanizer-model/prompt_format.json \ '{prompt: ($f[0].instr + "\n\n" + ($d | sub("^\\s+"; "") | sub("\\s+$"; "")) + $f[0].sep), temperature: 1.0, top_p: 0.95, top_k: 0, min_p: 0, repeat_penalty: 1.0, n_predict: 2048}' \| curl -s http://127.0.0.1:8080/completion -d @- | jq -r .contentpip install -U "mlx-lm>=0.32" huggingface_hubmlx_lm.convert --hf-path jialinyyzz/humanizer --mlx-path humanizer-mlx-8bit -q --q-bits 8 --q-group-size 64import jsonfrom huggingface_hub import hf_hub_downloadfrom mlx_lm import load, generatefrom mlx_lm.sample_utils import make_sampler
PF = json.load(open(hf_hub_download("jialinyyzz/humanizer", "prompt_format.json"), encoding="utf-8"))model, tok = load("humanizer-mlx-8bit")draft = open("draft.txt", encoding="utf-8").read()print(generate(model, tok, prompt=PF["instr"] + "\n\n" + draft.strip() + PF["sep"], max_tokens=2048, sampler=make_sampler(temp=1.0, top_p=0.95)).strip())import json, torchfrom huggingface_hub import hf_hub_downloadfrom transformers import AutoModelForCausalLM, AutoTokenizer
repo = "jialinyyzz/humanizer"PF = json.load(open(hf_hub_download(repo, "prompt_format.json"), encoding="utf-8"))tok = AutoTokenizer.from_pretrained(repo)model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
draft = open("draft.txt", encoding="utf-8").read()ids = tok(PF["instr"] + "\n\n" + draft.strip() + PF["sep"], return_tensors="pt").to(model.device)out = model.generate(**ids, do_sample=True, temperature=1.0, top_p=0.95, top_k=0, # switches off the top-k 64 in generation_config.json max_new_tokens=2048)print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True).strip())import jsonfrom huggingface_hub import hf_hub_downloadfrom vllm import LLM, SamplingParams
repo = "jialinyyzz/humanizer"PF = json.load(open(hf_hub_download(repo, "prompt_format.json"), encoding="utf-8"))llm = LLM(model=repo, dtype="bfloat16", max_model_len=8192, limit_mm_per_prompt={"image": 0, "audio": 0, "video": 0}) # text onlyparams = SamplingParams(temperature=1.0, top_p=0.95, top_k=-1, min_p=0.0, repetition_penalty=1.0, max_tokens=2048) # top_k=-1: off
drafts = [open(p, encoding="utf-8").read() for p in ["draft1.txt", "draft2.txt"]]for r in llm.generate([PF["instr"] + "\n\n" + d.strip() + PF["sep"] for d in drafts], params): print(r.outputs[0].text.strip(), "\n---")FROM ./humanizer-12b-Q8_0.ggufTEMPLATE """{{- $draft := "" }}{{- range .Messages }}{{- if eq .Role "user" }}{{- $draft = .Content }}{{- end }}{{- end }}Rewrite the text below so it reads like a person wrote it, not a language model.
Reorganize it as you see fit. Vary sentence length on purpose. Cut hedging,throat-clearing, and any sentence that only announces what comes next.Prefer the concrete word over the abstract one. It is fine to sound uneven.
Every fact, number, unit, date, name and quotation must survive unchanged.
{{ $draft }}
### Rewritten:{{ "\n\n" }}"""PARAMETER temperature 1.0PARAMETER top_p 0.95PARAMETER top_k 0PARAMETER min_p 0PARAMETER repeat_penalty 1.0PARAMETER num_ctx 8192PARAMETER num_predict 2048ollama create humanizer -f Modelfileollama run humanizer # one draft per message, no leading or trailing blank lines# or raw mode, which skips the template:jq -n --rawfile d draft.txt --slurpfile f humanizer-model/prompt_format.json \ '{model: "humanizer", raw: true, stream: false, prompt: ($f[0].instr + "\n\n" + ($d | sub("^\\s+"; "") | sub("\\s+$"; "")) + $f[0].sep), options: {temperature: 1.0, top_p: 0.95, top_k: 0, min_p: 0, repeat_penalty: 1.0, num_ctx: 8192, num_predict: 2048}}' \| curl -s http://127.0.0.1:11434/api/generate -d @- | jq -r .responseimport json, urllib.request
PF = json.load(open("humanizer-model/prompt_format.json", encoding="utf-8"))draft = open("draft.txt", encoding="utf-8").read()body = {"model": "humanizer-12b-q8_0", # replace with the model id shown in LM Studio "prompt": PF["instr"] + "\n\n" + draft.strip() + PF["sep"], "temperature": 1.0, "top_p": 0.95, "top_k": 0, "min_p": 0, "repeat_penalty": 1.0, "max_tokens": 2048}req = urllib.request.Request("http://127.0.0.1:1234/v1/completions", json.dumps(body).encode("utf-8"), {"Content-Type": "application/json"})print(json.load(urllib.request.urlopen(req, timeout=900))["choices"][0]["text"].strip())