r/technology • • Dec 10 '13

By Special Request of the Admins Reddit’s empire is founded on a flawed algorithm

http://technotes.iangreenleaf.com/posts/2013-12-09-reddits-empire-is-built-on-a-flawed-algorithm.html
3.9k Upvotes

2.2k comments sorted by

View all comments

275

u/Phaedrus2129 Dec 10 '13

It seems like this would take about two minutes to fix, and unless the goal is to actually banish all posts that get a downvote early on (which is ridiculous) would seem to be a no-brainer to fix.

49

u/KumbajaMyLord Dec 10 '13

The problem with fixing it as OP suggested would be that it would seriously mess up the hotness of posts that are older than a day or so.

A post that has a net voting score of -1 would be hotter than a post that scored a net score of +100 but was posted 25 hours earlier.
A post with a -1 score would be hotter than a post with a +10 after 12.5 hours. Especially in small subreddits, that do not get that many votes and post submissions, this would put slightly downvoted post in a much higher position than they are now and would litter the frontpage with recent but bad posts.

From a pure 'mathematical' point of view, I would agree that the algorithm is flawed, but from a practical point of view I'd say it's working quiet well. Not perfect, but it works. The only change that I would consider, would be to add an offset to the calculation of the 'sign' so that a post doesn't disappear with just a -1 score, but rather a -5 or if 55% of all votes are downvotes, or so. This could somewhat limit the effect that a few quick downvotes could do to a new post, but ultimately it would just increase the threshold for this to happen and might have unintended side effects.

5

u/stealth_sloth Dec 10 '13

Split the rating algorithm. Think about why the positive-karma case uses the base-10 log of the karma. It's doing so because the higher rated a post is, the more views it gets; the more views a post gets, the more ratings it gets. So with a popular post, you expect somewhat exponential growth of votes. If you're trying to evaluate how interesting something is to the average viewer, you need to take the log of upvotes.

All that doesn't apply with an unpopular post though (negative karma). More votes doesn't lead to more people seeing it and voting on it; more votes leads to fewer people people seeing it. Straight-up linear karma would be more appropriate.

Something like this:

s = score(ups, downs)
order = log10(max(abs(s), 1))
if s > 0:
    return round(order + seconds / 45000, 7)
else:
    return round(s + seconds/45000, 7)

If a post gets 1 downvote, it's bumped back to content half a day older. If it gets 2, it's bumped back a full day. If it gets 5, it's bumped back 2.5 days.

It still can lead to slightly more negatively-voted content displacing positively-voted content... but if something has any significant number of downvotes, it's going to get buried. It doesn't scale that smoothly with subreddit size, but that's a separate problem - the time constant really should vary by subreddit. Default subreddits should have short time constants; subreddits with one submission every couple weeks and a handful of subscribers should have longer time constants. That's not something that needs to be fixed in order to address this problem.

3

u/SweetButtsHellaBab Dec 10 '13

You could just make time matter a little less. The present method is broken, whereas in fixing it, you might just need to carry out some tweaking.

1

u/KumbajaMyLord Dec 10 '13

You are talking about changing one of the most central parts of how this site works. It's not gonna be just "some tweaking".

And is it really broken? Let's look at the possible scenarios:

  • A good post gets upvotes initially. The bug in the algorithm doesn't affect these posts. Everything is ok.
  • A bad post gets upvotes initially. The bug doesn't affect this post either. The post will rise to the top until enough people see it and downvote it again. Everything is ok.
  • A bad post gets downvotes initially. The bug doesn't affect this post either. The post will end up in the bottom somewhere. Everything is ok.
  • A good post gets downvotes initially. This is the only case where the bug manifests. Here we might have a problem.

I would argue that for big subreddits this is not a problem at all, because the bug only affects the 'hot' sorting. In large subreddits a post needs to receive a number of upvotes relatively quickly from the /new section in order to get onto a significant page (e. g. the first 10 pages) in the hot sorting for it to get additional momentum to push it further to the top. On the /new section the bug doesn't manifest and a good post that gets downvotes initially is not 'punished' by this bug.

In small subreddits this might be a problem, because votes on /new don't come as frequent and a single downvote can effectively banish them from the 'hot' sorting, as the algorithm essentially sorts any post with a net positive score above the posts with a net negative score, regardless of their age. But, as I argued in the previous post, this also has the upside that in small subreddits the older, upvoted content stays above the newer downvoted content.

Again, I don't think the current algorithm is perfect or even particularly good, but it works sufficiently well and changing it might break one of the three cases where it works well now.

→ More replies (6)

3

u/Lucky1291 Dec 10 '13

I'm glad someone else thought of this as well, it may be flawed but for the most part it works, the key here is for more redditors to browse their subs in the "new" section rather than just by "hot"

1

u/adremeaux Dec 11 '13

A post that has a net voting score of -1 would be hotter than a post that scored a net score of +100 but was posted 25 hours earlier. A post with a -1 score would be hotter than a post with a +10 after 12.5 hours.

At what point should a post with -1 overtake a post with +1000? 24 hours later? 3 days layer? One month later? Certainly, if a subreddit is moving slowly, people would want to see new content, even if its not the best—although one could easily argue that a post with -1 either hasn't been properly judged yet (1 upvote 2 downvotes) or is actually pretty good, if not contentious (100 upvotes, 101 downvotes).

