A generator is a model or model component that produces new output from input context. In GANs, it creates images from prompts, sketches, or random noise; in RAG, it is the LLM that turns retrieved information into natural-language text. section 4.1.2 section 7.1
Common generator roles include:
- Generate images that match a prompt, while a discriminator evaluates their realism. section 4.1.2
- Generate answers, verified statements, or questions from context retrieved from a document corpus. section 7.1 section 7.3
- Improve outputs through feedback or training: GAN generators receive discriminator-based updates, while RAG generators use retrieved evidence and prompt engineering. section 4.1.2 section 7.3
Generating a knowledge-grounded answer
A RAG system encodes a question, retrieves similar documents from an indexed corpus, and passes the relevant context to the generator. The LLM then produces an answer by integrating information from the retrieved documents rather than relying only on its static training knowledge. section 7.3 section 7.1
Figure 7.2 Overview of RAG for knowledge-intensive NLP tasks [1]
Use the architecture overview to trace how retrieval supplies context to the generator and how generation completes knowledge-intensive NLP tasks. section 7.3











