you have blind models and then you can have concatenate so the it's still suboptimal because what you want is you want a single model to output your word vectors or to interpret the language that can look at both the left and the right at the same time and then incorporate information from both of them simultaneously and not just at the end by concatenation this is what Birth


does it's a bird here and this is kind of what they claim is the new contribution bird at each in each layer here of the model D D let's look at this and for a particular token they look at all of the context so every every other token in the in the input they look at that and so the the basically it seems kind of it seems kind of obvious but it's it's actually there's there's

BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding


reasons why these other models don't do this but so this is the entire point of Berk is at each layer in this in this transformer architecture is still an attention that can ISM by the way so that there's there's the mechanism of attention here and and here is exactly the same or almost the same they actually keep it close on purpose in order to compare but now we have


attention not only to the left but also to the right to everything right so why do these other model whether for example the opening I transformer only look to the left that's because somehow you need a task to train on right and most of the time if you especially if you want unsupervised training you going to do something like language modeling and language modeling what you have is a


sentence ABCD and you're asking what comes next here alright so by by the definition of the task you can only look to the left that's that's just how how these like how the task works so it makes sense that that these other models kind of do this because they preach right and this not Burt has a different free training because they can they can only they have


to look to the left and the right and the other thing is what you want to use the model for so the good thing if you own if you go left to right is you can use the model now for generating language in the same thing if if you have a B C D and you ask and the model is trying to produce the next character only looking to the left right then you can you can say what's the next


character the model says B and then we can feed the same thing into the model and say okay what's now the next character what's now the next character G so there's pretty useful if you only look to the left you can actually use the model then for generating a language which is something you can't do with Burt or it's not it's not really obvious now how to do it with where people are I


know people are investigating into language producing producing entire sequences with Burt but as yet it's not super clear how to do this with this model that being said them all is pretty good at pretty much everything else so let's jump in to how they train they train let's see here they trained using masked basically masked language modeling so when I actually go into that first masked


language modeling what they do is they basically replace some words by the mask token and they don't have a good no nice alright today I'm everyone here all right here if you just look at kind of the top sentence here the man went to mask store right don't don't don't worry about the set and so on just this a man went to a mask store and the models simply asked


to predict what's here which word is there so it needs to incorporate information from the right and from the left to do this so that's basically how you train it they simply drop out some of the words some of the time and they they have different techniques so you can clearly tell a lot of work has gone into kind of fine-tuning everything in this model like how to Train it and so on so let's


say we don't always do this sometimes we do this other thing and sometimes we do that and there's several ways of biasing this model but basically you do this mask which modeling and then because they also want to evaluate on let's say entire sequence tasks or tasks that span multiple sentences what they do is the second free training task at the same time as you can see here where they feed


two sentences so that's the first sentence that's the second sentence they feed these two sentences as an input so at first they have this token and these separate the sentences and then they ask the model to predict a label is next and is next is neck is true if the second sentence follows the first and so it's if it's like a logical continuation and the way you do this unsupervised is


really easy you take a big giant corpus and you take a sentence for the first sentence and then 50% of the time you take the next sentence in the corpus and the label is true and 50% of the time you take some random sentence here you say for example the man the man mask to the store and the next sentence is penguin mask or flightless birds and that's kind of a random sentence so the


model is asked to predict well that's probably not the next and following this first sentence so you do these two tasks a pre-trained and D can do this unsupervised you don't need supervised data for that you just need a corpus and they do this for a long time with a lot of data and the model itself is giant has 24 I think of these transformer layers so it's giant


and then you kind of pre-trained in this model here is a here's an illustration of some extra things so what they do is they they first this is the input up here so the first token is this CLS token which is kind of the star token and then this is the first sentence then the step is the separator of two sentences then this is the second sentence and then again I said look up


to these hashtags in a second but first they say okay first we have the token embeddings so they kind of start with with the original concept of word vectors at the very basis because you need to start with actually going into a vector space to use these models but they don't they they then then in kind of transform these through the transform layers they also use segments embeddings


and segments embeddings as you can see here is simply a kind of a binary label EI being the label for the first sentence and E being the label for today the second sentence so just the model can differentiate which one's the first which one's the second because it's kind of hard to learn for a transformer architecture that the tokens kind of separate the sentences so you can want


to help it and the last thing is positional embeddings and we've also already talked about these in attention is all you need this is where you can kind of the model since it's a transformer it doesn't go step by step it doesn't go one of them so it's kind of hard for the model to make that how far things are apart from each other how far to tokens if they're neighbors


or if they're really far apart and these positional embeddings kind of help the model I decide if two tokens are close to each other in input infer if they're right they're just neighbors or if they are actually really far apart all right so this is this is how the kind of first input is constructed out of these embeddings and then it's fed through these transformer layers as we saw with


the mask that lime task and his next task I want to quickly get to these hashtags what what they mean so the input here is separated into word pieces so called work pieces and what that is is so in language processing tasks you have kind of a choice you have you have a choice of how to tokenize your input so what let's look at a sentence here subscribe to PewDiePie so


this is a sentence and the sentence is rather let's say world wise complicated so why matter language one will have problem with this so first you need to tokenize this sentence alright so what most people do is they say okay here are the word boundaries we're not tokenize this into three segments first is subscribe to piggyback okay so three things and each of these now needs a a


word vector associated with it now to the thing is the word vectors let's assume you have them pre-trained or something in any case you need a big table a big big table and this goes down here where for each word a the two I you you have a Keter associated with it right so you need to keep this in your model and as you can as you know English has a lot of words here so this table is gonna be


really big and the problem is how do you make this table right okay you could make it kind of dynamically and so on but in general you're gonna create this table with all the words you know and that's going to be too big because English has so many words and then you can say alright we'll only take the top whatever is used in 90% of the language which turns out to be it's kind of


burrito distributed so it turns out to be like 5 percent of the words are used in 90 percent of the language so you just take these but then you're gonna have the problem ok here 2 2 is not a problem why not 2 is used super often that we're gonna have it at the very top somewhere and we're gonna go back to it subscribe is it's already it's not so common right


so maybe you have a word for it somewhere down but then pewdiepie is a name so there is no there's not even a word like that's not even a word it's it's just so what you what you usually do what people usually do is they have this out of vocabulary token and then they have a vector associated somewhere here without of vocabulary token is a whatever I don't know what it


is I just don't like that I don't have it in my vocabulary and the model kind of deals that that's kind of it's not it's not really ideal especially if you don't want to generate language also your model tends to generate out of tabular tokens if you allow that if you don't allow that you have a problem during training so it's all kind of messy what's the alternative the


alternative is to go character level so let's look at character level in character level you say all right my words are obviously made of actors and characters I'm just gonna split it each character right here the white space can be a character too so I'm gonna split at each character and then I'm simply going to have a bone vector for each character and there's


only like 20-something six of those and um so I can keep 26 vectors but this tends to be rather problematic because a character by itself having a meaning that you know that can be encapsulated by a vector is kind of its kind of shady because the character character by itself usually doesn't mean and it doesn't have a meaning so what's the solution here the solution is to go in


between the solution is to say well let's actually go forward pieces and you can kind of think of them as syllables but you can you can split you can make them in a way that you have a fixed size vocabulary say okay I have 4,000 entry places in my big table it's I can afford 4,000 size table so first of all I'm going to have for each character ABCDE and so on I'm going to have a vector but


then only have 26 have 3,000 some left I'm going to have also the most common words now a is already here but maybe I can have two and from and so the most common words they also get there and then for the other things I'm going to split the words maybe in a sub scribe right so these are two syllables and sub can be free kind of a prefix to many things and I only need then 1 1 so I've


sub here sub I only need one vector for that and then the rest if described scribe is by the way also a word so I can have that but if scribe weren't in my vocabulary I can divide scribe Len up into into characters and then describe them with the so basically I can mix and match here I can sub it that's that I have that and then scribe I don't have it I don't have


any of the pieces but so I can just use the character the character so this would would be sub and then s C or I II so these these would be the tokens that I work with now as as my input and this these tags here so this is what would happen to PewDiePie you could simply split along each character so you basic this kind of an interpolation between the token model


and the character model and it's really neat and it usually works quite well the as I said the the hashtag sign here simply means that these two have original in one word and now this this in here is just a word piece token this is a really good example where where where piece come in because play by itself is a word and that can make play yang instead of having an own vector for


