February 7, 2023
AI Chatbots, such as OpenAI ChatGPT or Google’s Bard, are conversational artificial intelligence platforms that allows users to ask questions and receive answers as if they were talking to another person. Expect these LLMs to be used for thousands of specific applications, each app refined to give the best responses and formats for the user.
To ensure the best possible experience in any given application, Abiteq proposes a question prompt structuring framework that allows a combination of precise input, ease of use and the best possible response.
In this article, we will take a look at a proposed method for ChatGPT prompt structuring and application presentation for thorough coverage of the application goals and specific wording to get the best answer in the best format for the user.
Proposed ChatGPT Application Prompt Structuring
The proposed method for ChatGPT prompt structuring consists of four stages of prompts presented in the order given:
- Background Prompt
- User Context Prompt
- User Detail Prompt
- User Final Question Prompt
Each prompt type is input using a tabbed, html form with customized text boxes, check boxes and dropdown fields. Optionally, the user prompt types should be audible using speech-to-text recognition. ChatGPT should be prompted to remember each prompt type input separately (by type name) and allow for changes, or additions, to each prompt any time in the conversation.
The Background Prompt information would likely be provided by the Application Author and may be hidden hidden from view. The User Context Prompt detail is for helpful, and needed, application information that rarely changes. The User Detail Prompt information may need to change per application use and should conveniently available.
The User Final Question Prompt entry is for last minute details. It should be visible on the default display, much like the original ChatGPT interface is designed with separate question and answer text boxes.
Prompt Customization Forms
The user and application author can utilize the “Prompt Customization” feature to help provide needed application details to the prompt. This feature allows the author and user to create customized information to be added to the prompt, which can help to better inform the question.
The user can use some combination of natural language explanation in a text box field, and/or use custom dropdown and check box fields to list options of all application details. Or, optionally, feed the text box input with speech-to-text conversion allowing conversational input with the application and ultimately, the chatbot. These prompt forms would be particularly useful for details that do not change for every use of the application. Each of the prompt types would have a separate, tabbed page for this form.
Finally, the user should review their strings and make sure that they are within the token limit. The user should also make sure that the strings are clear and concise, and that the information is organized in a way that is easy to understand.
Proposed User Interface
In addition to the proposed method for ChatGPT prompt structuring and breaking prompts into strings, the proposed user interface includes a desktop computer display with tabs for each of the four prompt stages showing their customized fields and edit features. The default display will include a token limit slider for the answer size, the traditional question and answer text areas, a speech input option for the question, and a human-like, real time avatar for speech output of answers.
Final Flow Process
So the flow would be to build a natural language prompt question by combining the Application Author Prompt, Background Prompt, Context Prompt, User Detail Prompt and Final Question Prompts end to end, formatted as per the application requirements. Each prompt type submitting the information from it’s form as per the fields with values. These type groups would be titled by the Type, so the chatbot van use each type as a variable to be changed or added to later in the conversation.
Example Recipe Builder
If we make a Recipe Builder AI Application, our Prompt Types would be something like this:
- Background Prompt
- Author knows the application is intended for people wanting recipes. Provide variables always needed for this use. Also, provide the formatting including examples.
- “You are a chatbot speaking to the user in their kitchen wanting a recipe. You will refer to them by name in a friendly and helpful tone. You are an expert chef and will present the recipe you find by its short description with a brief explanation, then listing the ingredients with quantities, and finally the cooking procedure. You will use the following information:”
- Context Prompt
- User static input (rarely changes) including registered users using the same application by name (family members), family limitations such as vegetarian and gluten-free diet, we don’t like these ingredients, etc.
- “The recipe should be for this chef as per logged in name, vegetarian only without any tomatoes.”
- User Detail Prompt
- User Variable input, that may vary by recipe request. We have these ingredients, We want this type of cooking style, quantity of people, entree, etc.
- “The recipe should be an entree for four people using leftover chicken, carrots, potatoes and onions cooked in Mexican style.”
- Final Question Prompt
- The final question with refinements such as cooking skills, time to prepare, etc.
- “Can you add guacamole to this recipe?” or “We want a recipe that can be prepared in two hours by a beginner cook.”
Anytime in the conversation, variables can be changed or added. “Can you make the recipe Italian for six people?”
Conclusion
The proposed method for ChatGPT prompt structuring is essential for providing the user with the best possible experience. By utilizing this proposed method and user interface, the author can ensure that the prompts are clear, concise, and organized in a way that is easy to understand by ChatGPT, and thorough enough to achieve the best possible answer from the bot.