Methodology & Technical Notes

ProseGrain: Stylometric AI Detection Methodology & FAQ

ProseGrain is a 100% client-side AI-generated article inspection desk compiled from zero-dependency Rust into a 153 KB WebAssembly binary, operating over HTTPS and localStorage with 0 bytes of manuscript text ever transmitted.

ProseGrain supports 4 genre calibrations across 4 languages (Simplified Chinese, Traditional Chinese, English, and Japanese), combining Dual-PPM cross-entropy, Liang et al. (ICML 2024) Mixture MLE α̂, DivEye 9D surprisal dynamics & Hurst exponent, Feature-Hashed NBSVM, Isotonic-calibrated GBDT with Exact TreeSHAP, and U+200B/U+202F cleanup with JSON export.

01 · Dual-Distribution PPM Cross-Entropy & Feature-Hashed NBSVM

ProseGrain embeds corpus-trained Dual-PPM Markov context tables and a 65536-bucket Feature-Hashed N-gram NBSVM inside WebAssembly memory, running 100% locally with 0 bytes uploaded.

ΔH_PPM(x) = (1/T) Σ log2 [ P_AI(x_t | ctx) / P_Human(x_t | ctx) ], z_NBSVM = b + w^T φ(x) / ||φ(x)||_2

02 · Distributional Mixture MLE (Liang et al., ICML 2024) & Word Graph

ProseGrain models lexical counts as a convex mixture of human and LLM distributions, solving concave Newton-Raphson MLE α̂ alongside word co-occurrence clustering in under 5 ms with 0 bytes uploaded.

α̂ = argmax_{α ∈ [0,1]} Σ_v c(v) · ln [ (1 - α) P_Human(v) + α Q_AI(v) ]

03 · DivEye 9D Surprisal Dynamics (TMLR 2026) & Hurst Exponent

ProseGrain extracts skewness, kurtosis, first/second-order discrete derivatives, lag-1 autocorrelation, and Rescaled-Range Hurst scaling over empirical conditional surprisal streams (0 bytes uploaded, 100% deterministic).

DivEye(s) = [ μ, σ, CV, γ_1, γ_2, E|Δs|, σ(Δs), E|Δ²s|, ρ_1, H_{R/S} ]

04 · Isotonic-Calibrated GBDT, Exact TreeSHAP & Watermark Sanitizer

ProseGrain fuses all 28 orthogonal features through a corpus-trained LightGBM ensemble with Isotonic calibration, computing exact Shapley log-odds attributions and stripping U+200B/U+202F/U+2060/U+FEFF with 0 bytes uploaded.

f(x) = φ_0 + Σ_{j=1}^{28} φ_j(x), Clean(s) = filter(c ∉ {U+200B..U+200D, U+2060, U+FEFF}, s)

Frequently Asked Questions (FAQ)

Does ProseGrain send my unpublished manuscript, paper, or draft to any external server?
ProseGrain transmits 0 bytes of your text over HTTPS. Sentence segmentation, log-odds scoring, compression profiling, and watermark stripping run 100% inside 153 KB WebAssembly memory, storing only your 4 languages UI setting in localStorage.
How does ProseGrain catch modern GPT-4o, Claude, and DeepSeek prose that avoids obvious clichés?
ProseGrain combines 6 orthogonal features in Rust + WebAssembly: contrastive negative-parallelism frames, cross-sentence surprisal flatness, heading-filtered burstiness CV, paragraph uniformity, Yule K lexical concentration, and LZ77 redundancy in under 10 ms with 0 bytes uploaded.
How should I read the four sentence annotation tiers in ProseGrain?
ProseGrain assigns each sentence a 0%–100% estimate: High AI (>=70%) marks strong RLHF constructions or hidden codepoints; Moderate (46%–69%) marks smooth predictable pacing; Varied (25%–45%) marks diverse phrasing; Human Burst (<25%) marks concrete specificity or sharp cadence shifts (0 bytes uploaded).
Where do U+200B zero-width spaces and U+202F narrow no-break spaces come from in ProseGrain scans?
ProseGrain scans every UTF-8 scalar for U+200B, U+202F, U+2060, U+200C/D, and inline U+FEFF markers often introduced by LLM tokenizers or clipboard wrappers, providing a 100% local idempotent cleaner with 0 bytes uploaded.
How does ProseGrain avoid false positives on dense academic abstracts and news dispatches?
ProseGrain includes General, Academic, Press, and Copy domain presets alongside 3 sensitivity levels; selecting Academic shifts the prior and credits high-surprisal empirical measurements so human research prose is scored fairly with 0 bytes uploaded.