youdotcom/reflex-search (v0.4.1)
youdotcom/reflex-search (v0.4.1) is a compact, CPU-native System 1 search decision and source-ranking model built on the 24-layer text encoder of google/embeddinggemma-2 (d = 768, hybrid 512-token sliding-window and global full attention). Vision and audio towers are removed so the text-only bf16 checkpoint occupies 517 MB on disk (58 MB calibrated heads) and runs in ~196 MB RSS (int8) / ~315 MB RSS (bf16) on commodity CPUs via our SIMD/SME/AMX Rust engine (s1_eg2cpu, zero GPU sidecars, zero external filter-LLM calls).
It powers the reflex-search and reflex-extract Model Context Protocol (MCP) tools on https://api.you.com/mcp/reflex and in the standalone pure-Rust rmcp stdio reference server (youdotcom-oss/reflex-search-eval):
- Gate 1 (Sub-Query Preflight): Scores parallel candidate sub-queries (
noul_query_matches_intent,choice_best_query_for_intent) to fast-path valid decompositions in0 ms, prune off-topic hallucinations, and rank over-ceiling queries before spending Search API calls. - Gate 2 (Unified SERP + Knowledge Ranking & Turn-Adaptive Routing): Scores web highlights and licensed knowledge cards (
attribution+as_of) on one unified relevance scale (choice_best_search_hitacross up to 12 candidates +score_return_relevance), estimates counterfactual full-page read utility (noul_hit_worth_reading), and emitsevidence_coverage_score+ typednext_step({answer, read, revise, stop}). - Parallel Extract Intent Scoring: Scores BM25-windowed webpage and PDF passages against each caller-supplied
document_intent(score_extract_relevanceondoc_kind = "extracted_doc").
How reflex-search Was Built: Two-Phase Training & MCP Co-Design
reflex-search was developed in two distinct phases — first training calibrated decision heads and zero-drift LoRA adapters via Reinforcement Learning for Calibrated Decisions (RLCD) alongside a 7,404-trial local MCP evaluation hillclimb (v0.1 -> v0.3.3), and only then applying Activation-Guided Weight-Space Programming (WSP) informed by a 46,573-rollout cloud sandbox benchmark (v0.3.3 -> v0.4.0 -> v0.4.1, plus v0.4.2 MCP runtime refinement).
Phase I — System 1 RLCD Base Training & Local Pilot Hillclimb (v0.1 -> v0.3.3)
Autoregressive cross-entropy and binary RLVR post-training push ambiguous posteriors toward 0 or 1 (mode-dropping overconfidence) while incurring O(T) decode latency. System 1 RLCD removes generative token decoding (T = 1 forward pass, lm_head stripped), normalizes post-projection token states onto the unit hypersphere (h_hat = F.normalize(out.last_hidden_state, dim=-1)), and trains three lightweight (float32) projection heads plus upper-layer Rank-16 LoRA (layers [17, 20, 21, 22, 23] + embedding_projection) exclusively under strictly proper scoring rules (Gneiting & Raftery, 2007) plus 0.1 * JS(p(S) || p(S')) perturbation invariance:
ChoiceHead(1-of-KSetwise Cross-Attention + Abstention): Cross-attends[z, e_q, c_k]overh_hatwith an explicit(z · w_abstain) + b_abstainmargin on"none_of_the_above", trained with Multiclass Brier +0.15intra-query sibling pairwise margin loss ([#rank] host/path | title — snippethard negatives).NoulHead(Calibrated Bernoulli Predicates): Query-guided token read trained on balanced50/50Binary Brier across query-validity predicates and12,590counterfactual URL read-vs-skip pairs (noul_hit_worth_reading).ScoreHead(Two-Part Hurdle + Heteroscedastic Ordinal Probit): Combines a Bernoulli applicability hurdle with a 5-rank monotone-cutpoint ordinal probit trained under Hurdle Brier + Ranked Probability Score (RPS) and calibrated post-hoc in categorical log-space (softmax((log p_rank + b_rank) / T_rank),mean(b_rank) = 0) so interior ranks2..4never collapse.- Zero-Drift LoRA Routing: Static query templates (
"task: ... | query: ...") and candidate strings ("title: candidate | text: ...") bypass LoRA, guaranteeing0.0Matryoshka embedding drift onmodel.safetensors.
Open-Source Datasets & Zero-Leakage bar_locked Gate:
- Base RLCD supervision and the
210-task local pilot benchmark (7,404graded multi-model trials) built on open-source multi-hop research and QA benchmarks — includinggoogle/deepsearchqa(5,400+multi-rollout trajectories yielding12,590counterfactual URL pairs and12,259fused multi-branch highlight states, with40bar_lockedtasks held out exclusively for agent evaluation),LiveQA, and structuredOR/ exact-phrase /site:operator retrieval suites paired with synthetic operator corruptions. (Proprietary search logs are not redistributed.) - Every task root was partitioned via
sha256into disjointfit(64%),cal(11%), andbar_locked(25%,6,155text rows) splits (0overlap with downstream evaluation tasks). - Co-designing the model and MCP tools across
v0.1 -> v0.3.3established key architectural invariants: retiring neural span pointers (v0.1) in favor of40xfaster batched S1 + BM25 windowing (v0.2.1), introducing request-shape-keyed gating and per-branch#1non-mirror hit protection (v0.2.2), decouplingevidence[]relevance sorting fromrecommended_extract_urlscounterfactual read utility (v0.3.2,0.582pooled 4-model QA F1), and bounding parallel extract batches to<= 16,000chars withscore_extract_relevance(v0.3.3).
Phase II — Counterfactual Weight-Space Programming & Cloud Sandbox Co-Design (v0.3.3 -> v0.4.1 / v0.4.2)
Using our 107-task public agentic benchmark (youdotcom/reflex-search-eval: FabV2 SEC filings from vals-ai/finance-agent-v2, AIM-Harvard/MedBrowseComp, and perplexity-ai/draco, 46,573 total graded rollouts across 17 models in networkBlockAll: true sandboxes), we executed two zero-leakage Weight-Space Programming rounds (57 declarative ops, 824 parameters in heads.safetensors + heads.json; model.safetensors untouched) strictly on the 54-task Discovery Split (0 overlap with bar_locked or the 53-task Sealed Holdout Split):
v0.4.0(Round-1 Empirical-Bayes Moderated-$t$ WSP + 12-Way CPUChoiceHead): Refined top discriminative post-SiLU units acrossChoiceHead($t = +6.94$),NoulHead($t = +2.44$), andScoreHead(T_rank = 2.02), lifting Sealed Holdout-53ndcg@6from0.8574 -> 0.8841(+2.67 pp), Arena-30pass@5(67.07% -> 68.70%), and interactive streaming score (0.5867 -> 0.6195).v0.4.1(Round-2google/gemini-4-carbonAnti-Overextraction WSP + Turn-Adaptive Extract): Mined676clean-pass vs.440over-extracting turn-exhaustedv0.4.0Discovery-Split rollouts to suppress distractorworth_readingtraps while sharpeningChoiceHeadrecall:- Untouched
bar_locked(6,155rows): Best overall Quantile ECE (0.0242 <= 0.040) and lowest Perturbation JS (0.00105 <= 0.005) of all releases, with49.60%5-wayChoice:textaccuracy. - Sealed Holdout-53 (
int8s1_eg2cpu): Lifts out-of-distributionwinningRecall@6to55.46%(+6.37 ppoverv0.3.3) andworthReadingAlignmentto0.8768. - Live Cloud Impact (
v0.4.1&v0.4.2Hard-Conditional BM25 Runtime): Cuts bulk13+extract over-reading (21.85% -> 20.28%) and heavy-reader turn exhaustion (62.62% -> 59.58%), sets a record1,687.5 msstreamingTTFT(4.6x-8.2xfaster than server-side web loops), and — paired withperceived_difficulty === "hard"conditional dual-window BM25 (v0.4.2) — achieves all-time Reflex highs on All-17-Model Arena-30 score (0.5947),FabV2pass^5(36.56%), ArenaMedBrowseComppass@5(70.06%), and Full-50MedBrowseCompaccuracy (39.15%).
- Untouched
Untouched Holdout Calibration (bar_locked, 6,155 Rows)
| Cell | Holdout Rows | Proper Loss (vs. Base Rate) | Accuracy / Conditional RPS | Quantile ECE (Gate <= 0.045) |
Perturbation JS (Gate <= 0.005) |
|---|---|---|---|---|---|
Choice:text |
2,024 |
0.1249 < 0.1599 |
49.60% (5-way) |
0.0252 (-17.9% vs v0.3.3) |
0.00067 (-15.5% vs v0.3.3) |
Noul:text |
2,040 |
0.1587 < 0.2500 |
77.25% |
0.0302 (-18.8% vs v0.4.0) |
0.00120 (-7.3% vs v0.3.3) |
Score:text |
2,091 |
0.1188 < 0.3340 |
RPS 0.1559 < 0.2004 |
0.0175 |
0.00128 |
| Combined | 6,155 |
All 3/3 Heads Admitted |
— | 0.0242 <= 0.040 |
0.00105 <= 0.005 |
References & Companion Artifacts
- Technical Report, Co-Design Lineage (
MODEL_AND_RUNTIME_CODESIGN.md), & Pure-RustrmcpstdioServer:youdotcom-oss/reflex-search-eval - Full
46,573-Rollout Benchmark Dataset Archive:youdotcom/reflex-search-eval - You.com Search & Contents Integration Runbook: https://you.com/search-contents-integration-runbook
- Research Foundations: Gneiting & Raftery (2007) Strictly Proper Scoring Rules; Chroma
Context-1; SIDSID-2; Takehi et al., MIT CSAIL (2026) Sparks of Weight-Space Programming.
License & Attribution
- Base weights (
model.safetensors,tokenizer.json,config.json) derive fromgoogle/embeddinggemma-2under the Apache-2.0 license. - LoRA adapters, calibrated RLCD projection heads, weight-space edits, and configuration metadata are released under Apache-2.0.
- Downloads last month
- 91
Model tree for youdotcom/reflex-search
Base model
google/embeddinggemma-2