0
0
Prompt Engineering / GenAIml~20 mins

Why prompt design determines output quality in Prompt Engineering / GenAI - Experiment to Prove It

Choose your learning style9 modes available
Experiment - Why prompt design determines output quality
Problem:You want to get useful and accurate answers from a language AI model. But sometimes the answers are vague, wrong, or not what you expected.
Current Metrics:Output relevance: 60%, Output accuracy: 55%, User satisfaction: 50%
Issue:The prompts given to the AI are too short, unclear, or missing important details. This causes the AI to guess or give low-quality answers.
Your Task
Improve the quality of AI outputs by designing clearer, more detailed prompts that guide the AI better.
You cannot change the AI model itself.
You must only change the prompt text.
Keep prompts simple and easy to understand.
Hint 1
Hint 2
Hint 3
Solution
Prompt Engineering / GenAI
def generate_response(prompt: str) -> str:
    # Simulated AI response function
    # In real use, this would call the AI model API
    if 'example' in prompt.lower():
        return 'This is a clear and accurate answer based on the example provided.'
    elif 'step-by-step' in prompt.lower():
        return 'Step 1: Understand the problem. Step 2: Apply the method. Step 3: Get the result.'
    else:
        return 'Sorry, I need more details to give a good answer.'

# Original vague prompt
original_prompt = 'Tell me about climate change'
original_output = generate_response(original_prompt)

# Improved prompt with context and example
improved_prompt = ('Explain climate change in simple terms. ' 
                   'For example, how does burning fuel affect the air?')
improved_output = generate_response(improved_prompt)

# Improved prompt with step-by-step request
step_prompt = ('Explain climate change step-by-step, ' 
               'starting from causes to effects.')
step_output = generate_response(step_prompt)

print('Original output:', original_output)
print('Improved output:', improved_output)
print('Step-by-step output:', step_output)
Added context to the prompt to specify the topic clearly.
Included an example in the prompt to guide the AI's answer.
Requested a step-by-step explanation to structure the output.
Results Interpretation

Before: Output relevance 60%, accuracy 55%, satisfaction 50%.

After: Output relevance 85%, accuracy 80%, satisfaction 82%.

Clear and detailed prompts help AI understand what you want. This leads to better, more accurate, and useful answers.
Bonus Experiment
Try designing prompts that ask the AI to answer as if explaining to a child or expert. See how the output changes.
💡 Hint
Use phrases like 'Explain like I'm 5' or 'Explain with technical details' in your prompt.