where what's left is only the uncertainty that you yourself don't know, right?


Planning to Explore via Self-Supervised World Models (Paper Explained)

You say, well, this state has a pretty high total uncertainty.


But it's not due to the fact that the world itself is uncertain.


It must be due to the fact that I don't know yet.


And they make the claim that their model is actually going after these things.


And they say, okay, because we have these these Gaussians here as our estimators, they


somehow reduce to this total to this uncertainty, but only basically by taking Gaussians, they


assume, they just assume that this quantity here is constant.


At least that's how I understand it.


They basically assume that every transition in the world has about the same amount of


uncertainty.


And therefore, we can just focus on the total amount of uncertainty, right?


So if we can't predict, if we can't predict the next state a, we can predict the next


state a better than the next state b, and both have about the same amount of intrinsic


uncertainty, stochasticity in the world, that must mean we should go to b, because that's


where our model hasn't learned yet.


Now, of course, in the real world, that is absolutely not the case.


And I think this model works mainly because they test it in these transitions, or in these


environments where that might be very close to accurate, that actually, most of the transitions


have the same stochasticity as any other transition.


The second, the second part why this is a bit difficult is because you have to somehow


keep this latent, sorry, this, this couple of models right here, that make this disagreement


prediction.


So you rely on the fact that you can capture disagreement by looking how those models disagree


with each other.


And again, they employ Gaussians here, but it is not said that these things, these things


will actually give you the true disagreement among themselves.


If you initialize them wrongly, they might miss, like if, if your distribution has three


nodes, they might just for all of them focus on one of them, and then your disagreement


will be completely out of whack, or you could initialize them not far enough or, or too


close together.


That's the same thing.


So it all depends on kind of how you manage to handle this uncertainty right here.


So all of this seems a bit problematic, but the whole setup is pretty cool.


Because imagine like all of this is shifting constantly, right?


The the the policy here tries to maximize these rewards.


And that's something I don't understand in the paper, they make it sort of explicitly


clear that the policy tries to maximize this quantity right here.


The next uncertainty, the planning objective is to maximize expected novelty RIT, which


is this thing right here.


However, I don't actually see why in that case, you need planning.


Because with planning, your goal is sort of to look ahead more than one step.


So what I would expect is that they somehow have the aggregated somehow that they not


don't maximize this, but somehow they maximize the future right of T prime of RT prime i,


they somehow maximize the yes, they somehow maximize the future the total future maybe


with a disagreement, like if it was a reward, and you actually want to maximize the total


reward across your episode, I would imagine they use planning to maximize the total future


uncertainty that they encounter.


Because right here, you have your trajectories.


And as they say it, they only maximize the uncertainty after the first step.


So this here might be, you know, even intrinsically uncertain or a bit uncertain.


But if you go down the path here, there might be a state where that's super uncertain.


And you would like to find that right through your different rollouts.


So I'm not sure that the paper is correct or consistent here, actually.


I might be wrong, though they do have the code, which is a really good thing.


So I'll link to the code and you can go and explore that.


They do have this algorithm down here, which is pretty much I mean, this is saying just


nothing.


While exploring do train the world model, train the latent disagreement ensemble, train


the policy in imagination of like, rather, rather, it helps a bit.


Okay.


But one other thing right here, the policy that tries to maximize the reward, right?


So you use planning to look ahead where the uncertainty is.


But how do you do the planning?


You need the you need a policy in imagination space, right?


This latent disagreement policy here is used to train how you act in latent space, right?


How this action that you imagine comes to be, you can't plan in imagination space and


in imagination space use planning again, this is just an infinite recursion.


At some point, you need a model that tells you what to do.


And in imagination, they just use an actor critic model, you see they have a value function


here, they just use an actor critic model to basically one shot predict the next best


the next best action to get you to the next step.


So as they themselves rag on these model free methods, because they only look ahead.


How is that not exactly the same as me ragging on the fact that they use model free and imagination


space?


Because your world model certainly is retrospective, your world model learns from the past, right?


So the model free method that learns on your imagined world model learns from retrospective


imagination, and therefore, it itself has sort of the same problem, just one layer deeper,


that it learns from retrospective data and not from data ahead.


Because your uncertainty about the future might just be because of your retrospect,


exactly is because of your retrospective data.


And I see the value in having this uncertainty.


But I think there are other methods that also do model free, and don't just maximize an


intrinsic reward, but actually maximize a sort of uncertainty.


Okay, enough ragging, let's go to the experiment.


So the cool thing you can do with this is what's called zero shot performance.


So what they do is, in the first step, they do this, they just learn task agnostic, just


explorer without task.


Then second, they go and into their buffer.


So when they explore, they all save, they save what they do, there is no reward, but


they just save, they store their episodes, right?


And then someone comes with a task, and the task is simply, they specify like you have


to run forward, and they go to this buffer, and they now label every episode with its


reward.


So this is different, this is like offline reinforcement learning, right?


So basically, it is how well they call it zero shot, but it is how well can an algorithm


that has explored with self with this kind of self supervision, perform in in offline


reinforcement learning on the trajectories that it has already experienced, which is


different from performing the same trajectories in a in a with the reward, because you would,


you would learn from the reward and you would learn to seek out different like your experience


would be different if you're going after a reward.


So this is harder.


So they compare this to dreamer.


And dreamer sorry, is a fully supervised method.


The dreamer is actually cheating dreamer actually goes after the reward.


And all the other methods here, they don't have a reward and just they're just zero shot


offline reinforcement learning generalized to these methods.


And you see the green is the plan to explore.


And that, that outperforms almost all the other methods right here down here, and even


comes close to this to the dreamer that goes up here, it seems pretty much every graphic


that dreamer is the one that's able to cheat, right?


So it is performing pretty well.


But then the zero shot generalized plan to explore is sometimes on par and certainly


outperforms the other intrinsic reward methods.


Now how does that go about when you try actually when you allow the model to fine tune on the


task.


So here is performance on few shot adaptation from raw pixels without state space input.


So basically, you learn without reward for this many steps right here until this shaded


area back here.


This is how when you do no reward.


And then all of a sudden, now you say, Okay, now I'll give you reward.


Now please learn.


Now you have this many steps.


You have this many steps where you can learn from the reward.


So now we're no longer in this offline RL setting.


This is now online RL.


But we've been pre trained with all of this experience that we had without the reward.


Again, the orange here is the cheater.


So the orange is is cheating.


And now we don't so before the graphs were higher because we've we've actually at each


step, for example, how this works is you train until here without reward and then you do


this offline RL offline RL training.


And that's how this point comes about.


Now I think in the graph down here, they they don't do that.


So they just measure how well you're doing in the task.


And of course, if after this many steps, you've never looked at the reward, you haven't been


able to look at the reward, your reward will be fairly low right at the task because you


don't know what to do to get a high reward.


The dreamer again, this orange line is able to cheat.


That's why it just is basically straight line or goes up at the beginning, it's able to


look at the reward from the beginning.


And it's here as a baseline comparison.


So you see as soon as you give the reward to the models, they generally shoot up.


And this plan to explore generally shoots up much harder than these others, as you can


see, pretty much everywhere.


And again, it gets competitive and here even outperforms the dreamer.


Why could it outperform the supervised method?


Maybe because these this method here is sort of confused or is stuck in a local optimum,


which can happen very easily in reinforcement learning.


Whereas the plan to explore has never seen the reward, therefore hasn't tried to just


single mindedly maximize the reward, and has explored a bunch of different things to do


in the world.


And now we can use that knowledge to outperform the plan, the dreamer the baseline.


So the other thing I would like to draw your attention to here is that sometimes you see


that the plan to explore or the other curiosity methods actually get a reward before the reward


kicks in as we saw here, right?


For example, right here.


And this tells me that this is probably a property of the environment itself, namely


these reinforcement learning environments, they're they don't really have much noise


going on, right?


They pretty much just have it's a simulator with one figure that can walk or not.


And therefore, it might be that the only interesting thing to do in these models is to actually


perform one of these tasks.


And that's why it might be that the sometimes you they already get a reward.


So it's true that they don't see the reward for this entire duration, but also implicitly


via the developers building the simulator, they have made it such that the only interesting


thing to do is the same thing as getting a reward, right?


So I'm sort of skeptical that this is like a general exploration policy.


Because also in the real world, there are just combinatorically hugely many, many actions


to do many paths to follow.


And if you just go by what do I not know yet?


I think you can't you can't put that all into one model.


It's just too much.


And the states where you really were really something interesting happens are so few and


far in between.


And that it doesn't compare to the amount of states where you simply don't know.


Most states you don't know what's going to happen, but probably nothing's nothing interesting


is going to happen just different things, which will screw over this method completely.


In any case, they Yeah, sorry, this is just this is another experiment.


They have a bunch of other experiments.


And yeah, that was my this was my review of the paper.


Tell me if you agree or disagree or if I've misunderstood something that's entirely possible.


I am just always a bit skeptical of these things a bit.


So the experiments, they're very compute intensive, of course, so you never know there and then


these specific environments right here.


You never know there and then the fact that the real world actually has very different


stochasticity, which they simply assume away right here.


