aifree.dev

Teach it my docs, or let it read them?

RAG vs fine-tuning · Builder · 5 min · rag, embeddings, context · after Context window, Embeddings

RAG puts the right documents into the window at answer time (open book); fine-tuning changes the model by training on examples (study). Facts that change go in the book; habits, formats and style go into the model.

Before you start: could you explain this to a friend?

1 = not at all · 5 = easily

  1. 1 Guess first

    You want a chatbot that knows your company’s policy, which changes every month. What do you do?
  2. 2 Look

    Two ways to teach it your stuff

    1 / 3

    Open book (RAG)

    1. 1. Question comes in
    2. 2. Find the relevant pages
    3. 3. Put them in the window
    4. 4. Answer, citing them

    Study (fine-tuning)

    1. 1. Collect examples
    2. 2. Train the model on them
    3. 3. Model changes
    4. 4. Answer from memory

    Same question, two lanes. The model is the same at the start of both.

    Two lanes, same model at the start: one adds pages to the window, the other changes the model itself.

  3. RAG is embeddings doing a job: turn the question into a point, find the pages whose points sit nearest, put them in the window. The model then answers from text it can actually see — and can cite. Fine-tuning instead trains on hundreds of examples until a behaviour is inside the numbers.

  4. 4 You are the model

    Route each of the four situations to a lane, then Check.

    Open book (RAG)

    1. 1. Question comes in
    2. 2. Find the relevant pages
    3. 3. Put them in the window
    4. 4. Answer, citing them

    Study (fine-tuning)

    1. 1. Collect examples
    2. 2. Train the model on them
    3. 3. Model changes
    4. 4. Answer from memory
    1. Answer questions about our 400-page internal policy that changes monthly

    2. Always reply in our brand’s terse, lowercase style

    3. Cite the exact clause from a customer’s contract

    4. Parse our odd internal ticket format reliably

    Route each situation to a lane, then Check.
  5. 5 Check

    Which is cheaper to update when a fact changes?
  6. 6 Say it back

  7. 7 Mission · 5 min

    Take three short notes of your own, embed them with a free embedding key, embed a question, and find the nearest note by cosine similarity. You just built the retrieval half of RAG.

Three quick ones

Drawn at random from this lesson's pool; different next time.

Done?

Now: could you explain this to a friend?

1 = not at all · 5 = easily

Answer the three quick ones first.
Embed this

Paste this into a blog post or course page: the lesson's main picture in an iframe, with a link back to the full lesson.

<iframe src="https://aifree.dev/embed/explain/rag-vs-fine-tuning" width="100%" height="620" style="border:0;max-width:720px" title="Teach it my docs, or let it read them? (aifree.dev Explain)" loading="lazy"></iframe>
<p><a href="https://aifree.dev/explain/rag-vs-fine-tuning">Teach it my docs, or let it read them? Interactive lesson on aifree.dev</a></p>

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer