vadimbelsky commited on
Commit
e98225e
·
verified ·
1 Parent(s): 3cc2af2

v15: bias 0.0000 on every origin, engine filtered F1 0.8563->0.9348 (frozen file), register LOCATION 0.57->0.93, MUST 21/21

Browse files
Files changed (2) hide show
  1. README.md +58 -49
  2. onnx/model_quantized.onnx +1 -1
README.md CHANGED
@@ -16,9 +16,8 @@ plus four Arabic registers and Arabizi.
16
  It is the NER half of a data-loss-prevention agent that inspects outbound
17
  AI-assistant traffic on a device and redacts personal data before it leaves.
18
 
19
- `xlm-roberta-base`, fine-tuned on a fully synthetic corpus
20
- (`ScienceSoft/scnsoft-pii-synthetic-corpus`), exported to ONNX and int8
21
- quantized. **278 MB**, CPU inference.
22
 
23
  ## Labels
24
 
@@ -28,60 +27,65 @@ quantized. **278 MB**, CPU inference.
28
  have a shape and usually a checksum, so a regex decides them exactly and a
29
  classifier only produces a second, weaker opinion that then competes with the
30
  layer that was right. This model is built to leave them alone — and measurably
31
- does (see `touch_rate` below).
32
 
33
  ## Verified results
34
 
35
- Gate run 2026-09-03 (internal build v13), scored through the production Rust
36
- inference engine, not a Python decode of the same ONNX. Every figure measured,
37
- none estimated.
 
 
38
 
39
- | | this model | previously shipped |
40
  |---|---|---|
41
- | **regex-owned identifiers wrongly touched** (real ru text) | **0.0%** (0/770) | 0.1% (1/770) |
42
- | **known-defect suite** | **21/21** | 18/18 |
43
- | hivetrace ru PII — F1 / P / R | 0.8036 / 0.6888 / **0.9643** | 0.5888 / 0.4375 / 0.9000 |
44
- | Wojood ar NER — F1 / P / R | 0.4945 / 0.6143 / 0.4137 | 0.4888 / — / — |
45
- | production-engine filtered F1 (held-out synthetic) | **0.8563** | 0.7357 |
46
- | int8 F1 (held-out synthetic, Python decode) | 0.9321 | 0.8906 |
47
- | int8 vs fp32 F1 cost | 0.0025 | 0.0081 |
48
- | latency p95 @512 tok (CPU) | 193.4 ms | 190.9 ms |
49
- | name-origin bias delta | 0.0469 | 0.0312 |
50
-
51
- Head-to-head vs the incumbent it replaces (`onnx-community/multilang-pii-ner-ONNX`,
52
- PERSON only, WikiANN), ours ahead in every language: es +0.56 · it +0.53 ·
53
- en +0.55 · fr +0.51 · de +0.51 · ar +0.51 · ru +0.12 (95% CI entirely above the
54
- `-0.02` no-regression floor for every language).
55
-
56
- **The production-engine number is new in this run and is the one that matters.**
57
- Earlier cards quoted only a Python decode of the ONNX graph — the actual Rust
58
- inference engine (chunking, tokenizer template, span filtering) had never been
59
- scored directly, and doing so once already surfaced and fixed a real skew (the
60
- engine was dropping the `<s>`/`</s>` special tokens the model was trained with).
61
- 0.8563 is what the shipped agent actually emits on held-out synthetic text.
62
-
63
- **Latency and bias moved slightly against this model, both still inside
64
- budget.** p95 latency rose 2.5 ms (ceiling is 200 ms) and bias delta rose 0.0157
65
- (budget is 0.05). Neither regression is large enough to matter on its own; noted
66
- for anyone tracking the trend across runs rather than a single gate pass.
 
 
 
 
 
 
 
 
 
67
 
68
  ## Read this before using it
69
 
