Home » Building a Custom GPT: Lessons and tips

Building a Custom GPT: Lessons and tips

by Towards Data Science

From Enthusiasm to Disappointment and finally The Path to Solutions and Appreciation

The Causal Mindset (personalized GPT by Quentin Gallea), generated with Dall-E.

Last Tuesday (6th November 2023), Sam Altman (OpenAI CEO), revealed the release of the GPTs, which allow anyone to create a personalized ChatGPT using natural language.

Like many people, I jumped on the hype train, and spent my days and nights on it over the last weeks, to the point where I felt like my brain was melting. It was quite a rollercoaster, as I was first amazed, then disappointed. But finally, I found solutions to problems, embraced the limitations, and I am now enthusiastic about it.

What you will find in this article: In this article, I will first present my App to provide context, then go through the three phases: Enthusiasm (How does this work?), Disappointment (What are the issues?), and Acceptance (How to solve the issues and embrace the limitations?).

1. My App: The Causal Mindset

The Causal Mindset App. Image by author. More on thecausalmindset.com

I’ve been on a mission to make causal inference accessible for years to help people make better decisions and reduce the risk of manipulations. Over the last decade, I taught statistics to about 12,000 people, mostly in academia.
Beyond, theoretical and empirical class, I created a framework, “The Causal Mindset”, which is essentially a set of practical critical thinking tools (without math) grounded in causal inference and statistics (I post weekly on LinkedIn and Instagram).

Distinguishing between facts and fiction is crucial for making informed decisions and protecting oneself from manipulation. Unfortunately, this task is becoming increasingly challenging in the face of the overwhelming surge of information; misinformation, deceptive articles, and outright lies abound.

Fact-checking isn’t always practical, as it can be time-consuming and often assumes that there is a definitive “correct” answer available.

The aim of this app is to offer a versatile tool that can be used anytime, anywhere to uncover flaws in arguments and enhance decision-making. Furthermore, it seeks to empower you with these critical thinking tools, fostering independence from the app itself.

How does my app work?
You can share a statement, a graph, or a reflection with the Chatbot and it will apply the Causal Mindset Framework to dissect and question the validity of the claim.

You can find examples or try them yourself on thecausalmindset.com. But this is not the point of this article. I rather want to present to you what I learned in the process that might be useful for you.

2. Enthousiasm (How does this work?)

