On the Mastodon algorithm
Some people will cheerfully tell you that Mastodon is a different kind of social network because it doesn't have an algorithm.
Other people will angrily rail against this, insisting that “sorted in chronological order” is an algorithm, it's the only algorithm, it can't be changed, therefore Mastodon is bad because it doesn't provide any user controls.
Every now and then I get sufficiently annoyed by dumb takes about this to do a write-up. This is one of those times.
Go on then, tell me how people are wrong on the Internet
Both the positions above are wrong because they're lumping two completely different algorithms under the word “algorithm”.
Those algorithms are:
- How does Mastodon select the posts that will appear in your home timeline?
- How are the selected posts displayed?
The “Mastodon has no algorithm” crowd are actually saying “Mastodon has an algorithm, but it's fully controllable by you, nothing will show a post in your timeline that you did not explicitly ask for”.
As best as I can tell the “Mastodon absolutely has an algorithm” crowd don't care about algorithm #1 at all, and are focused on algorithm #2, insisting that “chronological ordering” is an algorithm, so that they have something to be angry online about.
There's a third algorithm too, How is an individual post on the home timeline displayed?, but people hardly ever talk about that one.
Selecting posts for your home timeline
This is the algorithm that actually matters.
You don't need to read the Mastodon code to understand how this works, you can deduce it from observation.
First:
- Include all the top-level posts from people you follow
- Include all the replies from people you follow
- Include all the boosts from people you follow
- Include all the posts containing hashtags you follow
Then:
- Remove replies if the user has requested that
- Remove boosts if the user has requested that
- Remove matching boosts if the user has enabled the “Group boosts in timelines” settings
- Remove posts from users who are actively muted
- Remove posts from users who are blocked
- Remove posts that match the user's filters to hide
That's at least two different ways the user can control what is initially chosen for their home timeline (users and hashtags) and at least six different ways the user can then control whether those posts appear on their timeline.
Displaying posts for your home timeline
The sort algorithm barely matters. It's “sort chronologically, newest first”. This is not modifiable by the user in Mastodon.
Mastodon does provide additional controls for the algorithm that determines how each post within the timeline can be displayed.
You can choose:
- Whether to show media in general
- Whether to show media that the poster marked as “sensitive”
- Whether to automatically expand posts that have a content warning
And for posts that have been filtered at the “warn” level the user can, on a post by post basis, choose to view that post.
So, again, there's an algorithm for how each post is displayed, and the user can make choices that affect how that algorithm behaves.
Caveats
A few caveats about the above because this is the Internet and people will nit-pick to death.
First, it's describing the current observable behaviour of the Mastodon server and default web client.
Second, other clients (both web, and apps) for Mastodon servers exist, and some of those provide further controls on the presentation of your timeline.
For example, the Phanpy web client can
- Display boosts separately to the timeline, in a carousel
- Shows conversations in a threaded view grouped together in one block in the timeline
See Phanpy subtle UI implementations for more on that, including screenshots.
Third, Mastodon-like servers exist; federating with Mastodon servers, supporting the same basic API, but providing their own additional controls over what posts appear in your home timeline.
For example, the glitch-soc server implemented fine-grained post filters before Mastodon did. So for a while, users on a glitch-soc server had more control over their timeline than users on a Mastodon server.
In summary
- Mastodon, and Mastodon-like servers, absolutely have an algorithm they use for selecting the items that make up your home timeline
- The specific client you're using to access your Mastodon server might also provide its own algorithms for displaying the timeline, which you can adjust
- Unlike other social media services (Twitter, Bluesky, Threads, etc), a Mastodon server is extremely transparent about the algorithm selecting the posts for your home timeline, and gives you full control of the parameters used in those decisions.
- Ignore anyone arguing “Mastodon does not have an algorithm”, they lack critical thinking skills
- Ignore anyone arguing “chronological order is an algorithm”. When it comes to social media “How are the posts you see chosen?” is a much more important question than “How are those posts ordered?”. If that's what they're focusing on then they're probably just looking for a reason to be angry about something online.
- “I would like Mastodon to provide a new option X, which would affect how posts are chosen for my home timeline” is an interesting discussion to have. But that would require careful thought, and most people arguing online don't have time for that.