that I can divide it into play which already has a meaning and presumably playing and play would have similar meaning so it makes sense to have to play as a so that's the token singled-out ear and then in as is as a suffix also makes sense to have a token for that in my table and then I said we have these two tokens here and that probably already gives me more information than


simply having the word playing right by the way you should subscribe to PewDiePie just FYI alright let's go on so we we do workpiece tokenization we do the masked language model we do the next sentence prediction pre-training what do we have now we have a model that can really really well predict some masked words now how do we use it they evaluate on these I believe it's 11


tasks 11 different tasks of or is it I don't know how many it is it is a lot with the same model so this pre trend model then how claim can be fine-tuned to do all of these tasks and it gets up it goes like state-of-the-art on everyone it's crazy so how do they fight in it so the easiest tasks are the one are the so-called sequence level tasks where you basically have the sequence and you're


you're about to predict one class label for the entire sequence so here where the sentence pair classification tasks for example the task we saw before the is next task but there is more sophisticated tasks that you need kind of supervised data for and so with supervised that you'd have a class level that you trained on so what do you do is let's look at one of them ever MN l I


they had it up here nope here multi-genre natural language inference crowd-sourced entailment classification task so given a pair of sentences the goal is to predict whether the second sentence is an entailment contradiction or neutral with respect to the first one all right two sentences and you're about to predict which one of these three labels it is so you put the


two cent sentences here Burke can already take two sentences as an input as we saw right the the embeddings are the the a and b embeddings and the position of endings are left out of the picture here but they would be added to it and these these would be the embeddings for it and then you pass this through the verb monel and this is the final layer and what they do is they


simply take now the the embedding the final embedding for this first one course into this starter token and they simply put a single layer of classification so basically a logistic regression on it and that's how they then get a class label so if this is whatever let's say this is this just gives you here a hidden vector of 512 dimensions 512 and you have three labels to output here 1 2


3 you simply need a a matrix that's 512 by 3 of size and these are the these are the weights that you would then have to train in addition the vert subvert is pre trained and you have to simply only now learn these weights of course they also kind of fine-tune the entire vertol but that's really fine-tuning the only thing you have to learn from scratch is is this these weights here that's pretty


first of all it's pretty neat because you can be very quick at learning new tasks because you simply start from the pre-trade vert and then you go and learn a single class for a layer on top and astonishingly this works extremely well for these tasks a bit of a a bit of a more challenging task is this year squat is a question-answering task and we're gonna jump down here where they explain


the task so you have an input question oops you have an input question and then for question is where the water droplets collide with ice crystals to form precipitation and you have an input paragraph which is kind of a paragraph from Wikipedia page and you know that the answer is somewhere in this paragraph right the data set is constructed such that the answer is in


the paragraph so the entire referees precipitation forms as small as smaller droplets call ask the collision with other raindrops ice crystals within a cloud so you the question is where do water droplets collide perform precipitation the answer here is within a cloud so that's this this thing here so usually what squad models do is they they predict the spam


they predict where it's the start of the answer and where is the end of the answer that's also what kind of birds train to do so in order to do this what you do is again you already have the ability to input two sequences so we've trained with two sentences but here they say well you say oh well our first sequence is going to be the question our second sequence is going to be the


entire power paragraph from Wikipedia and then for each output for each output for the output of each token remember there's as many outputs as there's inputs because the transformer will always transform to the same length of sequence for each token in the output we classify it is this token the start token and or is this token the end token or is this token none of all now what


they do effectively is that here each each one outputs each one is a vector and they as we said at the beginning of finding out which ones the subject now here we have two queries namely query one which is is this to start let's call it query s and query e is is this the end token so these are two queries and I'm going to just produce compute the inner product of each query with each of


these outputs right and over my sequence here this is gonna give me a distribution so start for start maybe this token is not much than this token is a lot and so on the other solution there's I've tokens and for the end not so much not so probable not so probable very probable not suppose so what you get when I get is from these inner products is a distribution over which ones start


in which ones to end ok this one's probably a start and this one's probably the end so that's how you predict the span and again what you have to ultimately learn is these these queries here and so not that much and this is named entity recognition and named entity recognition you have a sentence and you're supposed to recognize named entities like up here we saw subscribe


to PewDiePie and the named entity would be PewDiePie right this is a name and you're supposed to recognize that this is a name and they do it the same same way that they do the squat basically or a similar way sorry they basically for each of the outputs here they simply classify whether or not is it's part of an M entity or not so what they have to do is they have to simply train if they you


also have different labels for which kind of entity is this this is like a person and this is this is no entity so if you have ten of the labels then each for each thing you would classify it into one of ten classes so you need a classifier of input size versus number of classes that's all you have to train in addition to pre to fine-tuning vert itself alright so they kind of evaluate


on all of these tasks they get super duper numbers on all of them here burped large winds on pretty much everything and this model is big just saying and they trained it on TP use which is available in kind of Google cloud infrastructure so far they've trained it on a lot of data so - - away it's it's kind of expected that you would outperform but it's very surprising that you outperform


everyone else by this much and they've done a lot of kind of Appalachian studies where they show that it's really due to the fact that they do this left and right context they they take into account the left and right context of given token when doing the the attention that it's that that's why it's better so here for example they compare the bird base model and they say okay what if we


don't do the NSP the next sentence prediction tasks then you can see the numbers they already kind of they drop on these tasks and what if we then additionally do only left-to-right training and the numbers they drop really seriously again you see sometimes here for example you see a pretty serious drop in the number also here so there really seems to be real value in


doing this kind of left and right context attention so it's not just about the model size and the amount of data that's basically what they show here and this is really cool that the paper actually shows this because usually people have an idea and they throw a lot more resources at it and they're better you never know why and this is pretty cool that they actually show all right


hi there today we're looking at back propagation in the brain by Timothy Lilly corrupt Adam Santoro Luke Morris Colin Ackerman and Geoffrey Hinton so this is a bit of an unusual paper for the machine learning community but nevertheless it's interesting and let's be honest at least half of our interest comes from the fact that Geoffrey Hinton is one of the authors of this paper so

Backpropagation and the brain


this is a paper that basically proposes a hypothesis on how the algorithm of back propagation works in the brain because previously there has been a lot of evidence against there being something like back propagation in the brain so the question is how do neural networks in the brain learn and they they say there there can be many different ways that neural networks

Backpropagation and the brain


learn and they list them up in in this kind of diagram where you have a network and it maps from input to output by having these weighted connections between neurons so the input is two-dimensional and then it maps using these weights to a three-dimensional hidden layer and usually there is a nonlinear function somewhere at the output here of these so they they do a weighted sum of the

Backpropagation and the brain


inputs and then they do a nonlinear nonlinear function and then they propagate that signal to the next layer and till then to finally to the output all right so how do these networks learn the one way of learning is called hebbian learning the interesting thing here is that it requires no feedback from the outside world basically what you want to do in hebbian learning is

Backpropagation and the brain


you want to update the connections such that they kind of match their own previous outputs or even increase their own previous outputs so you propagate a signal and then maybe this neuron spikes really hard and this Spike's really low then if you propagate the signal again right then you want to match that those those activations or if you if you properly similar signals no

Backpropagation and the brain


feedback required so basically it's a self amplifying or self dampening process the ultimately though you want to learn something about the world and that means you have to have some some feedback from outside right so with feedback what we mean is usually that the output here let's look this way the output here is goes into the world let's say this is a motor neuron right you do

Backpropagation and the brain


something with your arm like you hammer on a nail and then you either hit the nail or you don't let's say you don't hit the nail so after it looks like crooked there you have feedback right so feedback usually in the form of some sort of error signal right so feedback it can be like this was good or this was bad or it can be this was a bit too much to the left or so on the important part

Backpropagation and the brain


is you get kind of one number of feedback right how bad you were and now your goal is to adjust all of the individual neurons or weights between neurons such that the error will be lower so in hebbian learning there is no feedback it's just simply a self reinforcing pattern activation machine in the first in these kind of first instances of perturbation learning what

Backpropagation and the brain


you'll have is you'll have one single feedback and that you can see this is a diffuse cloud here what you're basically saying is that every single neuron is kind of punished let's say the the feedback here was negative one that means every single neuron is is punished for that so how you can imagine something if you have your input X and you map it through through your function

Backpropagation and the brain