70
- **Recall was traded for precision, then partly traded back.** The previously
71
- shipped model already cut false positives on structured identifiers roughly
72
- 500× versus its own predecessor (53.6% → 0.1% touch rate); this run holds that
73
- line at 0.0% while also lifting real Russian PII recall 0.90 → 0.96 and F1
74
- 0.5888 → 0.8036 — the biggest jump this model line has made on real text in one
75
- step.
76
-
77
- **Organisation boundaries are still imperfect.** Wojood F1 is barely moved
78
- (0.4888 → 0.4945) and organisation spans remain the weakest category on real
79
- Arabic text — expect it to sometimes find that an organisation is present
80
- without choosing the exact right span.
81
 
82
  **Trained only on synthetic data.** Entity pools are finite, so scores on
83
  generated text overstate real-world ability. Judge it on the external
84
- benchmarks above (hivetrace, Wojood), not the synthetic figure.
 
85
 
86
  **Arabizi is a reconstruction.** No corpus contains it; its conventions
87
  (3=ain, 7=haa, 2=hamza) are our model of how people type, not observed data.
@@ -124,9 +128,14 @@ deliberately ignores.
124
 
125
  ## Training data
126
 
127
- `ScienceSoft/scnsoft-pii-synthetic-corpus` — fully synthetic, no real person's
128
- data. A meaningful share of rows contain no entity at all; those entity-free
129
- negatives are what keeps `touch_rate` near zero.
 
 
 
 
 
130
 
131
  ## Licence
132
 
 
16
  It is the NER half of a data-loss-prevention agent that inspects outbound
17
  AI-assistant traffic on a device and redacts personal data before it leaves.
18
 
19
+ `xlm-roberta-base`, fine-tuned on a fully synthetic corpus, exported to ONNX and
20
+ int8 quantized. **278 MB**, CPU inference.
 
21
 
22
  ## Labels
23
 
 
27
  have a shape and usually a checksum, so a regex decides them exactly and a
28
  classifier only produces a second, weaker opinion that then competes with the
29
  layer that was right. This model is built to leave them alone — and measurably
30
+ does (see the touch rate below).
31
 
32
  ## Verified results
33
 
34
+ Build **v15**. Gate run 2026-09-03, scored through the production Rust inference
35
+ engine, not a Python decode of the same ONNX. Corpus 147,753 training rows
36
+ (128,584 generated + 19,169 augmented) and 5,300 held-out rows, 2 epochs. Every
37
+ figure below was measured, none estimated; the gate was re-run on the stored
38
+ results before this upload and every check passed.
39
 
40
+ | | **v15 (this build)** | previous build on this repo (v13) |
41
  |---|---|---|
