{"id":38940,"date":"2023-04-03T14:00:57","date_gmt":"2023-04-03T18:00:57","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=38940"},"modified":"2023-04-24T08:00:39","modified_gmt":"2023-04-24T12:00:39","slug":"twitters-recommendation-algorithm","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/04\/03\/twitters-recommendation-algorithm\/","title":{"rendered":"Twitter&rsquo;s Recommendation Algorithm"},"content":{"rendered":"<p><a href=\"https:\/\/blog.twitter.com\/en_us\/topics\/company\/2023\/a-new-era-of-transparency-for-twitter\">Twitter<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=35391465\">Hacker News<\/a>, <a href=\"https:\/\/news.slashdot.org\/story\/23\/03\/31\/195248\/twitter-opens-much-of-its-source-code-to-the-global-community\">Slashdot<\/a>):<\/p>\n<blockquote cite=\"https:\/\/blog.twitter.com\/en_us\/topics\/company\/2023\/a-new-era-of-transparency-for-twitter\">\n<p>At <a href=\"https:\/\/blog.twitter.com\/en_us\/topics\/company\/2022\/twitter-2-0-our-continued-commitment-to-the-public-conversation\">Twitter 2.0<\/a>, we believe that we have a responsibility, as the town square of the internet, to make our platform transparent. So today we are taking the first step in a new era of transparency and opening much of our source code to the global community.<\/p>\n<p>[&#8230;]<\/p>\n<p>We also took additional steps to ensure that user safety and privacy would be protected, including our decision not to release training data or model weights associated with the Twitter algorithm at this point.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/blog.twitter.com\/engineering\/en_us\/topics\/open-source\/2023\/twitter-recommendation-algorithm\">Twitter<\/a> (<a href=\"https:\/\/twitter.com\/elonmusk\/status\/1641680913661607936\">tweet<\/a>, <a href=\"https:\/\/news.ycombinator.com\/item?id=35391433\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/blog.twitter.com\/engineering\/en_us\/topics\/open-source\/2023\/twitter-recommendation-algorithm\">\n<p>Twitter aims to deliver you the best of what&rsquo;s happening in the world right now. This requires a recommendation algorithm to distill the roughly 500 million Tweets posted daily down to a handful of top Tweets that ultimately show up on your device&rsquo;s <b>For You<\/b> timeline. This blog is an introduction to how the algorithm selects Tweets for your timeline.<\/p>\n<p>[&#8230;]<\/p>\n<p>The foundation of Twitter&rsquo;s recommendations is a set of core models and features that extract latent information from Tweet, user, and engagement data. These models aim to answer important questions about the Twitter network, such as, <i>&ldquo;What is the probability you will interact with another user in the future?&rdquo;<\/i> or, <i>&ldquo;What are the communities on Twitter and what are trending Tweets within them?&rdquo;<\/i> Answering these questions accurately enables Twitter to deliver more relevant recommendations.<\/p> \n<p>The recommendation pipeline is made up of three main stages that consume these features:&nbsp;<\/p> \n<ol> \n <li>Fetch the best Tweets from different recommendation sources in a process called <b>candidate sourcing<\/b>.<\/li> \n <li><b>Rank<\/b> each Tweet using a machine learning model.<\/li> \n <li>Apply<b> heuristics and filters<\/b>, such as filtering out Tweets from users you&rsquo;ve blocked, NSFW content, and Tweets you&rsquo;ve already seen.<\/li> \n<\/ol> \n<\/blockquote>\n\n<p>The (mostly Scala) code is <a href=\"https:\/\/github.com\/twitter\/the-algorithm\">here<\/a>.<\/p>\n\n<p><a href=\"https:\/\/mastodon.social\/@danluu\/110119479819025418\">Dan Luu<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@danluu\/110119479819025418\"><p>The new stuff in the Twitter algorithm is wild. <\/p><p>&ldquo;author_is_elon&rdquo;, &ldquo;author_is_republican&rdquo;, &ldquo;author_is_democrat&rdquo;, etc., are explicit terms that are special cased.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/aakashg0\/status\/1641976892885540865\">Aakash Gupta<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/aakashg0\/status\/1641976892885540865\"><ol><li><p>Likes, then retweets, then replies<\/p><p>Here&rsquo;s the ranking parameters:<\/p><ul><li>Each like gets a 30x boost<\/li><li>Each retweet a 20x<\/li><li>Each reply only 1x<\/li><\/ul><p>It&rsquo;s much more impactful to earn likes and retweets than replies.<\/p><\/li><li><p>Images &amp; videos help<\/p><p>Both images and videos lead to a nice 2x boost.<\/p><\/li><li><p>Links hurt, unless you have enough engagement<\/p><p>Generally external links get you marked as spam.<\/p><\/li><\/ol><\/blockquote>\n\n<p><a href=\"https:\/\/512pixels.net\/2023\/03\/twitters-algorithm-is-on-github\/\">Stephen Hackett<\/a>:<\/p>\n<blockquote cite=\"https:\/\/512pixels.net\/2023\/03\/twitters-algorithm-is-on-github\/\">\n<p>There were some very funny things in there that have now been deleted, but as of this writing, <a href=\"https:\/\/github.com\/twitter\/the-algorithm\/issues\/236\">this one remains,<\/a> as does one <a href=\"https:\/\/github.com\/twitter\/the-algorithm\/issues\/93\">requesting a printed version of the repository<\/a>.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/defcon.social\/@mysk\/110120004347140143\">Mysk<\/a>:<\/p>\n<blockquote cite=\"https:\/\/defcon.social\/@mysk\/110120004347140143\">\n<p>What is this WTF thing that Twitter's algorithm refers to?<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/defcon.social\/@mysk\/110120068752801346\">Mysk<\/a>:<\/p>\n<blockquote cite=\"https:\/\/defcon.social\/@mysk\/110120068752801346\">\n<p>Things no longer restricted on Twitter<\/p>\n<\/blockquote>\n\n<p id=\"twitters-recommendation-algorithm-update-2023-04-04\">Update (2023-04-04): <a href=\"https:\/\/defcon.social\/@mysk\/110136028938231244\">Mysk<\/a>:<\/p>\n<blockquote cite=\"https:\/\/defcon.social\/@mysk\/110136028938231244\"><p>Oh, the number of unfollows might result in &ldquo;shadow-banning&rdquo; a Twitter account.  The Twitter algorithm shadow-bans an account based on these 5 negative signals:<\/p><p>1- Blocks<br \/>\n2- Mutes<br \/>\n3- Abuse reports<br \/>\n4- Spam reports<br \/>\n5- Unfollows<\/p><\/blockquote>\n\n<p id=\"twitters-recommendation-algorithm-update-2023-04-24\">Update (2023-04-24): <a href=\"https:\/\/knightcolumbia.org\/blog\/twitter-showed-us-its-algorithm-what-does-it-tell-us\">Arvind Narayanan<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=35519224\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/knightcolumbia.org\/blog\/twitter-showed-us-its-algorithm-what-does-it-tell-us\">\n<p>It turns out to be a standard engagement prediction algorithm of the kind most major platforms use; I explained how these algorithms work in a recent <a href=\"https:\/\/knightcolumbia.org\/content\/understanding-social-media-recommendation-algorithms\">essay<\/a>. The source code release makes for an interesting case study of social media transparency. Let&rsquo;s talk about what the code does and doesn&rsquo;t reveal, from the perspective of trying to understand information propagation and algorithmic amplification on social media.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Twitter (Hacker News, Slashdot): At Twitter 2.0, we believe that we have a responsibility, as the town square of the internet, to make our platform transparent. So today we are taking the first step in a new era of transparency and opening much of our source code to the global community. [&#8230;] We also took [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-04-03T18:00:59Z","apple_news_api_id":"c52371d5-b007-46f6-862d-b61b910b45a8","apple_news_api_modified_at":"2023-04-24T12:00:42Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAg==","apple_news_api_share_url":"https:\/\/apple.news\/AxSNx1bAHRvaGLbYbkQtFqA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[1351,74,71,548,49,96],"class_list":["post-38940","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-artificial-intelligence","tag-opensource","tag-programming","tag-scala","tag-twitter","tag-web"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=38940"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38940\/revisions"}],"predecessor-version":[{"id":39142,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38940\/revisions\/39142"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=38940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=38940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=38940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}