[DataFramed AI Series #4] Building AI Products with ChatGPT
11 May 2023 · 56 min
Joaquin Marquez, an AI veteran from IBM and Oracle, discusses building products with ChatGPT and LangChain. He shares three core use cases: chatbots, natural-language-to-SQL interfaces, and fall-detection systems. An Oracle sales tool cut proposal time from days to hours.
Chapters
Hi, I'm Maggie, VP of Curriculum at datacamp. And I know firsthand how overwhelming it can be to keep up with the rapid changes in data and AI. But staying ahead doesn't have to be hard. That's why our curriculum team has curated the best learning content to help you and your team stay ahead, covering everything from data and AI literacy for busy executives, to cutting edge generative AI for developers, and everything in between. Whether you're upskilling yourself or your team, we make learning practical, engaging and flexible. It just works. Power your data and AI transformation journey on datacamp.com.
One thing that we've observed is this idea. It was just an idea that there would be emergent behavior if you fed it enough data. It was not obvious that would occur, but the mechanism itself, the transformer, is easy to understand. But what's difficult to understand is if you feed it enough data, at one point it starts coming back with responses that surprise you.
Welcome to part four of the Data Framed AI series. This is Richie. Perhaps the biggest development in AI over the last year is the explosion of tools that make it easier to develop applications with AI. That means that building AI into products is now feasible for almost any company. Today's guest is Joaquin Marquez. He started working with AI back in 1983, so he has more experience with AI than almost anyone on the planet. His prestigious resume includes putting his AI skills into practice at IBM, Verizon and Oracle. And now he runs the father son AI consultancy Kinema, where he builds AI products. In today's episode, we'll cover ideas on what to build with AI, the details of how to build AI products, and how ChatGPT is making chatbots better. I'm keen to dig into Joaquin's 40 years of experience. Hi, Joaquin, thank you for joining us on Data Framed.
Thank you for inviting. It's a pleasure to be here.
Yeah, I'd like to dive straight in. So let's talk a little bit about your work creating generative AI applications. So can you tell me what are the most common use cases your customers have for generative AI?
Yes, certainly. Right now I'm devoted to chatbots because of ChatGPT. It represents a unique opportunity because the chatbots that we did before ChatGPT did not use generative AI. We created different scenarios for dialogue and try to account for all the scenarios we could conceive of and have rules and special content for each scenario. So it was quite involved. That whole task has become much easier now and more creative, and we are not pigeonholed on specific Scenarios and specific sets of questions and dialogues. So now it's much more natural, but we have other challenges. So chatbots most recently, and then before that, I use narrative AI to generate SQL queries to answer English like questions. And I'm using that in my chat box now. Basically, you ask a question, it translates it into SQL and goes to the database, gets the answer, submits it to the chatbot to surround you with some nice context before answering that. And one other project that I was involved in, involved computer vision. And what I was doing was basically taking video from cameras where older people lived in their houses. And if, for example, one of them fell, okay, to detect the fall and be able to react and have the software call for help. So that's one where the generative AI was basically generating video, because video is very expensive and you cannot have old people falling on purpose. It's hard to get actors that will go for that. So you can generate some specific scenarios and then have the software learn what a fall looks like. And it's very useful because then you can train the neural network to recognize it.
I think all those three examples, the chatbots, the natural language interfaces to SQL and then the computer vision, they're all fascinating examples of using AI. Maybe we'll start with the chatbots. So you said that you using ChatGPT, this has made it easier to create chatbots because you don't need to worry about the scenarios. Does it also have a benefit for the end users as well of the chatbots?
Yes, it is much more natural for them. For example, one of the big challenges, and it combined two of the scenarios that I was talking about, the data that the user is interested in is generally not the generic data that was used to train ChatGPT, for example, it's specific data to their business and therefore you cannot ask ChatGPT for it. On the other hand, you cannot feed your data into ChatGPT because of privacy concerns. So you have to have a local database that you can query. But then the trick is, how do you do it? Do you have chatgpt make the call for you? Then you have to supply ChatGPT with the context of the question so that it understands where you're coming from and what is it that you refer to with certain specific words, and then that helps it to generate the SQL query, including the specific points that you want to make. For example, you could ask gimme sales for March 2019. So where March 2019 goes in the query, it needs to make that linking ChatGPT is fantastic to do that. It's a very difficult problem to solve otherwise, and it's solved for you. It's just a matter of, okay, using your imagination. And you may need two or three questions back and forth, a small piece of dialogue with ChatGPT before you get the answer that you need. And so therein lies the secret of getting these chatbots to work the way that you expect them to work.
That's absolutely fascinating. I'd love to get into the details of like how you'd been dealing with this, sort of these privacy issues and using local data to get around that. Maybe we'll talk about that later, but for now just. Can you tell me a bit more about the different technologies you're using to build these chatbots? So you mentioned GPT, but are there any other technologies that you think are important here?
I'm currently using LangChain, which allows you to create basically a sequence of back and forth and get several pieces of software involved, not just ChatGPT. So that for example, if you, you don't want any bad feedback, therefore you are supposed not to use bad words, then you could filter the bad words up front and also instruct ChatGPT not to use any bad language. So the involvement of these other tools has to do with filtering, with correction, with preparing the context to make the query. And then ChatGPT comes back with how you need to make that query and then you make it of your local database, not ChatGPT. So ChatGPT ends up putting together the question exactly the right way that a programmer, for example, or a SQL specialist will do. So that's one. One other interesting aspect is I have to do a lot of reading. So I put together a system by which I get the PDFs, especially technical articles. I feed them into a vector database together with the original text and then I can ask, okay, well in the last three years, give me the list of all the articles on a specific topic and it comes back with it. I have some background on this because in the 90s I was chief architect for Infosage, which was an IBM product, the world's first customized news and scientific article type of search. You would give it the topics you're interested in, the context, and it will come back with articles with news items that concern that topic and that specific focus that you they have. So it's the same idea, but now we can do it much more sophisticated. And let's say for example, that I'm investigating something like for real. I'm now into XAI explainability. There are Hundreds of articles already. So create a survey of them. I feed them and then I ask specific topics and it uses those articles as the source. And it's outside of ChatGPT, so it's called an embeddings or vector database.
That's very cool stuff. So I like the idea that you are using AI to do research for you in order to build more AI applications. That seems a good sort of virtuous circle there. But yeah, so it seems like LangChain and vector databases seem to be like the big technologies that are important here.
Yes, exactly. ChatGPT has its own. I've also used Pinecone. They're all fine pieces of software.
Excellent. And I think so a lot of companies at the moment, they really want to get involved in generative AI, but they're not sure whether they need to use these other pieces of software that other companies are making or whether they should build things themselves. So I guess of your work. Why do organizations come to you as a consultant rather than building things in.
House when they realize that it's not just having university training, but also the experience? Thankfully, our universities are graduating thousands of data scientists, but it's hard to find somebody with more than maybe 10 years experience. I've been lucky enough that I started doing this in the 80s, so I've learned through experience and I've been exposed to all of these technologies and absorbed them on my own as opposed to having that experience at a university. And having that many years experience gives me perspective because, for example, what we were doing that was state of the art in the 80s and 90s has been completely superseded. Some of the ideas are still there, but they're much easier to implement than back then. Back then we had to write everything from scratch, including vector databases and the expert systems, for example, the neural networks. Back then we knew about them, we had a good idea how to put them together. Not the modern models that have been discovered in the past half a dozen years, but some simpler models. And they were impossible to run due to memory limitations of the hardware done. And they were too slow also.
Okay. So I'm glad things have moved on from the 1980s. It's good that we're making progress.
Absolutely. But one of the things that clients realize is they may try one or two projects. Many of the AI projects fail because you are asked to do something that if you know it's very hard to do, but you don't have the experience to know it, then you go ahead and do it, try it. And AI is not ready to Solve that particular problem that particular way. But if you have the experience, then you can. And I've told the clients, that's not possible to do. It needs research. So it may be possible to do in six months, but currently it's not. So you have to know the current technology. You have to know what the hurdles are for each type of technology as well, what can be done, what cannot be done.
So just related to that, how do you go about deciding what makes a good AI project? How do you plan this? How do you decide whether this is high priority, whether it's feasible?
I would say a combination of knowledge and experience. The clients hang on to everything that they read in the news, okay? And then people have a tendency to think that they can get away with a lot more than it's possible, given the technology. So, for example, there are people that want ChatGPT to do some reasoning for them. Well, it turns out ChatGPT does not do any reasoning. What it does is predict, as they say, the next word, but not only that, but predict the context. And if you give it some context before you create the prompt, it helps it quite a bit to constrain the possibilities, right? And this context becomes quite complicated depending on how you ask the questions, the sequencing, all of that. So, for example, if you ask a question in one context and then you go and ask another question in a completely different context, and you don't set it up before that, before changing context, then you get the wrong answer because it assumes a history as part of the dialogue you go through. Okay? So if you want to change the way that you are thinking about something, you need to help it. And that's part of the prompt engineering challenge that we have currently. And since ChatGPT, in a way, it's a black box. Even though we understand the mechanism, the Transformers, it is a black box because by the time you feed those billions of documents into it, create a specialized model that contains all of that information, you really don't have a very good idea of what could come up. In the past, we used neural networks like the LS long Short Term memory, okay, that were capable of memorizing what had just come before. So in a sentence, if you were parsing one word, it knew what had gone before, three or four or five words before, but that's not enough, because you could continue in a crazy way that was completely out of context. And in some science fiction novels or comedies or whatever, you can never predict what comes afterwards. But with Transformers, you read not just a whole sentence. You could be Reading in parallel a whole paragraph. So you get both the context of what happened before and you get the context of what's going to happen later. So it uses this attention mechanism to do that, and it makes it so much more powerful because it's like having a second reading of the same text. You've already been there, now you go through it again. But doing it all at once, and you get much better results. And that's partially part of the improvement. And one thing that we've observed is this idea. It was just an idea that there would be emergent behavior if you fed it enough data. It was not obvious that would occur. But the mechanism itself, the transformer, is easy to understand. But what's difficult to understand is if you feed it enough data, at one point it starts coming back with responses that surprise you. So that makes it incredibly interesting because all of a sudden you realize, oh, I thought, for example, that it would get that question wrong. And it turns out it gets it right. Or maybe you didn't ask it right. You need to work on your own prompting.
So this is really interesting, the idea that first of all, you need to worry about your prompts, but also sometimes the responses you get are going to be surprising. So in general, how can you evaluate the quality of responses from a text generation model?
Well, for example, let's say a client has a specific type of business and you want to supply a chatbot for managers of the stores for that client that have, let's say, a high school education. So they usually don't have a course in statistics to understand the intervals of confidence in the data that they are getting back. I tried to solve that and partially solved it a few years ago, doing visual statistics, creating curves and showing where they were in the set of curves so that they could say, okay, we are above the medium but below the 75 percentile, or we are above the 75 percentile but below the 95 percentile. But if you are anywhere between 2.5% and 97.5%, you are within the usual high confidence interval. So you can see your curve where you are today. And visually you say, I'm doing great. If you are certainly above a certain level and you don't have to understand the details, well, it turns out a chat box a lot better ask you. That question gets back to you and tells you how you are doing, how your business is doing at a moment in time, and if it's not doing well. One of the things that we do is to feed back a predictive answer for Example, tomorrow is going to be lousy. And also a prescriptive answer, which is what you have to do is start selling coupons right now. Okay. Or announce something or call a nearby business. Let's say if you are a parking lot and you know you're not going to do enough business tomorrow, you call some nearby places that will attract customers and split the parking with them.
Okay. That's fascinating the way you think about, like, how do you interact and provide more information? So you're saying it's better to just give it more information rather than give it a specific task to do.
Yeah, exactly. Or you feed the specific information that context information unbeknownst to the user. So from the user question, you interpret and say, oh, okay, he's talking about this particular context using some keywords. Therefore, I need to give ChatGPT this preamble with the information that it needs. For example, in the case of the SQL databases, we don't feed the data, we only feed the schema for the tables and then it figures out how to do the SQL from the scheme.
So you're not providing any actual data to the AI, you just provide. This is the structure of the database, this is what's in each table, and then it can figure things out from there. That's very interesting. So does it make a difference when you're building these AI products? If you're building a complete AI product from scratch or if you're just adding AI features to an existing product?
It makes primitive. The product that I designed for IBM in the 90s took two years to do. Okay. To design and to code and all of that. We had to do everything, including the networking software and to design the databases, the vector databases. To do this and create new technology, I got three NLP patents out of it. It was quite an effort. Nowadays I don't need to do that. A lot of the products are open source. I can just use them. My only criteria is can I use them in a commercial product or do I have to ask the client to buy or license the product? That's the only thing. So nowadays things are much easier. The problems we have to solve are at a different level. And as I said, it's a question of prompting, but also architectural design. Because you cannot ask details of your business again from ChatGPT. You need to get ChatGPT to figure out how to ask your local database for the details.
Okay, so that's really interesting. So saying, well, prompting is obviously a bit of a challenge, but also figuring out the architectural design, are there Any other big problems that you need to consider when you're trying to devise an AI project?
Yes. First I have to think about it for a day or two. Then I need to figure out are there components, Are all the intermediate problems solved already? And what components will solve. Okay. And how do I need to string them together? And if I can figure that out, then I tell the client, yes, go ahead. And I believe this is the effort. If I see that there is a gap somewhere and it needs research, then I tell the client right now, we need to cover this gap. But I tell them upfront so that they know. Some of them decide, okay, we'll wait six months and see what happens. Others say, okay, we'll pay you to do the research and put it together, in which case it becomes their problem.
All right, that's interesting. So can you give me some examples of success stories where you've built an AI product for a customer and it's had a big impact for them?
Yes. When I was head of consulting and chief data scientist at Oracle Latin America, we were challenged with some problems with. It's not that we were not selling. We didn't know what we were selling and in what quantity because we were selling so much. So things got lost. This was a while ago. And basically what I did was to travel to several places, talk to the sales people, talk to the marketing people, look at the last four years of sales, and then using at the time some technique called SVN support, vector machine. Using that technique, I basically was looking, okay, when we sell a set of products, because IBM, I mean, Oracle sells usually sets of products for a corporation, it's not just one. And for example, databases are sold with almost everything because they are required. And we were targeting, okay, what's going on with the. The salespeople were taking quite a while, prepare the materials they needed to approach the customer, the potential customer, and let's say they used four and a half days to prepare, half a day, go and present it to the customer. The proposal I was able to reduce by identifying patterns, for example, what products sold in combination and what products, if you sold one, you never sold the other. Those types of patterns. Okay. I was able to decrease the preparation time to basically zero because it was based on previous sales experience. I could tell them through the AI, do you need to bring a technical team with you for this particular customer in combination of products, or can you go on your own being a salesperson or do you need backup of some sort? And then what is the best way to engage the Customer if they decide to go ahead. You bring a team or a series of meetings before a final commitment, or you don't. And we were able to basically reduce the time that it took to prepare only half a day visit the customer. And the AI just gave them a list of what had been sold, what we were selling, and what else we could offer if they went for it. Okay. And also the strategy that you needed to use and pointers to previous sales so you could contact the salespeople and get their wisdom about this particular customer. So that was a prescription. We had a predictive part. We predicted which customers would be more receptive and the prescriptive part, which is how should you approach the customer? That was quite a success.
I really love that story because when you started, I thought, oh, you were just gonna say you'd built a recommendation engine, but actually it was improving business processes, so just speeding up the operations and also finding more effective ways for you to sell things as well. So that sounds like it had like an.
On many different levels, and it was quite successful.
Excellent. Just on the flip side though, have you ever had any cases where you've had a customer that's been very excited about generative AI, and then after talking, you've decided actually that's not the right technology for their problem?
Yes. And in the past, I worked at Cognitive Systems, which was AI company, an offshoot of Yale Department of Artificial Intelligence. And we were doing natural language processing back in the 80s. And we created systems that would basically, for example, at a bank would receive bills of lending, which are documents that ships arrive with, saying, this is the cargo that we bring, and these are the permissions you need to get, and these are charges for bringing cargo and how to extract the cargo from the port. But there were many different types of bills. So we created a system that would categorize them and put them in specific bins to be read and either accepted or rejected by specific people that had particular knowledge of that. Okay. So that was an interesting one. And it was challenging because, for example, we had to have several thousand documents and we use techniques that. They are called case based reasoning. That was at the time. That's been superseded completely. Other aspects more recent is, for example, to use bert, which is a type of neural network, to do reduction. Okay. Chatbot. ChatGPT can also do it nowadays. And a lot of people, for example, they. They do redaction by just erasing words that want to keep private.
Okay.
And I discovered that instead of doing that, if you use special characters surrounding a label, Say Social Security ID goes here, blanking it out. And then if you use the output that has those labels into a vector database or even chatgpt itself, you could fine tune it. Then it starts looking at the patterns in terms of, okay, Social Security IDs could go in this position or that position, not just blanks. Okay. So it would start seeing behaviors of where people tend to use Social Security IDs, for example, in their correspondence.
Okay. And then from there, what was the use of that? Was this just to provide better redaction then or that's more natural sounding?
Yes. And then to be able to predict when you are not sure that these sequence of numbers is some international ID or a Social Security number. If you know the patterns in which a Social Security number pops up, you may be able to do a prediction. Okay, this is not a Social Security.
Okay. Oh, so it might be like a phone number instead. But you need the contacts.
We humans attach metadata when we see something and we know. And for example, if you hand redacted, then you cross it over, but you know it was a Social Security number that will be useful later on. If you do this day in and day out, you'll recognize the patterns and that's like a meta level of knowledge that one would feed back into ChatGPT.
So I'd like to talk a little bit about how generative AI can democratize access to data. So I guess one of the big sort of potential benefits of this technology is that some tasks are usually performed, performed by a data team, can now be performed by anyone, like even if they don't have a data background. So have you seen any examples of this?
Well, I've heard and read about some examples, but they are limited to particular contexts because everybody is trying to sell these tools that supposedly don't need any code. They are fantastic if you apply them to use cases that everybody has solved. Okay. Because that's what the tools are for. But if you have anything even slightly complicated, then they need to program. You need to add your own code into it to make it do what you want it to do and not what somebody thought you would want to do always. So I have not seen anything that's impressive from this point of view. Now, the democratizing of the data, there's several different layers. Because for example, if you are talking about personal identifiable information like pii, then you need to determine, okay, you can look at your own personal data, but you cannot look at anybody else. Or if you have, you're high up in the totem pole, let's say, at a bank, you may be able to use somebody else's personal data, but it depends on your rank and your particular function within an organization. All of those provisions need to be set up even before you can make the query. All right, so what you get is what is mainly due to the security process you go through rather than the chatbot itself. So the chatbot has no, it assumes, okay, you ask it a question you already have the right to ask. So by the time you get to it, you have to go through all of security layers in order to make it work. Now, the democratization of data in terms of, for example, you could go and completely obliterate all the data that's PI, no matter what, and then you feed it, or you put those limits, okay, like I was saying, Social Security number, personal phone number or cell number, name of a company without mentioning the company and so on. That's democratization. Anybody can read it. You're not damaging anyone. Some people could guess who you are talking about, okay, from the context. But that's one aspect where human intelligence still exceeds anything that ChatGPT can do. So in that sense, yes, you can democratize data. You can actually exchange information without giving away any secrets.
So, well, related to this, I was wondering, you've been working on natural language interfaces for SQL queries and has that helped provide access to data for people that couldn't normally get access to those databases?
Yes, because they will need to be experts in SQL and have the access rights to go into the database to start and then know how to access. And some of these queries get very complex. So, yes. Now, as far as further democratization, I think that very soon we'll be able to exchange information between companies, between people, in such a way that we are basically guaranteeing that no PIIs are being revealed of any type, or for example, that the exchange fully complies with HIPAA or some other things. So I believe these things are going to be possible.
That's really interesting, the idea that you can safely exchange data from one company to the next and not have to worry about those data privacy issues in general. Where do you think organizations should make use of generative AI just to improve their data capabilities?
Well, one of the problems everybody has is having enough examples of data to be able to train the neural network specific tasks not related to ChatGPT. And so let's say for example, how. One of my questions is how many different ways to ChatGPT can you ask about what was the most profitable month of the year for A specific. How many different ways can you ask that? And instead of me spending days or weeks writing down everything that occurs to me, I have ChatGPT generate that data for me and then I take all those 100, 200 questions, whatever they are all asking the same thing, and now I go and use it in my chatbot, make sure that it comes up with the same right SQL query every time, and usually it doesn't. So I need then to take care of. Because language is most of the time is not specific enough, it's ambiguous, and it depends on how you ask the question. That ambiguity is if you don't get rid of it, you don't get the right way.
Ah, that's interesting. So if you've understood this correctly, you're generating hundreds of different prompt variations in order to make sure that regardless, whatever a user inputs into your chatbot, you're going to get a consistent, correct answer.
Yes. And if there are ways of asking that always gets it wrong, then one of the things that I do is I check, let's say, using a pine cone vector database, are you asking this type of question and if the answer is yes, it comes back instead of going to ChatGPT saying, could you be more precise and related to this?
Do you have to do any testing of prompt quality? Like do you do AB testing on your prompts or anything like that?
Yeah, depending on the needs of the client. Yes, we prepare a whole test screen that we can apply. But again, the labeling and the data generation, all of that. I had a client, an insurance company in Los Angeles, that they wanted be able to get the readings from dongles in the limousines and taxis that they insured so that they could see first whether the drivers were behaving themselves while driving, and secondary, if there was an accident, that we would be able to detect it. But after more than 10,000 messages, we only found 13 of them that were true accidents. So every time I tried to train the neural network, it would say, well, it's just 13 of them, assume they don't exist. So it would never classify anything as accident. So this was a huge problem, and it's very hard to fake data from an accident. Okay, slamming your door in the car, it's 4G right there and there. It's the same as, for example, a bike bumping against the door. So how can you tell the difference? And if you can't, how can you produce more accidents? So I went to the website, the government website where they test the cars, and got their accident data, transformed it into the right format, as if it came from a dongle, and then fed. But those added a few dozen examples, not enough. So in that case, I was lucky because I used a mathematical technique called the fast Fourier transform, which is used in physics. And the fast Fourier transform changed it from acceleration versus time to acceleration versus frequency. The frequency gave it a telltale sign of the accident. There were some peaks at certain particular places that only occurred in accident. Then I fed that result from the fast Fourier transform into the neural network and it could easily tell one from the other. I was lucky because nowadays we could use generative AI to actually produce more examples of the accident patterns without having to be lucky and get a transformation that gave you guess.
Absolutely. So that used the fast Fourier transform to detect accident data. That does sound like quite unintuitive or not like a novel sort of leap of the imagination for how to solve that. But yeah. So more generally it does seem like generative AI is really good for creating synthetic data. And I do like the idea that you can use that. If you do have a problem with class imbalance, where you're trying to detect.
Rare events, that's one of the big pluses.
Does it change the kind of skills that you need to work with data now, the fact that you can do different things with AI?
Yes, because you are working at a different level. In order to take full advantage of the engine, let's say chatgpt, you have to speak its language, use it for what it was intended to be used. It's not like there's a lot of APIs you can go through, really, how you set up your right context, avoiding certain terminologies and not making it too complicated. One other thing that I've noticed is, for example, if the database has too many tables, then it either takes too long or it gets it wrong, because there are a lot of joins. And that takes time by itself if you make the query yourself, but it takes time to set up correctly. So ChatGPT is not as good. So you would make the table simpler a la data analytics type. Convert a relational database into data warehouse type with lots of attributes together, thickness in a table table as possible, and you get better results. So you have to make accommodations for the limitations of the chatbot.
Okay, I think that's a useful tip to know, is that if you're trying to generate these SQL queries with lots of joins, then it's not going to work.
So at least at the moment, you may get lucky. And it works if it has a very close example in its memory. But if it doesn't, which chances are it will not then easily get them wrong or more sensitive to changes in the wording, the English wording behind English query.
Ah, yes. Okay. So the language used in the database matters, perhaps because GPT in general is better with English rather than other languages.
Yes. For example, if you're asking something about a specific record in the database, then I found that using the word symbol is crucial. You say single, it knows it's one record. If you say something else or avoid the word single, it may give some of a particular column.
Because things are moving pretty fast, there's so many developments going on right now, it's quite hard to keep track of everything. So are there any generative AI projects that or tools that you're particularly excited about at the moment?
Well, as I said, right Now I'm into ChatGPT and LangChain, but I'm also looking at other aspects I have a strong interest in, as I said, Xai, explainability. And for example, in the case of explainability, the algorithms that work best in explaining themselves are things like decision trees, force, that type of thing. But if you think about the complexity of certain problems, and we already have examples of those types of problems in math, there are some math problems that have been solved with computers that no human understands. We just take it for granted because people have checked specific portions of the code, but nobody will ever understand them because they involve thousands of steps. And the same occurs with a decision tree or a forest in that it may have thousands of decision points to give you an answer. And the best that you can do as well, if you find this particular variable between this range and that range and then you repeat that 100 times, who's going to understand if you have 100 variables?
Absolutely. It can become incredibly difficult to explain what's going on in particularly complicated models.
Yes, we may have to settle for more generic answers if the only way that we can explain it even with the most explainable algorithms, is by providing hundreds of thousands of decision points.
And so related to this, I get the feeling that over the next few months there can be a lot of things that claim to be exciting AI, but maybe aren't. So do you have a way of deciding or any heuristics for deciding what is a good quality AI tool or company versus what's just, I don't know, cashing in on the hype?
Well, usually I read the scientific papers in Arkiv, but not the press. I mean, I also read the press to see, but I don't believe it until I see the background to the idea. Somebody has done some experimentations or research and they have a certain level of confidence that this will work. And then it's a question of reproducing it. And if the results jive with the claims in the articles, then I'll try. And as I said, we use as much open source as possible. Open source has been fantastic for everyone, but occasionally there are those gaps that need to have a client that's interested in paying for. And as I said, the advantage for them is it remains secret because they pay for it.
So I do find that interesting because that you mentioned having to read all these journal papers because sometimes if you're not involved in academia, then you think, well, it's just something that happens in the background universities. But actually this is a really important part of your research for building business products then.
Yes. And also I read articles on other types of products and the level of confidence that they have, but do tend to read the literature. And for example, when I was at IBM, TJ Watson Labs, they had all the papers there. I researched as much as there was before I started inventing things with my team. That's the way to do it. You don't want to reinvent, you want to step on shoulders of giants.
Absolutely. All right, so is there anything you're working on right now that you're excited about?
Well, as far as the explainability, it is a big concern of mine because it's going to come up very quickly with ChatGPT. ChatGPT in general can explain, when you ask, explain it to me what the last answer is or is meant to do. But checking it is a different type of piece because you cannot use ChatGPT check many times, you can make it hallucinate. Not as often as it may otherwise by restraining and making sure that you design your queries so that it's well restrained. For example, this one parameter called temperature, that if you set it to zero, will only give you answers that's 100% sure are correct. In other words, that answer is somewhere in one of the text stories. That's still not a guarantee, but yet we live with it. A lot of scientific papers are not of the best quality and that has been proved. So we live with uncertainty and we may need to check multiple sources here and there. GPT4 can give you sources. So you can go and check and make sure that yes, indeed, that answer jacks with what people already know. But in order to create guardrails to keep a generative AI in general not just ChatGPT, Dall E and others from going off the rails, you need two things. You need a set of rules of policy that keep you within the boundaries and have it as an expert outside that reads the answer. Now, this means cannot give you the answer word by word because it needs to check the whole answer before giving it to you to make sure it is worth. This will add additional time. So that's a consideration. You don't get your answer, you may want to go for coffee and come back all right. But you have an independent check on the answer. Make sure that it jives by all the guardrails that you set up. And the second piece is a plan. What do I mean by a planner? Basically something that will say, okay, we have these facts and they want to know if we can meet these goals. Starting from those facts and creates a plan and makes sure every step of the plan abides by all the rules. Let me give you a small example. The cannibals and missionary problem crossing the river.
I don't know. Oh, cannibals and missionary. I think I might have heard with different people crossing the river. But go on, tell the story.
It's a famous problem. It never happened, but it's three missionaries and three cannibals on one of the river's margins with the boat on that margin of the river. And basically, if you at any time had either in one of the margins or in the boat itself, more cannibals than missionaries, the missionaries will be gone after a while. So you had to solve the problem by always keeping them in equal numbers, both cannibals and missionaries, or more missionaries than cannibals. And imagine that you were to draw all the different ways in which this can happen. You start with three, three and one margin. In other words, six people in one margin. And with an empty boat on that margin. One possibility is that the boat is in the other margin. So game mode, they can't do anything. But other possibilities lead to situations where you have more cannibals than mishma. So imagine you have all the possibilities you cross out every time the rule is violated. So you prune the tree and you use that tree to make the plan. You are guaranteed that you always succeed because all of the dead ends have been cut out of the clan. Now this is a very simple problem to solve. But what happens if the possibilities are basically endless and you do not know how it's going to progress? Like in a game of chess, there are so many possibilities, it's inconceivable that you could account for them all and prune all the ones that are wrong. So you need set up a dynamic policy that calculates everything, maybe two or three moves ahead from any point. Okay. And then you proceed according to the answer by that policy. In other words, you prune just a small part of the tree and then you prune again at the next step, and so on. Okay. We would need to do something like this in ChatGPT to keep it from hallucinating and taking it in the wrong direction. You also need a causal engine or model that for example, says, okay, certain things are impossible because of natural laws, so that you can also use that as policy criteria because you need to check for breaking natural laws when you do things. Of course it will be terrible if you are interpreting, for example, a science fiction novel or fantasy novel because it would violate. But you could have your own rules in an imaginary world saying this is valid and this is not valid and then have it interpreted accordingly. Okay, that's one of the big advantages. But if we were to implement a combination of these, I believe that we could keep ChatGPT within reasonable boundaries and it will not take you off in that one chase at least.
No, that was a lot to take in. Let me make sure I've understood this. So you're saying that if we use say, ChatGPT as, or another large language model as part of a bigger AI system where you would have some sort of like chess engine type thing where you are pruning decisions in order to limit the scope and also maybe have some kind of factual engine, I don't know, maybe something based on data like WolframAlpha or even like just some sort of checking of like fact checking thing, then that would provide a better AI experience. Is that correct?
Yes.
All right, brilliant. Okay, I think you've just solved the problem of AI. That's brilliant.
Well, no, it's going to be quite a test. This is no easy solution come up with it, but it's worth it. There have been attempts to creating rules of cause and effect to interpret the world, but it's too complex to be capturing full. But you might be able to do it for specific domains and it's worth it because then the feedback you get from an engine like ChatGPT will be surely reasonable and possible and it will obey the rules that you set up. That would be. Or it will tell you it's impossible. It will explain why.
I think I see how this leads back to chatbots, because in a chatbot situation you really want it to be constrained to the answers it's giving you. And so having less freedom is often better in a business situation than having a really broad AI that can say anything.
Because also there is this tendency of people, even people working with chatbots saying oh, if they only throw more facts into the equation to train the engines like chat GPT, another emergent property, all of a sudden will gain reason. If you feed it crap, it will learn it. Okay? And we'll take it for granted and we'll say, well, something marvelous happened and then all of a sudden you were in A and you are in B where you wanted to be because of this match. That makes no sense. So depending on the problem, you need to constrain it to the right domain and then come up with the rules, the cause and effect rules, and the planning engine that will allow you to go from A to B within that context.
Fantastic. Before we wrap up, do you have any final advice for any organizations wanting to adopt generative AI?
Well, they shouldn't get as much experience upfront as possible to avoid going in a wild chase. The researchers now, they are well trained, but they don't have that level of real life experience. They haven't had multiple failures like we all have and learn from them more than successes. And to know what to avoid and what to go for and tell their, the companies they work for, these may lead you nowhere. It's not a guarantee and be listen to as well. So if you can tell a client, no, I've done that three times and against my advice, it hasn't worked. Not that I don't make mistakes, I still do, but I make different mistakes.
All right, brilliant. It's nice to know that everyone makes mistakes regardless of how much experience they have. So thank you very much for coming on the show, Joaquin. I hope you enjoyed the experience.
Thank you.
It.
More from Richie
#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota
#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon
#356 The Forecast for Time Series Forecasts with Rami Krispin, Senior Manager of Data Science at Apple
#355 AI's Impact on Databases with Shireesh Thota, CVP of Databases at Microsoft
#354 Beyond BI: Decision Intelligence with Graphs with Jamie Hutton, CTO at Quantexa
#352 AI Agents at Work: What Actually Breaks (and How to Fix It) with Danielle Crop, EVP Digital Strategy & Alliances at WNS
#351 Will World Models Bring us AGI? with Eric Xing, President & Professor at MBZUAI
#350 How to Make Hard Choices in AI with Atay Kozlovski, Researcher at the University of Zurich
#349 From AI Governance to AI Enablement with Stijn Christiaens, CEO at Collibra