Yeah, but other than that big props to the fact that the code is out.


And as I said, leave a comment if you agree or disagree.


Please subscribe and share this video if you liked it and I'll see you next time.


GPT-3: Language Models are Few-Shot Learners (Paper Explained)

Hello there. Today we're looking at language models are few shot learners by Tom B. Brown,


Benjamin Mann, Nick Rider and Melanie Sabaya and a whole of authors, whole slew of authors from


OpenAI. This paper also called GPT-3 just came out recently. So GPT-3 is a model that is a language


model and it comes out of a succession of language models of OpenAI. This paper is basically an


investigation into what you can do with giant language models. Now this language model is an


order of magnitude larger than anyone has ever built a language model and it can do some absolutely


crazy things. So we'll basically go over the architecture, over what the model does and over


the experimental results. It turns out that if you train a language model on enough data,


it is able to solve NLP tasks that it has never seen just out of the box. And we're gonna look


into this very cool kind of formulation of the problem. As you can see here the paper is 40


pages long without the appendix. It needs its own table of contents which is crazy. So we're going


to skip a fair bit of things. So first of all, what is a language model? For those of you who don't


know, I've done a bunch of videos and you can see those in my natural language processing playlist


about language models and specifically about transformer language models. So a language model,


let's just take an example this sentence right here. Just the sentence as such like third humans


do not require large supervised datasets to learn most language tasks. This is an English


sentence. And a language model would be a model that if you cross out a portion from the end here,


like this right here, it would be able to tell you what comes next. So in a language model,


you would input this part right here. And it will tell you the next word is data sets. So that's


basically all the language model does. And once you've trained one, you can basically generate


word after word after word from it. Or you can ask it a question like which word is most likely


to come next or more likely. So a language model is nothing but a model that can kind of generate


language in a probabilistic way. And the cool thing about language models is that you can train


it on any sort of text data. And that's what they do here. So they train a language model on giant


amounts of data. Specifically, right here, they go into the data sets they use, they use this,


let's skip down, they use this common crawl data set, which they filter down for quality. And this


is basically a crawl of the entire internet, if you will, together with these books, data sets,


and the web text data set, and the Wikipedia data set. So they throw all of this text that they


scrape from the internet together and then train a language model on that. Now the the the the


the language model right here is called GPT-3. And they train various sizes of it. And we'll get into


how it's built in a second. But just compare this to a language model like BERT. BERT required this


much flops to train. And these, this is a log scale. So this is right here, this is several


orders of magnitude, larger and bigger model and is trained for way longer on this text. So


naturally, it is going to be a lot better at language modeling. You can see right here the


size of these models that they trained on. Remember, the previous largest language model,


the Turing NLG of Microsoft had something like 17 billion parameters. So it would be comparable


to this right here. Whereas GPT-3 has 175 billion parameters, which this is absolutely crazy,


is an order of magnitude higher than anything that's ever existed. And if you look at the last


GPT, the GPT-2 model that if you remember, I've made a video about it is too dangerous to be


released. Well, now it has been released, but was too dangerous to be released. It clocked in at


about 1.5 billion parameters. So compared to this GPT-3XL model right here, they train these multiple


models to basically estimate the effect of the model size. And you can see here, the largest


model has 96 attention layers. Each layer has 96 attention heads, and each head is 128 dimensional.


And it trains on batches of size 3.2 million. This is the batch size. Absolutely crazy. So


they train this on a giant distributed cluster that apparently is provided by Microsoft. And


yes, crazy, crazy things. So how does this model look? This model is a transformer model. And right


here, we don't even have like a description of a transformer model. It's just assumed you know


what that is. I have made several videos on transformer models, and especially things like


attention is all you need or BERT or something like this. But for those who don't know, if I


have a transformer model, and I want to build a language model from it, let's take this sentence


right here, I would input a what's called a context, which is the thing I already have,


right? I would input that into a transformer model. And a transformer model is just several layers of


attention mechanism. Now an attention mechanism is basically a way where information is routed


in between the different tokens right here. And as it goes up the layer, basically, the


information is routed around and the model can make various inferences. And at the end,


the model is supposed to come up with the next word that you're going to put here.


Specifically, in this paper, they use sub words like word piece tokens, like it is common in NLP


right now. But essentially, this is an autoregressive language model. So it's not like


BERT, it's not bi directional, it is autoregressive, it goes from left to right, always produces the


next word. It is like GPT-2, they even say this, they say, we use the same model and architecture


as GPT-2. They just have more layers and wider layers and more data to train it on. So how do


they train it? Okay, that's we already said they train it in simply in simply a language modeling


way, just next word prediction. That's it. Okay, it's so it's not even something fancy like BERT.


The interesting part is when you do the now the the single tasks. So what you usually did


with something like BERT, so with something like BERT, you would do first pre train.


So there you would this is the language modeling right here, this pre training phase,


where you teach BERT about the English language by just feeding it a lot of data.


And then second, you had a step called fine tuning. Fine, I can't even write tuning. So on the second


one, you'd have something like the task you're actually interested in. And let's say the task


you're actually interested in is sentiment classification. So in sentiment classification,


you have like a sentence like blah, blah, blah. And you want to know is that a positive sentiment,


like is a happy sentence, or is it a sad sentence. And you would have a database of labeled instances


of that. So in this database, you'd have a bunch of sentences. And for each one, you would know,


is it good? Is it is it positive? Or is it negative? And then you'd have like a smaller


test set right here. And you would, you would train, you would basically take this pre trained


model, train it on this data set in a supervised machine learning way, and then test it on this test


set right here. This is called fine tuning. That's what they display here. So in fine tuning,


the model is trained via repeated gradient updates using a large corpus of example tasks.


Right. So the example task right here could be translating to French. So in your training


database of the translation task would be this would be sea otter is called l'outre de mer.


And in and and then you'd actually change your model, you do a gradient update. I mean, if,


if you're in the NLP world, this seems very natural. But they are going to argue in a second


that this isn't the only way that you can teach a model a task, right. So this this seems very


natural, right? You're going to change your model, you take your pre trained model, and you're going


to fine tune it on this task. And if you have a different task, right, if you have now question


answering task, you're going to have a different data set right here with a train and test data set,


and you're going to take the pre trained model, and then fine tune it on that data set and evaluate


it on that test set. So this gives you basically with as many models as you have tasks and you for


each one, you need a big, big training data set in order to perform well, sometimes we have this,


sometimes we don't, what they are interested in is basically to take the pre trained model


and directly go and evaluate it on the test data set in a sort of a zero shot fashion.


Now it is not zero shot as they will argue. So what are they doing? In a true zero shot fashion,


you would just take your, your language model that you pre trained and you just input the


following text, you input what they call a task description and a prompt. So this is the input.


And you're simply asked the model as a language model to predict the next word, it's just what


comes here. Now what you're counting on is basically that in the training data, the model has


seen a structure like this enough to understand what's going on. So that in the training data,


somewhere in the internet, there was the structure of translate something to something, and then there


would be a word here of something. And you kind of has to realize that this goes here, like that the


next word. So basically, what you're asking it is, if you were to find this text on a website,


or on Wikipedia, or in any of the books data set, if you were to find this piece of text, what would


be the next word in that piece of text, and you kind of hope that this, this is enough, if you've


trained a good language model, that this is enough to actually produce the French translation here.


Now, before I realized, I've said the language modeling is to teach the model the English


language, actually not true. In this Common Crawl corpus, you also have many foreign languages. So


you basically teach you the general model of the internet. Now they contrast this to what they call


one shot learning. So in one shot learning, you not only do you have the task description right


here, and this is this is a string, right, you don't specifically tell the model that this is


now a translation task, you simply input this as a string. So not only do you have the task


description, and the prompt right here, but you also have one example. And the example, and this


is where they, this is where they bring in the, where they say it's not exactly zero shot, where's


my little drawing here. So the example is going to come from the training data set of the task that


you're interested in. But the important part is you never train on it, you never explicitly train


on that example, you simply put it in the context. So you simply put this string, so translate English


to French new line, sea otter is l'outre de mer new line, cheese is what you simply input that string


into the model as a language model, and you ask it, what's the next word right here?


Okay, so I hope I hope this is clear. This is what they call kind of one shot generalization.


And by one shot, they basically mean you simply provide this thing in the context of the model


as a language model. Now, the, the advantage here is immediately clear that you only have to train


one model, then and then basically at inference time, you can just input the task description


and the sort of training data for the task into its its evaluation context, and the task itself.


And it will, if, if it is if it really does what they claim it does, it would be able to


sort of understand the prompt here, understand what it means to translate from English to French,


it would look at this example and say, Oh, that's what you want me to do, okay. And then it would


be able to generalize to this input right here to say, Ah, okay, from the task description and the


example, I get I get what you want me to do, I will the next word here is cheese. What's cheese


in French? I don't remember fromage fromage. Now, the way the language model is going to interpret


that is slightly different. As we said before, the way the language model is going to interpret is,


if you were to find the following text on a website somewhere, the text is called translate


English to French new line see order goes to the new line cheese goes to what would be the next


word on that website. So that's what the model sees, right? You have to differentiate between


what the human wants and what the model sees. The model is just a language model that is going to


