RecomNext

ML models

ELSA, ReALM, beeFormer scoring and training.

06 - ML models & training

Scope: ELSA, ReALM, beeFormer as used by recommendation algorithms.
Audience: Analysts who need scoring intuition; PMs who select these algorithms on scenarios.


How ML fits the serving path

If factors/vectors are missing for a user/item, the engine falls back to behavioral defaults so the placement still returns something.


ELSA (elsa-cf) - collaborative filtering

High-level scoring

ELSA is a shallow autoencoder over user–item interaction patterns.

  • User factors: latent vector from the encoder for that user.
  • Item factors: vectors derived from the decoder (item side).

user-to-item: score ≈ dot(user_factor, item_factor) for candidate items (top-K).
item-to-item: score ≈ similarity between seed item factor and other item factors.

Interpretation: items that co-occur in similar user taste patterns rank higher - not content look-alikes.

Training (detail)

AspectBehavior
ArchitectureLinear → SELU → Dropout → Linear
DataExported interactions (+ catalog support)
Warm-startLoad prior checkpoint; resize if item universe grew; fine-tune at ~0.1× LR, ~0.3× epochs
OutputUser + item factors → Mongo model_factors
TriggerOrchestrator threshold (e.g. ≥1000 new interactions) or Admin “Train Now”

When to use

Dense interaction graph, “people like you also liked.” Weak on brand-new items until retrained / until fallback kicks in.

Analyst checks

  • Scenario algorithm = elsa-cf.
  • Training page shows recent successful run.
  • Spot-check: cold user should look like popularity/weighted-history fallback, not random.

ReALM (realm-sequential) - sequential / session

High-level scoring

GRU over the user’s interaction sequence predicts likely next items.

  • Item embeddings + GRU hidden state → ranking over catalog / candidate set.
  • Emphasizes order and recency of path, not only aggregate counts.

user-to-item only in the registry.

Training (detail)

AspectBehavior
ArchitectureGRU + item embeddings → next-item
Warm-startPreserve item indices; merge new events into sequences; resize layers for new items; reduced LR fine-tune
OutputUser (hidden) + item factors → Mongo
TriggerSame orchestrator family as ELSA

When to use

Session-heavy funnels (browse A→B→C). Less ideal if events are sparse or unordered dumps.


beeFormer (beeformer-multimodal) - content similarity

High-level scoring

Content embeddings (text; multimodal pipeline as configured) stored in Qdrant. Serving is nearest-neighbor - same shape as vector-similarity, different embedding space.

Training (detail)

AspectBehavior
Basesentence-transformers style encoder (e.g. MiniLM family)
Warm-startEncode new items only; prune stale
OutputVectors → Qdrant
TriggerOften keyed on new items count (e.g. ≥10)

vs default vector-similarity

Default similar-products uses the online embeddings service / indexing templates. beeFormer uses the training pipeline’s vectors. Pick one intentionally per scenario; don’t assume they are interchangeable without eval.


Orchestrator overview

Typical schedule: daily off-peak. Admin Training page shows status for non-engineers.


PM guidance

GoalPrefer
Works with little ML opsweighted-history / co-occurrence / vector-similarity
Taste similarity from behaviorelsa-cf
Path / session awarerealm-sequential
Richer content similarbeeformer-multimodal (after train+index healthy)

Always pair ML scenarios with sensible filters/constraints and monitor fallback rate indirectly via “does this rail look popular-generic?” for cold users.