What is a system prompt?
A System Prompt is a type of prompt used to guide how Large Language Models (LLMs) generate text by setting the overall context and purpose for the model. It is considered one of the three distinct but sometimes overlapping types of prompting techniques discussed, alongside contextual and role prompting.
Here's a breakdown of what the sources say about System Prompts:
- Primary Purpose: The System prompt defines the ‘big picture’ of what the model should be doing. It serves to set the model’s fundamental capabilities and overarching purpose. The name 'system prompt' stands for 'providing an additional task to the system'.
- Instructions: It provides high-level instructions for interacting with users. System prompts are useful for generating output that meets specific requirements, such as generating a code snippet compatible with a specific programming language or returning a certain structure.
- Examples of Use:
- Specifying additional information on how to return the output.
- Classifying movie reviews and instructing the model to only return the label in uppercase.
- Returning output in a specific format like JSON. Returning data in JSON format can help force the model to create a structure and limit hallucinations.
- Controlling output for safety and toxicity, for example, by adding an instruction like ‘You should be respectful in your answer.’.
- Distinction and Overlap: While distinct in primary purpose, System prompts can have considerable overlap with role and contextual prompting. For instance, a prompt that assigns a role can also include a context. However, the System prompt's main function is to define the model's core purpose, whereas a contextual prompt provides immediate, task-specific information, and a role prompt frames the model's output style and voice by assigning an identity.
- Availability: It's noted that not all models have this System prompt feature.
In essence, the System prompt acts as an initial configuration layer for the LLM, providing foundational instructions that guide its behavior and output style for a particular interaction or application.