take the next that is just going to determine if I were to see this text somewhere, what will be the


most likely next word. So you have to phrase your tasks in a way that makes sense in that thing.


And they also have this few shot thing where you not only provide one context, but you provide a


bunch of context to basically tell the model more of what it what it should do. Right? Now, this


doesn't only work in a free mode where you basically say, what's the next word here, what


you can also do if you have such a language model with the exact same model, you can give it basically


a couple of possibilities. So you can give it it's you can say like, it's either shop, or it's from


us, or it's a bit. I think that has like this. So you can you can basically restrict it to only


produce one of these three things. So in translation, this might not be, you know,


the the way to go. But in if you have like, yes, no answers, questions, you can restrict it to that.


So in a lot of these NLP tasks, you have some options given for a given question. And you can


also restrict it. So don't, you know, you always have to go with the task at hand. But this is in


essence what the model does. And this is I think, this is the new, well, not the new per se, but


this is one of the core ideas of this paper, if you take anything from it, there's no new architecture


right here, there's no new wisdom in training, they train in a standard way, in a standard language


modeling fashion, a standard transformer architecture, this just happens to be ginormous. Okay, this


right here, this thing where they say, most of these things would fine tune and then basically


end up with one model per task, and you need a big data set per task. But we simply, we


simply can do this, since we have such a large language model, it is basically already basically


already knows how to do this tasks, as long as we formulate them in a language model way, we can


have the model perform these tasks. And they will show that this works surprisingly well throughout


this paper. Now we get into the experimental results right here. And the experimental results,


first of all, on language modeling, as you can see here, they basically say, as you go up with


the parameters, you see the more yellow ones are the parameters, you go into your validation loss


goes down and down and down and down. And I believe this is sort of a log scale as well. So


this is the log probability. So the perplexity and that the this basically follows a trend. Oh, no,


this is a log scale. This, this is a log scale. It follows a trend where as you scale up the model,


and as you scale up the compute that the model gets, and we know for these big language models,


we basically know you have to scale up model size, compute time, and data set size in the same


fashion for them to make these gains. But if you do that, it follows like a power law where as you


scale up these things, the model basically gets better and better and better. And the question,


of course, is, you know, how far how far can we go with this, but for now, it seems to hold quite


well that you can just make improvements by scaling up your model on language modeling, at least. So


where do we where do we basically go from here? So before we dive into the actual results of the


individual tasks, and now they're going to formulate these individual tasks. So they have


like pure language modeling tasks right here, like Alice was friends with Bob, Alice went to visit


her friend, and then it's like, what's the next word? Okay, it's Bob. And George bought some


baseball equipment, a ball, a glove and a what's the next word? And I guess this should be hat,


sorry, bat right here. But we're going to go into the into the tasks. And one of them is, for example,


question answering. So in question answering, you simply get either you get just a pure question or


a context and a question. And they do the fact they test where a situation where you just get


the question. So you just get I don't know who is the queen of England, or something like this. And


the model is simply to produce either the results direct, or to choose from a bunch of answers,


which one is the most likely as a language model. And as you can see, as you scale up the language


model, the zero shot, one shot and few shot predictions. So in few shot, you give 64 different


examples from the training set in the context. So you always have, so your context is going to


look something like this. And they have examples at the bottom and haven't looked at the QA task,


but the the example is going to be something like this. You have a task description like answer


the following questions, answer the question. And then you have your examples in zero shot, that's


zero in one shot, it's one. That's what I like. And then you say, how tall, who, sorry, who,


sorry, who, I don't know, who climbed Everest the first, the first. And then you say, Hillary,


I think it was Hillary. No, I don't remember. And then you say, I don't know how, how tall is the


Empire State Building. And then you have like some number here. And at the end, you say,


what was the question from before? I don't know. Who is the Queen of England? Yeah. Who is the


Queen of England? And then you ask the model to predict the next word right here. Okay. And


you do this in a closed book setting, which means you have no access to Wikipedia or whatever. Like


usually these systems, they can go and query Wikipedia, but this system doesn't say anything.


This system doesn't. So you just want to know what has the model learned about the world


by simply absorbing giant amounts of text. So if somewhere in the training data, the fact that the


Queen of England is Elizabeth II is present, it should complete this right here. And it performs


surprisingly well, as you can see here. So it manages to outperform a fine tuned state of the


art model that is actually that is fine tuned on question answering, right? This has it has been


built for question answering. And this model outperforms it by simply having a lot of language.


So this here is the results on on these open domain QA tasks. And you you see right here,


it the this this few shot it outperforms this open domain and open domain means that the model can


go and look at some Wikipedia page. And yeah, so so this is pretty cool. But there are other things


like the natural questions where it underperforms compared to this open domain thing. And they say,


this is mainly due to the natural questions being like, it's very much about factual Wikipedia


knowledge and so on. Maybe, like the question we just made maybe is more of a natural question


type of thing. And since and the model is apparently not as good at that, but it's still


impressive that the model is able to do this out of the box. Okay, so before I said, something like


before we go into the experiments, I want the following. So I have like some sort of hypothesis,


it's not it's an it's not an uncommon hypothesis, that basically these things, these giant language


models, right, they're just these transformers layer after layer after layer with their connections


in here. What I think is happening is they are simply storing the training data, right, they're


simply storing the training data in these connections right here. So usually you think of


storing the training data in some form of maybe we have like some module right here, some database


module in the neural network, and it learns to query the module. But ultimately, if you train a


neural network, what you have is data, and you train a function with parameters on that data.


And ultimately, what you're doing is you're distilling the data into these parameters. And


you kind of hope to learn some regularities from it. But ultimately, the information about your


training data influences or determines your final parameters of your function. Now, I can imagine


that if you have such a giant neural network with so many weights, like 17, sorry, 170 billion


weights, that you can pretty efficiently actually store the training data in that model. And when


you ask this model now to do something, what it basically does is what these people sort of


argue is that it has learned these language tasks has learned to reason over language and so on,


what I think is happening much more is it will simply go to the training data, since it has


stored the entire training data in its weights, and it will sort of pull out the five to 10 to 50


training examples that are most relevant to what you put in. And it will sort of interpolate right


you go to the training data, and it will pull out a bunch of training samples that are relevant to


the context you put in right now. And then it will sort of integrate those into the next word


that's going to come out right here. And I think if you look at this paper in terms of this, so you


always write you input a context, and the context is split into a task description. And then it is


split into k different examples. And then it is it is it has a prompt sorry, this here this is the


prompt. So the task description is please translate from English to French and the k different things


are k different translations. And then the prompt is you know what what you should do. So it's like


half of a k half of one of these boxes right here. So these boxes are have blah, blah, blah turns to


blah, blah, blah. And then the prompt is simply without the the right side. I think what it does


is it will simply take all of this. And it will go to its own training data, which it has stored


in its weights. And it will filter the training data, and basically take out the things that sort


of pattern match sort of regex match in a fuzzy way to this context. And then it will kind of


interpolate these training examples in order to come up with the answer. I don't think there is


reasoning happening here. And I'm we're going to if you go through the paper with this view,


then you can a lot of things actually make sense. And I actually I think that we need we need what


we need when people think of like explainable machine learning. They often think that if I'm


going to input something like I'm going to input an image into a classifier, and it comes out a


certain class car, I like the explainability should be Oh, which part of this image was it the


wheels? Was it the hood? Which part of the image which part of the input image is responsible for


making that determination? What I think in especially in these language models, what we


should do is if the model predicts something right here, the next word, I think we should


somehow have a method of determining which of the training examples that the model used to


interpolate given this context, because I'm pretty sure these training is you will find.


So if you'll find that, for example, this weight and this weight and this weight was very responsible


for making this prediction happen, I'm pretty sure you can somehow during training build an index


of which of the which five training examples had most influence on that particular weight or on


this combination of weights. And then you can sort of go backwards and say you made this decision


right here model, please tell me which of the training data samples were responsible for making


that decision. I'm actually pretty sure that already exists. Like I'm never the first one to


think of these things, though, if I am site me site the channel. No, but just an interesting way


to think about this model. And an interesting way to think about kind of what does what would


explain ability even mean in a model like this. And my argument is since it interpolates the


training data, the interpretability should come from the fact of which training samples does it


interpolate? Okay, let's go to translation. So in translation, as we said, they simply input the like


the task and then the few examples and then and then the output, okay. And you can see right here,


what you can see is that, again, as the model goes up in parameters, the performance generally


increases. And also, you can see that the performance is pretty good every time that


this model goes to English. So it goes if it if the target language is English, which sort of


makes sense, because like a large part of the corpus they train on is English. So being an


English language model, it should be pretty good if it is asked to produce English. And it's not


as good if it is asked to go into the different direction. Now what you also see is that it is not


really a difference whether you translate from from which language you translate, but if you go


to English, but it very much matters to which language you go if it is from English. So this


sort of makes sense in that it is just trained on a lot of English data. And it's not as good if it


is not trained on English. And right here, sometimes they are on par with the with the


state of the art supervised methods. And also other times they outperform these methods right


here. And these methods are unsupervised, but are specifically so they don't have a supervised


