Prompt engineering: Worked Example — Experimentation (NVIDIA-Certified Associate: Generative AI LLM)
Prompt Engineering: A Worked Example for NVIDIA-Certified Associate Generative AI LLM Prompt engineering is a critical skill within the...
Prompt Engineering: A Worked Example for NVIDIA-Certified Associate Generative AI LLM
Prompt engineering is a critical skill within the Experimentation domain of the NVIDIA-Certified Associate: Generative AI LLM exam. It involves designing and refining input prompts to effectively guide large language models (LLMs) to produce desired outputs. This worked example demonstrates a step-by-step approach to prompt engineering in a realistic scenario, illustrating the reasoning and concrete actions involved.
Scenario
You are developing a customer support chatbot using an LLM. The goal is to generate concise, polite, and accurate responses to common customer inquiries about order status.
Step 1: Define the Task and Desired Output
Clearly specify what the prompt should achieve. Here, the LLM must:
- Understand the customer query about order status.
- Respond politely and concisely.
- Include relevant order information if provided.
Step 2: Create an Initial Prompt
Start with a simple instruction prompt to test the model’s baseline behavior.
Example Prompt 1
"You are a helpful customer support assistant. Answer the following question politely and briefly: 'Where is my order?'
Run this prompt through the LLM and observe the output.
Step 3: Analyze the Output
Suppose the model replies:
"Your order is being processed and should arrive soon."
This is polite and concise but lacks personalization and actionable details.
Step 4: Refine the Prompt with Context
Incorporate placeholders for dynamic data (e.g., order number, status) to improve relevance.
Example Prompt 2
"You are a helpful customer support assistant. A customer asks: 'Where is my order?' The order number is 12345, and the current status is 'shipped'. Provide a polite and concise response including this information."
Step 5: Test and Evaluate the New Output
Expected model response:
"Your order #12345 has been shipped and is on its way. Thank you for your patience!"
This output is more informative and maintains politeness.
Step 6: Iterate with Additional Instructions
To ensure consistent tone and length, add explicit instructions.
Example Prompt 3
"You are a helpful customer support assistant. Respond to the question 'Where is my order?' for order #12345 with status 'shipped'. Keep the response polite, concise (under 30 words), and include the order number and status."
Step 7: Final Output and Validation
Model output might be:
"Your order #12345 has shipped and will arrive soon. Thank you for choosing us!"
This meets all criteria: polite, concise, informative, and personalized.
Summary of Prompt Engineering Process
- Start simple: Test baseline model behavior with a straightforward prompt.
- Analyze output: Identify gaps in relevance, tone, or completeness.
- Add context: Include dynamic data and specific instructions.
- Iterate: Refine prompt to control length, style, and content.
- Validate: Ensure output meets task requirements consistently.
This systematic approach exemplifies experimentation in prompt engineering, a key competency for the NVIDIA-Certified Associate: Generative AI LLM certification.
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →