Decoding AI Jargons with Chai

AI terms using a disaster-filled cross-country road trip with your most chaotic friend group.

Just like National Lampoon’s Vacation meets Terminator.(It’s an Hollywood movie)

Buckle up—it’s gonna get weird trip.

1. Encoder & Decoder

  • Encoder: When our enthusiastic friend Sam who plans the entire trip on a spreadsheet.

    • “We’ll leave at 5 AM, drive 437 miles, eat Chole bhature at mile 203, and arrive by sunset!”(But as we know if friend’s are there so trip not gona be so simple🤣)
  • Decoder: Here I am trying to follow Sam plan while ignoring his 37 missed calls about “deviating from the route.”
    Why it matters: Without Sam’s (encoder), you’d never leave the driveway. Without you winging it (decoder), Here I’m striving to eat Chole bhature.

// Encoder: Plans every detail
const tripPlan = JSON.stringify({
  departure: "5 AM",
  foodStop: "Chole Bhature - Mile 203",
  arrival: "Before sunset"
});

// Decoder: Tries to follow the plan...
const myTrip = JSON.parse(tripPlan);
console.log("Chole Bhature ETA: ?? ¯\\_(ツ)_/¯");

2. Vectors & Embeddings

  • Vector: Its just like GPS coordinates to reach our planned destination.(vector is simply a list of numbers that gives us direction and magnitude)

  • Embedding: Plotting all roadside attractions on a map to see which are cluster-worthy.

    • Embeddings is putting abstract things (like words, images, etc.) onto a "Map"

    • You can then group, search, or recommend based on proximity (clusters).

# Vector: Just numbers
vec = [0.89, 0.12, 0.45]

# Embedding: Plotting meaning onto a map
embedding = {
  "Chole Bhature": [0.82, 0.91],
  "Tandoori Momos": [0.80, 0.88]
}

print("Nearest food: ", max(embedding, key=lambda k: sum(embedding[k])))

3. Positional Encoding

The order of your stops determines if you survive.

  • Sam’s plan: “Jaipur → Goa”

  • Your version: Goa → Jaipur” (because you blew ₹10k on beach parties and now need budget kachoris to survive).
    Why it matters: AI uses this to know “dog bites man” ≠ “man bites dog” (or “man bites slot machine”).

    • Here’s the simple Explanation:

      • Sam’s plan:
        🗺️ Jaipur → 🎰 Goa
        (Start with heritage, end with a tan.)

      • Your plan:
        🎰 Goa → 😭 Jaipur
        (Spent all your money at Baga Beach, now sweating in pink city traffic eating ₹10 samosas.)

👉 Same places, different order — completely different experience!

That’s how sentences work too.

  1. "Dog bites man" = Normal news

  2. “Man bites dog" = Crazy news!

If the AI doesn’t know the order, it might think they’re the same.

const sentence1 = "Jaipur → Goa";
const sentence2 = "Goa → Jaipur";

console.log(sentence1 === sentence2); // false
// Order. Matters. a lot

4. Semantic Meaning

Analogy: Your friend who thinks “Let’s hit the bar!” means literally hitting it with a bat.

  • AI uses context to decode:

    • “Bar” after “thirsty” → margaritas.

    • “Bar” after “angry” → …call the cops.
      Fail moment: Early AI sent someone to a metal rod factory instead of a pub.

word = "bar"
context = "I'm thirsty"

if context == "I'm thirsty":
    meaning = "place to drink"
else:
    meaning = "metal rod or... bat?"

print(f"Bar means: {meaning}")

5. Self-Attention

Analogy: Your friend Sarah, who won’t stop pointing out road signs.

  • “OMG, DID YOU SEE THAT ‘WORLD’S BEST PIE’ SIGN? TURN BACK! TURN BACK!!”

  • AI uses self-attention to focus on critical signs (like “BRIDGE OUT”) and ignore Sarah’s pie obsession.

const roadSigns = ["World's Best Pie", "Bridge Out!", "Free Camels"];

function selfAttention(signs) {
  return signs.filter(sign => sign.includes("Bridge"));
}

console.log(selfAttention(roadSigns)); // [ 'Bridge Out!' ]

6. Softmax

Analogy: Voting on where to eat when everyone’s hangry.

  • Options:

    • Petrol station nachos: 60% 🌮 (you’re desperate).

    • Fancy Hotel: 30% 🥗 (Sam’s pick).

    • “Mystery meal” truck: 10% 🤢 (Sarah’s dare).
      Why it matters: AI uses softmax to pick the least terrible choice.

import numpy as np

choices = [6, 3, 1]  # Nachos, Fancy Bistro, Mystery Meal

softmax = lambda x: np.exp(x) / np.sum(np.exp(x))
probabilities = softmax(choices)

print(probabilities)  # [~0.84, ~0.11, ~0.04]

7. Multihead Attention

