You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-29Lines changed: 33 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Open research and development for lightweight PII detection models. This repo contains the full training code, experiment history, and research behind [DataFog](https://datafog.ai)'s PII-NER model family.
4
4
5
-
**Latest checkpoint:**[DataFog/pii-small-en](https://huggingface.co/DataFog/pii-small-en) on HuggingFace (v1.3, Apache 2.0)
5
+
**Latest checkpoint:**[DataFog/pii-small-en](https://huggingface.co/DataFog/pii-small-en) on HuggingFace (v1.4, Apache 2.0)
6
6
7
7
## PII-NER v1
8
8
@@ -28,31 +28,30 @@ The gating fusion dynamically weights character-level features (for structured P
28
28
29
29
### Results
30
30
31
-
Best results from v1.3 training on H100 (20 hours, 10 epochs):
V1.3 has the best overall F1 (0.907). V1.4 expanded training data from 169K to 241K examples with 4 new data sources and 22K synthetic examples covering 11 entity types that previously had zero training data. V1.4 achieves the best Tier 3 and Tier 4 recall — all previously-zero entity types now produce results. The F1 drop vs v1.3 reflects the broader entity coverage at the cost of some precision on existing types.
42
42
43
-
V1.3 has the best overall F1 and recall. V1.2 is better for Tier 1-critical deployments (0.841 vs 0.823).
44
-
45
-
### Top entity F1 scores (v1.3)
43
+
### Top entity F1 scores (v1.4)
46
44
47
45
| Entity | F1 | Entity | F1 |
48
46
|--------|------|--------|------|
49
-
| URL | 0.994 | License Plate | 0.952 |
50
-
| Biometric | 0.992 | Gender | 0.946 |
51
-
| IP Address | 0.988 | Employee ID | 0.940 |
52
-
| Date of Birth | 0.981 | IBAN | 0.935 |
53
-
| Vehicle ID | 0.976 | Username | 0.930 |
54
-
| Email | 0.968 | SSN | 0.930 |
55
-
| Phone | 0.966 | Location | 0.929 |
47
+
| URL | 0.995 | Nationality | 0.993 |
48
+
| Religion | 1.000 | Crypto Wallet | 0.987 |
49
+
| Health Condition | 0.988 | Insurance Number | 0.986 |
50
+
| Student ID | 1.000 | Political Affiliation | 0.995 |
51
+
| Marital Status | 1.000 | Salary | 0.995 |
52
+
| Sexual Orientation | 1.000 | Criminal Record | 1.000 |
53
+
| Biometric | 0.975 | Gender | 0.957 |
54
+
| Email | 0.976 | Phone | 0.947 |
56
55
57
56
### Quick start
58
57
@@ -100,11 +99,13 @@ See [eval_benchmark.md](pii-ner-v1/docs/eval_benchmark.md) for flags and options
Combined: ~169K English examples after filtering and dedup. 41 canonical entity types across 4 sensitivity tiers, unified into 83 BIO labels. The dataset has a 323x frequency imbalance (DATE: 170K occurrences vs PASSPORT: 526), which drives many of the training innovations below.
108
+
Combined: ~241K English examples after filtering and dedup. 41 canonical entity types across 4 sensitivity tiers, unified into 83 BIO labels. The synthetic data covers 11 entity types that had zero examples in the open-source datasets: NATIONALITY, RELIGION, MARITAL_STATUS, STUDENT_ID, CRYPTO_WALLET, INSURANCE_NUMBER, SALARY, CRIMINAL_RECORD, POLITICAL_AFFILIATION, SEXUAL_ORIENTATION, and HEALTH_CONDITION.
108
109
109
110
## Documentation
110
111
@@ -125,7 +126,8 @@ Key finding: no published work combines differentiable character-level pattern r
125
126
126
127
| Date | Version | What changed |
127
128
|------|---------|-------------|
128
-
| 2026-02-07 |**v1.3**| Best F1 (0.907). Early backbone freeze (epoch 3) + progressive tier weight reduction. Discovered training spikes originate in head components, not backbone. |
129
+
| 2026-02-08 |**v1.4**| Full entity coverage. Added 4 new data sources (241K total), synthetic data for 11 zero-occurrence types. All 41 entity types now produce results. Best T3 (0.945) and T4 (0.937) recall. Backbone freeze confirmed harmful — epoch 3 best, stopped early. |
130
+
| 2026-02-07 | v1.3 | Best F1 (0.907). Early backbone freeze (epoch 3) + progressive tier weight reduction. Discovered training spikes originate in head components, not backbone. |
129
131
| 2026-02-05 | v1.2 | Best Tier 1 recall (0.841). Backbone freezing after epoch 4. Epoch 3 identified as consistent sweet spot. |
| 2026-02-04 | — | Training chronicle, entity frequency audit (323x imbalance discovered). |
@@ -142,15 +144,17 @@ Key finding: no published work combines differentiable character-level pattern r
142
144
143
145
3.**The training spike is a head problem, not backbone.** V1.3 proved this definitively: the spike occurred at epoch 5 with the backbone already frozen since epoch 3. The CharCNN/GatingFusion/CRF destabilize under continued training.
144
146
145
-
4.**Epoch 3 is consistently the best checkpoint.** Across v1.2and v1.3, the model peaks at epoch 3 then destabilizes. Earlier representations generalize better.
147
+
4.**Epoch 3 is consistently the best checkpoint.** Across v1.2, v1.3, and v1.4, the model peaks at epoch 3 then destabilizes. Earlier representations generalize better.
146
148
147
149
5.**Tier-weighted loss works but amplifies instability.** 3x weight + 3x oversampling = ~9x gradient signal for Tier 1, which accelerates learning but accumulates damage.
148
150
151
+
6.**Backbone freeze hurts more than it helps.** V1.4 confirmed: freezing the backbone after epoch 3 causes immediate F1 regression (0.889→0.806) and eval loss spike (2.4→8.3). The head cannot adapt without backbone co-training.
152
+
149
153
## Open problems
150
154
151
-
-**Tier 1 recall gap**: 0.823 vs 0.98 target. Passport number (0.426 F1) has only 526 training examples.
152
-
-**13 zero-occurrence entity types**: NATIONALITY, RELIGION, MARITAL_STATUS, etc. exist in the taxonomy but no training data covers them.
153
-
-**Head instability**: Root cause of the epoch 3+ training spike is unknown. Gradient clipping, per-component LR decay, or early stopping are candidate fixes.
155
+
-**Tier 1 recall gap**: 0.814 vs 0.98 target. Passport number (0.447 F1) and PIN (0.556 F1) remain weak due to limited training examples.
156
+
-**Head instability**: Backbone freeze causes immediate regression (F1 0.889→0.806, loss 2.4→8.3). Root cause is in the CharCNN/GatingFusion/CRF head. Gradient clipping, per-component LR decay, or early stopping are candidate fixes.
157
+
-**Precision vs coverage trade-off**: v1.4 expanded entity coverage at cost of ~2pts F1 vs v1.3. Better synthetic data quality or curriculum learning could close this gap.
0 commit comments