DESTINY
GuidesG-04 · Stylometrics & Provenance MathAuthor: Karan Yadav · Updated 2026-11-25

Winnowing k-Gram Fingerprinting, MATTR-50 Lexical Stability & ESL Fairness in Stylometrics

Single-number "AI percentage" scores routinely falsely accuse non-native English scholars and technical writers while hiding proprietary thresholds behind ad-choked upload portals. Combining Schleimer–Wilkerson–Aiken Winnowing for exact local overlap, length-invariant MATTR-50 lexical diagnostics, and FIPS 180-4 SHA-256 revision chains replaces opaque accusations with verifiable mathematical evidence.

Why do black-box perplexity classifiers systematically misclassify ESL academic writers?

Direct answer: Perplexity classifiers assume low next-token surprise implies synthetic generation. However, controlled peer-reviewed evaluations (Liang et al., Patterns 2023) revealed that over 61% of authentic human TOEFL essays written by non-native English students were falsely flagged as AI-generated because structured academic English instruction favors high-probability transition clauses and compact core vocabulary.

From a Bayesian standpoint, deploying an imperfect binary classifier in an academic disciplinary pipeline creates a severe base-rate trap. Even a hypothetical detector with a 2% false-positive rate (far better than observed ESL error rates) applied across a university cohort of 10,000 genuine student submissions produces 200 wrongful academic-misconduct accusations per semester. Furthermore, Sadasivan et al. (2023) established theoretical limits showing that lightweight paraphrasing collapses statistical separability toward random chance. Consequently, responsible scholarly tooling must refuse to emit uncalibrated accusatory labels, instead decomposing inspectable linguistic signals paired with positive cryptographic draft history.

How does the Winnowing algorithm mathematically guarantee exact substring overlap detection?

Direct answer: Introduced by Schleimer, Wilkerson, and Aiken at ACM SIGMOD 2003, Winnowing hashes every consecutive k-word shingle and slides a window of w consecutive hashes across the sequence, selecting the rightmost minimum hash in each window. Any shared passage of length t ≥ k + w − 1 words contains at least one complete window whose minimum hash must match in both documents.

t=k+w−1 , d=2w+1 (k=5,w=4⇒t=8 words,d=0.40)

The proof is elegant and context-independent. Suppose two documents share an identical normalized sequence of t = k + w − 1 words. That span induces exactly w consecutive k-gram hashes, forming one full sliding window whose elements are identical in both texts regardless of surrounding edits, insertions, or deletions. Because the window’s minimum hash (breaking ties by rightmost offset) depends solely on those w hashes, both documents independently select the exact same fingerprint! Meanwhile, expected fingerprint density drops to 2 / (w + 1), keeping comparisons instantaneous on 15,000-word thesis chapters inside browser memory.

// O(n) Winnowing fingerprint selection (k=5 word shingles, w=4 window)
function winnowHashes(hashes, w = 4) {
  const selected = [];
  let lastPickedIdx = -1;
  for (let i = 0; i <= hashes.length - w; i++) {
    let minVal = hashes[i], minIdx = i;
    for (let j = i + 1; j < i + w; j++) {
      if (hashes[j] <= minVal) { // <= picks rightmost minimum on tie
        minVal = hashes[j];
        minIdx = j;
      }
    }
    if (minIdx !== lastPickedIdx) {
      selected.push({ hash: minVal, pos: minIdx });
      lastPickedIdx = minIdx;
    }
  }
  return selected;
}

Why does MATTR-50 outperform classic Type-Token Ratio across essays of varying lengths?

Direct answer: Raw Type-Token Ratio (V / N) decays asymptotically toward zero as token count N grows due to Heap’s Law. Covington & McFall’s Moving-Average Type-Token Ratio (MATTR) averages local unique-word ratios across every contiguous 50-word window, yielding an unbiased estimator directly comparable between a 250-word abstract and a 12,000-word dissertation chapter.

MetricFormulaLength BiasAppropriate Diagnostic Use
Burstiness CVσsent / μsentLow (≥ 8 sentences)Detecting monotonous cadence for editorial revision
MATTR-50mean(TTR over 50-word windows)Length-InvariantComparing vocabulary diversity across chapters
Winnowing (k=5, w=4)Jaccard of min-window FNV-1aInvariant (≥ 8 words)Self-plagiarism & lab-manual boilerplate isolation
SHA-256 ChainH(drafti ∥ Hi−1 ∥ ti)None (256-bit digest)Positive cryptographic proof of iterative drafting

How do cryptographic SHA-256 revision chains shift provenance from accusation to positive proof?

Direct answer: Instead of defending an essay against a fragile post-hoc detector, a scholar records local SHA-256 checkpoints from outline through literature notes to defense manuscript. Each JSON receipt links the new draft digest to the prior checkpoint hash, providing committee-verifiable proof of incremental composition while preserving complete local privacy.

