Skip to main content

Command Palette

Search for a command to run...

So, What’s the Deal with RAG and LLMs?

Let me explain some basics 😎

Published
3 min read
So, What’s the Deal with RAG and LLMs?
H
Greetings! I'm a dynamic computer engineer passionate about developing applications and building projects. I love exploring new technologies and stay up-to-date with global trends.

RAG — Retrieval Augmented Generation.

Yeah, sounds like the latest buzzword from the AI hype machine, right?
Whoooo hyped term haan!!!. But let’s pause the FOMO and actually break this thing down into bite-sized chunks. 🙄

By now, everyone’s heard of AI, ChatGPT, Bard, Claude, Gemini, insert your favourite sci-fi-sounding model here. But terms like LLMs and RAG keep flying around. Let’s rewind to basics before diving into the alphabet soup.


What is an LLM (Large Language Model)?

Imagine your brain… but instead of storing childhood memories and that embarrassing text you regret sending, it stores a ridiculous amount of text from books, websites, forums, and, unfortunately, Reddit.

An LLM is basically that:

  • A deep learning algorithm trained to comprehend and generate text.

  • Uses a fancy architecture called a Transformer (no, not Optimus Prime — though the “attention is all you need” paper was kinda revolutionary).

  • Trained on massive datasets (think: the entire internet until your Wi-Fi breaks).

  • Can do things like translate, summarize, predict, write code, and accidentally gaslight you with confidence.


Why Customize an LLM?

Here’s the catch: off-the-shelf LLMs are generalists. They’re like that friend who knows a little bit about everything but gives questionable life advice after midnight.

For example: Ask ChatGPT about the latest US trade tariffs.

  • It might give you old info.

  • Or worse, it’ll politely make something up. (AI’s version of “just trust me bro”).

That’s where customization comes in. By tailoring an LLM, you make it more focused, accurate, and relevant for your use case.


How Do You Customize LLMs?

Source: Databricks

Ah yes, the buffet of customization. Ranging from “easy hacks” to “please have a data center and a spare $10M.” 😅

1. Prompt Engineering

  • Basically: “talk to the AI nicely.”

  • You design prompts (instructions) that steer the model toward useful answers.

  • It’s like telling your GPS: “Take me to the coffee shop, but avoid tolls and traffic.”

2. RAG (Retrieval Augmented Generation)

  • Think of RAG as giving your LLM Google powers (but without the ads).

  • It hooks the model up to an external retrieval system so it can pull in fresh, real-time info.

  • Example: Instead of guessing tariff policies, it’ll fetch the actual policy document before answering.

So, no more “As of my knowledge cutoff in 2021...” — RAG makes AI sound less like an old newspaper. 🤦‍♂️

3. Fine-Tuning

  • Here, you feed the LLM domain-specific data.

  • Teaching it your jargon, your style, your rules.

  • Example: Training an LLM for medical research papers or legal contracts (instead of asking it about cat memes).

4. Pre-Training from Scratch

  • AKA: “Good luck, corporate labs!”

  • You build an LLM from the ground up, training on your own massive dataset.

  • Requires GPUs, money, patience, and possibly a small nuclear reactor for power.


The Tradeoff: Complexity vs. Cost

As you move from Prompt Engineering → RAG → Fine-Tuning → Pre-Training from Scratch, things get:

  • More complex

  • More computationally expensive

  • More painful for your wallet

  • Step 1: “Prompts (cheap & cheerful)”

  • Step 2: “RAG (medium effort, smarter AI)”

  • Step 3: “Fine-tuning (specialized brains)”

  • Step 4: “Pre-training (call Elon for budget)”

RAG