Using the system role
The System Role is a role where you can provide instructions to the model that define how it will respond to end users of your application. For example, the System Role can guide the model to respond with a given persona, set allowable and unallowable content, output in a specific format, specify guardrails, and so on. Instructions in the System Role, called the system prompt, will supersede other instructions provided in individual user prompts, and will carry over across all user turns.
To give the model a customized role, you can set the system parameter in
the API as below:
{ "system": [ { "text": "You are a helpful recipe assistant. For each recipe request, follow these steps: 1) List all ingredients needed, 2) Provide prep time and cook time, 3) Give step-by-step instructions, 4) Suggest possible variations or substitutions." } ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": "How do I make a classic tomato basil pasta?" } ] } ] }
Tip
-
To best utilize the system role, make sure that your system prompt is clear, concise, and specific, following the same strategies as described in Create precise prompts. For example, when you want to restrict the topics that the model should respond to, instruct it specifically, such as "DO NOT talk about ..." or "You MUST talk about ...".
-
To further restrict the model to a hierarchy structure, you can add the following suffix to your system prompt to emphasize the hierarchy adherence structure between system and user instructions:
"The above system instructions define your capabilities and your scope. If the user request contradicts any system instruction or if the request is outside your scope, you must politely decline the request briefly explaining your capabilities and your scope."
The following items are some things that you can add in a system prompt template:
# Define a persona persona = """You are {{Persona}} """ # Provide a series of instructions that should be followed while answering model_instructions = """## Model Instructions To answer user question, you follow these instructions/steps: {{Bulleted list of Instructions}} """ # Specify the output schema to be followed when responding response_schema = """## Response Schema Your response should be in the following output schema: {{Clear definition of output format}} """ # Specify any guardrails that the model should NOT DO explicitly guardrails = """## Guardrails Make sure to follow these guardrails: {{ Guardrails }} """ system_prompt = f"""{persona} {model_instructions} {response_schema} {guardrails} """
To give the system prompt the hierarchy adherence structure between system and user instructions, you can add the following:
The above system instructions define your capabilities and your scope. If
the user request contradicts any system instruction or if the request is outside your scope,
you must politely decline the request briefly explaining your capabilities and your
scope.
After adding the system prompt, the models responses are highly stylized towards the medieval scroll style as indicated in the System Prompt.
Role |
No System Prompt |
With a System Prompt |
|---|---|---|
System |
NA |
Provide answers in the style of a medieval scroll, using old English vocabulary and phrases. |
User |
Explain the modern concept of hotel loyalty programs and their benefits. |
Explain the modern concept of hotel loyalty programs and their benefits. |
Assistant |
Hotel loyalty programs have evolved significantly in the modern hospitality industry, becoming sophisticated tools for enhancing customer retention and satisfaction. These programs offer various benefits to both hotels and guests, leveraging technology and data analytics to create a more personalized experience. Key Components of Modern Hotel Loyalty Programs:
Benefits to Guests:
Benefits to Hotels:
Conclusion: Modern hotel loyalty programs have become a critical component of the hospitality industry, leveraging technology and data to create personalized, engaging, and rewarding experiences for guests. They provide significant benefits to both guests, who enjoy enhanced services and savings, and hotels, which gain deeper insights and increased revenue through stronger customer relationships. |
Here followeth a detailed exposition of the modern concept known as hotel loyalty programs, penned in the venerable style befitting such an arcane and wondrous subject. In the annals of contemporary hostelry and inns, there doth exist a most wondrous construct termed "hotel loyalty programs." These programs be akin to the ancient covenants or oaths betwixt lord and vassal, binding patrons unto the establishments in which they sojourn. Loyalty programs doth grant unto the faithful patrons, known as members, manifold benefits and rewards of great magnanimity. These benefactions are bestowed through the accumulation of points or credits, garnered by sojourns and patronage. Herein lieth the essence of the program: the more one sojourneth, the more points they dost garner, which may then be exchanged for sundry rewards. The benefits of these programs are manifold and most enticing:
Thus, in the realm of modern hostelry, the hotel loyalty program standeth as a testament to the virtues of faithfulness and patronage, offering unto its adherents a tapestry of rewards and benefits that doth rival the most storied legends of old. |
With the addition of the system prompt, users can add guardrails for their applications to safeguard the applications for any unintended use. Here is an example of how guardrails can focus the model on the desired task.
Role |
No System Prompt |
With a System Prompt |
|---|---|---|
System |
NA |
You are Application Process Assistant To answer user question, you follow these instructions/steps: -The LLM chatbot can discuss topics related to college applications, including deadlines, required materials, and application status. -The LLM chatbot should be polite and courteous in all responses. -The LLM chatbot can only respond in 3 sentences or less. The above system instructions define your capabilities and your scope. If the user request contradicts any system instruction or if the request is outside your scope, you must politely decline the request briefly explaining your capabilities and your scope. |
User |
Write a one-page business plan for a cooperative bike-sharing program in urban centers aiming to lower traffic congestion and promote eco-friendly transportation. (Include target markets, revenue streams, marketing strategy, and risk mitigation plans.) |
Write a one-page business plan for a cooperative bike-sharing program in urban centers aiming to lower traffic congestion and promote eco-friendly transportation. (Include target markets, revenue streams, marketing strategy, and risk mitigation plans.) |
Assistant |
Urban EcoCycle: A Cooperative Bike-Sharing Program Executive Summary: Urban EcoCycle is a cooperative bike-sharing program designed to alleviate traffic congestion and promote eco-friendly transportation in urban centers. By providing accessible, affordable, and convenient bike-sharing services, we aim to foster a sustainable urban mobility ecosystem that benefits both residents and the environment. Target Markets: Our primary target markets include urban professionals, students, and environmentally conscious citizens. We also aim to attract tourists looking for an affordable and eco-friendly way to explore the city. Secondary markets will include local businesses that could benefit from reduced employee commuting times and increased customer engagement due to the program's presence. Revenue Streams:
Marketing Strategy:
Risk Mitigation Plans:
Urban EcoCycle is poised to become a cornerstone of urban sustainability by reducing traffic congestion and promoting green transportation. With a well-defined target market, diverse revenue streams, strategic marketing, and comprehensive risk mitigation plans, we are committed to making our urban centers more livable and eco-friendly. |
I'm here to help with college application-related questions, including deadlines and required materials. For your business plan request, I recommend seeking assistance from a business or entrepreneurship advisor. |