A concise guide to understanding and optimizing for X's (Twitter's) recommendation algorithm.
Candidate Generation → Feature Hydration → ML Scoring → Filtering → Your Timeline
(~1 billion tweets) (~6,000 features) (probability) (diversity) (~100 tweets)
- Candidate Generation: Fetch ~thousands of tweets from multiple sources
- Feature Hydration: Compute ~6,000 features per tweet
- ML Scoring: Neural networks predict engagement probability
- Filtering: Apply diversity, quality, and safety filters
- Re-ranking: Optimize for diversity and freshness
- Mixing: Combine with ads and recommendations
| Action | Weight | Impact |
|---|---|---|
| 👍 Likes | ⭐⭐⭐⭐⭐ | Very High |
| 🔄 Retweets | ⭐⭐⭐⭐⭐ | Very High |
| 💬 Quote Tweets | ⭐⭐⭐⭐⭐ | Very High |
| ↩️ Replies | ⭐⭐⭐⭐ | High |
| ⭐⭐⭐⭐ | High | |
| 🔍 Clicks | ⭐⭐⭐ | Medium |
| 🔖 Bookmarks | ⭐⭐⭐ | Medium |
| 👤 Profile Visits | ⭐⭐ | Low |
| ❌ "Not Interested" | ⭐⭐⭐⭐⭐ | Very Negative |
| 🚫 Reports | ⭐⭐⭐⭐⭐ | Very Negative |
- ✅ High-quality media (photos, videos)
- ✅ Topic relevance to user interests
- ✅ Clear, compelling text
- ✅ Authentic, original content
- ✅ Recency (newer = better)
- ✅ Follower count (medium impact)
- ✅ Engagement rate (high impact)
- ✅ Account reputation (TweepCred score)
- ✅ Verification (small boost)
- ✅ Posting consistency
- ✅ Direct follows (very high impact)
- ✅ Real Graph score (interaction likelihood)
- ✅ Two-hop connections (friends of friends)
- ✅ Mutual relationships
📝 Tweet Structure:
[Hook - Attention-grabbing first line]
↓
[Context - Brief setup]
↓
[Value - Main insight]
↓
[CTA - Call to action]
↓
[Media - Photo/video if relevant]
✅ Do This:
- Post 1-3 times per day
- Use 1-2 relevant hashtags (not 10)
- Include high-quality images or videos
- Write concise, valuable content
- Respond to replies quickly
- Post when your audience is active
- Create shareable insights
- Be authentic and consistent
❌ Don't Do This:
- Spam (>10 tweets/hour)
- Engagement bait ("RT if you agree!")
- Misleading clickbait
- Excessive hashtags
- All caps or excessive punctuation
- Copy content without credit
- Post low-quality content
- Ignore your community
📷 Images:
- High resolution (1200x675px optimal)
- Clear, relevant visuals
- Include alt-text
- Avoid text-heavy images
🎥 Videos:
- Hook viewers in first 3 seconds
- Keep 30-60 seconds (sweet spot)
- Add captions (most watch muted)
- High completion rate boosts ranking
⏰ Optimal Timing:
- First 30 minutes are CRITICAL
- Weekday mornings (9-11am)
- Weekday afternoons (1-3pm)
- Test your specific audience times
📈 Velocity Matters:
- Fast early engagement = big boost
- Share in relevant communities
- Engage with early responders
- Don't delete and repost
- ~50% of For You timeline
- Tweets from accounts you follow
- No scoring penalty
- Higher baseline ranking
- ~50% of For You timeline
- From accounts you don't follow
- 0.75x score multiplier (25% penalty)
- Must be 33% better to compete
- Requires exceptional quality
Key Insight: To reach beyond your followers, your content must be significantly better than average.
def rank_content(user_id, candidates):
scored = []
for item in candidates:
# Simple scoring
recency = 1.0 / (1 + hours_since_post(item))
engagement = (item.likes + 2*item.retweets + 3*item.replies) / (1 + item.impressions)
relevance = compute_relevance(user_id, item)
score = 0.3*recency + 0.4*engagement + 0.3*relevance
scored.append((item, score))
scored.sort(key=lambda x: x[1], reverse=True)
return [item for item, score in scored[:100]]Author:
- Follower count
- Account age
- Engagement rate
- Reputation score
Content:
- Has media (photo/video)
- Text length
- Topic/category
- Language
Engagement:
- Like count
- Retweet count
- Reply count
- Engagement velocity
User-Content Affinity:
- User follows author
- User topic interest
- Historical engagement
Temporal:
- Hours since post
- Engagement velocity
- Is trending
- Candidate Sources: Multiple retrieval methods (search, graph, ML)
- Feature Store: Fast access to user/content features
- ML Model: Predict engagement probability
- Diversity Filters: Avoid showing too much from one source
- A/B Testing: Experiment and measure
- Engagement Rate = Total Engagements / Impressions
- Reply Rate = Replies / Impressions
- Retweet Rate = Retweets / Impressions
- Video Completion Rate = Watches to End / Total Watches
- Profile Visit Rate = Profile Visits / Impressions
- Precision@K: Relevant items in top K results
- Engagement Rate: User interactions / Impressions
- Diversity: Unique authors/topics in results
- Latency: Time to generate rankings
- User Satisfaction: Retention, time spent
- Home Mixer: Main ranking orchestration
- Earlybird: In-network search index
- UTEG: User-tweet graph recommendations
- TweetMixer: Out-of-network coordination
- FRS: Follow recommendations
- Heavy Ranker: Multi-task neural network (main scorer)
- Light Ranker: Fast pre-ranking model
- Navi: High-performance model serving
- SimClusters: Community detection & embeddings
- TwHIN: Dense knowledge graph embeddings
- Real Graph: User interaction prediction
- TweepCred: PageRank reputation
- Create shareable, valuable content
- Post consistently (same time, same quality)
- Engage authentically with your community
- Use media (especially video)
- Optimize for likes and retweets
- Monitor what works and iterate
- Too much self-promotion
- Posting at random times
- Ignoring replies and mentions
- Using engagement bait tactics
- Inconsistent posting schedule
- Low-quality or irrelevant content
- Copying without attribution
- Overusing hashtags
- Full Guide: TWEET_RANKING_GUIDE.md
- Main README: ../README.md
- Retrieval Signals: ../RETREIVAL_SIGNALS.md
- Home Mixer: ../home-mixer/README.md
The algorithm rewards:
- 👍 Authentic engagement (likes, retweets, replies)
- 🎨 High-quality media
- 💎 Valuable, original content
- 🤝 Meaningful connections
- ⚡ Fast initial engagement
- 📊 Consistent quality
The algorithm penalizes:
- 🚫 Spam and engagement bait
- 👎 Low-quality content
- 😴 Negative feedback signals
- 📉 Inconsistent posting
- 🔇 Ignored community
Bottom line: Create authentic, valuable content that your audience wants to engage with. The algorithm will reward genuine quality.
Last Updated: 2026