training data set that goes, let's say from English to French, but they are built with this


model. And they are not supervised. And they are not supervised, but they are trained on


English to translate later. So they are sort of task specific, but don't have a supervised training


set. And this model right here, it just learns whatever it learns. And it just it just does it


appear it can now translate reasonably well. Okay, now. Yeah, so the results here are a bit noisy,


but it is still interesting to see that it sometimes even gets close to the supervised


thing, though they say that they are not familiar with the literature and are not sure that these


models that these numbers are, you know, good. Okay. Okay, the next thing is these Winograd schemes,


where you do have up where is the text here is a classic NLP task that involves determining


which word a pronoun refers to when the pronoun is grammatically ambiguous, but semantically


unambiguous to a human. So these are sort of human produced sentences where it's kind of


pronoun could refer to multiple things. I don't have a example present, but where do we have the


right here, you can see that this model will out produce a fine tuned BERT large, but will


not out produce a fine tuned Roberto large. So it is going to it is going to come it is competing


at least with the fine tuned models that were made specifically for that task, right? Again,


this is pretty, pretty interesting. And you also see that the larger models here, it starts to


make a difference whether or not you give it one zero or one or more examples. Okay.


So we'll get into we'll get into the the more interesting things right here. In


this thing right here. Where is it? Yes. This is the kind of a physical,


physical question, physical QA, where it is a bit of common sense reasoning. So you're asked to I


don't. Yeah, these are like science questions. Multiple choice questions collected from a third


to ninth grade exams. And the physical QA is physical QA asks common sense question about


how the physical word work world works, and is intended as a probe of grounded understanding


of the world. So it has questions as I understand it, it has questions like if a drop a ball,


will it fall on the ground? Or where will it fall or something like this. And they say that they


can outperform a fine tuned state of the art model on this if they go just high enough. And you can


also see that there isn't much of a difference between zero one and few shot. The methods of


this model right here, even though zero shot is even higher than one shot. So this is probably just


noise. But then you find out that they have an asterisk here. And this means that this is


potentially a contaminated data set. So they have potential contamination issues. So what they found


was there was a significant overlap between the data set, this data set, and their training data


set. And they even they only realized this too late because there was a bug in their deduplication


code. And then they couldn't change it anymore. Like I because this model is so large, that they


couldn't restart the training because they've already spent like so much money and energy on it.


This is crazy. I think these language models are getting so large that we should building them,


we should more think of it like we built the the International Space Station or something like this,


where it's a project where humanity sort of collaborates or there's a big effort and you


build it once and whatever you have, you have, right. So these these good numbers here are simply


or not simply are because or could be influenced by this contamination. And I think that's what's


happening right here. Even though they will make the case that this contamination isn't really an


issue, I can probably show you that it might be it maybe actually is an issue. Because on the other


data sets, at the the fine tuned state of the art model outperform the GPT-3 quite a bit.


So and also the the fact that the you know, if you provide a demonstration or many demonstrations,


it doesn't actually change that much. It kind of tells me that the model sort of already knows


what the answer is, and doesn't really need demonstrations, because it doesn't help if you


have the training data stored, or the the test data, you don't really have to get demonstrations,


right. So they have a few other a few other things right here, where on these COCA task,


they perform pretty poorly compared to others or poorly, let's say they perform well, but not


particularly more well than a state of the art. And they perform especially well,


perform especially poorly on the reading comprehension. Sorry, that's the that's the COCA.


So in reading comprehension, what you have to do is abstractive multiple choice and span based answer


formats in both dialogue and single question settings. So basically, if you read a piece of


text like this, and then answer a question about the piece of text. Now, this is something where I


think you cannot really interpolate the training data super well. And therefore, so you can't


really just pattern match and interpret because you have to do actual reasoning. And I think


that's why the model performs poorly here. They do measure this on on super glue, which is a NLP


benchmark. And also here, you can see it doesn't outperform a fine tuned state of the art model


on these tasks. But it does outperform a fine tuned BERT model slightly. The BERT model is


fine tuned on these things, whereas GPT-3 isn't. But notice the tasks in which it does well and in


which it doesn't do well compared to the state of the art model. So for example, in the BoolQ,


it doesn't do particularly well, right? The state of the art is 91, it only has 76. That's quite a


large difference and actually have the glue benchmark open here. And you can see this is the


the BoolQ. So an example here would be, is France the same time zone as the UK? And then there is


like a passage and you need to reason about from this passage about whether or not this answer is


true or false. Okay. This this is very much not language modeling, this is reasoning. And that's


why the model is doing poorly here. Whereas in another thing, you see this, for example, this


COPPA right here, the model is doing almost as good as a fine tuned state of the art. And I have


to stress this model has never actually learned this task in a supervised way. It's simply a


language model. And I have this COPPA task right here. And these are the examples. So one example


is the premise, the man broke his toe, what was the cause of this? And you have two different


things that it could be. Either he got a hole in his sock, or he dropped a hammer on his foot.


And the way you phrase it in this model is you would give the premise as the context. And then


you simply ask the model since it's a language model, which of these two things is more probable


to come. And of course, it is going to select the thing that kind of happened more often in the


training data. And, you know, broke his toe. The cause of breaking his toe that is a hammer, this


is entirely conceivable that a language model would know this and with enough training data


could sort of pull from the training data examples where hammer on foot and broke toe appear a bunch


of times and hole in sock would be rather unrelated. So as long as these questions are not


too adversarial, constructed specifically that a language model can't solve them, the model is


the model is going to perform pretty well right here, right. So it's very interesting to see that


if you view this as interpolating the training data, it suddenly makes sense where it's good


and where it isn't good. So this was the super glue. And and


NLI, it is performing particularly poorly on NLI, which is the ability to understand the relationship


between two sentences, right. So where the model classifies whether the second sentence logically


follows from the first contradicts the first or is possibly true neutral. Okay, so this is the


reasoning part of this model is not given. It is simply recalling the training data and doing


language modeling. Now they say, oh, we can test this, we can test this with synthetic and


qualitative tasks. So they invent some own tasks since you know now it's pretty easy since you


don't have to fine tune the model, you don't have to generate an actual training set for a task. So


you can focus on generating a test set and and you know, that's what they do. So they do something


like arithmetic. So they say, okay, can we come up with a bunch of arithmetic tasks, for example,


two digit addition. So what the model would see would that this is an example and what the model


would see is simply this as a context right here for the prompt. And if you give it examples. So


if this is like one shot learning, you would input add the following numbers, the following numbers


as a string, right, then a new line. And then you would give it one example, like what is 11 plus


12. And with the answer together with the answer, answer is, I don't even know, 23. And then you,


the prompt goes here. So what is 48 plus 76? And then you ask, what is the next word right here?


What is the next string token that comes here? Now, the the inference here is that if the model


manages to do this, it can't simply because these are all strings, the model basically has no clue


how to do math. These are numbers to the model. These are just tokens as strings. And the inference


is if the model can do this, it must have learned, you know, some kind of reasoning ability, it must


have learned to like perform some logic inside. So they go into two digit addition, three digit


addition, four digit addition, five digit addition, and even multiplication and subtraction. And the


results are right here. So as you can see, the lower parameter models, they perform pretty poorly.


But as you go up the parameters, the big model is performing really well in the two digit range is


performing also really well. So accuracy of look that accuracy 80 90% in three digit addition and


subtraction. But then if as soon as you get to the four digit or the two digit multiplication, and so


on, the performance drops. Now, they say that's because multiplication is harder. And you know,


it's logically very computationally, you know, but the two digit addition and so on model has


learned something about the world. I disagree. Because so here's the because. What you will do


is you will simply and this, you simply recall the training data. So look at the two digit addition


with zero shot, you already get 76%. But with one shot, you get 99%. And with few shot, you get


100%. So if you interpret this model as simply filtering the training data to pattern match,


then it makes a lot of sense that the one shot would like the examples here will give you a


much improvement. Because if you have a bunch of examples, where please add right add, and then,


oh, I erased our example again. So you have like 48 plus 72 equals blah, blah, blah, you have


these of this, if you give more and more example, all of a sudden, this looks like a table. And


they say, we made sure that the strings here, these particular strings were not in our training


data, right? So these strings never appeared. But I just have an issue with this D duplication stuff,


because what can appear actually, is not the what can appear is a table. And in table, often you


have columns, and then another column will be the sum of these columns on the left. And if you are


asked to pattern match, you'll naturally find websites, right? If you have a few of these


examples, you'll find websites where the columns exactly refer to these things. And then you'll


find the sum here. And if you filter for websites that appear to match your scheme in the examples,


you'll find all the website with a table on them, where the column one column is an addition of the


others. And I can actually do that. So I went and I typed in just a bunch of these things. So


I'm 98 plus 45 is 143. 18 plus 55 is 70, I believe at least. And I can find now Google makes it hard


because they localize and everything. But you can still find what you're going to find our tables


and tables and tables and tables. And now I actually went to doc.go to basically say,


hey, you know, they don't, you know, really personalize it to me. And what's the first thing


I find when I type in just these numbers is math, skip counting, missing sequence number, and a


website where basically, the answers are already given. Look at that. So all the model has to do