f then the function f has a way to w1 and so on right so you map X through it right and then you get feedback of negative 1 and then you map X with a little bit of noise plus M right da-da-da-dah and you get a feedback of negative 2 right then you you that means that the direction of this noise was probably a bad direction so ultimately you want to update X into

Backpropagation and the brain


the direction of negative that noise by modulated of course by by some some factor here that's that it kind of tells you how bad it was so this could be the negative 2 minus negative 1 now that makes big sense No yes that would be no it would be negative 1 minus negative nevermind so basically with a scalar feedback you simply tell each neuron what it did right or sorry if if the entire network

Backpropagation and the brain


right the entire network did right or wrong so the entire network will lead to this feedback you don't have accountability of the individual neurons all you can say is that whatever I'm doing here is wrong and whatever I'm doing here is right so I'm gonna do more of the right things now in back propagation it is very different right in back propagation what you'll do is

Backpropagation and the brain


you'll have your feedback here let's say that's negative 1 and then you do a reverse computation so the forward computation in this case was this weighted sum of this layer now usually layer wise reverse computation which means that you know how this function here this output came to be out of the out of the inputs and that means you can inverse and you can do an

Backpropagation and the brain


inverse propagation of the error signal which is of course the gradient so this would be your your you you would derive your error by the inputs to the layer right so this basically tells in the back propagation algorithm you can exactly determine if you are this node how do I have to adjust my input weights how do I have to adjust them in order to make this number here go down right and

Backpropagation and the brain


then because you always propagate the error according to that what you'll have in each in each layer is basically a vector target so it's no longer just one number but each layer now has a target of vectors and it says okay these are the outputs that would be beneficial please this layer please change your outputs in the direction of negative two negative three plus four so you see this

Backpropagation and the brain


is so the negative two would be this unit the negative three would be this unit and the plus four would be this unit so each unit is instructed individually to say please this is the direction that each unit should change in in order to make this number go lower you see how this is much more information than the perturbation learning in the perturbation learning

Backpropagation and the brain


all the units simply know well the four was bad and now is better so let's you know change a bit and here you have detailed instructions for each unit because of the back propagation algorithm so ultimately people have kind of thought that since back propagation wasn't really possible with biological neurons that the brain might be doing something like perturbation learning but

Backpropagation and the brain


this paper argues that something like back propagation is not only possible but likely in the brain and they proposed this kind of backdrop like learning with the feedback network so they basically concern all the they differentiate hard between these two regimes here in this hand you have the scalar feedback which means that the entire network gets one number as a feedback and the each neuron

Backpropagation and the brain


just gets that number and here you have vector feedback where each neuron gets an individual instruction of how to update and they achieve this not by back propagation because still the original formulation of back prop as we use it in neural networks is not biologically plausible but they achieve this with this backdrop like learning with the feedback network and we'll see how this

Backpropagation and the brain


does but in in essence this feedback network is constructed such that it can give each neuron in the forward pass here detailed instructions on how to update itself right so yeah they have a little bit of a diagram here of if you do hebbian if this if this is an error landscape if you do have you in learning you basically you don't care about the error you're just reinforcing yourself

Backpropagation and the brain


if you do perturbation learning then you it's very slow because you don't have a detailed signal you just you just rely on this one number it's kind of if you were to update every single neuron in your neural network with reinforcement learning considering the output the of the neural networks or the error considering that the reward not using back row and then with back probably

Backpropagation and the brain


have a much smoother much faster optimization trajectory so they looked at this and they they come to some some conclusions first of all so here's here's back prop basically saying back prop as we said you have the forward pass and there you simply compute these weighted averages and you you also pass them usually through some sort of nonlinear activation right and the cool

Backpropagation and the brain


thing about this is in artificial neural networks is that once the error comes in you can exactly reverse that so you can do a backward pass of errors where you can propagate these errors through because you know it's kind of invertible the function doesn't have to be invertible but that the gradients will flow backwards if you know how the forward pass was computed so first of

Backpropagation and the brain


all they go into a discussion of back prop in the brain how can we even expect that and one cool piece of evidence is where I find is that they cite several examples where they use artificial neural networks to learn the same tasks as humans right and or as as animal brains and then I have no clue how how they measure any of this but then they compare the hidden representations of

Backpropagation and the brain


the living neural networks and the artificial neural networks and it turns out that the these the networks that were trained with backpropagation x' then networks that were not trained with backdrop so basically that means if you train a network with backprop it matches the biological networks much closer in how they form their hidden representations and they they do a

Backpropagation and the brain


number they cite the number of experiments here that show this so this gives you very good evidence that if the hidden representations they look as if they had been computed by backdrop and not by any of these scaler update algorithms so it is conceivable that we find backprop in the brain that's why they go here next they go into problems with backdrops so basically why why

Backpropagation and the brain


would we why so far have we believed that back prop isn't happening in the brain so now let's I want to highlight two factors here that that I find a thinker suffice state they have more but first of all back prop demands synaptic symmetry in the forward and backward paths right so basically if you have a neuron and it has output to another neuron what you need to be able to do is

Backpropagation and the brain


to pass back information along that neuron so it kind of has to be a symmetric connection idea of the forward and the backward pass and these need to be exact right and this is just not if you know how neurons are structured they have kind of input dendrites and then there's this accent act action potential and along the axon the signal travels and the back traveling of the signal

Backpropagation and the brain


just I think is very is very very very slow if even possible and so it's generally not invertible or inverse compute capable so this is one reason why that prop seems unlikely and then the second reason here is error signals are signed and potentially extreme valued and i want to add to that they also just talk about this somewhere that error signals are of a different type

Backpropagation and the brain


right that's a different type so first let's see what signed error signals are signed yes we need to be able to adjust neurons in a specific directions right if you look at again what we've drawn before here we said here this is how these neurons must must update so the first neuron must must decrease by two this must decrease by three and this must increase by four now in

Backpropagation and the brain


background we need this but in if if we assume that there is something like a reverse computation or signaling here happening then we still have the problem that usually these output signals are in the form of spiking rates which means that over time right so if a neuron wants to if a neuron has zero activation there's just no signal but if a neuron has a high activation it spikes a lot if

Backpropagation and the brain


has a low activation it kind of spikes sometimes well what he can do is negative spike right like zero is as low as it goes so the the thought that there are signed information in in the backward pass is inconceivable even if you have something like a second so you can imagine here instead of this backward connection because of the symmetry problem we have some kind of

Backpropagation and the brain


second neural network that goes in this direction still you'd have the problem that here you can only have positive signal or a zero and they might be extreme valued which okay it can't be really encoded with the spiking because they are they're limited in the range they can assume but they are also of a different type and I'm what I mean by that is basically if you think of this

Backpropagation and the brain


as a programming problem then the forward passes here are our activations right and the backward passes here they are deltas so in the backward passes view either propagate deltas or you propagate kind of directions so the activations are sort of impulses whereas the backward signals are this isn't how you need to change their their gradients ultimately so it's fundamentally a different type

Backpropagation and the brain


of data that is propagated along would be propagated along these directions and that makes it very unlikely because we are not aware as this paper says that the that neural networks that neurons can kind of switch the data type that they're they're transmitting all right so then the paper goes into their end grad hypothesis and what this is the hypothesis basically states that the

Backpropagation and the brain


brain could implement something like neural networks by using by using an approximate backdrop like algorithm based on autoencoders and I want to jump straight into the algorithm no actually first they do talk about autoencoders which which I find very interesting so if you think of autoencoders what is an autoencoder an autoencoder is a network that basically starts out with an input

Backpropagation and the brain


layer and then has a bunch of hidden layers and at the end it tries to reconstruct its own input right so you feed a data in here you get data out here and then your error the error signal it will be your difference to your original input now the usually when we train autoencoders in deep learning we also train this by back prop right we see then this error here and this goes

Backpropagation and the brain


back but if you just think of single layer autoencoders so um let's let's go over here single layer auto-encoder with let's say the the same number of the same number of units in this in this layer what you'll have is so this this is input this is output and this is the hidden layer right you'll have a weight matrix here and you'll probably have some sort of

Backpropagation and the brain


nonlinear function and then you have another weight matrix here and they call them W and B another way to draw this is I have weight matrix going up then I have a nonlinear function going transforming this into this signal and then I have the be going back right so I'm drawing I'm drawing it in two different ways up here or over here and with the second way you can see that it

Backpropagation and the brain


