← All posts
📅

Prompt Engineering 101 — The Art of Talking to AI

A roundup of fundamental and advanced Prompt Engineering techniques for interacting effectively with LLMs.

What is Prompt Engineering?

Prompt Engineering is the art and science of designing prompts to communicate effectively with large language models (LLMs) such as GPT-4, Claude, or Gemini.

Core techniques

1. Zero-shot Prompting

Ask a question directly without examples:

Classify the sentiment of the following text: "This product is amazing!"
→ Positive

2. Few-shot Prompting

Provide a few examples so the model picks up the pattern:

Text: "I love it!" → Positive
Text: "Terrible!" → Negative
Text: "It's just okay" → ?

3. Chain-of-Thought (CoT)

Ask the model to reason step by step:

Think step by step: If I have 5 apples,
give away 2, then buy 3 more, how many do I have?

4. Role Prompting

Assign a specific role to the AI:

You are a Senior Python Developer with 10 years of experience.
Review the following code and suggest improvements...

Golden principles

  1. Be specific — The more specific, the better
  2. Provide context — Give full background
  3. Set constraints — Constrain the output format
  4. Iterate — Refine your prompt gradually
  5. Use delimiters — Mark sections clearly

Conclusion

Prompt Engineering is not just “writing good questions”. It is a critical skill in the AI era, helping you extract the most from language models.


Next post: a deep dive into Advanced Prompting Techniques with RAG and Agent patterns.