is recall this particular training example from the samples it already has, right? And it will


it will basically be able in quotes to perform addition like this is financial data and another


one where you have to subtract stuff, right? So I'm pretty sure all the model is doing here is


interpolating the training data. And that's also why it performs worse if if you up the digits,


because longer digit numbers are simply less frequent in the in in the training data.


Multiplication is first of all less frequent. And second of all, it also results in larger numbers,


which are less frequent, right? So it explains a lot. So I yeah, I have my issues with people


saying yeah, this this shows some reasoning. I don't think it does. The same thing here with


word scramble. So in word scramble, they have different things you see, okay, they they they


look whether or not only 17 matches 0.8% of the math things are in their training data is like,


no, you haven't searched well enough. And the rest of their duplication, by the way, is also


pretty weak, I would say, because they just look for like 13 gram overlaps between the training


data and the in the and their their test data. So they have these word scrambling tasks where


they basically scramble words, and they ask the model to unscramble it. For example, this word


is inevitably scrambled. So they always you know, they give like anagrams and they give random


insertion into the word like this word right here, or they reverse the word. And they say so


this I think this is the thing at the very beginning. But if you can see right here,


also as the model goes up, then this this improves and they also say, Well, this means maybe some


kind of reasoning. But I think this is just it's learning the language and it's learning that,


you know, the the words in in sorry, that the letters make up a word, and the letters correspond


to word pieces are associated with word pieces. And it always learns to English. A good task to


check this would actually be to scramble words. So if you unscramble words, you always end up with an


English word. So all it has to do is basically check which word has the highest overlap in word


pieces. But you could do something like please scramble this word and then always count it


correctly when any of the scrambling of the words. So instead of going from this to this,


which you can simply solve by knowing the English language. But you would have basically


no clue what the task is that you don't have to understand that as a model, you could ask it to


go from this to this given a few examples, right, then it would really need to understand what the


task is that it's supposed to actually scramble a word, and would need to learn that from its


context given examples. But they, as far as I see, they don't do that. And again, I think it's


recalling the training data. This is SAT analogies. So the SAT are this test that US high schoolers


take to get into college. And they say a typical example. This is dying on me. No, it's scrolled.


Okay. A typical example is the following. This I find pretty hilarious. Audacious is to boldness.


Boldness as sanctimonious is to hypocrisy. Anonymous is to identity remorseful is to misdeed.


Deleterious is to result or impressionable is to temptation. This is a as a okay, I'm not a native


speaker, but this is a hard question, right? And you have to, you know, see that these these high


schoolers, they're stressed, like this is very much a time based test. So you need to make a


decision quickly. Well, the model, of course, is basically able to sift through its entire


training data in the time it takes the GPUs to perform inference. But it's still funny that GPT3


achieves 50, 65% in the few shot setting, and 59% in one shot setting, 53% is zero shot setting,


whereas the average score among college applicants was 57%. So it outperforms the average college


applicant. It's pretty funny, but you would expect the language model to have a pretty good grasp


of these kind of synonyms and relations between words, because these are just absolutely


statistical associations between words. So yeah, this, I found this to be pretty, pretty funny.


And the last thing, and this is what everyone's freaking out over, is this news article generation,


where basically, they give it the beginning of a few of a news article. And then they let humans


decide whether or not the news article is written by a machine or by a human. And they say, here,


by contrast, mean human accuracy at detecting articles that were produced by the 175


billion parameter model was barely above chance at 52%. Human abilities to detect model generated


texts appear to decrease as model size increases. There appears to be a trend towards chance


accuracy with model size and human detection of GPT3 is close to chance. Okay. So what they do is


they give, and they have some examples right here, they give the model the following input,


the title, the subtitle of an article, and then this word article. And the model is supposed to


complete the rest of the article right here. And you can also, you know, give, do this in a few


shot setting such that the model basically knows that it's, if you give it a few, a few examples,


the model knows it is supposed to produce a news article, right? Okay. So there are two, two ways


that you can think of this. First way, the model has learned the language so well, and it writes,


it has learned to write coherent language and so on. It's learned to reason, keep context and blah,


blah, blah. Okay. Second way, the model sees this thing right here. It sees the few, you know, k


few shot examples that it has before in the context. It will take them, filter the training


data to, in this case, it just sees news articles. So do just news articles. It will take this thing,


filter the training data even more to just the news articles that pertain largely to topics or


words that appear in here. And then lastly, it will interpolate the few training examples to


produce this thing. Now they argue that this isn't really possible because they have actually checked


that this news article is not in the training data. But I have simply gone and taken a,


I've really taken a random substring here. I've taken this substring, voted to strengthen the


ban on the ordination of just this substring. And I've put it into Google and I find a book with


voted to strengthen prohibitions to ban LGBTQ people from being ordained and ministers. So it's,


you know, I find this, it's not the same article, but it's talking about the same incident the


article talks about. And it is using the same language, probably read the article and the


author is like, I can't really, you know, copy paste that would be, you know, not really cool.


So I'll just kind of, you know, write it in my own words, but largely the same thing. The Associated


Press here, also a different article, you know, see different title than this one right here,


but about the same thing. And also with the same language, right here, voted to stay to strengthen


the faiths, divisive bans on same sex marriage and ordination of LGBT clergy. And generally,


so the argument, this article wasn't in the training data is just not really something I buy


in this, in this case. So I think it, the article as such wasn't there, but many articles about this


topics were, and I think this will just interpolate these. Now they say this was the hardest article


for the humans to decide. And this here was the easiest. So it's, it says, I don't know,


Star Tuck's Promise draws Megyn Kelly's sarcasm. It says a year ago, Joaquin Phoenix made headlines


when he appeared on the red carpet at the Golden Globes wearing a tuxedo with a paper bag over his


head that read, I'm a shapeshifter, blah, blah. You would guess that Joaquin Phoenix would do something


like this, but they say their human raters were US based, right? And you see right here, it says,


Megyn Kelly was not impressed and she let him have it on the Tonight Show. Now the Tonight Show


is not where Megyn Kelly is and US based people would, I guess, know something like this and would


immediately feel like this is wrong. So I think this thing is interpolated from a bunch of different


news articles about this and the interpolation just let it, like made it, that this person is


on this show, which they aren't and the humans noticed, right? But it doesn't change the fact


that it probably just went to the training data, filtered a bunch of articles about these words


and then interpolated, like mashed them together. It is a good language model, right? It can


grammar, it's very good at grammar. So we can interpolate different passages of text.


And I feel that the really, really useful application of this will be sort of as a search


engine, as a fuzzy search engine. So now I can like input, for example, my machine learning


research ideas and what will output will be sort of an abstract of a paper that is kind of a mush


together of other papers on the same thing. And that, you know, you can think of many applications.


I don't think we have built something really intelligent here. And what this is, though,


is pretty cool. They give examples like this here, where they make up a word and then ask the model


to use the word in a sentence. So to scree is something, sorry, to screech something is to


swing a sword at it. An example of a sentence that uses the word screech is. And of course,


the model, what's the model is going to do is it's going to take this, it's going to filter


the training data for all of the instances where sort of this construction appears, like an example


of using the words, which is mostly sort of dictionaries, then it's going to not know that


word, but it can interpolate it from all this data right here. And so the cool thing is it actually


conjugates the word. We screeched at each other for several minutes, and then we went outside


and ate ice cream. So you can see how this comes to be. But I think it would really be fun to have


a model that tells us which training data samples were used here. It can also correct English grammar


which is pretty obvious, though again, it can never correct. So the input always here is


poor English, good English, poor English, good English, poor, good, poor English, and then good


English. And that's what the model is asked to output. And I'm actually not sure, pretty sure


this here shouldn't be bold. I'm fairly sure this shouldn't be bold. This is given to the model. The


model is only asked to produce this. Otherwise I'd be actually impressed. But yes, nothing


task specific is provided aside from the examples, from few examples as conditioning, and the poor


English input, good English output framing. So the good English output thing here should not be in


boldface. Authors, if you're listening, this should not be bold. Thank you. Okay, but again, it is


always, as you can see, it's too good English. It's always the target is good English. Whereas


if the model really understood the task, it should also be able to do the inverse. It should be able


to produce something poor from something good, because then you eliminate the fact that it's


just a good English language model, right? Because it can basically produce something like this


without having a clue what the task is. It will simply, you condition on this input, and it will


simply output this sentence because it's very likely, because it's already almost here, and it


will output it in better English, because it's a good language model, right? It's a good English


language model. So, yeah. So they measure this overfitting the degree to which their training,


to which their test data is in this common crawl thing. And they say they have a conservative


bound on how many percent of the data in the data set are clean. And as you can see here,


they measure then how much the performance differs to up or down if you only use the


only evaluate on the clean portion of this data set. But again, their deduplication is so weak,


they do like n-gram deduplication. Whereas I think you should really, like in the news articles,


you should really do much more fuzzy deduplication, much more of a meaning deduplication


if you then want to argue that the model has learned to reason. Like if you simply want to


argue that the model is a good language model, fine, right? But yeah. And also look at this,


like I would expect of a data set, a test data set, if you have like a natural questions data


