Hi everybody. Thank you so much for joining us for today's Protocol Labs Research Seminar. Today we are joined by Alex Mikolov, who is a final year PhD student at MIT EECS. He's worked on research and theoretical computer science and machine learning. He is also broadly interested in the design and implementation of systems that simplify how we compute and organize data. Today he will be presenting Mandala, a high-level data management language implemented in Python. So Alex, I'm going to let you take it from here and thank you so much for joining us today. All right. Thank you for introducing me. Today I'm going to tell you about this sort of programming language, which is broadly speaking for managing data produced by computations. And while this is originally inspired by things like machine learning and data science applications, I believe the same abstractions can be very useful in a natural fit for things like content addressable computation, which is probably what you're more interested here. To just dive right into it, I'm first going to give you short overview of first the problem of data management, and then just sketch where we're going with this talk. And to motivate things a little bit, here's a here's a file name that you may have seen something like this if you've done some machine learning or data science experiments. And this file name tells the story in a way, presumably the story of how this file came to be. And this story doesn't look like a very happy one for whoever has to deal with this file. And to just unpack a little bit the different participants in this story, if you will. We have, first of all, the kind of quantity that's being represented by this file, which actually makes a lot of sense as it's pretty reasonable. Things to include in the file name, then we have some parameters which presumably participate in the computation of the contents of this file in some way. However, it's not completely clear how they do so. Then we have some versioning information. Again, it's unclear at all what this versioning refers to. And finally, and worst of all, we have these subjective annotations that people just like sprinkling around when they're in a hurry. And as you can see, as usual, final is not the last item on the list. And good luck figuring out what any of these mean, like a week down the line or a month or whatever amount of time. So yeah, so this is in some sense maybe the worst of data management. And in general, the problem of scientific data management would be to deal with things like this, meaning save, load, query, delete and otherwise just organize quantities of this sort. This file name, as we said, is a very naive and probably one of the worst approaches to data management. And the starting observation for this whole project is that there is actually something else that tells the story of how this file came to be, namely the code that you used to generate the contents of this file. I'm going to argue that this code is in many ways a better telling of the story of the contents of this file. And where we're going with this is that basically we're going to in some way replace this file name as a way to refer to this file's contents by the code itself. So this probably sounds very weird at this point. So I have some explaining to do about this. So first of all, let's briefly see how code tells the story in a better way.  So first of all, the code producing this final quantity is unambiguous in a very strong sense. So relative to all the functions that you've defined here, the way these functions are composed to produce this quantity is perfectly clear from the code. Another nice thing about thinking of code as the name for whatever data you're creating is that code is very expressive. So especially in imperative programming languages, you can tell all sorts of very different stories for how your data comes to exist. And code allows you to do so very nicely. Another maybe more subtle thing is that code also implicitly encodes computational relations between the quantities being computed. And in things like data science and machine learning and surely not only in these domains, what we typically care about when we have a bunch of data like this is some sort of query that asks, okay, so how do my, for example, final metrics that are at the bottom of this piece of code going to depend on some initial parameters. And since code implicitly contains precisely the relationship from these initial parameters to these final metrics, it also is in a good position to kind of somehow automatically keep track of this and allow it to query things. Another nice thing about code is it has very naturally editable structure.  And if you want to pass to another sort of story, for example, if we want to remove the pre-processing, we can just delete these two lines of code, like in the middle of this here. And very easily switch to this different story for a different piece of data. Or if we want to change, for example, what alpha is, you can just go to the part of the code where alpha is defined and change that. And the final thing, code is also refactorable, which is especially easy to do in modern IDEs.  So you do, you evolve these two things jointly in some sense. All right, so this has been, you know, a lot of advantages of code. However, you know, the real question is, you know, code is so great. So if it's so great, you know, why not just use code itself instead of file names? And more generally speaking, why not use code itself as the principal interface to the storage of its results. And this probably sounds a little bit radical at this point, maybe even a little bit hopeless. But what I'm going to argue in the rest of this talk is that in fact, it's not only doable, it is actually very fruitful to do so. And it can dramatically simplify both the code that you need to write for data management and also the concepts that you need to work with in your mind. And just to give you a quick sketch of how we're going to actually implement this. So there's is going to be two main components to the system that have to work together in some sense. And the first component is a very radical form of memorization or very, I guess, aggressive form of memorization. And the idea here would be that you write some experimental primitives as Python functions in this case.  And each of the function calls to these functions is going to be memorized. And this is what you can refer to as a composable sort of memorization. And as we're going to see, this memorization is very tightly integrated with core features of Python. Like as I mentioned, data structures control flow, subroutines, in a way that prevents or avoids data duplication, and also keeps track of all relationships between the things that you're computing behind the scenes. Because you're always, if all the function calls that you're doing are memorized, you know, this is going to mean that you can in storage actually recover the chain of events that led up to a certain thing existing. And then another powerful thing about this sort of end-to-end memorization approach is that once you have a piece of code like this that you've already executed, so everything's been memorized, everything's been computed. And then if you want to interact with the results of this code, you can simply just re-execute or retrace this code. So you can step through this code again, except now that everything's been computed, you're not computing anything new. So you're not doing any heavy work. Instead, you're just traversing the storage in some sense. And by combining this with, you know, some imperative control flow, you can do very expressive imperative queries to your storage. So you can take a piece of code like this, you can rearrange some parts of it, maybe add some more logic. And this gives you a very powerful way to interact with storage directly by just using the tool you're most familiar with, namely the programming language you're working in. So this is the first component. And then the second component is a declarative query interface, which is in some sense complementary to this imperative query interface that I've been talking about so far. And here the idea is that if you look at this code, it's actually very similar to the code we had before for computing things or traversing storage, except because of this query context manager here. This code is interpreted in a very different way. And what it actually does is behind the scenes, it builds this graph of computational relations instead of computing anything. So this piece of code is going to define some sort of a combinatorial representation of your workflow. And then it's going to be able to compile this to SQL. So you don't really need to know anything about SQL to be using this. You're using things that are completely familiar to you, like these functions that you're working with. But behind the scenes, this is compiled to SQL. So you're using a very powerful query language behind the scenes. And you use this sort of structure to then ask questions of the sort for all the experiments that I've done that I've recorded in this storage. You're asking, give me a table of all the things that satisfy basically these computational relations specified by this piece of code. And just to quickly mention this idea also appears in a Julia project, which has a bit of a different focus. It's called their conjunctive query. So you can look this up if you're interested. All right. So this is for the main components. And then just to give you a quick idea of why this would be a useful thing to do at all. The first big reason would be just a massive code reduction. So if you have some experiment that you're doing and it has like a bunch of moving parts, then depending on which parts you've computed already or which parts you want to query or which parts you want to save, you're writing all these different pieces of code that are somehow all of them about the same workflow and the same logic that you have. But all of them also have this additional stuff that you have to go and deal with to accommodate a specific data management use case. And with Mandelwald, you can essentially just remove all this complexity and go back to the simplest in some sense canonical expression of your workflow of the logic of what you're doing. And you can repurpose this code for all sorts of different goals that you would need to write extra code for. So the first benefit is a massive reduction in the amount of code that you have to write and maintain. And then the other big advantage of this is that maybe a bit more subtle, but still quite useful in practice is that we have all these things like data structures and control flow and subroutines and refactoring that we've traditionally used for managing the complexity of software. And they've been very successful for that. And with Mandelwald, you can leverage the same concepts to in a very natural way manage the complexity of the data associated with the code that you're working on. All right. So this is for the overview. And then just for a quick plan of where we're going with the rest of this. So first, I'm just going to show you a demo. So this is actually a working system. So I'm going to show you a demo of how these things work in a very artificial, minimal context. Then I'm going to discuss different ways in which these programming patterns can be scaled up to more complex projects that have more moving parts and are changing. And you keep adding more parts to them. And in particular, I'm going to talk about how things like data structures and subroutines seamlessly integrate with these programming patterns that I'm describing. Then I'm also going to talk a little bit about refactoring, which is a necessity if you're doing some sort of computational experiments, because you're always adjusting things and coming up with new ways of doing things. And if you have a bunch of data already sitting in your storage that's connected to the old version of your code, it may be very, very painful to adjust to a new code base. And these refactoring parameters that I'm going to show you are exactly kind of streamlining this process. And finally, I'm going to conclude with some more or like a broader vision for where this is hopefully going. Now we're actually onto the demo. So I'm going to pull up just a Jupyter notebook here, where I'm going to show you just like the very, very, very basic form of these programming patterns that I've been talking about. So first I'm going to just do some imports and set up the storage. So as you can see, this says that it's in memory. This is just to make this example simpler. Typically for a large project, you would write this on disk. So we've created a storage. And now to demo the memorization, we're going to start in the simplest possible way. So I have this increment function here that prints out the message. And I'm decorating it here with this op decorator. It stands for operation. And I'm pointing it to the storage. And when I define this, what I'm doing essentially is connecting this function to the storage. So now the storage knows that there's this function, code increment, it knows about its signature, and other things like that. And now that I've defined this, the way I write to storage in Vandova is primarily by doing function codes. So this is the whole memorization business that I've been talking about. And the simplest example of this, the Hello World, would be to just create this round context with the storage. And you call this function inside. And as you would expect, you get this message printed out. So we ran a function, and we put the result of this in storage. So now the first important thing to understand is, when I do this again, what's going to happen is that I don't, or what's not going to happen is that I don't get this message printed out anymore. And this is because the storage already knows that I've done this work, that I've called this function on this input. So what happens is it bypasses the function execution, and it directly just loads the results from the storage. And we can actually look at what this result is. So I'm just going to print it. And as you would expect, this is 24, so it's 23 plus one. However, there's also this around it. And the reason that this 24 is wrapped inside this object is so that the system can keep track of things. And in particular, we have this most important property of this object is the UID, which is some meaningless identifier that serves as some sort of pointer to a storage location for this result. All right. So so far, so good. This is a pretty basic memorization stuff. And then where this gets more interesting is when you start creating more and more functions and composing them in more and more expressive ways. So as a steps towards this, I'm defining here this add function, which again, prints out the message that's true numbers. And now I can create this mini workflow or mini experiment, if you will, on adding numbers. So what I'm doing in this in this piece of code here is I'm ranging over some values of I, and then I'm saying, you know, J is going to be the incubi and then final is going to be the add of I and J. So I can again, run this. And as you can see, a bunch of stuff gets printed out. By the way, one of these increments that we're doing is we're incrementing 23, which we've already done. So as you can see, this is not showing up. So this is why we have these two consecutive calls to add here. All right. So, okay, so this is great. So we've computed all these things. We've put all these things in storage. And now the same thing applies that applied before that if I run this again, nothing actually gets computed. And this is the retracing part that I was talking about. So when you have a piece of code like this, and you've already executed it, just running through it again doesn't do any computation. It just retraces its steps. So this is the retracing pattern. And so going back, oh, sorry. And so I guess expanding a little bit on this retracing pattern, what this pattern is very good for is not simply revisiting code you've already executed. What is very good for is actually making your code very open to extension. So, and this openness can hold in many different ways. So for example, I can take this code and I can extend, for example, this range of parameters. And I can also add some logic here. And when I run this, I am basically adding more computation on top of what I've already done before. So this is very useful in things like if you're doing exploratory data analysis or machine learning, this retracing pattern makes it very easy to iterate on a piece of code in the simplest way possible without actually having to really think about how you're organizing your data or how to avoid computing things you've already computed. So that's a very nice pattern. Another very related pattern in which you can use this retracing as a sort of query interface. So for example, if I'm interested in some values for I here, I can just edit this code and go over these values and just collect these results. So yeah, so you can even more flexibly modify a piece of code to just use it directly as a way to traverse the storage and as an imperative query interface. And the final thing to mention about this retracing pattern, which is very important if you're doing some long running experiments or computations, is that if you have a workflow like this and it fails at some point, which tends to happen sometimes with long running computations, restarting this computation is trivial because you don't really need to write any extra code to do this and you don't need to prepare in advance your code for resumability. What you do is simply you run this piece of code again and it's going to retrace its steps up to the first point where it failed and then just continue computing from there. All right. So this was the memorization demo. And any questions about the code so far? I have just one question. So if you have two different developers basically interacting with the system and maybe they don't even know what each other is doing, if they both define the same increment function, would they be hitting, benefiting from each other's cache basically? Right. Yeah. So it depends. So certainly the focus until now for implementation has been on like a single developer, but you could totally imagine this sort of caching taking place. The thing is they will have to really be sure that they're pointing to the same function behind the scenes because these functions like this ink, for example, when you're defining this is going to assign to this function some permanent identifier behind the scenes. And so if the other person makes sure that they're pointing to the same identifier, then yes, they're going to be sharing their work if they point to the same storage. Yes. I imagine that this is actually, it's probably possible to generalize it even if they haven't stored the, if they're not pointing to the same function in the sense that you're describing because you could presumably derive the identity of the function based on the structure inside so that like if two people implemented the same function, it would have the same idea. Right. Yeah. It's definitely a very interesting question. It also ties to a lot of, for example, if you want to do versioning, like if you had a structure representation that completely specifies the semantics of your function, this would be wonderful. Yeah. So yeah, the thing is, yeah, this is also a bit maybe rough around the edges to do this. So for example, here you have this print statement, right? So it adds nothing to the semantics. So you have to exclude it somehow. You could imagine like all sorts of other things that, you know, look semantic maybe, but actually don't really matter. Like you could have some death cult, for example, or something like this. So yeah, it's a little bit tricky, even though it would be wonderful. Yeah. If you would do it, it would unlock a whole lot of other things also. So not just like even for a single developer, it would be very useful to have this sort of introspection to be able to do it. And you know, of course, you can pass to a more restricted DSL and then you could be able to do something like this. Yeah. Yeah. Cool. All right. So yeah, so this is for the memorization. So this, this has been the demo of, I guess, how this works from a user point of view. Maybe what's more interesting, if we use also how it works behind the scenes. So to unpack a little bit, what goes on when I call one of these functions. So for example, if you take the F function, it has two arguments X and Y. As I already mentioned, it also has some permanent UID throughout the life of this function. So even if you change things about this function, it's going to have always this UID during the course of its life. And then if you pass in some arguments, the first step would be to assign UIDs to these arguments as well. And so you do this very natively just wrapping these inputs by content, which works well enough when your inputs are simple enough things. And you assign UIDs based on this content hash. So then once you have this, the next step is to compute a UID for this call.   So based on the call UID, you do some storage lookup. And then if you don't find a call, there's no choice you have to compute. So you compute, you save the results, then you return this value reference that has its own UID that you can pass to future functions. And if the call is found, and that's the easier one, you just load the results and you return something identical to what you computed the first time. The demo of this second part that I mentioned, namely the declarative query component, this is going to refer to the previous workflow we had. So yeah, this workflow. And now I'm going to, or rather, we actually have the other thing. So yeah, this workflow. And now I'm going to make a relational query to this workflow. And this is best understood by going through this, maybe line by line. So first we have this query context that tells us that we're doing a query, we're not computing anything. And then here we had a loop over I. So we had some variation over I. And now we're replacing this variation by this query object, which basically tells the system that I is going to be like this placeholder that at this point can match anything in the storage. And then to make this more interesting, when you have the same line, which is identical to what we had in the computation, when you say the J is ink of I, you are saying basically whatever I can match, J can only match ink of this. And then when I add this last line of the computation, which again is identical to what we had before, I'm saying that whatever I and J can match to, final must match the ad of I and J. So I specify this combinatorial structure expressing these computational relations. So this is what this part is for. And then to query this, I call this get table function. And I pass some local variables that I've defined up here. And I get out a table. And just to make this a little bit more meaningful, I can name these things here. As you can see, we get out this table. And if you look more closely, you notice that each of the rows of this table, the value in the second comb is one plus the value of the first comb. And this is because we have this constraint. And the value in the last comb is the sum of the values in the first two columns. And this is because we have this constraint. So hopefully, this example makes it a bit clearer. And just to really go a little bit deeper into this, I'm going to also show you how line by line what you're doing with this query interface would correspond to a SQL query or SQL ish, I guess in this case. So when you get to the first line, if you translate this to SQL, what this would mean is essentially that you only know that you're going to be selecting some stuff. Then when you have this first line, and you say I equals this query place holder, what this tells the SQL compiler is that you're going to be selecting the table of all values in storage. And you're going to be selecting from a copy of this table of all values named I. Then when you add the second line, the J equals Incvi. This is going to be interpreted in a very similar way. So there's going to be another copy of the table of values. This time is going to be called J. And you're also adding this constraint that J is Incvi. And then the last line is also or the last part of this computational or these computational relationships also has a very similar effect to the query. So you are conjuncting on this new constraint of final is the add of find J on top of the constraints you had before. And finally, when you call this get table function, it tells you what it is you are selecting from this. This was just a basic demo. And now I'm going to talk about how to actually scale this up to more interesting use cases. So so far, I've been talking about what we have here, this retracing pattern which tells you if you want to get to something in storage, just walk over the code that computes this thing, which sounds like it could take ages for certain things. Like if you have lots and lots of code, just walking through this code again could take a long amount of time, even if you're not doing anything. And so this pattern may sound a little bit hopeless maybe, but what I'm about to show you is how you can actually in very natural ways overcome these sorts of problems. And the second part of the demo is going to be based on this random forest example. So you don't really have to know anything about random forest beyond the fact that I'm going to explain here that it's a machine learning classification algorithm. And as typical in machine learning, you have some examples, you have some labels, and you have some randomized decision tree training algorithm.  And these trees together comprise your random forest. And then when you want to make a new prediction on some example, you take the predictions from all these trees, you do a majority vote on them, and this is your final prediction. And for this example, we're going to have just a few functions that basically go over what I just explained. So the first function takes no inputs and just gives you the data set that you're going to use. So it gives you examples and labels. Then there's a function to train a single decision tree. So it's going to take in some examples, labels, and some random state just to keep track of the randomness. And it's going to return a tree. And then there's going to be a function to evaluate the entire forest. So it's going to take a list of trees. So this represents the random forest. It's going to take in the examples and labels and give you back the accuracy of this forest on this data set. And one notable thing here is you have this list data structure appearing in one of the arguments of our functions. And part of this example is to demonstrate how these sorts of data structures seamlessly combine with these patterns that I've been talking about. All right. So these are the functions. And then the workflow that we're going to start with is basically what you would expect given these functions. So we're going to create this data set. We're going to train 50 random decision trees on this data set and encapsulate them as a list. And finally, we're going to evaluate the random forest consisting of these trees on this very same data set. So going back to the notebook. So I'm just going to set up what I've been talking about here. And we have these functions that I talked about. You don't even need to read this code. And here we have this maybe a little bit larger. We have this initial workflow that I've described. And we can run this. That's pretty great. We get some accuracy of 0.94. And now, you know, despite this list here and things like that, running this code again again has the property that, you know, running code twice with Mando always has, which is that it's not going to compute anything. So running this again, if you notice, it took less time. This is because it's not really training anything. It's just retracing the steps. And I mean, again, we get to this number. And if you think about this workflow a little bit, you can notice actually some problems with this. And I guess the problems are clearest to understand if you think about what work you have to do to get to this last thing in the workflow, this forest accuracy. So this accuracy of the random forest, it's just a single number. So it's a very small thing in storage. It's very fast to load. However, by using this retracing pattern, getting to this number is very, it causes you to do some very heavy work. So one unfortunate thing you have to do is you have to go through this loop again. So you have to loop through each of these function calls. And when you're doing that, you're like, oh, I've done this, I've done this. So you know, you've done all these things, but you're still looping through them. And the other inefficient thing about this workflow is along the path to this final single number, you're loading all these things from storage. And they could be potentially very large objects that you don't even want to look at for your use case. So these are the problems. And we're actually going to show some very simple ways to solve each of these problems. So to overcome this looping problem, what you can do and what's very natural from software engineering actually is that you're going to put this loop into a function. And now instead of looping through 50 things, you have to just go through one function code. This is going to be it. And then to deal with this problem of potentially loading these huge things from storage, you're going to do lazy loading, which basically only ever loads something from storage if it really needs it for computation. So this is where we're going with this. And now in a little bit more detail, so the first going back to these problems, so we're going to first fix the first problem by using essentially subroutines and adapt them to data management. So these are what are the so-called higher-level memoized functions. So if you recall, this problematic part of the workflow that we have, this highlighted line here, this loop, what we're going to do is we're going to extract it as a function. So I'm defining this function, train trees. I'm exposing some of the things it needs to compute whatever it's computing as inputs. And it's returning this list of decision trees. And I've just taken this piece of code and I've just put it into this function. And if you notice, the decorator here is different. It's before it used to be up. Now it's super up, which reflects the fact that in this high-level memoized function, you can actually call other memoized functions, which is not something you can do in the lowest-level memoized functions.  So we can actually do this exactly what I just described. We can execute this. And now here's the refactored workflow. So this is the refactored line. Everything else is the same. And I can run this. And as you can see, again, we're getting to the same thing we had before. But now we are going through this new function. And now if I run this again, something actually a little bit different is going to happen from the first time when you run it. And this, I think, deserves a little bit of note. So going back to this workflow that we refactored, if you think about what happens the first time you pass through it, so a lot of the stuff is the same as in the inefficient workflow we had before, except now we're going to get to this call to this new function train trees. So when this happens, because this is a brand new function, there's no calls to this function and storage. So you're not going to find this call for these inputs and storage. And what you're going to have to do is you're going to have to actually go inside the body of this function and retrace whatever is happening in there. And this means going through this loop again. And finally, you're going to come out of this loop. You're going to get finally the list of fees. You're going to return this. And importantly, you're going to save the call to this new function train trees. You're going to save this call and the storage. And then you're going to proceed with everything else as you did before. And the important thing that happens here is that by running this code, you've essentially created this shortcut to the storage. So you've had to go through the loop again. But now that you've done this thing, that you've saved the call to this new function, you've created a shortcut in storage. So that the second time you pass through this new workflow, again, you're going to get to this call to train trees. But now you're going to find this in the storage. So you're going to skip directly to the final thing. And then, again, everything else is going to proceed as it did before. So you've essentially kind of patched your storage to introduce this shortcut that allows you to jump over these uninteresting calls that you don't want to retrace every time. Clearly, a nice way to solve this problem. However, this very simple natural idea of using subroutines is also useful for a range of other things. So one thing, so what subroutines are usually employed to do in software engineering is to manage the complexity of code. And this abstraction actually allows you to kind of carry this over to manage the complexity of data. So as mentioned, this can be used to optimize retracing. On a more, I guess, philosophical note, these high level functions kind of make this bet that in any sufficiently complicated project created by humans, there are going to be these stable higher level or stable hierarchies of abstractions that humans come up with, just be able to keep things in memory even. And these high level memoized functions kind of allow you to tap into this phenomenon and go beyond the way we use this phenomenon in software engineering where we're just structuring code that has nothing to do with some data associated, or there's no data associated with this code. And these high level memoized functions allow you to kind of generalize this to also manage the data connected to the code. And a final thing that I'm going to show you some more pictures about in the next few slides is this sort of hierarchical structuring also optimizes the declarative query interface that I showed you before. And just as a quick example of this, this is just a different workflow just for the purposes of illustration.  So just very basic machine learning stuff. And imagine you've run this sort of workflow with many different instantiations of all the quantities here. So many different datasets, many different values of alpha, many different labels, even though the labels would vary jointly with the dataset.  And if you think about the relational picture of this, or what this might look like in your database as a mental picture, you're going to have something like this, or you're going to have, so here in green, you can think of them as one column tables that keep all the different values of the local variables in this piece of code. And in red, I have these tables with more columns that correspond to the functions that are being called here. And this is a very useful mental picture to have just for what's going on behind the scenes when you use this declarative query interface. And these red arrows here are essentially foreign keys from the memorization tables of these functions to whatever values of the inputs corresponding to a call. And if you want to use the declarative interface to query something like this, what you typically want is maybe to get a table of the joint dependency between x, y, alpha and accuracy. And to do this, you'd have to do some join of these tables. So you have to join a bunch of tables to get to this final result, which is fine if you're joining a few small tables, but if you have a project with like 100 functions or something like that, it may be more problematic. And what these high-level memoized functions allow you to do is essentially to just draw this abstraction boundary around this and replace this with a single function that kind of encapsulates whatever is going on inside this box that we have here. And now that you do this, you don't have to join any tables anymore. So you literally have the answer to your query like in this single table. So this is how these high-level functions allow you to optimize queries. And then, oh, maybe this is a good time to actually stop to see if there is any questions about this at this point. No questions? All right. So this was about these high-level memoized functions. And now the other optimization that I mentioned I'm just going to very briefly describe is this lazy loading. So it's basically what you would expect. So we have this one keyword that we can actually do this here. So you have this lazy keyword in your context, and this makes the entire context use this lazy loading. So you run this and you see now the final thing I end up with this accuracy, it's not in memory. And in fact, none of the things along the way are loaded in memory. So what's going to happen when I run this is that when I get to this first line, X and Y are just going to be pointers to storage locations without any data. And then trees, even better. So trees is technically, it's going to be, and Python is going to be a list of things. However, the lazy loading is so lazy that it doesn't represent this as a list of pointers to storage. It represents this as a single pointer to a list of things in storage. And it's only going to load this list if it really needs it for anything. So for example, in this code that we have here, so this tree is like a single pointer, but that's enough because this pointer has a UID. And so this UID is enough for this call to the next function down the line to see, oh, I've done this call before. I don't care about the contents of this list. I can just give you the result of this call. And so it's sufficient like this.  But the bottom line of all these optimizations is that they are defined so that whatever control flow you have, if you add this lazy equals true to your code, it's not going to break your control flow. So you have conditionals or iteration or things like that. It's going to keep working with this lazy loading. So it's going to figure out what it needs to load. And then I'm going to just very briefly mention some more advanced query patterns. So if you remember this query we had in the beginning, it's a very simple one, but there are some things to note about it. So one is that all constraints that you specify here are going to apply to whatever you're querying. And then another thing is what if I have data structures in my workflow? So how do I even encode this as a computational graph? And there's answers to both of these questions that you can, if you're interested, I have more slides on this in the appendix. So I can talk about this afterwards. But the bottom line is that first of all, you can match two data structures in these queries. It's a little bit more involved, but you can do it. So this is what this make list construct here is for. And then you can also partition the constraints in your queries with this branching construct. And what the effect of this is going to be is that for each block of code in a branch, either all of the constraints are going to apply or none of them. And how these constraints are going to be determined is going to be based on context. So if I request something, or if I request some variables only from this block, if I want to get a table involving variables only from this block, I'm not going to activate these constraints. However, if I request some or some variables from this block, and they depend on some things from this block, then I'm going to activate all the constraints in both of these blocks. But this is just scratching the surface. I mean, there's a bit more details to it. But the bottom line is you can use this to partition the logic of your workflows. And why is this actually useful? At least in machine learning, it often happens that you have some initial data processing, and then you branch into several different ways of trying to extract some information from the data, whether it's going to be training some machine learning model or doing some data analysis. And this sort of structure with the branches allows you to reuse the code for the initial stages and add on top of this the different branches that you're exploring in a way that doesn't cause the constraints from these branches to interfere with each other. And of course, you can do this recursively. So you can branch even more from one branch. You can have multiple branches afterwards and so on and so forth. And another nice thing about this is that these different levels of abstraction that I've been talking about with these high level MemoS functions can coexist in the structure of your queries. So if you want to treat one of these higher level functions as a black box, and you can do this, but you can also have a different branch in which you kind of look inside what's going on in this function.  So this is the motivation for this. And finally, I'm just going to very quickly mention refactoring because I think we're nearly out of time here. So there's various ways to refactor things in this model of storage and one way is to just extend the functionality of a function. So before we have this function that creates our dataset that didn't take any arguments. And now if I want, I can just expose some parameter from inside this function as an argument. And I'm going to do this while keeping the relationship to whatever calls I had for this function before. So what this looks like on the level, like behind the scenes in the memorization table was going to be that I'm just adding retroactively this new column to my table. And all the things in this column are going to point to the default value that I've created for this argument. And this has a bunch of, you know, useful applications, especially in context like exploratory data science, where you always want to like tweak and add new behaviors to functions. And then the other thing you can, the other way in which you can refactor a thing is to create a completely new version of something. So you're going to forget about all the past calls to this function. And for example, as you can see here, we have this function called Inc, which actually decrements a number. So this illustrates one use case of this, which would be just to fix a bug in this function. So if you notice that one of your functions has a bug, and you just want to fix this bug, you can create a new version, then you can recompute everything that you've done. And it's going to, you know, recompute only the things that depend on this faulty function that you have. And in general, you can do other sorts of backward incompatible changes. Or if you want, you can also force reconputation of this function. All right, so this was just a bit of a refactoring, but I just want to say a few words about the vision for this whole thing. And where I hope to be able to take it is essentially to enable this metaphor with these programming patterns that I've been showing you of this infinite interactive session. Because if you think about it, in an infinite interactive session, you don't really have to save or load anything because it's all of it is in memory. So you don't have to even think, you know, how am I going to organize this? How am I going to save and load something? And what Mantua essentially enables you to kind of pretend is that you are working in this infinite interactive session. And what's more, it actually makes this sort of a metaphor practical by adding all these memorization features and queryability features to this so that you can address all the objects in this infinite interactive session by using directly the code that produces these objects. So this is, if it is like a one sentence metaphor for the whole motivation for this, it would be something like this. So yeah, so I think I'm pretty much done with the presentation part. So yeah, thank you very much. Thank you so much, Alex, for joining us today for the Collabs Research Seminar. For anyone who wants to follow along to make sure you catch these live, follow us at Proto Research on Twitter. And then you can also sign up for the monthly emails with the schedule to be sent directly to your email in the description below. So thanks again. Yeah, thanks everyone. Sounds great.


