File size: 6,479 Bytes
61bf377
 
 
fb28304
 
 
 
 
 
 
 
e5bcf8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61bf377
 
e5bcf8f
 
 
61bf377
e5bcf8f
15a9381
e5bcf8f
 
 
 
 
 
 
15a9381
 
 
61bf377
e5bcf8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8317f3b
61bf377
e5bcf8f
 
8317f3b
e5bcf8f
8317f3b
 
 
e5bcf8f
8317f3b
61bf377
fb28304
 
 
 
15a9381
 
 
61bf377
15a9381
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
license: mit
base_model: openbmb/MiniCPM5-1B
datasets:
- koboshchan/klicke-events
tags:
- typr
- revtypr
- writing-process
- keystroke-dynamics
- lora
model-index:
- name: Typr (RevTypr v4.4)
  results:
  - task:
      type: writing-process-generation
      name: Human Writing Process Generation
    dataset:
      name: koboshchan/klicke-events (held-out test, 64 essays)
      type: koboshchan/klicke-events
      split: test
    metrics:
    - name: Exact Replay Rate
      type: exact_match
      value: 1.0
    - name: 5-Fold Process Turing AUC (ideal 0.50)
      type: roc_auc
      value: 0.6765
    - name: Calibrated Discriminator Human Score
      type: human_score
      value: 0.7917
---

<p align="center">
  <img src="https://huggingface.co/koboshchan/typr/resolve/main/logo.svg" alt="Typr Logo" width="84" height="84" />
</p>

<h1 align="center">Typr (RevTypr v4.4)</h1>

<p align="center">
  <a href="https://github.com/koboshchan/typr"><img src="https://img.shields.io/badge/GitHub-koboshchan%2Ftypr-181717?logo=github" alt="GitHub" /></a>
  <a href="https://huggingface.co/datasets/koboshchan/klicke-events"><img src="https://img.shields.io/badge/Dataset-koboshchan%2Fklicke--events-FFD21E?logo=huggingface&logoColor=000" alt="Dataset" /></a>
  <a href="https://github.com/koboshchan/typr/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License" /></a>
</p>

