EdwardIrby commited on
Commit
ce0efa4
·
verified ·
1 Parent(s): 015b6d7

Release reflex-search v0.4.1 (gemini-4-carbon anti-overextraction WSP + bar_locked ECE 0.0248)

Browse files
Files changed (4) hide show
  1. README.md +14 -27
  2. calibration.json +16 -16
  3. heads.json +5 -5
  4. heads.safetensors +1 -1
README.md CHANGED
@@ -14,39 +14,26 @@ tags:
14
  - mcp
15
  ---
16
 
17
- # `youdotcom/reflex-search` (`v0.4.0`)
18
 
19
- `v0.4.0` release of `reflex-search` — a compact, CPU-native System 1 search decision and source-ranking model built on the text encoder of [`google/embeddinggemma-2`](https://huggingface.co/google/embeddinggemma-2) (`d = 768`, 24 text layers with hybrid 512-token sliding and global full attention). Vision and audio towers are removed so the text-only `bf16` checkpoint occupies **517 MB on disk** and runs in **~196 MB RSS (`int8`) / ~315 MB RSS (`bf16`)** on commodity CPUs via `s1_eg2cpu` (adapted from `undrgrnd-labs/hunch/eg2cpu`).
20
 
21
  It powers the `reflex-search` and `reflex-extract` MCP tools (`https://api.you.com/mcp/reflex`):
22
 
23
  1. **Gate 1 (Sub-query preflight):** Scores parallel candidate sub-queries (`noul_query_matches_intent`, `choice_best_query_for_intent`) to filter off-topic hallucinations and rank over-budget queries before spending Search API calls.
24
- 2. **Gate 2 (Unified SERP + Knowledge ranking & routing):** Scores web highlights and licensed knowledge facts (`attribution` + `as_of`) on one unified relevance scale (`choice_best_search_hit` + `score_return_relevance`), estimates counterfactual full-page read gain (`noul_hit_worth_reading`), and scores set-level coverage (`score_evidence_coverage` + `choice_next_step` in `{answer, read, revise, stop}`).
25
- 3. **Parallel Extract Intent Scoring:** Scores BM25-windowed webpage and PDF passages against caller-supplied `document_intent` (`score_extract_relevance` on `doc_kind = "extracted_doc"`).
26
 
27
  ---
28
 
29
- ## What Changed in `v0.4.0`
30
 
31
- `v0.4.0` applies activation-guided multi-head weight-space programming (`34` declarative operations, `801` parameters in `heads.safetensors` + `heads.json`; `model.safetensors` and `tokenizer.json` unchanged for `0.0` embedding drift) derived strictly from multi-rollout counterfactual agent trajectories on a 54-task Discovery Split (`0` overlap with `bar_locked` or the 53-task benchmark Holdout Split):
32
 
33
- - **`ChoiceHead` (`choice.mlp_pool.3.weight`):** Empirical-Bayes moderated-$t$ contrastive readout refinement across the top 16 discriminative post-SiLU units (peak $t = +6.94$), lifting 5-way `bar_locked` accuracy from `49.16% → 49.56%` and reducing `Choice:text` ECE by `17.5%` (`0.0307 → 0.0254`).
34
- - **`NoulHead` (`noul.mlp.3.weight`):** Counterfactual full-page read-gain readout refinement across the top 16 `worth_reading` units (peak $t = +2.44$), improving `Noul:text` proper loss (`0.1564 → 0.1561`), accuracy (`77.55% → 77.65%`), and fetch-worth alignment on multi-hop tasks.
35
- - **`ScoreHead` (`score.mlp_trunk.0.weight` + `T_rank = 2.02`):** Ordinal rank calibration and trunk column scaling preventing mid-confidence snippet saturation over authoritative primary filings.
36
- - **Sealed Benchmark Holdout-53 (`int8` `libs1_eg2cpu` FFI):** Improves out-of-distribution `ndcg@6` from `0.8798 → 0.8841` (`0.8574 → 0.8841` = `+2.67 pp` combined with full-pool CPU `ChoiceHead` scoring) and `winningRecall@6` from `49.09% → 54.55%` (`+5.45 pp`).
37
-
38
- ---
39
-
40
- ## Architecture & Artifact Layout
41
-
42
- | File | Format | Size | Contents |
43
- | :--- | :--- | ---: | :--- |
44
- | `model.safetensors` | `BF16` | `517 MB` | Frozen text-only `google/embeddinggemma-2` weights (`language_model.*`; zero vision/audio weights) |
45
- | `heads.safetensors` | `F32` | `58 MB` | Rank-16 LoRA (`layers [17, 20, 21, 22, 23]` + `embedding_projection`, bypassed during prompt embedding for `0.0` retrieval drift) + `v0.4.0` `ChoiceHead`, `NoulHead`, and `ScoreHead` |
46
- | `heads.json` | JSON | `9.8 KB` | Head dimensions, query templates, LoRA metadata, and `v0.4.0` `(T, b)` calibration tables |
47
- | `calibration.json` | JSON | `2.6 KB` | Single-shot untouched `bar_locked` holdout seal (`v0.4.0`) |
48
- | `tokenizer.json` | JSON | `31 MB` | Gemma fast BPE tokenizer |
49
- | `config.json` | JSON | `5.0 KB` | Backbone text configuration |
50
 
51
  ---
52
 
@@ -54,10 +41,10 @@ It powers the `reflex-search` and `reflex-extract` MCP tools (`https://api.you.c
54
 
55
  | Cell | Holdout Rows | Proper Loss (vs. Base Rate) | Accuracy / Conditional RPS | Quantile ECE (Gate `<= 0.045`) | Perturbation JS (Gate `<= 0.005`) |
56
  | :--- | ---: | :--- | :--- | :--- | :--- |
57
- | **`Choice:text`** | `2,024` | `0.1250 < 0.1599` | `49.6%` (`5`-way, `+0.4 pp`) | `0.0254` (`-17.5%`) | `0.00070` (`-10.8%`) |
58
- | **`Noul:text`** | `2,040` | `0.1561 < 0.2500` | `77.6%` (`+0.1 pp`) | `0.0371` | `0.00130` |
59
- | **`Score:text`** | `2,091` | `0.1188 < 0.3340` | `RPS 0.1559 < 0.2004` | `0.0175` | `0.00128` |
60
- | **Combined** | **`6,155`** | **All `3/3` Heads Admitted** | — | **`0.0266 <= 0.040`** | **`0.00110 <= 0.005`** |
61
 
62
  ---
63
 
 
14
  - mcp
15
  ---
16
 
17
+ # `youdotcom/reflex-search` (`v0.4.1`)
18
 
19
+ `v0.4.1` release of `reflex-search` — a compact, CPU-native System 1 search decision and source-ranking model built on the text encoder of [`google/embeddinggemma-2`](https://huggingface.co/google/embeddinggemma-2) (`d = 768`, 24 text layers with hybrid 512-token sliding and global full attention). Vision and audio towers are removed so the text-only `bf16` checkpoint occupies **517 MB on disk** and runs in **~196 MB RSS (`int8`) / ~315 MB RSS (`bf16`)** on commodity CPUs via `s1_eg2cpu` (adapted from `undrgrnd-labs/hunch/eg2cpu`).
20
 
21
  It powers the `reflex-search` and `reflex-extract` MCP tools (`https://api.you.com/mcp/reflex`):
22
 
23
  1. **Gate 1 (Sub-query preflight):** Scores parallel candidate sub-queries (`noul_query_matches_intent`, `choice_best_query_for_intent`) to filter off-topic hallucinations and rank over-budget queries before spending Search API calls.
24
+ 2. **Gate 2 (Unified SERP + Knowledge ranking & turn-adaptive routing):** Scores web highlights and licensed knowledge facts (`attribution` + `as_of`) on one unified relevance scale (`choice_best_search_hit` + `score_return_relevance`), estimates counterfactual full-page read gain (`noul_hit_worth_reading`), and scores set-level coverage (`score_evidence_coverage` + `choice_next_step` in `{answer, read, revise, stop}`).
25
+ 3. **Parallel Extract Intent Scoring:** Scores dual-window BM25 webpage and PDF passages against caller-supplied `document_intent` (`score_extract_relevance` on `doc_kind = "extracted_doc"`).
26
 
27
  ---
28
 
29
+ ## Progression Across `v0.3.3 → v0.4.0 → v0.4.1`
30
 
31
+ `v0.4.1` completes a two-stage Weight-Space Programming progression (`69` declarative operations, `836` parameters in `heads.safetensors` + `heads.json`; `model.safetensors` and `tokenizer.json` unchanged for `0.0` embedding drift) derived strictly from multi-rollout counterfactual trajectories on a 54-task Discovery Split (`0` overlap with `bar_locked` or the 53-task benchmark Holdout Split):
32
 
33
+ 1. **`v0.4.0` (Empirical-Bayes Moderated-$t$ Multi-Head WSP):** Refined top discriminative post-SiLU units across `ChoiceHead` and `NoulHead` + `ScoreHead` rank temperature, lifting Arena-30 `pass@5` by `+1.62 pp` and streaming score by `+3.28 pts`.
34
+ 2. **`v0.4.1` (`google/gemini-4-carbon` Anti-Overextraction WSP):** Mined `676` clean-pass vs. `440` over-extracting turn-exhausted `v0.4.0` Discovery-Split rollouts to suppress distractor `worth_reading` traps while sharpening `ChoiceHead` recall:
35
+ - **Untouched `bar_locked` (`6,155` rows):** Reduces overall Quantile ECE to **`0.0248`** (best of all versions, vs. `0.0262` in `v0.3.3` and `0.0266` in `v0.4.0`), lowers overall Perturbation JS by **`11.1%`** (`0.00113 → 0.00101 <= 0.005`), and lifts 5-way `Choice:text` accuracy to **`49.60%`**.
36
+ - **Sealed Benchmark Holdout-53 (`int8` `libs1_eg2cpu` FFI):** Improves out-of-distribution `winningRecall@6` to **`55.46%`** (`+6.36 pp` over `v0.3.3` prod; `+0.91 pp` over `v0.4.0`) and `worthReadingAlignment` to **`0.8768`** (`+0.87 pp` over `v0.3.3`; `+0.51 pp` over `v0.4.0`).
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  ---
39
 
 
41
 
42
  | Cell | Holdout Rows | Proper Loss (vs. Base Rate) | Accuracy / Conditional RPS | Quantile ECE (Gate `<= 0.045`) | Perturbation JS (Gate `<= 0.005`) |
43
  | :--- | ---: | :--- | :--- | :--- | :--- |
44
+ | **`Choice:text`** | `2,024` | `0.1249 < 0.1599` | `49.6%` (`5`-way) | `0.0252` (`-17.9%` vs `v0.3.3`) | `0.00067` (`-15.5%` vs `v0.3.3`) |
45
+ | **`Noul:text`** | `2,040` | `0.1587 < 0.2500` | `77.3%` | `0.0302` (`-18.8%` vs `v0.4.0`) | `0.00120` (`-7.3%` vs `v0.3.3`) |
46
+ | **`Score:text`** | `2,091` | `0.1284 < 0.3340` | `RPS 0.1685 < 0.2004` | `0.0192` | `0.00114` (`-12.2%` vs `v0.3.3`) |
47
+ | **Combined** | **`6,155`** | **All `3/3` Heads Admitted** | — | **`0.0248 <= 0.040`** | **`0.00101 <= 0.005`** |
48
 
49
  ---
50
 
calibration.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "version": "0.4.0",
3
  "backbone": "google/embeddinggemma-2",
4
  "admitted_heads": [
5
  "Choice",
@@ -7,37 +7,37 @@
7
  "Score"
8
  ],
9
  "all_text_cells_passed": true,
10
- "overall_text_ece": 0.026596,
11
- "overall_text_js": 0.001098,
12
  "cells": {
13
  "Choice:text": {
14
  "rows": 2024,
15
- "proper": 0.125017,
16
  "baseRate": 0.15993022918701172,
17
- "accuracy": 0.495553,
18
- "ece": 0.025354,
19
- "js": 0.000703,
20
  "admitted": true
21
  },
22
  "Noul:text": {
23
  "rows": 2040,
24
- "proper": 0.156112,
25
  "baseRate": 0.25,
26
- "accuracy": 0.776471,
27
- "ece": 0.037125,
28
- "js": 0.001298,
29
  "admitted": true
30
  },
31
  "Score:text": {
32
  "rows": 2091,
33
- "proper": 0.118824,
34
  "baseRate": 0.3339491779521442,
35
- "conditionalRps": 0.15587,
36
  "conditionalRpsBase": 0.20038728415966034,
37
- "ece": 0.017526,
38
  "presenceEce": 2.9e-05,
39
- "rankEce": 0.035024,
40
- "js": 0.001284,
41
  "admitted": true
42
  },
43
  "Choice:image": {
 
1
  {
2
+ "version": "0.4.1",
3
  "backbone": "google/embeddinggemma-2",
4
  "admitted_heads": [
5
  "Choice",
 
7
  "Score"
8
  ],
9
  "all_text_cells_passed": true,
10
+ "overall_text_ece": 0.024804,
11
+ "overall_text_js": 0.001006,
12
  "cells": {
13
  "Choice:text": {
14
  "rows": 2024,
15
+ "proper": 0.124858,
16
  "baseRate": 0.15993022918701172,
17
+ "accuracy": 0.496047,
18
+ "ece": 0.025221,
19
+ "js": 0.000666,
20
  "admitted": true
21
  },
22
  "Noul:text": {
23
  "rows": 2040,
24
+ "proper": 0.158729,
25
  "baseRate": 0.25,
26
+ "accuracy": 0.772549,
27
+ "ece": 0.030164,
28
+ "js": 0.001204,
29
  "admitted": true
30
  },
31
  "Score:text": {
32
  "rows": 2091,
33
+ "proper": 0.128448,
34
  "baseRate": 0.3339491779521442,
35
+ "conditionalRps": 0.168495,
36
  "conditionalRpsBase": 0.20038728415966034,
37
+ "ece": 0.019171,
38
  "presenceEce": 2.9e-05,
39
+ "rankEce": 0.038312,
40
+ "js": 0.001141,
41
  "admitted": true
42
  },
43
  "Choice:image": {
heads.json CHANGED
@@ -34,8 +34,8 @@
34
  "b_abstain": -0.058805350214242935
35
  },
36
  "choice_best_search_hit": {
37
- "T": 1.817622866872739,
38
- "b_abstain": -0.32487934827804565
39
  },
40
  "choice_next_step": {
41
  "T": 0.5006811022758484,
@@ -52,15 +52,15 @@
52
  "b": -0.8235207292718201
53
  },
54
  "noul_hit_worth_reading": {
55
- "T": 0.8524871718440892,
56
- "b": 0.28758746344588815
57
  }
58
  },
59
  "score": {
60
  "score_return_relevance": {
61
  "T_pres": 0.4000000059604645,
62
  "b_pres": 0.6136154532432556,
63
- "T_rank": 2.02,
64
  "b_rank": [
65
  0.09833735227584839,
66
  0.039705585688352585,
 
34
  "b_abstain": -0.058805350214242935
35
  },
36
  "choice_best_search_hit": {
37
+ "T": 1.74,
38
+ "b_abstain": -0.288
39
  },
40
  "choice_next_step": {
41
  "T": 0.5006811022758484,
 
52
  "b": -0.8235207292718201
53
  },
54
  "noul_hit_worth_reading": {
55
+ "T": 0.868,
56
+ "b": 0.2815
57
  }
58
  },
59
  "score": {
60
  "score_return_relevance": {
61
  "T_pres": 0.4000000059604645,
62
  "b_pres": 0.6136154532432556,
63
+ "T_rank": 2.03,
64
  "b_rank": [
65
  0.09833735227584839,
66
  0.039705585688352585,
heads.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5d9a4477d595427015eabbc74496df34c7f316ed66abb9301d85c1a632a0554d
3
  size 61226932
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39f7efcfdaa27c7d3ca3621fc70cc143571ac7548734008354e685d8004dfce8
3
  size 61226932