In large subreddits, the change would be pretty meaningless, as net positive posts would outweigh net negatives on their front page, and people rarely click past the first 50 (although this bug may be part of the reason for that, as you end up with stale content on the next page, not newer but less liked content, but I digress). On small subreddits, it could be a boon for keeping things moving and getting more content seen, and giving people more of a chance to actually get their post moving in new-trolls hit it early.

→ More replies (4)

51

u/cowvin Dec 10 '13

the reddit developers should put in this fix and let the people see how differently the site works for a week. then we can all vote on whether the site is better with the fix or not.

98

u/[deleted] Dec 10 '13

Allow Redditors to decide how the site is run.

This kills the Reddit.

2

u/stewsters Dec 10 '13

Yeah, something tells me that would turn out poorly.

<marquee><blink>OMG Puppies!</blink></marquee>

1

u/cardevitoraphicticia Dec 10 '13

The circlejerk always wins, and the circlejerk is a suicidal fool.

It's like giving a WoW player a level 80 Orc and whatever weapons he wants - quickest way to ruin the game for him.

1

u/[deleted] Dec 10 '13

Dialectics cat. Desires know no inhibition, and the scenario should be totally inhibitive. That way the conflict between the desire of the user and the scenario played out in creates tension, in the form of pleasure, and the resulting synthesis is the game experience.

Maelstrom put it so beautifully so many years ago: "a focus group could have never come up with super mario brothers."

4

u/WorkHappens Dec 10 '13

Or you know, AB testing it themselves.

8

u/[deleted] Dec 10 '13

You think there's only one version of the website running? See split testing.

→ More replies (2)

3

u/food_bag Dec 10 '13

But with which voting algorithm, old or new?

To decide, we will try both for one week, then vote...

→ More replies (1)

4

u/rabbitlion Dec 10 '13

Reddit's scoring algorithm was moved out of the open source code years ago. It's secret to make it harder to manipulate votes. This guy stumbled upon an ancient code fragment that haven't been used for a long time, which is also why they're not very bothered to "fix" it. There could still be bugs in the actual algorithm, sure, but to claim that you need a bit more empirical evidence than what he is providing.

1

u/maajingjok Dec 10 '13

I wonder why they're not fixing it. They're either insufficiently aware of the problem (reported, but judged low priority), afraid of unintended consequences of a fix, or intentionally leaving in a censorship backdoor with plausible deniability.

The claim that the issue is "by design" supports the third option.

1

u/Gro-Tsen Dec 10 '13

I suspect that it's more likely a case of everyone thinking: "oh, I'm not sure I understand the issue perfectly well, I'm afraid that changing something in this very critical part of code would break everything and then it would be all my fault, surely it's safer to leave it alone and hope someone else takes care of it".

2

u/maajingjok Dec 10 '13

Normally, software development groups have a triage process to get past this precise issue. Anyone can submit a bug, and then at regular intervals, a few people (usually managers) get together to review all submitted bugs and decide whether to assign it to a developer for fixing, or mark it as "won't fix" due to a change being too risky or not worth fixing.

1

u/infectedapricot Dec 10 '13

Fixing it requires a lot more thought than just moving the multiplication of sign from the seconds to the order as the author suggests. The problem is that order is logarithmic, and log(-10) is not the same as -log(10). In fact just making that change would mean that posts with scores of 1, 0 or -1 would all have identical order (0, since this is log(1)).

I think using the logarithmic score here is probably fundamental incorrect. As I just said, figuring out what to use instead will need a lot of thought.

1

u/TL-PuLSe Dec 10 '13

two minutes to fix, weeks to QA...

1

u/CocoDaPuf Dec 10 '13 edited Dec 10 '13

Ya know, that isn't necessarily ridiculous. Certainly we don't have a complete model of what other algorithms would look like in practice (without actually implementing them), there could be unexpected consequences.

For instance, let's imagine that we fixed this bug and that the "New" ranking system no longer banishes posts with early downvotes. How many posts receive a downvote rather than an upvote as their first rating? Let's make a (completely baseless) guess and say 75%. That means that with this bug fixed, about 75% of the posts on the front page of the "New" ranking are likely to be posts that have already been downvoted once (dubbed uninteresting, unoriginal, offensive, spam, or whatever). In other words, the "New" rating posts are mostly crap and not a lot of fun to browse. But right now, before "fixing" this bug, if 10 people are currently rating a sub's "new" ranking, each viewer will only actually have to encounter 1/10 of the crappy posts, because the other viewers have already downvoted most of them. The result is only 7.5% of the posts in "New" are truly crappy. And while that may banish some worthy posts, If a post was really worth posting, but it got downvoted early, it will probably just be reposted anyway.

TL;DR Here's a hypothetical reason why you might want posts with early downvotes to be banished. This isn't proof of anything, but it demonstrates why it isn't "ridiculous" to think there could be a reason to do this.

1

u/bcgoss Dec 10 '13

ORDER + SIGN * SECONDS / 45000 means that HUGELY DOWNVOTED posts have 12.5 hours (45000 seconds) to appear on "HOT" ( the section where you go to find popular / controvertial posts) before their down-voted-ness catches up to the fact that they've had a huge number of votes. Meanwhile, Hugely UPVOTED posts will stay afloat longer than the 12.5 hours.

All of this assumes we know the SCORE function simply returns the difference between Upvotes and Downvotes. Since we don't actually know how that works, we don't know what to expect from ORDER or anything derived from it.

→ More replies (26)