What are some examples of delimiters that can be used in ChatGPT/AI prompts?
Delimiters are special characters or sequences of characters used in ChatGPT prompts to separate different parts of the input or provide additional context and instructions to the model. Here are some common examples of delimiters that can be used in ChatGPT prompts:
1. Triple Quotes (“”” or ”’)
These are commonly used to enclose text that needs to be treated differently, such as code snippets or specific examples. For instance:
“`
Summarize the text enclosed within triple quotes:
“””
This is a sample text that needs to be summarized by ChatGPT.
“`
2. XML Tags (`
XML-style tags can be used to mark different sections of the prompt or to indicate specific entities or instructions. For example:
“`
“`
3. Angle Brackets (`<>`)
Angle brackets are often used to indicate input and output, or to separate different parts of the prompt. For example:
“`
The quick brown fox jumps over the lazy dog.
“`
4. Pipes (`|`)
Pipes can be used to create lists or separate options. For example:
“`
Suggest three tourist attractions in |London|Paris|Rome|.
“`
5. Brackets (`[]`)
Brackets can be used to define placeholders or variables in the prompt. For example:
“`
Generate a [number] word story about [topic].
“`
6. Colons and Semicolons (`:` or `;`)
These can be used to separate instructions or components within the prompt. For example:
“`
Task: Summarize the following text; Text: […]
“`
7. Special Characters (`#`, `@`, `%`, etc.)
Unique special characters can be used as delimiters to signal specific instructions or sections of the prompt.
It’s important to note that the effectiveness of delimiters may vary depending on the specific use case and the model’s training. Additionally, some delimiters may be more prone to potential prompt injection attacks, so it’s essential to validate and sanitize user inputs when using delimiters in production applications.
mai 19, 2024