set that is constructed from Wikipedia pages, and you have the Wikipedia page in there,


you can either the entire thing is clean or none of it is clean. And also these Winograd data set,


if this data set somehow leaked into the common crawl corpus, either the entire thing is clean,


or none of it is clean. I just have kind of problems with the fact that there are so many


in between things right here. And yeah, so I'm not convinced here that this deduplication,


I still think it's a cool thing. But I don't, I think it's mostly a training data filter and


interpolator rather than actual reasoning. And they go through some of the limitations here.


And the broader impact, this broader impact statement is like five pages long. And yeah,


okay, you can do you can, you know, bad people take the model to do bad things. Okay. And


that's pretty much it. So what I appreciate here is at the bottom, they have basically all the


results, but also a lot of task descriptions, like how they framed each tasks, more outputs,


and they give more outputs on their website, right. So you can see here how each of the tasks


was framed, where you always have this is what this here is what the model sees. And then this


is what it's asked to produce, right. So you have this for for all many of these things. And so in


SQUAD, you have this context and the question. Okay, so the the context is actually in there,


I didn't know that. But you have the context and the question and the model is asked to complete


something right here. So you can look at how the model sees tasks. And maybe you can evaluate for


yourself how you think how difficult you think these tasks are. Alright, I hope this was informative.


It is a long paper, therefore it is a long video. If you're still here and haven't subscribed yet,


do maybe if you like this. If you want more, leave it a like, tell me in the comments what


[Rant] Online Conferences

Hey machine learners, Janek here. Okay, that is stolen. Today I want to give some quick thoughts


[Rant] Online Conferences

about online conferences. As you might know, iClear this year is fully online because of the global


[Rant] Online Conferences

situation. Big props to the organizers of the conference for putting something together in this


[Rant] Online Conferences

short amount of time. iClear is one of the largest machine learning conferences and if you're not


[Rant] Online Conferences

registered you don't get access to that website right now. Today I'll just talk about things that


[Rant] Online Conferences

are public and we'll do like analysis of what happened when the materials are actually released.


[Rant] Online Conferences

If you want to run an online conferences there are basically two things you need to take care of,


[Rant] Online Conferences

actually three. One of them is networking but it's going to be online. We're gonna have to sacrifice


[Rant] Online Conferences

that. I know there are efforts but let's be real. So there are paper presentations and there are


[Rant] Online Conferences

things like talks, panels, workshops and so on. For the papers in iClear what they have is their


[Rant] Online Conferences

website and you can kind of click on each of the papers you get to a sub page and you'll find a


[Rant] Online Conferences

video that the authors uploaded which is about five minutes long. You'll get the abstract and


[Rant] Online Conferences

the reviews directly there from Open Review and during the poster sessions you'll have a chat


[Rant] Online Conferences

window where you can chat with the authors and so people can come there and kind of chat about


[Rant] Online Conferences

the paper at a given time. What people have pointed out here and I agree is that watching


[Rant] Online Conferences

a five-minute video often you need like two or three minutes of that video to even see whether


[Rant] Online Conferences

you're interested in the paper which is much longer than you would have at a poster. At a


[Rant] Online Conferences

poster you could clearly see people say they just open the PDF and just kind of gloss over it and


[Rant] Online Conferences

that takes 30 seconds to decide whether or not you're interested. If I were to suggest an


[Rant] Online Conferences

improvement it would be also have the authors upload a poster. So at a glance you'll be able


[Rant] Online Conferences

to see what interests you right. For the talks and the panels the talks are pre-recorded and then


[Rant] Online Conferences

there is a question and answer session that is live. The questions are voted beforehand and then


[Rant] Online Conferences

the most voted questions I believe will be answered in a live session by either the talk


[Rant] Online Conferences

giver or the panel discussionists. That is the conference but what what are we doing here? I kind


[Rant] Online Conferences

of think it's a paradoxical thing to take the live conference and just try to map it as closely as


[Rant] Online Conferences

possible to online. Look at these paper poster poster sessions right. It is cool that you have


[Rant] Online Conferences

all this but now I have to go at that particular time to chat with the authors and this is in


[Rant] Online Conferences

competition to everything else that's happening at the same time right. So there will be a hundred


[Rant] Online Conferences

papers that are presented in a given session and now I can go to this one and chat here but I'll


[Rant] Online Conferences

miss the chat over there. Of course I can read it later but the only reason that is in the live


[Rant] Online Conferences

conference is because everyone's just there for one week right. That's about the span you can hold


[Rant] Online Conferences

people in one place. So you need to cram things at the same time. So you're at the poster session


[Rant] Online Conferences

you will miss this poster if you go to this poster right. You just don't have time. But online we're


[Rant] Online Conferences

not constrained by this. So why are we doing this at the same time? Why aren't we doing this


[Rant] Online Conferences

asynchronously? We actually have a perfect system for doing things like this. It's called YouTube.


[Rant] Online Conferences

You publish a paper you can make a video it can be five minutes, it can be 30 minutes. You put it on


[Rant] Online Conferences

YouTube. You link to your paper your abstract and your reviews you can put them in the description


[Rant] Online Conferences

and then okay there's no live chat but there is a comment section. I appreciate all of you thank


[Rant] Online Conferences

you. But we have a perfectly fine system for that to do this in an asynchronous way. I don't see the


[Rant] Online Conferences

benefit of having really this live chat and the talks and the panels the same thing. You have you


[Rant] Online Conferences

already have pre-recorded talks. What are you doing having them compete with other things at the same


[Rant] Online Conferences

time like okay I'm going to go to this workshop but this one's happening too. Right now I have to go


[Rant] Online Conferences

and decide because everything needs to be crammed into this one week. It just seems to make no sense.


[Rant] Online Conferences

For example on our channel machine learning street talk we have guests on and we'll do reddit threads


[Rant] Online Conferences

to ask people which questions would they like the authors or the people that we have on to answer


[Rant] Online Conferences

and people up and down vote the questions and then we have a panel discussion. We could even do this


[Rant] Online Conferences

live right on YouTube and then record it and it will be almost the same experience because let's


[Rant] Online Conferences

be honest if Yoshua Bengio is in a panel in a live conference you'll be lucky to even get a single


[Rant] Online Conferences

question and it will almost never happen that you'll get a follow-up question because you're


[Rant] Online Conferences

right there live. It's just not something that is really happening. I think the main advantage of


[Rant] Online Conferences

these live conferences is the fact that you're there. If you go to a poster session the face-to-face


[Rant] Online Conferences

interaction is something very different from a chat window. You can kind of see what the author


[Rant] Online Conferences

is thinking in real time. You can ask them questions. So in writing you can always weasel out of difficult


[Rant] Online Conferences

questions or so. Yeah so it seems like you you lose all the benefits of the live conference but


[Rant] Online Conferences

if you do it in this way you retain all the bad sides namely the crowdedness, different things


[Rant] Online Conferences

competing at the same time, entry fees. I get it it's a lot of work to build this website and so on


[Rant] Online Conferences

but we have YouTube and Reddit and that already covers like 95% of what this is doing. I always


[Rant] Online Conferences

think of this I don't know if it's a myth when the car was first invented it still had the pulleys


[Rant] Online Conferences

to pull the horse because people were just used to horse buggies and not cars. It seems like we're


[Rant] Online Conferences

doing the same thing with online conferences. We were just so used to the live conferences that we


[Rant] Online Conferences

don't see the mega possibilities that we have online. These are my thoughts on online conferences.


[Rant] Online Conferences

If you agree disagree leave a comment and maybe in the future we'll go to true online conferences


[Rant] Online Conferences


Matplotlib Tutorial 4 - Scatter Plots

What's going on everybody welcome to the fourth matplotlib tutorial video. In this video we're going to be talking about scatter plots.


Matplotlib Tutorial 4 - Scatter Plots

So scatter plots are a real simple type of graph. Generally the idea of a scatter plot is to either show correlation between something or sometimes a distribution.


Matplotlib Tutorial 4 - Scatter Plots

But generally correlation or some sort of relationship between two types of variables.


Matplotlib Tutorial 4 - Scatter Plots

Or at least in our case two types because this will be a X and Y but later on down the road when we talk about 3D scatter plots you can actually compare three variables at a time.


Matplotlib Tutorial 4 - Scatter Plots

So that's pretty cool. So like with population ages or something what we could do is you know maybe age to disease or age to cancer rate or something like that and we could compare.


Matplotlib Tutorial 4 - Scatter Plots

But in the interest of not being dismal we'll go ahead and just use some sample data that we make up. So let's just get rid of basically all of this information.


Matplotlib Tutorial 4 - Scatter Plots

We'll leave the X label, Y label, title, legend, and show. That's fine.


Matplotlib Tutorial 4 - Scatter Plots

So to do scatter it's pretty simple you just do appeal to dot scatter and then you scatter your X's and your Y's and you can give it a label.


Matplotlib Tutorial 4 - Scatter Plots

And we'll call this skitscat and then we'll give it a color of K.


Matplotlib Tutorial 4 - Scatter Plots

And then what we're going to want is some X's and some Y's so we'll just say X and here's another well we'll just do it simply actually.