We have a great panel and a great discussion. The session is entitled Fast Forward Family. We're going to discuss the session title in a moment. I'm Mina Al Arabi. I'm a Young Global Leader and Yale World Fellow. I'm very pleased to be moderating the session. It is on the record and we're looking forward to participation of the audience. So please be prepared with your questions and comments. But first, I have the pleasure of introducing our panel. I'm going to start here from my right. We have Minister Shiozaki, who's Minister of Health, Labor and Welfare in Japan. And then we have Peter Matheson, who is President of the University of Hong Kong, but also the representative for the He-For-She UN campaign in Asia. We have Neelam Chibber from India. She is the Managing Director of Industry Mother Earth. She's also a Schwab Foundation Social Entrepreneur. And we have Kate Marie Sigfusson, who is the Founder and CEO of Babies for Babies. And she's also a Global Shaper. So thank you for joining us. We've entitled the session Fast Forward Family, but really what we want to talk about are all the different dynamics that you've been discussing over the last few days and probably in the last few months that we're seeing. From urbanization, to changing workplace practices, to aging societies that mean that caregivers are changing, there are shifts in our societies that are having immediate impacts on our lives, but also are going to impact our futures and the future of our children and the coming generations. So one of the things we have to think about is that by 2040, 55 countries are going to have to deal with aging societies in ways that we've never witnessed before. But at the same time, 28% of the people of the Middle East at the moment are between 15 and 29. So they're millennials who are coming into the workforce, who not only need jobs, but need better livelihoods. We have China that's just changed its one child policy. What impact does that have? And when we talk about a fourth industrial revolution and all the technological advances, the US still doesn't have maternity paid maternity leave. And what does that mean? So all of these issues to discuss, I'm going to start with you, Minister Shiozaki. There's different statistics, one of them says that 40% of Japan's population will be 65 years of age or older by 2060. So how do you prepare for that? Thank you very much for inviting me to attend this session. And as you introduced me, I'm Minister of Health, Labor and Welfare, and which probably has closest link to the topics that we are going to discuss. Actually, our Prime Minister Abe announced a so-called new set of three arrows. As top priority agenda in September last year. He used to have three years ago, three arrows, but first one was dynamic monetary policy and second was flexible fiscal policy. And third is a growth strategy. But now he has new set of three arrows. The first one is economic revival. So that's basically the same notion that he had in the first set of three arrows. But now he has two arrows. One is how we can take care of young couples raising kids or single mothers, well, whoever raising kids and how we can support those care. And second one is how we can go symbolically, he said, how can we stop people quitting jobs because of elderly care? And that really, well, the second and third new arrow showed how difficult and serious these problems are now. And of course, probably among us, maybe India and Japan are the most traditional countries with very old culture. But things are even in Japan changing a lot. For example, take, for example, about the aging as you correctly pointed out the possibility of having figure like 40% by 2060 over those over 65. Now we have 26%, 26% of population is over 65. And if you go to countryside, the figure might go all the way up to 40 or something like that. So there are many elderly people without youngsters because we have a strange, unique feature of demography within or geographic demography in Japan that people are flowing out to Tokyo. They used to flow out to Osaka or other big cities, but now only to Tokyo. But anyway, we realize that we have to socialize so-called elderly care in the 1990s, and we decided to introduce the elderly care public insurance scheme, which is close to the one they have in Germany. And we introduced in 2000. And now we have about 10 trillion yen size of spending a year, whereas we have 40, four times as many as elderly care for medical care. But the speed of increase is much faster in the case of elderly care. And the reason why Prime Minister symbolically said that we have to stop people quitting because of the elderly care. We socialized, we didn't have a so-called public insurance scheme for elderly care before 2000, but we decided to introduce it because wives, housewives used to be contained at home and taken care of the husband's parents or something like that with the word symbolically phrased elderly care hell or something like that. Well, we don't hear that phrase anymore, but still, first financially it's getting bigger and bigger and that means burden on the people is going to be going up. And but at the same time, we have to do something in order not to have the cases like people quitting because of the elderly care. And so what we immediately, we have to do is increase the housing facilities for facilities to have elderly care who need care. And also we have, more importantly, I guess, what we must do, I think this is the case, is the same for childcare too. We have to change the working behavior and also the institutionalize the system that could allow people to take care of elderly but at the same time working safely. And that means take official break for elderly care or childcare. And have the government support that? Or are you looking to the private sector to support that? The government, it's a public policy that could allow them to take recess for taking care of elderly or taking care of kids. And so I think people are more influenced by the way they work at home. And no, no, at the places where you work. And what we are now facing is the assignment that we have to change the employment policies and also the policies that are needed to allow people to work as safe as possible with childcare or elderly care. And now we have lots of double income families compared to in old days. That means we have more needs to have the correct policies to be applied to those who have elderly care, needs or childcare. I want to bring you in here because it's correct as Mr. Shiazaki said that there are traditional family structures in different parts of the world. And India is one of them, you grew up in a large family and the influence they had on their lives. So how do you balance that between wanting to increase, for example, female participation in the workforce and encouraging them, but at the same time having these constraints either taking care of the elderly or the young people? Is it something that you look to governments to support or the private sector can play a part in? The way it is in India, let's be frank, we have about 70% of our population in rural India, right? And I think the weight for government or private support because there's a huge amount of labor market in the unorganized sector in rural India. So it's critical that women work. That's what we see in the work we do. Rural women are very keen to work. They need access to the livelihood because their incomes give them a much better position at home. And there is more and more recognition within their larger families, within their mothers and their mother-in-laws. So let's be frank about it. Child support, elderly care support is coming from the extended family in rural India and to some extent even in urban India, yeah? So we have a policy with the private sector so we have to give three months of paid leave, maternity leave, yeah? I think paternity leave has also started. I think it's a month and they're trying to push it to a couple of months. But that's in the organized sector. That we have this huge unorganized sector. I think 90% of our workforce is in the unorganized sector. And there we see that it is the strength of the larger family. So when, as a topic we have today is fast-forward family, I would say there are huge strengths in the family structure and moving jobs to rural economies, like in India, move the jobs to rural India, stem migration, because the minute you have migration, then you break up the extended family. And then they are in the cities and then they need all these support structures which are going to take much longer to come in. So I think a good solution to this is create jobs in rural India, let the family stay together, and the elders look after the young, which is what has happened traditionally. And I just wanted to also bring in another topic in here about, I was just seeing the movie, the virtual reality film, Collisions, yeah? And so hundreds of years or hundreds of generations of knowledge was with the aborigines. So there's a lot of embedded knowledge that comes through close family structures, yeah? So in our strive towards modernities, like he's saying everybody's moving to Tokyo, but I think when you're looking at societies like India, whether if you move 70% of its population to its cities, you're going to see turbulence and you're going to see a whole lot of impact, even in terms of usage of traditional knowledge, greener economies, recycling, all sorts of knowledge that's passed on, you're going to start losing it. You're going to have a lot more problems, so. Well, Peter, that's also an issue in China at the moment and mass migration, around the world, you have 65 to 70 million people moving to cities annually and the trend is continuing to increase. So China, of course, there is the issue of migration, but it's also an issue for Europe in a different way because with your background in the UK, there's the issue of demographics that we need people to move and we need them to have an input not only in the workforce, but also in society and innovation. So how do you find the best ways to move on? So can I come back to China in a second?  One is aging and its consequences and the other one is family structures and maybe that can impinge on gender stereotypes and roles within the family and whatnot. So I was looking for the link between the two and I think the link between the two, as Minister Shizaki said, is actually probably about caring responsibilities. So there is this expectation that traditionally women care for the young and maybe increasingly as there are more and more elderly needing care, there could be a natural assumption that it will be the women that lead the care of the elderly and it's interesting what the minister was saying about the expectation being that the wife would look after the husband's parents as well as her own. And those are the kind of stereotypes which need to be changed, I think. And so to me, the link between the two topics of the afternoon is maybe about caring responsibilities and how they should be defined and how they should be shared out in a way that's not currently practiced in most societies. I didn't know that the United States doesn't have paid maternity leave so I've learned something today. The UK has just introduced what they call shared parental leave so where there's an allocation of leave to a pair of parents who may be the same sex or different sex or whatever, but there's an allocation of parental leave which can be split, however the couple wishes between the man and the woman or the two women or whatever it is. And I think that's actually rather imaginative. So I'm not here to speak in favor of the UK policy but I think that's quite a good idea. In relation to China, I mean many of the points that Nila made, I mean China is urbanizing at an enormous rate and so there is a drive for populations to move to cities and China obviously has huge rural areas. A lot of it is responsible for producing the food that the country needs. And so there needs to be automation of food production, otherwise there won't be enough food produced to feed all the people in the city. So that's one challenge to China. You mentioned the one child policy so one of the drivers to relaxing the one child policy was the recognition that there is an aging population and these aging people are gonna need someone to look after them and if each couple's only got one person and that one child is away somewhere else in the world making his or her way in the world then who's gonna look after the elderly. So that's been one of the drivers to the relaxation of the one child policy. If I made a contrast between Hong Kong where I live and work now and the UK where I lived and worked until two years ago. In the UK, the government has abolished retirement age and has lifted the pension age. So the pension age is getting higher. And you could say that represents a very emancipated policy by the UK. In reality, I don't think it does. I think in reality it's because the government couldn't afford the pension pot and wanted to encourage people to work longer in order to stave off the day when they need to take their pension. Hong Kong, which has the longest life expectancy in the world for men and the second longest for women or it could be the other way around, I can't remember, it's longest for one and second longest for the other has a mandatory retirement age of 60. And so people in Hong Kong spend a lot of their lives working for their old age and wanting to work beyond 60 because there's no state support for elderly care in the way that there is in the UK. So there's some very interesting similarities and some very interesting differences between the UK and Hong Kong. But ageing is a, I'm a medic as you know, so ageing is regarded as a success for my profession, but actually it creates all sorts of satirical problems. And my personal view is that the correct managing of ageing is actually nothing to do with medicine. It's actually much more about social science. And you're right. In the issue of social science, I'm going to turn to you, Kate Murray, on not only are you having to take care of aging populations in countries that have had successful health policies and therefore you have people living longer, but you're also still having to deal with the issue of the next generation coming in and how do you balance work and being a mother? And so you said to me, refer to yourself as a startup mom. So what does that mean? What does that mean at a time when we're expecting more flexible hours and women increasingly joining the workforce, but of course still having to deal with the gender gap in terms of pay. So while single mothers, for example, take on more work because they're having to financially, they're still being paid less than men. According to the World Economic Forum, the gender pay gap is not going to close for another 118 years. So this is a long-term policy that we have to talk about. Right. And I will say that actually a bigger indicator of inequality than gender in the US is actually motherhood. A woman in the US who's single and childless will earn 96 cents on the dollar a man makes and a mother will earn 76 cents. And we really need to look at these types of figures when we talk about women and work and caregiving.  I'm an entrepreneur and I'm a mother. And what that means for me being a startup mom or a startup dad is that you're uniquely positioned to reimagine and innovate the workplace because we need a lot of that. We talk about the fourth industrial revolution. I'm seeing a robot downstairs stand on one foot and then jump to the other. We're talking about nanotechnologies and self-driving cars and all this amazing progress we're making. And yet our traditional workplace has stuck decades or centuries in the past. So what we can do as entrepreneurs as startup moms and startup dads in being one key to achieving gender parity is to reimagine and reinvent the workplace. And I think that the corporate world has just as equal a hand in doing that. I just am speaking from my own personal advantage. And I think that we're talking so much about caregiving and that is the key, right? Because, and more so I think when we talk about caregiving we should talk about the value that we give caregivers because caregivers work is not factored into GDP dollars and just think of it were. Think of how many dollars that would be. And when we talk about women in the workplace and when women exit, women exit right before they reach senior management positions because it's the age at which they're becoming mothers. And I mean, this is such a wonderful conversation to have from different points of view because the real crux of it is that we don't value caregivers. Whether they are caregivers for aging populations for children and why is that? And I think that we really need to dig deep from a societal standpoint and consider why is a professional out earning in the workforce, wherever they are in the world valued more than somebody who is raising the next generation. And what are we doing here if not for the next generation? And so reimagining the workforce, giving caregivers the value that they deserve caring for our elderly, caring for our children, raising the next generations. It's a big conversation to have. I remain very, very hopeful. And to speak on behalf of American families, it is a travesty that we are one of the only countries in the world and the only developed country that does not have any paid parental leave. 25% of women in the US are back at work 10 days after giving birth, 10 days. And most of those women are in positions where they're on their feet. And this is barbaric. This is something that we need to, I mean, we are addressing in the US but it does go back to caregiving and I'd like to talk more about why we placed a little value on that because it is the most important role. Well, we're not now in both cases for children but also the elderly. So I guess we're looking for you of how you think you can have not only society but the economy and the market forces. Appreciate that those that need to take time out to care for families and those in society. There, we've, as always in good conversations at the World Economic Forum, there's so much to talk about and so little time. So I want to be fair and open up to the audience and then we can discuss some of these issues. So please raise your hand if you'd like to ask a question and we'll get a mic to you and if you'd like to introduce yourself. Okay, so I've got one person here and then one gentleman here and a lady here. So we'll go in that order. Toby Porter from Help Age International. Great to hear aging discussed. My experience in the World Economic Forum is that the development community and the humanitarian community spends too little time talking about demographic change and aging and it's very much portrayed here as a sort of rich world challenge and actually some of the fastest aging countries on Earth are in emerging countries. And I think the development world still very much organizes itself quite vertically on silos and the other aspect is how families are linked. So we surveyed families with elderly relatives in countries, in developing countries and the enormous proportion of those families suffer catastrophic health expenditure events often related to strokes, heart attacks, et cetera. And billions and billions of dollars invested in development health systems but still countries where so little on basic things like hypertension. The Minister of Health from South Africa is here at the meeting again this year. He has currently the highest rates of hypertension in over 50 segments has ever been recorded. And in rural areas people just don't get their blood pressure checked, there isn't even the most basic management of these things. It's all integrated and we need to be looking at whole life course, whole family approaches. So based on what you heard our panel speaking also on your wealth of knowledge and what you're referring to here what would you say is the number one factor that you could change in rural areas to help deal with aging or in developing countries with aging and managing aging, what can they learn? Well I think like a lot of the panelists I think care is a huge issue. So I think three areas, two we already know about so health as everybody talks that the changing demographic profile means that we need to get better at NCD and it's just, there's a target now in the sustainable development goal so it's there. It's not happening much. Social protection, pensions as well as payments for mothers, for children, et cetera. And I think the third area which is completely new is care. I think that it's a huge challenge all over the world that in developing countries it's not really even on the policy making table. 60% of global dementia caseload already is in in emerging countries. That's the huge issue. Can I just comment on that because Toby raises an interesting point about healthcare and particularly about hypertension. So I'm a kidney doctor so hypertension's right up my street. But there's an interesting paradox for the medical profession, every heart attack you prevent means that that person's gonna live longer and have different care needs later on. So it's actually very cost effective to let people die from their first heart attack. This is not the NHS approach. But actually that's not what doctors or indeed society want. We'd like to prevent the heart attack in the first place but we'd also like to manage it when it happens. And hypertension's a very good example. I mean hypertension in rural Africa which I know reasonably well kills people because they have a major stroke and the consequences of the stroke kill them. Now if you could intervene either to treat their blood pressure earlier you'd make the stroke less likely. You may not prevent it altogether but you may make it less severe or make it happen much later in their life. But also there's a huge issue around management of stroke.  But in societies without infrastructure it usually is. And they then become a dependent who needs somebody to care for them. And then that takes a woman out of the workforce in Africa it's usually a daughter rather than a partner. But so there is something very circular about preventive health. So when I say that elderly management of aging is not about healthcare I believe that because I think a lot of it's about social care. But there are aspects of healthcare that would alter the impact of aging and age-related diseases. Most non-communicable diseases have an element of age-related cancer. Heart disease stroke, they're all much more common in the elderly. Thank you. Thank you, Madam Moderator. Let me just raise one aspect that will even make elderly care situation worth. That is the increasing numbers of older people who have a problem with cognitive ability. Many of them will be developing a dementia eventually. Many of us? Well, yes. It's true, we all have a stake in it. As you can imagine, it will increase the demand for the care services. But we already have a shortage of care workers. And we know that the overall labor supply will be declining in the future, like country like Japan. So if you cannot have a adequate amount of care services as Minister Shiozaki said, you have to quit your job to take care of your parents. And that will even accelerate the declining trend of labor supply. In fact, last year, some of our colleagues calculated the total social cost of cost relating to the increasing number of people with cognitive decline is as much as 14 trillion a year.  So my point is to promote the care services for older people is urgent, not only for helping these people, but also for economic growth. And invest in, it's not yet possible, but invest in prevention of dementia of our cognitive decline problem will produce enormous returns in economy. So I think people have to recognize the expenditures on elderly care or expenditures on the prevention of dementia will be a big investment. Mr. Shiozaki, at a time when we see, of course, concerns about the economy and growth and so forth while there are these demands, so investments, for example, in health, how do you balance it, especially at the time when there is such economic pressures? As I said, the cost is rapidly growing. And I think we didn't really expect that speed to be realized in the case of elderly care. And of course, medical care also faces increasing cost too, but I think elderly care costs is a much fast growing area. And I think in 2000, as I said, by introducing public insurance scheme, that means those care will be calculated in GDP. That means it could be a positive factor for economic growth, but that comes with a burden too on the side of general public. And now we are thinking of decreasing how we can decrease this cost or stop growing that fast. So preventive measures? First is, of course, preventive measures and also in the case of cognitive decline or dementia. I think R&D for the pharmaceutical development must be made to detect as early as possible and also to stop dementia to get worse. But I think what is needed in the real cases of elderly care, for example, in the facilities for elderly people, I think what is needed is productivity revolution. We just watched the robot that would be used in the elderly care too. And now we are encouraging any element that could enhance productivity growth through IT or robotics and all that. And that would stop the demand for elderly care people. But at the same time, more practical way of handling this, we are now trying to invite foreign labor forces as trainee status for elderly care. Because I think in Asia, Japan is the fastest aging country that have a long experience of taking care of elderly people. And Asian countries would face the same problem in some time. And even in China, I guess, population itself is going to decline in 20 years. And that means, and also in 30, 40 years time, the percentage of elderly people in the population that would be in the same as ours. So I think immediate response is to how can we increase the people working for elderly care domestically by paying more, but in cost. And that goes down to the burden of the general public through taxation and also insurance contribution. So then we are thinking of asking foreign labor forces to be in our market too, but at the same time, I think we might have to think about how much we will cover in the public insurance scheme. There was a question here, and this lady there, so we'll start here at the front. Hello, my name is Aditi and I'm a global shaper from the Amdabad Hub. My question is rooting from the concern of my fellow global shaper, Kate, when we lose so much of women force when they start their families. So my question is, why can't we look at, families are restructuring themselves, even in the developing nations. We are moving from a joint family to nuclear families and becoming more and more lonelier in our homes. So why can't we create a space or family inside in the workforce itself? My question to you is with the policy makers and also people who run the startup to restructure, is there a way we can restructure our work area or work environment where we provide that kind of family space to the women? For example, a care center or a place where they can feed their babies, a place where their babies can play. And could it be more like a policy where all the startups we started doing in our companies where we see, we face it firsthand and also from the government of how can it be more like a policy where all the offices should have, like we have pool tables and swimming pools and health center in all the offices but there is absolutely no crash or a place for to keep our child when we are working in the offices. So that's my question. The question, Milano, come to you. What do you do as an industry mother? To answer that, I mean in Indian manufacturing, it's a must to have a crash. So that's a global SOP. But I don't think it's a must in corporate offices. But it's a must in manufacturing. So that is, it's a no-brainer. It has to be done. But coming to the aging population bit, so I have a fellow Shobhi who was telling me yesterday who's got an aging mother. I've got, I have an 84-year-old mother and a 94-year-old mother-in-law who lives with me. And she said, why can't we have a crash for these people in office? I mean, not crash. I mean, you'd have to have another word for it. But honestly, I really believe, I mean, that it's assumed that we are going to look after our young. It's a travesty, I feel, that it's not assumed that we're going to look after our old. I just, because my son is just married in American. And, no, no, I'm not, my son is married in American My son is married in American and my daughter-in-law's grandmom came for the wedding and I could see the sorrow in her eyes because our moms are living with us. And she said, she said, I was taken to see a home. She lives alone. But how much longer is she going to live alone? And she's got a loving family. I mean, this is going to be broadcast. So they're all going to be seeing this. But I mean, it's an awesome family. It's a beautiful family. But it's just not assumed. And I just feel that we look after our kids. So I mean, looking after our old is just the same thing. How can it not be? Okay, Ray, do you see changes in American corporations or startups where we see, you're right. We hear about companies that have great places to work and then cafeterias and pool tables. Do you see that? So currently there is a race at the top to provide parental leave and accommodations and the workforce to be inclusive of family. And that's wonderful. That's at the very top. That's for the very few who are lucky enough to have those jobs. And I think it can be a great example. But the reality is we do need childcare in the workplace, in the corporate workplace. There is a whole sector of women in the US, professional women, who are being forced out of the workforce because they cannot out-earn the salary of the cost of a caregiver. Rather, their salary cannot earn the cost of caregiving. We have no universal childcare before the age of kindergarten in the US. With ages zero to five being the most important years of a human's life for development, we have no mandated care for them. So women, when we talk about, and I've heard a lot of conversations this week at Davos, about keeping women on a career track, keeping women in that funnel to get in those upward trajectories. And there's all the data that show that women are opting out right, as I said earlier, right before they're reaching these senior management positions. And that is because, disproportionately, the burden, and it is a beautiful thing. I'm a mother, so by burden, I don't mean that it's to be pejorative, but the burden of motherhood, because the woman biologically bursts the child, falls disproportionately on the woman, and caregiving, often, of elderly or children, falls disproportionately on the woman. So if we're talking about keeping women in the workplace, we need to be real, and we need to talk tangibly about the things across industries, across ranks in industries, what things we can do to help women who are pregnant, postpartum, nursing, and just new parents in the trenches. And let me say we cannot leave new fathers out of this equation. We need to do tangible things to help them stay in the workforce, because right now we're telling women, lean in, lean in, lean in, and we are, but we need something to lean on. And so to answer your question, yes, we can reimagine the workplace. It's absolutely possible to have on-site childcare, to have mother's rooms, to talk about breastfeeding in the workplace and what that looks like, because I cannot tell you how many women in my community, and I represent a large community of working mothers, and they're all asking me to ask questions of you all on my social media channels for what you can do to bring them these things, like on-site childcare and mother's rooms and paid parental leave, and then making a shift from a societal place, both at home and in the workplace, where we are not only giving fathers paid leave, but we're asking them to take it. We are being inclusive of young men in the conversation, and I could go on, but to answer your question, yes, we can redesign the workplace. Peter, isn't that part of what he for she really stands for? So you mentioned he for she, which is a UN women initiative to promote gender equity in the world, but focused on three sets of impact champions, university presidents of which I'm one, CEOs of global corporations who met in Davos this week, and then heads of state, and so it's an initiative not without its controversies, and I don't particularly want to get involved in its controversies, but the principle of promoting gender equity is something that I certainly subscribe to. The meeting that took place in Davos this week was focused on the corporate sector, and I was really struck by how the issues, the numbers, the initiatives that have been tried, and in some cases failed, and some of the things which have worked are very similar in the corporate sector than they are in the university sector. So in summer Davos, in Dalian last year, I was on a panel on gender equity, and I was the only university representative, and I was really struck by the fact that everybody else thought I was going to bring the answers. Everyone sort of said, oh yeah, we've got problems on gender equity. Who's the guy from the university? Tell us what the answers are, and I said to them, no, look, I'm here to learn not to teach, you know. I mean, I actually, I need to learn from you as well, because in the university sector, there is not gender equity. I mean, I worked in the UK in a medical school, because that's my background, and there is not gender equity in medical schools. The medical student populations have been female predominant for 25 years in the UK, and yet 25 years later, there's still not anything close to equal female representation at senior levels, and so I just do not buy the idea that it's a matter of time and that these women will eventually come through. There is something systematic which stops it. Clearly, caring responsibilities are part of that. It is partly about maternity leave and places to breastfeed and places to look after small children. It's also about re-entry into careers, and it's about tolerance of a woman taking longer to achieve the same progression that a man would take if she has other responsibilities, and universities can calibrate for that, and actually universities' medical schools in the UK now do that much more effectively than they did for one single reason, which is that there's a woman called Dame Sally Davis, who is a major controller of research funding in the UK, and she just overnight said, you're not getting any research funding from my agency unless you have decent equal opportunity policies in your medical school. And so every medical school in England, because it's devolved, so it's England rather than the UK, every medical school had to look through its equal opportunities policies, and that single intervention made a huge difference. And then the last thing I just wanted to say about Hifushi, I came from that session, and I was walking through the forum here, and I met a friend of mine from the University of Chicago, Ian Solomon, so if Ian's watching, I'm crediting him with this idea, not claiming it as my own, but I said to him, the thing that was a bit disappointing about this session that I went to was I didn't hear one really big bang idea about how to really make a difference. So Ian said, I'll give you one. He said, the World Economic Forum should become more family friendly. We should have crushed facilities. We should have more opportunities for women here, less than 18% of the delegates of the World Economic Forum are female. However, for the young global leaders and the global shapers, it's 52 because the World Economic Forum controls it more. It's more about the corporate sector who's coming and how they choose to go. I agree, and that's absolutely right, and I've heard this statistic quoted a lot, and it's not a criticism of the World Economic Forum, because as you say, the World Economic Forum doesn't, in general, decide who comes. The corporates decide who comes, but it is a sign of another sector where something big could be done to make a really important statement. If you made the World Economic Forum family friendly and child friendly, maybe that would send a message to some of these corporates that need to... And it's true also for governments. I mean, everybody this week was excited about having the Canadian Prime Minister here, Justin Trudeau and everyone's hailing the fact that we have gender parity in the Canadian government, but so many people are saying, well, shouldn't this have happened anyway? And it was his famous quote about it's 2015, last year of why there was gender parity. So I want to ask you, when you raised the issue about, there can be a single policy that would have incredible impact, whether it's about the medical schools in England or here in the World Economic Forum, what we can do to actually change. So I want to ask you, womenomics came out of Japan and what they tried to do there. So I want to ask you about specific policies that you fail, make a difference that can push this agenda forward? Well, I think Japan has been notorious regarding the gender equality, I guess. But our Prime Minister is very keen on this and I think female policy is one of the top priority policies of the present administration. And actually last year, we passed a bill that would facilitate the female to work more freely and giving obligation to large companies over employees of over 300 to have numerical targets to regarding female participation in the workplace. And also we are now introducing a new policy to encourage companies to have nursing facilities in their offices or plans or whatever. And so these policies are going to be the positive move to let female participation in the work and also at the same time to work with babies or childcare. And we also are trying to let part-time job female, mainly female, to have maternity leave because it's been very limited in the case of part-time female workers to have maternity leave. But at the same time, there is a rather different type of policy that we're going to introduce to encourage female to work and childcare to be handled easily. That is something to do with the old traditional culture of living within big families. We are now trying to introduce a taxation tax-preferential treatment of living three generations together in one house. And so if you, yeah. And for example, I happen to be my typical case living with, I used to live with my wife's parents. So my, of course, my wife works in a university. And so probably my wife would assert that I took care of all the children's problems. But I think living in, with three generations, that really helped my wife work safer, I guess, with two kids raising. Yeah, traditionally. So it's going to be a public policy to encourage three generations living together in one house or close by. Yeah, that's a very good one. Okay, so we have three questions and little time. So I'm going to take the questions together and then we'll address them. So if we can start with the lady here who's been waiting patiently. And then we'll come to questions here. Appreciate that you just brought up part-time work. And I think workplace flexibility is a big topic in terms of tangential actions that can happen to make an impact both on childcare and on caretaking as well as a wide other range of social issues. I'd be curious, especially from a federal level, I'm familiar with the United States regulations in this, but from the federal level in other countries, if there's any support for telecommuting and remote work, as well as flexible schedules. Okay, thank you. Okay, so telecommuting and flexible schedules. And then. Thank you.  If we can stipulate that families and the creation of families are an avenue to stability in a country. Okay, then I'd like to bring in rather sort of segment issue, which is the unnatural selection of girls and boys. This is particularly hit hard, obviously, in India and in China, but there's a book called Unnatural Selection, and it actually shows that there are a number of countries. We have substantial disproportion of boys being born instead of girls. So you have a large cohorts of young men, right, who will statistically, virtually have no capacity to enter into a family relationship. We even might see that over 70% of the refugees coming into Europe are unattached young men. So then the question is, how are we going to redefine family or rethink this if you have large cohorts of people who will not have access to family structure? Okay, thank you. Important points raised. Yes, definitely worth taking into. We'll take a final question and then come back to these issues. Please come ahead. My name's Mandi Parai, and for the purposes of this conversation, I'm a mumpreneur, although one of you ever heard of a dadpreneur, so it's a rather sexist term. My point is that we don't have to reinvent the wheel. There are plenty of countries that are actually looking at childcare in a very progressive manner. For example, Scandinavia, the Scandinavian countries, where they don't look at part-time work because often women lose out when they're doing part-time work. They look at flexiwork, both for men and women, and have done this very well for many years. And so my question would be, here we are talking about the Industrial Revolution, where more and more we're concerned about jobs and the lack of jobs. So for example, with looking at automated cars and how less truck drivers will be needed, well then why don't we think about less time at work for everyone rather than the few at the top becoming more and more stressed and us having to look at neuroscience and thinking about sleep and how are we going to fit in sleep as we all become more and more competitive at the top whilst losing jobs at the bottom. Why don't we all just think about taking a few more hours off and therefore instead of having to make it crushes at work as trying to fit in everything, we can actually look after our children and our elderly at home and all of us look after our children and our elderly. There we go, a health and labour policy rolled into one. Okay, so we've got some interesting questions. So I want to ask who'd like to tackle the flexiwork slash part-time work and not disadvantaged women by just saying, okay, well, you can go into part-time and then necessarily getting the rights that they deserve. Neela. So on flexiwork, all I can say is that yes, in the unorganized sector that we have in India, in rural India, there is an option that women work part-time. So they can work four hours a day, but we've got to stick to global standards so that wage rate should be fit for those four hours. And it's a great option. It's a fantastic option and we explore it all the time. And I think it's great. I think it should just, I mean, it's a no-brainer. But Kate Marie, is there that possibility when you're in a start-up and you're trying to cram in as many hours as you can to get something off the ground to make that happen?  What we are, like I said, uniquely positioned to reimagine the workplace. And so while my life is not glamorous or easy, I equally value my family and my work and I just make that look like it works for me. On a daily basis, and that's constantly evolving. So I think that flex work is a little bit different for entrepreneurs because you don't stop working. I'm on all the time, but I do it in a way that works for me and that is what a start-up mom or a start-up dad is. I really like the comment about essentially working smarter and not necessarily just putting in the face time. I think that's something that we can really hope to do in this fourth industrial revolution is work smarter and really value our home life more. And I think that the sharing economy provides a lot of opportunity for that and it will remain to be seen whether that works out for better or worse. But for example, I know I don't have the statistic on it, but a vast number of mothers are becoming Uber drivers because it allows them to set their own schedule and work and then be with the family and then work again and be with the family again. So I think really my point is that we can reimagine work and we don't need to go into an office from nine to five and just put in those hours sitting at a desk. We can start, stop, start, stop, start, stop in order to give equal value to our work and our personal lives. And I think speaking from a millennial point of view, our generation really values this. Whether we're parents or not, whether we're caregivers or not, we really, and men and women across the board, value this idea of not just working to live but really doing both in a way that means something to us. So I have great hope for the future. Well, with hope for the future, there is also the issue about redefining families and really a valid and important point that raised that probably requires a session on its own about how we see the impact of unnatural selection and increasing young men rising up in different ways in life but not having the family support that they would necessarily need. How do you tackle that? No, I mean, that's a huge topic and it's a huge topic in China as the questioner raised. Just think, if I could just go back to workforces. I mean, for me, there's a couple of issues about workforces. One is hiring into the workforce in the first place and the second one is retention in the workforce. And there's no, in general, there's much less of a problem with hiring of women into the workforce. It's keeping them. But even in hiring, so in the university world, one of the other university partners in the He For She initiative is Nagoya University in Japan. And I was talking to my counterpart in Nagoya and in Hong Kong, I'm impatient to make change quickly but it's illegal for me to hire somebody preferentially on the basis of gender. So I can't go and try and fill a post with a woman in order to make the gender balance better because that's illegal under equal opportunities law. In Nagoya University, they've got in engineering which is a subject where women are traditionally even more underrepresented than they are in most other disciplines. It's legal in Japan to have women-only faculty positions and Nagoya University is hiring some women in engineering because it's designated as a priority area with a great underrepresentation of one group. And so that kind of legislation I think is very helpful and Japan is doing that, Hong Kong is not. On unnatural selection, well, I mean, I think the idea that some people won't ever have access to a family structure is one of the great saddenances of the modern world, I think. You know, and the disruption of the family structure with urbanization or with everybody being so obsessed with working so many hours and I'm no one to preach on this subject. I think that's one of the great saddenances and I think if the world can work to preserve family structures, whether it's by looking at the workplace or by looking at flexi-working or by looking at equal opportunities policies in more general, then I think the world would be a better place. And I think that is a major challenge. My last word would just be about, so it comes back to a little bit about respect for caregiving roles. My worry about the corporate world's approach to flexible working or to all these other policies is that somehow it's a bit apologetic. It's sort of trying to make life a bit easier for women because we think that's a good thing to do. It's not about getting the best out of the human race and making sure that we have access to 100% of the human race, not just 50% of it. And so it's got to be respectable for men to take time off to look after children. It's got to be respectable for men to have flexible working, not only for women, otherwise it'll make the situation worse, potentially not better. Okay, so we are out of time, but I'm going to ask your permission to extend just for five minutes because we actually have Anne-Marie Slaughter here and we wanted to ask her her take on it because of course she wrote that all important article on having it all or not. And really we don't want to expand the conversation even further, but it is about that, about how we make the choices that we do, how companies and governments make choices, but we as individuals. So I just wanted to take a word from you and then we'll wrap up the session. Oh, thank you. So I'm actually just going to emphasize what we heard here just at the end because I spent three years after that article rethinking what really needs to happen and concluded that the two single most important things we can do to get to real equality between men and women are to value care and to value care for everyone, to value care as the work of investing in the next generation, which is from a policy point of view, the single most important thing any nation can do. We're here at Davos talking about global competitiveness.  There's no greater way of combating inequality. There's no greater way of making a nation competitive, secure, et cetera. So care from that point of view is absolutely essential. And of course, at the other end of life it is the moral obligation to those who cared for us. So value in care and then second, value in care as men do it as well as women, there is no way to change women's roles without changing men's roles equally. And there is no way as exactly as you said they're startup moms and startup dads, they're working fathers as well as working mothers as long as this is a women's issue, it will never be resolved. It has to be a human issue. We have to recognize all human beings are likely to be caregivers at some point in their lives, whether that's children or parents or friends or community members, it's not about being married or any particular concept of family and workplaces have to make room for that care and value it both because it's important for us as a race, but it's actually hugely important for us as individuals and makes us better at everything we do. So this kind of global perspective where we think about it in terms of reinventing how we work as part of, I love that idea that that's part of the fourth industrial revolution. We just don't just revolutionize what we produce but how and where we produce it and thinking absolutely that this is for men every bit as much as for women. Excellent, okay so as we wrap up I want in 30 seconds for you to tell me one trend that you're excited about because we've thrown up some of the problems and some potential solutions but one trend that you're excited about that actually is taking us forward in that direction so Kate Murray, I'll start with you. I have to say young men. I think the generation of young men rising into influential positions in their careers and into fatherhood have a huge capacity for empathy. They want this work-life integration. They want to be caregivers and I think that we need to make sure we are always inclusive of them in this conversation. Excellent, thank you. I'm sorry, I have to say what I heard from Professor Kloshoff this morning that in the next, I don't know how many years, 10 years or something, the way we evaluate growth is what is going to determine the importance given to things like care. Like is it going to be, are we going to evaluate on GDPs? So I mean if he's saying that it's got to change let's hope in the next 10 years it starts changing because then that's one way of evaluating your growth. The thing I've heard this week which I think made me feel, I always try and find silver linings, I always try and turn every negative into a positive and the thing that I, it's a slightly cynical comment but the corporate world in the discussions I've heard has woken up to the idea that actually diversity improves performance and that's diversity not only in gender but also in race and background and everything else and to my mind that's likely to make progress much more quickly than anyone doing it because they think it's a good thing. If they do it because it'll make their businesses more successful then it's more likely to happen and that makes me optimistic about change. I think a conservative country like Japan what is the center core problem is one companies, two men. I think we have to, as she talked about it, we have to really try to change the mindset but can we do it through public policy or what? And I think we have to, as a public policymaker, I have to think about something that could change the atmosphere of workplace and mindset of mail. Well I'll just leave you with this one thought I come from the Middle East and there unfortunately young people are seen as a problem, a challenge we're gonna do with all these young people we have and here we are where the world is worrying about aging, well we've got the young people hopefully they will be welcomed with open arms and hopefully our countries will start to do better in keeping young people but also improving the state of the world with you all. Thank you, I'd like to thank our panel thank you for joining us. Thank you.