42
+ | **regex-owned identifiers wrongly touched** (hivetrace ru) | **0.0%** (0/770) | 0.0% (0/770) |
43
+ | **known-defect suite** | **21/21** (int8 and fp32) | 21/21 |
44
+ | hivetrace ru PII (synthetic, expert-annotated) — F1 / P / R | **0.8656 / 0.8000 / 0.9429** | 0.8036 / 0.6888 / 0.9643 |
45
+ | Wojood ar NER — F1 / P / R | **0.5870 / 0.6537 / 0.5327** | 0.4945 / 0.6143 / 0.4137 |
46
+ | IAHLT ar — F1 | **0.5444** | 0.4697 |
47
+ | TAB en incl. quasi-identifiers — F1 | 0.7009 | 0.7428 |
48
+ | production-engine filtered F1, frozen eval file `cf21c01b1759` (n = 3,300) | **0.9348** | 0.8563 |
49
+ | … PERSON only / production-masked (PERSON + ADDRESS) | **0.9772 / 0.9864** | 0.8094 / — |
50
+ | production-engine filtered F1, register eval `c72af982d47c` (n = 3,300) | **0.8786** | 0.7884 |
51
+ | … LOCATION / ADDRESS | **0.927 / 0.942** | 0.568 / 0.793 |
52
+ | int8 vs fp32 F1 cost (95% CI) | +0.0086 [+0.0058, +0.0112] | +0.0020 |
53
+ | latency p95 @ 512 tok (CPU) | 191.7 ms (measured under load avg 10–14; an upper bound) | 190.8 ms |
54
+ | name-origin bias delta | **0.0000** — every origin scores 1.000 | 0.0469 |
55
+
56
+ The two "frozen eval" rows are the only cross-build deltas in this table that
57
+ compare like with like: the same 3,300 rows, the same scorer, both builds. The
58
+ register file stresses LOCATION and ADDRESS in syntactic roles the original file
59
+ under-represents; v15 lifted LOCATION there from 0.568 to 0.927.
60
+
61
+ **What changed in v15.** Name-origin bias closed to zero (v14's frame work had
62
+ left it at 0.0469) by drawing names from the Mimesis pools for every origin
63
+ (anglo, arabic, slavic, south_asian, east_asian, african, hispanic). Address
64
+ abbreviations (Apt/Ste/Whg, а/я, ص.ب, postcodes, PO boxes) and LOCATION in
65
+ syntactic roles are now covered. TAB en moved slightly against this build
66
+ (0.7428 → 0.7009); it is reported, not gated.
67
+
68
+ Head-to-head vs `onnx-community/multilang-pii-ner-ONNX` (PERSON only, WikiANN
69
+ test[:500]): es +0.65 · it +0.62 · fr +0.63 · en +0.61 · ar +0.59 · de +0.56 ·
70
+ ru +0.12, with the 95% CI lower bound above the −0.02 floor in every language.
71
+ Disclosure: in that comparison ours is scored as fp32 torch and the incumbent as
72
+ int8 ONNX; the +0.0086 quantization cost above does not change the conclusion.
73
+
74
+ Nothing from this repo has shipped to devices yet: the repo is private and the
75
+ agent's model catalog does not point at it. "Previous build" means the previous
76
+ commit here, not a fleet.
77
 
78
  ## Read this before using it
79
 
80
+ **Arabic is the weakest language, and the gap is recall.** Arabic F1 sits at
81
+ 0.54–0.59 on the external benchmarks against 0.87 for Russian and 0.70 for
82
+ English, concentrated in LOCATION (Wojood LOCATION recall 0.334). Do not read
83
+ the aggregate numbers as uniform accuracy across languages.
 
 
 
 
 
 
 
84
 
85
  **Trained only on synthetic data.** Entity pools are finite, so scores on
86
  generated text overstate real-world ability. Judge it on the external
87
+ benchmarks above (Wojood, IAHLT, TAB), not the synthetic figures — and note that
88
+ hivetrace is itself a synthetic benchmark, expert-annotated but not real text.
89
 
90
  **Arabizi is a reconstruction.** No corpus contains it; its conventions
91
  (3=ain, 7=haa, 2=hamza) are our model of how people type, not observed data.
 
128
 
129
  ## Training data
130
 
131
+ Fully synthetic, no real person's data. A meaningful share of rows contain no
132
+ entity at all; those entity-free negatives are what keeps the touch rate at
133
+ zero. The published corpus `ScienceSoft/scnsoft-pii-synthetic-corpus` is the
134
+ v13 build's corpus; v15 trained on a later generator (address shapes, LOCATION
135
+ roles, Arabic address vocabulary, Mimesis name pools) whose export has not been
136
+ published yet.
137
+
138
+ Environment: transformers 4.57.1, tokenizers 0.22.1, torch 2.9.0a0, faker 37.12.0.
139
 
140
  ## Licence
141
 
onnx/model_quantized.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3e7189f37871b9d261edc9f8a771651459b4e20a3d23506100d10e3ed7a10ff1
3
  size 278234412
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af1250c3c3dd69151528d28efeb1222088af4ad8b5dd3513cc4a2451b350d99c
3
  size 278234412