Andrew Ng: Deep Learning, Education, and Real-World AI | Lex Fridman Podcast #73

Andrew Ng discusses his path from coding at age five to founding Coursera, which reached 100,000 sign-ups in its first courses. He explains why unsupervised learning was oversold while scale proved crucial, and describes the unglamorous reality of industrial ML: most work is data labeling and handling small datasets.
Chapters
The following is a conversation with Andrew Eng, one of the most impactful educators, researchers, innovators and leaders in artificial intelligence and technology space in general. He co founded Coursera and Google Brain, launched Deep Learning AI, Lending AI and the AI Fund, and was the Chief Scientist at Baidu. As a Stanford professor and with Coursera and Deep Learning AI, he has helped educate and inspire millions of students, including me. This is the Artificial Intelligence Podcast. If you enjoy it, subscribe on YouTube, give it five stars on Apple, podcast support on Patreon, or simply connect with me on Twitter lexfriedman spelled F R I D M A N. As usual, I'll do one or two minutes of ads now and never any ads in the middle that can break the flow of the conversation. I hope that works for you and doesn't hurt the listening experience. This show is presented by Cash app, the 1 finance app in the App Store. When you get it, use code lexpodcast Cash App lets you send money to friends, buy bitcoin and invest in the stock market with as little as $1. Brokerage services are provided by Cash App Investing, a subsidiary F Square, a member sipc. Since Cash App allows you to buy Bitcoin, let me mention that cryptocurrency in the context of the history of money is fascinating. I recommend Ascent of Money as a great book on this history. Debits and credits on ledgers started over 30,000 years ago. The US dollar was created over 200 years ago, and bitcoin, the first decentralized cryptocurrency, released just over 10 years ago. So given that history, cryptocurrency is still very much in its early days of development, but is still aiming to and just might redefine the nature of money. So again, if you get Cash App from the App Store or Google Play and use the code lexpodcast, you'll get $10 and cash app will also donate $10 to first, one of my favorite organizations that is helping to advance remotely robotics and STEM education for young people around the world. And now here's my conversation with Andrew Ng.
The courses you taught on machine learning at Stanford and later on Coursera that you co founded have educated and inspired millions of people. So let me ask you what people or ideas inspired you to get into computer science and machine learning when you were young? When did you first fall in love with the field is another way to put it.
Growing up in Hong Kong and Singapore, I started learning to code when I was 5 or 6 years old. @ that time I was learning the basic programming Language. And they would take these books and they'll tell you type this program into your computer. So type DAC program to my computer. And as a result of all that typing, I would get to play these very simple shoot them up games that I had implemented on my little computer. So I thought it was fascinating as a young kid that I could write this code. I was really just copying code from a book into my computer to then play these cool little video games. Another moment for me was when I was a teenager and my father, who's a doctor, was reading about expert systems and about neural networks. So he got me to read some of these books and I thought it was really cool you could write a computer that started to exhibit intelligence. Then I remember doing an internship while I was in high school. This was in Singapore, where I remember doing a lot of photocopying and I was office assistant. And the highlight of my job was when I got to use this shredder. So the teenager me remember thinking, boy, this is a lot of photocopying. If only we could write software, build a robot or something to automate this, maybe I could do something else. So I think a lot of my work since then has centered on the theme of automation. Even the way I think about machine learning today we're very good at writing, learning algorithms that can automate things that people can do, or even launching the first MOOCs mass open online courses that later led to Coursera. I was trying to automate what could be automatable in how I was teaching on.
Campus. Process of education, tried to automate parts of that to make it more sort of to have more impact from a single teacher. Single.
Educator. Yeah. I felt teaching at Stanford, I was teaching machine Learning to about 400 students a year at the time. And I found myself filming the exact same video every year, telling the same jokes in the same room. And I thought, why am I doing this? Why don't we just take last year's video and then I can spend my time building a deeper relationship with students. So that process of thinking through how to do that, that led to the first MOOCs that we.
Launched. And then you have more time to write new jokes. Are there favorite memories from your early days at Stanford? Teaching thousands of people in person and then millions of people online, you know, teaching.
Online. What not many people know was that a lot of those videos were shot between the hours of 10pm and 3am, a lot of times launching the first movie house advert. We already announced the course about 100,000 people had signed up, we just started to write the code, and we had not yet actually filmed the video. So a lot of pressure, 100,000 people waiting for us to produce the content. Many Fridays, Saturdays, I would go out, have dinner with my friends, and then I would think, okay, do you want to go home now, or do you want to go to the office to film videos? And the thought of being able to help 100,000 people potentially learn machine learning, fortunately, that made me think, okay, I want to go to my office, go to my tiny little recording studio. I would adjust my Logitech webcam, adjust my Wacom tablet, make sure my lapel mic was on, and then it would start recording, often until 2am or 3am I think. Unfortunate that it doesn't show that it was recorded that late at night, but it was really inspiring, the thought that we could create content to help so many people learn about machine.
Learning. How did that feel? The fact that you're probably somewhat alone, maybe a couple of friends recording with a Logitech webcam and kind of going home alone at 1 or 2am at night and knowing that that's going to reach sort of thousands of people, eventually millions of people. What's that feeling like? I mean, is there a feeling of just satisfaction, of pushing.
Through? I think it's humbling. And I wasn't thinking about what I was feeling. I think one thing I'm proud to say we got right from the early days was I told my whole team back then that the number one priority is to do what's best for Lear, do what's best for students. And so when I went to the recording studio, the only thing on my mind was, what can I say? How can I design my slides? What I need to draw right to make these concepts as clear as possible for learners? I think I've seen sometimes instructors, it's tempting to, hey, let's talk about my work. Maybe if I teach you about my research, someone will cite my papers a couple more times. And I think one of the things we got right, launched the first few MOOCs and later building Coursera, was putting in place that bedrock principle of let's just do what's best for learners and forget about everything else. And I think that as a guiding principle, turned out to be really important to the rise of the.
Movement. And the kind of learner you imagined in your mind is as broad as possible, as global as possible. So really try to reach as many people interested in machine learning and AI as.
Possible. I really want to help anyone that had an interest in machine learning to break into the field. And I think sometimes I've actually had people ask me hey, why are you spending so much time explaining gradient descent? And my answer was if I look at what I think the learner needs and would benefit from, I felt that having a good understanding of the foundations, kind of back to the basics, would put them in a better stead to then build on a long term career. So try to consistently make decisions on that.
Principle. So one of the things you actually revealed to the narrow AI community at the time and to the world is that the amount of people who are actually interested in AI is much larger than we imagined. By you teaching the class and how popular it became, it showed that, wow, this isn't just a small community of sort of people who go to Europes and it's much bigger, it's developers, it's people from all over the world. I mean I'm Russian so there's everybody in Russia, Russia is really interested. There's a huge number of programmers who are interested in machine learning. India, China, South America, everywhere. There's just millions of people who are interested in machine learning. So how big do you get a sense that the number of people is that are interested from your.
Perspective? I think the number's grown over time. I think it's one of those things that maybe it feels like it came out of nowhere but as an insider building it, it took years. It's one of those overnight successes that took years to get there. My first foray into this type of online education was when we were filming my Stanford class and sticking the videos on YouTube and some other things. We had uploaded the whole orgs and so on, but basically the 1 hour 15 minute video that we put on YouTube and then we had four or five other versions of websites that I had built, most of which you would never have heard of because they reached small audiences. But that allowed me to iterate, allow my team and me to iterate to learn what are the ideas that work and what doesn't. For example, one of the features I was really excited about and really proud of was build this website where multiple people could be logged into the website at the same time. So today if you go to a website, if you are logged in and then I want to log in, you need to log out if it's the same browser, same computer. But I thought, well, what if two people say you and me were watching a video together in front of a computer. What if a website could have you type your name and password have me type my name and password and then now the computer knows both of us are watching together and it gives both of us credit for anything we do as a group. Inference's feature rolled it out in a school in San Francisco. We had about 20 something users. Where's the teacher there? Sacred Heart Co Teacher Prep. The teacher was great. And guess what? 0 people use this feature. It turns out people studying online, they want to watch the videos by themselves. You can play back, pause at your own speed rather than in groups. So that was one example of a tiny lesson learned out of many that allows us to hone in to the set of.
Features. And it sounds like a brilliant feature. So I guess the lesson to take from that is there's something that looks amazing on paper and then nobody uses it, doesn't actually have the impact that you think it might have. And so yeah, I saw that you really went through a lot of different features and a lot of ideas. And to arrive at the final, at Coursera, at the final kind of powerful thing that showed the world that MOOCs can educate.
Millions. And I think with the whole machine learning movement as well, I think it didn't come out of nowhere. Instead what happened was as more people learned about machine learning, they will tell their friends and their friends will see how it's applicable to their work. And then the community kept on growing and I think we're still growing. I don't know in the future what percentage of all developers will be AI developers. I could easily see it being normal for 50% because so many AI developers, broadly construed, not just people doing the machine learning modeling, but the people building infrastructure data pipelines, all the software surrounding the core machine learning model maybe is even bigger. I feel like today almost every software engineer has some understanding of the cloud. Not all, but maybe this microcontroller developer doesn't need to deal with the cloud. But I feel like the vast majority of software engineers today are sort of have an appreciation of cloud. I think in the future maybe we'll approach nearly 100% of our developers being in some way an AI developer or at least having an appreciation of machine.
Learning. And my hope is that there's this kind of effect, that there's people who are not really interested in being a programmer or being into software engineering, like biologists, chemists and physicists, even mechanical engineers. All these disciplines that are now more and more sitting on large data sets. And here they didn't think they're interested in programming until they have this data set and they Realize there's these set of machine learning tools that allow you to use the data set. So they actually become, they learn to program and they become new programmers. So like the. Not just because you've mentioned a larger percentage of developers become machine learning people. The. It seems like more and more the, the kinds of people who are becoming developers is also growing.
Significantly. Yeah, I think, I think once upon time only a small part of humanity was literate, could read and write. And maybe you thought maybe not everyone needs to learn to read and write. Just go listen to a few monks read to you and maybe that was enough. Or maybe we just need a few handful of authors to write the bestsellers and then no one else needs to write. But what we found was that by giving as many people in some countries, almost everyone, basic literacy, it dramatically enhanced human to human communications and we can now write for an audience of one, such as if I send you an email or you send me an email. I think in computing we're still in that phase where so few people know how to code that the coders mostly have to code for relatively large audiences. But if everyone or most people became developers at some level, similar to how most people in developed economies are somewhat literate, I would love to see the owners of a mom and pop store be able to write a little bit of code to customize the TV display for their special this week. And I think it will enhance human to computer communications, which is becoming more and more important in today's.
World. So you think it's possible that machine learning becomes kind of similar to literacy where like you said, the owners of a mom and pop shop is basically everybody in all walks of life would have some degree of programming.
Capability. I could see society getting there. There's one other interesting thing. If I go talk to the mom and pop store, if I talk to a lot of people in their daily professions, I previously didn't have a good story for why they should learn to code. We could give them some reasons. But what I found with the rise of machine learning and data science is that I think the number of people with a concrete use for data science in their daily lives, in their jobs, may be even larger than the number of people with a concrete use for software engineering, for example. Actually if you run small mom and pop's law, I think if you can analyze the data about your sales, your customers, I think there's actually real value there, maybe even more than traditional software engineering. So I find that for a lot of my friends in various professions, be it recruiters or accountants or people that work in factories, which I deal with more and more these days. I feel if they were data scientists at some level, they could immediately use that in their work. So I think that data science and machine learning may be an even easier entree into the developer world for a lot of people than the software.
Engineering. That's interesting and I agree with that. But that's beautifully put. We live in a world where most courses and Talks have slides, PowerPoint, Keynote, and yet you famously often still use a marker and a whiteboard. The simplicity of that is compelling and for me at least, fun to.
Watch. Thank.
You. So let me ask, why do you like using a marker and whiteboard even on the biggest of.
Stages? I think it depends on the concepts you want to explain. For mathematical concepts, it's nice. You can build up the equation one piece at a time. And the whiteboard marker or the appendix stylist is a very easy way to build up an equation, a build up a complex concept one piece at a time, why you're talking about it. And sometimes that enhances understandability. The downside of writing is that it's slow. And so if you want a long sentence, it's very hard to write that. So I think there are pros and cons. And sometimes I use slides and sometimes I use a whiteboard or a.
Stylus. The slowness of a whiteboard is also its upside because it forces you to reduce everything to the basics. Some of your talks involve the whiteboard. I mean, there's really not. You go very slowly and you really focus on the most simple principles. And that's a beautiful. That enforces a kind of a minimalism of ideas that I think is surprising, at least for me, is great for education. Like a great talk, I think is not one that has a lot of content. A great talk is one that just clearly says a few simple ideas. And I think you. The whiteboard somehow enforces that. Peter Abil, who is now one of the top roboticists and reinforcement learning experts in the world, was your first PhD student. So I bring him up just because I kind of imagine this must have been an interesting time in your life. Do you have any favorite memories of working with Peter, your first student in those uncertain times, especially before deep learning really sort of blew up. Any favorite memories from those.
Times? Yeah, I was really fortunate to have had Peter Bu as my first PhD student. And I think even my long term professional success builds on early foundations or early work that Peter was so critical to. So I was really grateful to him for working with me. What not a lot of people know is just how hard research was and still is. Peter's PhD thesis was using reinforcement learning to fly helicopters. And so actually, even today, the website Heli Stanford. Edu H E L I Stanford. Edu is still up. You can watch videos of us using reinforcement learning to make a helicopter fly upside down, Fly loops, rows. So it's.
Cool. It's one of the most incredible robotics videos ever, so people should watch.
It. Oh, yeah. Thank.
You. Inspiring. That's from like 2008 or 07 or 6, like that range, something like.
That. Yeah. It was over 10 years.
Old. That was really inspiring to a lot of.
People. What not many people see is how hard it was. So Peter and Adam Coates and Morgan Quigley and I were working on various versions of the helicopter, and a lot of things did not work. For example, turns out one of the hardest problems we had was when helicopters flying around upside down, doing stunts. How do you figure out the position? How do you localize a helicopter? So we want to try all sorts of things. Having one GPS unit doesn't work because you're flying upside down. GPS unit is facing down, so you can't see the satellite. So we experimented trying to have two GPS units, one facing up, one facing down. So if you flip over, that didn't work because the downward facing one couldn't synchronize if you're flipping quickly. Morgan quickly was exploring this crazy, complicated configuration of specialized hardware to interpret GPS signals. Look into FPGAs. Completely insane. Spent about a year working on that. Didn't work. So I remember Peter, great guy, him and me sitting down in my office looking at some of the latest things we had tried that didn't work and saying, darn it, what now? Because we tried so many things and it just didn't work. In the end, what we did in Adam Coates was crucial to this, was put cameras on the ground and use cameras on the ground to localize the helicopter. And that solved the localization problem so that we could then focus on the reinforcement learning and inverse reinforcement learning techniques so then actually make the helicopter fly. And I'm reminded when I was doing this work at Stanford around that time, there was a. A lot of reinforcement learning, theoretical papers, but not a lot of practical applications. So the autonomous helicopter for flying helicopters was one of the few practical applications of reinforcement learning at the time, which caused it to become pretty well known. I feel like we might have almost come full circle with today. There's so much buzz so much hype, so much excitement about reinforcement learning. But again, we're hunting for more applications and all of these great ideas that the community's come up.
With. What was the drive? Sort of in the face of the fact that most people are doing theoretical work? What motivate you in the uncertainty and the challenges to get the helicopter sort of to do the applied work, to get the actual system to work. Yeah. In the face of fear, uncertainty, sort of. The setbacks that you mentioned for.
Localization. I like stuff that works in the physical.
World. So it's back to the.
Shredder. I like theory, but when I work on theory myself, and this is personal taste, I'm not saying anyone else should do what I do, but when I work on theory, I personally enjoy it more if I feel that the work I do will influence people, have positive impact or help someone. I remember many years ago I was speaking with a mathematics professor and it kind of just said, hey, why do you do what you do? And he said he had stars in his eyes when he answered. And this mathematician, not from Stanford, different university, he said, I do what I do because it helps me to discover truth and beauty in the universe. He had stars in his eyes when he said it. And I thought, that's great. I don't want to do that. I think it's great that someone does that, fully support the people that do it. A lot of respect for people that. But I am more motivated when I can see a line to how the work that my teams and I are doing helps people. The world needs all sorts of people. I'm just one type. I don't think everyone should do things the same way as I do. But when I delve into either theory or practice, if I personally have conviction, you know, that here's a pathway to help people, I find that more satisfying to have that.
Conviction. That's your.
Path.
Yeah. You were a proponent of deep learning before it gained widespread acceptance. What did you see in this field that gave you confidence? What was your thinking process like in that first decade of the. I don't know what that's called. 2000s. The.
Odds. Yeah, I can say the thing we got wrong and the thing we got right, the thing we really got wrong was the early importance of unsupervised learning. So early days of Google Brain, we put a lot of effort into unsupervised learning rather than supervised learning. And there was this argument, actually, I think it was around 2005, after NeurIPS at that time called NIPS, but now NeurIPS had ended and Geoff Hinton and I were sitting in the cafeteria outside the conference. We had lunch, we were just chatting and Jeff pulled up this napkin. He started sketching this argument on a napkin. It was very compelling. I'll repeat it. Human brain has about 100 trillion. So that's 10 to the 14 synaptic connections. You will live for about 10 to the 9 seconds. That's 30 years. You actually live for 2 by 10 to the 9, maybe 3 by 10 to the 9 seconds. So just let's say 10 to the 9. So if each synaptic connection, each weight in your brain's neural network has just a one bit parameter, that's 10 to the 14 bits you need to learn in up to 10 to 9 seconds of your life. So via this simple argument, which is a lot of problems, it's very simplified, that's 10 to the 5 bits per second you need to learn in your life. And I have a one year old daughter, I am not pointing out 10 to 5 bits per second of labels to her. I think I'm a, I'm a very loving parent, but I'm just not going to do that. So from this very crude, definitely problematic argument, there's just no way that most of what we know is through supervised learning. The way you get so many bits of information is from sucking in images, audio, just experiences in the world. And so that argument, and there are a lot of known forces argument we should go into, really convinced me that there's a lot of power to unsupervised learning. So that was the part that we actually maybe got wrong. I still think unsupervised learning is really important, but in the early days, 10, 15 years ago, a lot of us thought that was the path.
Forward. Oh, so you're saying that that perhaps was the wrong intuition for the.
Time. For the time. That was the part we got wrong. The part we got right was the importance of scale. So Adam Coates, another wonderful person, fortunate to have worked with him. He was in my group at Stanford at the time and Adam had run these experiments at Stanford showing that the bigger we train a learning algorithm, the better its performance. And it was based on that there was a graph that Adam generated where the x axis, y axis lines going up and to the right. So the bigger you make this thing, the better performance. Accuracy is the vertical axis. So it's really based on that chart that Adam generated that gave me the conviction that it could, could scale these models way bigger than what we could on a few CPUs which is what we had at Stanford, that we could get even better results. And it was really based on that one figure that Adam generated that gave me the conviction to go with Sebastian Thrun to pitch starting a project at Google which became the Google Brain.
Project. Google Brain, you go find a Google Brain. And there the intuition was scale will bring performance for the system. So we should chase larger and larger scale. And I think people don't realize how groundbreaking of a. It's simple, but it's a groundbreaking idea that bigger data sets will result in better.
Performance. It was controversial at the time. Some of my well meaning friends, senior people in the machine learning community, I won't name, but some of whom we know, my well meaning friends came and were trying to give me friendly advice like hey Andrew, why are you doing this? This is crazy. It's in the neural network architecture. Look at these architectures we're building. You just want to go for scale. This is a bad career move. So my well meaning friends, some of them were trying to talk me out of it. But I find that if you want to make a breakthrough, you sometimes have to have conviction and do something before it's popular since that lets you have a bigger.
Impact. Let me ask you just in a small tangent on that topic. I find myself arguing with people saying that greater scale, especially in the context of active learning, so very carefully selecting the data set, but growing the scale of the data set is going to lead to even further breakthroughs in deep learning. And there's currently pushback at that idea that larger data sets are no longer. So you want to increase the efficiency of learning, you want to make better learning mechanisms. And I personally believe that just bigger data sets will still, with the same learning methods we have now, will result in better performance. What's your intuition at this time? On this dual side, do we need to come up with better architectures for learning or can we just get bigger better data sets that will improve.
Performance? I think both are important and it's also problem dependent. So for a few data sets we may be approaching your Bayes error rate or approaching or surpassing human level performance. And then there's that theoretical ceiling that we will never surpass a Bayes error rate. But then I think there are plenty of problems where we're still quite far from either human level performance or from Bayes error rate. And bigger data sets with neural networks without further algorithm innovation will be sufficient to take us further. But on the flip side, if we look at the recent breakthroughs using transformer Networks or language models. It was a combination of novel architecture, but also scale had a lot to do with it. If you look at what happened with GP2 and Bert, I think scale was a large part of the.
Story. Yeah, that's not often talked about is the scale of the dataset it was trained on and the quality of the data set because there's some. So it was like Reddit threads that had. They were uprated highly. So there's already some weak supervision on a very large data set that people don't often talk about.
Right. I find that today we have maturing processes to managing code. Things like Git version control took us a long time to evolve the good processes. I remember when my friends and I were emailing each other C files in email, but then we had was it cvs, subversion, Git, maybe something else in the future. We're very immature in terms of tools for managing data and think of how to clean data and how to solve very hard, messy data problems. I think there's a lot of innovation there to be.
Had. Still, I love the idea that you were versioning through.
Email. I'll give you one example. When we work with manufacturing companies, it's not at all uncommon for there to be multiple labelers that disagree with each other. And so we would doing the work in visual inspection, we will take say a plastic part and show it to one inspector. And the inspector, sometimes very opinionated, they'll go, clearly that's a defect. This scratch, unacceptable. Got to reject this part, take the same part to a different inspector, different, very opinionated, clearly the scratch is small, it's fine, don't throw it away, you're going to make us. And then sometimes you take the same plastic part, show it to the same inspector in the afternoon, I suppose in the morning and very affinity go in the morning, they say, clearly this is okay. In the afternoon, equally confident, clearly this is a defect. And so what is an AI team supposed to do if sometimes even one person doesn't agree with himself or herself in the span of a day? So I think these are the types of very practical, very messy data problems that my teams wrestle with. In the case of large consumer Internet companies, where you have a billion users, you have a lot of data, you don't worry about it, just take the average, it kind of works. But in the case of other industry settings, we don't have big data. If you have small data, very small data sets, maybe 100 defective parts or 100 examples of a defect, if you have only 100 examples, these little labeling errors, if 10 of your 100 labels are wrong, that actually is 10% of your data set has a big impact. So how do you clean this up? What are you supposed to do? This is an example of the types of things that my teams, this is a landing AI example, are wrestling with to deal with small data which comes up all the time once you're outside consumer.
Internet. Yeah, that's fascinating. So then you invest more effort and time in thinking about the actual labeling process. What are the labels, what are the, how are disagreements resolved and all those kinds of like pragmatic real world problems. That's a fascinating.
Space. Yeah, I find that actually when I'm teaching at Stanford, I increasingly encourage students at Stanford to try to find their own project for the end of term project rather than just downloading someone else's nicely clean data set. It's actually much harder if you need to go and define your own problem and find your own data set rather than go to one of the several good websites, very good websites with clean scoped data sets that you could just work.
On. You're now running three the AI Fund, Landing AI and DeepLearning AI. As you've said, the AI Fund is involved in creating new companies from scratch. Landing AI is involved in helping already established companies do AI. And deep learning AI is for education of everyone else or of individuals interested of getting into the field and excelling in it. So let's perhaps talk about each of these areas first. DeepLearning AI how? The basic question, how does a person interested in deep learning get started in the.
Field? Deep learning AI is working to create causes to help people break into AI. So my machine learning course that I taught through Stanford remains one of the most popular courses on Coursera to this.
Day. It's probably one of the courses sort of if I ask somebody how did you get into machine learning or how did you fall in love with machine learning or would get you interested? It always goes back to Andrew Ang at some point. So you've influenced. The amount of people you've influenced is ridiculous. So for that I'm sure I speak for a lot of people. Say big thank.
You. No, yeah, thank you. You know, I was once, once reading a news article, I think it was tech review and I'm going to mess up the statistic, but I remember reading an article that said something like one third of all programmers are self taught. I may have the number one third wrong, maybe it was two thirds. But when I read that article I thought this doesn't make sense. Everyone is self taught.










