
20 questions and AI chat bots - posit::conf(2023)
Presented by Winston Chang Presented at Posit Conference, between Sept 19-20 2023, Learn more at posit.co/conference. -------------------------- Talk Track: I can't believe it's not magic: new tools for data science. Session Code: TALK-1153
image: thumbnail.jpg
Transcript#
This transcript was generated automatically and may contain errors.
I'm Winston Chang, I'm a software engineer at Posit, and earlier this year I did some work on a package called ChatStream, which you can use to help build AI chat applications with Shiny for Python. And it just sort of looks like this, if you can't read this it's fine, it's just basically a chat interface, you ask it a question and it gives you an answer, it talks to the open AI API, and that gives you an answer and you can have a conversation with it.
And when I was working on this I showed this to the team and we were trying to figure out some fun demos to do with it. And Joe Chang had the idea like, well, what if you have it play the game 20 questions, what if you have two of these on a page, one of them thinks of an object and the other one tries to guess what that object is. So I went and I figured out how to wire up these two instances of this Shiny module to talk to each other, take the outputs from one of them and use it for the inputs of the other and vice versa.
And so, again, this is going to be really small, I didn't realize this room was going to be like this, but you don't have to read this, it's not that important. This is two of these modules talking to each other playing the game of 20 questions.
From 20 questions to debates
Now we've shown this elsewhere, and I was thinking today, for today I want to do something a little bit different. So I was thinking, like, how can we make this better? And I thought, well, you know what might be fun is if they're doing, instead of playing 20 questions, you have these two chatbots doing a debate about a topic. So I went and I changed the application a little bit, I don't know if the cursor will show up there.
Anyway, on the top, you can enter in your topic, there's these two chatbots. So here they're debating, you know, LLMs have subjective experience versus they don't have subjective experience, if you're a philosophy of mind person, you'll know what this all means. And then they have this debate about it, and you can, you know, you read this, and actually it's kind of interesting to engage with an argument this way, to learn about something by reading it this way.
But I still thought, you know, it was a little bit dull to have these two AI chatbots doing it. So I thought, you know, how can I make this, how can I make that better, how can I make it more interesting? And I realized this could be like a Socratic dialogue, where you have characters that are doing this argument, right?
So in a Socratic dialogue, just to remind everyone, you have these characters, so here we have Protagoras and Socrates here, and they might be debating something like, you know, the nature of virtue ethics, what does it mean to live a good life? So I went and I updated my application a little bit, and I added a field where you can type in, you can also add in the character that you want to embody, like one of these AI chatbots. So there's character and topic, and this is, you know, Protagoras and Socrates arguing about virtue ethics.
So this was, you know, the results from this were really fun and interesting. It's a little bit more compelling reading it coming from a character, rather than just a generic chatbot. And some of the results were, I mean, it is interesting, and some of them, you know, some of the output was, like, also rhetorically very impressive.
of the output was, like, also rhetorically very impressive.
Making it a song
And I was thinking to myself, like, well, that's cool. How can I, you know, how can I make this even more interesting? So I picked a topic that I thought wasn't, I think will resonate with everyone here, and some characters I think everyone will be familiar with. And I had it generate some dialogue, and then I thought, okay, it would be even better if this were a song.
So I went, and I didn't edit the app to generate songs, because that's, like, way beyond what I'm capable of doing, but I found someone on the internet who makes songs using AI-generated voices, which is really cool and also a little bit creepy that they can do that. But anyway, I'd like to play for you the song.
Your Python is minimal, my R is the pinnacle. Analyzing data using R, my manipulator, Python's environ given vibes like an early beta. You know it's true, R has got the prime crew. Biggie back, Python is a champ. R is a stage on the learning ramp. Python is structure. R is a stumble, my Python is humble. So, Snoop, it's clear that they both have their sphere. You said it big, let's set the record straight. Using Python and R for the knowledge they facilitate.