is kind of a forward backward algorithm where now the error if you look at what is the error here the error is the difference between this and this and the difference between this and this and the difference between this and this right and you can train an autoencoder simply by saying W please make sure that the that the the the input here gets mapped closer to the output and to be

Backpropagation and the brain


the same thing this will become clear in a second so but basically sorry this I mean the the hidden representations you'll see basically the idea is that you can train an autoencoder only by using local update rules you don't have to do back prop and that's what this algorithm is proposing namely if you think of a stack of autoencoders this this this transforming one hidden

Backpropagation and the brain


representation into the next right this is the feed-forward function what you can do is you first of all you can assume that for each of these functions here you have a perfect inverse right you can you can perfectly compute the inverse function that's this this G here of course this doesn't exist but assume you have it what you then could do is you could if

Backpropagation and the brain


if you knew in one layer and on the top layer of course you know if you knew that okay I got this from my forward pass but I would like to have this this is my desired output right so in the output layer you get this this is your error signal if you knew you you you could compute an error right here this is what you do in the output right now in back prop we would back propagate

Backpropagation and the brain


this error along the layers but now we don't do this instead of what we do is we use this G function to invert the F function right and by that what we'll say is what hidden representation in layer two what should the hidden representation have been that in order for us to obtain this thing right so the the claim here is if in layer two we had had H two as a hidden representation

Backpropagation and the brain


then we would have landed exactly where we want it right that's what this G function does because here we use F so had we had F h2 and used F on it we would be exactly where we want instead we had h2 here and used F on it and then we landed here where we don't want so this is where we want we would want to be in layer two and this is where we were so again we can compute an error

Backpropagation and the brain


here again instead of back propagating that error what we'll do is we'll use the inverse of the forward function in order to back propagate our desired hidden representation and you can see there is of course a relationship to the true back prop here but the the important distinction is we are not trying to back propagate the error signal we're trying to invert the desired hidden states of the

Backpropagation and the brain


network and then in each layer we can compute from the forward pass we can compute the difference to the desired hidden state and thereby compute an error signal and now we have achieved what we wanted we want an algorithm that doesn't do back prop that only uses local information in order to compute the error signal that it needs to adjust and by local I mean information in the

Backpropagation and the brain


same layer and also the data type that is propagated by F is activations right of hidden representations and by G is also activations of hidden representations both of them are always positive can be encoded by spiking neurons and so on so this algorithm achieves what we want they go bit into detail how the actual error update here can be achieved and apparently neurons

Backpropagation and the brain


can achieve you know in the same layer to to adjust themselves to a given desired activation so this algorithm achieves it of course we don't have this G we don't have it and therefore we need to go a bit more complicated what they introduces the this following algorithm the goals are the same but now we assume we do not have a perfect inverse but we have something that is a bit like an

Backpropagation and the brain


inverse so we have an approximate inverse and they basically suggest if we have an approximate inverse we can do the phone so G G is now an approximate inverse to F what we can do is this is our input signal right we use F to map it forward to this and so on all the way up until we get our true or error right here this is our error from the environment right this is the nail being

Backpropagation and the brain


wrong and then we do two applications of G right so this is an application of F we do to applet of g1 we applied g2 this to what we got in the forward pass right and this now gives us a measure of how bad our inverse is right so if G is now an approximate inverse and this now we see here oh okay we we had a ch2 in the forward pass and we basically forward passed and then went through our inverse

Backpropagation and the brain


and we didn't land quite exactly where we started but we know that okay this this is basically the difference between our our inverse our forward inverse H and our true H and then we also back project using G again the desired outcome so we invert the desired outcome here now before we have adjusted directly these two right because we said this is what we got this is what we want

Backpropagation and the brain


but now we include for the fact that G isn't a perfect inverse and our assumption is that G here probably makes about the same mistakes as G here so what we'll do is we'll take this vector right here and apply it here in order to achieve this thing and this thing is now the corrected thing our corrected to desired hidden representation correct for the fact that we don't have a

Backpropagation and the brain


perfect inverse and now again we have our error here that we can locally adjust again all the signals propagated here here and here are just neural activations and all the information required to update a layer of neurons is now contained within that layer of neurons right and and this goes back through the network so this is how they achieve how they achieve this this is a

Backpropagation and the brain


bit of a close-up look and here are the computations to do this so basically for the forward updates you want to adjust W into the direction of the H minus the H tilde and the H tilde in this case would be this the the hidden representation that you would like to have so you will update your forward forward weights into the direction such that your hidden representations are

Backpropagation and the brain


closer sorry that your forward haven representation is closer to your backward hidden representation and the backward updates now your goal is to get a more a better to make G so sir W here is our W or the weight of F and B or the weights of G so in the backward updates your goal is to make G a better inverse right so what you'll do is again you'll take the difference between now you see

Backpropagation and the brain


the difference here here here right not the same error so here you will you in the W update use what we labeled error here in the G update you use this error here so this is the error of G so when you update the function G you want to make these two closer together such that G becomes a better inverse right because you're dealing with an approximate inverse you still need to obtain that

Backpropagation and the brain


approximate inverse end and this here is how you learn it this algorithm now achieves what we wanted right local updates data types check signed check and so on I hope this was enough clear in essence is pretty simple but it's pretty cool how they work around this they call this a different story with propagation and not these these kind of papers I don't think they

Backpropagation and the brain


invented this maybe I'm not sure maybe they did maybe they didn't and this paper just kind of frames it in this hypothesis it is unclear to me I am not familiar with this kind of papers so sorry if I miss attribute something here all right then they go into into how could these things be implemented biologically and they go for some evidence and they also state that we used to look at neurons

Backpropagation and the brain


basically in this way where you had input and feedback here very simple simplistic view of neurons whereas nowadays even the company computational community views neurons in a more differentiated way where you have for example different regions here on the soma that can be separated from each other and you have inter neuron interference and so on I'm not qualified

Backpropagation and the brain


okay so hi everyone so huge thanks to Alexander hyung you and Sammy for organizing this incredible workshop and excited to be here and thanks everyone for coming I know I'm between you and lunch so I'll try and keep things on time so today I'm really excited to talk a bit about transfer learning in the context of deep learning so transfer learning is this incredibly popular

Towards Understanding Transfer Learning with Applications to Medical Imaging


technique it's used almost everywhere that we apply deep neural networks but there's also this challenge that we really don't understand many aspects of it all that all that well and so by the end of this talk I hope that you know you have some sense of all the many different ways it comes up and also some of the interesting open questions there are in the field so a lot of this talk


is going to be based off of a paper understanding transfer learning for medical imaging that's joint work with my collaborators chauhan jeong john Kleinberg and sami Benjo okay so let's dive right in what is transfer learning very basic so in the settings that we're gonna really be studying what you do is you first you learn classifier on some tasks let's call it Tosca and sometimes we call this


pre-training then having learned Koski you continue training this classifier on a new task task B and the goal is really to get good performance on task B so the goal is to get good performance on toss B you might ask why train on task a at all and the general belief in the community is that if you know task a is sort of complex and diverse and very general then by going through this


process of training on task a hopefully you've learned useful things that you can sort of transfer over when you start retraining on on task B so this high-level framework actually has connections to a lot of interesting work that's come out from the the theoretical perspective I think Zac mentioned some in his talk earlier today and I wanted to kind of give a quick point out to shy


and Devine who is maybe here no I don't see him oh you're here you're here okay in the front where there's been a lot of interesting work done in in this very related field of domain adaptation to try and understand this from a more formal framework and I think the times really come to revisit some of these ideas and see how we can use them to give us better insights for


transfer learning in in the deep learning context so speaking of transfer learning and deep learning what does that look like well it's very similar of sorry very simple you sort of just replace classifier with deep network so you have this deep network it's gonna be your classifier you randomly initialize it and you train on toski and this will be known as pre training then you take


this network and and it's sort of converged to some set of parameters on taos k and then you train it again this time on task B and then voila you have your final model that you're going to deploy and it's it's hopefully going to do great on on task B so this paradigm is pretty simple but it's been extremely successful and it's probably the computer vision community that sort of


really showed us how successful this could be in various applications so in sort of specifically the current setting what people do is pre train a large convolutional neural network on some data set of large images and you know image net gets a special shout-out here it's extremely popular for for pre training so much so that there are sort of entire papers saying why image net is


good for transfer learning but besides that there are a couple of other data sets so ms cocoa is a very popular big computer vision benchmark for object detection that sometimes used for pre training and companies also tend to have their own internal data sets which they like using for pre training so a really big one that Google likes using is jf th has sort of three hundred million images


