1 00:00:00,000 --> 00:00:15,120 My name is Ian Clark. I'm the CEO of Upriser Labs. I'm also the founder of the Freenet Project, an anonymous peer-to-peer network that I've spoken about here more times than I can count over the last 10 years. 2 00:00:15,740 --> 00:00:17,600 This has nothing to do with that. 3 00:00:20,740 --> 00:00:28,280 This talk's a hacking desire, figuring out what people want. Why would anyone want to do that? 4 00:00:28,280 --> 00:00:37,160 Well, this is really fundamental to the internet in many ways, to getting the right information to the right people. 5 00:00:37,360 --> 00:00:47,820 It's essentially what companies like everything from Google to Facebook, what they're all based on, figuring out what people want and providing it to them. 6 00:00:48,820 --> 00:00:58,020 My background is in artificial intelligence, and so I was very interested in kind of taking that type of approach to... 7 00:00:58,280 --> 00:01:16,460 ...addressing this issue, so I'm going to be talking about this kind of broad area and some other approaches to this problem, techniques that are generally called a collaborative filtering or recommendation engines, which is kind of the umbrella term for all of this. 8 00:01:16,620 --> 00:01:28,000 I'm going to talk about how they do it, what's wrong with the way they do it, and present to you a pretty neat approach that I've been working on for the last... 9 00:01:28,980 --> 00:01:31,040 ...well, for the last while. 10 00:01:34,140 --> 00:01:35,640 What can you do with this? 11 00:01:35,840 --> 00:01:42,340 Well, we actually see a lot of examples of recommendation engines in use on the internet today. 12 00:01:43,140 --> 00:01:46,880 You can use it to figure out what kind of music people like. 13 00:01:47,920 --> 00:01:55,920 This is an interesting problem, because typically people have a lot of trouble articulating exactly what their musical tastes are. 14 00:01:56,120 --> 00:01:57,920 So the idea of some algorithm... 15 00:01:58,280 --> 00:02:05,400 ...that can look at your behavior and essentially reverse-engineer your music preferences is pretty attractive. 16 00:02:06,480 --> 00:02:15,020 I'm sure most, if not all, of you are familiar with Netflix, and that's one of the most prominent uses of collaborative filtering online. 17 00:02:15,560 --> 00:02:17,320 They use it to recommend movies. 18 00:02:21,040 --> 00:02:25,560 This approach can also be used to recommend search, for example... 19 00:02:26,220 --> 00:02:30,480 ...as an alternative to using something like PageRank to rank search results. 20 00:02:30,720 --> 00:02:42,460 You could use a recommendation engine like the one I'm going to describe to rank search results in a way that is tailored to you specifically, based upon your past behavior. 21 00:02:44,080 --> 00:02:49,360 These techniques can and are being used to target advertising, behavioral advertising. 22 00:02:51,040 --> 00:02:53,180 Some people kind of see that as scary. 23 00:02:53,420 --> 00:02:55,540 I think it's kind of a double-edged sword. 24 00:02:55,560 --> 00:03:03,960 On the positive side, I think most people, if you're going to get advertised to, it's better that it's actually relevant to you. 25 00:03:05,540 --> 00:03:15,680 These techniques can and are being used for dating websites, finding people who are likely to form compatible matches. 26 00:03:16,280 --> 00:03:22,240 I've been doing quite a bit of work with a company called eHarmony that most of you are familiar with... 27 00:03:23,160 --> 00:03:25,540 ...who have done a lot of research in this area. 28 00:03:27,520 --> 00:03:38,940 They're kind of continuing to use this type of approach to figure out what pairs of people are likely to achieve long-lasting relationships... 29 00:03:38,940 --> 00:03:43,040 ...and, in their case, hopefully get married, because that's basically their raison d'ĂȘtre. 30 00:03:43,480 --> 00:03:47,260 And also product recommendations, which is similar to advertising. 31 00:03:47,920 --> 00:03:52,080 So, what are the common approaches to this problem today? 32 00:03:52,420 --> 00:03:54,680 Well, the simplest one is... 33 00:03:54,680 --> 00:03:57,400 ...what I'll refer to as item-based collaborative filtering. 34 00:03:57,740 --> 00:03:59,300 A little bit of terminology. 35 00:03:59,660 --> 00:04:05,660 So, typically, the people, our users, and the things that are being recommended... 36 00:04:05,660 --> 00:04:09,880 ...whether it's music or movies or whatever, are called items. 37 00:04:10,400 --> 00:04:17,480 An item-based collaborative filter basically looks for similar items... 38 00:04:17,480 --> 00:04:24,580 ...typically on the basis of a lot of people who bought this thing or liked this thing... 39 00:04:24,580 --> 00:04:25,900 ...also liked this thing. 40 00:04:27,160 --> 00:04:31,700 And then, if you express an interest in a certain item... 41 00:04:31,700 --> 00:04:35,140 ...it will recommend other items that it thinks are similar to that. 42 00:04:35,740 --> 00:04:39,000 This is very simple to implement. 43 00:04:39,580 --> 00:04:40,920 It's easy... 44 00:04:41,580 --> 00:04:44,540 It's also easy to explain to end users. 45 00:04:44,920 --> 00:04:47,420 It's a pretty transparent what's going on. 46 00:04:48,460 --> 00:04:51,260 On the negative side, it's quite naive. 47 00:04:51,580 --> 00:04:54,420 I mean, really, the only input to this algorithm is... 48 00:04:54,580 --> 00:04:57,260 ...what item are you looking at right now? 49 00:04:57,520 --> 00:05:00,360 And that's all it knows about you when it makes its recommendations. 50 00:05:01,820 --> 00:05:05,980 There also tends to be a problem here where you have limited diversity. 51 00:05:06,400 --> 00:05:12,700 So, for example, when this technique is applied to things like news stories... 52 00:05:12,700 --> 00:05:14,100 ...what it will tend to do is... 53 00:05:14,100 --> 00:05:18,120 ...let's say you have a news story about the war in Iraq, for example... 54 00:05:18,120 --> 00:05:22,680 ...it will recommend a bunch of other news stories on the same or similar topics. 55 00:05:22,680 --> 00:05:25,400 And that's typically not what people want. 56 00:05:25,480 --> 00:05:28,000 People want some degree of diversity... 57 00:05:28,000 --> 00:05:31,100 ...especially if they're reading news or listening to music. 58 00:05:32,700 --> 00:05:37,780 A more sophisticated, a more powerful approach is user-based collaborative filtering. 59 00:05:39,760 --> 00:05:45,780 In this approach, you look for users that are similar. 60 00:05:46,000 --> 00:05:49,160 And the way you find users that are similar is you look at... 61 00:05:49,420 --> 00:05:51,460 ...what did this guy rate? 62 00:05:51,460 --> 00:05:53,080 What did this other person rate? 63 00:05:53,160 --> 00:05:54,320 The same things. 64 00:05:54,660 --> 00:05:57,280 And you look for users where that is similar. 65 00:05:57,640 --> 00:06:03,880 And to those statisticians among you, typically you'll use a Pearson correlation coefficient... 66 00:06:03,880 --> 00:06:06,840 ...to determine the similarity between users. 67 00:06:07,780 --> 00:06:11,520 On the upside, this can actually develop quite a nuanced... 68 00:06:11,520 --> 00:06:15,660 Oh, and then, of course, once you've identified the users that are similar... 69 00:06:15,660 --> 00:06:20,320 ...you look for things that they liked that your candidate user hasn't seen yet... 70 00:06:20,320 --> 00:06:22,140 ...and that's what you recommend to them. 71 00:06:22,520 --> 00:06:28,160 Now, this can develop quite a nuanced view of what your interests are. 72 00:06:28,280 --> 00:06:33,300 If it can find 20 or 30 other people that are similar to you... 73 00:06:33,300 --> 00:06:38,580 ...and then use those other people essentially as recommenders for you... 74 00:06:38,580 --> 00:06:42,380 ...then that can be very, very effective. 75 00:06:43,280 --> 00:06:46,460 It's also quite easy for end users to understand... 76 00:06:46,460 --> 00:06:48,820 ...people like you like these things. 77 00:06:48,820 --> 00:06:51,320 It's not hard to get your head around. 78 00:06:51,960 --> 00:06:54,100 There are some problems, though. 79 00:06:54,180 --> 00:07:01,460 Firstly, it requires a lot of data per user to accurately determine user similarity. 80 00:07:01,860 --> 00:07:06,680 If you and I have just been using Netflix for even a couple of weeks... 81 00:07:06,680 --> 00:07:11,940 ...we've maybe rated four or five movies each. 82 00:07:13,180 --> 00:07:17,160 How many of those are we both likely to have rated? 83 00:07:17,240 --> 00:07:18,800 Well, at most, one. 84 00:07:18,820 --> 00:07:19,640 One or two, really. 85 00:07:19,920 --> 00:07:23,540 And one or two ratings of the same movie... 86 00:07:23,540 --> 00:07:25,740 ...the fact that I gave Robocop a five... 87 00:07:25,740 --> 00:07:30,900 ...and the fact that I gave The Matrix a five-star rating... 88 00:07:30,900 --> 00:07:33,180 ...and the fact that you did two... 89 00:07:33,820 --> 00:07:35,440 ...okay, we're probably both geeks... 90 00:07:35,440 --> 00:07:40,500 ...but it's not a very nuanced perspective of how are we similar. 91 00:07:40,740 --> 00:07:45,940 So these things require a very dense data set to be effective. 92 00:07:46,360 --> 00:07:47,600 And in most situations... 93 00:07:47,600 --> 00:07:50,120 ...you really don't have a dense data set... 94 00:07:50,120 --> 00:07:54,540 ...because most people are not Netflix, they're not Amazon, they're not Google... 95 00:07:54,540 --> 00:07:56,760 ...and they need to make do with a lot less data. 96 00:07:58,060 --> 00:08:00,900 Also, this approach can be hard to scale. 97 00:08:02,660 --> 00:08:05,000 A naive implementation of it... 98 00:08:05,000 --> 00:08:08,200 ...where you check every user against every other user... 99 00:08:09,140 --> 00:08:11,720 ...has order of N squared scalability... 100 00:08:11,720 --> 00:08:16,200 ...which, if you have millions of users, that's a very, very, very bad thing. 101 00:08:17,600 --> 00:08:22,480 Typically, approaches which try to make this algorithm scale more effectively... 102 00:08:23,460 --> 00:08:27,920 ...reduce the quality of its recommendations significantly. 103 00:08:30,720 --> 00:08:35,420 So our approach is different to both of these two things. 104 00:08:35,520 --> 00:08:38,500 In some ways, it shares some properties with both of them. 105 00:08:39,440 --> 00:08:47,240 Our idea is we want to build a mathematical model of your interests... 106 00:08:47,240 --> 00:08:48,900 ...what you like and what you don't like. 107 00:08:49,360 --> 00:08:56,360 And simultaneously, we build a mathematical model of the qualities that particular items have. 108 00:08:56,920 --> 00:09:03,040 And for any user and item, we can combine these mathematical models... 109 00:09:03,040 --> 00:09:09,840 ...and it will spit out a prediction of how much that user will like that thing. 110 00:09:10,980 --> 00:09:13,560 So we start out, obviously... 111 00:09:14,460 --> 00:09:18,380 ...these models start out essentially being random... 112 00:09:18,380 --> 00:09:21,700 ...but what you do is you take past data... 113 00:09:21,700 --> 00:09:25,320 ...so user A liked item B this much... 114 00:09:25,320 --> 00:09:28,260 ...and you feed it into this model... 115 00:09:28,260 --> 00:09:31,560 ...and you kind of make tiny tweaks to the model... 116 00:09:33,640 --> 00:09:38,920 ...so that it's producing the appropriate output on the training data. 117 00:09:39,780 --> 00:09:42,160 This technique is called gradient descent... 118 00:09:42,160 --> 00:09:44,240 ...and I'll talk a little bit more about this in a second. 119 00:09:44,880 --> 00:09:50,560 And then we use this model that hopefully is now giving fairly good predictions... 120 00:09:50,560 --> 00:09:53,540 ...on the training set, the data that it has seen... 121 00:09:53,540 --> 00:10:00,060 ...and it's able to produce predictions of how much a given user will like a given thing... 122 00:10:00,060 --> 00:10:01,440 ...that they haven't seen yet. 123 00:10:03,480 --> 00:10:09,980 So this broad technique is something that's used quite a lot in artificial intelligence research. 124 00:10:10,080 --> 00:10:11,400 It's called gradient descent. 125 00:10:12,160 --> 00:10:15,280 And the way to think about gradient descent... 126 00:10:15,280 --> 00:10:19,060 ...is your current solution to a problem... 127 00:10:19,060 --> 00:10:23,300 ...is like a ball on an uneven surface... 128 00:10:23,300 --> 00:10:24,380 ...like this one here. 129 00:10:24,800 --> 00:10:30,120 And the lower down the point on the surface is... 130 00:10:30,120 --> 00:10:32,760 ...the better your thing is doing. 131 00:10:32,920 --> 00:10:34,860 So in the case of our application... 132 00:10:34,860 --> 00:10:40,640 ...the more accurately our algorithm is predicting user behavior... 133 00:10:40,640 --> 00:10:44,100 ...the lower this ball is going to be on this surface. 134 00:10:44,560 --> 00:10:46,460 And then gradient descent... 135 00:10:46,460 --> 00:10:50,340 ...you simply put the ball on the surface initially in a random position... 136 00:10:50,340 --> 00:10:53,520 ...and it will roll downhill. 137 00:10:54,160 --> 00:10:56,780 And what's going on is that at each stage... 138 00:10:56,780 --> 00:11:01,280 ...you're essentially figuring out what slight modification can I make... 139 00:11:01,280 --> 00:11:04,040 ...to the properties of this mathematical model... 140 00:11:04,040 --> 00:11:07,100 ...such that it will yield better results. 141 00:11:08,420 --> 00:11:10,320 And you do this... 142 00:11:10,320 --> 00:11:14,540 ...millions of times in the case of the data set I've been working with mainly... 143 00:11:15,120 --> 00:11:17,080 ...using 100 million ratings. 144 00:11:17,500 --> 00:11:20,560 And you repeatedly go through them over and over again. 145 00:11:20,920 --> 00:11:26,080 And for each rating you kind of modify your model ever so slightly... 146 00:11:26,080 --> 00:11:29,740 ...so that it's giving output that's closer to what you're looking for. 147 00:11:31,340 --> 00:11:36,600 And eventually it will start to produce results that are pretty close to your training set. 148 00:11:44,640 --> 00:11:45,220 I'll wait. 149 00:11:53,360 --> 00:11:56,220 I don't know if we're supposed to evacuate or... 150 00:11:58,260 --> 00:11:59,140 I'm guessing not. 151 00:12:11,540 --> 00:12:12,000 Okay. 152 00:12:14,640 --> 00:12:17,660 I assume it's going to stop any second now, so... 153 00:12:20,680 --> 00:12:21,140 Okay. 154 00:12:28,400 --> 00:12:31,100 At least this is also happening to all the other speakers. 155 00:12:31,180 --> 00:12:32,420 That makes me feel better. 156 00:12:35,500 --> 00:12:35,960 Okay. 157 00:12:39,380 --> 00:12:39,840 Okay. 158 00:12:39,860 --> 00:12:40,300 Okay. 159 00:12:40,320 --> 00:12:43,420 I'll try and continue on and ignore it. 160 00:12:51,840 --> 00:12:57,080 So, gradient descent has pretty diverse applications, as I was mentioning. 161 00:12:57,220 --> 00:13:01,680 It's something that's used quite a lot in artificial intelligence. 162 00:13:02,040 --> 00:13:05,980 Whenever you have a situation where you have a problem to solve... 163 00:13:05,980 --> 00:13:07,580 ...you're not quite sure how to solve it... 164 00:13:07,580 --> 00:13:11,980 ...and you'd like a computer to figure out how to solve it on your behalf... 165 00:13:12,680 --> 00:13:15,920 ...gradient descent is a very effective way to do that. 166 00:13:19,840 --> 00:13:21,620 This is not real. 167 00:13:25,180 --> 00:13:26,300 Take the... 168 00:13:47,280 --> 00:13:49,980 But they haven't switched it off yet. 169 00:13:50,320 --> 00:13:50,500 Okay. 170 00:13:51,680 --> 00:13:52,500 Um... 171 00:13:53,560 --> 00:13:54,380 Okay. 172 00:13:54,440 --> 00:13:55,000 So... 173 00:13:57,370 --> 00:13:58,100 So I'm... 174 00:13:58,100 --> 00:14:03,200 To kind of give an example of the type of diverse applications... 175 00:14:03,200 --> 00:14:07,240 ...that gradient descent algorithms can be... 176 00:14:07,240 --> 00:14:09,280 ...used to solve... 177 00:14:10,160 --> 00:14:11,380 ...here's one example. 178 00:14:11,660 --> 00:14:16,680 So, in this case, these guys simulated a simple humanoid figure... 179 00:14:17,240 --> 00:14:20,580 ...existing in a three-dimensional space... 180 00:14:20,580 --> 00:14:25,640 ...and they simulated basic rules of physics like gravity and friction... 181 00:14:25,640 --> 00:14:28,300 ...and, you know, the fact that the same thing... 182 00:14:28,300 --> 00:14:31,520 ...you know, two things can't be in the same place at the same time. 183 00:14:32,160 --> 00:14:37,220 They then used a neural network to control the humanoid figure... 184 00:14:37,220 --> 00:14:39,180 ...for those of you not familiar with it... 185 00:14:39,180 --> 00:14:43,200 ...a neural network is a technique... 186 00:14:43,200 --> 00:14:45,380 ...that's used in artificial intelligence quite a bit. 187 00:14:46,460 --> 00:14:49,600 It's a network of neurons which... 188 00:14:49,600 --> 00:14:53,440 ...it's kind of like a loose approximation to the way the brain works... 189 00:14:53,440 --> 00:14:57,340 ...and you can use a gradient descent algorithm... 190 00:14:57,340 --> 00:15:01,680 ...to train a neural network to do stuff that you want it to do. 191 00:15:02,040 --> 00:15:04,780 So in this particular simulation... 192 00:15:04,780 --> 00:15:05,700 ...um... 193 00:15:05,700 --> 00:15:09,140 ...the fitness of this thing... 194 00:15:09,140 --> 00:15:12,960 ...in other words, the point at which this ball is at its lowest point... 195 00:15:12,960 --> 00:15:16,980 ...is where this humanoid figure achieves its maximum height. 196 00:15:17,420 --> 00:15:22,760 So this gradient descent algorithm is going to try to figure out a way... 197 00:15:22,760 --> 00:15:27,700 ...to make this guy jump as high as he possibly can... 198 00:15:29,820 --> 00:15:31,560 ...and you'll see... 199 00:15:31,560 --> 00:15:33,360 ...I'm going to play a video of this... 200 00:15:33,360 --> 00:15:34,660 ...you'll see that actually... 201 00:15:34,660 --> 00:15:36,480 ...he does improve with time... 202 00:15:36,480 --> 00:15:40,580 ...as the gradient descent algorithm does its thing... 203 00:15:40,580 --> 00:15:41,060 ...um... 204 00:15:41,620 --> 00:15:42,180 ...and... 205 00:15:42,820 --> 00:15:43,380 ...there's... 206 00:15:44,040 --> 00:15:45,060 ...okay, so... 207 00:15:45,060 --> 00:15:46,560 ...here you can see the... 208 00:15:47,200 --> 00:15:49,820 ...here you can see the humanoid figure and... 209 00:15:49,820 --> 00:15:53,900 ...I found a little bit of a soundtrack that seemed to go with this video... 210 00:15:53,900 --> 00:15:54,820 ...so let's see if it works. 211 00:16:18,760 --> 00:16:19,220 Boom. 212 00:16:19,240 --> 00:16:19,260 Boom. 213 00:16:22,100 --> 00:16:22,720 There we go. 214 00:16:23,100 --> 00:16:23,160 Boom. 215 00:16:47,360 --> 00:16:52,360 Okay, so hopefully you could see that it kind of started out being pretty dumb, flailing 216 00:16:52,360 --> 00:16:55,940 around, but by the end of it, he was getting some pretty serious airtime. 217 00:16:57,880 --> 00:17:05,860 So this mathematical model that we want to create that's going to represent what people want and 218 00:17:05,860 --> 00:17:11,080 what properties the items that they want have, how are we actually going to do that in practice? 219 00:17:11,460 --> 00:17:18,040 Well, the approach is pretty simple. So in this case, I'm taking an example of a movie I quite 220 00:17:18,040 --> 00:17:26,300 like called Robocop, and what I've done here is I've broken down my movie preferences along 221 00:17:26,300 --> 00:17:33,540 essentially four dimensions. You can see here that I quite like action movies, violent movies 222 00:17:33,540 --> 00:17:43,580 are okay, I really like sci-fi movies, and I do not like romance. So Robocop, it's got a decent 223 00:17:43,580 --> 00:17:47,920 amount of action, a lot of violence, it's definitely sci-fi. 224 00:17:48,040 --> 00:17:57,840 And there is no romance whatsoever. So how do we take my preferences and Robocop's qualities and 225 00:17:57,840 --> 00:18:05,860 turn it into an actual number? Well, it's pretty straightforward, really. We give each of my 226 00:18:05,860 --> 00:18:13,400 preferences a name, A, B, C, and D, for the four preferences you saw there. We give each of the 227 00:18:13,400 --> 00:18:16,920 qualities of the movie their own names, E, F, G, and H. 228 00:18:18,040 --> 00:18:25,340 And the rating is very simply A, you know, how violent, how much I like violent movies, which could be a 229 00:18:25,340 --> 00:18:31,100 positive for a negative number, multiplied by E, which is, you know, whether or not the movie is actually 230 00:18:31,100 --> 00:18:36,740 violent or not, which can also be a positive for a negative number. I multiply each of these pairs 231 00:18:37,740 --> 00:18:46,240 together, and the sum of them gives me the rating. So in the case, I can just flip back here, or try to, 232 00:18:46,400 --> 00:18:46,780 no. 233 00:18:48,980 --> 00:18:57,500 Sorry, let me, lost my mouse pointer here. 234 00:19:02,080 --> 00:19:09,400 Okay, so, yeah, so you can basically see action multiplied by action leads to a high number. Romance multiplied by 235 00:19:09,400 --> 00:19:15,940 romance, because they're both negative, also leads to a high number, so add them all up, and I like Robocop. 236 00:19:20,440 --> 00:19:31,340 Okay, but there's a question. So I just, my computer's being a little bit slow. 237 00:19:31,740 --> 00:19:46,720 So, let me just, okay. How do we actually figure out, for a given user, how much do they like violence, how much do they like this, and similarly for movies, how do we figure out what the properties of the movies are? 238 00:19:46,920 --> 00:19:47,920 You know, we can't, 239 00:19:48,040 --> 00:20:17,260 exactly, laboriously go through each movie and assign these things to them. That would take a very long time, and we definitely can't go through every single user and kind of ask them, how much do you like violence, how much do you like this, how much do you like that, because, you know, users just probably can't be arsed to answer that many questions, and secondly, the answers they give probably won't be very good. So, how do we assign numbers to each of these values, such that we get accurate ratings? 240 00:20:17,260 --> 00:20:21,520 And that's basically where the gradient descent algorithm comes in. 241 00:20:24,420 --> 00:20:46,440 Similarly, how do we decide what the important features are? You know, so I kind of came up with violence, you know, sci-fi, romance, you know, but, you know, we don't really want to be in the business of having to try to figure out what the important qualities of a movie are that will dictate whether or not somebody likes the movie. 242 00:20:48,920 --> 00:21:06,420 So, what we do is we actually don't need to figure that stuff out. We can just let the gradient descent algorithm tell us. So, how does that work? 243 00:21:07,000 --> 00:21:16,960 Well, essentially, what we're giving the gradient descent algorithm is a bunch of movies, a bunch of users, and... 244 00:21:17,260 --> 00:21:28,620 a set of ratings that match each of those users to each of those movies, and we basically tell the gradient descent algorithm, okay, you've got... 245 00:21:28,620 --> 00:21:46,980 Actually, I use 64 features, typically. You've got 64 features. They can mean whatever you want them to mean. You just need to assign numbers to each of those user features and each of those item features, such that you are able to... 246 00:21:47,260 --> 00:21:59,220 distill that user's interest down to a very basic, you know, down to something that will yield accurate predictions. 247 00:22:05,520 --> 00:22:09,200 So, how do we decide... 248 00:22:09,200 --> 00:22:09,620 Oh, wait. 249 00:22:13,440 --> 00:22:14,120 Okay. 250 00:22:15,580 --> 00:22:16,720 Okay, so, yeah. 251 00:22:17,260 --> 00:22:20,900 So, what will happen is this thing will figure it out for itself. We may not... 252 00:22:20,900 --> 00:22:34,260 We probably won't even understand what these features mean, that it's figured out. They will just make sense for it, but kind of later on, I'll show some visualizations where, you know, you'll hopefully get a sense for what it tries to figure out. 253 00:22:37,060 --> 00:22:43,320 So, I've done this. I'll show you kind of what it looks like a little bit later, but does this approach work? 254 00:22:44,220 --> 00:22:47,240 Well, so, I think about two years ago, a year and a half ago... 255 00:22:47,240 --> 00:22:56,920 Netflix wanted to stimulate innovation and research in this field, and so they did a very good thing. 256 00:22:57,060 --> 00:23:15,760 They took several years' worth of the data that they had collected, the ratings by users on items, and they released it onto the Internet, 100 million ratings, half a million users, 17,000 movies. 257 00:23:17,980 --> 00:23:40,880 And they basically said to people, you know, take this data. You try to build a piece of software that can predict what users are going to rate, and then we will test what you've built on a test set of data that we haven't given to you. 258 00:23:41,240 --> 00:23:47,220 And if your algorithm performs better than everyone else's... 259 00:23:47,240 --> 00:23:49,640 I don't know if anyone else in a given year will give you, I think, $50,000. 260 00:23:51,220 --> 00:24:02,520 No. In any given year, it's 50,000, and if you can achieve a score below .85 something, then they'll give you $1 million. 261 00:24:03,040 --> 00:24:07,960 And nobody has done that, and it's actually quite likely that nobody will be able to achieve that. 262 00:24:08,660 --> 00:24:16,220 But I'll talk a little bit more about why that is and what the properties are of the way they've chosen to... 263 00:24:18,000 --> 00:24:20,660 measures success of these type of algorithms, 264 00:24:21,480 --> 00:24:24,940 basically what they use to determine how successful 265 00:24:24,940 --> 00:24:28,120 this type of collaborative filtering algorithm is 266 00:24:28,120 --> 00:24:30,260 is a metric called root mean squared error. 267 00:24:30,640 --> 00:24:33,040 And that's pretty simple. 268 00:24:33,720 --> 00:24:39,600 You train the algorithm up on a training set. 269 00:24:39,860 --> 00:24:42,200 You then give it a probe set, 270 00:24:42,420 --> 00:24:46,400 which is combinations of users 271 00:24:46,400 --> 00:24:50,060 and items that the algorithm has not seen, 272 00:24:50,160 --> 00:24:51,760 that it's not been trained on. 273 00:24:52,410 --> 00:24:55,940 And then you let the algorithm make a prediction 274 00:24:56,510 --> 00:24:59,420 for that given user and item. 275 00:25:00,060 --> 00:25:03,440 And the algorithm, and then you measure the difference 276 00:25:03,440 --> 00:25:06,140 between what that user actually rated that thing 277 00:25:06,630 --> 00:25:08,160 and what the thing predicted. 278 00:25:08,670 --> 00:25:10,600 And then you take the mean difference 279 00:25:10,600 --> 00:25:14,060 between what was predicted and what the user actually did. 280 00:25:14,400 --> 00:25:16,220 It's slightly more complicated 281 00:25:16,220 --> 00:25:19,720 than that because they use a root mean squared error. 282 00:25:20,780 --> 00:25:25,080 And all that means is that they actually take 283 00:25:25,080 --> 00:25:28,880 the squared differences between what was predicted 284 00:25:28,880 --> 00:25:34,020 and what the users actually did and get the mean of that. 285 00:25:34,200 --> 00:25:36,340 And then you take the square root of the whole thing. 286 00:25:36,840 --> 00:25:41,540 And the reason that they use this type of mean 287 00:25:42,180 --> 00:25:45,740 is they want to really kind of more aggressively, 288 00:25:45,740 --> 00:25:47,960 punish very, very bad predictions. 289 00:25:48,340 --> 00:25:50,320 So if you predict that a movie's gonna, 290 00:25:50,500 --> 00:25:52,680 you know, that a user's gonna love a movie 291 00:25:52,680 --> 00:25:54,020 and they actually hate it, 292 00:25:54,160 --> 00:25:56,140 that's actually a very, very bad thing. 293 00:25:56,460 --> 00:25:58,760 And by using root mean squared error, 294 00:25:59,000 --> 00:26:02,560 this will lead to a significantly higher error. 295 00:26:02,740 --> 00:26:06,720 And so you're punished for just really dumb predictions. 296 00:26:08,800 --> 00:26:14,360 And then as I mentioned, it's very important to separate out 297 00:26:15,740 --> 00:26:18,760 the probe set, the data you're actually gonna test 298 00:26:18,760 --> 00:26:21,300 the algorithm with, from the training set. 299 00:26:21,540 --> 00:26:24,700 If you look at the kind of forms around the Netflix prize 300 00:26:24,700 --> 00:26:28,380 where people kind of discuss it, 301 00:26:28,960 --> 00:26:32,560 what happens is, you know, about once a day, 302 00:26:32,640 --> 00:26:34,020 you'll see somebody appear on there. 303 00:26:34,120 --> 00:26:35,980 It's like, oh my god, I just won the prize. 304 00:26:36,460 --> 00:26:38,560 And invariably the response is, 305 00:26:38,740 --> 00:26:41,180 are you testing your algorithm on the training set? 306 00:26:41,560 --> 00:26:43,360 And typically when you do that, 307 00:26:43,460 --> 00:26:45,540 you get root mean squared errors, 308 00:26:45,740 --> 00:26:49,560 which is around, you know, .65 or .7, 309 00:26:49,660 --> 00:26:52,880 which would mean that you'd just become a millionaire. 310 00:26:54,200 --> 00:26:56,360 But you have to separate out the data 311 00:26:56,360 --> 00:26:58,720 because the algorithm will essentially cheat, 312 00:26:58,920 --> 00:26:59,860 typically speaking. 313 00:27:00,160 --> 00:27:02,300 There's kind of a degree to which it will memorize 314 00:27:02,300 --> 00:27:05,680 the data that it sees, so you can't test it 315 00:27:05,680 --> 00:27:07,040 on your training set. 316 00:27:08,740 --> 00:27:09,940 So how do we do? 317 00:27:10,340 --> 00:27:14,660 So this, the approach I just described scores .905, 318 00:27:15,800 --> 00:27:18,280 on the Netflix probe set. 319 00:27:18,900 --> 00:27:22,600 That's about 5% better than Netflix's own algorithm, 320 00:27:22,740 --> 00:27:24,920 which is approximately .95 something. 321 00:27:27,180 --> 00:27:30,700 But some algorithms actually do significantly better 322 00:27:30,700 --> 00:27:33,040 than that, they can get down to .864. 323 00:27:33,800 --> 00:27:36,760 How do they, how are they able to do that? 324 00:27:37,380 --> 00:27:39,500 Can, what improvements can we make 325 00:27:39,500 --> 00:27:43,420 to get better predictions, and do we want to? 326 00:27:45,740 --> 00:27:48,380 Well, before I talk about that, 327 00:27:49,580 --> 00:27:51,000 well, no, I'll talk about that now. 328 00:27:51,220 --> 00:27:54,980 So the answers to these questions are typically, 329 00:27:55,060 --> 00:27:56,120 how do they do that? 330 00:27:56,280 --> 00:28:00,480 In some cases, they kind of do it by exploiting a flaw 331 00:28:01,080 --> 00:28:03,840 in the way that Netflix are measuring success. 332 00:28:04,380 --> 00:28:07,000 To give an example, let's say, 333 00:28:08,160 --> 00:28:12,580 let's say your algorithm predicted things very, very well 334 00:28:12,580 --> 00:28:14,100 for high ratings. 335 00:28:14,100 --> 00:28:16,540 So if a user was gonna like a movie, 336 00:28:17,040 --> 00:28:19,820 then your algorithm's actually very, very accurate 337 00:28:19,820 --> 00:28:21,080 at predicting that type of thing. 338 00:28:21,620 --> 00:28:25,940 If you're, but let's say your algorithm is really bad 339 00:28:25,940 --> 00:28:29,060 at predicting stuff that you don't like. 340 00:28:30,020 --> 00:28:32,880 So if you're gonna rate something at one or a two, 341 00:28:33,380 --> 00:28:36,340 you know, maybe it's producing three or whatever. 342 00:28:36,500 --> 00:28:39,580 But it's just bad at predicting what you'll rate 343 00:28:39,580 --> 00:28:40,960 on movies you don't like. 344 00:28:41,660 --> 00:28:44,080 Let's take another algorithm, which is, you know, like, 345 00:28:44,080 --> 00:28:52,940 is okay at predicting movies that you like, and it's okay at predicting movies that you 346 00:28:52,940 --> 00:28:57,680 don't like. Well, the way that most collaborative filtering 347 00:28:57,680 --> 00:29:03,860 algorithms are used, the first algorithm would be much better, because the way most people 348 00:29:03,860 --> 00:29:09,140 use collaborative filtering algorithms is you generate a bunch of predictions for a 349 00:29:09,140 --> 00:29:16,640 given user, you take the top 10 or top 20 predicted ratings, and you present those to 350 00:29:16,640 --> 00:29:23,180 the user. You never present movies with, or items with 351 00:29:23,180 --> 00:29:28,560 low predictions to the user, so it really isn't terribly important how well your algorithm 352 00:29:28,560 --> 00:29:32,020 does in terms of its accuracy of predicting low ratings. 353 00:29:32,280 --> 00:29:38,840 But it's very important for high ratings. Now, the root-mean-squared error metric will 354 00:29:38,840 --> 00:29:39,120 actually... 355 00:29:39,120 --> 00:29:43,600 You actually prefer the second algorithm, even though in practice the second algorithm 356 00:29:43,600 --> 00:29:48,920 is going to do a worse job. There are other things as well. 357 00:29:49,220 --> 00:29:56,500 One of the things that a lot of the approaches to the Netflix prize, one of the things they 358 00:29:56,500 --> 00:30:03,560 do is they'll look at user mood. They'll look at other movies that you rated 359 00:30:03,560 --> 00:30:06,680 today, and they will... 360 00:30:12,320 --> 00:30:17,560 They'll look at other movies you rated today, and they'll try to figure out, is this guy 361 00:30:17,560 --> 00:30:22,460 in a good mood? Maybe he's drunk or something, and he's rating everything pretty high. 362 00:30:23,460 --> 00:30:28,820 And then they'll kind of raise their prediction for you, because they've decided you're in 363 00:30:28,820 --> 00:30:34,920 a good mood, and thus they will actually achieve a better root-mean-squared error. But in practice, 364 00:30:35,600 --> 00:30:36,520 this has no... 365 00:30:36,520 --> 00:30:40,920 No bearing on the actual effectiveness of the collaborative filter, because the only 366 00:30:40,920 --> 00:30:46,800 thing that matters are the predicted ratings for you relative to each other. 367 00:30:47,200 --> 00:30:54,020 So this is kind of another way that you can do better on the Netflix root-mean-squared 368 00:30:54,020 --> 00:30:59,000 error metric without actually yielding a better result. 369 00:31:01,450 --> 00:31:05,700 So I kind of said I'd talk about what the algorithm actually did. 370 00:31:05,700 --> 00:31:14,640 So, what I did to try to visualize or create a visual representation of what this algorithm 371 00:31:14,640 --> 00:31:27,000 is doing is I set up a run of this and tried to train it using just three features for 372 00:31:27,000 --> 00:31:31,620 both users and items, which is not very much and really doesn't perform very well at all, 373 00:31:31,740 --> 00:31:33,380 but it has a nice property. 374 00:31:35,080 --> 00:31:35,680 Subtitles by the Amara.org community 375 00:31:35,700 --> 00:31:38,440 floating point numbers associated with every movie, 376 00:31:38,620 --> 00:31:41,820 then you can graph those things in three dimensions. 377 00:31:42,980 --> 00:31:45,860 And that's what I've done here. 378 00:31:47,600 --> 00:31:49,940 So each of these dots is a movie. 379 00:31:50,580 --> 00:31:53,540 I've also labeled some of them 380 00:31:53,900 --> 00:31:55,900 so you can kind of get a feel for 381 00:31:57,060 --> 00:31:59,640 whether this algorithm's perception 382 00:32:00,440 --> 00:32:02,740 of what a movie's qualities are 383 00:32:02,740 --> 00:32:07,580 have any relationship to what the actual movie is about. 384 00:32:08,680 --> 00:32:11,720 So in this case, you can see that violent movies are red, 385 00:32:11,940 --> 00:32:13,580 and they're actually spread, 386 00:32:13,840 --> 00:32:16,780 you know, there isn't really any obvious clustering 387 00:32:16,780 --> 00:32:17,940 with violent movies. 388 00:32:18,800 --> 00:32:20,540 You can see that they're kind of spread 389 00:32:20,540 --> 00:32:21,780 throughout the field completely. 390 00:32:22,920 --> 00:32:27,220 Movies about Vietnam, which just turns out 391 00:32:27,220 --> 00:32:28,220 there are a hell of a lot of movies 392 00:32:28,220 --> 00:32:29,580 about Vietnam, relatively, 393 00:32:30,420 --> 00:32:31,800 and you can see those 394 00:32:31,800 --> 00:32:32,720 in dark green colors, 395 00:32:32,740 --> 00:32:35,120 in dark green are kind of higher up. 396 00:32:35,280 --> 00:32:37,220 So there is some degree of clustering, 397 00:32:37,760 --> 00:32:41,400 but it's clear that it's not like neat little, 398 00:32:41,520 --> 00:32:43,940 there isn't a neat little violence cluster, 399 00:32:44,200 --> 00:32:47,940 there isn't a neat little Vietnam cluster. 400 00:32:48,160 --> 00:32:51,140 So it kind of shows that the features 401 00:32:51,540 --> 00:32:55,060 that the algorithm determined would be effective 402 00:32:56,260 --> 00:32:59,220 for the three features that the algorithm determined 403 00:32:59,220 --> 00:33:02,680 would be effective probably don't really map directly. 404 00:33:02,740 --> 00:33:05,220 to the types of classifications 405 00:33:05,220 --> 00:33:06,940 that we would apply to movies. 406 00:33:10,700 --> 00:33:13,920 So this is something I already talked about actually, 407 00:33:14,000 --> 00:33:16,940 the kind of flaws in the root mean squared error metric. 408 00:33:19,040 --> 00:33:20,700 So I'll just skip this, 409 00:33:20,940 --> 00:33:22,760 but basically root mean squared error, 410 00:33:22,960 --> 00:33:25,200 it's okay, but it's, you know, 411 00:33:25,220 --> 00:33:27,860 it's applications to the real world are quite limited. 412 00:33:28,060 --> 00:33:30,760 One way in particular that root mean squared error 413 00:33:30,760 --> 00:33:32,720 is not effective is, let's say, 414 00:33:32,740 --> 00:33:34,360 you want to use this type of approach 415 00:33:34,360 --> 00:33:35,700 to do targeted advertising. 416 00:33:36,140 --> 00:33:39,240 Now if you're trying to pitch somebody 417 00:33:39,780 --> 00:33:42,480 on an algorithm that will improve targeted advertising, 418 00:33:42,820 --> 00:33:45,140 the first question they will ask you is, 419 00:33:45,400 --> 00:33:49,180 what percentage increase in revenue will this yield? 420 00:33:49,420 --> 00:33:51,460 What's going to be the increased yield from this? 421 00:33:51,620 --> 00:33:55,080 You cannot determine that from root mean squared error. 422 00:33:55,340 --> 00:33:57,280 So if you kind of say, hey, well, you know, 423 00:33:57,280 --> 00:34:00,360 the thing scores .905 on the Netflix data set, 424 00:34:00,500 --> 00:34:02,020 absolutely meaningless. 425 00:34:04,460 --> 00:34:05,060 It's not going to be the same for advertisers. 426 00:34:06,000 --> 00:34:08,360 And that's actually true of many, many situations. 427 00:34:08,980 --> 00:34:11,600 It's kind of a, it's a very academic metric, 428 00:34:11,740 --> 00:34:14,840 but academics seem to really like it, despite its flaws. 429 00:34:16,060 --> 00:34:19,680 So what are the alternatives to root mean squared error 430 00:34:19,680 --> 00:34:21,880 that Netflix could and probably should, 431 00:34:23,240 --> 00:34:25,160 but almost certainly won't use? 432 00:34:26,780 --> 00:34:32,720 The simplest one that I've come up with is models the way 433 00:34:32,740 --> 00:34:36,700 you actually use these algorithms quite closely. 434 00:34:36,920 --> 00:34:41,400 So what you do is you rank the items by, for a given user, 435 00:34:41,560 --> 00:34:46,140 you rank the items by what your algorithm predicts that, 436 00:34:46,320 --> 00:34:50,500 how much your algorithm predicts you will rate those items. 437 00:34:51,330 --> 00:34:54,100 You set a threshold so you kind of have a cutoff 438 00:34:54,100 --> 00:34:59,340 at the top 20 items, and then you look at if any 439 00:34:59,340 --> 00:35:02,640 of those items are in your probe set, the kind of, 440 00:35:04,080 --> 00:35:06,500 thing you've set aside that you haven't trained 441 00:35:06,500 --> 00:35:10,520 the algorithm on, you look at the average actual rating 442 00:35:11,160 --> 00:35:15,780 of the items that find their way into this set 443 00:35:15,780 --> 00:35:16,860 of top 20 items. 444 00:35:18,940 --> 00:35:22,380 And then that is actually a metric that you can translate 445 00:35:22,380 --> 00:35:26,420 directly into, you know, if you're talking to advertisers, 446 00:35:26,440 --> 00:35:29,900 for example, this is the percentage increase 447 00:35:29,900 --> 00:35:32,580 you're going to get if you use this type of a 448 00:35:32,740 --> 00:35:36,100 specific approach to target your ads to your users. 449 00:35:41,460 --> 00:35:44,060 So, where can we take this in the future? 450 00:35:44,180 --> 00:35:47,480 And actually, a lot of this I've kind of developed 451 00:35:47,480 --> 00:35:50,260 a lot further than what's described in this talk, 452 00:35:50,380 --> 00:35:52,160 so I'm kind of talking about the future, 453 00:35:52,220 --> 00:35:53,900 but this is stuff that I'm doing right now. 454 00:35:54,920 --> 00:35:57,240 Can we incorporate more data? 455 00:35:57,500 --> 00:36:02,720 Are there ways that we can take more diverse data and use it 456 00:36:02,740 --> 00:36:06,440 to make better predictions for users? 457 00:36:06,880 --> 00:36:11,360 Well, the problem with most collaborative filtering 458 00:36:11,360 --> 00:36:15,140 algorithms is that when the only form they accept data 459 00:36:15,140 --> 00:36:19,040 in is, user A liked item B this much. 460 00:36:19,480 --> 00:36:22,120 But, there's a lot of information available to you 461 00:36:22,120 --> 00:36:24,760 about both users and items that are not in that form. 462 00:36:25,080 --> 00:36:29,740 For example, let's say, let's say you're operating 463 00:36:29,740 --> 00:36:32,720 a website, let's say you're Netflix, and you're operating a website, and you're operating Communicationability. 464 00:36:32,720 --> 00:36:40,680 There are a whole load of things that you can determine about users based on even the HTTP request coming in. 465 00:36:40,800 --> 00:36:42,520 So you can look at their user agent string. 466 00:36:42,860 --> 00:36:45,200 You can figure out, you know, are they a Mac user? 467 00:36:45,240 --> 00:36:46,200 Are they a Windows user? 468 00:36:46,500 --> 00:36:47,600 Do they use Firefox? 469 00:36:47,980 --> 00:36:49,300 Do they use Internet Explorer? 470 00:36:49,800 --> 00:37:00,920 All of this metadata potentially holds information that you could use to more effectively predict what this user is likely to be interested in. 471 00:37:00,920 --> 00:37:10,300 You can also, the user's geographic location, many other things are available to you right from the very first moment that user visits your website. 472 00:37:10,560 --> 00:37:12,480 Why can't you use this stuff? 473 00:37:14,220 --> 00:37:19,120 Well, actually, we did figure out a way to use this information. 474 00:37:19,420 --> 00:37:28,380 So the software that we wrote, you can tag both users and items. 475 00:37:28,460 --> 00:37:30,640 So if you know a user is using Firefox. 476 00:37:30,920 --> 00:37:32,240 You can give them a Firefox tag. 477 00:37:32,440 --> 00:37:36,260 If you know a user is using Windows, you give them a Windows tag. 478 00:37:36,420 --> 00:37:40,940 If you know they're in Las Vegas, Nevada, you can give them a Las Vegas, Nevada tag. 479 00:37:41,380 --> 00:37:49,360 It will then look for correlations between these tags and actual user behavior. 480 00:37:49,840 --> 00:37:56,000 And you might ask, well, you know, what does the fact that I use a Mac really say about me? 481 00:37:56,080 --> 00:38:00,660 Well, it turns out that in some of the experiments we've done, for example, 482 00:38:00,920 --> 00:38:07,240 one in an online news website, we discovered that Windows, or rather the algorithm discovered 483 00:38:07,240 --> 00:38:18,060 that Windows users are, or Mac users are 20% less likely to click on a news story about religion relative to Windows users. 484 00:38:18,880 --> 00:38:23,660 So, because Steve Jobs is their god and they don't believe in any other, I assume. 485 00:38:26,200 --> 00:38:30,900 But, you know, and we found like all sorts of crazy correlations. 486 00:38:30,920 --> 00:38:42,940 You know, between whether they use Yahoo Mail or, it turns out Yahoo users are a lot more likely to click on anything relative to Gmail users. 487 00:38:43,260 --> 00:38:46,420 They cannot see a hyperlink without clicking it. 488 00:38:46,660 --> 00:38:55,420 And as a result, like some, I do work with targeted advertising companies that send email. 489 00:38:55,580 --> 00:38:59,540 They claim they're not spammers because it's targeted, opt-in, blah, blah, blah. 490 00:38:59,760 --> 00:39:00,900 But what's amazing... 491 00:39:00,920 --> 00:39:06,740 What's amazing is that for almost all of them, approximately 80% of their users use Yahoo Mail. 492 00:39:07,610 --> 00:39:18,720 Which is, and they don't really know why, they think maybe it's just, there's something about the Yahoo Mail user demographic that makes them very gullible. 493 00:39:19,340 --> 00:39:30,900 So, anyway, all of this metadata is potentially very useful, and we've figured out a way that we can give this metadata to our algorithm, 494 00:39:30,920 --> 00:39:42,980 and it will identify correlations in user behavior using this metadata, and that allows it to bootstrap much more quickly. 495 00:39:43,620 --> 00:39:51,660 And this is critical for many applications because, as I said at the outset, one of the flaws, specifically with user-based collaborative filters, 496 00:39:51,820 --> 00:39:55,140 is that they require a very dense data set to be effective. 497 00:39:55,940 --> 00:40:00,900 But even the approach that I've described, this gradient descent approach, is very useful. 498 00:40:00,900 --> 00:40:04,160 It still requires quite a bit of data about users. 499 00:40:04,780 --> 00:40:10,240 And, depending on the scenario, you typically don't know a lot about most of your users. 500 00:40:10,460 --> 00:40:17,040 If you're operating a website, and you want to use a collaborative filter to show people stuff they're going to like, 501 00:40:17,280 --> 00:40:22,320 and the guy who sold you the collaborative filtering algorithm says, 502 00:40:22,500 --> 00:40:29,100 yes, as soon as a user has spent 100 hours on your website, we'll be able to start recommending stuff that's relevant to them, 503 00:40:29,160 --> 00:40:30,380 that's completely useless. 504 00:40:30,380 --> 00:40:40,280 So you really need a way that you can bootstrap your model of what a user's interests are, 505 00:40:40,400 --> 00:40:49,020 and by feeding the algorithm any scrap of metadata you can get about that user, that's a way to do that. 506 00:40:50,480 --> 00:40:58,660 The feature model, this mathematical model, is pretty simple. 507 00:40:58,660 --> 00:41:02,100 It's basically, you multiply things together, and then you add them all. 508 00:41:02,360 --> 00:41:03,660 Could it be more complicated? 509 00:41:04,160 --> 00:41:11,660 Well, yeah, there probably are ways that you could perhaps throw some more complicated formulae in there, 510 00:41:11,780 --> 00:41:14,720 some trigonomic formulae in there, 511 00:41:14,880 --> 00:41:22,280 and maybe that would allow the model to more effectively represent what users are interested in. 512 00:41:22,480 --> 00:41:25,420 This is something on my to-do list, I haven't really done it yet, 513 00:41:25,420 --> 00:41:32,820 but it seems like if I could perhaps use a genetic algorithm to come up with a mathematical formula 514 00:41:33,300 --> 00:41:39,540 that I then try to train to predict user behavior, I may be able to get better results. 515 00:41:40,920 --> 00:41:47,240 One of the other things I've done, and then I think we'll probably have some time for questions, 516 00:41:48,780 --> 00:41:53,560 is what about the circumstances in which the recommendation is taking place? 517 00:41:53,560 --> 00:41:57,580 I know that if I'm, for example, listening to music, 518 00:41:57,780 --> 00:42:07,060 my tastes in the morning are probably different to the type of music I want to listen to at 10 o'clock at night. 519 00:42:07,320 --> 00:42:09,960 Is there any way we can actually take advantage of this? 520 00:42:10,140 --> 00:42:13,300 Well, actually it turns out that you can, 521 00:42:13,540 --> 00:42:18,060 and there's this mechanism that we call circumstance tags, 522 00:42:18,240 --> 00:42:22,000 where you can basically say, give me some recommendations for this user. 523 00:42:22,000 --> 00:42:26,160 By the way, it's evening time where this user is. 524 00:42:27,160 --> 00:42:30,860 Or, give me a set of recommendations for this guy. 525 00:42:31,140 --> 00:42:35,200 By the way, he's looking at recommendations on this page of our website. 526 00:42:35,500 --> 00:42:40,980 So you can essentially describe the circumstances that this user is in at that moment, 527 00:42:41,160 --> 00:42:48,220 and the collaborative filtering algorithm will try to reverse engineer patterns in user behavior 528 00:42:48,220 --> 00:42:51,980 as they vary throughout, perhaps throughout the day, 529 00:42:52,000 --> 00:42:55,220 if you're using time of day as a circumstance tag, 530 00:42:55,440 --> 00:43:01,200 or perhaps a user's behavior on different parts of your website changes, 531 00:43:01,340 --> 00:43:03,860 and you can use that information as well. 532 00:43:04,920 --> 00:43:09,920 So lastly, I've got some videos online. 533 00:43:10,120 --> 00:43:12,560 If you go to sensoray.com, 534 00:43:12,800 --> 00:43:18,580 a lot of this research I've described is part of this software, Sensoray, 535 00:43:18,660 --> 00:43:20,640 that I've been working on. 536 00:43:20,640 --> 00:43:23,340 And feel free to check it out. 537 00:43:23,560 --> 00:43:27,380 And their email address is there if you have any, 538 00:43:27,480 --> 00:43:30,100 well, if you think of any questions on doing that. 539 00:43:30,460 --> 00:43:34,660 But since I think I've got a few minutes, 540 00:43:35,220 --> 00:43:38,980 if anyone has any questions, feel free to ask. 541 00:43:40,020 --> 00:43:44,600 Yeah, I was wondering about this algorithm where you multiply how much you like something 542 00:43:44,600 --> 00:43:47,400 by how much the product has of that something, 543 00:43:47,640 --> 00:43:49,180 and you add all the things together. 544 00:43:49,180 --> 00:43:53,920 Well, what if you're the type of user that you'd only buy it 545 00:43:53,920 --> 00:43:56,400 if it has the five features you're looking for? 546 00:43:56,600 --> 00:43:58,800 And so a product that has four features, 547 00:43:58,960 --> 00:44:00,080 if you were to use that algorithm, 548 00:44:00,360 --> 00:44:05,920 then you would predict that that person is only 80% or is 80% likely to want that product, 549 00:44:06,160 --> 00:44:08,400 when in reality, he's 0% likely, 550 00:44:08,580 --> 00:44:12,120 because he doesn't want a product with just the four features he wants the product with. 551 00:44:12,780 --> 00:44:13,260 Right. 552 00:44:13,400 --> 00:44:16,980 So the question was, if I can condense it, 553 00:44:17,020 --> 00:44:18,880 . . . 554 00:44:18,880 --> 00:44:27,380 what if four features do not adequately represent the qualities of a item 555 00:44:27,380 --> 00:44:32,420 from the perspective of whether a user may or may not find it, be interested in it. 556 00:44:32,800 --> 00:44:33,720 And you're right. 557 00:44:33,940 --> 00:44:38,820 So what I find is that the fewer features I give the algorithm, 558 00:44:38,960 --> 00:44:40,940 the less well it performs. 559 00:44:41,180 --> 00:44:48,340 So I gave it three features to generate that crazy rotating cloud thing 560 00:44:48,340 --> 00:44:49,460 with all the dots in it, 561 00:44:49,640 --> 00:44:52,420 and that performed very badly. 562 00:44:52,560 --> 00:44:55,440 So that performed, I think it was 0.96 RMSE, 563 00:44:55,640 --> 00:44:58,740 which is worse than Netflix's own algorithm. 564 00:44:58,980 --> 00:45:01,080 As you increase the number of features, 565 00:45:01,160 --> 00:45:05,480 the performance increases because the system is basically able to figure out 566 00:45:05,480 --> 00:45:10,380 a more nuanced idea of what the user is interested in. 567 00:45:11,040 --> 00:45:14,060 And what I find is I keep increasing the features, 568 00:45:14,120 --> 00:45:17,380 and I find that once you hit about 64 features, 569 00:45:18,340 --> 00:45:23,240 it starts to kind of level off in the increase in performance you get 570 00:45:23,240 --> 00:45:24,720 on most datasets, 571 00:45:24,920 --> 00:45:29,280 which suggests that you can do a reasonably good job 572 00:45:29,280 --> 00:45:32,340 of representing what somebody is interested in 573 00:45:32,340 --> 00:45:34,860 in 64 floating point numbers. 574 00:45:35,480 --> 00:45:36,880 And that's pretty good, 575 00:45:36,960 --> 00:45:40,280 because 64 floating point numbers is not a lot of data. 576 00:45:41,180 --> 00:45:44,840 So, you know, that gives you a lot of flexibility. 577 00:45:45,120 --> 00:45:46,680 You can transmit . . . 578 00:45:46,680 --> 00:45:47,620 Well, if you wanted to, 579 00:45:47,620 --> 00:45:49,700 you could very easily share with other people, 580 00:45:49,940 --> 00:45:53,460 here is my block of 64 floating point numbers 581 00:45:53,460 --> 00:45:54,620 that represent my interests. 582 00:45:54,920 --> 00:45:56,560 Go and give me stuff that I like. 583 00:45:56,760 --> 00:45:58,880 Now, of course, there are privacy implications to doing that, 584 00:45:59,020 --> 00:46:00,900 but from a technology point of view, 585 00:46:00,960 --> 00:46:02,280 it's pretty exciting. 586 00:46:02,660 --> 00:46:03,380 Sir, at the back. 587 00:46:13,100 --> 00:46:16,080 Could you just repeat the last . . . the training time? 588 00:46:17,580 --> 00:46:19,420 That's absolutely right. 589 00:46:19,620 --> 00:46:23,440 So the time required to train increases pretty dramatically 590 00:46:23,960 --> 00:46:26,280 as you increase the sophistication of the algorithm. 591 00:46:26,500 --> 00:46:29,760 So when I first implemented this, 592 00:46:29,920 --> 00:46:33,700 it took about nine minutes for one training cycle 593 00:46:33,700 --> 00:46:35,700 on 100 million ratings. 594 00:46:35,960 --> 00:46:41,040 And it would typically start giving good output 595 00:46:41,040 --> 00:46:44,860 after maybe 40 or 50 training cycles, 596 00:46:44,860 --> 00:46:49,100 which, you know, so a day, it's performing pretty well. 597 00:46:49,880 --> 00:46:51,080 When I . . . 598 00:46:51,080 --> 00:46:52,960 That's on a small number of features. 599 00:46:53,080 --> 00:46:54,600 As you increase the number of features, 600 00:46:54,800 --> 00:46:56,600 there are several things that slow it down. 601 00:46:56,780 --> 00:46:59,780 Firstly, there's just more numbers it needs to multiply and add, 602 00:46:59,940 --> 00:47:01,380 and that slows it down. 603 00:47:02,820 --> 00:47:05,000 Secondly, the gradient descent algorithm 604 00:47:05,000 --> 00:47:09,300 is operating in a space with higher dimensionality. 605 00:47:09,520 --> 00:47:11,140 So if you can . . . 606 00:47:11,140 --> 00:47:14,800 The kind of two-dimensional surf . . . 607 00:47:14,800 --> 00:47:17,900 The surface that I kind of had a rotating picture of, 608 00:47:17,980 --> 00:47:19,720 that's operating in two dimensions, 609 00:47:20,040 --> 00:47:22,820 but imagine trying to do gradient descent 610 00:47:22,820 --> 00:47:25,160 in 64-dimensional space. 611 00:47:25,380 --> 00:47:31,920 It just takes longer to find the lowest point 612 00:47:31,920 --> 00:47:34,720 on this 64-dimensional surface. 613 00:47:35,980 --> 00:47:37,720 The . . . 614 00:47:37,720 --> 00:47:40,140 Yeah, so you're absolutely right. 615 00:47:40,260 --> 00:47:41,800 It does slow down dramatically 616 00:47:41,800 --> 00:47:44,780 as you increase the number of features. 617 00:47:44,800 --> 00:47:45,860 But the good news is, 618 00:47:45,940 --> 00:47:50,960 you really only have to train the collaborative filter once, 619 00:47:51,580 --> 00:47:56,000 so it doesn't really matter if it takes even a couple of days. 620 00:47:56,180 --> 00:47:57,640 And then after that, 621 00:47:58,580 --> 00:48:01,160 you really just kind of need to maintain it 622 00:48:01,160 --> 00:48:02,540 as you collect more data. 623 00:48:02,720 --> 00:48:05,560 So scalability and kind of CPU time 624 00:48:05,560 --> 00:48:07,640 tends not to be a bottleneck 625 00:48:07,640 --> 00:48:09,740 in this type of collaborative filter, 626 00:48:09,940 --> 00:48:11,580 although many collaborative filters 627 00:48:11,580 --> 00:48:13,520 are extremely CPU-intensive, 628 00:48:13,520 --> 00:48:16,140 and that poses a problem. 629 00:48:16,320 --> 00:48:17,660 I've got two minutes left. 630 00:48:17,720 --> 00:48:18,440 Any more questions? 631 00:48:21,380 --> 00:48:21,980 One there. 632 00:48:30,420 --> 00:48:32,020 Mm-hmm. 633 00:48:34,300 --> 00:48:35,500 Mm-hmm. 634 00:48:39,440 --> 00:48:40,240 Yep. 635 00:48:43,660 --> 00:48:45,700 Okay, so the question was, 636 00:48:45,960 --> 00:48:49,800 what about how people's interests change over time? 637 00:48:50,280 --> 00:48:53,320 And I'm not sure what Netflix does about that. 638 00:48:53,440 --> 00:48:55,660 Your experience would suggest they don't do anything. 639 00:48:55,940 --> 00:48:57,280 My approach to that is, 640 00:48:57,340 --> 00:48:59,220 my algorithm will forget old data. 641 00:48:59,700 --> 00:49:01,460 So it, you know, 642 00:49:01,540 --> 00:49:05,040 basically when it's decided it's using too much disk space, 643 00:49:05,200 --> 00:49:07,320 it'll start throwing away the oldest ratings. 644 00:49:07,580 --> 00:49:11,400 And so there is an extent to which it will focus more 645 00:49:11,400 --> 00:49:14,260 on your more recent ratings. 646 00:49:14,480 --> 00:49:16,500 But I think there is a lot of scope to examine, 647 00:49:16,740 --> 00:49:17,400 you know, 648 00:49:17,400 --> 00:49:20,260 just how quickly do people's interests change. 649 00:49:20,500 --> 00:49:21,600 Like, my approach to that 650 00:49:21,600 --> 00:49:23,160 is a pretty kind of brain-dead approach, 651 00:49:23,320 --> 00:49:24,860 but it seems to be relatively effective. 652 00:49:25,100 --> 00:49:26,080 But you're absolutely right. 653 00:49:26,220 --> 00:49:27,880 People's interests do change over time. 654 00:49:28,100 --> 00:49:31,440 A lot of collaborative filters don't acknowledge that fact. 655 00:49:33,860 --> 00:49:35,340 One minute left, I think. 656 00:49:36,880 --> 00:49:38,400 Okay, thank you very much. 657 00:49:41,400 --> 00:49:41,520 Thank you.