コンテンツテーブル Overview System Architecture Components Home Mixer Thunder Phoenix Candidate Pipeline How It Works Pipeline Stages Scoring and Ranking Filtering Key Design Decisions 概要 The For You feed algorithm retrieves, ranks, and filters posts from two sources. For You feed algorithm retrieves, ranks, and filters posts from two sources. For You feed algorithm retrieves, ranks, and filters posts from two sources. In-Network (Thunder): You follow posts from accounts. あなたがフォローしているアカウントからの投稿 Out-of-Network (Phoenix Retrieval):グローバルなコルプスから発見された投稿 両方のソースは組み合わせられ、使用してランク付けされます。 , Grok ベースのトランスフォーマーモデルで、各ポストの関与確率を予測します. The final score is a weighted combination of these predicted engagements. Phoenix Grok ベースのトランスフォーマーは、あなたの婚約履歴 (あなたが気に入ったこと、回答したこと、共有したことなど) を理解して、どのようなコンテンツがあなたに関連しているかを決定するためにそれを使用します。 システム建築 ┌─────────────────────────────────────────────────────────────────────────────────────────────┐ │ FOR YOU FEED REQUEST │ └─────────────────────────────────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐ │ HOME MIXER │ │ (Orchestration Layer) │ ├─────────────────────────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ QUERY HYDRATION │ │ │ │ ┌──────────────────────────┐ ┌──────────────────────────────────────────────┐ │ │ │ │ │ User Action Sequence │ │ User Features │ │ │ │ │ │ (engagement history) │ │ (following list, preferences, etc.) │ │ │ │ │ └──────────────────────────┘ └──────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ CANDIDATE SOURCES │ │ │ │ ┌─────────────────────────────┐ ┌────────────────────────────────┐ │ │ │ │ │ THUNDER │ │ PHOENIX RETRIEVAL │ │ │ │ │ │ (In-Network Posts) │ │ (Out-of-Network Posts) │ │ │ │ │ │ │ │ │ │ │ │ │ │ Posts from accounts │ │ ML-based similarity search │ │ │ │ │ │ you follow │ │ across global corpus │ │ │ │ │ └─────────────────────────────┘ └────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ HYDRATION │ │ │ │ Fetch additional data: core post metadata, author info, media entities, etc. │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ FILTERING │ │ │ │ Remove: duplicates, old posts, self-posts, blocked authors, muted keywords, etc. │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ SCORING │ │ │ │ ┌──────────────────────────┐ │ │ │ │ │ Phoenix Scorer │ Grok-based Transformer predicts: │ │ │ │ │ (ML Predictions) │ P(like), P(reply), P(repost), P(click)... │ │ │ │ └──────────────────────────┘ │ │ │ │ │ │ │ │ │ ▼ │ │ │ │ ┌──────────────────────────┐ │ │ │ │ │ Weighted Scorer │ Weighted Score = Σ (weight × P(action)) │ │ │ │ │ (Combine predictions) │ │ │ │ │ └──────────────────────────┘ │ │ │ │ │ │ │ │ │ ▼ │ │ │ │ ┌──────────────────────────┐ │ │ │ │ │ Author Diversity │ Attenuate repeated author scores │ │ │ │ │ Scorer │ to ensure feed diversity │ │ │ │ └──────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ SELECTION │ │ │ │ Sort by final score, select top K candidates │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ FILTERING (Post-Selection) │ │ │ │ Visibility filtering (deleted/spam/violence/gore etc) │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐ │ RANKED FEED RESPONSE │ └─────────────────────────────────────────────────────────────────────────────────────────────┘ 成分 HOME ミキサー Location: home-mixer/ For You feed をセットアップするオーケストラレーション レイヤー。 以下の段階を含む枠組み: CandidatePipeline Stage Description Query Hydrators Fetch user context (engagement history, following list) Sources Retrieve candidates from Thunder and Phoenix Hydrators Enrich candidates with additional data Filters Remove ineligible candidates Scorers Predict engagement and compute final scores Selector Sort by score and select top K Post-Selection Filters Final visibility and dedup checks Side Effects Cache request info for future use ハイドレーター Query Fetch user context (engagement history, following list) 源泉 「Thunder and Phoenix」の検索結果 ハイドレーター 追加データで候補者を豊かに フィルター 不適切な候補者削除 スコア 関与を予測し、最終スコアを計算する 選択者 スコア順に Sort by score and select top K 選択後のフィルター Final Visibility and Dedup Checks(最終的可視性とデダップチェック) 副作用 Cache request information for future use (将来の使用のためのキャッシュ要請情報) サーバーがgRPCエンドポイントを露出する( )は、特定のユーザーのためのランクアップされた投稿を返します。 ScoredPostsService Thunder Location: thunder/ すべてのユーザーからの最近の投稿を追跡するメモリーポストストストアとリアルタイムの摂取パイプライン。 Consumes post create/delete events from カフカ オリジナル投稿、回答/リポスト、およびビデオ投稿のユーザーごとのストアを維持 リクエストするユーザーがフォローするアカウントから「ネットワーク内」の投稿候補を提供します。 保存期間より古い投稿を自動的に削除 Thunder は、外部データベースをタップすることなく、ネットワーク内のコンテンツのサブミリ秒検索を可能にします。 フェニックス Location: phoenix/ 2つの主な機能を持つMLコンポーネント: The ML component with two main functions: リトリバル(Two-Tower Model) ネットワーク外の関連記事: User Tower: User Features and Engagement History を embedding にエンコードする Candidate Tower: Encodes all posts into embeddings. Candidate Tower: Encodes all posts into embeddings. Candidate Tower: Encodes all posts into embeddings. Similarity Search: Retrieves top-K posts via dot product similarity. トップページ ランキング(Transformer with Candidate Isolation) 各候補者の参加確率を予測する: ユーザーの文脈(関与履歴)と候補者の投稿を入力として取る 特別な注意を払う仮面を使用して、候補者がお互いに会うことができない 各アクションタイプの出力確率(例えば、返信、リポスト、クリックなど) こちら 詳細な建築文書 phoenix/README.md 候補パイプライン Location: candidate-pipeline/ 推奨パイプラインを構築するための再利用可能なフレームワーク. Defines traits for: Trait Purpose Source Fetch candidates from a data source Hydrator Enrich candidates with additional features Filter Remove candidates that shouldn't be shown Scorer Compute scores for ranking Selector Sort and select top candidates SideEffect Run async side effects (caching, logging) Source Fetch candidates from a data source (データ源から候補者を送信) Hydrator 追加機能で候補者を豊かにする Filter 表示されない候補者を削除 Scorer ランキングの計算結果 Selector トップ候補者選出・選出 SideEffect Async Side Effects(キャッシュ、ログ) フレームワークは、可能な限り、構成可能なエラー処理とログ化で、源と水分補給器を並行して実行します。 どのように機能する パイプラインステージ Query Hydration: ユーザーの最近のコミットメントの履歴とメタデータを収集します(たとえば、次のリスト) : Retrieve candidates from: Candidate Sourcing : Recent posts from followed accounts (in-network) Thunder : ML-discovered posts from the global corpus (out-of-network) Phoenix Retrieval : Enrich candidates with: Candidate Hydration Core post data (text, media, etc.) Author information (username, verification status) Video duration (for video posts) Subscription status : Remove posts that are: Pre-Scoring Filters Duplicates Too old From the viewer themselves From blocked/muted accounts Containing muted keywords Previously seen or recently served Ineligible subscription content : Apply multiple scorers sequentially: Scoring : Get ML predictions from the Phoenix transformer model Phoenix Scorer : Combine predictions into a final relevance score Weighted Scorer : Attenuate repeated author scores for diversity Author Diversity Scorer : Adjust scores for out-of-network content OON Scorer 選定:スコアにより分類し、トップK候補を選択 Post-Selection Processing: Final Validation of Post Candidates to be Served ポスト候補の最終認定 スコアリング&ランキング Phoenix Grok ベースのトランスフォーマーモデルは、複数の関与型の確率を予測します。 Predictions: ├── P(favorite) ├── P(reply) ├── P(repost) ├── P(quote) ├── P(click) ├── P(profile_click) ├── P(video_view) ├── P(photo_expand) ├── P(share) ├── P(dwell) ├── P(follow_author) ├── P(not_interested) ├── P(block_author) ├── P(mute_author) └── P(report) THE これらを最後のスコアにまとめます: Weighted Scorer Final Score = Σ (weight_i × P(action_i)) ポジティブなアクション(例えば、リポスト、シェア)にはポジティブな重みがあります。ネガティブなアクション(ブロック、ムート、レポート)にはネガティブな重みがあります。 フィルター フィルターは2段階で実行されます。 Pre-Scoring Filters: Filter Purpose DropDuplicatesFilter Remove duplicate post IDs CoreDataHydrationFilter Remove posts that failed to hydrate core metadata AgeFilter Remove posts older than threshold SelfpostFilter Remove user's own posts RepostDeduplicationFilter Dedupe reposts of same content IneligibleSubscriptionFilter Remove paywalled content user can't access PreviouslySeenPostsFilter Remove posts user has already seen PreviouslyServedPostsFilter Remove posts already served in session MutedKeywordFilter Remove posts with user's muted keywords AuthorSocialgraphFilter Remove posts from blocked/muted authors DropDuplicatesFilter Duplicate Post ID を削除する CoreDataHydrationFilter コアメタデータを水分化できなかった投稿を削除する AgeFilter Thresholdより古い投稿を削除する SelfpostFilter ユーザー自身の投稿を削除する RepostDeduplicationFilter Dedupe reposts of the same content (同じコンテンツの再投稿) IneligibleSubscriptionFilter Paywalled コンテンツの削除 ユーザーがアクセスできない PreviouslySeenPostsFilter Remove posts user has already seen ユーザーが既に見た投稿を削除 PreviouslyServedPostsFilter セッション中に既に配信された投稿を削除する MutedKeywordFilter User's muted keywords を削除する AuthorSocialgraphFilter blocked/muted authors からの投稿を削除する Post-Selection Filters: Filter Purpose VFFilter Remove posts that are deleted/spam/violence/gore etc. DedupConversationFilter Deduplicate multiple branches of the same conversation thread VFFilter 削除された投稿/スパム/暴力/上等を削除する DedupConversationFilter Deduplicate multiple branches of the same conversation thread. 同じ会話のトレードの複数のブランド Key Design Decisions 1. ハンドエンジニアリング機能なし システムは完全にGrokベースのトランスフォーマーに依存し、ユーザーの関与のシーケンスから関連性を学びます。コンテンツ関連のためのマニュアル機能エンジニアリングはありません。 Candidate Isolation in Ranking(ランキング) Transformer inference では、候補者はユーザーコンテキストにのみ関わることができません. This ensures the score for a post does not depend on which other posts are in the batch, making scores consistent and cacheable. 3.ハッシュベースの組み込み リクエストとランキングの両方で、複数のハッシュ機能を使用して検索を埋め込む 4.多動作予測 単一の「関連性」のスコアを予測するのではなく、このモデルは多くのアクションの確率を予測します。 5.コンポジティブパイプラインアーキテクチャ THE crate は、以下を含む推奨パイプラインの構築のための柔軟な枠組みを提供します。 candidate-pipeline パイプラインの実行とモニタリングのビジネス論理の分離 独立した段階の並行実行と優雅なエラー処理 新たな源、水分、フィルター、スコアの容易な追加 注:トランスフォーマーの実装は、recommendation system usage cases に適応した xAI による Grok-1 オープンソースリリースから移行されています。 トランスフォーマーの実装は、 xAIによって、推奨システムの使用ケースに適応しました。 Note: Grok-1 Open Source リリース Grok-1 Open Source リリース このプロジェクトは、Apache License 2.0 でライセンスを受けています。 このプロジェクトは、Apache License 2.0 でライセンスを受けています。