Talking to AI Is an Art: From Token Saving to Prompt Mastery
“Prompting is like telling a bedtime story to a genius child — you want them to understand, dream, and respond… without keeping you up all night.”
🌱 Part 1: GIGO — Garbage In, Garbage Out
Imagine this:
You walk into a pharmacy and say,“Give me something for pain.
You might get a balm, a pill, or a confused look.
Now say:
“I have a sharp pain in my right shoulder from yesterday’s workout. I need something that reduces inflammation quickly.”
Boom! The pharmacist understands. You get the right thing.
That’s GIGO in action:
Garbage In = Garbage Out
Good Input = Good Output
AI is just like that pharmacist.
If you talk to it vaguely, it guesses.
If you talk to it clearly, it delivers magic.
Part 2: Tokens — The Currency of AI Conversations
When you talk to AI, you’re not just sending messages — you’re spending tokens.
🧮 What’s a Token?
In AI-land, a “token” is a piece of text — usually a word or part of a word.
For example:
- “cat” = 1 token
- “unbelievable” = 2–3 tokens
- “Hello, how are you?” = ~5 tokens
You usually have a token limit (~8,000 to 100,000 depending on the model).
Like a prepaid plan. Use it wisely.
🔁 Part 3: Smart Token Use — 400 Messages and the Art of Summary
Imagine you’re building a therapy chatbot with 400 past messages.
You can’t send all 400 every time — it’ll eat up all your tokens!
🧠 How Devs Solve This:
Your life is a movie.
- The last 100 scenes? Still fresh.
- The first 300? You remember the “essence,” not every word.
Solution:
- 🔁 Last 100 messages: Send them directly.
- 📜 First 300 messages: Summarized into something like:
“User has been anxious about job performance, especially after feedback from boss. Seems to overthink deadlines and lacks confidence during meetings.”
🎯 This way, AI gets recent facts and older feelings.
✨ Part 4: Prompting Styles — Dressing Your Query Right
Here are 3 main prompt formats:
🧢 1. Instruction Style (Alpaca)
“Write a formal email to my boss requesting leave for 3 days due to a family emergency.”
Best for direct commands.
🧵 2. ChatML Style (OpenAI)
[{"role": "system",
"content" : "You are sensei, a large language model trained by gemini."},
{"role": "user",
"content" : "How are you?"},
{"role": "assistant",
"content" : "I am doing well"},
{"role": "user",
"content" : "What is the mission of the company gemini?"}]
Adds roles and structure.
🪡 3. Promptal / Template Style
Goal: Summarize meeting
Audience: Sales team
Tone: Informal
Length: Under 100 words
AI now has clear instructions like a screenplay.
🧙♀️ Part 5: Prompting Techniques — Spells That Actually Work
🟢 1. Zero-shot Prompting
No examples, just instruction:
“Translate ‘Guten Morgen’ to English.”
“What is the capital of Italy?”
Use for simple, factual tasks.
🔵 2. Few-shot Prompting (One or Two Examples)
Example:
Input: “Hola” → Output: “Hello”
Input: “Merci” → Output: “Thank you”
Input: “Ciao” → Output: ?
AI learns the pattern. Great for language, tone, structure.
🟡 3. Chain-of-Thought Prompting (CoT)
Let AI “think aloud” step by step.
Without CoT:
Q: What’s 15% of 80? → A: 12
With CoT:
A: 15% = 15/100 × 80 = 12
Improves logical accuracy and complex reasoning.
🧩 Why Providing Examples Matters
Humans learn by examples — AI too.
Telling AI: “Act like Ravi who is funny, explains gently to kids” = Persona Prompting
It mimics tone, logic, and empathy.
Without examples, you risk misunderstandings.
⛓️ Limiting AI Using Prompting
You can constrain AI via your prompts.
Examples:
- Keep it under 50 words
- Use a professional tone
- No personal opinions
Think of it like Google Maps preferences:
“Avoid toll roads. Prefer highways.”
Same with AI: You guide its route.
❤️ Final Note: You Are the Prompt Designer
“AI is not magic. The magic is in how you ask.”
You’re not just typing questions.
You’re designing thoughts.
You’re creating a story, a song, a solution.
You now know the art of speaking to AI. So next time, speak not just with text — but with intention.
What Prompted the Change? – Find & Share on GIPHY
🧠💬 Talking to AI Is an Art: From Token Saving to Prompt Mastery was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
This post first appeared on Read More