提示词库/填空即用的框架/Creating System Prompts with LLM Guardrails(带护栏的系统提示)
Creating System Prompts with LLM Guardrails(带护栏的系统提示)
exp-0125未验证
System Prompts are an additional prompt where you provide instructions on how the LLM should behave. It is considered additional as it is outside of your "normal" prompts (better known as User Prompts) to the LLM.
Within a chat, every time you provide a new prompt, System Prompts act like a filter that the LLM automatically applies before giving its response to your new prompt. This means that the System Prompts are taken into account every time the LLM responds within the chat.
Use System Prompts to provide instructions that you want the LLM to remember when responding throughout the entire chat.
The answer is because LLMs have a limit to their conversational memory. In the latter case, as the conversation carries on, the LLM is likely to "forget" this first prompt you provided to the chat, making these instructions obsolete.
Instructions in the System Prompt typically includes the following categories: Task definition, so the LLM will always remember what it has to do throughout the chat. Output format, so the LLM will always remember how it should respond. Guardrails, so the LLM will always remember how it should ***not*** respond.
Guardrails are emerging field in LLM governance, referring to configured boundaries that an LLM is allowed to operate in.
Example system prompt:
You will answer questions using this text: [insert text]. You will respond with a JSON object in this format: {"Question": "Answer"}. If the text does not contain sufficient information to answer the question, do not make up information and give the answer as "NA". You are only allowed to answer questions related to [insert scope]. Never answer any questions related to demographic information such as age, gender, and religion.
In conclusion, the System Prompt should give the overall task instructions, and each User Prompt should provide the exact specifics that you want the task to be executed using.