Real World AI: A Practical Guide for Responsible Machine Learning [0:00:00] Guest: The takeaway is that machine learning and launching AI-based products is a team sport. You cannot do it alone. You can't do it sequestered in one part of an organization. It really takes the collaboration of people with different types of skill sets. A lot of people have a misunderstanding, like working on AI is really spending on the effort to tune the model, to really optimize all those different parameters in the model, right? In reality, all the people building real-world AI spend the majority of their effort on how to get the data right. My name is Wilson. And my name is Alyssa. And we're the authors of Real-World AI. [0:00:47] Noah Labhart: This is Code Story, a podcast bringing you interviews with tech visionaries who share in the critical moments of what it takes to change an industry and build and lead. that has your back. I'm your host, Noah Labhart, and today, how Alyssa and Wilson literally wrote the book on how AI and machine learning works in the real world. All this and more on Code Story. In the world today, many business folk are asking, how can you successfully deploy AI? When AI works, it's nothing short of brilliant. It helps companies make or save tremendous amounts of money while delighting customers on an unprecedented scale. But when it fails, the results can be devastating. In the book Real World AI, Alyssa and Wilson share dozens of AI stories from startups and global enterprises alike, featuring personal experiences from people who have worked on global AI deployments that impact billions of people. This book uses plain language to walk you through an AI approach that you can feel confident about for your business and for your customer. On today's episode, I get to ask them some questions about their experience with AI, what they set out to accomplish with the book, and much, much more. Enjoy today's chat with Alyssa and Wilson, authors of Real World AI. [0:02:20] Guest: Real World AI is a book about how to deploy machine learning based technology into production inside of a real company solving real problems in a way that is possible, practical, responsible, and scalable. And we go into a lot of different stories and sort of tactical, constructive advice, hearing from people in the trenches, both ourselves as well as many others who we've worked with and interviewed, about sort of what it takes to do this and to do it well. [0:02:55] Noah Labhart: So tell me about the goal of writing this book. What did you set out to accomplish by providing this well-needed text for this area? What do you hope people get out of it? When we [0:03:06] Guest: start to think of to write this book, we say like in the actual, there's already a lot of books about AI in the market, right? But we see on the one side, a lot of books, they are really talking about a high level on how you define AI strategy, how you should define AI strategy like yesterday. On the other side, all those books are really focused on a lot for detailed technology, how you to train a deeper neural network, how you build a transformer, et cetera. But there's not a lot of books talking about how to really build AI, build real-world AI in a responsible way. They struggle to really deploy AI successfully. Similar mistakes are made again and again. And some of those mistakes makes pretty big harms to the business and also the world. So we hope with this book, we can really share people the best practice we have learned from our own mistakes so they can avoid those mistakes and really deploy the AI applications successfully. One of the goals of this book was really to kind of codify and scale a lot of the lessons learned. These stories in the book and the lessons, you know, they're not new. They've taken blog post formats. We've done webinars on this content before. We even put a course together with Udacity that speaks to a lot of it. And this book is really an attempt to summarize and organize a lot of that information and make it accessible for a broader business audience. We both really believe strongly in responsible use of machine learning technology and how how powerful it is, but also how important it is to do it well and to do it with ethical and responsible sort of choices in mind. [0:04:48] Noah Labhart: So obviously you two are experts in the field, and I think it's probably a foundational thing to do to define what, you know, AI is and what machine learning is. I know in my world, those two things can blur together. together. So in your words, what is AI and what is machine learning and where do they overlap and where are they different? I [0:05:13] Guest: think when we go talk about this in the book a little bit, but we sort of look at AI as sort of the broader category. Sometimes it's looked at as artificial intelligence or augmented intelligence, but it's sort of the broader category of many different technologies. Machine learning is a subset, one of those technologies and even sort of further narrow neural nets, which is sort of the most common technology that's used today for machine learning based products in production. You know, there are technical definitions and there are also sort of product or aspirational definitions of what AI is and definitely get into some of those details in the book to differentiate sort of the idea or promise of AI with the tactical, practical, in the weeds technology of a deep learning neural network. work. [0:06:01] Noah Labhart: So there are, you know, misunderstandings about AI in the world today, right? When the layman hears the acronym AI, they think intelligent robots that are going to lead us through our day to day lives. When I, you know, put myself in that place, I think of iRobot with Will Smith, right? Robots are going to come help us do all of our stuff. But how does real life AI differ from the movies? [0:06:24] Guest: You know, it's both the same and completely different at the same time. There's There's a big difference between the machine learning products that are out there in the field today, which are using neural networks and deep learning and all sorts of other technologies as well, and what the movies portray, which is something that academics have termed artificial generalized intelligence, which is sort of a more aspirational goal where machines or computers can really be more like humans and reason and think and hypothesize. pretty far from where we are today in sort of practical terms for most of the machine learning based products that are out there in the market. You know, there's a really big technical gap there. However, that said, the technology that we do have is incredibly powerful. And we're doing stuff today that we absolutely could not do five, 10 years ago, that feels like it is incredibly smart. And it is and it's making synthesizing vast amounts of information fast and making and scalably in ways that we couldn't do before. But there's a really big difference between narrow AI, which is what most stuff is today, and generalized augmented intelligence or artificial intelligence. This is a super interesting and super important topic. I think all those AI movies or stories, it looks very fascinating. You mentioned the intelligent robot. Another big one is really the Westworld. You can see AI is kind of like human already. So that's what Alyssa mentioned, AGI, Artificial General Intelligence. I think it's still far away from reality, but I think that's the direction, someday we will get there. But now the real-life AI is really the application that has been taught or learned how to carry out specific tasks. So that's the real-world AI. It learns from data. It can do specific tasks very well, sometimes much better than a human. There's a lot of real world examples. When you search websites, it recommend you the product you want. When you talk to your iPhone, it recognize your voice and it can answer your questions. And even for all the self-driving cars, right? You can see even it's the real world AI, the only application who can do one specific task, but it's already very powerful. Very powerful, but only work on specific task instead of just to behave like a human. And there's a quote actually that we open chapter one with in our book from Andrew Moore, who's the former Dean of Computer Science at Carnegie Mellon University. And he defines artificial intelligence as the science and engineering of making computers behave in ways that until recently, we thought required human intelligence. And I really love that definition. And I think it's one that speaks to both the reality and the aspirations of the field. [0:09:26] Noah Labhart: You mentioned, or Wilson mentioned, learning from data, right? And to optimize a business's return on AI, they've got to have the right data. What does that mean? You can't just throw any data set at a machine learning algorithm or artificial intelligence. So what is the right data? [0:09:47] Guest: Data security is a super important subject for anyone who is working on AI. Because a lot of people have a misunderstanding like working on AI is really spending all the effort to tune the model, to really optimize all those different parameters in the model, right? But in reality, all the people who build real-world AI, they spend the majority of their effort on how to get the data right. So this is a super important topic and super important for people to really spend their effort there. But what is right data? There's a few common factors to consider when you decide if you have the right data there. The first one is really the data quality. We all know garbage in, garbage out, right? The right data might have high quality. Take the self-driving car as example. The AI model needs to detect pedestrians, cars, and many other objects from the images. So the image to train the model need to be from this real world, and the angle of this image should be the same as the camera on the self-driving car. If the bounding box is annotated in the image, to be really precise. It cannot be too big or too small. All those will cause serious problem for the car. So that's the quality part. Second factor is really the data representativeness. So the right data need to represent different cases from the real world. Back to the self-driving car example, you will need images from different places, images taken with different weathers, and images from extreme situations like a traffic incident. Then your AI model can handle those different challenges later on. The third factor there is really the data accessibility. So this is a factor often ignored by people. Most of the AI models need to be refreshed regularly. Otherwise their performance will degrade. To refresh those models, you need to get the new training data to retrain it. So if you don't have access to the training data in the future, you will be in big trouble. Last but not least, really the data bias. This is a hard one, but super important. AI can introduce bias. We have shared quite a few examples in our book. Translation software can map a doctor to male while nurses to female. A job review model can penalize females, right? None of those models have any intention to introduce bias, but the output does. and most of the times model bias can be caused by bias in this training data. So make sure enough effort is spent to detect the training data bias is also super important. So in summary, those data quality, data representation, data accessibility, data bias, so those are the major factors to consider when you decide if you have the right data there. One of the stories that I share in the book is sort of my introduction, introduction. My first major mistake in AI, when I took over a team for computer vision and, you know, we were working really hard trying to improve the model and improve the accuracy. There's a generalized sort of computer vision tagging system at IBM. And right before we were going to launch, someone on the team came to me and said, we can't launch this. And I was like, oh my God, like, what are you talking about? There's all this energy and money and time and people and put an image into the model. And what I got out was the word loser. And the image that had put in as a test was someone who was sitting in a wheelchair and the tag was loser, right? And I was horrified and we were all like, oh my God, we can't possibly do this. It's unintended bias that we did not know about. And the problem stemmed from the training data, right? There was labels and images in our training data set that one, we were not aware of and two, didn't reflect our values. And I think there's a unbelievable amount of time and focus spent on sort of this model training and deployment and sort of the end state. And there's not enough time typically spent on the importance of the data. The data is what matters. It really is at the end of the day, as Wilson was saying. And the data that you need for your project is almost always, with a few exceptions, really specific and tailored to the business problem that you're trying to solve. And you need to have the right data that is diverse enough and complete enough and high enough sort of quality matching the intended problem in order to mitigate something unintended, but really harmful in many cases, consequences. [0:14:18] Noah Labhart: Well, in the book, you mentioned, you know, that business leaders may not have the right org structure to work with AI. I think it's in chapter five. What structures indicate AI readiness for a business? How do they know they're ready? [0:14:31] Guest: I think there's a lot of, there's many different structures. some different options that might make sense for different stages of organizations. But the takeaway is that machine learning and launching AI-based products, it's a team sport. You cannot do it alone. You can't do it sequestered in one part of an organization. It really takes the collaboration of people with different types of skill sets, data science or machine learning training being one of those skill sets, but certainly not the only one. And I think that's one of the big challenges that we see in organizations is that, you know, there's sort of this idea that you just hire some really smart people and you put them in a basement and, you know, out comes this magical model if you, you know, sort of given them enough time and compute power and data. And that's really not how it works in successful companies. Most companies that are good at this and are good at prototyping and getting things sort of actually into production, solving a real problem, have a variety of skill sets on their team from designers and product managers and DevOps engineers and, you know, software, regular software engineers and all sorts of sort of diverse inputs. that is really a partnership between the business stakeholders and the technical experts and leadership. And it's that collaboration that really sort of is where the magic happens and you need everyone's skill sets in order to be really successful. And we walk through some different structures that might work for different sized organizations. The takeaway is that they all accomplish this collaborative way of working That's so critical for any project, but more pointedly so for machine learning based products. [0:16:14] Noah Labhart: That makes sense. Well, what industries do you think could benefit most from AI and machine learning? Is there one world that's better than the other? Or can everybody do better having this sort of technology? [0:16:27] Guest: You know, Wilson, I don't know if you'll agree with me, but I think it's everyone. I think there's a lot of focus on which industries are better or worse or more ready. And the short of it is there's opportunity in every single industry for maturation and innovation using this technology. But actually, in many cases, if you don't need to use AI to solve your problem, you shouldn't. Because it's a really hard, it's often very expensive. it's cumbersome, it's challenging, and there's lots of other technologies. I like to tell people that if you don't absolutely have to use machine learning-based technology, don't. If you can sort of solve 80% without, do. But the reality is that there's very real difficult problems that are very well-suited for machine learning-based solutions in every industry. Anytime you're dealing with with large amounts of data, which is basically every industry, and repetitive tasks, it's super well suited for machine learning. I also affirm the believer that AI can really transform all kinds of industries, although the material level from different industries might be different. For the high tech industries, and people are using AI, using machine learning for a long time, 10 years, 20 years there. They also have a lot of data accumulated. They track all those user behaviors from the web. With all this data, they can really leverage AI to do a lot of use cases like recommendations, like advertisements, a lot of those, right? Meanwhile, other industries like finance or maybe retail, we see a lot of AI use cases now and many other industries are also catching up. Basically, I think any industry where they have a lot of data, there's a lot of potential for leveraging AI to really transform that industry. [0:18:23] Noah Labhart: I want to double back a little bit to an earlier chapter. You talk about, you know, identifying the Goldilocks problem. And immediately that jumps out as what in the world is that? Can you explain what the Goldilocks problem is? [0:18:38] Guest: Yeah. Yeah, so if you're not familiar with the Goldilocks story, you know, classic children's book, which talks about, you know, something not too hot, not too cold, but just right. This is one of the things that organizations who are newer to using AI, it's important to start with a project that is going to be successful, that, you know, sort of is set up for success from the beginning. And often that starts with choosing the right problem. So we talk through some different qualities of what makes a good problem to start with new in developing that muscle of how to build machine learning based products. So you don't want an enormous problem that's so vague and so ill-defined and so big that's hard to make progress. And you don't want a really small problem that no one's really going to care about if you solve it. So you need sort of something that's just right in the middle, that's a big enough problem to solve, that matters if you solve it, that's sort of narrow enough that you can start with, but broad enough to have impact, that has enough data, that it's not impossible to get the right quality data for, but also is broad enough that it could be broadened later to solve a bigger and bigger problem as you invest further. And so we go through some different qualities that help people choose what is a good problem to start with that's sort of just the right temperature. In our book, we also shared quite a few examples. organization I tried to tackle a super noble and also ambitious problem, cure cancer after spent millions of dollars in the product field, right? Because that problem is just too big, too broad. On the other hand, we also shared another story from Autodesk, where when they start their AI journey, they start to look into how they can reduce the response time to their customer service request. Also, even within that problem, they start with a very narrow one. They want to give people the best support when anyone is asking for a password reset. So that particular problem is very small and also is not ambiguous, right? So if someone is asking, I need to reset my password, I have a problem logging in, then you can really route them to the places they can get the support. So that's a very simple problem. The answer is very clear and a human can really identify this problem clearly and easily. So that's some characteristics of a Goldilocks problem for AI. Simple and a human can really easily do that. So machine can do that in a much more scalable way there. And also the other part to consider is really the problem is simple, but the impact of solving big. The password reset or user login in those customer requests for Autodesk happens thousands of times every month. So the impact actually is much big, right? The last but not least, there's also need to be good quality data exist. We know that AI need high quality training data. Your AI initiative won't be successful if you don't have access to high quality training data. In the Autodesk use case, they have a lot for historical chat to password reset. So they can clean up and label all this data to really train their AI applications. [0:22:07] Noah Labhart: So your story about the Tesla Model 3 is a great example of what can happen with immature AI, obviously Elon's company. Can you describe that scenario and how it can be avoided? [0:22:19] Guest: Tesla is an incredible company that is making a huge amount of progress in self-driving cars, and it's really inspiring, but it's a hard problem. in self-driving industries, getting enough data. And Andrej Karpathy actually, who's one of the AI experts at Tesla, he did a talk several years ago where he said that when he was in academia, there was sort of 70, 80% of his time that was spent on model development and about 20% of time spent on training data. And when he got to Tesla, it was the opposite, right? It was 80% of time spent on training data and like 20% spent on model building. it up. And the challenge that Tesla and many others have is that how do you get enough examples of real world problems to be able to train a self-driving car? So in this instance, it was a sad situation. What happened was Tesla was on autopilot and ended up hitting a semi truck that was perpendicular on a freeway. Now, that doesn't happen very often, right? It's very truck to be stopped perpendicularly on the middle of a freeway. That's not normal. And so therefore those types of examples are unlikely to be included at any large volume in the training data set. And so the Tesla didn't sort of know how to react to that or, you know, sort of figure that out and unfortunately, you know, ended up in a car crash. But it speaks to, you know, some of the the challenges with synthetic data and some of the complexity that is level five autonomous driving, it's just a really, really hard problem because the real world and real humans don't often behave rationally necessarily. And there's all sorts of problems that you can't think of, or that are edge cases that need to be accounted for in a model. And, you know, there's different ways to deploy a machine learning based solution to have sort of fallbacks or, you know, how do autonomous mode into a manual mode in situations that are edge cases where there's lower confidence. But unfortunately, in that case, there was a tragic outcome. But I can speculate that one of the challenges was that the training data, it's unlikely that it had a lot of examples of semi trucks perpendicular on a freeway, right? Because that just doesn't happen. And Tesla has thousands of hundreds of thousands of miles driven and data collected. But most of that is cars driving normally successfully down a freeway. [0:25:00] Noah Labhart: So in the book, you urge people to consider three areas before deploying new AI. And then you call them availability, performance and scalability. When I when I think about this, I think about, you know, the project management triangle, time, cost and scope. So can a business do two out of three of these, or do they have to do all three of them? Are there trade-offs between them? Can you talk about that a little bit? [0:25:24] Guest: Yeah, I think those are the three very important principles for building high-scalable, high-performing systems. If you ask any engineer, those are not new concepts. But when people start to build AI, some of those actually got ignored and which caused some problems. So for those three principles, availability, performance, scalability, availability really refers to if a lot of people are using your AI product, the product should be available all the time. You should not get a, well, I want to use your AI model, you've got an outage, the AI is not working, then that's not good given just AI is used in so many different scenarios now in our everyday life. Performance is more referred to when you interact with AI, you always get quick response. Like sometimes if you ask a question, the AI can only answer you in one or two minutes. Probably you will lose the patience to use an AI, right? Scalability refers to if the traffic, if your user base increase a lot, the system can scale to support those increased demand or increase the traffic. So those are the basic principles when anyone designing any engineering systems. And it's a little bit different from those different triangle trade-offs for project managers. Because when you build this AI system, you cannot really just only get one and then trade off the other two. Availability, I think that's always a key focus. You should always get it right. No one wants to use an AI system where you always bump into outage. Performance is super important. Basically when you use any internet products, the speed actually means money. If it's a product which results worse, slowly people lose patience, people will give up the product. two I think is a must-have. You cannot make any trade-off. Scalability, so that's an interesting one. When you start to build your application, it might be okay you do not consider the scalability in the beginning, but once your product gets attraction, you start to see more users coming, that's time you have to make the investments to make your systems scalable. available. Context is king in AI. In marketing they say content is king. In AI, context is king. It really matters, you know, the specifics of the problem that you're trying to solve and the environment that you're trying to solve it in and who the people are, the players and what the stakes are of what you're doing. And it's impossible to sort of say arbitrarily, oh, this always works or this never works or, you know, balance and context are always really critical to evaluating any problem. [0:28:30] Noah Labhart: You know, one of the last chapters, you talk about building versus buying the technology for AI and for machine learning. And there's lots of vendors out there now that are touting they can do machine learning or easy to use. What helps someone decide if they should create their own infrastructure solution or go out and use someone's prebuilt solution? [0:28:56] Guest: One of the things to understand about successfully deploying machine learning products at scale is that it requires many different technologies, not just one. And it requires sort of an orchestration or a symphony of all of these technologies working together. And so for any piece of this system or, you know, a complex machine learning based application, There are anywhere from five to 100 different types of technologies, depending on how you define that and different types of infrastructure, hardware, software and sort of everything in between. There are components of it that will be appropriate for your team or your company to buy and other components that are appropriate to build yourself, depending on what is strategic to your business. So take, for example, if you are a self-driving car company, right? It doesn't make sense to buy off-the-shelf self-driving models, right? Because that is core to your strategic differentiation and your competitive advantage is that you have, you know, something special and really innovative about self-driving technology. technology. However, it might make sense for you to purchase hardware like compute power from Amazon or a large cloud computer company because that part of it is not necessarily competitively advantageous to your business. Or it may or may not be. But that's just an example to really think about what are all the different components because no one can build all of this themselves. It's really complex and there's some great tools out there that are going to make your life a lot easier. And so my recommendation is buy what you can because this problem is hard and buy what you don't need to build and only build the part that is really important for your team to build because you're going to get to market faster and you're going to be able to learn and iterate and have more success. Focus on what's your strategic focus and make sure you are doing the best there. For the rest, maybe you can leverage stuff from other vendors or other players. One more thought to add there is also depends on the AI material level of your organization. So if you are just starting to start your AI journey, start to build a team, start to recruit the talent, start to try those use cases. So in that phase, maybe you want to buy some of those AI applications while you are building your own capability. So doing it that way, you really get the best of AI immediately and also it's really shortening your time to go to market it. But meanwhile, while you're building your own AI capability, those people, those teams can also learn from all the solutions from outside. That's just another consideration really based on the different stage you are at your AI maturity level. [0:31:50] Noah Labhart: Well, thank you for being on the show today. Thank you for telling me about real-world AI. You've written an incredible book with some incredibly great information to help people deploy AI and machine learning systems. Where can my listeners find out more information about the book, about you both, and connect with you? [0:32:08] Guest: Absolutely. We would encourage everyone to grab the book off of Amazon, Real-World AI, by Alyssa Simpson Rochwerger and Wilson Pang. And you can reach out to me on LinkedIn. in and, yeah, you can also return to me on the key in two. And thank you so much for for having us. Noah, it's absolute pleasure to be with you today. And [0:32:30] Noah Labhart: This concludes another chapter of Code Story. Code Story is hosted and produced by Noah Labhart. Be sure to subscribe on Apple Podcasts, Spotify, or the podcasting app of your choice. Support the show on patreon.com slash Code Story for just a month. And when you get a chance, leave us a review. Both things help us out tremendously. And thanks again for listening.