Matplotlib Tutorial 4 - Scatter Plots

X equals an empty list, Y equals an empty list and we'll do 1, 2, 3, 4, 5, 6, 7, 8.


Matplotlib Tutorial 4 - Scatter Plots

I can't type anymore so we'll just stop at 8 and then we'll just put some random variables in here. Bam. Done.


Matplotlib Tutorial 4 - Scatter Plots

Okay so you've got your X's, your Y's, your scatter down here, you're ready to rumble. Here we go.


Matplotlib Tutorial 4 - Scatter Plots

Bam. So you've got a scatter plot and you've got basically the little dot dot dot kind of denotes that this is to let you know it's a scatter plot basically.


Matplotlib Tutorial 4 - Scatter Plots

So pretty simple stuff that's really nothing more to talk about on a scatter plot.


Matplotlib Tutorial 4 - Scatter Plots

One thing that you can do too is you can have a marker and the marker on a scatter plot is like the type.


Matplotlib Tutorial 4 - Scatter Plots

So right now we have an O because it's a circle that's filled in basically.


Matplotlib Tutorial 4 - Scatter Plots

There's a whole bunch of markers so this would be like a star for example.


Matplotlib Tutorial 4 - Scatter Plots

You can't really tell but that's a star so it's a very small star.


Matplotlib Tutorial 4 - Scatter Plots

So another thing that you might do is comma marker size and I believe the default is 1 so if we did something like I don't know 10 we should wind up with a pretty big marker.


Matplotlib Tutorial 4 - Scatter Plots

Marker size maybe, marker underscore size let's try that one on.


Matplotlib Tutorial 4 - Scatter Plots

Let's try that one on for size. Oh god I made myself laugh.


Matplotlib Tutorial 4 - Scatter Plots

Okay we can't get marker size apparently.


Matplotlib Tutorial 4 - Scatter Plots

So what we can do is anytime you're having this let's do scatter plot marker size.


Matplotlib Tutorial 4 - Scatter Plots

Our good friend Google, we come over here and maybe it's just size.


Matplotlib Tutorial 4 - Scatter Plots

Maybe that's what people are doing.


Matplotlib Tutorial 4 - Scatter Plots

So for a scatter plot apparently you can just do S for size.


Matplotlib Tutorial 4 - Scatter Plots

So we'll go ahead and run that again and I did not want to make them any bigger.


Matplotlib Tutorial 4 - Scatter Plots

Let me go look at this, size is 10.


Matplotlib Tutorial 4 - Scatter Plots

You should be able to make these like massive.


Matplotlib Tutorial 4 - Scatter Plots

Marker is a star.


Matplotlib Tutorial 4 - Scatter Plots

Let's go back.


Matplotlib Tutorial 4 - Scatter Plots

Size equals let's make it 100 then.


Matplotlib Tutorial 4 - Scatter Plots

I will fight you.


Matplotlib Tutorial 4 - Scatter Plots

There we go.


Matplotlib Tutorial 4 - Scatter Plots

So it looks like they're a lot bigger.


Matplotlib Tutorial 4 - Scatter Plots

That's crazy.


Matplotlib Tutorial 4 - Scatter Plots

So they go on a different range.


Matplotlib Tutorial 4 - Scatter Plots

Later on we'll talk about marker sizes with the 3D scatter plots I'm pretty sure have it.


Matplotlib Tutorial 4 - Scatter Plots

They're called marker size.


Matplotlib Tutorial 4 - Scatter Plots

Anyway so S will be your size in this case.


Matplotlib Tutorial 4 - Scatter Plots

And so like let's do 500 make it huge.


Matplotlib Tutorial 4 - Scatter Plots

It's coming out of our legend here.


Matplotlib Tutorial 4 - Scatter Plots

Anyway that's how you can kind of change the size and the marker.


Matplotlib Tutorial 4 - Scatter Plots

There's a whole bunch of markers.


Matplotlib Tutorial 4 - Scatter Plots

One thing that we can do is we can like I was trying to say before in the first video,


Matplotlib Tutorial 4 - Scatter Plots

matplotlib marker options.


Matplotlib Tutorial 4 - Scatter Plots

Generally what you can do anytime you got a question because I don't know all the matplotlib markers.


Matplotlib Tutorial 4 - Scatter Plots

I know some of them they're like stars you can use carrot top and that will make like a triangle and stuff.


Matplotlib Tutorial 4 - Scatter Plots

But you're never going to remember everything that's possible.


Matplotlib Tutorial 4 - Scatter Plots

And then like with matplotlib colors there is like a hundred of these like really long.


Matplotlib Tutorial 4 - Scatter Plots

They have like pinkish orange as a color and it's like you're not going to remember those.


Matplotlib Tutorial 4 - Scatter Plots

So what you do is you use Google right and you type it in matplotlib marker options.


Matplotlib Tutorial 4 - Scatter Plots

Awesome.


Matplotlib Tutorial 4 - Scatter Plots

Here's a legend guide that's not what we're looking for.


Matplotlib Tutorial 4 - Scatter Plots

We're probably looking for markers though.


Matplotlib Tutorial 4 - Scatter Plots

And then here you go.


Matplotlib Tutorial 4 - Scatter Plots

You've got all your marker types.


Matplotlib Tutorial 4 - Scatter Plots

So you could have a point.


Matplotlib Tutorial 4 - Scatter Plots

It could be a pixel, a circle, triangle like all this stuff.


Matplotlib Tutorial 4 - Scatter Plots

Okay.


Matplotlib Tutorial 4 - Scatter Plots

So you have so many options that it would behoove you to go ahead and check it out and Google it and see what all your options are.


Matplotlib Tutorial 4 - Scatter Plots

But you can do like an X to color.


Matplotlib Tutorial 4 - Scatter Plots

Let's do marker equals let's make it a star and see if that works.


Matplotlib Tutorial 4 - Scatter Plots

For some reason we weren't able to change the size.


Matplotlib Tutorial 4 - Scatter Plots

So we got some big stars.


Matplotlib Tutorial 4 - Scatter Plots

And then you can have like an X like a we just got to do the X just because I brought it up.


Matplotlib Tutorial 4 - Scatter Plots

Anyway there's a bunch of marker types and look you should look it up just so you can get acquainted with all the types.


Matplotlib Tutorial 4 - Scatter Plots

Not like I'm going to run through a tutorial going through all of the markers.


Matplotlib Tutorial 4 - Scatter Plots

So anyways that's it with scatter plots, the size of the scatter plot, marker style, that kind of stuff.


Matplotlib Tutorial 4 - Scatter Plots

Line graphs can also have line style and line width.


Matplotlib Tutorial 4 - Scatter Plots

We'll talk more about that as we get there.


Matplotlib Tutorial 4 - Scatter Plots

But if you have any questions or comments on this tutorial please feel free to leave them below.


Matplotlib Tutorial 4 - Scatter Plots

Otherwise as always thanks for watching.


Matplotlib Tutorial 4 - Scatter Plots

Thanks for all the support and subscriptions.


Matplotlib Tutorial 4 - Scatter Plots


Set Distribution Networks: a Generative Model for Sets of Images (Paper Explained)

Hi there, today we're looking at set distribution networks, a generative model for sets of images


by Shuangfei Cai, Walter Tablet, Miguel Angel Bautista, Carlos Gestren and Josh M. Suskind


of Apple.


So this paper introduces a generative model for sets and it does so in an energy based


model fashion.


It will have an encoder, a decoder in form of a generator, it will have a discriminator


and it will have all kinds of math but the end result is a model that can generate sets


of images and by sets we mean it can generate different kind of views on the same identity


of image and you'll see what that means and it can generate even sets that it has never


seen before which makes it different from a class conditional GAN or something like


this.


So if I can't really describe it on a high level in a very concise fashion you'll just


have to stick around and see what's going on right here.


So if you like content like this feel also free to share it out and leave it a like,


tell me in the comments what you like.


This is going to be a fairly math heavy paper and I'll try my best to kind of distill it


down to what's happening because ultimately it's not that difficult.


All right so if you have a look at these samples right here these are examples of sets of images.


Now without actually caring for top and bottom row they will have some meaning right here.


Top row is always a row from the actual data set and the bottom row is the reconstruction


of that set.


Now you'll see that the images don't really have a correspondence so you see it's the


same truck in the top and the bottom row but the orientation here isn't really shared or


anything and that's because as we said this is a set network.


So what you want to do in this problem setting is you want to take you want to build a model


that can take this set right here from the data set and it can encode it into a latent


description that we call Z.


Z simply describes the set as a whole.


So Z here would be sorry would be truck right it would sort of be the 3D model so not the


class truck but the 3D information of the truck without having any information of the


different views.


And then you want to build another model that can generate from this low level representation


of the set can generate the different views okay like each one of these by sort of rotating


it so we want to build a model that understands just from the pixels that here we have sets


of things that they somehow always share a commonality and in this case they always share


their 3D structure right.


What they don't share is the view where they rendered from.


So our model is supposed to kind of parse the two apart and encode that 3D structure


just from the pixels in this Z variable and then encode the fact that you can rotate it


and look at it from different views into the generative model that then produces the different


views okay.


