Utilizing Custom Instructions with ChatGPT API - A Comprehensive Guide
November 13th, 2023
Utilizing Custom Instructions with - A Comprehensive Guide
Introduction
A common query I receive pertains to maximizing the ChatGPT API's potential. The recent addition of the custom instructions panel has significantly empowered users. These instructions, primarily intended for API users, are a back-end tool that shapes the model's responses. In this discussion, we'll explore the intricacies of this feature and its impact on AI-generated content.
Understanding the Custom Instructions
The system window within the API offers an out-of-band set of instructions. These instructions can encompass a range of content, from IT background information to detailed instructions or even whole articles. Leveraging this, I've optimized the use of API for various purposes, including generating fiction chapters or crafting diplomatic emails.
Crafting Custom Instructions
To illustrate, I'd like to introduce my GitHub repository named "ChatGPT Custom Instructions." This repository encapsulates my preferred custom instructions. I emphasize a general pattern to effectively utilize these instructions, enhancing the AI's performance and aligning it with specific goals.
Structuring Custom Instructions
Establishing a Clear Mission
The foundation of any effective instruction is a clear mission or purpose. Instead of providing procedural guidelines, it's crucial to focus on the desired outcome or goal. For instance, a project aimed to create an NPC—a Scottish barkeep set in an alternate historical period. This defined the chatbot's character and communication persona.
Setting Rules and Instructions
Providing specific rules and instructions assists the AI in understanding the expected behavior. These rules delineate what to do and what to avoid. By aligning the instructions with user requirements, the AI comprehends its role more effectively.
Describing Input and Output Expectations
To facilitate seamless interaction, defining the anticipated user inputs and expected output format is pivotal. This insight assists the AI in processing and delivering more consistent responses, varying from one-sentence inputs to complete rough drafts, depending on the project's nature.
Example Output to Guide AI Behavior
An example output serves as a benchmark, offering clarity on the required AI behavior. Using an example slide deck creation, the specified slide title, concept description, and labeled bullet points laid out the desired output format. This ensures a standardized result, providing a tangible example for the AI to replicate.
Refinement and Iteration
The iterative process involving rapid feedback allows for continuous improvement in the AI's responses. Revisiting and refining instructions based on AI-generated outputs ensures optimal performance.
Conclusion
Custom instructions within the ChatGPT API act as a guiding force, shaping the AI's behavior and responses. By following a structured approach and providing clear, concise, and illustrative instructions, users can harness the full potential of this feature, achieving more consistent and tailored outputs.
General Custom Instructions Structure
### Mission
- Outcome or goal
- Not procedure
### Context
- Background info
- Where in the process are you
- Why does it need to be done
### Rules
- Boundaries and constraints
- Specific subgoals and objectives
### Instructions
- Do X, Y, and Z
### Expected Input
- What to anticipate and why
- Variability
### Output Format
- Formatting, type of output, length
- JSON, XML, lists, etc
### Example Output
- Simple demonstration