Jazykový model umí jen to, co se naučil při tréninku — a tváří se sebejistě, i když něco neví. RAG (vyhledáním rozšířená generace) to řeší: model nejdřív najde relevantní text a teprve pak odpoví — z něj. Porovnej, jak model odpovídá bez dokumentu a s ním. A language model only knows what it learned during training — and sounds confident even when it doesn't. RAG (retrieval-augmented generation) fixes this: the model first finds relevant text and only then answers — from it. Compare how the model answers without a document and with one.
Co to jeWhat it is RAG (vyhledáním rozšířená generace): místo aby model odpovídal jen z paměti, nejdřív si vyhledá relevantní dokument a teprve pak odpoví — z něj.RAG (retrieval-augmented generation): instead of answering from memory alone, the model first retrieves a relevant document and only then answers — from it.
Co zkusitWhat to try Níže je malá znalostní báze (dokumenty, které model neviděl). Napiš otázku a porovnej dvě odpovědi: jen model (tipuje a halucinuje) a model + RAG (najde nejpodobnější dokument a odpoví z něj). Vyhledávání používá podobnost jako embeddingy (9).Below is a small knowledge base (documents the model never saw). Type a question and compare two answers: the model alone (it guesses and hallucinates) and the model + RAG (it finds the most similar document and answers from it). Retrieval uses similarity like embeddings (9).
Proč je to důležitéWhy it matters Tohle je nejčastější reálné nasazení LLM ve firmách — chatbot nad vlastními dokumenty. Dramaticky snižuje halucinace, protože model odpovídá z doloženého textu, ne z paměti.This is the most common real-world use of LLMs in companies — a chatbot over your own documents. It dramatically cuts hallucinations, because the model answers from sourced text, not from memory.
Samotný model je jako student, který píše test jen z hlavy — co nezná, to si domyslí. RAG je jako test s otevřenou knihou: nejdřív si najde správnou stránku a teprve pak odpovídá. Proto je RAG dnes nejčastější způsob, jak nasadit LLM nad vlastní data. The model on its own is like a student taking a test from memory — whatever it doesn't know, it makes up. RAG is like an open-book test: it first finds the right page and only then answers. That's why RAG is today the most common way to deploy an LLM over your own data.
RAG = vyhledáním rozšířená generace. Model nejdřív vyhledá relevantní text v databázi a teprve pak generuje odpověď — opírá se o zdroj, ne jen o paměť. RAG = retrieval-augmented generation. The model first retrieves relevant text from a database and only then generates the answer — leaning on a source, not just memory.
Hledá se přes podobnost významu (embeddingy z příkladu 9). Otázka i dokumenty se převedou na čísla a vybere se text, který je otázce nejblíž. It searches by similarity of meaning (embeddings from example 9). The question and the documents are turned into numbers and the text closest to the question is picked.
Méně halucinací, aktuální a ověřitelné informace, a model může uvést zdroj. Funguje i pro data, která model při tréninku nikdy neviděl. Fewer hallucinations, up-to-date and verifiable information, and the model can cite a source. It works even for data the model never saw during training.
Když vyhledání najde špatný nebo žádný dokument, odpověď bude taky špatná. RAG je jen tak dobré, jak dobré je vyhledávání. If retrieval finds the wrong document or none, the answer will be wrong too. RAG is only as good as its search.
Firemní znalostní báze, školní materiály, dokumentace, chatboti nad vlastními dokumenty — vůbec nejčastější reálné nasazení LLM. Company knowledge bases, school materials, documentation, chatbots over your own documents — by far the most common real-world deployment of an LLM.