Posts

The Rise of the Transformers – a simplified version Part 2

Image
This post continues from my previous article—click here to read it first. In this article, I’ll begin unpacking the some of the key steps that need to be completed before we get to the attention mechanism. Let’s first understand how a large language model (LLM) interacts with a human user. Humans communicate in natural language—sentences, paragraphs, and conversation. But LLMs, like ChatGPT, operate purely with numbers. So, the first step in any interaction is to convert the text we type into a format the model can understand. This transformation happens in a few key stages: 1. Text Input (from user) 2. Tokenization – breaking text into smaller units the model can process 3. Numerical Conversion – each token is mapped to a unique id corresponding to that token. Each unique id is then mapped to a high-dimensional vector (a list of numbers)  that captures the meaning of each token in a format the model can understand  4. Positional Encoding – adding information about th...

The Rise of the Transformers – a simplified version.

 The Rise of the Transformers – a simplified version. Long before the wonderful world of ChatGPT, large language models struggled to understand meaning across sentences, paragraphs, and context. Sequence mattered, but older architectures—RNNs, LSTMs—could only peer through narrow windows. Comprehension was fleeting, memory limited, parallelism elusive. Then came the breakthrough: the Transformer. In this series, I’ll be simplifying how we got here, what Transformers are, why they matter, and where we’re headed in this rapidly evolving landscape of machine understanding. How we got here.  What was the Problem that the Transformer was trying to solve.  Before Transformers, neural networks processed language one step at a time. Earlier models like RNNs(Recurrent Neural Networks) and LSTMs read sentences sequentially, word by word, with limited memory of what came before, like someone with a short memory trying to follow a long story. Consider this paragraph: “Sarah packed he...

Building a Supercharged Notification Service API with AWS: - Part 2

Alright, Tech Enthusiasts and Newbies! Are you ready to continue on our AWS adventure? It's time to roll up our sleeves and dig into some code! We've covered the high-level concepts, and now we'll dive deep into the CloudFormation template that brings our Notification Service API to life. Grab your favorite caffeinated beverage and let's embark on this coding adventure together. Overview of CloudFormation Templates We have three CloudFormation templates: Pinpoint Stack : Setup for using Amazon Pinpoint to send messages. Transaction DynamoDB Table : The database to store transaction details. Notification Service API : The main infrastructure for sending notifications. We'll start with the Pinpoint stack, followed by the DynamoDB stack, and then the main Notification Service API stack. This ensures our infrastructure components are set up in the right sequence. The Pinpoint Stack - The Big Picture: What A...

Optimizing Node.js Code with ChatGPT: A Node.js-Based Application for Seamless Integration

Introduction Hey there, tech enthusiasts and coding newbies! Ever felt like your AWS Lambda functions are jogging when they could sprint? Let’s turbocharge them using Node.js and OpenAI's GPT-4! Stick around to transform your code from sluggish to superb with a touch of AI magic and a sprinkle of humor. Why Optimize AWS Lambda Functions? AWS Lambda is fantastic for running code without managing servers (serverless computing). But just because it’s easy doesn’t mean it can’t be improved. Efficient Lambda functions save time, reduce costs, and make your serverless applications run smoother than a well-oiled skateboard. Tools You'll Need Node.js : The backbone of our project, ensuring our JavaScript runs smoothly outside of browsers. OpenAI API Client Library for Node.js : This is where GPT-4 comes in, helping us analyze and suggest improvements for your Lambda code. Your AWS Lambda Code : The star of the show, ready fo...

Demystifying CloudFormation: Building Your Cloud One Template at a Time

Demystifying AWS CloudFormation: Building Your Cloud One Template at a Time Hello, tech enthusiasts and cloud newbies! If you’ve ever dreamed of wielding a magic wand to conjure up entire cloud infrastructures with a flick of your wrist, then buckle up because today, we're diving into the enchanting world of AWS CloudFormation. Now, you might be thinking, “Is this going to be one of those boring, jargon-filled lectures?” Fear not! We're going to keep it light, funny, and yes, educational. By the end, you'll be crafting CloudFormation templates like a wizard conjuring spells. What is AWS CloudFormation Anyway? Picture this: You've just landed a job as a cloud engineer. You walk into the office, and your boss says, “Hey, we need a complex, scalable, secure cloud infrastructure. Can you have it up by lunch?” You break into a cold sweat. But then you remember—CloudFormation to the rescue! CloudFormation is AWS's infrastructure-as-code (IaC)...

Building a Supercharged Notification Service API with AWS: - Part 1

Image
Building a Supercharged Notification Service API with AWS: A Deep Dive for Tech Enthusiasts and Newbies Welcome, tech enthusiasts and newbies alike! Today, we're embarking on an exhilarating journey into the world of AWS, where we'll build a highly secure, available, and scalable Notification Service API. This will be a multipart blog where we will build a service to send notifications via text and voice, manage transaction details, and handle errors like a boss. Buckle up because we're diving deep into the technical rabbit hole. Let's get started! The Grand Vision Imagine you’re a developer at a startup called "MyPacer," which offers an electronic run tracker. Your mission, should you choose to accept it, is to build a Notification Service API that can send out notifications via text, voice, and email. It must be secure, highly available, scalable, and fault-tolerant. And oh, did we mention it...

Optimizing AWS Lambda: Faster, Better, Cheaper - Part 2

Optimizing AWS Lambda: Faster, Better, Cheaper - Part 2 Hey there, tech enthusiasts and curious newbies! COntinuing from where we left off. Welcome to our deep dive into the world of AWS Lambda optimization. Whether you're a seasoned cloud ninja or just dipping your toes into serverless waters, this post is for you. We're going to start with a "meh" Lambda function and transform it into a marvel of efficiency and elegance. Buckle up—it's going to be a fun ride! The "Meh" Lambda: A Starting Point Every epic story starts with humble beginnings, and our journey is no different. Let's kick things off with a basic, somewhat underwhelming Lambda function. It's written in Node.js 18 using the AWS SDK v3, calling a dummy web service and inserting data into DynamoDB. Here it is in all its unoptimized glory: const https = require('https'); const { DynamoDBClient, PutItemCommand } = require("@aws-sdk/client-dynamodb"); const dynamoDbClient...