Common prompting mistakes to avoid in AI for Everyone - Time & Space Complexity
Start learning this pattern below
Jump into concepts and practice - no test required
When working with AI prompts, it is important to understand how the complexity of your prompt affects the AI's processing time.
We want to know how the AI's work grows as prompts get longer or more complicated.
Analyze the time complexity of the following prompting approach.
prompt = "Tell me about cats."
response = AI.generate(prompt)
prompt = "Tell me about cats and dogs."
response = AI.generate(prompt)
prompt = "Tell me about cats, dogs, and birds."
response = AI.generate(prompt)
This code sends prompts of increasing length to the AI and gets responses.
Look for repeated actions that affect time.
- Primary operation: Sending the prompt to the AI and waiting for a response.
- How many times: Once per prompt, but prompt length grows.
As the prompt gets longer, the AI takes more time to process it.
| Input Size (words in prompt) | Approx. Operations |
|---|---|
| 3 | Small amount of processing |
| 6 | About twice the processing |
| 9 | About three times the processing |
Pattern observation: Processing time grows roughly in direct proportion to prompt length.
Time Complexity: O(n)
This means the AI's work grows linearly as the prompt gets longer.
[X] Wrong: "Adding more details to the prompt won't affect how long the AI takes to respond."
[OK] Correct: The AI reads and processes the entire prompt, so longer prompts take more time and resources.
Understanding how prompt length affects AI processing helps you design clear and efficient prompts, a useful skill when working with AI tools in real projects.
"What if we split a long prompt into several shorter prompts? How would that change the time complexity?"
Practice
Solution
Step 1: Understand what makes a good prompt
Good prompts are clear and specific, helping AI understand the request.Step 2: Identify common mistakes
Vague or unclear questions confuse the AI and lead to poor answers.Final Answer:
Using vague or unclear questions -> Option DQuick Check:
Vague prompts cause poor AI answers [OK]
- Writing broad or unclear prompts
- Not giving enough context
- Assuming AI knows your intent
Solution
Step 1: Analyze each prompt's clarity
The prompts "Tell me about stuff.", "What do you think?", and "Give me info." are vague or too broad without specifics.Step 2: Identify the clear and specific prompt
Explain the causes of climate change with examples. asks for causes and examples, guiding the AI well.Final Answer:
Explain the causes of climate change with examples. -> Option CQuick Check:
Specific prompts guide AI better [OK]
- Using vague words like 'stuff' or 'info'
- Asking open-ended questions without focus
- Not specifying what kind of answer is wanted
"List the benefits of exercise." What is a likely problem with this prompt?Solution
Step 1: Evaluate the prompt's clarity
The prompt is short and simple but does not specify details or context.Step 2: Identify the issue
Without context, AI might give a generic or incomplete list.Final Answer:
It is too vague and lacks context -> Option BQuick Check:
Vague prompts cause unclear AI answers [OK]
- Not specifying what kind of benefits to list
- Assuming AI knows the user's intent
- Using very short prompts without guidance
"Explain AI." The AI gives a very short and unclear answer. What is the best way to fix this?Solution
Step 1: Identify why the answer is unclear
The prompt is too broad, so AI doesn't know what to focus on.Step 2: Improve the prompt
Adding details or specifying topics helps AI give a better answer.Final Answer:
Add more details and specify what aspect of AI to explain -> Option AQuick Check:
Specific prompts get clearer AI answers [OK]
- Using too short or broad prompts
- Repeating prompts expecting different answers
- Using unclear or informal language
"Dinner ideas?" How can you improve this prompt to avoid common mistakes and get better results?Solution
Step 1: Identify the problem with the original prompt
"Dinner ideas?" is too short and vague, lacking details or guidance.Step 2: Choose a prompt that is clear and specific
Ask: 'Can you list 5 healthy dinner ideas with ingredients and cooking time?' asks for a specific number of ideas, includes 'healthy', and requests ingredients and cooking time, guiding the AI well.Final Answer:
Ask: 'Can you list 5 healthy dinner ideas with ingredients and cooking time?' -> Option AQuick Check:
Specific, detailed prompts get better AI answers [OK]
- Using very short or vague prompts
- Not specifying quantity or details
- Assuming AI guesses your needs
