검색 증강 생성 (RAG)

Retrieval-Augmented Generation (RAG)은 생성 과정에서 외부 지식 소스를 통합하여 Large Language Models (LLM)의 정확성과 신뢰성을 향상시키는 AI 프레임워크입니다.

RAG 시스템은 정보 검색과 텍스트 생성의 강점을 결합합니다. 먼저 사용자의 쿼리를 기반으로 외부 지식 기반에서 관련 문서 또는 데이터를 검색합니다. 그런 다음, 이 검색된 정보를 사용하여 LLM의 입력을 보강하여 모델이 더 많은 정보를 기반으로 하고 문맥적으로 정확한 응답을 생성할 수 있도록 합니다. 이 접근 방식은 오래되었거나 불완전할 수 있는 LLM의 내부 지식에 대한 의존도를 줄이고 생성된 출력의 전반적인 품질과 신뢰성을 향상시킵니다. RAG는 최신 정보 또는 전문 지식이 필요한 작업에 특히 유용합니다.

        graph LR
  Center["검색 증강 생성 (RAG)"]:::main
  Pre_large_language_model["large-language-model"]:::pre --> Center
  click Pre_large_language_model "/terms/large-language-model"
  Pre_vector_database["vector-database"]:::pre --> Center
  click Pre_vector_database "/terms/vector-database"
  Pre_semantic_search["semantic-search"]:::pre --> Center
  click Pre_semantic_search "/terms/semantic-search"
  Center --> Child_rag_pipeline["rag-pipeline"]:::child
  click Child_rag_pipeline "/terms/rag-pipeline"
  Center --> Child_context_window["context-window"]:::child
  click Child_context_window "/terms/context-window"
  Rel_prompt_engineering["prompt-engineering"]:::related -.-> Center
  click Rel_prompt_engineering "/terms/prompt-engineering"
  Rel_generative_ai_agents["generative-ai-agents"]:::related -.-> Center
  click Rel_generative_ai_agents "/terms/generative-ai-agents"
  Rel_rlhf["rlhf"]:::related -.-> Center
  click Rel_rlhf "/terms/rlhf"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧠 지식 테스트

1 / 3

🧒 5살도 이해할 수 있게 설명

🌍 Imagine you're taking a test. A regular AI tries to answer from memory alone. An AI using [RAG](/ko/terms/rag) is allowed to look at an open book (the [database](/ko/terms/database)) specifically related to the question before it writes down the answer. This makes it much less likely to make things up.

🤓 Expert Deep Dive

RAG architectures fundamentally shift LLM interaction from pure parametric recall to a hybrid parametric-retrieval paradigm. The core challenge lies in optimizing the retrieval-augmentation loop for relevance and efficiency. Techniques like dense passage retrieval (DPR) using bi-encoders, or hybrid search combining keyword and semantic matching, are crucial. Advanced RAG implementations explore iterative retrieval, query decomposition for complex questions, and re-ranking mechanisms to refine retrieved context. The choice of vector [database](/ko/terms/vector-database), embedding model, chunking strategy, and retrieval parameters (e.g., top-k) significantly impacts performance. Potential vulnerabilities include retrieval poisoning, where malicious data injected into the knowledge base can lead to biased or incorrect LLM outputs. Furthermore, the computational overhead of retrieval can introduce latency, a critical trade-off for real-time applications. Evaluating RAG systems requires metrics beyond standard LLM benchmarks, focusing on retrieval precision/recall and the factual consistency of the generated output with the retrieved context.

🔗 관련 용어

더 알아보기:

📚 출처