so absolutely enormous what's been really interesting to see in the past couple of years though is that transfer learning has also become very popular in applications in natural language processing so in the past people were able to transfer word embeddings so you've probably seen these diagrams of taking a word in your vocabulary getting a vector representation and then these


vector representations of all of these nice properties we could do that for a while but it's only more recently that sort of all of these a neural networks that are named after Muppets for some reason have have have been developed and that lets us transfer much more complex representations of language and that's shown to be very very successful in a lot of standard natural language tasks


and now I have to mention the most important part of transfer learning which is github for transfer learning so been mentioned in a talk in his talk earlier that you know github can be this very useful research resource and that's definitely very true in transfer learning so in transfer learning kind of applications nobody actually bothers with the pre-training stuff instead you


go to github and you sort of find the model you're interested in and find all of its pre trained weights and then you just download it and then after you download it you just perform the fine-tuning for whatever tells you're interested in and this is really important because what this is enabled is it's enabled people who totally aren't working on sort of core machine


learning to apply transfer learning to all of their problems and nowhere is this more true than in medical imaging where where it's sort of the entire community has almost universally adopted transfer learning as this paradigm and what's the setup here well the setup here is that you take this sort of standard pre-trained imagenet model something large and complex like Inception v3 and then you


and then you have sort of these pre trained weights on imagenet that you sort of downloaded from somewhere so imagenet has you know amongst other things a whole bunch of different dog breeds and then bizarrely you sort of find two in this model to do all kinds of medical predictions so you find unit to predict and diseases on chest x-rays diseases like retinal


diseases PET scans for early detection of Alzheimer's and sort of the most exotic application was even sort of screening human embryos for IVF treatments so people are just sort of going out there and doing this and and when you think about this this is kind of bizarre because the reason the community um you know wanted to do transfer learning is this belief that


you sort of learned features on sort of this this source dataset and then you can kind of transfer all of this to to your target tasks but of course medical images and natural images are extremely different to each other so it's kind of interesting to understand what's what's on here one final thing is these aren't just sort of sort of turning into papers where you see accuracies but they're


actually being deployed in clinic so this is the example of one company called idx which literally states that it takes inception v3 pre turndown imagenet and is using these to diagnose retinal diseases and it's sort of out in clinic right now so understanding their examples the inception model mean for this problem adversarial examples where for medical images you mean I'm just


asking you're saying this is being deployed and it's natural to think about at the state examples for the infection not that I mean so for example you know I'm not talking about transferability I mean that's that's an interesting question sort of like how much can you like kind of do like these are completely different datasets so I think that's also like a very interesting


thing to look at um but okay so while we're kind of going ahead and sort of deploying all of these there's kind of this real challenge because even in the natural image setting we actually don't understand the effects of transfer learning that well so I'm gonna review some results which have just come out in literally the last year that have really challenged the common assumptions people


have on transfer learning so this is a picture of Ms Coco and I mentioned it earlier it's a very popular computer vision benchmark for for doing object detection so this is kind of what it looks like you're trying to learn these balance boxes and in almost all of the competition entries the standard thing to do is you pre train on imagenet and then you sort of fine-tune your image


net a model on this this ms koko tusk but then last year we got this paper rethinking image Annette pre training which basically showed just by kind of being up maybe a little bit more careful about how you pick your learning rate you actually get exactly the same results from random initialization as you do with Swiss pre-training now part of the reason people really


like pre-training on imagenet is again this belief that it's kind of this big diverse task and sort of if you train on there you're gonna learn lots of interesting features that you can kind of reuse in lots of places so sort of this underlying assumption is more data is is great but then there was there's another paper also just last year which looked at pre training on jft which is


sort of this even bigger data set sort of 300 million images and what they find is that more true more pre training data is not always better which is this sort of very closely held assumption in the community so in particular like they sort of try training from random initialization versus the entire data set and in a bunch of places the performances are actually really pretty


comparable other criterion if you fix the number of iteration or training data more source domain data is not better I suspect that that won't be true right it's like fitting more to the training distribution it's not necessarily better to the story features not necessarily better so they're they're not fixing the number of training iterations I think I think they're literally just training to


convergence and see what it's late right yeah right like you're saying maybe you just sort of like dues or barely stopping and then you just fix it whatever the number is that you got from the first amount of examples you do the same number of updates for more data or data points you know I'm not I'm not sure it'll make a difference I see your point and I'd have to check to see


exactly what they did but we can discuss this offline yeah but yeah so so one interesting point to kind of make here and I think this is actually connected to some of the theoretical work in this that's that sort of come up in related topics is if you do a better job of actually picking the subsets of data that you train on you actually do see significant performance gains and I


think again this is a place where we can kind of revisit some of the theoretical ideas and see if we can do something better this process is like relatively ad-hoc and then finally one other paper that came out just earlier this year do better image net models transfer a better has this kind of makes us implicitly makes this very interesting observation that when you decide to do


transfer learning you're not just taking the the features but you're also committing to an architecture it because you download them both together and if your task looks very different to imagenet you know this is something you should be be aware of and thinking about and so do better image net models transfer better well it's complicated there's this nuance relationship that


depends on sort of how you regularize during the training process the data set the specifics of the data set and size etc and so you sort of actually see a lot of variability based off of all of these conditions and sometimes you actually get pretty similar performance as usual optimal weight optimal where um oh here um yeah so this is optimal for transfer so so this is sort of like standard ways


in which people can perform regularization and this is how you tend to download your pre trained models but these are actually sort of not as good for for doing transfer learning on and.and here if you kind of train in a slightly different way you actually end up with better features for transfer yeah really thorough so I highly recommend reading it so they tried they


tried pretty much everything so they tried this sort of like fixed feature extractor setting where you sort of freeze things and then just retrain some of the top they also tried left fine-tuning setting where you sort of trained everything and they were also of course comparing to training from from scratch in these settings and so yeah the kind of exact results vary a little


bit I think your fine-tuning maybe you have like slightly less sensitivity to some of these these settings particularly for larger target datasets but yeah they try everything so definitely worth reading so this is all in the natural image setting what about in the medical image setting actually hardly anything is explored in the medical image setting which i think is


sort of something we should we could really try and address from sort of two angles firstly of course I think it's important to study it because we're actually deploying these in a lot of places and it's important to understand what's going on particularly is this is sort of a very counterintuitive thing to do secondly I think this medical imaging setting also captures a very interesting


part of captures an interesting sort of regime in of performing transfer learning so here your source and your target tasks are extremely different to each other like the data is different the actual tasks you're going for is different and as we'll see later there are still some benefits that that come up so sort of understanding why that happens I think is sort of very


interesting to to explore from a purely principled angle okay so in this talk so first we'll do a quick sort of performance evaluation of transfer just to sort of set things up and then we're going to go into a little bit more detail and try how is pre-training affecting the actual features we're learning in our model and for this I'll also touch on some work


we've been looking at on studying representational similarity of networks using canonical correlation analysis and then finally and very interestingly and also somewhat paradoxical we'll look at some feature independent properties of transfer that we see okay so the first yeah so I'm fine um so I think the question is sort of is there a precise definition of what fine-tuning means in


this setting is there as in like you sort of stop after some amount of time or yeah is there something very specified um the answer is like not really you're really just sort of training to convergence or pretty much you're mostly stopping once you see that like validation losses converged yeah but okay so okay so so let's let's take out let's breeze through the first part


um so first part we're gonna just try and evaluate the actual performance gains of transfer and to do this the way people tend to evaluate transfer learning because you're sort of downloading these datasets from at least sorry these models and these weights from github is you just tend to evaluate it on on standard imagenet architectures so like some big complicated thing like


this but as I mentioned if your task looks really different to imagenet its kind of important to think about the fact that you're making this implicit or contextual choice and so in our evaluation we also evaluated this much smaller family of architectures that we call CBR s they're really just vanilla convolutional neural networks they're called CBR s because the most sort of


popular and successful way of having a vanilla Convenant these days is to have a convolution followed by batch norm followed by a rel u activation and these things are really tiny there may be sort of like one eighth to maybe one twentieth the size of your full-fledged two image net architecture and then in terms of tasks we looked at sort of two large-scale medical imaging


