Python-bloggers

Did you ask ChatGPT about who you are?

This article was first published on T. Moudiki's Webpage - Python , and kindly contributed to python-bloggers. (You can report issue about the content on this page here)
Want to share your content on python-bloggers? click here.

It all started with a bug in Python package BCN (BCN, for Boosted Configuration neural Networks), that I tried to solve with the traditional (and still efficient) tools for the job: search engines querying and Stackoverflow. Interested in learning more about BCNs? You can read this post and this post.

Python package BCN is currently built on top of R package BCN, thanks to rpy2. The bug was caused by a problem in converting numpy arrays to rpy2 objects, and the answers that I got using search engines and Stackoverflow lead me here. That wasn’t enough though. I still needed to find a way to convert a Python dictionary to an R list in rpy2, and assign a class to that R list (don’t worry about the jargon, it won’t prevent you from reading the remainder). Perfect moment to try calling OpenAI’s ChatGPT to the rescue; jumping into the bandwagon.

I remember when I talked to a colleague about OpenAI 6 years ago, in 2017. Back in the days, OpenAI said: “what is the best thing we can do to ensure the future is good? We could sit on the sidelines or we can encourage regulatory oversight, or we could participate with the right structure with people who care deeply about developing AI in a way that is safe and is beneficial to humanity”. Later on, I also found mentions of OpenAI in the “Deep Learning” textbook: “Ian Goodfellow is Research Scientist at OpenAI” and “Elon Musk, cochair of OpenAI (…)”. I still had no precise idea of what they were trying to achieve eventually, even if it sounded exciting, considering the people involved. Since then, the people that I cited left the project, OpenAPI has released the mighty ChatGPT among other tools, and has given up on the “open” part. Dangerous tool? Why? For whom? Worried about competition?

Signing up for using ChatGPT is straightforward. You’ll need to provide a valid email address and a phone number (more secure, 2-factor authentication). Still trying to solve my bug, I decided to ask ChatGPT how I could convert a Python dictionary to an R list in rpy2. Here’s what it said:

Then, I wanted to know how to assign an R class to an rpy2 object (R list). Here’s what I got:

To me, even though it’s a small example, this was truly amazing. Fast, clear, and precise. StackOverflow would still win in areas such as a transparency on how answers are built: identified people publish questions, other people give their answers to these questions, and there’s a vote for the best answer. It would be interesting to see ChatGPT citing its sources in the future, for those who want it. Well, with that being said, the bug was solved and you can use version 0.5.1 of Python package BCN. For now, you can install version 0.5.1 from a GitHub branch:

pip install -U git+https://github.com/Techtonique/bcn_python.git@numpy-conversion

Here’s a notebook containing examples of use. Starting on Tuesday (April, 18), as the branch will be deleted, you’ll use directly:

pip install BCN

Armed with my enthusiasm after solving the bug, I wanted to ask ChatGPT a LOT of questions:

You can try these too. The syntax in responses is great; even better than some human beings. The structure (using paragraphs) is great too. I appreciated the nuanced responses given to some of these difficult questions. The best parts of ChatGPT’s responses in our conversation are summarized below:

Definitely thoughtful responses in there. How about asking ChatGPT who I am?. Hopefully, it wouldn’t retrieve some sensitive information from I’m-not-sure-where. Here we go:

I definitely love the “highly skilled” part of the response. Not just “skilled”, but “highly skilled”. Thanks, robot mate. Probably the nicest thing I’ve heard about me in the past few years, besides “you should consider modelling” with two l’s. Ha ha. Some parts of the response, however, made me raise my eyebrows because answering them is about information retrieval. No sophisticated model required. I’ve actually got my PhD in Actuarial science from University Lyon 1, not from Université Libre de Bruxelles. Never contributed to scikit-learn or mlr. Never heard of stagedml or pairwise_distances. Here is what I created. Never worked at Dataiku; the only interactions that we’ve had are:

I’m curious to know about how ChatGPT created this response. That’s where a paper about the algorithms involved, in addition to citing its sources, could be useful (if open sourcing is not an option). I’ve tried to correct ChatGPT:

Interestingly, when I ask it again who I am, now using “T. Moudiki”, it knows that T. Moudiki is Thierry Moudiki, and deletes references to Dataiku. It’s really a conversation.

But what if several people (that are not you) give wrong answers about your resume? Will ChatGPT think that they’re true, and change its mind as easily as it did it here? This is a reminder that ChatGPT is based on a model; a representation of reality. It will become better with time (not perfect, and it’s OK), notably due to trustworthy user feedback, where trustworthy is yet to be defined… Did you ask ChatGPT about who you are?

To leave a comment for the author, please follow the link and comment on their blog: T. Moudiki's Webpage - Python .

Want to share your content on python-bloggers? click here.
Exit mobile version