Because FIPS 180-4 SHA-256 is collision-resistant and preimage-resistant, nobody can alter an earlier draft checkpoint without invalidating every subsequent hash in the exported JSON chain. Paired with local Winnowing diffing against one’s own previously published conference papers (preventing inadvertent self-plagiarism prior to journal submission), this architecture gives graduate students, STEM lab teams under corporate NDAs, and international scholars robust protection without surrendering intellectual property to commercial scraping repositories.

How should universities, writing centers, and STEM labs interpret decomposed stylometrics responsibly?

Direct answer: Treat stylometric signals (sentence burstiness CV, Shannon lexical entropy H1, MATTR-50, and formulaic transition counts) strictly as formative revision diagnostics rather than punitive adjudication. Combine local Winnowing source comparison for verbatim attribution hygiene with chronological SHA-256 draft checkpoints whenever positive provenance is requested.

Consider two everyday campus scenarios where opaque detectors fail catastrophically but decomposed local metrics succeed. First, in an undergraduate chemistry or electrical engineering lab course, forty students calibrate the identical spectrometer or oscilloscope using the same three-page lab handout. Unsurprisingly, their Materials & Methods paragraphs display low sentence-length variance (low CV) and substantial verbatim protocol overlap. Running local Winnowing (k = 5, w = 4) with the lab manual loaded in the reference pane immediately isolates shared apparatus phrasing from the student’s independent error-propagation discussion—helping students cite standard protocols cleanly before grading without uploading capstone NDA data to external servers.

Second, consider a multilingual doctoral candidate writing a literature review in English as a third language. Disciplined academic writing courses explicitly teach structured discourse markers ("in contrast", "consequently", "furthermore") and measured declarative clauses—producing moderate burstiness and predictable syntax that perplexity-only models frequently penalize. By reviewing MATTR-50 across chapters, stripping stray clipboard formatting characters (such as U+00A0 non-breaking spaces or U+200B zero-width spaces introduced by bilingual dictionary plugins), and archiving timestamped local SHA-256 snapshots at prospectus, mid-draft, and defense stages, the candidate preserves both scholarly voice and verifiable human authorship.

From a software engineering perspective, every metric in our client-side studio is reproducible across browsers and operating systems: tokenization lowercases ASCII letters, strips punctuation outside internal apostrophes and hyphens, computes deterministic 32-bit FNV-1a shingle hashes (offset basis 0x811C9DC5, prime 0x01000193), and executes synchronous FIPS 180-4 SHA-256 hashing over normalized UTF-8 bytes. Zero proprietary weights, zero remote endpoints, and zero unverifiable probability guesses stand between the student and the underlying mathematics.

Peer-Reviewed Research & Cryptographic Standards

  1. Schleimer, Wilkerson & Aiken (ACM SIGMOD 2003) — Winnowing: Local Algorithms for Document Fingerprinting
  2. Liang et al. (Patterns, 2023) — GPT Detectors Are Biased Against Non-Native English Writers
  3. Covington & McFall (Journal of Quantitative Linguistics, 2010) — Cutting the Gordian Knot: The Moving-Average Type-Token Ratio (MATTR)
  4. Sadasivan et al. (2023) — Can AI-Generated Text be Reliably Detected?
  5. NIST FIPS 180-4 — Secure Hash Standard (SHS / SHA-256)
[FAQ // VERIFIED SPECIFICATION]

Winnowing & ESL Fairness FAQ

04 ENTRIES · VISIBLE DOM PARITY
What is the guarantee threshold of Schleimer-Wilkerson-Aiken Winnowing with k=5 and w=4?
Every substring match of length at least t = k + w - 1 = 5 + 4 - 1 = 8 consecutive normalized words is mathematically guaranteed to produce at least one shared fingerprint hash, while reducing index storage by roughly a factor of 2 / (w + 1) = 40%.
Why are commercial perplexity-based AI detectors biased against ESL and international students?
Liang et al. (Patterns, 2023) tested seven widely used commercial detectors on TOEFL essays written by non-native English students and observed false-positive misclassification rates exceeding 61%, because standard English-for-Academic-Purposes phrasing yields lower statistical perplexity than colloquial native idioms.
Why use MATTR-50 instead of raw Type-Token Ratio (TTR) to measure lexical richness?
Raw TTR (unique words divided by total words) drops monotonically as an essay gets longer, making a 3,000-word dissertation chapter look artificially repetitive compared to a 300-word summary. Covington and McFall’s Moving-Average Type-Token Ratio (window = 50 words) remains length-invariant across arbitrary document sizes.
How do SHA-256 hash-chained revision snapshots protect students proactively?
Hashing sequential local drafts with FIPS 180-4 SHA-256 creates an append-only cryptographic lineage (v1 -> v2 -> v3) proving step-by-step human composition over days or weeks without ever surrendering unpublished coursework to a third-party cloud database.