Rishh00 commited on
Commit
94e90d9
·
verified ·
1 Parent(s): 120fe08

Model card for the reader release

Browse files
Files changed (1) hide show
  1. README.md +91 -78
README.md CHANGED
@@ -1,95 +1,108 @@
1
  ---
2
- license: cc-by-sa-4.0
3
  language:
4
- - en
 
5
  library_name: sentence-transformers
6
- pipeline_tag: sentence-similarity
7
- base_model: sentence-transformers/all-MiniLM-L6-v2
8
- datasets:
9
- - WillHeld/top_v2
10
  tags:
11
- - ren
12
- - secnd
13
- - calibrated-decisions
14
- - selective-prediction
15
- - conformal
16
- - intent-classification
17
- - human-in-the-loop
18
  ---
19
 
20
  # Ren
21
 
22
- **A calibrated decision model that proves 99% precision before it answers on its own.** Ren learns one organisation's own past decisions from a few hundred labels, answers automatically only where a statistical gate certifies at least 99% precision on held-out data, and sends everything else to a person, whose answer it learns from in under a second. On Meta's MTOP assistant intents with 2,000 labels, Ren answers **42.4%** of requests on its own at **99.93%** precision.
23
-
24
- This repository holds Ren's encoder, release **`ren-1.0.0`**. The per-organisation decision head, calibration and gate are fitted on each organisation's own labels by the [Secnd](https://github.com/Rish-it/secnd) runtime.
25
 
26
- ## Install
27
-
28
- ```bash
29
- pip install sentence-transformers
30
- ```
31
 
32
- ## Quickstart
33
 
34
- ```python
35
- from sentence_transformers import SentenceTransformer
 
 
 
36
 
37
- encoder = SentenceTransformer("secnd-ai/ren", revision="v1.0.0")
38
- vectors = encoder.encode(
39
- ["set an alarm for 7am", "what's the weather tomorrow"], normalize_embeddings=True
40
- ) # (2, 384)
41
  ```
42
 
43
- Pin `revision="v1.0.0"` if you tune confidence thresholds against this release; `main` moves when a new release ships.
44
-
45
- ## Checkpoints
46
-
47
- | Release | Repo | Encoder | Params | Dims | Best at |
48
- |---|---|---|---|---|---|
49
- | **`ren-1.0.0`** | **`secnd-ai/ren`** (this repo, tag `v1.0.0`) | MiniLM-L6, tuned on TOPv2 | 22.7M | 384 | English requests and intents; runs on CPU |
50
-
51
- ## How Ren decides
52
-
53
- 1. **Encode** each item with this encoder (plus a small numeric block and a memory of past answers for the same payee or sender).
54
- 2. **Score** it with a logistic-regression head trained only on the organisation's own labels.
55
- 3. **Calibrate** probabilities with one temperature fitted on a fixed calibration split.
56
- 4. **Gate:** pick the lowest confidence threshold whose one-sided 95% Clopper-Pearson lower bound on precision clears 99%, walking down from the most confident answers and stopping at the first failure. Above it Ren answers automatically; below it a person decides. With too little evidence it answers nothing.
57
- 5. **Learn** from every answer: the head refits in 0.27 s (0.01 s warm-started) at 10,000 labels, and a new version goes live only if it passes the gate, does not lose more than one point of accuracy, and certifies at least as much as the live one. 5% of automatic answers go to a person as spot-checks, and if those show precision below 99% Ren stops answering on its own until a new version passes.
58
-
59
- ## Training
60
-
61
- All-MiniLM-L6-v2 tuned once on TOPv2 (Chen et al., 2020): English assistant requests in 8 domains, labelled by the top-level intent of each parse (69 intents). Every TOPv2 request whose normalised text appears anywhere in MTOP was removed first (23,137 rows, leaving 157,405), so MTOP results use only the labels inside each budget. Supervised contrastive loss over class-balanced batches (16 intents x 4 rows), temperature 0.05, AdamW lr 2e-5, 3,000 steps, seed 0, one NVIDIA A10G.
62
 
63
  ## Results
64
 
65
- Held-out test splits, 2,000 training labels, seed 0. "Holds across re-splits" reshuffles the calibration and test rows 2,000 times and counts how often test precision above the chosen threshold stays at 99% or more.
66
-
67
- | Dataset | Encoder | Answered automatically | Precision there | Accuracy | Holds across re-splits |
68
- |---|---|---|---|---|---|
69
- | MTOP (Meta, 113 intents) | all-MiniLM-L6-v2 | 31.7% | 99.62% | 86.2% | 99.05% |
70
- | MTOP (Meta, 113 intents) | **Ren 1.0.0** | **42.4%** | **99.93%** | **88.1%** | **99.45%** |
71
-
72
- Learning loop on MTOP (200 seed labels, then 20 rounds of 100 answers from people, 5 seeds): at round 20 Ren answers 33.9% automatically (19.2% with the base encoder) at 88.3% accuracy, and test precision is at least 99.24% in every round where it answers automatically.
73
-
74
- Every number links to a committed result file in the [Secnd repository](https://github.com/Rish-it/secnd): `docs/results/s3/card-mtop-pt-minilm+lr-b2000.json`, `docs/results/s3/robustness-mtop-pt-minilm+lr-b2000.json`, `docs/results/s4/`.
75
-
76
- ## Honest limits
77
-
78
- - **English only.** Tuned on assistant-style requests; other domains may gain less, or nothing.
79
- - **It abstains when labels disagree.** On UK parliamentary expense claims (IPSA), where identical descriptions carry different labels, the gate certifies nothing at 2,000 labels. That is the intended behaviour, not a bug.
80
- - **Not every seed certifies early.** In the learning-loop simulation, one of five seeds had not certified any automatic answers after 2,200 labels.
81
- - **The 99% is a property of the gate on a fixed published split,** with a 95% one-sided bound. It is not a guarantee on arbitrary future traffic; spot-checks are there to catch drift.
82
- - **Larger encoders are not automatically better here.** bge-base tuned the same way certified only 16.5% on MTOP, because one early calibration error stops the gate's walk.
83
-
84
- ## Licence and citation
85
-
86
- CC BY-SA 4.0, because Ren is trained on TOPv2 (CC BY-SA 4.0). The base encoder is Apache-2.0.
87
-
88
- ```bibtex
89
- @inproceedings{chen-etal-2020-low,
90
- title = {Low-Resource Domain Adaptation for Compositional Task-Oriented Semantic Parsing},
91
- author = {Chen, Xilun and Ghoshal, Asish and Mehdad, Yashar and Zettlemoyer, Luke and Gupta, Sonal},
92
- booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
93
- year = {2020}
94
- }
95
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  language:
3
+ - en
4
+ license: cc-by-sa-4.0
5
  library_name: sentence-transformers
6
+ pipeline_tag: text-classification
7
+ base_model: jhu-clsp/ettin-encoder-400m
 
 
8
  tags:
9
+ - ren
10
+ - secnd
11
+ - selective-classification
12
+ - calibration
13
+ - human-in-the-loop
 
 
14
  ---
15
 
16
  # Ren
17
 
18
+ Built with Muse Spark Open. Ren is independently developed for Meta's platform and is not an official
19
+ Meta product.
 
20
 
21
+ Ren reads a question, its options, a message and a person's nearest past decisions, then scores each
22
+ option. It is trained once; a new business supplies history, not a new training run. A temperature, a
23
+ confidence threshold and a support floor come from held-out calibration rows, and a Clopper–Pearson lower
24
+ bound decides whether any answer may be automatic. Anything below it goes to a person. English only.
 
25
 
26
+ ## What is in this repository
27
 
28
+ | Path, tag `v1.1.0` | What it is | Use it for |
29
+ | --- | --- | --- |
30
+ | `reader/` | 400M reader, `ic-ettin-400m-s6000-near-wide-fine-seed1` | Choosing among up to 128 options from a person's history |
31
+ | `meta/` | The reader above, fine-tuned on typed decisions and written Meta-app tasks | Ad, inbox and account decisions |
32
+ | root files | MiniLM encoder from [`v1.0.0`](https://huggingface.co/Secnd-AI/ren/blob/v1.0.0/README.md) | Retrieval vectors and the per-business classifier head |
33
 
34
+ ```sh
35
+ hf download Secnd-AI/ren --revision v1.1.0 --include "reader/*" --local-dir ren
 
 
36
  ```
37
 
38
+ Serving code and setup: [github.com/Rish-it/secnd](https://github.com/Rish-it/secnd).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  ## Results
41
 
42
+ Fixed official test sets, measured on these exact weights. Calibration chose this seed; test sets chose nothing.
43
+
44
+ | Set | No examples | 8 nearest | 32 nearest |
45
+ | --- | ---: | ---: | ---: |
46
+ | MTOP | 75.99% | 92.38% | 93.59% |
47
+ | BANKING77 | 68.99% | 89.90% | 86.23% |
48
+
49
+ With a person's history, the reader against a logistic head on the same retrieval vectors:
50
+
51
+ | History | MTOP reader | MTOP head | BANKING77 reader | BANKING77 head |
52
+ | --- | ---: | ---: | ---: | ---: |
53
+ | 200 labels | 82.51% | 69.54% | 75.39% | 54.16% |
54
+ | 1,000 labels | 88.12% | 80.46% | 82.60% | 85.32% |
55
+ | All labels | 92.45% | 93.00% | 89.87% | 92.50% |
56
+
57
+ Answering alone, on all 4,386 MTOP test rows, with the gate and support floor fixed on calibration. Twelve
58
+ calibration labels were changed by a model audit, not a human one. Test labels were never changed, so
59
+ precision is measured against labels that keep their errors.
60
+
61
+ | Examples | Answered alone | Accepted | Errors | Precision | 95% low | Wrong accepts with the right option removed, of 500 |
62
+ | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
63
+ | 0 | 0% | 0 | 0 | n/a | n/a | 0 |
64
+ | 8 | 21.04% | 923 | 1 | 99.89% | 99.40% | 2 |
65
+ | 32 | 14.46% | 634 | 1 | 99.84% | 99.12% | 2 |
66
+
67
+ `meta/` on 342 and 338 fresh written tasks: 84.8% agreement with a three-model panel and 76.0% with Muse Spark
68
+ 1.3, against 44.4% and 49.7% for always picking the most common answer. Ad decisions are the weakest, at 70.3%
69
+ and 54.3%. This is agreement with models on written tasks, not accuracy on real data. On the fixed typed
70
+ benchmark of 2,000 decisions, before the Meta tuning, the same reader scores 79.70%.
71
+
72
+ One A10G over HTTP: 17.5 s cold start, then 3.68 requests a second with four clients, about $0.08 of GPU per
73
+ 1,000 decisions when saturated. Four CPUs: 2.2 s p95 per request at 8 nearest, measured on the same architecture.
74
+
75
+ ## Limits
76
+
77
+ - One seed. Certified coverage moved 19 points between two seeds of one earlier pool, and on this pool a second
78
+ seed scores 0.55 points higher on MTOP and 0.72 on BANKING77 at 8 nearest. Report a range, never a single best run.
79
+ - The gate certifies full MTOP history only. Another business gets no inherited permission to answer alone; it
80
+ earns it from its own reviewed decisions.
81
+ - With the right option missing, the support floor missed its target of at most 1 wrong accept per 500, with 2.
82
+ - BANKING77 certifies zero at the 99% bar, including after a model audit of its calibration labels.
83
+ - With no examples on BANKING77 this model does not lead: a published typed decision model scores higher.
84
+ - With thousands of labels, a logistic head on retrieval vectors beats the reader.
85
+ - Written training rows come from one model and carry its style.
86
+ - Benchmark numbers are not a promise about a new business or future traffic.
87
+
88
+ ## Training data
89
+
90
+ Excluded: all MTOP and BANKING77 texts, calibration rows, test rows, real customer text, rows traced to
91
+ real posts, ATIS and a FEVER mirror (no licence found). No output of a hosted Meta Model API trained this model.
92
+
93
+ | Source | Licence |
94
+ | --- | --- |
95
+ | Ettin encoder 400M (base weights) | MIT |
96
+ | TOPv2 | CC BY-SA 4.0 |
97
+ | CLINC150 | CC BY 3.0 |
98
+ | MASSIVE (English) | CC BY 4.0 |
99
+ | Snips | Apache 2.0 |
100
+ | GoEmotions | Apache 2.0 |
101
+ | Bitext customer support | CDLA-Sharing 1.0 |
102
+ | DBpedia-14 | CC BY-SA 3.0 |
103
+ | Civil Comments | CC0 |
104
+ | PAWS, Google LLC | Free use, with attribution |
105
+ | SMS Spam (UCI) | CC BY 4.0 |
106
+ | SQuAD | CC BY-SA 4.0 |
107
+ | WANLI | CC BY 4.0 |
108
+ | Written Meta-app tasks and 23 taxonomies | Written and labelled with Muse Spark Open |