Decoding AI Jargons

Mehreen ZahraMehreen Zahra
6 min read

Feeling scared that Generative AI might take your job? Don’t worry—it’s not about replacing us, but understanding how it works will help us harness its power rather than fear it. Generative AI (like ChatGPT, GPT-4, etc.) can seem complex at first glance. But don’t worry! I’ll walk you through some key terms and break them down using real-world examples, so they’re much easier to understand.

1. Transformers – Think of it as a Superpower for AI

Imagine a superhero team, where each hero has a special skill. In Transformers, each "hero" or "unit" has the ability to understand and process different parts of an input (like a sentence). Together, they help AI understand text better than ever before.

  • Transformers can look at words in a sentence and understand their relationships without focusing on them one by one. It's like being able to read a whole page in a book at once instead of word-by-word.

2. Encode & Decode – Like Translating a Secret Code

Think of encoding as converting a message into a secret code (so only the right people can understand it). Decoding is the reverse: turning the secret code back into the original message.

  • Encoding: Text goes into a special format that AI can understand (like a language translation).

  • Decoding: Once AI processes the information, it translates it back into human language.

// Encoding: Transforming text into tokens (like turning words into numbers)

 const text = "Hello";

 const encoded = text.split('').map(char => char.charCodeAt(0));

 console.log(encoded); // [72, 101, 108, 108, 111]

// Decoding: Transforming back to original text

 const decoded = encoded.map(code => String.fromCharCode(code)).join(''); 

console.log(decoded); // "Hello"

3. Tokenization – Breaking Things Down Into Bite-Sized Chunks

Imagine reading a book. You don't memorize the entire book at once but break it down into smaller parts. Tokenization does this for language. It breaks down a sentence into smaller "chunks" (tokens), like words or characters.

Tokens: Just like words in a sentence, AI processes information in small, manageable pieces.

const sentence = "AI is cool!";
const tokens = sentence.split(" "); // Split by spaces into words (tokens)
console.log(tokens); // ["AI", "is", "cool!"]

4. Vectors – Representing Words as Numbers

Think of a vector as a "map" of a word. Each word has a position on this map. These positions are expressed using numbers. Instead of words, AI works with vectors (numbers that represent words).

Vector: The word "dog" might have a vector (a series of numbers) that represents its meaning in AI's "map."


// Simple representation of the word "cat" as a vector (numbers)
const catVector = [0.23, 0.87, -0.34, 0.56];
console.log("Cat Vector:", catVector);

5. Embeddings – Giving Meaning to Words

Imagine you have a dictionary. Instead of just defining a word like "dog," an embedding gives you a map of related concepts, like "puppy," "tail," "bark," etc. It puts words in context, so AI knows what the words mean in different situations.

Embeddings: They provide the AI with deep relationships between words, helping it understand context better.

// Simple example: Embedding a word into a vector of its meaning
const word = "dog";
const dogEmbedding = [0.91, 0.52, 0.34, 0.78]; // Embedding representing "dog"
console.log("Dog Embedding:", dogEmbedding);

6. Positional Encoding – Where Things Happen in a Sentence

Imagine you’re at a concert and you’re sitting in a specific seat. Your positional encoding tells AI where you are in the sentence (your "seat"). It's like labeling where each word is, so AI knows the order.

  • Positional Encoding: Words like "dog" and "barked" are different depending on their position in the sentence.

7. Semantic Meaning – The Deeper Meaning of Words

Take the word "bat." Semantic meaning helps AI know whether you’re talking about a flying mammal or a piece of sports equipment, based on context.

  • Semantic Meaning: It's all about understanding the real meaning behind words, not just their literal definitions.

8. Self-Attention – Focusing on Important Words

When reading a story, you focus on key sentences that help you understand the plot. Self-attention is AI's way of focusing on important words in a sentence, ignoring the unimportant ones.

Self-Attention: AI "looks" at all the words in a sentence and decides which ones matter the most.

// A simplified example of self-attention
const sentence = ["The", "cat", "sat", "on", "the", "mat"];
const importantWord = sentence[1]; // "cat" could be important here
console.log("Self-Attention: Focusing on", importantWord); // "cat"

9. Softmax – Making Decisions Based on Likelihood

Imagine you’re picking a snack. You might prefer chips, but you could also pick cookies. Softmax helps AI decide which option is the most likely, based on the probabilities it calculates.

  • Softmax: It helps the AI make a decision by choosing the most likely answer from a list of options.
// Softmax helps in deciding probabilities
const probabilities = [0.2, 0.3, 0.5]; // Example probabilities for different words
const nextWord = probabilities.indexOf(Math.max(...probabilities));
console.log("Softmax says the next word is index:", nextWord); // Word with the highest probability

10. Multi-Head Attention – More Eyes on the Problem

If you want to find the best restaurant in a city, you might ask multiple friends for recommendations (each friend focusing on different factors like cost, ambiance, or food quality). Multi-head attention is like having multiple "attention heads," each looking at different parts of the input.

Multi-Head Attention: It helps AI look at different aspects of a sentence simultaneously to get a more complete understanding.

11. Temperature – How Creative AI Should Be

When choosing between a few dessert options, a high temperature means you're open to random or more creative choices (like trying an unfamiliar dessert). A low temperature means you'll stick to safe, predictable choices (like always choosing chocolate cake).

  • Temperature: It controls how "risky" or "creative" the AI’s response should be. A higher temperature results in more unpredictable answers, while a lower one is more conservative.

12. Knowledge Cutoff – What AI Knows Until a Certain Date

Imagine you’re taking a history test, but you’re only allowed to study textbooks up until 2020. Anything after that, you don’t know about. This is the knowledge cutoff for AI.

Knowledge Cutoff: It defines the latest point in time the AI has information on. Anything beyond that, it doesn't know.

13. Vocab Size – The Dictionary AI Knows

Picture a dictionary with only 500 words. If you only know those 500 words, your ability to explain things is limited. Vocab size is the number of words or tokens AI can understand.

  • Vocab Size: The larger the vocabulary, the more words AI can process.

Now that we’ve broken down some key AI terms with real-world analogies, you should have a clearer idea of how AI processes language. It’s not as mysterious as it seems once you understand how each part plays its role. Whether you're diving into the world of AI development or just trying to understand how systems like ChatGPT work, these terms will help you connect the dots.

If you enjoyed this article and want to dive deeper into the world of AI,or just tech in general, feel free to follow me. I’m always sharing new insights, tips, and tricks to help make complex topics more approachable (and fun)!

Let’s keep learning together—click that follow button and stay tuned for more!

1
Subscribe to my newsletter

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

Written by

Mehreen Zahra
Mehreen Zahra