tasks one of them is diagnosing different diseases from chest x-rays and another one is diagnosing a certain kind of retinal disease diabetic retinopathy from scans of the the back of your eye so we sort of run these experiments across all these different architectures random initialization and transfer learning there was a lot of experiments but we saw some clear takeaways so


firstly perhaps you know sort of falling on from some of the results we've seen in the natural image settings transfer and random initialization actually performed pretty comparably so here's a sort of complicated results table we got from our chest x-ray experiments and if we look at where transfer and random initialization perform comparably it's actually for most of the table and in


some cases transfer even sorry random initialization even outperforms transfer secondly and and interestingly we observed that these simple vanilla kind of networks actually performed about as well as these standard imagenet architectures so we weren't really trying to optimize for performance we just wanted to try some simple things to see what they look like compared to


image net like image net architecture is because those architectures are really pretty different to to what you might want for the for the medical data that's it knows the simple architecture did you also free trainer when this yes yes so we pre trained them on imagenet and then we and then fine-tuned on the medical data sets yeah and then sort of did those comparisons so the


data set sites so we actually buried this so like kind of variations of this or in the paper um the full data set is around 200k images I think which is kind of like reasonable size but um sort of smallish compared to image net which is like in the millions so it's sort of interesting to see that these sort of perform comparably and then finally we also saw that image net performance was not


actually indicative of how these architectures would perform on a medical task so what do I mean so let's look at another results table so here's where I at 50 and here are these two architectures and here's what we saw when we train them on image net these architectures actually perform horribly they're not designed for image net in a way that I can sort of explain offline


but when we look at how they do on the medical talk they're actually really within sort of ballpark performance of each other oh these architectures they're just um they're just like a family of simple vanilla convolutional networks yeah we kind of just made them up just because like we wanted something extremely simple and I can explain why sort of like you're sort of seeing this


difference I guess offline if you want but there are kind of clear ways in which image net is not the right way to design your architecture for some of these tasks and so we were able to take advantage of that you mean the data set size so yes it's something we've buried but I'm full dataset sizes maybe two hundred thousand images for both of them yeah so I mean this last point is


interesting because other papers so this paper undo better image net models transfer better and even the papers that been Rick's group has been working on on this distribution shift and sort of seeing if how performance car lights across distribution shift does show that there's this correlation but here here we don't see this okay so that was kind of a quick sort of


overview of what the the performance evaluations look like but we like to go beyond just the performance evaluation we kind of really want to understand what is transfer learning doing to our architecture it's like what are we gaining from from applying transfer learning if anything at all and you know I mean what we saw is like at a performance level things are performing


about the same and so a really fundamental question is well random initialization and pre train weights don't really look anything like each other so we have one thing sitting in one part of the space another set of parameters sitting in another part of the space what's happening during this fine-tuning process is it just that it doesn't really matter how you initialize


and then after you fine-tune you just sort of change dramatically and everything you initialize with is erased so we could just kind of do whatever we liked or is something else going on and to alter that question what we really want to do is we want to look at some of the the latent representations of these models and and take a measurement to see how similar they are the problem with


trying to do this kind of an analysis is that comparing representations from different neural networks is is really difficult there's this alignment problem it's not like one neuron and a layer of one network is going to correspond nicely to to another neuron in the layer of another network in fact there's no reason that one neuron Maps so another neuron at all it could be like a group


of neurons that are having the same function as as a single neuron and another network or one group mapping to to another group so it's pretty complicated but in another line of work we've been looking at doing exactly these kinds of comparisons using canonical correlation analysis and the basic framing is as follows we have some data set of interest and we're going to


think of the neurons representation what it's learned as what we call an activation vector so we feed in this kind of data set of interest and this neuron is going to emit a scalar value across all of these these input points and we can literally just sort of stack all of these and that'll form a vector that we call the the activation vector of this neuron and so there's this sort of nice


framework where we kind of think of these neurons as these activation vectors and because layers are linearly combining their neurons there are sort of these subspaces that are sort of spanned by their neurons so I'm so so this is going to be at a very high level the details of like all the the the mathematical details of CCA are in their relevant papers but so at a very high


level what we do is we take in two sets of these neuron activity vectors and they're typically going to be layers so layer from one network a layer from another network and then CCA will find the linear combination of these neurons that maximizes correlation and by iteratively applying this process we can basically get something like a similarity score between these layers so


the score just tells us well you know how how similar are the representations learned by these layers sort of up to sort of scaled linear transforms so that's the way in which it addresses this disalignment issue and so previously we've kind of used this to study various properties of convolutional networks lately it's been become quite popular in studying various


different kinds of language models in NLP and more broadly this this kind of entire area of studying similarity between deep representations has quite a lot of people who have been thinking about it so we're I'm mostly gonna be talking about using CCA but the first paper here was probably this paper called convergent learning by Lee Osinski Kuhn Lipson and Hopcroft in ic LR 2016


where instead of dealing with the distributed problem they just tried to find nice one-to-one mappings between between neurons and different networks then we kind of followed up with some of the CCI work then there was a more recent paper that's really pushing this framework of having activation vectors for neurons and and sort of comparing similarities between subspaces


and then most recently there's been this paper similarity of neural networks representations revisited by Kornbluth naruse Ely and Hinton that's broadly proposing a kernel based similarity measure and one one quick note about sort of all of these is that I think performing these sort of similarity comparisons is a very interesting way to try and get at what your are neural networks are doing it's


kind of useful for interpretability and it has interesting consequences for things like compression and for model Ensemble Inc and sort of all these papers including our own are interesting but I think there's a lot of scope for doing things in a more formal and a more principled way so although many of these methods are built off of sort of principle techniques a lot of the ways


in which we apply them are indeed heuristic and we I don't think we can claim we fully understand their limitations or or where best to use them so I think there are a whole bunch of interesting questions in this space but okay so going back to transfer learning what are we going to do well we're gonna do a very simple experiment we're gonna train a bunch of networks from pre train


weights we're gonna train a bunch of networks from random initialization then we're going to apply CCA to just see how similar they are to each other we want a baseline so CCA is gonna give us these similarity scores but we want some kind of a baseline to compare these two and so we're also going to look at the similarity scores we get when we train a population of networks from different


random initializations and apply CCA there so here what the results look like so along the x-axis are sort of different architectures these blue points are what you get from doing this comparison from networks trained from different random initializations and these yellow points are what you get when comparing pre train networks the network's train from random


initialization yeah so so you do see different architectures here but ah good point no we didn't do that and that would be kind of an interesting thing to study definitely so-so but yeah so we just kind of stayed within an architecture but kind of the the takeaway is that these blue points are sort of higher up than these yellow points what does that mean well it means


that models train from random initializations seem to be more similar to each other representational e than then models trained from from pre trained weights and transfer learning so even though we're seeing the same performance there is something different happening at the the representational level so yep the different circles actually compare a correspond to different networks so we


train multiple networks and then we just sort of performed we put on these comparisons yeah so it's it's it's averaged over the layers um multiple I mean I can tell you offline but sort of slightly different layers for different networks because their architectures are a bit different but yeah taking a few layers at different stages in the network performing this comparison and


then averaging we have two distributions and I get a bunch of samples Ramon popular some examples of the other you know like basically just be something I'm wondering like any statistic is going to be kind of you know but I think this pertaining to a population but you know this number of like thirty four and a half verse 36 is this enough to tell me something about I think it is hard to


compare across architectures at least the way we did this experiment just because like we looked at different layers and things and we'd have one point see see a similarity actually telling us a lot about of transferability I think well not about transferability but I think it is actually telling us something about what's similar versus what's not similar like I think that was the whole point of


like kind of having this sort of baseline comparison I guess in blue and I think the fact that we see and nobody tried like multiple networks for that so I think the fact that we are seeing that the blue things are higher like in most cases is telling us that there is more similarity there we train on the same training data exactly yeah yeah because we're interested in lots of questions


okay we're interested we're interested in yeah sort of seeing what this looks like once we've trained on the medical data yes oh yeah so like we're not done making the conclusion yet but sort of the first thing we saw was that like performance is similar and so like hypothesis one is like it kind of doesn't matter how you initialize and like they're actually all doing the same


thing all the way through so on top they're clearly similar because performance is similar but like we don't know what's happening in between so so then we try this analysis and then and then it looks like different things are happening in between but there's kind of more coming yep CCA assumes that the inputs are like linear you take a linear combination I was wondering if you try


