diff --git a/img/rag.png b/img/rag.png new file mode 100644 index 0000000..2a2ccac Binary files /dev/null and b/img/rag.png differ diff --git a/pages/techniques/_meta.ca.json b/pages/techniques/_meta.ca.json index baeafe3..ab13eae 100644 --- a/pages/techniques/_meta.ca.json +++ b/pages/techniques/_meta.ca.json @@ -5,6 +5,7 @@ "consistency": "Autoconsistència", "knowledge": "Prompt de coneixement generat", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Enginyeria de prompts automàtic (APE)", "activeprompt": "Prompt actiu", diff --git a/pages/techniques/_meta.en.json b/pages/techniques/_meta.en.json index ba164b0..4f0998b 100644 --- a/pages/techniques/_meta.en.json +++ b/pages/techniques/_meta.en.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/_meta.es.json b/pages/techniques/_meta.es.json index 5973653..ce20701 100644 --- a/pages/techniques/_meta.es.json +++ b/pages/techniques/_meta.es.json @@ -5,6 +5,7 @@ "consistency": "Auto-consistencia", "knowledge": "Prompt de conocimiento generado", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Ingeniería de prompts automático (APE)", "activeprompt": "Prompt activo", diff --git a/pages/techniques/_meta.fi.json b/pages/techniques/_meta.fi.json index ba164b0..4f0998b 100644 --- a/pages/techniques/_meta.fi.json +++ b/pages/techniques/_meta.fi.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/_meta.fr.json b/pages/techniques/_meta.fr.json index ba164b0..4f0998b 100644 --- a/pages/techniques/_meta.fr.json +++ b/pages/techniques/_meta.fr.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/_meta.it.json b/pages/techniques/_meta.it.json index c72af18..099c33b 100644 --- a/pages/techniques/_meta.it.json +++ b/pages/techniques/_meta.it.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Prompt Generate Knowledge", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Prompt Attivo", diff --git a/pages/techniques/_meta.jp.json b/pages/techniques/_meta.jp.json index 643bcb3..ca4a31b 100644 --- a/pages/techniques/_meta.jp.json +++ b/pages/techniques/_meta.jp.json @@ -5,6 +5,7 @@ "consistency": "自己整合性(Self-Consistency)", "knowledge": "知識生成プロンプティング", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "自動プロンプトエンジニア", "activeprompt": "アクティブプロンプト", diff --git a/pages/techniques/_meta.kr.json b/pages/techniques/_meta.kr.json index ba164b0..4f0998b 100644 --- a/pages/techniques/_meta.kr.json +++ b/pages/techniques/_meta.kr.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/_meta.pt.json b/pages/techniques/_meta.pt.json index ba164b0..4f0998b 100644 --- a/pages/techniques/_meta.pt.json +++ b/pages/techniques/_meta.pt.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/_meta.ru.json b/pages/techniques/_meta.ru.json index 3a672e7..4f0998b 100644 --- a/pages/techniques/_meta.ru.json +++ b/pages/techniques/_meta.ru.json @@ -4,6 +4,9 @@ "cot": "Chain-of-Thought Prompting", "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", + "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", + "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", "dsp": "Directional Stimulus Prompting", diff --git a/pages/techniques/_meta.tr.json b/pages/techniques/_meta.tr.json index ba164b0..4f0998b 100644 --- a/pages/techniques/_meta.tr.json +++ b/pages/techniques/_meta.tr.json @@ -5,6 +5,7 @@ "consistency": "Self-Consistency", "knowledge": "Generate Knowledge Prompting", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "Automatic Prompt Engineer", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/_meta.zh.json b/pages/techniques/_meta.zh.json index c4e232d..33d17c7 100644 --- a/pages/techniques/_meta.zh.json +++ b/pages/techniques/_meta.zh.json @@ -5,6 +5,7 @@ "consistency": "自我一致性", "knowledge": "生成知识提示", "tot": "Tree of Thoughts", + "rag": "Retrieval Augmented Generation", "art": "Automatic Reasoning and Tool-use", "ape": "自动提示工程师", "activeprompt": "Active-Prompt", diff --git a/pages/techniques/art.ru.mdx b/pages/techniques/art.ru.mdx new file mode 100644 index 0000000..e36419c --- /dev/null +++ b/pages/techniques/art.ru.mdx @@ -0,0 +1,3 @@ +# Automatic Reasoning and Tool-use (ART) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.ca.mdx b/pages/techniques/rag.ca.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.ca.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.en.mdx b/pages/techniques/rag.en.mdx new file mode 100644 index 0000000..4694ca5 --- /dev/null +++ b/pages/techniques/rag.en.mdx @@ -0,0 +1,25 @@ +# Retrieval Augmented Generation (RAG) + +import {Screenshot} from 'components/screenshot' +import RAG from '../../img/rag.png' + +General-purpose language models can be fine-tuned to achieve several common tasks such as sentiment analysis and named entity recognition. These tasks generally don't require additional background knowledge. + +For more complex and knowledge-intensive tasks, it's possible to build a language model-based system that accesses external knowledge sources to complete tasks. This enables more factual consistency, improves reliability of the generated responses, and helps to mitigate the problem of "hallucination". + +Meta AI researchers introduced a method called [Retrieval Augmented Generation (RAG)](https://ai.facebook.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/) to address such knowledge-intensive tasks. RAG combines an information retrieval component with a text generator model. RAG can be fine-tuned and it's internal knowledge can be modified in an efficient manner and without needing retraining of the entire model. + +RAG takes an input and retrieves a set of relevant/supporting documents given a source (e.g., Wikipedia). The documents are concatenated as context with the original input prompt and fed to the text generator which produces the final output. This makes RAG adaptive for situations where facts could evolve over time. This is very useful as LLMs's parametric knowledge is static. RAG allows language models to bypass retraining, enabling access to the latest information for generating reliable outputs via retrieval-based generation. + +Lewis et al., (2021) proposed a general-purpose fine-tuning recipe for RAG. A pre-trained seq2seq model is used as the parametric memory and a dense vector index of Wikipedia is used as non-parametric memory (accessed using a neural pre-trained retriever). Below is a overview of how the approach works: + + +Image Source: [Lewis et el. (2021)](https://arxiv.org/pdf/2005.11401.pdf) + +RAG performs strong on several benchmarks such as [Natural Questions](https://ai.google.com/research/NaturalQuestions), [WebQuestions](https://paperswithcode.com/dataset/webquestions), and CuratedTrec. RAG generates responses that are more factual, specific, and diverse when tested on MS-MARCO and Jeopardy questions. RAG also improves results on FEVER fact verification. + +This shows the potential of RAG as a viable option for enhancing outputs of language models in knowledge-intensive tasks. + +More recently, these retriever-based approaches have become more popular and are combined with popular LLMs like ChatGPT to improve capabilities and factual consistency. + +You can find a [simple example of how to use retrievers and LLMs for question answering with sources](https://python.langchain.com/en/latest/modules/chains/index_examples/vector_db_qa_with_sources.html) from the LangChain documentation. \ No newline at end of file diff --git a/pages/techniques/rag.es.mdx b/pages/techniques/rag.es.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.es.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.fi.mdx b/pages/techniques/rag.fi.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.fi.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.fr.mdx b/pages/techniques/rag.fr.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.fr.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.it.mdx b/pages/techniques/rag.it.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.it.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.jp.mdx b/pages/techniques/rag.jp.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.jp.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.kr.mdx b/pages/techniques/rag.kr.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.kr.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.pt.mdx b/pages/techniques/rag.pt.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.pt.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.ru.mdx b/pages/techniques/rag.ru.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.ru.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.tr.mdx b/pages/techniques/rag.tr.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.tr.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/rag.zh.mdx b/pages/techniques/rag.zh.mdx new file mode 100644 index 0000000..8994330 --- /dev/null +++ b/pages/techniques/rag.zh.mdx @@ -0,0 +1,3 @@ +# Retrieval Augmented Generation (RAG) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/techniques/tot.en.mdx b/pages/techniques/tot.en.mdx index 8f931d8..a565495 100644 --- a/pages/techniques/tot.en.mdx +++ b/pages/techniques/tot.en.mdx @@ -24,5 +24,7 @@ Image Source: [Yao et el. (2023)](https://arxiv.org/abs/2305.10601) From the results reported in the figure below, ToT substantially outperforms the other prompting methods: - + Image Source: [Yao et el. (2023)](https://arxiv.org/abs/2305.10601) + +Code available [here](https://github.com/princeton-nlp/tree-of-thought-llm) \ No newline at end of file diff --git a/pages/techniques/tot.ru.mdx b/pages/techniques/tot.ru.mdx new file mode 100644 index 0000000..5a9b127 --- /dev/null +++ b/pages/techniques/tot.ru.mdx @@ -0,0 +1,3 @@ +# Tree of Thoughts (ToT) + +This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side. \ No newline at end of file diff --git a/pages/tools.en.mdx b/pages/tools.en.mdx index 853f3cb..f651de9 100644 --- a/pages/tools.en.mdx +++ b/pages/tools.en.mdx @@ -11,6 +11,7 @@ - [Dyno](https://trydyno.com) - [EmergentMind](https://www.emergentmind.com) - [EveryPrompt](https://www.everyprompt.com) +- [fastRAG](https://github.com/IntelLabs/fastRAG) - [Guardrails](https://github.com/ShreyaR/guardrails) - [Guidance](https://github.com/microsoft/guidance) - [GPT Index](https://github.com/jerryjliu/gpt_index)