Tirthanker commited on
Commit
426fe86
·
verified ·
1 Parent(s): f141f88

Correction: v2.0 domain input still carries subreddit names (hybrid_engine/README.md)

Browse files
Files changed (1) hide show
  1. hybrid_engine/README.md +4 -2
hybrid_engine/README.md CHANGED
@@ -2,7 +2,9 @@
2
 
3
  New users get **v2b** (engagement model + small tag-closeness bonus). As a user builds up engaged history, the engine **gradually shifts toward a warm DeepFM model**, but always keeps part of v2b. Every post also gets a **gentle freshness decay** as it ages and a **cold-start push** while it is new and rarely shown. Finally, **topic matches lead the feed**: in every block of 10 positions, the first 7 go to posts that share a picked tag (or its broad domain).
4
 
5
- **Version 2.0 does not use the community (subreddit) or flair anywhere in its models.** Neither is a model input, and the content vectors are built from the title, body and image caption only. The per-user history rates (`sub_seen`, `sub_rate`: how often *this user* engaged with posts from the same community before) are kept. They compare community ids inside one user's own history and need no learned community names. A test (`tests/test_engine.py::test_no_community_or_flair_in_models`) fails if community or flair ever creeps back in. The full story, including the cost of this change, is in [`REPORT.md`](../REPORT.md).
 
 
6
 
7
  ```
8
  score = (1 - w) * rank(v2b) + w * rank(DeepFM) w = min(w_max, engaged / (engaged + n0))
@@ -81,7 +83,7 @@ A missing embedding, or one of the wrong size (for example a 512-d CLIP vector),
81
  - **ONNX equals PyTorch** for both models (largest difference 2.4e-7).
82
  - **Feature parity:** from raw post and user data, the engine rebuilds the exact training inputs for all 539 validation and test rows. The largest difference is 0.0021 (standardized units), and no categorical value mismatched.
83
  - **Score parity:** engine outputs match the offline model predictions (cold within 1.1e-4, warm within 2.5e-4).
84
- - **Smoke tests:** a new user gets pure v2b; the DeepFM weight grows with history and is capped; future interactions are ignored; older posts never get a larger freshness multiplier; the push applies only to fresh posts; the topic-first rule; community and flair change no score.
85
  - **Backend tests:** backend-shaped payloads, plus the backend's real `reco.store` code on fakeredis (indexing, state, burst buffer, pool write). The drop-in `build_pool_hybrid` returns the same candidates as the backend's own `build_pool`.
86
  - **Speed:** about 0.7 ms per candidate on CPU, including the history features.
87
 
 
2
 
3
  New users get **v2b** (engagement model + small tag-closeness bonus). As a user builds up engaged history, the engine **gradually shifts toward a warm DeepFM model**, but always keeps part of v2b. Every post also gets a **gentle freshness decay** as it ages and a **cold-start push** while it is new and rarely shown. Finally, **topic matches lead the feed**: in every block of 10 positions, the first 7 go to posts that share a picked tag (or its broad domain).
4
 
5
+ > **Correction (2026-10-07).** Version 2.0 removes the community name and flair as direct inputs and from the embedding text. It still receives each post's `domain` field, which for Reddit text posts is `self.<subreddit>`: 24 of the 30 domain tokens known to both models are subreddit names. Community information therefore remains indirectly available to the 2.0 models for text posts. A follow-up release removes `domain` entirely. Until then, treat v2.0's community independence as partial.
6
+
7
+ **Version 2.0 removes the community (subreddit) and flair as direct inputs.** Neither is a direct model input, and the content vectors are built from the title, body and image caption only (but see the correction above: the `domain` input still carries subreddit names for text posts). The per-user history rates (`sub_seen`, `sub_rate`: how often *this user* engaged with posts from the same community before) are kept. They compare community ids inside one user's own history and need no learned community names. A test (`tests/test_engine.py::test_no_community_or_flair_in_models`) fails if the `subreddit` or `flair` inputs come back, or if the text changes with them; it does **not** cover the `domain` token (see the correction above). The full story, including the cost of this change, is in [`REPORT.md`](../REPORT.md).
8
 
9
  ```
10
  score = (1 - w) * rank(v2b) + w * rank(DeepFM) w = min(w_max, engaged / (engaged + n0))
 
83
  - **ONNX equals PyTorch** for both models (largest difference 2.4e-7).
84
  - **Feature parity:** from raw post and user data, the engine rebuilds the exact training inputs for all 539 validation and test rows. The largest difference is 0.0021 (standardized units), and no categorical value mismatched.
85
  - **Score parity:** engine outputs match the offline model predictions (cold within 1.1e-4, warm within 2.5e-4).
86
+ - **Smoke tests:** a new user gets pure v2b; the DeepFM weight grows with history and is capped; future interactions are ignored; older posts never get a larger freshness multiplier; the push applies only to fresh posts; the topic-first rule; changing the `community` and `flair` fields changes no score (the `domain` token is not covered; see the correction above).
87
  - **Backend tests:** backend-shaped payloads, plus the backend's real `reco.store` code on fakeredis (indexing, state, burst buffer, pool write). The drop-in `build_pool_hybrid` returns the same candidates as the backend's own `build_pool`.
88
  - **Speed:** about 0.7 ms per candidate on CPU, including the history features.
89