And the reason why there is no correspondence between the views is we simply regard these


things as sets.


So our final objective is simply going to be that the set on top is different views


of that particular truck is going to be very similar to the set on the bottom which is


also different views of that particular truck and that's what our model is supposed to do.


Now you might know something like this from we can simply say well this this looks like


a class conditional GAN right.


I simply have the class truck and I you know I feed this to my generator and my discriminator


and my encoder and so on and it will produce a the same truck and here that and here the


bench and so on.


The problem I guess becomes more apparent when you go to this different data set.


So this is a face data set and again top row being the input and bottom row being the output.


Now what is here what is supposed to be preserved you can kind of see in the images is sort


of the identity of the person on the photo.


Now you have to kind of glass and gloss around your human bias here.


You as a human can tell extremely tiny differences between faces and therefore none of the actual


identities are going to be preserved right.


So this on the top I believe is Ali and on on the bottom here it's not Ali.


But you'll have to sort of gloss around this and you'll see that what is preserved or what


is supposed to be preserved is something like the rough identity of the person on the picture


and also a little bit of the image compositions.


So you see here in the background you often have sort of these sports backgrounds right


where there's kind of a washed out stadium or whatnot and you can see that this is also


preserved here.


I think it's kind of a glamour glamour shots of this must be some sort of glamour model


and you'll see that this as well is preserved.


What is different within each set is of course the different views on the same identity right.


So you have the same person and you have pictures of them in different of different views different


lighting different hairstyles and so on.


Here you even see you have the black and white image and the set that is produced also contains


some black and white images.


So this model this is already the trained model here is doing a fairly good job here.


You can see that almost all the pictures have some sort of double like two people with one


being sort of half in frame and it leads to fairly a fairly strange thing.


I'm going to guess the model hasn't seen lots of that during training.


I like I particularly like this.


This is this is pretty good.


Also here it we know that a lot of these face data sets they don't really have bald people


all too often so you can see here this results in sort of kind of a weird Richard Branson


type picture.


In any case it does it does a fairly good job right.


As you can see right here and what's the problem with with these faces.


Can't we just do a class conditional again where we basically say here this is Ali right


and that's one class in our latent vector and then and so on.


What we want to do is we want to train something like this that where we can give in a new


identity that we haven't seen during training.


In fact we want to train something where we don't even know how many sets there are going


to be in the end.


We simply wanted to want to train it in a way where we say look I'm going to give you


a set and the set will have you know images of the same person and you're going to sort


of reconstruct that in a way where you output a set of images of that person concerning


conserving the identity of the person and the rough style of the picture.


So this is really different from a class conditional again as in we don't know how many classes


there are and there can be new unseen ones during testing.


So how do we go about something like this?


And here here's where the thing starts.


So we're going to dive into a bit of of the math here and then into a bit of the reasoning


but ultimately what they are going to do is they're going to build and they're going to


build three things.


They're going to build an encoder, a discriminator and a generator.


So what does the encoder do?


And remember our task here is going to be the way we train it is going to be by reconstruction


at least one way we train it.


So the encoder is going to take this set of images that we give it for example here different


views of this car and is going to produce this representation this set representation.


Now what should this what should a property be of the set representation?


For example it should be independent of the ordering of these inputs right?


A set is simply a collection of objects it's independent of the ordering and it's also


independent of the size in some way.


Of course a bigger set gives you more information but the set identity the fact that this is


this particular car is independent of how many views you have.


So what they do is they build and they put each image through an encoder which is a convolutional


neural network and I guess that gives them a hidden representation and encoding and embedding


for each image and then they have this operation called pool and binaries and so this does


two things namely first of all it pools it simply averages these things so it goes one


over n ci of xi or c of xi I guess.


So this simply averages these encodings right here and this already fulfills our property


so this average is independent of the order of the images and also I can add more and


I can add less in expectation the average will result in the same thing right?


So this here now we have basically lost the information of the order of the exact ordering


and so on this is simply an average of these images.


It's a good representation for a set this is now if we give enough images this will


be independent of the particular rendering position and it will only depend on the fact


that this is that particular car if it's trained well of course and then the second thing is


binaries and here you have to understand how these what exactly this set latent representation


is how do we encode a set in latent space and as far as I understand it as far as I


understand it what they do is they do the following so since they don't know how many


sets there are they can't simply do the classic one hot vector so what you would do in a class


conditional GAN is you would say I have a vector and maybe I have 10 classes so I'll


make 10 entries right here is that 10?


I don't know I'll make so if I have C classes I'll make C entries right and I'll put a 0


in all of them and a 1 in where a 1 where my classes or something like this so this


would be a valid encoding for a class conditional GAN to represent the identity of the class


here however no we don't know and also we can't really make this continuous because


other if you make this continuous you you wouldn't really encode the identity of the


set it's you would encode more of a you would encode more of kind of a continuous latent


space and then that becomes kind of different when you have new sets and so on so what they


really want to do is they want to make this representation here be a description of the


set itself but not a one hot so what do we do what they do is they do the same thing


they have a vector but not of size C because they don't know C but of some dimensionality


D okay this can be 10 this can be 4 this can be you know whatever just let's say it's 10


again but we don't know how many classes there are what the model can do is it can encode


each class as a binary vector a binary combination of negative ones and ones so it can put like


a negative one here a one negative one negative one one one negative one and so on so what


what does that give you now you you can encode much more than 10 classes in fact you can


with this you can encode two to the 10 classes right and that's so it's not like it's not


that it's not that they can encode an unlimited set of sets I have set identities but they


can encode in this manner they can encode a lot right they can encode this many sets


using a representation like this so this binarize operation it will take this output right here


and basically clamp it to either one or negative one so the set will be encoded by a binary


vector like this and then the generator and the discriminator take that information okay


and we'll go we'll go over what what this architectural choice means but right now this


you you know see that this is a this is a way to encode a large number of set identities


in a low dimensional vector all right so there are two things now there are the discriminator


and the generator so first of all the generator is pretty easy the generators task is to take


this Z that we just saw which is the set identity and to generate different instances of that


set right and for that it needs this noise here so if you know a generator from a from


a GAN this it always kind of needs input noise in order to produce different outputs and


that's this thing on the right here this Z prime they simply come from some sort of latent


distribution I think they call this P of psi which is some like a uniform or a Gaussian


or something you just sample some noise right and you combine it with this thing right here


which is the set identity you concatenate it and then each one of these different Z


will produce one different one different view right here okay so the generators task is


simply take the set identity and combine each with some noise and produce some views of


that set now the discriminators task right here is going to be to decide it's going to


get a set of views of a set of pictures and it's going to have to decide is this set coming


from the generator or is this set coming from the data set right now you can't simply compare


images to each other like you would do in a regular GAN because they don't correspond


to each other right but what should correspond to each other is these identity this Z identity


so the discriminator is going to take also two inputs it's going to take this set right


here or you know from the data set and it's going to take this right here this Z now this


Z is going to be the set identity and that you get from the encoder right it's the same


as you get right here you get it from the encoder which set you should produce and the


same goes here so the discriminator knows the set discriminator knows for example I'm


trying to produce that particular car and it gets a set of images that is supposedly


of that particular car needs to decide does it come from the data set or from the generator


so it uses the same encoder pipeline here it's just like a CNN giving you a latent representation


and then it has two tasks the discriminator has two different tasks first of all this


here is the regular GAN path so it there's an there's an MLP there is simply a pipeline


that outputs a number and the number is does this come from the data set or does this come


from the generator but then there is an additional pipeline that they have found to be vital


to train the objective which is a reconstruction pipeline so this is more like a sort of like


an auto encoder pipeline where they have a decoder they try to reconstruct the input


set and they then compare it using mean squared error now here they try to reconstruct the


input set really picture by picture not as a set but picture by picture so that's it's


different from the set generator okay and this is this pipeline is just to stabilize


the training but it also goes into this the output of the discriminator so sort of the


discriminator is happier the more it can the more it can reconstruct the images which seems


kind of weird at the beginning but it you know they say it has helped in other GANs


I'm not super familiar with GAN literature but it's just a another objective that you


can add so this is going to be the overview right here so if everything works well we


should be able to take a set from the data set X right which is going to be you know


images different images from the same person we should be able to feed that to the encoder


get a latent representation Z for that set that somehow encodes here the identity of


the person and now we don't if the encoder works really well we don't have to have seen


that person before it will simply somehow encode the identity in that binary vector


then we feed that to the generator together with some noise and we'll get out a set of


pictures of different views of that same person or the person with a similar identity and


pictures with similar kind of picture style and that if our discriminator works well will


look very very similar to or will be images really of that same person and our discriminator


if we plug that in right here will agree and we plug in the Z right here okay okay that's


the overview now the math so think about this in this sort of probabilistic framework what


they say is we have we denote an image set of size n as X and that becomes from the space


of sets of images so capital X right here is going to be a set of images as you see


here and this here is the space of all sets of images okay so what they want to do is


they want to build a probabilistic model of that so a model where you can input a set


and it'll tell you how likely is that now you don't you don't actually have to have


a number as an output right here what they often do is they start with a formulation


like this and what they end up with is simply a model that allows you to sample from this