AI Engineering, JavaScript Solutions, Competitive programming in JavaScript, MCQ in JS

Tuesday, May 5, 2026

Day 7 - AI Engineering - Introduction to RAG - Why Giving a PDF to an LLM Doesn’t Work

Day 7 — Why Giving a PDF to an LLM Doesn’t Work

AI Engineering — Day by Day
My journey to becoming an AI Engineer




After building my first LLM playground, I had a simple thought:

“If LLMs are so powerful, why not just give them the entire document and ask questions?”

At first, this feels like it should work.

But when I started thinking deeper, I realized something important:

This approach breaks in multiple ways — and understanding that is what leads to RAG.

🧠 My Initial Understanding

My first assumption was:

  • Give full PDF to LLM
  • It keeps it in context
  • Ask questions → get answers

And technically… this can work for small inputs.

But only under very limited conditions.


⚠️ Where This Approach Breaks

1. Context Window Limitation

LLMs can only process a fixed number of tokens.

  • Large documents don’t fit
  • Important information gets truncated

2. Attention Dilution

Even if the document fits:

  • Too much information → weaker focus
  • Model struggles to identify what matters

This was a surprising insight for me.

More data does not mean better answers.

3. No Retrieval Mechanism

When you provide the full document:

  • The model sees everything
  • But doesn’t know what is relevant

It tries to “figure it out” — which is unreliable.


4. Inefficiency

  • High token usage
  • Slower responses
  • Repeated processing of same data

5. No Scalability

This approach completely breaks when:

  • You have multiple documents
  • You have large knowledge bases

🧠 The Key Realization

At this point, I understood:

The problem is not that the model lacks data…
The problem is that it cannot reliably find the right data.

🔄 The Mental Shift

Instead of:

Give everything → hope model answers correctly

The better approach is:

Find relevant information  
→ Provide only that  
→ Then generate answer

This idea is what leads directly to:

👉 Retrieval Augmented Generation (RAG)


💭 What This Changed for Me

Before:

  • I thought LLMs just needed more data

Now:

  • I understand they need the right data at the right time

🚀 What’s Next

Now that this limitation is clear, the next step is to understand:

How do we retrieve the right information efficiently?

In the next post, I’ll start exploring:

  • What RAG actually is
  • Why it solves these problems

💭 Final Thought

LLMs are powerful — but they are not search engines.

And once I understood that:

I stopped trying to give them everything…
and started thinking about how to give them the right thing.

No comments:

Post a Comment