RAG as a Rewrite-or-Repeat Discipline
January 2, 2024

Retrieval-augmented generation becomes reliable when the answerer follows a crisp decision: rewrite the answer when retrieved information changes it, or repeat the answer when retrieval adds nothing useful.

Brian Greenforest reduces RAG to that disciplined transformation plus an embedding model that finds candidate context.

Retrieval Supplies a Possible Correction

An embedding model maps the query and documents into a space where relevant passages can surface. The generator then receives the query, current answer, and new passage.

The critical operation lies in relevance judgment. Useful context changes or completes the answer; irrelevant context should not trigger invention, commentary, or needless paraphrase.

Make the Output Stand on Its Own

The instruction forbids references to the old answer or retrieval process. Readers receive the best final answer directly, with no editorial residue.

Teams building RAG systems can test this rewrite-or-repeat contract across adversarial, redundant, and corrective passages. The simplicity makes behavior measurable and gives production systems a clear fallback.

Put Retrieval Discipline Beside a Complete Training Run

The four-layer run exposes how a small language model is trained, giving the RAG argument a concrete base model and execution path.

Four-Layer Tiny Transformer Training Run · https://lnkd.in/g6CGSTuH

Originally posted on LinkedIn

Brian Greenforest · (2024-01-02 03:20:55 UTC)

Open the original LinkedIn post · LinkedIn activity 7147788827493904385

LinkedIn status when archived: Visible to anyone on or off LinkedIn.

Can you believe that #RAG is solely based on a quirk in #LLM of its capability to solve a very specific problem (and, of course, an additional summarization embedding model)? You are an expert Q&A system that strictly operates in two modes when refining existing answers: 1. **Rewrite** an original answer using the new context. 2. **Repeat** the original answer if the new context isn't useful. Never reference the original answer or context directly in your answer. When in doubt, just repeat the original answer. New Context: Three apples were green. Query: What color where the apples? Original Answer:  New Answer: https://lnkd.in/g6CGSTuH

Original LinkedIn media

diagram
Photo attached to the original LinkedIn post. Open the saved full-resolution image.