Posts

Showing posts from July, 2025

Internals Working of Large Language Models (LLMs)

Image
  Many real-time applications like ChatGPT, requests are sent and received using event streams , especially when streaming responses How Requests Are Sent to LLMs like ChatGPT ๐Ÿงต 1. Event Stream (Server-Sent Events / Streaming API) When you chat with ChatGPT, especially in real-time apps, the request is sent once , and the response comes back gradually as a stream of text. This is known as event streaming or streamed responses , and it's often handled using: Server-Sent Events (SSE) WebSockets (less common for OpenAI API, more for custom LLM apps) HTTP Streaming (chunked responses)  

What is ChatGPT?

๐Ÿค– What is ChatGPT?  In simple terms, ChatGPT is an AI (Artificial Intelligence) tool created by a company called OpenAI. It's like a robot that can talk with you — but in a way that actually makes sense. You type a question or request, and it responds just like a human would. It can: Write essays, poems, or blogs (like this one!) Solve maths and coding problems Help you prepare for interviews or exams Explain confusing topics in a simple way Even make jokes or tell bedtime stories ๐Ÿง  How Does It Work? At the heart of ChatGPT is something called a Large Language Model (LLM) . It’s been trained on a huge amount of text from the internet — books, articles, websites — so it understands how language works. The magic lies in how it predicts words. Just like when you start typing a message and your phone suggests the next word — ChatGPT does that, but on a much smarter and larger scale. There are different versions of it too, like: GPT-3.5 : Fast and free, good for g...

Find the Odd One Out using LLMs

  Step-by-Step: How LLMs Find the Odd One Out: 1. Tokenization and Embedding Each word in the list ( nose , teeth , eyes , taste , neck ) is: Tokenized : Converted into discrete units (words or subwords). Embedded : Mapped into high-dimensional vectors that represent meaning, context, and relationships learned from vast data. 2. Semantic Understanding LLMs analyze meaning using these embeddings. The model recognizes: Nose, teeth, eyes, neck = body parts (physical, anatomical). Taste = a sense or function , not a tangible body part. This happens because the model has seen billions of sentences in training that relate these concepts (like “eyes help you see,” “taste is one of the five senses”). 3. Pattern Recognition The model looks for shared categories or roles : Similarities : Nose, teeth, eyes, neck are visible physical parts of the body . Outlier : Taste is a function , not a part — it's something you do or experience , often through the tong...

What Is a Vector Database?

Image
With the rise of Artificial Intelligence, especially in fields like natural language processing and image generation, traditional databases are no longer enough. Enter the Vector Database — a powerful new way to store and search data based on meaning, not just keywords. ๐Ÿ“Œ What Is a Vector? In AI and machine learning, a vector is simply a list of numbers that represents something — like a word, image, or video — in a high-dimensional space. These numbers are generated by AI models and capture the meaning or context of the item. For example: The word "king" might be represented as [0.1, 0.8, 0.5, ...] A cat image might be [0.45, 0.9, 0.12, ...] These are called embeddings , and they allow us to compare and search items based on similarity. Vector embeddings based on similarity. ๐Ÿ” What Is a Vector Database? A vector database is a specialized database designed to store and search these high-dimensional vectors efficiently. Unlike traditional databases that use exact...