Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(signals): retire the title_embeddings inbox ranking family (#118619)

posthog[bot]150f0528f84e
diff --git a/docs/internal/inbox-ranking-training.md b/docs/internal/inbox-ranking-training.md
index 0578ee7e0958..cbcef09d6a9f 100644
--- a/docs/internal/inbox-ranking-training.md
+++ b/docs/internal/inbox-ranking-training.md
@@ -6,7 +6,7 @@ The artefact's team/report IDs, creation timestamp, and actor attribution identi
Selecting the current priority adds no correction. These records are available for future priority learning; they do not introduce a new ranking label or training head.
Research already running when a priority is edited preserves that correction; a later research run can reassess it.
-The report-embedding and title-embedding ranking families use one example per report per head, from the report's birth-day snapshot.
+The report-embedding ranking family uses one example per report per head, from the report's birth-day snapshot.
This prevents long-lived reports from receiving more weight in training because they appear in more daily snapshots.
Birth days use the UTC interval returned by `snapshot_bounds`, including the start and excluding the end.
The label comes from the snapshot `horizon_days` later, including outcomes already present on the birth day.
@@ -43,7 +43,7 @@ Each head in `metadata.json` records `cohort` (`everyone`) and `horizon_days`.
## Row budget
A feature set can limit the rows one head keeps (`max_examples_per_head`).
-The embedding families set it to 100,000.
+The report-embedding family sets it to 100,000.
The budget limits history, not the rows inside a day:
- The head's examples are grouped by report-creation day, newest first.
diff --git a/products/signals/backend/ranking/features.py b/products/signals/backend/ranking/features.py
index cd549a6f61de..fffa55400c1b 100644
--- a/products/signals/backend/ranking/features.py
+++ b/products/signals/backend/ranking/features.py
@@ -6,11 +6,11 @@ matrix. A model records the set it was fit on in its `metadata.json`, so a run c
sets at once: the examples Parquet, the training matrix and the scoring matrix are all built per
set, and a model whose declared set this build cannot produce is left unscored.
-The two sets are the report's combined-text embedding vector and its title-only vector, one
-rendering each. They are the served contract: training (`products/signals/dags/inbox_ranking/training/`)
-and serving (the scoring sweep in this package) build features through the same `build_matrix`, so
-the booster's `feature_names` match the serving matrix by construction. The sweep reads each
-vector at scoring time and needs nothing else from the report.
+The one set is the report's combined-text embedding vector. It is the served contract: training
+(`products/signals/dags/inbox_ranking/training/`) and serving (the scoring sweep in this package)
+build features through the same `build_matrix`, so the booster's `feature_names` match the serving
+matrix by construction. The sweep reads the vector at scoring time and needs nothing else from the
+report.
"""
import abc
@@ -32,11 +32,6 @@ NO_EXTRAS: Extras = MappingProxyType({})
# snapshot, indexed by report_id, with the vector in `EMBEDDING_COLUMN` and the moment that vector
# landed in `EMBEDDING_INSERTED_AT_COLUMN`.
REPORT_EMBEDDINGS_EXTRA = "report_embeddings"
-# The title-only vector, under its own key, from the dataset dag's own
-# `inbox_report_title_embeddings` snapshot. Two keys rather than one, because the two families
-# exist to be compared: a row that fell back to the combined-text vector would measure nothing, and
-# a summary-only edit re-embeds only the combined rendering, so the two landing times differ.
-TITLE_EMBEDDINGS_EXTRA = "title_embeddings"
EMBEDDING_COLUMN = "embedding_small"
EMBEDDING_INSERTED_AT_COLUMN = "embedding_inserted_at"
# The width of text-embedding-3-small-1536, the model the report documents are embedded with. A
@@ -111,11 +106,9 @@ class FeatureSet(abc.ABC):
class ReportEmbeddingsFeatureSet(FeatureSet):
"""One text rendering's embedding vector, and nothing else, at one example per report.
- Parameterized by the `extras` key it reads, so a rendering is a second instance rather than a
- second class: the combined-text rendering and the title-only rendering then share this width,
- this grain and this row budget by construction, and a regularization change lands on both. That
- is what makes the two families' grades a measurement of the text choice rather than of the
- recipe. A set reads its own key only, and never falls back to another rendering's vector.
+ Parameterized by the `extras` key it reads, so another rendering is a second instance rather
+ than a second class, and shares this width, this grain and this row budget by construction. A
+ set reads its own key only, and never falls back to another rendering's vector.
Two modelling calls this set records, both open questions on the issue that asked for it
(posthog#98243):
@@ -204,17 +197,12 @@ class ReportEmbeddingsFeatureSet(FeatureSet):
REPORT_EMBEDDINGS_FEATURE_SET = ReportEmbeddingsFeatureSet(name="report_embeddings", extras_key=REPORT_EMBEDDINGS_EXTRA)
-# The title-only rendering of the same reports, so a family can measure the title against the
-# title-plus-summary vectors on identical rows. The inbox title is what a person reads before
-# opening a report; the summary is read after. Everything else matches the set above, deliberately.
-TITLE_EMBEDDINGS_FEATURE_SET = ReportEmbeddingsFeatureSet(name="title_embeddings", extras_key=TITLE_EMBEDDINGS_EXTRA)
# Every set this build can produce, by name. A model that names a set absent from here cannot be
# scored, the same way a model whose feature names have moved on cannot.
FEATURE_SETS: Mapping[str, FeatureSet] = MappingProxyType(
{
REPORT_EMBEDDINGS_FEATURE_SET.name: REPORT_EMBEDDINGS_FEATURE_SET,
- TITLE_EMBEDDINGS_FEATURE_SET.name: TITLE_EMBEDDINGS_FEATURE_SET,
}
)
diff --git a/products/signals/backend/ranking/scorer.py b/products/signals/backend/ranking/scorer.py
index 0d538d3ed6d8..bdaff0591e60 100644
--- a/products/signals/backend/ranking/scorer.py
+++ b/products/signals/backend/ranking/scorer.py
@@ -28,7 +28,6 @@ from products.signals.backend.ranking.features import (
EMBEDDING_COLUMN,
EMBEDDING_INSERTED_AT_COLUMN,
REPORT_EMBEDDINGS_EXTRA,
- TITLE_EMBEDDINGS_EXTRA,
FeatureSet,
ProjectInputs,
ReportEmbeddingsFeatureSet,
@@ -44,7 +43,7 @@ from products.signals.backend.ranking.model_store import (
from products.signals.backend.ranking.serving_manifest import ServingManifestEntry
from products.signals.backend.ranking.sinks import persist_scores
from products.signals.backend.report_embedding_reader import ReportVector, latest_report_vectors
-from products.signals.backend.report_embeddings import EMBEDDING_RENDERING_TITLE, EMBEDDING_RENDERING_TITLE_SUMMARY
+from products.signals.backend.report_embeddings import EMBEDDING_RENDERING_TITLE_SUMMARY
logger = structlog.get_logger(__name__)
@@ -55,7 +54,6 @@ NO_PROJECT_VECTORS = "no_project_vectors"
# renderings under the same keys, so a model reads the text it was fit on.
RENDERING_BY_EXTRA: Mapping[str, str] = {
REPORT_EMBEDDINGS_EXTRA: EMBEDDING_RENDERING_TITLE_SUMMARY,
- TITLE_EMBEDDINGS_EXTRA: EMBEDDING_RENDERING_TITLE,
}
# A model that did not load has no feature contract this pass could read.
diff --git a/products/signals/backend/test/test_ranking_scoring.py b/products/signals/backend/test/test_ranking_scoring.py
index 7277f60b7599..d57e0ca2d9d4 100644
--- a/products/signals/backend/test/test_ranking_scoring.py
+++ b/products/signals/backend/test/test_ranking_scoring.py
@@ -33,7 +33,6 @@ from products.signals.backend.ranking.features import (
MIN_PROJECT_HISTORY_REPORTS,
PROJECT_VECTOR_KINDS,
REPORT_EMBEDDINGS_FEATURE_SET,
- TITLE_EMBEDDINGS_FEATURE_SET,
FeatureSet,
)
from products.signals.backend.ranking.model_store import ModelLoadError, load_serving_set
@@ -270,7 +269,7 @@ class TestModelStore(_StoreTestMixin, SimpleTestCase):
)
def test_a_challenger_that_cannot_load_is_skipped(self, _name: str, kwargs: dict, reason: str) -> None:
served = self._served()
- challenger = self._challenger("title_embeddings", TITLE_EMBEDDINGS_FEATURE_SET, **kwargs)
+ challenger = self._challenger("nn", REPORT_EMBEDDINGS_FEATURE_SET, **kwargs)
self.store.publish_manifest([served, challenger])
serving = load_serving_set()
@@ -411,47 +410,24 @@ class TestScorer(_ScorerTestMixin, SimpleTestCase):
candidate = self.store.publish_model(
"report_embeddings", REPORT_EMBEDDINGS_FEATURE_SET, version=OLDER_VERSION, roles=[DAILY_CANDIDATE_ROLE]
)
- title = self._challenger("title_embeddings", TITLE_EMBEDDINGS_FEATURE_SET)
- self.store.publish_manifest([served, candidate, title])
+ challenger = self._challenger("nn", REPORT_EMBEDDINGS_FEATURE_SET, model_kind=ONNX_MODEL_KIND)
+ self.store.publish_manifest([served, candidate, challenger])
_, fake_vectors, _ = self._score(["r1", "r2"], {}, persist=False)
- assert sorted(fake_vectors.calls) == sorted([EMBEDDING_RENDERING_TITLE_SUMMARY, EMBEDDING_RENDERING_TITLE])
-
- def test_a_challenger_without_a_vector_is_a_skipped_result(self) -> None:
- served = self._served(thresholds={"open": 0.25})
- title = self._challenger("title_embeddings", TITLE_EMBEDDINGS_FEATURE_SET)
- manifest = self.store.publish_manifest([served, title])
-
- (outcome,), _, captured = self._score(
- ["r1"],
- {EMBEDDING_RENDERING_TITLE_SUMMARY: {"r1": ReportVector(embedding=_vector(1), inserted_at=LANDED)}},
- persist=False,
- )
-
- assert outcome.score is not None
- results = outcome.score.results
- assert (results[served.key].status, set(results[served.key].scores)) == ("scored", set(HEADS))
- # thumbs_up saved no threshold, so it has no base rate to divide by.
- assert results[served.key].lifts == {"open": results[served.key].scores["open"] / 0.25}
- assert results[title.key].lifts == {}
- assert (results[title.key].status, results[title.key].skip_reason) == ("skipped", NO_VECTOR)
- assert outcome.score.served_key == manifest.served.key
- assert outcome.score.embedding_inserted_at == LANDED
- assert captured.events == []
+ assert fake_vectors.calls == [EMBEDDING_RENDERING_TITLE_SUMMARY]
def test_xgboost_and_onnx_models_score_in_one_pass(self) -> None:
served = self._served()
- onnx = self._challenger("title_embeddings", TITLE_EMBEDDINGS_FEATURE_SET, model_kind=ONNX_MODEL_KIND)
+ onnx = self._challenger("nn", REPORT_EMBEDDINGS_FEATURE_SET, model_kind=ONNX_MODEL_KIND)
self.store.publish_manifest([served, onnx])
expected = np.load(ONNX_FIXTURES / "report.expected.npz")
report_ids = [f"r{index}" for index in range(len(expected["report"]))]
vectors = {
- rendering: {
+ EMBEDDING_RENDERING_TITLE_SUMMARY: {
report_id: ReportVector(embedding=vector, inserted_at=LANDED)
for report_id, vector in zip(report_ids, expected["report"])
}
- for rendering in (EMBEDDING_RENDERING_TITLE_SUMMARY, EMBEDDING_RENDERING_TITLE)
}
outcomes, _, _ = self._score(report_ids, vectors, persist=False)
@@ -576,8 +552,10 @@ class TestScorerPersists(_ScorerTestMixin, BaseTest):
def test_persist_writes_one_valid_row_per_scored_report_of_the_team(self, _name: str, shared_pass: bool) -> None:
self.team_id = self.team.id
served = self._served(thresholds={"open": 0.0})
- title = self._challenger("title_embeddings", TITLE_EMBEDDINGS_FEATURE_SET)
- manifest = self.store.publish_manifest([served, title])
+ candidate = self.store.publish_model(
+ "report_embeddings", REPORT_EMBEDDINGS_FEATURE_SET, version=OLDER_VERSION, roles=[DAILY_CANDIDATE_ROLE]
+ )
+ manifest = self.store.publish_manifest([served, candidate])
scored, unscored = self._report(self.team.id), self._report(self.team.id)
other_team = Team.objects.create(organization=self.organization)
foreign = self._report(other_team.id)
@@ -585,10 +563,7 @@ class TestScorerPersists(_ScorerTestMixin, BaseTest):
outcomes, _, captured = self._score(
[scored, unscored, foreign],
- {
- EMBEDDING_RENDERING_TITLE_SUMMARY: {scored: vector, foreign: vector},
- EMBEDDING_RENDERING_TITLE: {scored: vector},
- },
+ {EMBEDDING_RENDERING_TITLE_SUMMARY: {scored: vector, foreign: vector}},
persist=True,
shared_pass=shared_pass,
)
@@ -602,11 +577,11 @@ class TestScorerPersists(_ScorerTestMixin, BaseTest):
assert [(str(row.report_id), row.team_id) for row in rows] == [(scored, self.team.id)]
score = RankingScore.model_validate_json(rows[0].content)
assert score.served_key == manifest.served.key
- assert score.results[title.key].status == "scored"
+ assert score.results[candidate.key].status == "scored"
assert sorted(
(event["event"], event["properties"]["report_id"], event["properties"]["model_key"])
for event in captured.events
- ) == sorted([(REPORT_SCORED_EVENT, scored, served.key), (REPORT_SCORED_EVENT, scored, title.key)])
+ ) == sorted([(REPORT_SCORED_EVENT, scored, served.key), (REPORT_SCORED_EVENT, scored, candidate.key)])
classification = {
event["properties"]["model_key"]: {
key: value
@@ -618,7 +593,7 @@ class TestScorerPersists(_ScorerTestMixin, BaseTest):
# thumbs_up saved no threshold, and a model without one gets no stand-in. A zero threshold gives no lift.
assert classification == {
served.key: {"readable_heads": ["open"], "threshold_open": 0.0, "predicted_open": True},
- title.key: {"readable_heads": ["open"]},
+ candidate.key: {"readable_heads": ["open"]},
}
assert self.store.reads.count(serving_manifest_key(PREFIX)) == 1
assert captured.scopes == (0 if shared_pass else 1)
diff --git a/products/signals/dags/inbox_ranking/AGENTS.md b/products/signals/dags/inbox_ranking/AGENTS.md
index 6540c4cdc923..9b16d37671f0 100644
--- a/products/signals/dags/inbox_ranking/AGENTS.md
+++ b/products/signals/dags/inbox_ranking/AGENTS.md
@@ -15,10 +15,10 @@ Read `README.md` first for what the dataset is and how partitions behave. This f
- `products/signals/backend/ranking/features.py` holds a `FeatureSet` per feature universe (it lives in the backend so the scoring sweep owns it and the dag imports it). The embedding sets are also the serving contract: the sweep builds each model's matrix through the set's own `build_matrix`, and refuses a booster whose `feature_names` or `feature_schema_version` disagree with its set. A change to a set's features means bumping that set's `schema_version`, and the sweep must be able to compute it at scoring time — nothing impression-derived, nothing that needs the label streams.
- A model declares its feature set in `metadata.json` and is checked against that set, not against one global contract. Adding a set means an entry in `FEATURE_SETS`; the examples asset then writes its Parquet under `inbox_ranking_training_examples/v1/<feature_set>/dt=D/`. Do not reintroduce a module-global feature list into the training path: three sets live side by side. A partition whose examples were written before the per-set layout has nothing under `<feature_set>/`, so re-run the examples asset for that day before re-running the candidate on it.
- A set that reads a side input declares it in `extras_keys`, and reports per-row availability through `buildable`. The example builder drops the rows `buildable` returns False for.
-- The two embedding sets are one `ReportEmbeddingsFeatureSet` parameterized by the `extras` key it reads, one rendering each. A set reads its own key only: never add a fallback to the other rendering's vector, and keep width, grain, row budget and booster params identical across the pair, or the paired AUC difference stops measuring the text choice. `embeddings_extras` loads one set's inputs at a time, because a snapshot carries a vector per live report; keep it that way, so a further embedding family costs runtime rather than peak memory.
+- An embedding set is a `ReportEmbeddingsFeatureSet` parameterized by the `extras` key it reads, one rendering each. A set reads its own key only: never add a fallback to another rendering's vector. `title_embeddings` is retired (`RETIRED_MODEL_NAMES`), so nothing trains on the `inbox_report_title_embeddings` snapshot. `embeddings_extras` loads one set's inputs at a time, because a snapshot carries a vector per live report; keep it that way, so a further embedding family costs runtime rather than peak memory.
- A **missing** side-input object leaves its key out, so only the sets reading it are skipped and their partitions stay as they are. An **empty** object keeps its key and takes the ordinary thin-input path. Do not collapse the two: the first must not write over a partition, and the second is a day the family really has nothing to fit.
- Both `buildable` and `build_matrix` take the moment being built as `as_of`, and a side input that changes over a report's life must honor it. The report vector does: reports are re-embedded when their text changes, so the snapshot's latest vector often postdates the moment, and taking it would train on text that did not exist yet. Never widen a set's side input to the latest value for convenience.
-- `example_grain` and `max_examples_per_head` are per set, because the examples object is. Every set defaults to the birth grain so the families target the same scoring moment; side-input availability and row budgets can still change their training populations. `report_embeddings` is the reason the budget exists (1536 columns per row). Keep the two embedding sets on one budget, so their grades measure the text choice and not the row count. A budget limits history and never samples inside a day: `cap_examples` keeps whole report-creation days, newest first, so the kept label rate stays the population rate and the scores stay calibrated. Never reintroduce a positive-keeping sample: it raises the base rate the booster fits, and a holdout cut from the same sample hides it.
+- `example_grain` and `max_examples_per_head` are per set, because the examples object is. Every set defaults to the birth grain so the families target the same scoring moment; side-input availability and row budgets can still change their training populations. `report_embeddings` is the reason the budget exists (1536 columns per row). A budget limits history and never samples inside a day: `cap_examples` keeps whole report-creation days, newest first, so the kept label rate stays the population rate and the scores stay calibrated. Never reintroduce a positive-keeping sample: it raises the base rate the booster fits, and a holdout cut from the same sample hides it.
- `feature_vector` (one row, serving) and `feature_frame` (vectorized, training) must agree row for row; a test pins it. Change both together.
- Examples are one row per report, on the snapshot of the day it was created, labeled from the snapshot `horizon_days` later. The scoring-moment and report grains stay selectable for re-scoring families, so keep the holdout cut by report: a row-level split leaks near-duplicate snapshots of the same report the moment a set asks for one of them. The moments are chosen before the features are built, so a set under a row budget never builds columns for rows it then drops; keep that order.
- `inbox_ranking_models/v1/<model_name>/dt=D/` is history like the dataset partitions: the only mutation is a re-run of the same partition, which replaces the prefix in full (stale head files are deleted). `<model_name>/champion.json` is the only object written outside its partition, and only the champion asset (or a human, deliberately) writes it; it carries the candidate's `run_id`, so a loader can detect a re-run behind a pinned version.
diff --git a/products/signals/dags/inbox_ranking/README.md b/products/signals/dags/inbox_ranking/README.md
index 8283a3141e35..a5fde315e4b7 100644
--- a/products/signals/dags/inbox_ranking/README.md
+++ b/products/signals/dags/inbox_ranking/README.md
@@ -43,7 +43,7 @@ s3://<bucket>/<prefix>/
The first four are report grain and land in one table. `inbox_signal_embeddings` is signal grain, feeds the group-level model, and is read on its own — training joins it to `inbox_report_model_data` by `report_id`.
-`inbox_report_title_embeddings` is a report-grain leaf. It snapshots the `title_v1` rendering the same way `inbox_report_embeddings` snapshots `title_summary_v1`, and nothing joins it: the training side pairs the two by `report_id` when it measures one rendering against the other, and each carries its own `embedding_inserted_at`, because a summary-only edit re-emits only `title_summary_v1`. Its dependency on `inbox_report_model_data` is for ordering, not data — it holds a vector per live report, so it runs last and alone in the run pod. That edge has a cost: a failed join, or a run that hits the job's runtime cap, skips the title snapshot for the day, and the schedule never revisits a day. Repair such a gap with a single-asset backfill while the source rows are inside their 3-month TTL.
+`inbox_report_title_embeddings` is a report-grain leaf. It snapshots the `title_v1` rendering the same way `inbox_report_embeddings` snapshots `title_summary_v1`, and nothing joins it. No model family trains on it since `title_embeddings` was retired; the snapshot stays for offline reads. It carries its own `embedding_inserted_at`, because a summary-only edit re-emits only `title_summary_v1`. Its dependency on `inbox_report_model_data` is for ordering, not data — it holds a vector per live report, so it runs last and alone in the run pod. That edge has a cost: a failed join, or a run that hits the job's runtime cap, skips the title snapshot for the day, and the schedule never revisits a day. Repair such a gap with a single-asset backfill while the source rows are inside their 3-month TTL.
`inbox_report_reviewers` is a (report, reviewer) leaf for user–report affinity modeling. It holds one row per entry of each spine report's current `SignalReportSuggestedReviewer` index, for teams that allow AI training. Nothing joins it, and its object carries its own schema version (`REVIEWERS_SCHEMA_VERSION`), so a failure here does not fail the training table.
@@ -146,18 +146,17 @@ s3://<bucket>/<prefix>/
└── inbox_ranking_served_scores/v1/dt=YYYY-MM-DD/ # the scoring sweep's scores of the reports born that day, per model key
```
-- **A model is a `(model_name, model_version, model_role)`.** `model_name` is the family: which features and which learner: `report_embeddings` and `title_embeddings`, both per-head XGBoost, are the two trained here. `nn`, one ONNX network, is trained by the `signals_ml` location, and each `MODEL_FAMILIES` entry names its `learner` and the `location` that trains it. `model_version` is the partition day it was fit on, and `model_role` is the role it was scored or trained under (`candidate` on the training events; `served`, `daily_candidate` or `cross_family` on the online grade). Each family owns a prefix under the models path and its own `champion.json`, so two families trained on the same day cannot collide, and promotion stays inside a family. A second family is a second model graded on the same online rows, not a competitor for another family's pointer.
-- **A feature set is one feature universe.** `products/signals/backend/ranking/features.py` holds a `FeatureSet` per universe: its name, its schema version, its ordered feature names, the report-state columns it reads, `build_matrix`, and how many rows it wants per report and per head. `report_embeddings` and `title_embeddings` are the two today. A candidate records the set it was fit on in its `metadata.json`, so the grader checks a model against its own set rather than one global contract, the examples asset writes one Parquet per set, and the unseen scorer builds one matrix per set and shares it across the families that read it. Adding a set means an entry in `FEATURE_SETS`; a model naming a set this build cannot produce is logged and left unscored.
+- **A model is a `(model_name, model_version, model_role)`.** `model_name` is the family: which features and which learner: `report_embeddings`, per-head XGBoost, is the one trained here. `nn`, one ONNX network, is trained by the `signals_ml` location, and each `MODEL_FAMILIES` entry names its `learner` and the `location` that trains it. `model_version` is the partition day it was fit on, and `model_role` is the role it was scored or trained under (`candidate` on the training events; `served`, `daily_candidate` or `cross_family` on the online grade). Each family owns a prefix under the models path and its own `champion.json`, so two families trained on the same day cannot collide, and promotion stays inside a family. A second family is a second model graded on the same online rows, not a competitor for another family's pointer.
+- **A feature set is one feature universe.** `products/signals/backend/ranking/features.py` holds a `FeatureSet` per universe: its name, its schema version, its ordered feature names, the report-state columns it reads, `build_matrix`, and how many rows it wants per report and per head. `report_embeddings` is the one today. A candidate records the set it was fit on in its `metadata.json`, so the grader checks a model against its own set rather than one global contract, the examples asset writes one Parquet per set, and the unseen scorer builds one matrix per set and shares it across the families that read it. Adding a set means an entry in `FEATURE_SETS`; a model naming a set this build cannot produce is logged and left unscored.
- **Examples are one row per report at its birth, by default.** For partition `dt=D` the examples asset reads the report-state and labels snapshots `dt=D-lookback..D` and emits one row per report, on the snapshot of the day it was created, labeled from the snapshot `horizon_days` later (7 for open, 14 for action, 30 for fixed). Features are built by the feature set from that snapshot's state columns plus `age_hours`, the report's age at the snapshot. Labels are aligned to the state spine, so a report with no label event is a negative (all-zero labels), not absent. Label-only rows (no Postgres state) are skipped, as are state rows read long after their snapshot day (backfills carry current Postgres state; see `features_observed_at`) and, for the heads that read the status stream (`action` and `fixed`), rows whose status telemetry fails the dataset's `label_provenance_ok` check. Birth is the moment serving scores a report, and the label that comes out is a per-report probability, which is what the inbox ordering needs. A report born before the window, or one whose birth-day snapshot is missing from it, is no example; `reports_missing_birth_snapshot` on the asset counts the second case, which is a gap in the partitions.
- **An outcome already visible on the birth day is a future positive.** A report born on day D has no scoring moment before D, so an outcome visible at D belongs to the moment being built rather than to an earlier one; the labels of D therefore read as their defaults for a report born on D. Most outcomes land on the birth day, so this is where the positives are: censoring on them costs the `pr_created` head most of its training signal. `<set>_<head>_birth_day_positives` on the examples asset, and `birth_day_positives` on the `inbox_ranking_examples_built` event, say how many positives the rule keeps. These rows carry a hindsight the other rows do not: the state snapshot reads `signal_count`, `total_weight`, `run_count` and the text sizes live from Postgres a few hours after day D ends, so a birth-day outcome happened before its own feature read. Both the holdout AUC and the newborn unseen grade therefore read optimistically on these rows, until the scoring sweep's timestamped score log replaces the daily snapshot as this table's source.
- **Every head asks whether the outcome happened within N days of the scoring moment.**
- **A set may ask for another grain**, and cap the rows one head keeps (`max_examples_per_head`, whole report-creation days, newest first). The scoring-moment grain is one row per (report, snapshot) whose head label is still 0 on that snapshot: the serving situation replayed over history, but its label is a hazard conditional on the report still being live, and one long-lived report contributes dozens of near-duplicate rows. The report grain is the first snapshot of the window where the report is a usable moment, which is later than birth only when a side input landed late. Both stay selectable for re-scoring families; nothing ships on them today. The row budget shortens the history a head is fit on and keeps each kept day whole, so the scores stay calibrated to the population of that window. The lookback is the training job's whatever the grain, so positives accrue over the whole window until the budget binds.
- **The embedding sets are the serving contract.** Each reads one rendering's vector and nothing else, so the scoring sweep needs only the report's latest vector for that rendering. The sweep must build features through the same module; the booster's `feature_names` are checked against it at load. A model whose metadata names no set is left unscored.
- **`report_embeddings` is the report's own vector and nothing else**, read from the dt=D `inbox_report_embeddings` snapshot as a side input. Age is deliberately left out: it is the whole signal of the `recency_auc` line the unseen read already reports, so a gap to that line is content rather than recency. The scoring sweep does not serve this set: it is an offline candidate, and serving it needs the report vector at scoring time.
-- **`title_embeddings` is the same set over the title-only vector**, read from the dt=D `inbox_report_title_embeddings` snapshot, a separate leaf partition with its own `embedding_inserted_at`. One `ReportEmbeddingsFeatureSet` class parameterized by the input it reads, so the two renderings share this width, this grain, this row budget and the trainer's booster params by construction: the pair measures the text choice, and a recipe that drifted on one side would read as a text effect. A set reads its own input only and never falls back to the other rendering's vector, so a report present in one snapshot and absent from the other is an example for one family and not the other. The inbox title is what a person reads before opening a report and the summary is read after, which is the question the pair answers: whether the summary carries `open` signal or only post-open signal.
- **A moment only takes a vector that already existed for it.** The snapshot holds the latest vector per report, and a report is re-embedded whenever its text changes (the summary workflow and every re-research run rewrite it), so the latest vector often postdates an earlier moment. Each row carries `embedding_inserted_at`, and a moment keeps the vector only when it landed at or before that snapshot's end; at the birth grain a report whose birth-day snapshot holds only a later vector is no example, and at the report grain it moves to the first snapshot where the vector was already its own. Without that check the family would train on text that did not exist when the report was supposedly scored. A report the snapshot has no vector for at all is not an example either, because the source table's TTL runs from report creation and a long-lived report loses its vector while still live. The scores asset records each set's coverage of the newborn pool, so a thin side input is visible rather than silent.
- **A set whose side input is unavailable is skipped, not rebuilt from nothing.** The examples asset writes no object for it, the candidate asset leaves that family's partition as it stands, and the unseen scorer drops its models for the day. Rebuilding would write an empty examples object, then an empty candidate, and the candidate's prefix cleanup would delete boosters a champion pointer can name.
-- **Missing and empty are different inputs.** The case above is a snapshot object that is absent. A snapshot that exists and carries no usable vector keeps its key, so the family builds no row and the ordinary thin-input path applies. Each rendering is a separate dependency of the examples and scores assets, so a failed title snapshot costs the title family's day and nothing else.
+- **Missing and empty are different inputs.** The case above is a snapshot object that is absent. A snapshot that exists and carries no usable vector keeps its key, so the family builds no row and the ordinary thin-input path applies.
- **One rendering's vectors are held at a time.** The examples asset loads a set's side inputs, builds that set's object, and releases them before the next set. Each snapshot carries a vector per live report, so a further embedding family costs runtime rather than peak memory. The scores asset narrows each snapshot to the newborn pool it scores for the same reason. Raising the pod memory limit is not the first move here.
- **Candidate**: one per family, per-head XGBoost with fixed params, holdout = the last `holdout_days` of reports (cut by report, never by row), AUC + a label-permutation null. Each family trains on the examples of the feature set its registry entry names, and a family whose examples or metadata are missing that day is logged and skipped rather than failing the asset. A head is _readable_ when it has enough holdout positives and clears its null by 0.05. The shipped booster (`<head>.ubj`) is refit on everything; the train-only fit is kept as `<head>.holdout.ubj` so a later candidate can grade this model on its own holdout.
- **Metrics telemetry**: each asset also captures its metrics as events into the dogfood project (the same project the label events land in), through `training/telemetry.py`: `inbox_ranking_examples_built` once per head and feature set, `inbox_ranking_candidate_trained` once per head (`head`, `model_role` always `candidate`, holdout / train AUC, average precision, logloss, positive rate, mean predicted score, the row-weighted decile calibration error, the permutation-null mean and spread, counts, `readable`), `inbox_ranking_holdout_calibration` once per head and holdout score decile `inbox_ranking_promotion_decided` once per run and `inbox_ranking_serving_manifest_published` once per run, all carrying `model_name` and `model_version` and stamped midday UTC on the partition day so re-runs and backfills chart on the day they describe. Per-head stability is a trends insight with a `head` breakdown; a readability drop is an insight alert. `metadata.json` stays the durable record. Capture is best-effort. Local dev runs (`DEBUG`) emit too, under `distinct_id` `inbox_ranking_training_local` with `environment=local`, so filter or break down on `environment` when reading the prod series; any other non-Cloud deployment emits nothing.
@@ -285,19 +284,6 @@ The inbox sorts the reports of one team, so the order that matters is the order
Compare model families on the within-team AUC when they differ in team-level inputs, such as project vectors: a gain in pooled AUC alone can be team identity rather than a better order. The promotion gate still reads the pooled holdout AUC.
-#### Reading one rendering against another
-
-The `title_embeddings` and `report_embeddings` families are trained and graded to be compared, not promoted. The read:
-
-- **Pair the rows, then take the difference.** The sweep scores each report with both families when both are in the manifest, so for one head and one day they are mostly graded on the same reports. Break the unseen grade down by `model_name` and difference the two AUCs on the rows both grades had. An unpaired difference of two full-population AUCs is not this comparison: keep each family's full-population number, and the matched one, as separate figures.
-- **Read the uncertainty before the sign.** `null_auc_std` on each grade is the spread a per-day AUC has on those rows. A difference inside that band is inconclusive, not evidence that the two renderings carry the same signal. Pool about 30 days before treating a direction as real.
-- **Carry coverage and positives with every figure.** `pool_coverage_by_model` on the scores asset says how much of the pool each model scored, and `rows` / `positives` / `birth_day_positives` on each grade say how much outcome the AUC rests on. A family graded largely on its missing branch reads low for a reason that is not the text.
-- **Keep the baselines on the same rows.** `recency_auc` and the other embedding family are reported on the same grade, so the reading is title against combined against newest-first, not against numbers from another day.
-- **Read `open` first.** It has the shortest horizon (7 days, shared with `pr_created`) and the most positives, so its labels mature first; `action` follows at 14 days. Emission is forward-only and a moment only takes a vector that had already landed, so both families accrue from the first partition after their input starts flowing.
-- **This is not an online experiment.** Every row is a live birth-day score graded against a later snapshot, and the outcomes it grades happened under the order the inbox actually served. A gap between two families is a difference in rank quality on logged outcomes, not a causal claim about what the inbox would do differently.
-
-Nothing in this read changes what the inbox serves. The scoring sweep serves the family the manifest names (`INBOX_RANKING_SERVED_FAMILY`), promotion stays inside a family, and `INBOX_RANKING_AUTO_PROMOTE` gates the pointer rewrite; a rendering that wins here earns a separate decision, not an automatic promotion.
-
### Running the training job locally
The training job is S3-only, so it can run on a laptop against copies of the prod snapshots. The dataset job cannot: it needs the dogfood project's ClickHouse and cross-region Postgres.
@@ -309,7 +295,7 @@ The training job is S3-only, so it can run on a laptop against copies of the pro
INBOX_RANKING_READER_SECRET_ID=<secret id> products/signals/dags/inbox_ranking/bin/sync_snapshots_local.sh
```
- This copies `inbox_report_state/v1/dt=*` and `inbox_report_labels/v1/dt=*` to `~/.cache/posthog/inbox_ranking/` and from there into `s3://posthog/inbox_ranking/` on SeaweedFS (`localhost:19000`). `INBOX_RANKING_SYNC_EMBEDDINGS=1` adds `inbox_report_embeddings`, which the `report_embeddings` family needs; it is off by default because that table carries a vector per live report per partition. Without it the job still runs, and that family builds no examples. `INBOX_RANKING_SYNC_TITLE_EMBEDDINGS=1` adds `inbox_report_title_embeddings`, which the `title_embeddings` family needs, on its own switch and for the same reason. It prints the partition days present in both tables; pick the **newest** of those as the partition to run. The examples asset reads the `INBOX_RANKING_TRAINING_LOOKBACK_DAYS` snapshots behind the partition it runs for, so an early day has little history behind it and trains on almost nothing. Re-runs only move new days.
+ This copies `inbox_report_state/v1/dt=*` and `inbox_report_labels/v1/dt=*` to `~/.cache/posthog/inbox_ranking/` and from there into `s3://posthog/inbox_ranking/` on SeaweedFS (`localhost:19000`). `INBOX_RANKING_SYNC_EMBEDDINGS=1` adds `inbox_report_embeddings`, which the `report_embeddings` family needs; it is off by default because that table carries a vector per live report per partition. Without it the job still runs, and that family builds no examples. `INBOX_RANKING_SYNC_TITLE_EMBEDDINGS=1` adds `inbox_report_title_embeddings` on its own switch and for the same reason. No family trains on it. It prints the partition days present in both tables; pick the **newest** of those as the partition to run. The examples asset reads the `INBOX_RANKING_TRAINING_LOOKBACK_DAYS` snapshots behind the partition it runs for, so an early day has little history behind it and trains on almost nothing. Re-runs only move new days.
Note that the dev stack's object storage accepts unsigned requests and publishes port 19000 on every host interface, so anything synced here (and the disk cache) is readable by whoever can reach your machine. The snapshots are internal dogfood telemetry, not customer data, but run the sync on a network you trust.
diff --git a/products/signals/dags/inbox_ranking/bin/sync_snapshots_local.sh b/products/signals/dags/inbox_ranking/bin/sync_snapshots_local.sh
index 0cb204ebfe34..75ce00721bcc 100755
--- a/products/signals/dags/inbox_ranking/bin/sync_snapshots_local.sh
+++ b/products/signals/dags/inbox_ranking/bin/sync_snapshots_local.sh
@@ -12,7 +12,7 @@
#
# INBOX_RANKING_SYNC_TITLE_EMBEDDINGS=1 copies inbox_report_title_embeddings, the title-only
# vectors of the same reports. It is a separate switch for the same reason: each table is a vector
-# per live report per partition, and a local loop usually wants one of them.
+# per live report per partition. No model family trains on it.
#
# Two hops: prod S3 -> a disk cache -> the local object-storage bucket. The disk copy is what
# makes a re-sync cheap (aws s3 sync only moves new partitions) and doubles as input for
diff --git a/products/signals/dags/inbox_ranking/dataset/dag.py b/products/signals/dags/inbox_ranking/dataset/dag.py
index d15486d8f20b..3e84c2fa3ee9 100644
--- a/products/signals/dags/inbox_ranking/dataset/dag.py
+++ b/products/signals/dags/inbox_ranking/dataset/dag.py
@@ -14,8 +14,7 @@ Nine assets on one daily partition, each writing Parquet under the configured S3
The first four are report grain and feed one table. inbox_signal_embeddings is signal grain and is
read on its own, joined to the others by report_id at training time. inbox_report_title_embeddings
-is a report-grain leaf: nothing joins it, and the training side pairs it to inbox_report_embeddings
-by report_id when it measures one rendering against the other. inbox_report_reviewers is a
+is a report-grain leaf: nothing joins it, and no model family trains on it. inbox_report_reviewers is a
(report, reviewer) leaf with its own schema version: nothing joins it, and the training side pairs
it to the report tables by report_id. inbox_user_report_interactions is a (report, person) grain
leaf with its own schema version, so nothing joins it either. inbox_project_vectors is a
diff --git a/products/signals/dags/inbox_ranking/tests/test_nn.py b/products/signals/dags/inbox_ranking/tests/test_nn.py
index 8c8cfe6ad937..7629205549b5 100644
--- a/products/signals/dags/inbox_ranking/tests/test_nn.py
+++ b/products/signals/dags/inbox_ranking/tests/test_nn.py
@@ -48,11 +48,7 @@ from products.signals.dags.inbox_ranking.training.dag import (
)
from products.signals.dags.inbox_ranking.training.serving import FamilyModels, compose_manifest
from products.signals.dags.inbox_ranking.training.train import HeadMetrics
-from products.signals.dags.inbox_ranking.training.unseen import (
- NN_MODEL_NAME,
- REPORT_EMBEDDINGS_MODEL_NAME,
- TITLE_EMBEDDINGS_MODEL_NAME,
-)
+from products.signals.dags.inbox_ranking.training.unseen import NN_MODEL_NAME, REPORT_EMBEDDINGS_MODEL_NAME
PREFIX = settings.INBOX_RANKING_DATASET_S3_PREFIX
PARTITION = "2026-08-19"
@@ -146,7 +142,7 @@ def test_the_main_location_never_fits_or_promotes_nn(monkeypatch, no_side_effect
model_object_key(PREFIX, name, PARTITION, METADATA_FILE): json.dumps(
_xgboost_metadata(name, PARTITION)
).encode()
- for name in (REPORT_EMBEDDINGS_MODEL_NAME, TITLE_EMBEDDINGS_MODEL_NAME, NN_MODEL_NAME)
+ for name in (REPORT_EMBEDDINGS_MODEL_NAME, NN_MODEL_NAME)
}
)
monkeypatch.setattr("products.signals.dags.inbox_ranking.training.dag.s3_client", lambda: client)
@@ -156,7 +152,7 @@ def test_the_main_location_never_fits_or_promotes_nn(monkeypatch, no_side_effect
inbox_ranking_model_champion(context)
champions = {key.split("/")[-2] for key in client.objects if key.endswith(CHAMPION_FILE)}
- assert champions == {REPORT_EMBEDDINGS_MODEL_NAME, TITLE_EMBEDDINGS_MODEL_NAME}
+ assert champions == {REPORT_EMBEDDINGS_MODEL_NAME}
assert not [key for key in client.objects if f"/{NN_MODEL_NAME}/" in key and not key.endswith(METADATA_FILE)]
diff --git a/products/signals/dags/inbox_ranking/tests/test_training.py b/products/signals/dags/inbox_ranking/tests/test_training.py
index 828b915e8c0a..92b011d04590 100644
--- a/products/signals/dags/inbox_ranking/tests/test_training.py
+++ b/products/signals/dags/inbox_ranking/tests/test_training.py
@@ -30,8 +30,6 @@ from products.signals.backend.ranking.features import (
REPORT_EMBEDDINGS_FEATURE_SET,
REPORT_GRAIN,
SCORING_MOMENT_GRAIN,
- TITLE_EMBEDDINGS_EXTRA,
- TITLE_EMBEDDINGS_FEATURE_SET,
Extras,
FeatureSet,
feature_set_by_name,
@@ -60,7 +58,6 @@ from products.signals.dags.inbox_ranking.dataset.dag import (
LABELS_TABLE,
PROJECT_VECTORS_TABLE,
STATE_TABLE,
- TITLE_EMBEDDINGS_TABLE,
)
from products.signals.dags.inbox_ranking.training.calibration import (
BUCKETS,
@@ -143,10 +140,10 @@ from products.signals.dags.inbox_ranking.training.unseen import (
CANDIDATE_ROLE,
LEGACY_POOL_NAME,
MODEL_FAMILIES,
+ NN_MODEL_NAME,
POOL_NAME,
REPORT_EMBEDDINGS_MODEL_NAME,
SERVED_SCORES_TABLE,
- TITLE_EMBEDDINGS_MODEL_NAME,
ModelFamily,
calibration_rows,
chance_band,
@@ -163,9 +160,7 @@ from products.signals.dags.inbox_ranking.training.unseen import (
from products.signals.dags.inbox_ranking.training.within_team import NO_TEAMS, WithinTeamAuc, within_team_auc
EMBEDDINGS_MODEL_NAME = REPORT_EMBEDDINGS_MODEL_NAME
-# The two renderings' sets. Every rule about a vector holds for both, because they are one class
-# parameterized by the input it reads, so the embedding tests below run over the pair.
-EMBEDDING_FEATURE_SETS = (REPORT_EMBEDDINGS_FEATURE_SET, TITLE_EMBEDDINGS_FEATURE_SET)
+EMBEDDING_FEATURE_SETS = (REPORT_EMBEDDINGS_FEATURE_SET,)
class _StateFeatureSet(FeatureSet):
@@ -186,7 +181,7 @@ STATE_MODEL_NAME = "state_xgb"
EMBEDDING_SET_IDS = [feature_set.name for feature_set in EMBEDDING_FEATURE_SETS]
-_EMBEDDING_EXTRA_KEYS = (REPORT_EMBEDDINGS_EXTRA, TITLE_EMBEDDINGS_EXTRA)
+_EMBEDDING_EXTRA_KEYS = (REPORT_EMBEDDINGS_EXTRA,)
D0 = datetime.date(2026, 8, 10)
NOW = datetime.datetime(2026, 8, 20, tzinfo=datetime.UTC)
@@ -736,8 +731,7 @@ def test_birth_grain_keeps_one_row_per_report_on_the_day_it_was_created(feature_
]
snapshots = _daily_snapshots(ids, head, created, days=3)
snapshots[D0 + datetime.timedelta(days=head.horizon_days)].labels.loc[:, "open_count"] = 0
- # Both renderings' inputs, so the parameter that varies is the set under test and not what it
- # was handed. The state set reads neither.
+ # The state set does not read the vectors, so the same extras serve every set under test.
extras = {key: _vector_frame({report_id: _embedding() for report_id in ids}) for key in _EMBEDDING_EXTRA_KEYS}
examples = build_examples(snapshots, head, feature_set, extras)
@@ -1183,16 +1177,14 @@ def test_with_model_names_drops_rows_that_name_no_family(scores, expected):
def test_head_grades_keep_every_family_apart_on_the_same_rows():
# A grade keyed on version and role alone would pool the families into one meaningless AUC.
- # Three of them now, and the paired title-against-combined read is a difference of two of these
- # grades, so a family whose rows leaked into another's would be read as a text effect.
head = HEADS_BY_NAME["open"]
labels = _labels(["a", "e"], open_count=[1, 0])
per_family = {
STATE_MODEL_NAME: [0.9, 0.1],
EMBEDDINGS_MODEL_NAME: [0.1, 0.9],
- TITLE_EMBEDDINGS_MODEL_NAME: [0.8, 0.2],
+ NN_MODEL_NAME: [0.8, 0.2],
}
- thresholds = {STATE_MODEL_NAME: 0.5, EMBEDDINGS_MODEL_NAME: 0.05, TITLE_EMBEDDINGS_MODEL_NAME: 0.95}
+ thresholds = {STATE_MODEL_NAME: 0.5, EMBEDDINGS_MODEL_NAME: 0.05, NN_MODEL_NAME: 0.95}
graded = pd.concat(
[
graded_rows(
@@ -1212,15 +1204,15 @@ def test_head_grades_keep_every_family_apart_on_the_same_rows():
)
grades = head_grades(graded, head, pool=POOL_NAME, scoring_partition="2026-08-10")
assert [(grade.model_name, grade.rows, grade.auc) for grade in grades] == [
+ (NN_MODEL_NAME, 2, 1.0),
(EMBEDDINGS_MODEL_NAME, 2, 0.0),
(STATE_MODEL_NAME, 2, 1.0),
- (TITLE_EMBEDDINGS_MODEL_NAME, 2, 1.0),
]
# Each model keeps the cut it saved, and never borrows another model's.
assert [(grade.classification.threshold, grade.classification.predicted_positive_rate) for grade in grades] == [
+ (0.95, 0.0),
(0.05, 1.0),
(0.5, 0.5),
- (0.95, 0.0),
]
# And the calibration read follows the grade, so each family has its own deciles.
assert {row["model_name"] for row in calibration_rows(grades)} == set(per_family)
@@ -1268,9 +1260,9 @@ def test_an_empty_scores_write_is_refused_over_a_partition_that_holds_rows(exist
"existing,scored,expected",
[
(
- [STATE_MODEL_NAME, EMBEDDINGS_MODEL_NAME, TITLE_EMBEDDINGS_MODEL_NAME],
+ [STATE_MODEL_NAME, EMBEDDINGS_MODEL_NAME, NN_MODEL_NAME],
[STATE_MODEL_NAME, EMBEDDINGS_MODEL_NAME],
- [TITLE_EMBEDDINGS_MODEL_NAME],
+ [NN_MODEL_NAME],
),
(
[STATE_MODEL_NAME, EMBEDDINGS_MODEL_NAME],
@@ -1280,8 +1272,8 @@ def test_an_empty_scores_write_is_refused_over_a_partition_that_holds_rows(exist
([STATE_MODEL_NAME], [], [STATE_MODEL_NAME]),
([], [STATE_MODEL_NAME], []),
(
- ["tabular_xgb", EMBEDDINGS_MODEL_NAME, TITLE_EMBEDDINGS_MODEL_NAME],
- [EMBEDDINGS_MODEL_NAME, TITLE_EMBEDDINGS_MODEL_NAME],
+ ["tabular_xgb", "title_embeddings", EMBEDDINGS_MODEL_NAME],
+ [EMBEDDINGS_MODEL_NAME],
[],
),
],
@@ -2035,14 +2027,6 @@ def _model_metadata(**overrides) -> dict[str, Any]:
(_model_metadata(), None),
# No declared set is left unscored rather than read as a default.
({key: value for key, value in _model_metadata().items() if key != "feature_set"}, "this build can produce"),
- (
- _model_metadata(
- feature_set=TITLE_EMBEDDINGS_FEATURE_SET.name,
- feature_schema_version=TITLE_EMBEDDINGS_FEATURE_SET.schema_version,
- feature_names=list(TITLE_EMBEDDINGS_FEATURE_SET.feature_names),
- ),
- None,
- ),
# A set a later build introduced, or one that has been withdrawn.
(_model_metadata(feature_set="mmoe_trunk"), "this build can produce"),
(_model_metadata(feature_schema_version=99), "feature_schema_version 99"),
@@ -2106,14 +2090,10 @@ def test_examples_key_layout_is_per_feature_set():
examples_object_key("inbox_ranking", REPORT_EMBEDDINGS_FEATURE_SET.name, "2026-08-19")
== "inbox_ranking/inbox_ranking_training_examples/v1/report_embeddings/dt=2026-08-19/part-00000.parquet"
)
+ # And one models prefix per family, so one family's booster never lands on another's.
assert (
- examples_object_key("inbox_ranking", TITLE_EMBEDDINGS_FEATURE_SET.name, "2026-08-19")
- == "inbox_ranking/inbox_ranking_training_examples/v1/title_embeddings/dt=2026-08-19/part-00000.parquet"
- )
- # And one models prefix per family, so a title booster never lands on the combined family's.
- assert (
- model_object_key("inbox_ranking", TITLE_EMBEDDINGS_MODEL_NAME, "2026-08-19", "open.ubj")
- == "inbox_ranking/inbox_ranking_models/v1/title_embeddings/dt=2026-08-19/open.ubj"
+ model_object_key("inbox_ranking", EMBEDDINGS_MODEL_NAME, "2026-08-19", "open.ubj")
+ == "inbox_ranking/inbox_ranking_models/v1/report_embeddings/dt=2026-08-19/open.ubj"
)
@@ -2124,18 +2104,6 @@ def test_every_registered_set_is_reachable_by_the_name_a_model_records(feature_s
assert feature_set_by_name(feature_set.name) is feature_set
-def test_the_two_embedding_families_share_one_recipe():
- # The pair measures the text choice, so everything except the input must match. A budget, grain
- # or width that drifted on one side would make the paired AUC difference read as content.
- report, title = REPORT_EMBEDDINGS_FEATURE_SET, TITLE_EMBEDDINGS_FEATURE_SET
- assert report.extras_keys != title.extras_keys
- for attribute in ("schema_version", "feature_names", "state_columns", "example_grain", "max_examples_per_head"):
- assert getattr(report, attribute) == getattr(title, attribute)
- families = {family.name: family.feature_set for family in MODEL_FAMILIES}
- assert families[TITLE_EMBEDDINGS_MODEL_NAME] is title
- assert families[EMBEDDINGS_MODEL_NAME] is report
-
-
# Before every snapshot the tests build, so a vector counts as present unless a test says otherwise.
LANDED_EARLY = datetime.datetime(2026, 8, 1, tzinfo=datetime.UTC)
# The end of D0, the moment a D0 example or a D0 score is built as of.
@@ -2222,33 +2190,25 @@ def test_a_missing_rendering_is_left_out_while_an_empty_one_keeps_its_key():
# day the family genuinely has nothing to fit, and takes the ordinary thin-input path.
empty = _vector_frame({}).astype({EMBEDDING_COLUMN: object})
- missing_title = _extras_for(
- _snapshot_objects(report_embeddings=_vector_frame({"a": _embedding()}), title_embeddings=None)
- )
- assert set(missing_title) == {REPORT_EMBEDDINGS_EXTRA}
- assert TITLE_EMBEDDINGS_FEATURE_SET.missing_extras(missing_title) == (TITLE_EMBEDDINGS_EXTRA,)
- assert REPORT_EMBEDDINGS_FEATURE_SET.missing_extras(missing_title) == ()
+ missing = _extras_for(_snapshot_objects(report_embeddings=None))
+ assert missing == {}
+ assert REPORT_EMBEDDINGS_FEATURE_SET.missing_extras(missing) == (REPORT_EMBEDDINGS_EXTRA,)
- empty_title = _extras_for(
- _snapshot_objects(report_embeddings=_vector_frame({"a": _embedding()}), title_embeddings=empty)
- )
- assert TITLE_EMBEDDINGS_FEATURE_SET.missing_extras(empty_title) == ()
- assert TITLE_EMBEDDINGS_FEATURE_SET.buildable(_state(["a"]), empty_title).tolist() == [False]
+ empty_snapshot = _extras_for(_snapshot_objects(report_embeddings=empty))
+ assert REPORT_EMBEDDINGS_FEATURE_SET.missing_extras(empty_snapshot) == ()
+ assert REPORT_EMBEDDINGS_FEATURE_SET.buildable(_state(["a"]), empty_snapshot).tolist() == [False]
def test_a_rendering_is_read_only_when_a_set_asks_for_it():
# The examples asset reads one set's inputs at a time, so a family it is not building must not
# pull a fleet-wide vector table across the network.
- objects = _snapshot_objects(
- report_embeddings=_vector_frame({"a": _embedding()}), title_embeddings=_vector_frame({"a": _embedding()})
- )
- assert set(_extras_for(objects, TITLE_EMBEDDINGS_FEATURE_SET.extras_keys)) == {TITLE_EMBEDDINGS_EXTRA}
+ objects = _snapshot_objects(report_embeddings=_vector_frame({"a": _embedding()}))
+ assert set(_extras_for(objects, REPORT_EMBEDDINGS_FEATURE_SET.extras_keys)) == {REPORT_EMBEDDINGS_EXTRA}
assert _extras_for(objects, ()) == {}
-def test_only_the_set_whose_snapshot_is_missing_is_skipped(monkeypatch):
- # One rendering's failed snapshot must cost one family's day. The others have to keep building,
- # or a title-side gap silently stops the combined family the title is measured against.
+def test_a_set_whose_snapshot_is_missing_is_skipped(monkeypatch):
+ # A failed snapshot must leave the family's examples as they stand, not rebuild them from nothing.
module = "products.signals.dags.inbox_ranking.training.dag"
written: list[str] = []
monkeypatch.setattr(f"{module}.skip_unconfigured", lambda context: False)
@@ -2258,7 +2218,7 @@ def test_only_the_set_whose_snapshot_is_missing_is_skipped(monkeypatch):
monkeypatch.setattr(
f"{module}.embeddings_extras",
lambda context, client, bucket, prefix, partition_key, keys: {
- key: _vector_frame({}) for key in keys if key != TITLE_EMBEDDINGS_EXTRA
+ key: _vector_frame({}) for key in keys if key != REPORT_EMBEDDINGS_EXTRA
},
)
@@ -2272,31 +2232,15 @@ def test_only_the_set_whose_snapshot_is_missing_is_skipped(monkeypatch):
inbox_ranking_training_examples(context)
metadata = context.get_output_metadata("result")
- assert written == [REPORT_EMBEDDINGS_FEATURE_SET.name]
- assert metadata[f"{TITLE_EMBEDDINGS_FEATURE_SET.name}_skipped"].value is True
+ assert written == []
+ assert metadata[f"{REPORT_EMBEDDINGS_FEATURE_SET.name}_skipped"].value is True
-def test_both_renderings_snapshots_are_upstream_of_the_examples_that_read_them():
+def test_the_embeddings_snapshot_is_upstream_of_the_examples_that_read_it():
# An asset that reads a snapshot without declaring it can run before the day's snapshot lands
- # and record the family as having no input. One dependency per rendering, so the two renderings
- # are scheduled independently rather than as one edge that either family's failure breaks.
+ # and record the family as having no input.
deps = {key.path[-1] for key in inbox_ranking_training_examples.keys_by_input_name.values()}
- assert {EMBEDDINGS_TABLE, TITLE_EMBEDDINGS_TABLE} <= deps
-
-
-def test_a_rendering_never_falls_back_to_the_other_renderings_vector():
- # The families exist to measure the title against the title plus summary, so a row that took
- # the other rendering's vector would compare the two models on partly the same text. The inputs
- # also diverge in practice: a summary-only edit re-embeds only the combined rendering, and
- # either snapshot can hold a report the other does not.
- rows = _state(["combined_only", "title_only"])
- extras = {
- **_report_vectors({"combined_only": _embedding()}, feature_set=REPORT_EMBEDDINGS_FEATURE_SET),
- **_report_vectors({"title_only": _embedding()}, feature_set=TITLE_EMBEDDINGS_FEATURE_SET),
- }
-
- assert REPORT_EMBEDDINGS_FEATURE_SET.buildable(rows, extras).tolist() == [True, False]
- assert TITLE_EMBEDDINGS_FEATURE_SET.buildable(rows, extras).tolist() == [False, True]
+ assert EMBEDDINGS_TABLE in deps
@pytest.mark.parametrize("feature_set", EMBEDDING_FEATURE_SETS, ids=EMBEDDING_SET_IDS)
@@ -2404,14 +2348,6 @@ def test_reading_a_moment_needs_the_vectors_landing_time(feature_set):
(STATE_FEATURE_SET, NO_EXTRAS, ()),
(REPORT_EMBEDDINGS_FEATURE_SET, _report_vectors({"a": _embedding()}), ()),
(REPORT_EMBEDDINGS_FEATURE_SET, NO_EXTRAS, (REPORT_EMBEDDINGS_EXTRA,)),
- # Each rendering answers for its own input: the other one being present is not its input.
- (
- TITLE_EMBEDDINGS_FEATURE_SET,
- _report_vectors({"a": _embedding()}, feature_set=TITLE_EMBEDDINGS_FEATURE_SET),
- (),
- ),
- (TITLE_EMBEDDINGS_FEATURE_SET, NO_EXTRAS, (TITLE_EMBEDDINGS_EXTRA,)),
- (TITLE_EMBEDDINGS_FEATURE_SET, _report_vectors({"a": _embedding()}), (TITLE_EMBEDDINGS_EXTRA,)),
],
)
def test_a_set_declares_the_side_inputs_it_needs(feature_set, extras, expected):
@@ -2581,8 +2517,7 @@ def test_the_served_family_candidate_is_paired_only_when_it_is_a_second_model(
def test_a_family_with_no_readable_head_is_left_out():
- # The title family has no readable head today. A manifest lists only models a store can load
- # and a reader can judge, so it must not gain an entry the sweep would score blind.
+ # A manifest lists only models a store can load and a reader can judge, so it must not gain an entry the sweep would score blind.
decision = _compose(
[
FamilyModels(
@@ -2594,9 +2529,9 @@ def test_a_family_with_no_readable_head_is_left_out():
name=STATE_MODEL_NAME, candidate=None, champion=_serving_metadata(STATE_MODEL_NAME, "2026-08-10")
),
FamilyModels(
- name=TITLE_EMBEDDINGS_MODEL_NAME,
+ name=NN_MODEL_NAME,
candidate=None,
- champion=_serving_metadata(TITLE_EMBEDDINGS_MODEL_NAME, "2026-08-12", readable=False),
+ champion=_serving_metadata(NN_MODEL_NAME, "2026-08-12", readable=False),
),
]
)
@@ -2979,7 +2914,7 @@ _CANDIDATE_EVENT = {
"model_version": CANDIDATE_VERSION,
"roles": [DAILY_CANDIDATE_ROLE],
}
-_TITLE_EVENT = {"model_name": TITLE_EMBEDDINGS_MODEL_NAME, "model_version": V1, "roles": [CROSS_FAMILY_ROLE]}
+_NN_EVENT = {"model_name": NN_MODEL_NAME, "model_version": V1, "roles": [CROSS_FAMILY_ROLE]}
_SERVED_POOL = ["tie", "low", "legacy_low", "legacy_high", "challenger_only", "late"]
@@ -2995,7 +2930,7 @@ def _served_rows() -> pd.DataFrame:
# The sweep scores the same report with the daily candidate too, under its own model key.
_served_event("tie", "2026-08-10T14:00:00Z", p_open=0.7, **_CANDIDATE_EVENT),
_served_event("tie", "2026-08-10T22:00:00Z", p_open=0.1, **_CANDIDATE_EVENT),
- _served_event("challenger_only", "2026-08-10T13:00:00Z", p_open=0.5, **_TITLE_EVENT),
+ _served_event("challenger_only", "2026-08-10T13:00:00Z", p_open=0.5, **_NN_EVENT),
_served_event("challenger_only", "2026-08-10T14:00:00Z", p_open=0.5, status="skipped", **_V1_EVENT),
# Born before D, so not a newborn of the pool.
_served_event("older", "2026-08-10T13:00:00Z", p_open=0.5, **_V1_EVENT),
@@ -3043,7 +2978,7 @@ def test_served_score_rows_keep_the_earliest_score_of_each_newborn_per_model_key
assert sorted(
zip(others["report_id"], others["model_name"], others["model_version"], others["model_role"], others["score"])
) == [
- ("challenger_only", TITLE_EMBEDDINGS_MODEL_NAME, V1, CROSS_FAMILY_ROLE, 0.5),
+ ("challenger_only", NN_MODEL_NAME, V1, CROSS_FAMILY_ROLE, 0.5),
("tie", REPORT_EMBEDDINGS_MODEL_NAME, CANDIDATE_VERSION, DAILY_CANDIDATE_ROLE, 0.7),
]
metadata = served_metadata(_state(_SERVED_POOL), rows)
@@ -3052,7 +2987,7 @@ def test_served_score_rows_keep_the_earliest_score_of_each_newborn_per_model_key
f"{REPORT_EMBEDDINGS_MODEL_NAME}@{V1}/{SERVED_ROLE}": 2 / 6,
f"{REPORT_EMBEDDINGS_MODEL_NAME}@{V2}/{SERVED_ROLE}": 3 / 6,
f"{REPORT_EMBEDDINGS_MODEL_NAME}@{CANDIDATE_VERSION}/{DAILY_CANDIDATE_ROLE}": 1 / 6,
- f"{TITLE_EMBEDDINGS_MODEL_NAME}@{V1}/{CROSS_FAMILY_ROLE}": 1 / 6,
+ f"{NN_MODEL_NAME}@{V1}/{CROSS_FAMILY_ROLE}": 1 / 6,
}
@@ -3104,7 +3039,7 @@ def test_served_scores_grade_per_version_at_the_threshold_that_was_served(monkey
(REPORT_EMBEDDINGS_MODEL_NAME, V1, SERVED_ROLE),
(REPORT_EMBEDDINGS_MODEL_NAME, V2, SERVED_ROLE),
(REPORT_EMBEDDINGS_MODEL_NAME, CANDIDATE_VERSION, DAILY_CANDIDATE_ROLE),
- (TITLE_EMBEDDINGS_MODEL_NAME, V1, CROSS_FAMILY_ROLE),
+ (NN_MODEL_NAME, V1, CROSS_FAMILY_ROLE),
}
graded = {version: row for (_, version, role), row in graded_by_key.items() if role == SERVED_ROLE}
# The tie is a positive, at the threshold V1 saved at birth.
diff --git a/products/signals/dags/inbox_ranking/training/dag.py b/products/signals/dags/inbox_ranking/training/dag.py
index 7135caf13575..6106ccd1ffbf 100644
--- a/products/signals/dags/inbox_ranking/training/dag.py
+++ b/products/signals/dags/inbox_ranking/training/dag.py
@@ -28,8 +28,7 @@ graded on the same rows, not a competitor for another family's pointer.
Both the candidate and the champion asset walk `families_trained_in(MAIN_LOCATION)`, so each family trains on the
examples of the feature set it declares and decides against its own pointer. A family whose
examples or metadata are missing that day is logged and skipped: its own series has a gap, and
-every other family still trains, promotes and gets graded. The two embedding families read one text
-rendering each, from separate snapshots, so a missing snapshot costs one family and not the pair.
+every other family still trains, promotes and gets graded.
The `nn` family is trained by the `signals_ml` location (`nn/dag.py`) and never here.
Two further assets grade the served models on data no example covers. `inbox_ranking_served_scores`
@@ -62,7 +61,6 @@ from products.signals.backend.ranking.features import (
EMBEDDING_INSERTED_AT_COLUMN,
FEATURE_SETS,
REPORT_EMBEDDINGS_EXTRA,
- TITLE_EMBEDDINGS_EXTRA,
Extras,
FeatureSet,
)
@@ -95,7 +93,6 @@ from products.signals.dags.inbox_ranking.dataset.dag import (
LABELS_TABLE,
PROJECT_VECTORS_TABLE,
STATE_TABLE,
- TITLE_EMBEDDINGS_TABLE,
)
from products.signals.dags.inbox_ranking.training.examples import (
BASE_STATE_COLUMNS,
@@ -279,13 +276,10 @@ def load_snapshots(
return snapshots
-# The dt=D snapshot table behind each embedding side input. One table per rendering, read on its
-# own: a rendering's snapshot can be missing while the other's is present, and the families must
-# not share a fate.
+# The dt=D snapshot table behind each embedding side input, one table per rendering.
_EXTRA_SNAPSHOT_TABLES: Mapping[str, str] = MappingProxyType(
{
REPORT_EMBEDDINGS_EXTRA: EMBEDDINGS_TABLE,
- TITLE_EMBEDDINGS_EXTRA: TITLE_EMBEDDINGS_TABLE,
}
)
@@ -372,10 +366,8 @@ _LOOKBACK_MAPPING = dagster.TimeWindowPartitionMapping(
deps=[
dagster.AssetDep(STATE_TABLE, partition_mapping=_LOOKBACK_MAPPING),
dagster.AssetDep(LABELS_TABLE, partition_mapping=_LOOKBACK_MAPPING),
- # Only dt=D: `embeddings_extras` explains why one snapshot serves the whole window. One
- # dependency per rendering, so a missing title snapshot costs only the title family.
+ # Only dt=D: `embeddings_extras` explains why one snapshot serves the whole window.
EMBEDDINGS_TABLE,
- TITLE_EMBEDDINGS_TABLE,
],
**COMMON_ASSET_KWARGS,
)
diff --git a/products/signals/dags/inbox_ranking/training/unseen.py b/products/signals/dags/inbox_ranking/training/unseen.py
index bbc06015ac0e..ef098cd41137 100644
--- a/products/signals/dags/inbox_ranking/training/unseen.py
+++ b/products/signals/dags/inbox_ranking/training/unseen.py
@@ -22,11 +22,7 @@ from sklearn.metrics import roc_auc_score
from posthog.dataclasses import frozen
-from products.signals.backend.ranking.features import (
- REPORT_EMBEDDINGS_FEATURE_SET,
- TITLE_EMBEDDINGS_FEATURE_SET,
- FeatureSet,
-)
+from products.signals.backend.ranking.features import REPORT_EMBEDDINGS_FEATURE_SET, FeatureSet
from products.signals.backend.ranking.serving_manifest import DEFAULT_MODEL_KIND, ONNX_MODEL_KIND
from products.signals.dags.inbox_ranking.training.calibration import (
CalibrationBucket,
@@ -60,7 +56,6 @@ CANDIDATE_ROLE = "candidate"
# The model family: which features and which learner, as against `model_version`, the partition day
# it was fit on. Both are in the identity, so two families trained on one day stay apart.
REPORT_EMBEDDINGS_MODEL_NAME = "report_embeddings"
-TITLE_EMBEDDINGS_MODEL_NAME = "title_embeddings"
NN_MODEL_NAME = "nn"
# The Dagster code locations that train a family: `signals` on the main image, and `signals_ml` on
# the image that carries torch.
@@ -69,7 +64,7 @@ ML_LOCATION = "signals_ml"
# Families this build no longer trains. Saved scores objects still hold their rows, so every reader
# drops them through `with_model_names`: the grades stop with the family, and the rewrite guard does
# not require rows that no re-run can produce.
-RETIRED_MODEL_NAMES = frozenset({"tabular_xgb"})
+RETIRED_MODEL_NAMES = frozenset({"tabular_xgb", "title_embeddings"})
# A shuffle plus one AUC rather than a refit, so this sits far above the trainer's NULL_PERMUTATIONS.
NULL_PERMUTATIONS = 25
@@ -116,16 +111,11 @@ class ModelFamily:
# The families the training jobs train, in the order they are trained. A
# family with no metadata for the day is skipped, so an entry can be added here before its trainer
# writes its first candidate, and a family that fails costs its own series rather than every one.
-# The two embedding families read one `ReportEmbeddingsFeatureSet` instance each and fit with the
-# same module-level `XGB_PARAMS`, so their width, grain, row budget, sampling, split and booster
-# settings match by construction. Keep it that way: the pair is a measurement of the text choice,
-# and a recipe that differed between them would answer a question nobody asked.
# `nn` is one multi-head network over the report vector and the team's project vectors. It needs
# torch, so the `signals_ml` location trains it and the main location never fits it. It declares
# the report embeddings set, because that set builds its report input in training and at serving.
MODEL_FAMILIES: tuple[ModelFamily, ...] = (
ModelFamily(name=REPORT_EMBEDDINGS_MODEL_NAME, feature_set=REPORT_EMBEDDINGS_FEATURE_SET),
- ModelFamily(name=TITLE_EMBEDDINGS_MODEL_NAME, feature_set=TITLE_EMBEDDINGS_FEATURE_SET),
ModelFamily(
name=NN_MODEL_NAME, feature_set=REPORT_EMBEDDINGS_FEATURE_SET, learner=ONNX_MODEL_KIND, location=ML_LOCATION
),