chantra/humanizerth-thai-12B-Q4_0-MLX

来源:🤗text-generationgemma11.9B 参数24 GBsafetensors✓ 3 个校验和4 天前更新
或提交种子

humanizerth-thai-12B-Q4_0-MLX

Ultra-Lightweight 4-bit Thai Text Humanization Model for Apple Silicon (MLX 4-bit, ~6.3 GB)

humanizerth-thai-12B-Q4_0-MLX is an ultra-lightweight, 4-bit quantized MLX model for Thai text humanization. It removes artificial, overly-formal, and robotic "AI-sounding" patterns generated by LLMs (such as ChatGPT, Claude, and Gemini) and restores natural, conversational Thai phrasing while maintaining high fidelity for factual data, numbers, entities, dates, and pricing.

This model is a 4-bit quantized version (q_bits=4, q_group_size=64, 4.5 bits/weight effective) of humanizerth, fine-tuned on top of jialinyyzz/humanizer (which is built upon google/gemma-4-12B) using 10,000 clean, authentic, pre-LLM human Thai text pairs (from Wongnai restaurant reviews, Pantip forums, and Wisesight social media datasets).

For the higher-precision 8-bit version, see chantra/humanizerth-thai-12B-Q8_0-MLX.


🚀 Key Advantages of the 4-bit Version

  1. Ultra-Compact Footprint: Only 6.3 GB on disk (a 47% reduction from the 11.8 GB 8-bit model).
  2. Runs Smoothly on 8 GB & 16 GB Apple Silicon: Requires only ~7–9 GB peak unified memory during inference, enabling lightning-fast local execution on base M1/M2/M3/M4/M5 MacBook Air and MacBook Pro laptops.
  3. High Generation Speed: Delivers ~45–55 tokens/sec on Apple Silicon GPUs.
  4. Strips AI Boilerplate: Naturally removes robotic openers like "ในส่วนของประเด็นข้อมูลและรายละเอียดที่กล่าวถึงนั้น...", "จากการประเมินคุณภาพของสถานประกอบการแห่งนี้ พบว่า...", and bureaucratic wrappers like "ตามรายละเอียดที่ระบุไว้ข้างต้น".

📊 Comparison: 4-bit vs. 8-bit vs. Base Model (100 Test Samples Benchmark)

Attribute / Metric Base Humanizer (Zero-Shot) humanizerth (4-bit Q4_0) ⚡ humanizerth (8-bit Q8_0) 🏆
Model Size on Disk ~24.0 GB (BF16) ~6.3 GB ⚡ ~11.8 GB
Peak RAM Usage ~26 GB ~7–9 GB ~14–16 GB
Target Hardware 32 GB+ Mac 8 GB / 16 GB / 24 GB Mac 18 GB / 36 GB / 48 GB Mac
Generation Speed ~22 tok/s ~45–55 tok/s ~32–40 tok/s
Hard Fact Recall (100 Samples) 100.0% 100.0% (100/100) 100.0% (100/100)
Median Verbatim AI Reuse (Lower is better) 0.0820 0.0550 (< 0.22 target) 0.0350 (< 0.22 target)
Mean Verbatim AI Reuse (Lower is better) 0.1114 0.0813 0.0813
High Reuse Outliers (> 0.50) 0.0% 0.0% (0 / 100) 0.0% (0 / 100)
Paragraph Retention 99.70% 98.23% 100.0%
Language Purity (CJK Leakage) 0 / 100 0 / 100 (0%) 0 / 100 (0%)
Overall humanizerth Score 0.9921 0.9959 0.9911

4-bit Performance by Genre (100 Samples)

  • Pantip QA (46 samples): Fact Recall 1.000 | Median Reuse 0.054 | Score 0.995
  • Wisesight Sentiment (19 samples): Fact Recall 1.000 | Median Reuse 0.053 | Score 0.999
  • Wongnai Reviews (35 samples): Fact Recall 1.000 | Median Reuse 0.069 | Score 0.996

💻 Quickstart with MLX

1. Installation

pip install -U mlx-lm

2. Basic Inference (Python)

from mlx_lm import load, generate

model_id = "chantra/humanizerth-thai-12B-Q4_0-MLX"
model, tokenizer = load(model_id)

ai_draft = """
จากการประเมินคุณภาพของอาหารและการให้บริการของสถานประกอบการแห่งนี้ พบว่า 
สถานประกอบการคาเฟ่เปิดใหม่ย่านอารีย์แห่งนี้ มีเอกลักษณ์ที่โดดเด่นเป็นอย่างยิ่ง 
โดยเฉพาะอย่างยิ่งในส่วนของเมนูมัทฉะลาเต้เกรดพิธีการ ซึ่งมีราคาจำหน่ายอยู่ที่แก้วละ 160 บาท 
มีรสชาติที่กลมกล่อมและไม่หวานจนเกินไป นอกจากนี้ ในส่วนของบรรยากาศภายในสถานประกอบการ 
ถือได้ว่ามีความเงียบสงบและเหมาะสมเป็นอย่างยิ่งสำหรับการนั่งปฏิบัติงานนอกสถานที่ ตามรายละเอียดที่ระบุไว้ข้างต้น
"""

instruction = (
    "Rewrite the text below so it reads like a person wrote it, not a language model.\n\n"
    "Reorganize it as you see fit. Vary sentence length on purpose. Cut hedging,\n"
    "throat-clearing, and any sentence that only announces what comes next.\n"
    "Prefer the concrete word over the abstract one. It is fine to sound uneven.\n\n"
    "Every fact, number, unit, date, name and quotation must survive unchanged.\n\n"
)

prompt = f"{instruction}{ai_draft.strip()}\n\n### Rewritten:\n\n"

output = generate(model, tokenizer, prompt=prompt, max_tokens=512)
print(output)

🎨 Persona Steering via Prefix Priming

You can steer the tone into Gen Z / Teenager / Content Creator style by priming the completion with an opening phrase:

prefix = "ทุกคนนน คือปังมากกกก "
prompt_with_prime = prompt + prefix

output = prefix + generate(model, tokenizer, prompt=prompt_with_prime, max_tokens=512)
print(output)

Popular Primers for Creators:

  • Food & Cafe: "ทุกคนนน คือปังมากกกก "
  • Travel: "ทริปนี้คือปังไม่ไหวววว ค่าาา "
  • Tech Review: "แกรรร บอกเลยว่าโคตรปังงง "
  • Finance: "อันนี้คือดีย์งามมมม ค้าบบบ "
  • Skincare: "เตือนแล้วนะแกรรร คือเริ่ดเลยยย แต่ "

🛠️ Model Architecture & Quantization Details

  • Base Architecture: Gemma-4-12B (mlx_lm.models.gemma4)
  • Upstream Checkpoint: jialinyyzz/humanizer
  • Quantization: 4-bit weights (q_bits: 4, q_group_size: 64, effective bits: 4.501 per weight)
  • Context Length: 4096 tokens
  • Target Data: 100% Authentic Human Thai Corpora (Zero synthetic LLM-generated targets)
  • Hardware Compatibility: Apple Silicon Macs (M1/M2/M3/M4/M5)

📜 Citation & Credits

@misc{humanizerth2026,
  author = {Chantra / Thanawit},
  title = {humanizerth-thai-12B-Q4_0-MLX: Ultra-Lightweight 4-bit Thai Text Humanization on Apple Silicon},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/chantra/humanizerth-thai-12B-Q4_0-MLX}}
}