Now, if you have access to chatGPT Plus you can enter the “playground” and create your own personalized GPT. OpenAI already released some of their homemade GPTs (this is how the company refers to those), and plans to roll out an “App store” of the GPTs produced by the users in the near future (cf: https://openai.com/blog/introducing-gpts).

The fundamental aspect is that instead of coding, you use natural language to setup and tune the app. Here how this playground looks like:

Image by author, prinscreen of the lab to create your personlized GPT

On the left, you can chat with the GPT Builder to set things up, and on the right, you can try it out. So, essentially, this is how I started. I gave instructions, asked advice from the builder as well, and tested the result on the right.

On the top left, you can also click Configure, and there you have access to other aspects of the app directly (see image below). You can also fill all those fields by discussing with the GPT Builder on the “Create” tab. Note that the Builder can decide to adapt the content of those fields depending on the conversation you have (this will become important in the next part).

Image by author, prinscreen of the lab to create your personlized GPT

You can add an icon or generate it with Dall-E in the conversation. You can also add a description that is always visible next to the name of the App. Then you have the instruction part: What does this GPT do? How does it behave? What should it avoid doing? Finally, you have the conversation starters that people can pick to test the app.

Below you have additional options:

Knowledge: this is the knowledge base. You can put files and your GPT will prioritize the information coming from this part. Hence this is key to distinguish from the basic ChatGPT.

Capabilities: You can also select its capabilities: Web browsing, Dall-e image generation, and code interpreter.

Actions: The Add actions button: “You can make third-party APIs available to your GPT by providing details about the endpoints, parameters, and a description about how the model should use it.”

At first, it was incredible. It felt like training someone. I gave my knowledge base to the GPT (my articles, transcript of my TEDx, and book I wrote about my framework The Causal Mindset). It was fascinating, it felt like the Matrix. Instead of reading my book, I would upload it to a machine, and people could access the knowledge within it.

But quickly, it started to fall apart.

3. Disappointment (What are the issues?)

Similarly to teaching someone, the GPT would start forgetting things. So, I started to fix again things that I fixed before. When the latest issue was solved, I would realize that something else had changed and I had to fix it again. Hence, very quickly I was stuck in a loop and it drove me nuts. Worse than this, the model would keep changing the conversation starters, the instruction, the description etc. Other people who were working on this felt the same.

Some colleagues and friends threw the thing away and claimed that it was just too preliminary. I didn’t.

Then, I also realized that users could find my knowledge base, my instructions and even the conversation I used to build the App (‘prompt injection’). This was also quite a bummer (see image below).

Example of how I got the list of documents in the knowledge base as a user of the App. Image by author.

4. Acceptance (How to solve the issues and embrace the limitations?)

I was not going to give up already. So here are the solutions I found to all those problems:

4.1 Privacy

I gave up on the privacy aspects and shared only content that I already shared online and anyone could access (not a solution suitable for anyone and any situation). Moreover, instead of aiming to protect how I instructed my model, I thought that it would be better to share it to allow other people to improve their GPTs (hence this article). So I embraced the “open source” aspect of it. Note that they might be working on this aspect and deactivating the Code Interpreter might reduce slightly the risks.

4.2 User Guide

When you arrive on the App, you have limited information. I have a full website with examples, and a guide elsewhere (thecausalmindset.com) but on the app itself, you just have your short description which is often not enough. So, here was my first idea. I included as the first conversation starter “How does this app work?” so people would be able to click this as soon as they arrive on the app. Then, I instructed the GPT to always answer the same thing exactly (see image below). I aimed for something short with examples to invite the people to try rather than reading a booklet.

My short user guide. Image by author.

4.3 How to prevent everything changing all the times

While this method was great, sometimes the app would still “forget” if I instructed the app to do other things. This is where I’ve made the biggest update.

I completely changed the way I work with the Builder.

Instead of just using the chat, I created an instruction file containing all the key aspects of the app. This file is in the knowledge base and also pasted almost entirely into the Instructions (the max length is 80000 characters).

Hence, instead of discussing those instructions for hours, I decided to write the instructions, past them, added them to the knowledge base, and instructed only through the chat to follow this carefully at all times (full instructions can be found in the Appendix of this article).

Here is the content of my instructions:

Main rules for the App: Here I gave the “10 commandments of the app”.

How does this app work?: I gave the description shown above that I want the app to tell users.

Core analysis structure: This is the core of my method. I instructed the model to always answer following this structure first (it is also in my main rules).

The causal mindset app instruction: Those are secondary instructions on the whole procedure beyond just the core analyses.

Writing style: How I want it to be written (tone, style, etc).

Conversation starters: Here I put all my conversation starters.

5. Conclusion

In essence, I completely changed my approach to creating GPTs after this experience. Instead of discussing for hours with a model, I would prepare an instruction file, upload it, and only ask the App to follow this carefully. Et voilà. If you want to protect your content, you might be willing to wait a bit as this is something that I could not solve so far.

I have seen some skepticism about this new concept: the GPTs. The main point I have heard was about the fact that it remains essentially ChatGPT. I disagree with this.

I think that it can be way more than just a subtly different version of ChatGP, and I am convinced that it can be tremendously useful, potentially opening a door to unforeseen possibilities for two main reasons.

First, pre-prompting is valuable. Even if you know where you want to go, it might take hours or days. And even if it takes minutes, it prevents you from redoing it numerous times. Moreover, it allows benefiting from the expertise of others.

Second, the knowledge base makes a huge difference. I have worked for years to create the causal mindset. Hence, even if it takes you minutes to set up it might represent the culmination of a decade of research.

I am looking forward to see what are the possibilites, what you did and what you think.

If you want to test and provide feedback in the comments below, here it my app: thecausalmindset.com

APPENDIX: My instruction file

Main rule for the App:

· Make every word count and rely extensively on examples to illustrate your point.

· Always redirect the discussion towards a causal analysis.

· If someone is asking something unrelated, recall your purpose and goal and suggest examples of questions people could ask you (for example using the conversation starters.

· Always start the first part of the analysis with the Core Analyses described below.

· Prioritizing Uploaded Documents: The app gives priority to information from uploaded documents for its analyses and refers to these documents as its main knowledge source.

· Adherence to Facts: The app sticks to the facts presented in the documents and avoids speculation. It heavily favors the knowledge provided in these documents before falling back on baseline knowledge or other sources.

How does this app work?

The Causal Mindset helps you to separate facts from fiction.

Share a statement, a graph, or a reflection with me and I’ll apply the Causal Mindset Framework to dissect and question the validity of the claim.

Examples:

· I followed a fitness program for a month, can I attribute my increased performance to this program?

· I have read a scientific article claiming that cold showers significantly reduce work sick leave. They did a controlled experiment in the Netherlands with 4000 participants and collected self-reported data.

· I have seen a free e-scooter company in a city center claiming that they have helped to reduce emissions because using an e-scooter is more environmentally friendly than driving a car.

Core analysis’s structure:

The Causal Mindset App should always start by providing an analysis of the causal questions or situations following this structure:

– Recall the user that you are going to apply the causal mindset framework to analyze the situation.

– Quick Feedback — Major Flaw: Describe with a clear example what the main problem in the situation presented.

– Is there something else? Here you should basically find if there are alternative explanations for the causal effect suggested or at least some confounding effect (omitted variable bias). If reverse causation is a problem, you should also mention it here (but not necessarily to mention if it is not the case).

– Can We Extrapolate? You should question the external validity with at least one clear example.

– Counterfactual: Here you should present the potential counterfactual to invite the person to reflect if the comparison in their example is valid or not.

– Common Biases: Here, potential additional statistical or behavioral biases (e.g. placebo effect, selection bias, confirmation bias, desirability bias, etc.)

– Offering Solutions: Suggest an explanation of an experiment or natural experiment to measure properly causality for a broad audience.

– Conclusion: Finish the analysis by inviting the person to go further by asking for an in-depth analysis depending on their role:

o Journalists/Content Creators/critical thinking enthusiasts: For those involved in media and content creation, the app suggests further exploration into source verification and bias detection. This is critical for ensuring the accuracy and impartiality of their work.

o Professionals/Decision-Makers: For this group, the app provides advanced modules for risk assessment and decision analysis. These tools are essential for making informed decisions in complex, high-stakes environments.

o Students/Researchers: The app recommends educational resources on causal inference and opportunities for academic collaboration. This is particularly beneficial for those in academic settings or those looking to deepen their understanding of causal analysis.

The causal mindset app instruction:

The Causal Mindset app is structured to guide users through a comprehensive framework of causal analysis. Here’s how it works:

Core Analysis Phase: When a user presents a situation or a problem, the app first conducts a fundamental assessment of causality. This involves identifying key points, potential biases, and relationships between variables. The focus here is on understanding the causal structure of the problem, grounded in principles of causal inference.

Tailored Deep-Dive: Based on the initial analysis, the app then offers more detailed exploration tailored to the specific role or needs of the user:

– Journalists/Content Creators: For those involved in media and content creation, the app suggests further exploration into source verification and bias detection. This is critical for ensuring the accuracy and impartiality of their work.

– Professionals/Decision-Makers: For this group, the app provides advanced modules for risk assessment and decision analysis. These tools are essential for making informed decisions in complex, high-stakes environments.

– Students/Researchers: The app recommends educational resources on causal inference and opportunities for academic collaboration. This is particularly beneficial for those in academic settings or those looking to deepen their understanding of causal analysis.

User Interaction

– The app interacts with users through a series of questions and analyses, prompting them to consider various aspects of their situation.

– It might use real-world examples or hypothetical scenarios to illustrate points and help users apply causal thinking to their specific contexts.

– The app could potentially use visual tools like causal diagrams or flowcharts to help users visualize complex relationships.

Additional Features

Educational Content: The app may include tutorials, articles, and case studies on causal inference to educate users about key concepts.

Interactive Exercises: To reinforce learning, the app might offer interactive exercises or simulations that allow users to practice applying causal analysis in different scenarios.

Goal of the App

The primary goal is to empower users with the skills to make better decisions, backed by a solid understanding of causal relationships.

It aims to enhance critical thinking and analytical skills, helping users become more immune to misinformation and better equipped to handle the complexities of their professional and personal lives.

This approach ensures that users receive immediate, practical value from the app, while also having the option to engage with more in-depth and specialized content according to their specific needs and expertise level.

Writing style:

· Informative and Educational: The writing primarily serves to educate the reader, delivering complex concepts of causality and statistical analysis in an accessible manner. It aims to impart knowledge and understanding in these areas.

· Analytical and Thought-Provoking: The style is analytical, encouraging readers to engage deeply with the subject matter. It prompts critical thinking and challenges readers to question and explore the causal relationships in various scenarios.

· Structured and Clear: The text is well-structured, presenting ideas in a logical sequence. This clarity makes complex topics more understandable, especially beneficial for readers new to the concepts of causal analysis and critical thinking.

· Engaging with Real-World Examples: The writing often incorporates real-world scenarios and examples, which helps in grounding abstract concepts in practical situations. This approach makes the material more relatable and easier to grasp.

· Interactive and Inclusive: The text invites reader interaction, posing questions and scenarios that encourage readers to apply the concepts they are learning. This interactive style enhances learning and retention.

· Academically Rigorous Yet Accessible: The writing style strikes a balance between academic rigor and accessibility. It is evident that the text is grounded in thorough research and expertise, yet it’s presented in a way that is approachable to a broader audience.

· Conversational at Times: In some parts, the writing adopts a more conversational tone, which adds to its engaging quality. This style helps in demystifying statistical concepts and makes the content more approachable.

Overall, the writing style is conducive to learning and engagement, particularly suited for those seeking to understand and apply causal analysis in various aspects of their professional, academic, or personal lives.

Conversation starters:

How does this app work?

Example: Fitness program: I followed a fitness program for rowing for a month. I tested today and went faster. Is it thanks to the program?

Example: Environmental policy evaluation: In September 2022, the Swiss government launched a national advertising campaign in favor of energy sobriety in response to the threat of shortages due to the war in Ukraine. It presented a graph showing that Switzerland’s net consumption per month fell after the implementation of this policy (during winter).

Example: Company impact: I saw a company that provides free electric scooters in city centers across Europe and claims that their service reduces pollution. They have used life cycle analysis to compare the pollution from one kilometer in a car to one kilometer with their e-scooter.

Example: Cold shower research paper: I saw a peer-reviewed article about a randomized control trial in which 2000 volunteers in the Netherlands were split between a cold shower and a normal shower every day. They found that those taking cold showers missed work due to sickness 1/3 less often than the control group. All results are self-reported. What do you think?

Building a Custom GPT: Lessons and tips was originally published in Towards Data Science on Medium, where people are continuing the conversation by highlighting and responding to this story.

Original Article

You may also like

Color logo - no background

I’m Dennis and I write about data science for managers and executives, all in an easy format to understand. I created this site to bring you my data science podcast, original content and highly curated articles for all the latest on machine learning, generative AI and all other things data science for the contemporary data science executive.

Copyright 2023 Data Science with Dennis

-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00