like deep CCA where you take a nonlinear or why did you assume make the linearity assumption yeah I mean that's a good question you could definitely try deep sea CA for CCA like I mean we have to have some kind of I guess place where we want to say something is like you know like where we kind of conclude that things are not that's similar to each other representational e and we thought


linear is like kind of a good proxy because you know layers kind of operate linearly and so like you know things are sorted within linear transforms of each other it seems like a reasonable kind of call to say okay that's sort of somewhat similar whereas yeah when you come to like not like I think the nonlinear comparison could also be interesting but yeah you


need to know exactly when to call things similar and not somewhere oh man so many questions okay I'll take one more question and then maybe move on did you have a question me yep okay Jack maybe we'll chat more offline okay yep similarity r/t layers yeah so it's that's an interesting question and what I'm about to get to so so the altar is like I think for like


some models you see that but not for not for not for others and so that is about to come up yeah so so so okay so like kind of so we saw performance is similar and then a hypothesis says maybe they're just all doing the same things that doesn't seem to quite be the case and now like kind of let's look further into that and to look further into that let's do something really simple so this are


the actual filters from the first convolutional layer of of ResNet that's kind of initialize with pre-trained weights so you trick take your rest net you pre train it on image net and this is what the filters look like and sort of you know true to kind of the community's expectations you see all of these really nice Gabor filters come up so yeah so I don't think the weights OCC


I only operates on like activations like I think it's like I think it's difficult to sometimes make direct comparisons between weights because your weights can look really different but I think functionally is like what we what's like more interesting to us like I mean there's like the standard experiment where you have like a ground truth neural network and then you train


something to mimic that but like even they're like the weights are not going to look like that's similar but like kind of out with wise is yeah what we're looking at well yeah so we're interested like whether there are kind of functional similarities in these they're like like the actual outputs and so that's what we we study by making your your similarity measure parameterize by


the examples not by the weights it factors out all these in variances and permutations and stuff like that inside of a network and like you mentioned there are lots of papers legend sincere that find all these relation between the example mapping or the ground matrix it something yeah like I think almost all of these like even even the paper those doing kernel based


measures yeah like kind of thinking about it in terms of examples I think is kind of really helpful for doing these sort of similarity measures but okay so so we're gonna do something even simpler let's just look at like let's just look at the filters okay so these are the filters from conv one that we've initialized from having pre-trained freshly off of imagenet look at all


these gorgeous Gabor filters what happens when we when we train this network so we train it on this medical data and well after training it actually looks kind of similar so so maybe that just means that you know these like these kind of Gabor filters are perfect for this medical data okay now let's see what happens when we do the same thing from random initialization so this is


what our our network looks like when we randomly initialize it and again we're gonna train it on this medical data so we do that and oh man this actually also looks somewhat similar so so so what is going on because so over here like maybe you could say oh there's interesting feature reuse happening but but you're also seeing the same stuff for random initialization okay so that's like our


that's that's ResNet now we've trained a whole bunch of other architectures and some of them are much smaller so what happens here well here's one of our very small architectures it's maybe one-tenth the size of the resonant so here it is initialize with it's nice imagenet weights and what happens after training well it actually changes dramatically and then again if we look at it at


random initialization and then look at it off your training again it changes significantly your connections a few dozen skip connections activation I mean we should interpret them by adding you know having you across layers or something like the real representation is and it depend on all the layers not so this is just yeah so so because the architectures are different we looked at


Khan Wan specifically for that because it's sort of below all of that now you are getting feedback from kind of the skip connections that you aren't getting but I think this this is also true for for say like something like Inception as well I'm just sort of showing showing resonate here and I think I think what's really going on is to do with sort of to do with the size of these models so yeah


so two quick points one point that's kind of interesting is that everyone loves Gabor filters but these models are not actually the smaller model which is changing a lot does it actually really seem to be learning at least the classical Gabor filters and so here are like places where there's a good more filter and it's actually erased the Gabor filter so like here's another


place where it's kind of good more filter erase cover or filter erase and then the other point is relates to what my tousle already brought up which is that like what we observe through kind of further experiments is that the size I think the size of these architectures is actually kind of really impacting what you see during this fine tuning process so like the kind of picture we


have in our head it's sort of maybe so random initialization and pre-trained weights take us to sort of very different parts of the space but sort of somehow when your model is kind of large and these imagenet architectures are indeed in some sense seem to be large for these medical tusks maybe you just don't sort of move as much and then and then whereas when you have sort of


smaller models you sort of change a lot more now we've you know we've throughout this workshop we've seen lots and lots of interesting work on the neural tangent kernel and sort of thinking about these infinite with limits in the kernel regime versus the sort of the not the deep regime but like at least it to my kind of high level understanding it's not a direct mapping to what we're


seeing here so I think it's kind of interesting to to sort of study this further and try and understand try and make this connection because there's probably some kind of a connection and sort of understanding why this is happening would be really interesting okay so um final point is that in the paper we have a lot more kind of work on sort of broadly thinking about


similarity and reuse there are other interesting things we see like we can store for our larger models our similarity at initialization can be pretty predictive sort of similarity post training we can also like kind of look at how much feature reused is happening and this interesting co-adaptation problem which happy to chat about more offline but you know i


think time is running out and I don't want to I want to make sure we get to lunch on time so I wanted to end with I think one of the most interesting observations we saw during this entire set of experiments so one thing we observe again and again across different architectures and and across our different setups is that when you train with pre-trained whites versus


training from random initialization there is a huge difference in convergence speed so this yellow line here is what you get when you convert in sort of your training your training curve with with pre trained weights and this blue line is what you see with random initialization if you sort of extend these far enough out they basically converge to the same value but


there's this sort of huge difference in in how quickly they converge and you know when you when you first see this plot you might think oh well this means that transfer learning is doing its job like you know you've learned some useful features and you're sort of reusing it and that's why you're converging foster but we've also seen a lot of counterintuitive results on the things


that larger models are sort of maybe a bit lazier and just don't move as much and it's it's still kind of not fully clear exactly how much feature use is happening in this in this process and so we tried an experiment to try and understand why we see this difference in convergence speeds and the experiment is very simple so we decided to initialize by drawing weights IID from from sort of


the same distribution as random initialization but rescaled to match the pre trained weights so sort of here's here's what this concretely would look like if you initialize those pre trained weights you'd look something like this if you initialize with random initialization you of course destroyed all the features and it looks something like this and then this thing which we


call the mean var in it I mean it looks exactly like random initialization except that it's scaling is different because you sort of rescaled so how does this do if we initialize what this and train instead turns out that it actually helps a lot with convergence speed and we sort of students across different architectures and across our different tasks and so what's really interesting


here you didn't very and grains from the imagenet transfer the pre train weights exactly and and it was per later so not across the entire architecture that wouldn't make sense but sort of perlier take this and then initialize and so what's really interesting is that yeah this is this is a feature independent property because we're sampling i idea we've kind of destroyed all of the


features and we're only kind of keeping the scaling but these are these are just both for the the two large-scale medical imaging tells me like that and when we already know from and the relative order of magnitude of the amount of data on sorts first target times because uh a dramatic impact here like did you look at like Burt did you do all the stuff we were doing the exact same things in 2014


but instead of training on the billion or a dataset we were training on like penn treebank or something like this and that difference like the discrepancy like and I've seen I know at least internally at Amazon I have some colleagues we're doing some stuff that was like how many so many unsupervised examples what I like look the fire fiber choosing it by the cost of like how much


would I pay to get a million unsupervised examples versus a hundred extra labeled ones or something like that and these numbered skin you know could be it could be a very big difference so I wonder with 1 million versus two hundred thousand is are sort of on the same order of magnitude and that's why you see yeah so actually this specific experiment we also so like I'm


not covering this here but we tried a bunch of things where we varied the data and so it's interesting but this is actually pretty robust to varying the data so you see the same sort of like convergence like you actually see a speed-up even when your data is much smaller one thing you do see is that with these really large image that architectures if you have something as


small as like five thousand data points that's when you see like a little bit more of a gap between transfer learning versus random initialization maybe it's like two percent but then by the time you've gotten to fifty thousand examples that gap is like almost gone and and like there's really no reason why you'd a priori you want to use like kind of imagenet sized architecture


on like 5000 examples like I think that's sort of like also like kind of yeah merits sort of further study we've been talking about over parametrizations I think that's like an interesting related question but yep the main point here is that this is like this is just purely a feature like a property of scaling and it's kind of a purely feature independent property and so I


