I'm not the author of this code, but I've been maintaining it for a while. This is a great writeup. I'm pretty sure it's based on the Reddit link ranking algorithm, which was well-described by Evan Miller here and in a followup.
It would be great to see a similar writeup and simulator for comment ranking ("confidence"), which is a different algorithm. It's been tinkered with a lot over the years. I'm not sure it makes much sense anymore, and I'm pretty sure the tag weighting is just applied wrong with addition instead of multiplication. And I covet a very clever HN feature for getting attention to new threads where (at least for the first couple days) the threads are sorted best-first, but with the newest interleaved, so it goes (newest comment, top thread, 2nd newest comment, 2nd thread, etc). We haven't seen the unfortunate Reddit gaming of "hijacking the top comment to say..." but I'd like to encourage late comments more. (This is also why /active is next to the logo.)
I'm open to improvements on these. One big difference between us and Reddit/HN is that we don't have downvotes to indicate disagreement. jcs required that downvoters pick a from a list of predetermined reasons, but the familiar UI didn't work out. Commenters can see the flags on their comments, so we had a lot of discussions immediately distracted into meta conversations about why a comment was flagged. I changed the UI to move it from a down arrow over to "flagging" and spent a lot of time emphasizing in comments and messages that it should be used for things that need mod attention rather than disagreeing. Even a pretty recent change to enforce that users can reply to or flag a comment but not both (stream 1 and 2).
I'm also open to improvements on improving the tone and quality of conversations, though that's harder to nudge than a couple lines of javascript.
the threads are sorted best-first, but with the newest interleaved
May I once again push my suggestion to calculate the "bestness" of a thread using the recursive number of upvotes of all its (sub)comments instead of just the upvotes of the root comment?
(sorry, but I did not decide to look at the code, so just offering my observations below)
The biggest issue I as a commenter notice is the perennial "fastest gun in the west problem". In fact, I didn't even realize that Lobsters interleaved best and new comments on threads; is the order actually "first best, first newest, second best, ..."? In this thread, for example, I see your comment at the top and @Forty-Bot's comment (which is "first best, second best" unless I'm mistaken --- is there perhaps some hiding done if you are the one who made the newest comment?).
I know you say that "We haven't seen the unfortunate Reddit gaming of 'hijacking the top comment to say...'..." but I definitely have found myself post a reply to the discussion in the top comment which is debatably better served as a top-level comment (sometimes I do both and link to the top-level comment). Analyzing my own behavior, I find I want to be where the discussion is at --- and sometimes that ends up being in the children of one of the top-level comments.
Also (again anecdotally) early snark seems to have a much higher chance of ending up as the top-voted comment, whereas later snark is more likely to stagnate.
IMO the biggest issue with fast replies is that upvotes beget more upvotes (ditto for comments). I noticed that there is some sort of initial hiding of karma on posts with low votes; I wonder if this could apply to all comments regardless of karma? I unfortunately have to leave (otherwise my reply would be a lot longer with other ideas and comments), so this is more a collection of hurried thoughts and a "seconded" to your request for more discussion on comment ranking.
I'm also open to improvements on improving the tone and quality of conversations, though that's harder to nudge than a couple lines of javascript.
Though I don't use the site nowadays, I really like the first sentence of Reddiquette.
Remember the human. When you communicate online, all you see is a computer screen. When talking to someone you might want to ask yourself "Would I say it to the person's face?"
I am calling the bluffs of all the self-proclaimed blunt, socially awkward, or whatever else communicators: there are many things I see said here that you simply would not say to someone else's face. I am a firm believer that disagreement is not a reason to be unkind; put differently, you can always say what you want to say in a way that conveys good intentions. And for all the know-it-alls, if you're so sure that you are right, you should be excited by the opportunity to teach, not preach.
I might be on this site way too much, but I read most comments from the /comments page, and only sometimes do I directly jump to that comment to get the context. In other words, the sorting of the top-level comments within a submission's comment tree is relatively unimportant to me. I probably didn't even realize that they differ from time to time.
Thanks for sharing those Reddit algorithm links. They look very interesting. I may also attempt a follow-up post for the lobsters commenting algorithm, but no promises there (:
I'm also open to improvements on improving the tone and quality of conversations, though that's harder to nudge than a couple lines of javascript.
I'm honestly not sure what might help here at this point, but it's definitely not an algorithmic solution. I can't think of how this can be solved by a handful of moderation practices either without being too heavy-handed.
If more of the silent majority of lurkers engage in kind and substantive ways, that can definitely improve the quality of discourse and the experience of using this site. As with most sites, what gets posted and discussed here is often the result of 1% of the minority that is most engaged, and that character ends up defining the whole community. It doesn't take a lot of people coming out of the lurk-zone to shift this.
I've given up on the front page algorithm. Popular stories stay on top for way too long before getting demoted. It's common for a story to stay on the front page for days, and it's pretty annoying to have to scroll past the same story for the 3rd or 4th time. At this point I only browse new, which frustratingly takes two clicks to get to from the front page.
Popular stories stay on top for way too long before getting demoted. It's common for a story to stay on the front page for days.
This is what attracts me to Lobsters and makes me prefer it over HN. Stories on Lobsters have time to "breath": people from different timezones have time to see them, contribute to them, have meaningful back-and-forth discussions going over days.
In HN a post has a 10 to 30 minutes window to make to the top. Stories move so fast that there is now a European HN and an American HN (and to a lesser extent an Asia/Australia HN), where non overlapping groups of people superficially engage for a few hours before moving on to the next story on the front page.
Is that really the algorithm? I think the site just moves more slowly, there aren't that many new posts. Unfiltered /newest often shows posts that are over 24 hours old and if you have some tags filtered it can easily go back several days.
I generally only hide posts that I find repulsive (but that commentators here love to comment on). I not infrequently use the search bar to look for posts, so I don't want to intentionally degrade my search results. Sometimes posts have great technical content, but overstay their welcome.
As far as I can tell, hiding a post only dims it in the search results. It doesn't remove it. I tested this by looking at my personal list of hidden stories (you can view yours here: https://lobste.rs/hidden ) and searching using terms that would definitely match those posts. They showed up, but in a slightly dimmer color than the other posts.
So if that's the only reason you're not using "hide" to help get stories off your front page, it may well be a non-issue.
I read HN like that, I filter out everything below some score, and sort the rest by date, so as soon as I hit a known title, I know I can stop reading.
Authors submitting their own content get a tiny boost, which is mildly surprising given the otherwise strict self-promo rules.
I had an initial surprise as well upon reading this in your article, but I think it makes sense only because of the self-promo rules. I am more inclined to read stories that are self-submitted, after all. It's a treat getting to ask the author questions or reply to their post.
Yet, my experience on the website has been far from ideal. For me, this is rooted in a disconnect of values with the group most engaged on the site, whose votes and discussions drive the climate. ... Studying the algorithm has shown me that disengaging would make my problem worse—a single user's participation can be worth a lot.
I am sorry you feel that way and I indeed hope you engage more. I find myself on the less popular side of various culture wars fought here sometimes and it really does seem like a futile effort trying to justify my position (and likewise, sometimes I have to stop myself feeling emboldened when I know my opinion is shared). Know that there are those of us who read and upvote dissenting opinions --- and that there are those of us who still value your opinion even if we do not agree with it.
I find myself on the less popular side of various culture wars fought here sometimes and it really does seem like a futile effort trying to justify my position (and likewise, sometimes I have to stop myself feeling emboldened when I know my opinion is shared).
I thought this section in the guidelines captures it well:
Climate: Lobsters is more of a garden party than a debate club. We're learning things we didn't know to be curious about and sharing what we've made. Disagreements are normal but fights are not; it's OK to make your point, share a resource, and let someone be wrong. Abuse and bigotry are unwelcome.
Conversations on this site unfortunately get veered to the framing of taking a position and defending/justifying it. I'd like more people to look beyond "wars" (cultural or otherwise) and being on some side of it. I sincerely believe even relatively contentious topics are better dealt with a sense of lightness and curiosity. We should try to learn more from each other. This also applies to myself. I want to engage with commenters, actively hoping that the interactions would teach me something.
I read the guidelines years ago, but I must confess that I often forget some of the guidelines offered by the site. Maybe it could be an optional/mandatory feature that you'll every N months get a quiz from the guidelines before you can access the site again.
Really neat analysis and visualisation. I have been thinking about the ranking algorithm recently for a potential side project, so I had a dig through the maths. I actually think there's a small inaccuracy which traces back to some redundant code, although it's possible that I have misunderstood something.
The sign negates the effect of comment upvotes when the story scores zero, and make them contribute negatively to the rank when the story scores below zero.
As far as I can tell, the sign parameter doesn't do anything! The variable is intended to flip the sign of order if score is negative. However, if score is negative:
cpoints <= score (because cpoints is the minimum of score and another value), and therefore |score| <= |cpoints|
|score + 1| < |score| (score is a count of votes, so its smallest negative value is -1)
Therefore, |score + 1| < |cpoints| - so, knowing that cpoints, is negative, we can infer that |score + 1| + cpoints is less than 0.`
So if the score is negative, the value of order is guaranteed to be 0 - so the sign is redundantly multiplying 0 by 1 or -1.
I've played around with the little example model the author provides and it seems to agree with this - when the story has a negative score, the order always comes out as 0, regardless the number of comments.
If I'm not mistaken this is a fun case of some redundant logic in the code - I guess at some point there were scenarios where the order could be non-zero with a negative score, which would have the effect the op suggests.
Thanks for the correction! I was flip-flopping between whether that term is doing anything or not (I initially had the wrong reasons for it not doing anything). I hadn't accounted for cpoints almost always negating the |score + 1| term.
pushcx | a month ago
I'm not the author of this code, but I've been maintaining it for a while. This is a great writeup. I'm pretty sure it's based on the Reddit link ranking algorithm, which was well-described by Evan Miller here and in a followup.
It would be great to see a similar writeup and simulator for comment ranking ("confidence"), which is a different algorithm. It's been tinkered with a lot over the years. I'm not sure it makes much sense anymore, and I'm pretty sure the tag weighting is just applied wrong with addition instead of multiplication. And I covet a very clever HN feature for getting attention to new threads where (at least for the first couple days) the threads are sorted best-first, but with the newest interleaved, so it goes (newest comment, top thread, 2nd newest comment, 2nd thread, etc). We haven't seen the unfortunate Reddit gaming of "hijacking the top comment to say..." but I'd like to encourage late comments more. (This is also why /active is next to the logo.)
I'm open to improvements on these. One big difference between us and Reddit/HN is that we don't have downvotes to indicate disagreement. jcs required that downvoters pick a from a list of predetermined reasons, but the familiar UI didn't work out. Commenters can see the flags on their comments, so we had a lot of discussions immediately distracted into meta conversations about why a comment was flagged. I changed the UI to move it from a down arrow over to "flagging" and spent a lot of time emphasizing in comments and messages that it should be used for things that need mod attention rather than disagreeing. Even a pretty recent change to enforce that users can reply to or flag a comment but not both (stream 1 and 2).
I'm also open to improvements on improving the tone and quality of conversations, though that's harder to nudge than a couple lines of javascript.
gioele | a month ago
May I once again push my suggestion to calculate the "bestness" of a thread using the recursive number of upvotes of all its (sub)comments instead of just the upvotes of the root comment?
https://lobste.rs/s/tdfoqh/ranking_comments_by_sum_replies_scores
cole-k | a month ago
(sorry, but I did not decide to look at the code, so just offering my observations below)
The biggest issue I as a commenter notice is the perennial "fastest gun in the west problem". In fact, I didn't even realize that Lobsters interleaved best and new comments on threads; is the order actually "first best, first newest, second best, ..."? In this thread, for example, I see your comment at the top and @Forty-Bot's comment (which is "first best, second best" unless I'm mistaken --- is there perhaps some hiding done if you are the one who made the newest comment?).
I know you say that "We haven't seen the unfortunate Reddit gaming of 'hijacking the top comment to say...'..." but I definitely have found myself post a reply to the discussion in the top comment which is debatably better served as a top-level comment (sometimes I do both and link to the top-level comment). Analyzing my own behavior, I find I want to be where the discussion is at --- and sometimes that ends up being in the children of one of the top-level comments.
Also (again anecdotally) early snark seems to have a much higher chance of ending up as the top-voted comment, whereas later snark is more likely to stagnate.
IMO the biggest issue with fast replies is that upvotes beget more upvotes (ditto for comments). I noticed that there is some sort of initial hiding of karma on posts with low votes; I wonder if this could apply to all comments regardless of karma? I unfortunately have to leave (otherwise my reply would be a lot longer with other ideas and comments), so this is more a collection of hurried thoughts and a "seconded" to your request for more discussion on comment ranking.
Though I don't use the site nowadays, I really like the first sentence of Reddiquette.
I am calling the bluffs of all the self-proclaimed blunt, socially awkward, or whatever else communicators: there are many things I see said here that you simply would not say to someone else's face. I am a firm believer that disagreement is not a reason to be unkind; put differently, you can always say what you want to say in a way that conveys good intentions. And for all the know-it-alls, if you're so sure that you are right, you should be excited by the opportunity to teach, not preach.
wrs | a month ago
pushcx said "I covet a very clever HN feature", implying lobste.rs does not do this (yet).
gerikson | a month ago
[Re: the comment interleaving feature]
I might be on this site way too much, but I read most comments from the /comments page, and only sometimes do I directly jump to that comment to get the context. In other words, the sorting of the top-level comments within a submission's comment tree is relatively unimportant to me. I probably didn't even realize that they differ from time to time.
[OP] atharva | a month ago
Thanks for sharing those Reddit algorithm links. They look very interesting. I may also attempt a follow-up post for the lobsters commenting algorithm, but no promises there (:
I'm honestly not sure what might help here at this point, but it's definitely not an algorithmic solution. I can't think of how this can be solved by a handful of moderation practices either without being too heavy-handed.
If more of the silent majority of lurkers engage in kind and substantive ways, that can definitely improve the quality of discourse and the experience of using this site. As with most sites, what gets posted and discussed here is often the result of 1% of the minority that is most engaged, and that character ends up defining the whole community. It doesn't take a lot of people coming out of the lurk-zone to shift this.
Forty-Bot | a month ago
I've given up on the front page algorithm. Popular stories stay on top for way too long before getting demoted. It's common for a story to stay on the front page for days, and it's pretty annoying to have to scroll past the same story for the 3rd or 4th time. At this point I only browse new, which frustratingly takes two clicks to get to from the front page.
gioele | a month ago
This is what attracts me to Lobsters and makes me prefer it over HN. Stories on Lobsters have time to "breath": people from different timezones have time to see them, contribute to them, have meaningful back-and-forth discussions going over days.
In HN a post has a 10 to 30 minutes window to make to the top. Stories move so fast that there is now a European HN and an American HN (and to a lesser extent an Asia/Australia HN), where non overlapping groups of people superficially engage for a few hours before moving on to the next story on the front page.
isagalaev | a month ago
And people with offline lives who don't check lobsters every 15 minutes :-)
gerikson | a month ago
HN is vastly larger than lobste.rs. Since 1 Jan 2026, there have been 540 submissions here, compared to 16.2k over at HN.
mtlynch | a month ago
Are stats publicly available for Lobsters?
I know HN has a BigQuery dataset and firebase REST API. Does lobsters have something similar?
gerikson | a month ago
I run this little service https://gerikson.com/hnlo/
For HN, I use Firebase. For lobste.rs, I simply load the story pages from /newest and read the .json:
https://lobste.rs/newest/page/1.json etc
For one-off stats, @pushcx can run queries. You'll have to construct them yourself, I believe.
jasonjmcghee | a month ago
I think the problem is solved with the "hide" button.
enobayram | a month ago
I'm sorry, but we use that as a proxy for the down vote button around here!
gerikson | a month ago
That only counts as a "downvote" if you also flag the submission, and refrain from commenting on it.
donio | a month ago
Is that really the algorithm? I think the site just moves more slowly, there aren't that many new posts. Unfiltered /newest often shows posts that are over 24 hours old and if you have some tags filtered it can easily go back several days.
gerikson | a month ago
I too would appreciate if /newest was a direct click from the front page.
dzwdz | a month ago
I've just made Swap /recent for /newest in the navbar lobsters#1861, fyi.
hoistbypetard | a month ago
Is there a reason you don't click "hide" on the ones where you don't want to continue following the discussion?
Forty-Bot | a month ago
I generally only hide posts that I find repulsive (but that commentators here love to comment on). I not infrequently use the search bar to look for posts, so I don't want to intentionally degrade my search results. Sometimes posts have great technical content, but overstay their welcome.
hoistbypetard | a month ago
As far as I can tell, hiding a post only dims it in the search results. It doesn't remove it. I tested this by looking at my personal list of hidden stories (you can view yours here: https://lobste.rs/hidden ) and searching using terms that would definitely match those posts. They showed up, but in a slightly dimmer color than the other posts.
So if that's the only reason you're not using "hide" to help get stories off your front page, it may well be a non-issue.
jasonjmcghee | a month ago
AFAIK it dims when you click hide, but if you refresh, it's gone. (You can still search and find it or see it in hidden)
hoistbypetard | a month ago
Sorry! I was referring specifically to the search results. Yes, it really gets hidden from other listings.
k749gtnc9l3w | a month ago
Why not add a direct bookmark BTW?
LeahNeukirchen | a month ago
I read HN like that, I filter out everything below some score, and sort the rest by date, so as soon as I hit a known title, I know I can stop reading.
cole-k | a month ago
I had an initial surprise as well upon reading this in your article, but I think it makes sense only because of the self-promo rules. I am more inclined to read stories that are self-submitted, after all. It's a treat getting to ask the author questions or reply to their post.
I am sorry you feel that way and I indeed hope you engage more. I find myself on the less popular side of various culture wars fought here sometimes and it really does seem like a futile effort trying to justify my position (and likewise, sometimes I have to stop myself feeling emboldened when I know my opinion is shared). Know that there are those of us who read and upvote dissenting opinions --- and that there are those of us who still value your opinion even if we do not agree with it.
[OP] atharva | a month ago
I thought this section in the guidelines captures it well:
Conversations on this site unfortunately get veered to the framing of taking a position and defending/justifying it. I'd like more people to look beyond "wars" (cultural or otherwise) and being on some side of it. I sincerely believe even relatively contentious topics are better dealt with a sense of lightness and curiosity. We should try to learn more from each other. This also applies to myself. I want to engage with commenters, actively hoping that the interactions would teach me something.
enpo | a month ago
I read the guidelines years ago, but I must confess that I often forget some of the guidelines offered by the site. Maybe it could be an optional/mandatory feature that you'll every N months get a quiz from the guidelines before you can access the site again.
BD103 | a month ago
Thanks for the breakdown, I really appreciated the demo as well!
strongoose | a month ago
Really neat analysis and visualisation. I have been thinking about the ranking algorithm recently for a potential side project, so I had a dig through the maths. I actually think there's a small inaccuracy which traces back to some redundant code, although it's possible that I have misunderstood something.
As far as I can tell, the
signparameter doesn't do anything! The variable is intended to flip the sign oforderifscoreis negative. However, if score is negative:cpoints <= score(becausecpointsis the minimum of score and another value), and therefore|score| <= |cpoints||score + 1| < |score|(score is a count of votes, so its smallest negative value is-1)Therefore,
|score + 1| < |cpoints|- so, knowing that cpoints, is negative, we can infer that|score + 1| + cpointsis less than 0.`This means that
So if the score is negative, the value of
orderis guaranteed to be 0 - so the sign is redundantly multiplying 0 by 1 or -1.I've played around with the little example model the author provides and it seems to agree with this - when the story has a negative score, the order always comes out as 0, regardless the number of comments.
If I'm not mistaken this is a fun case of some redundant logic in the code - I guess at some point there were scenarios where the
ordercould be non-zero with a negative score, which would have the effect the op suggests.[OP] atharva | a month ago
Thanks for the correction! I was flip-flopping between whether that term is doing anything or not (I initially had the wrong reasons for it not doing anything). I hadn't accounted for
cpointsalmost always negating the|score + 1|term.I'll update this post soon.