Analogy: Your friend group divided into teams:

  • Team 1: Navigation Experts
    Arguing passionately:

    • “Google Maps says left!”
      “Bro, my gut feeling says right.”

  • Team 2: Snack Managers
    Stocked like the apocalypse:

    • 17 bags of Chipps, 4 bottles of Frooti, and one forgotten paneer sandwich.

  • Team 3: Music DJ
    Only plays Arijit Singh heartbreak songs.

    • "Bro, this Tum Hi Ho hits different on highways."
      Why it matters: AI’s “multihead attention” is just organized chaos.

const friends = {
  nav: ["Google Maps", "Paper Map?!"],
  snacks: ["Chipps", "More Chipps", "Still Chipps"],
  music: ["Arijit Singh"]
};

friends.nav.forEach(opinion => console.log("Arguing over:", opinion));

8. Temperature

Analogy: How much you let Amit (a.k.a. DJ Dhamaka) control the AUX cord.

  • 🎧 Low Temperature:
    Sam plays it safe—Arijit Singh's soulful hits like “Tum Hi Ho” fill the car.
    Everyone’s emotional. Even I am pretending there's dust in his eye.
    Mood: Sentimental + Predictable.

  • 🤪 High Temperature:
    Suddenly, Amit switches to experimental goat trance + Bhangra fusion with a dash of EDM remix.
    Next thing you know, you're dancing at a dhaba rave with flashing truck lights.
    Mood: Pure Chaos.

Temperature is a hyperparameter that controls the randomness/creativity of the output in models like GPT, etc.

  • Low Temperature (e.g., 0.2 - 0.5):
    The AI plays it safe—picks predictable, common answers.
    👉 Just like Arijit Singh’s emotional classics—reliable, loved, consistent vibes.

  • High Temperature (e.g., 0.9 - 1.2):
    The AI becomes wild—outputs surprising, weird, or super creative responses.
    👉 Just like your friend discovering experimental goat metal at 3 AM—unexpected chaos.

9. Knowledge Cutoff

Analogy: Your 1998 road atlas that still lists “Blockbuster” as a landmark.

  • AI trained on pre-2023 data thinks:

    • “TikTok” is a clock sound.

    • “Twitter” is for angry birds.
      Fail moment: Your AI plans a stop at “RadioShack” for phone chargers.

🔍 In AI: Knowledge cutoff means the AI doesn't know anything that happened after its last training date.

10. Tokenization & Vocab Size

  1. Tokenization
    Breaking down big, confusing things into smaller, understandable bits.

Like turning “PyaazKachoriExtraSpicyPlz” into
[“Pyaaz”, “Kachori”, “Extra”, “Spicy”, “Plz”]

jsCopyEditconst phrase = "PyaazKachoriExtraSpicyPlz";
const tokens = phrase.match(/.{1,5}/g);
console.log(tokens); 
// breaks it into 5-letter chunks for easy digestion
  1. Vocab Size
    How many roadside food joints your AI can recognize.

🥲 Small vocab:
“Should we stop at Sagar Ratna or Sagar Ratna again?”

🤩 Big vocab:
“Let’s hunt for that hidden aloo tikki cart behind Sector 17, Chandigarh.”

Visual:
A confused GPS suggesting “Sagar Ratna” 73 times before you give up and eat chips.

🛑 The Grand Finale: AI Road Trip Disaster

  1. Encoder (Sam):
    We’ll take NH 48, stop for Poha in Indore, see the Gir lions, and reach Dwarka by Friday!

  2. Decoder (You):
    Ends up at a goat farm in Rajasthan because the GPS “embeddings” thought “Gir” meant “Baa Baa Land.”

  3. Self-Attention:
    Completely ignores Sam yelling “WRONG TURN, BRO!” because you’re too busy arguing over who skipped “Kesariya” on the playlist.

  4. Softmax:
    Chooses “Goat selfies with a filter” over “Sam’s perfectly planned itinerary.”

const GPS = "Rajasthan";
const actualLocation = "Camel Farm";

if (GPS !== actualLocation) {
  console.log("Blame Sam 🦙");
}

AI isn’t magic it’s just a chaotic desi road trip with algorithms arguing over GPS and snack stops. Sometimes you reach Goa. Sometimes you end up taking selfies with Camels and people. Either way... blame Sam for planning this trip. 🦙

TL;DR: AI jargon = road trip chaos. Bring snacks, ignore Sam, and enjoy the Trip. 🚗💨

Thanks for reading this fun AI journey! Shoutout to Hitesh Sir and Chai & Code for the inspiration! ❤️

0
Subscribe to my newsletter

Read articles from SANKALP HARITASH directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

SANKALP HARITASH
SANKALP HARITASH

Hey 👋🏻, I am , a Software Engineer from India. I am interested in, write about, and develop (open source) software solutions for and with JavaScript, ReactJs. 📬 Get in touch Twitter: https://x.com/SankalpHaritash Blog: https://sankalp-haritash.hashnode.dev/ LinkedIn: https://www.linkedin.com/in/sankalp-haritash/ GitHub: https://github.com/SankalpHaritash21 📧 Sign up for my newsletter: https://sankalp-haritash.hashnode.dev/newsletter