FairnessEM: fairness-aware entity matching
A fairness loss for the Ditto entity matcher
- Problem
- An entity matchingDeciding whether two records, such as two product listings or two customer entries, describe the same real-world thing.Read more about entity matching on en.wikipedia.org can score a good F1 while its errors fall unevenly across groups of records.
- What was done
- Added a PPVP fairness lossAn extra penalty added during training that pushes a model to perform about equally well across different groups of data.Read more about fairness loss on en.wikipedia.org to DittoAn entity matching method from 2020 research that fine-tunes a pretrained language model such as BERT to decide whether two records match.Read more about Ditto on arxiv.org in PyTorch and swept 11 loss weights across 10 configurations, 110 runs.
- What changed
- Average disparity fell 74%, from 0.0355 to 0.0094 at the best weight per configuration, with F1 near 0.82.
- Average group disparity cut, best alpha per configuration
- 74%
- Average group disparity, best alpha per configuration
- 0.0355 to 0.0094
- Average F1
- 0.816 to 0.820
- Runs, 10 configurations x 11 alpha values
- 110
- F1 at alpha 1.0, false fairness
- 0.0113
Compare the three points on record
Disparity and F1, the points on record
| Measure | Before | Best alpha | Alpha 1.0 |
|---|---|---|---|
| Disparitylower is fairer | 0.0355 | 0.0094 | near zero |
| F1scale 0 to 1 | 0.816 | 0.820 | 0.0113 |
The starting averages: group disparity 0.0355 and F1 0.816.
110 runs: 10 configurations x 11 alpha values. The per-alpha results are not in the public repository, so only these three points are drawn, with nothing between them.
Before: average disparity 0.0355, average F1 0.816.
Problem
An entity matcher can reach a good F1 while its errors fall unevenly across groups of records. A fairness fix only counts if F1 holds, because a model that stops predicting matches looks fair for the wrong reason.
Approach
I added a PPVP fairness loss to the Ditto matcher in PyTorch, weighted by alpha. I ran 10 configurations at 11 alpha values, 110 runs in all, and compared average group disparity and F1 at each weight.
Highlights
- Average disparity fell 0.0355 to 0.0094 (74%) at each configuration's best alpha.
- Average F1 moved from 0.816 to 0.820.
- Swept 10 configurations at 11 alpha values, 110 runs in all.
- Flagged false fairness at alpha 1.0, where F1 collapsed to 0.0113.
- Near-zero disparity there came from a model that made almost no positive predictions.