Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    The Download: the rise of luxury car theft, and fighting antimicrobial resistance

    The curious case of the disappearing Lamborghinis

    Meta’s new deal with Nvidia buys up millions of AI chips

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026

      ChatGPT can embrace authoritarian ideas after just one prompt, researchers say

      January 24, 2026
    • Business

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026

      New VoidLink malware framework targets Linux cloud servers

      January 14, 2026

      Nvidia Rubin’s rack-scale encryption signals a turning point for enterprise AI security

      January 13, 2026

      How KPMG is redefining the future of SAP consulting on a global scale

      January 10, 2026

      Top 10 cloud computing stories of 2025

      December 22, 2025
    • Crypto

      Metaplanet Reports FY2025 Results as Bitcoin Unrealized Losses Top $1 Billion

      February 17, 2026

      Crypto’s AI Pivot: Hype, Infrastructure, and a Two-Year Countdown

      February 17, 2026

      The RWA War: Stablecoins, Speed, and Control

      February 17, 2026

      Jeffrey Epstein Emails Show Plans to Meet Gary Gensler To Talk Crypto

      February 17, 2026

      Bitcoin Bounce Fades, Q1 Losses Deepen, and New Price Risk Back in Focus

      February 17, 2026
    • Technology

      The Download: the rise of luxury car theft, and fighting antimicrobial resistance

      February 18, 2026

      The curious case of the disappearing Lamborghinis

      February 18, 2026

      Meta’s new deal with Nvidia buys up millions of AI chips

      February 18, 2026

      Stephen Colbert says CBS banned him from airing this James Talarico interview

      February 18, 2026

      Google’s AI search results will make links more obvious

      February 18, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»X For You Feed Algorithm
    Technology

    X For You Feed Algorithm

    TechAiVerseBy TechAiVerseJanuary 20, 2026No Comments8 Mins Read4 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    X For You Feed Algorithm
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    X For You Feed Algorithm

    X For You Feed Algorithm

    This repository contains the core recommendation system powering the “For You” feed on X. It combines in-network content (from accounts you follow) with out-of-network content (discovered through ML-based retrieval) and ranks everything using a Grok-based transformer model.

    Note: The transformer implementation is ported from the Grok-1 open source release by xAI, adapted for recommendation system use cases.

    Table of Contents

    • Overview
    • System Architecture
    • Components
      • Home Mixer
      • Thunder
      • Phoenix
      • Candidate Pipeline
    • How It Works
      • Pipeline Stages
      • Scoring and Ranking
      • Filtering
    • Key Design Decisions
    • License

    Overview

    The For You feed algorithm retrieves, ranks, and filters posts from two sources:

    1. In-Network (Thunder): Posts from accounts you follow
    2. Out-of-Network (Phoenix Retrieval): Posts discovered from a global corpus

    Both sources are combined and ranked together using Phoenix, a Grok-based transformer model that predicts engagement probabilities for each post. The final score is a weighted combination of these predicted engagements.

    We have eliminated every single hand-engineered feature and most heuristics from the system. The Grok-based transformer does all the heavy lifting by understanding your engagement history (what you liked, replied to, shared, etc.) and using that to determine what content is relevant to you.


    System Architecture

    ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
    │                                    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                                    │
    └─────────────────────────────────────────────────────────────────────────────────────────────┘
    

    Components

    Home Mixer

    Location: home-mixer/

    The orchestration layer that assembles the For You feed. It leverages the CandidatePipeline framework with the following stages:

    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

    The server exposes a gRPC endpoint (ScoredPostsService) that returns ranked posts for a given user.


    Thunder

    Location: thunder/

    An in-memory post store and realtime ingestion pipeline that tracks recent posts from all users. It:

    • Consumes post create/delete events from Kafka
    • Maintains per-user stores for original posts, replies/reposts, and video posts
    • Serves “in-network” post candidates from accounts the requesting user follows
    • Automatically trims posts older than the retention period

    Thunder enables sub-millisecond lookups for in-network content without hitting an external database.


    Phoenix

    Location: phoenix/

    The ML component with two main functions:

    1. Retrieval (Two-Tower Model)

    Finds relevant out-of-network posts:

    • User Tower: Encodes user features and engagement history into an embedding
    • Candidate Tower: Encodes all posts into embeddings
    • Similarity Search: Retrieves top-K posts via dot product similarity

    2. Ranking (Transformer with Candidate Isolation)

    Predicts engagement probabilities for each candidate:

    • Takes user context (engagement history) and candidate posts as input
    • Uses special attention masking so candidates cannot attend to each other
    • Outputs probabilities for each action type (like, reply, repost, click, etc.)

    See phoenix/README.md for detailed architecture documentation.


    Candidate Pipeline

    Location: candidate-pipeline/

    A reusable framework for building recommendation pipelines. 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)

    The framework runs sources and hydrators in parallel where possible, with configurable error handling and logging.


    How It Works

    Pipeline Stages

    1. Query Hydration: Fetch the user’s recent engagements history and metadata (eg. following list)

    2. Candidate Sourcing: Retrieve candidates from:

      • Thunder: Recent posts from followed accounts (in-network)
      • Phoenix Retrieval: ML-discovered posts from the global corpus (out-of-network)
    3. Candidate Hydration: Enrich candidates with:

      • Core post data (text, media, etc.)
      • Author information (username, verification status)
      • Video duration (for video posts)
      • Subscription status
    4. Pre-Scoring Filters: Remove posts that are:

      • Duplicates
      • Too old
      • From the viewer themselves
      • From blocked/muted accounts
      • Containing muted keywords
      • Previously seen or recently served
      • Ineligible subscription content
    5. Scoring: Apply multiple scorers sequentially:

      • Phoenix Scorer: Get ML predictions from the Phoenix transformer model
      • Weighted Scorer: Combine predictions into a final relevance score
      • Author Diversity Scorer: Attenuate repeated author scores for diversity
      • OON Scorer: Adjust scores for out-of-network content
    6. Selection: Sort by score and select the top K candidates

    7. Post-Selection Processing: Final validation of post candidates to be served


    Scoring and Ranking

    The Phoenix Grok-based transformer model predicts probabilities for multiple engagement types:

    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 combines these into a final score:

    Final Score = Σ (weight_i × P(action_i))
    

    Positive actions (like, repost, share) have positive weights. Negative actions (block, mute, report) have negative weights, pushing down content the user would likely dislike.


    Filtering

    Filters run at two stages:

    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

    Post-Selection Filters:

    Filter Purpose
    VFFilter Remove posts that are deleted/spam/violence/gore etc.
    DedupConversationFilter Deduplicate multiple branches of the same conversation thread


    Key Design Decisions

    1. No Hand-Engineered Features

    The system relies entirely on the Grok-based transformer to learn relevance from user engagement sequences. No manual feature engineering for content relevance. This significantly reduces the complexity in our data pipelines and serving infrastructure.

    2. Candidate Isolation in Ranking

    During transformer inference, candidates cannot attend to each other—only to the user context. This ensures the score for a post doesn’t depend on which other posts are in the batch, making scores consistent and cacheable.

    3. Hash-Based Embeddings

    Both retrieval and ranking use multiple hash functions for embedding lookup

    4. Multi-Action Prediction

    Rather than predicting a single “relevance” score, the model predicts probabilities for many actions.

    5. Composable Pipeline Architecture

    The candidate-pipeline crate provides a flexible framework for building recommendation pipelines with:

    • Separation of pipeline execution and monitoring from business logic
    • Parallel execution of independent stages and graceful error handling
    • Easy addition of new sources, hydrations, filters, and scorers

    License

    This project is licensed under the Apache License 2.0. See LICENSE for details.

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleChatbot Psychosis
    Next Article UAE signs Pax Silica declaration to advance AI-era security
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    The Download: the rise of luxury car theft, and fighting antimicrobial resistance

    February 18, 2026

    The curious case of the disappearing Lamborghinis

    February 18, 2026

    Meta’s new deal with Nvidia buys up millions of AI chips

    February 18, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025683 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025265 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025155 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025114 Views
    Don't Miss
    Technology February 18, 2026

    The Download: the rise of luxury car theft, and fighting antimicrobial resistance

    The Download: the rise of luxury car theft, and fighting antimicrobial resistance Across the world,…

    The curious case of the disappearing Lamborghinis

    Meta’s new deal with Nvidia buys up millions of AI chips

    Stephen Colbert says CBS banned him from airing this James Talarico interview

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    The Download: the rise of luxury car theft, and fighting antimicrobial resistance

    February 18, 20260 Views

    The curious case of the disappearing Lamborghinis

    February 18, 20260 Views

    Meta’s new deal with Nvidia buys up millions of AI chips

    February 18, 20260 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.