<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>2.1: Key Concepts in GenAI | GenAI Learning</title>
    <link>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/index.html</link>
    <description>Key Concepts in Generative AI Concept Definition Large Language Models (LLMs) LLMs are AI models trained on vast amounts of text data. They use the Transformer architecture, which relies on attention mechanisms to process input data. Examples: GPT (Generative Pre-trained Transformer), BERT, T5. Tokenization Breaking down text into smaller units (tokens) for processing. Example: The sentence “Hello, world!” might be tokenized into [&#34;Hello&#34;, &#34;,&#34;, &#34;world&#34;, &#34;!&#34;]. Embeddings Representing tokens as numerical (vectors) in a high-dimensional space. Embeddings capture semantic meaning (e.g., “king” - “man” + “woman” ≈ “queen”). Self-Attention/Attention Mechanism Mechanism that helps models focus on relevant words. Transformers The deep learning architecture used in LLMs. Transformers are the backbone of most modern generative models. Key components: Encoder, Decoder, and Attention Mechanism. Pre-training Training a model on a large dataset (e.g., all of Wikipedia) to learn general language patterns. Fine-tuning Adapting the pre-trained model to a specific task (e.g., sentiment analysis, chatbot). Prompt Engineering Designing effective inputs to guide model responses. Tokenization Tokenization is the process of converting text into smaller units, typically words or subwords, that can be processed by machine learning models. In natural language processing (NLP), tokens are the basic building blocks for understanding and generating language. Tokenization helps the model “understand” the text by converting it into a format that can be fed into the neural network.</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="https://genai.gitpull.in/2-intro-genai/2.1-key-concept/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>2.1.1: Tokenization</title>
      <link>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/1-tokenization/index.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/1-tokenization/index.html</guid>
      <description>Tokenization Tokenization is the process of converting text into smaller units, typically words or subwords, that can be processed by machine learning models. In natural language processing (NLP), tokens are the basic building blocks for understanding and generating language. Tokenization helps the model “understand” the text by converting it into a format that can be fed into the neural network.&#xA;Word-level tokenization splits text into words. Example: &#34;I love AI&#34; → [&#34;I&#34;, &#34;love&#34;, &#34;AI&#34;]. Subword-level tokenization (used in models like GPT) splits words into smaller parts or subwords. This is more efficient and handles unknown words better, as the model can understand smaller pieces of a word. Example, “delightful”→[“delight”, “ful”]`. Character-Level Tokenization Splits text into individual characters. Example: &#34;AI&#34; → [&#34;A&#34;, &#34;I&#34;]. Hands-On: Tokenization Tokenization Example</description>
    </item>
    <item>
      <title>2.1.2: Embeddings</title>
      <link>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/2-embeddings/index.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/2-embeddings/index.html</guid>
      <description>Embeddings Embeddings are numerical representations of tokens in a high-dimensional space. They capture the semantic meaning of tokens, allowing models to understand relationships between words.&#xA;Why are Embeddings Important?&#xA;Words with similar meanings have similar embeddings. Embeddings enable models to generalize and understand context. Example:&#xA;The embeddings for &#34;king&#34;, &#34;queen&#34;, &#34;man&#34;, and &#34;woman&#34; might satisfy the relationship: king - man + woman ≈ queen Hands-On: Embeddings from transformers import AutoTokenizer, AutoModel import torch # Load the tokenizer and model tokenizer = AutoTokenizer.from_pretrained(&#34;gpt2&#34;) model = AutoModel.from_pretrained(&#34;gpt2&#34;) # Tokenize input text text = &#34;Hello, how are you?&#34; inputs = tokenizer(text, return_tensors=&#34;pt&#34;) # Generate embeddings with torch.no_grad(): outputs = model(**inputs) # Extract embeddings for the first token embeddings = outputs.last_hidden_state print(&#34;Embeddings shape:&#34;, embeddings.shape) print(&#34;Embeddings for &#39;Hello&#39;:&#34;, embeddings[0, 0, :5]) # First 5 dimensions Output:</description>
    </item>
    <item>
      <title>2.1.3: Attention Mechanism</title>
      <link>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/3-attention-mechanism/index.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/3-attention-mechanism/index.html</guid>
      <description>Self-Attention: The Core of Transformers Imagine you’re reading a sentence: &#34;The cat sat on the mat. Each word is important, but some are more related to others.&#xA;“cat” is related to “sat.” “mat” is related to “sat.” “on” is less important. Self-Attention helps the model decide which words to focus on!&#xA;How Self-Attention Works (Step-by-Step) Self-attention is done in 4 steps:&#xA;1. Convert Words into Vectors (Embeddings) Computers don’t understand words, so we convert them into numbers (word embeddings).</description>
    </item>
    <item>
      <title>2.1.4: Transformers</title>
      <link>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/4-transformers/index.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/4-transformers/index.html</guid>
      <description>Transformer Architecture The Transformer Model is the core architecture behind most modern NLP and GenAI models like GPT, BERT, and LLaMA. Here’s how it works:&#xA;Key Components of the Transformer&#xA;Self-Attention Mechanism: This allows the model to focus on different words in a sentence when processing each word. For example, when processing the word “bank” in the sentence “I went to the bank to withdraw money,” the model can focus on the context to determine if “bank” refers to a financial institution or the side of a river. Multi-Head Attention: This technique allows the model to focus on different aspects of the sentence simultaneously, using multiple attention heads to capture different relationships between words. Positional Encoding: Since transformers don’t inherently understand the order of words (like sequential models), positional encoding is added to provide information about the position of words in a sentence. Encoder-Decoder Architecture: Encoder: Processes the input data (e.g., a sentence). Decoder: Generates the output data (e.g., a translation of the sentence). Both the Transformer Encoder and Decoder consist of:</description>
    </item>
    <item>
      <title>2.1.5: Recap</title>
      <link>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/5-recap/index.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://genai.gitpull.in/2-intro-genai/2.1-key-concept/5-recap/index.html</guid>
      <description>Summary: How Generative AI Processes Text When you enter a prompt like:&#xA;➡️ &#34;Explain black holes&#34;&#xA;A Generative AI model follows these steps:&#xA;Step 1: Tokenization&#xA;Breaks text into smaller parts (tokens).&#xA;Example:&#xA;&#34;Explain black holes&#34; → [&#34;explain&#34;, &#34;black&#34;, &#34;holes&#34;]&#xA;Step 2: Embeddings&#xA;Each token is converted into a numerical vector for processing.&#xA;Step 3: Transformer Model Processing&#xA;Self-attention determines which words matter the most. Multiple layers refine understanding. Step 4: Text Generation</description>
    </item>
  </channel>
</rss>