Monorepo model bundle for **[Typr (RevTypr v4)](https://github.com/koboshchan/typr)** β€” a 6-model neural pipeline trained strictly on real human writing trajectories from **[koboshchan/klicke-events](https://huggingface.co/datasets/koboshchan/klicke-events)** (derived from the [KLiCKe Corpus](https://github.com/terryyutian/KLiCKe-Corpus) by Tian, Crossley, & Van Waes, 2025) with **zero synthetic training data** and **100% exact replay by mathematical construction**.

- **Source Code, Training Pipeline & Web App:** [github.com/koboshchan/typr](https://github.com/koboshchan/typr)
- **Training Dataset:** [huggingface.co/datasets/koboshchan/klicke-events](https://huggingface.co/datasets/koboshchan/klicke-events)

---

## How Human Is It? (Held-Out KLiCKe Evaluation)

All numbers below are measured **pure-raw (`best-of-1`, zero post-editing)** on **64 unseen held-out test essays** from `koboshchan/klicke-events` (`split="test"`, strict writer isolation β€” zero writers overlap with training).

> **Headline:** **100.0% exact character-for-character replay** (`64/64`) with a **0.6765 5-fold Process Turing AUC** across all 30 keystroke, pause, navigation, and revision features (`0.50` = indistinguishable from real humans; down from `0.8188` in Round 2).

### Behavioral Alignment: Real Humans vs. Typr v4.4 (Pure-Raw)

| Behavioral Feature | Real Humans (KLiCKe) | Typr v4.4 (Pure-Raw) | 1D Wasserstein ↓ | 1D Separator AUC *(0.50 = ideal)* |
|---|---:|---:|---:|---:|
| **Exact Replay Rate** | `100.0%` | **`100.0%`** | `0.000` | `0.500` |
| **Mid-Word Pause Context (`pause_ctx_mid_word`)** | `0.462` | **`0.464`** | `0.017` | `< 0.57` |
| **Mid-Doc Revision Share (`mid_doc_edit_frac`)** | `0.365` | **`0.346`** | `0.058` | `< 0.57` |
| **Mean Typing Burst (`burst_len_mean`)** | `9.00` chars | **`9.44` chars** | `0.620` | `< 0.57` |
| **Mean Delete Length (`del_len_mean`)** | `3.82` chars | **`3.17` chars** | `0.805` | `< 0.57` |
| **90th-Pct Delete Length (`del_len_p90`)** | `8.02` chars | **`6.39` chars** | β€” | `0.596` |
| **Total Wait Log-Time (`log_wait_ms_per_100c`)** | `10.44` | **`10.29`** | `0.160` | `0.573` |
| **Pauses / 100 Chars (`pauses_per_100c`)** | `20.19` | **`17.24`** | `3.111` | `< 0.57` |
| **Selection Deletes / 100 Chars (`sels_per_100c`)** | `0.150` | **`0.113`** | `0.048` | `< 0.57` |
| **Cursor Jumps / 1k Chars (`jumps_per_1kc`)** | `16.04` | **`13.06`** | `4.394` | `< 0.57` |
| **Small Cursor Moves / 1k Chars (`small_moves_per_1kc`)** | `6.92` | **`8.98`** | `3.412` | `0.671` |
| **Edits / 100 Chars (`edits_per_100c`)** | `5.05` | **`3.75`** | `1.375` | `0.640` |
| **Deleted Chars / 100 Chars (`del_chars_per_100c`)** | `23.97` | **`13.32`** | β€” | `0.642` |
| **Typed-to-Final Ratio (`typed_to_final_ratio`)** | `1.232` | **`1.133`** | `0.102` | `0.642` |

### Iterative GRPO Progression (Pure-Raw `best-of-1`, 64 Held-Out Test Essays)

| Training Stage | Exact Replay | 5-Fold Turing AUC ↓ | `del_len_mean` *(human 3.82)* | `del_len_p90` *(human 8.02)* | `small_moves/1kc` *(human 6.92)* | `typed/final` *(human 1.232)* |
|---|---:|---:|---:|---:|---:|---:|
| Round 2 + `OldTextLLM` | `100.0%` | `0.8188` | `2.42` | `4.88` | `10.92` | `1.111` |
| Round 3 (GRPO + Anti-Gibberish Guard) | `100.0%` | `0.8125` | `2.85` | `5.33` | `9.56` | `1.112` |
| **Round 4 (Macro Deletion Center GRPO)** | **`100.0%`** | **`0.6765`** | **`3.17`** | **`6.39`** | **`8.98`** | **`1.133`** |

---

## Repository Structure (~100 MB total, LoRA only)

- `config.json` β€” Model bundle metadata, eval metrics & Hugging Face Hub download-stats query file
- `logo.svg` β€” Typr Caret T vector brand mark
- `WriterPersonaVAE/persona_vae.pt` β€” 16-d writer style VAE + empirical real writer latent bank (`398 KB`)
- `RevPointerNet/rev_pointer.pt` β€” 5.26M 2-scale Char-U-Net + Stride-8 Patch Transformer, Round-4 GRPO (`20 MB`)
- `OldTextLLM/` β€” `r=16` LoRA adapter + tokenizer for `openbmb/MiniCPM5-1B` (`43 MB`; base model auto-pulled separately)
- `TypoMotorNet/motor_net.pt` β€” Char-level Pointer-Generator with KV-cache (`26 MB`)
- `PauseNet/pause_net.pt` β€” 2.65M Multi-Scale Dilated ConvNeXt (`10 MB`)
- `HumanDiscriminator/discriminator.pt` β€” Round-4 calibrated behavioral discriminator for `--best-of` reranking (`292 KB`)
- `quantile_stats.json` β€” Precomputed human behavioral quantile bands

## Training Data

Trained 100% on real human writing logs from **[koboshchan/klicke-events](https://huggingface.co/datasets/koboshchan/klicke-events)** (`4,346` train / `243` val / `240` test essays, strict writer isolation), originally collected in the **KLiCKe Corpus** (Tian, Crossley, & Van Waes, 2025, *Journal of Writing Research*).

## Quick Start

Checkpoints are pulled automatically from `koboshchan/typr` via `typr.hub.ensure_hf_checkpoints()` when running the [Typr CLI or Docker stack](https://github.com/koboshchan/typr):

```bash
git clone https://github.com/koboshchan/typr.git
cd typr
python -m typr.generate_v4 --essay-file demo/unseen_essay.txt --best-of 4 --out-json out.json
```