--- license: apache-2.0 base_model: openbmb/MiniCPM5-2B tags: - humanizer - ai-humanizer - text-humanization - text-rewriting - rewriting - paraphrase - paraphraser - style-transfer - email - email-rewriter - ai-detection - pangram - gguf - llama.cpp - quantized - local - local-first - offline - privacy - on-device - edge - mobile - small-language-model - minicpm - qlora - lora - text-generation language: - en library_name: llama.cpp pipeline_tag: text-generation --- Paraphase-2B: a stiff email draft rewritten into a plain, human-sounding email # Paraphase-2B — the small AI humanizer for email Paraphase-2B is the **2.5B-parameter** member of the Paraphase family: an **AI humanizer for English email** that runs on a 4–6 GB device. It rewrites AI-sounding drafts into plain prose, keeps every fact, and is **100% local** — works offline, no API, no upload. It is a QLoRA fine-tune of [MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B), shipped as GGUF. **The short version:** use the 2B when you have 4–6 GB of RAM and want a small, fast, offline rewriter. Use the [4B](https://huggingface.co/chadstthomas/Paraphase-4B) when you can spare 4.5 GB — it is 100% valid out of the box and keeps slightly more facts. The 2B needs the retry wrapper (below) to reach its best validity. ## Quick start 1. Download `paraphase-2b-Q8_0.gguf` (2.68 GB). 2. Serve it: `llama-server -m paraphase-2b-Q8_0.gguf -c 2048` 3. Send the rewrite prompt below. No thinking flag is needed. [On-device guide ↓](#on-device-help) · [Interactive comparison →](https://huggingface.co/spaces/chadstthomas/paraphase-explorer) · [Try the 4B live →](https://huggingface.co/spaces/chadstthomas/paraphase-rewriter) ## Before and after One synthetic draft from the 2B Q8 + retry. The measured numbers are below; this is a demo, not a benchmark. - *Before:* Furthermore, it is important to note that all expense reports for the month of September must be submitted by October 15. Late submissions will not be processed until the following cycle. - *After:* Also, remember that all September expense reports need to be submitted by October 15. Late ones won't be processed until the next cycle. ## Which one should I run? | | **2B Q8 + retry** | **4B Q8 + retry** | |---|---|---| | file size | **2.68 GB** | 4.48 GB | | free RAM (approx.) | **~3.5 GB** | ~5.5 GB | | valid on voice50 | 48/50 | **50/50** | | copy reuse | 0.294 | **0.260** | | AI tells | **6.3%** | 8.0% | | numeric facts | 96.1% | **97.0%** | | tool calls | 65% | 65% | | Pangram, 13 flagged drafts | 10/13, median −0.503, 7 rescues | 10/13, median −0.588, 9 rescues | | Pangram gate (11/13) | missed | missed | **Pick the 2B when:** - The device has **4–6 GB of RAM** (phone, small laptop, Raspberry Pi-class box). - You want the **fewest AI tells** (6.3% vs 8.0%) and the smallest download. - You are rewriting **batches offline** and can run the retry wrapper. - The 4B does not fit, or its 4.5 GB download is impractical. **Pick the 4B when:** - The device has **6 GB+ free** and you want the best validity and fact fidelity. - You want **50/50 valid greedy** without relying on resampling. - You are publishing or automating and want the stronger default. **Don't use either for:** non-English text, long documents, legal/medical advice, unattended sending, or claims of guaranteed detector evasion. ## Measured stats (voice50, 50 paired items) | configuration | valid | AI tells | facts | copy reuse | length | tool | |---|---:|---:|---:|---:|---:|---:| | 2B Q8, greedy | 41/50 | **2.4%** | 97.5% | 0.301 | 0.82 | 65% | | **2B Q8 + retry** | **48/50** | 6.3% | 96.1% | 0.294 | 0.95 | 65% | | 2B Q4, greedy | 41/50 | 7.3% | 93.9% | **0.219** | 0.77 | 60% | Greedy output is only 82% valid: the base model's instruction-recitation habit returns on some inputs. The retry wrapper fixes 7 of the 9 bad rows. Q4 is the smallest rung (1.56 GB) and copies the least, but its fact fidelity and tool calls fall below the Q8 release bar. ## Pangram Two pre-registered tests, both from the same 186-probe mission: - **12-item human-source gate:** the 2B passed **12/12** vs the base model's 11/12 (one discordant item, McNemar p = 1.0; continuous median −0.213, p = 0.052). Descriptive only. - **13 flagged drafts:** **10/13 improved**, median `fraction_ai` **−0.503** (95% CI [−0.588, 0.000]), **7 crossed below 0.5**, 0 pass→fail flips, exact sign test **p = 0.039**. The pre-registered gate required 11/13, so this is **suggestive, not confirmed**. The broad product-path arm of the mission was control-invalid: only 13 of 50 voice50 drafts were flagged by Pangram, so the drafts were too easy. The numbers above are the flagged subset where the question is meaningful. Raw aggregates are in [`pangram/`](pangram/). ## On-device help ### Memory | rung | file | free RAM (approx.) | typical device | |---|---:|---:|---| | Q4_K_M | 1.56 GB | ~2.3 GB | 4 GB phone (tight), 4 GB laptop | | **Q8_0** | **2.68 GB** | **~3.5 GB** | 6 GB phone, 8 GB laptop | These are working estimates: weights + 2048-token KV cache + runtime overhead. On a 4 GB device use Q4 and `-c 1024`; leave the OS some room. The model is English email, so a 2048 context is plenty for a single draft. ### llama.cpp ```bash llama-server -m paraphase-2b-Q8_0.gguf -c 2048 --host 0.0.0.0 --port 8080 ``` Then send the rewrite prompt: ```python import requests PROMPT = ( "Rewrite the email below so it reads like a real person wrote it quickly at work. " "Keep every fact, number, name, and commitment exactly the same. " "Use plain, direct language. No em dashes. Keep it about the same length. " "Output only the rewritten email.\n\nEMAIL:\n" ) resp = requests.post("http://127.0.0.1:8080/v1/chat/completions", json={ "messages": [{"role": "user", "content": PROMPT + draft}], "temperature": 0, "max_tokens": 1024, }) print(resp.json()["choices"][0]["message"]["content"]) ``` Unlike the 4B, the 2B does **not** need a thinking-disable flag. ### Ollama ```text FROM ./paraphase-2b-Q8_0.gguf PARAMETER temperature 0 PARAMETER num_ctx 2048 ``` ```bash ollama create paraphase-2b -f Modelfile ollama run paraphase-2b ``` ### Android and iOS - Build llama.cpp for the device (Termux on Android, Xcode on iOS) and load the GGUF; the file is architecture-independent. - Prefer **Q4 on 4 GB phones**, Q8 on 6 GB+. Pass `-t 4` (big cores) and `-c 1024` on small devices; expect thermal throttling on long batches. - Keep the model on internal storage; keep the app in the foreground for the first runs. - Any GGUF-compatible app that uses llama.cpp can load the file; the prompt and retry policy below are what matter. ### Retry wrapper (recommended) Take the greedy output. If it is empty, meta, an instruction echo, shorter than `max(20, 0.5 × input)` words, or copies more than 70% of the input's 5-grams, resample at temperature 0.9 (at most twice) and keep the first acceptable candidate. This is what turns 41/50 valid into 48/50 and is how the 0.294 reuse number was measured. ## Task adapter: extraction (new) This model has a measured **extraction LoRA** in the [Paraphase-4B Adapter Pack](https://huggingface.co/chadstthomas/Paraphase-4B-Adapter-Pack) (`gguf/paraphase-2b-extract-lora.gguf`, 50 MB; also as `peft/extract-2b/`). Apply it to this raw base: ```bash llama-server -m paraphase-2b-Q8_0.gguf \ --lora paraphase-2b-extract-lora.gguf -c 2048 ``` On the frozen 50-email extraction test (magnitude-aware v2 labels): exact match **0.14 → 0.34**, micro F1 **0.277 → 0.631**, date F1 **0.313 → 0.806**, amount F1 **0.438 → 0.766** — within 0.05 micro F1 of the 4B extraction adapter, on the on-device tier. Extraction is a format task, which is exactly where a 2B holds up. ## Files | file | size | notes | |---|---:|---| | `paraphase-2b-Q8_0.gguf` | 2.68 GB | recommended when RAM allows | | `paraphase-2b-Q4_K_M.gguf` | 1.56 GB | 4 GB devices; below the Q8 quality bar | | `adapter/` | 43 MB | LoRA adapter (r=16) | | `pangram/` | small | aggregate mission results, no email text | ## Training - Base: `openbmb/MiniCPM5-2B` (Apache-2.0). - Method: 4-bit QLoRA, 200 steps, LR 1e-4, r=16. - Data mix: 502 low-overlap paraphrase pairs ×2, 175 notes→email pairs, 475 real AI-draft/human pairs, 412 persona rows, 26 tool-replay rows ×2. - Human source text is AESLC-derived and is **not redistributed**. - No detector was used in training. ## Limitations - 18% invalid greedy; use the retry wrapper (4% in the measured policy). - The 2B is less valid and keeps fewer facts than the 4B; Q4 is weaker still. - One detector vendor (Pangram 4.1), one run per probe; the flagged-subset result is suggestive, and it is conditional on drafts Pangram flags. - English email only; no human prose-quality evaluation. ## License Apache-2.0, inherited from the base model. See `LICENSE`. **Compare interactively:** [Paraphase Explorer](https://huggingface.co/spaces/chadstthomas/paraphase-explorer) · **Larger sibling:** [Paraphase-4B](https://huggingface.co/chadstthomas/Paraphase-4B)