think there are a whole bunch of open questions here especially related to this kind of scaling part so specifically is there sort of maybe some scaling rule that explains this convergence speed up we looked at this a little bit but sort of not extensively and there are differences but I think it seems like it should be possible to maybe pin this down and then I think we


also did some very preliminary experiments on natural images and I think we're seeing sort of similar effects and there are kind of interesting questions we can all skier like you know if we train and then sort of reinitialize but just preserve the scale like you know do you see a difference in convergence speed that's like one of the basic questions we could


try and try and answer and then I think there are sort of other questions that also came up through this process sort of like kind of maybe really kind of getting at sort of similarity of representations at initialization versus after training and sort of how I do things vary between large and small models because at least I mean looking at the weight certainly they're learning


very different filters so sort of understanding that better would be really interesting and then I think there's also kind of scope here to actually formalize things a little more so I'm sort of seeing medical imaging partially also as this way of seeing a place where transfer learning does provide some benefits some convergence benefits but in a scheme where like the


the source and target distribution are extremely different from each other and so just understanding better what might be happening there and maybe saying something formal there could also be very interesting and with that thanks for thanks for coming [Applause] oh yeah absolutely I mean like honestly if you look at how much how long you train rent from random initialization


versus training on imagenet plus training on the medical data like training from random initialization is going to be way faster like this but this question makes scent like sort of the reason this question is very important is because people are just downloading their models from github and then sort of just doing the fine-tuning so at that point you're like oh well you


know this thing is readily available so do I want to do this or do I want to do do something else yeah yep now we didn't do 200,000 so I can chat with you offline about that but you don't need to do 200,000 - to kind of get a good similarity measure you can do something smaller than that the trade-off there is between sort of like the number of data points you're using and serve the actual


number of like kind of vectors you're trying to find similarities over this is why people so so okay so I think there are two parts to this firstly like people I think there's some outs of people like using transfer learning simply because they've seen other people do it and kind of you train it and then you can do this process and it sort of works and you're like oh great


but I think I think in sort of settings where people are doing extensive experimentation like I know we think Google like part of the reason transfer learning is popular is I mean they have resources but you're still trying to run a lot of experiments and part of the reason transfer learning is popular it's because of this speed up you see in convergence I think like you have to be


a little careful about this because um part of the reason I think you also see this fee up and convergence is because you're also committed to this imagenet architecture so like in the paper we sort of studied this further but you know I think like we're meaningful feature reuse is happening if it is happening is really in the lower layers and so one way to get sort of similar


speed ups but maybe have a better architecture is like you kind of just reuse some of the weights and then you sort of reinitialize stuff and sort of train that away and this ties into like kind of all kinds of other interesting questions so like there's been this interesting point in in deep learning about this co-adaptation problem which is suppose I have an initialization but


I only keep part of it and then I kind of reset everything else how will those work together and and it's kind of interesting because for some settings that's been a problem for this it doesn't appear to be a problem so that's also another interesting question to study I think yeah yep yeah absolutely so I mean I guess I guess Zack and I were we like I guess


this is a discussion we mentioned briefly earlier so if you have a very very small amount of data you will see a bit of a difference so I think we had to get to five thousand data points on the image net architectures at least and so there we saw maybe like a two percent difference instead of like a fraction of a percent difference but then by the time we got up to like fifty thousand


data points that kind of that difference was really gone and then when we tried on a much smaller architecture so bear in mind before we were training this enormous image and net architecture so we tried on a much smaller architecture and then there it didn't really seem like there was much of a difference so I think I think yes you do see a difference but part of this is like a


hi everyone, let's get started. Good afternoon and welcome to MIT 6.S191! TThis is really incredible to see the turnout this year. This is the fourth year now we're teaching this course and every single year it just seems to be getting bigger and bigger. 6.S191 is a one-week intensive boot camp on everything deep learning. In the past, at this point I usually try to give you a

MIT 6.S191 (2020): Introduction to Deep Learning


synopsis about the course and tell you all of the amazing things that you're going to be learning. You'll be gaining fundamentals into deep learning and learning some practical knowledge about how you can implement some of the algorithms of deep learning in your own research and on some cool lab related software projects. But this year I figured we could do something a little


bit different and instead of me telling you how great this class is I figured we could invite someone else from outside the class to do that instead. So let's check this out first. Hi everybody and welcome MIT 6.S191 the official introductory course on deep learning to taught here at MIT. Deep learning is revolutionising so many fields from robotics to medicine and


everything in between. You'll the learn the fundamentals of this field and how you can build some of these incredible algorithms. In fact, this entire speech and video are not real and were created using deep learning and artificial intelligence. And in this class you'll learn how. It has been an honor to speak with you today and I hope you enjoy the course!


Alright. so as you can tell deep learning is an incredibly powerful tool. This was just an example of how we use deep learning to perform voice synthesis and actually emulate someone else's voice, in this case Barack Obama, and also using video dialogue replacement to actually create that video with the help of Canny AI. And of course you might as you're watching this video you might


raise some ethical concerns which we're also very concerned about and we'll actually talk about some of those later on in the class as well. But let's start by taking a step back and actually introducing some of these terms that we've been we've talked about so far now. Let's start with the word intelligence. I like to define intelligence as the ability to process information to inform


future decisions. Now the field of artificial intelligence is simply the the field which focuses on building algorithms, in this case artificial algorithms that can do this as well: process information to inform future decisions. Now machine learning is just a subset of artificial intelligence specifically that focuses on actually teaching an algorithm how to do this without being explicitly programmed to


do the task at hand. Now deep learning is just a subset of machine learning which takes this idea even a step further and says how can we automatically extract the useful pieces of information needed to inform those future predictions or make a decision And that's what this class is all about teaching algorithms how to learn a task directly from raw data. We want to


provide you with a solid foundation of how you can understand or how to understand these algorithms under the hood but also provide you with the practical knowledge and practical skills to implement state-of-the-art deep learning algorithms in Tensorflow which is a very popular deep learning toolbox. Now we have an amazing set of lectures lined up for you this year including


Today which will cover neural networks and deep sequential modeling. Tomorrow we'll talk about computer vision and also a little bit about generative modeling which is how we can generate new data and finally I will talk about deep reinforcement learning and touch on some of the limitations and new frontiers of where this field might be going and how research might be heading


in the next couple of years. We'll spend the final two days hearing about some of the guest lectures from top industry researchers on some really cool and exciting projects. Every year these happen to be really really exciting talks so we really encourage you to come especially for those talks. The class will conclude with some final project presentations which we'll talk about in


a little a little bit and also some awards and a quick award ceremony to celebrate all of your hard work. Also I should mention that after each day of lectures so after today we have two lectures and after each day of lectures we'll have a software lab which tries to focus and build upon all of the things that you've learned in that day so you'll get the foundation's during the


lectures and you'll get the practical knowledge during the software lab so the two are kind of jointly coupled in that sense. For those of you taking this class for credit you have a couple different options to fulfill your credit requirement first is a project proposal I'm sorry first yeah first you can propose a project in optionally groups of two three or four people and in these


groups you'll work to develop a cool new deep learning idea and we realized that one week which is the span of this course is an extremely short amount of time to really not only think of an idea but move that idea past the planning stage and try to implement something so we're not going to be judging you on your results towards this idea but rather just the novelty of the idea


itself on Friday each of these three teams will give a three-minute presentation on that idea and the awards will be announced for the top winners judged by a panel of judges the second option in my opinion is a bit more boring but we like to give this option for people that don't like to give presentations so in this option if you don't want to work in a group or you don't want to give a presentation you


can write a one-page paper review of the deep learning of a recent deepening of paper or any paper of your choice and this will be due on the last day of class as well also I should mention that and for the project presentations we give out all of these cool prizes especially these three nvidia gpus which are really crucial for doing any sort of deep learning on your own so we


definitely encourage everyone to enter this competition and have a chance to win these GPUs and these other cool prizes like Google home and SSD cards as well also for each of the labs the three labs will have corresponding prizes so it instructions to actually enter those respective competitions will be within the labs themselves and you can enter to enter to win these different prices


depending on the different lab please post a Piazza if you have questions check out the course website for slides today's slides are already up there is a bug in the website we fixed that now so today's slides are up now digital recordings of each of these lectures will be up a few days after each class this course has an incredible team of TAS that you can reach out to if you