Welcome to DOFBOT-Ultra repository
2. RAG Retrieval Enhancement and Model Training Samples
RAG Retrieval Enhancement and Model Training Samples
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
Before starting this feature, you need to close the web control program backend process.
1. Course Content
Introduce the three concepts of large model hallucination, RAG retrieval enhancement, and model training samples, laying the theoretical groundwork for subsequent hands-on practice.
2. What is Large Model Hallucination? Why Do Large Models Hallucinate?
RAG retrieval enhancement and model training samples are primarily used to reduce large model hallucination. Let's first understand large model hallucination.
Large model hallucination refers to situations where the model, when understanding the environment, generating instructions, or planning actions, outputs content that is inconsistent with real-world facts or logic, causing the robot to make incorrect actions or deviate significantly from user expectations.
Why do large models hallucinate? Large models are essentially probability prediction systems trained on massive text data. In certain specific domains or scenarios, the training data may lack sufficient samples, causing the model to "fabricate" content to fill gaps.
3. RAG Retrieval Enhancement and Training Samples
3.1 RAG Retrieval Enhancement
RAG is an architecture that combines a Retrieval system with a Generation model, aimed at addressing the limitations of traditional generation models in scenarios such as open-domain knowledge Q&A and real-time information queries (e.g., outdated knowledge, factual hallucination, long text dependency). Its core logic is: retrieve relevant knowledge and incorporate it into the Prompt, allowing the large model to reference the relevant knowledge, achieving "retrieve first, generate second".

3.2 Training Samples
Training samples are contained within the RAG knowledge base. The robot comes pre-configured with two knowledge bases: an action function library and a training sample library. The training samples contain training examples from the course case scenarios, providing the large model with decision-making ideas for specific scenarios. Subsequent chapters [16. AI Large Model Development Pre-configuration / 06-Deploy Local RAG Knowledge Base] and [16. AI Large Model Development Pre-configuration / 07-RAG Knowledge Base + Chatbot] will explain how to configure and extend proprietary knowledge bases and training samples.
4. The Role of RAG Retrieval Enhancement and Training Samples in the Robot
4.1 Reducing Large Model Hallucination
When a large model encounters domains or special user requirements it has never encountered before, it will give possible results based on existing training data, but these results may differ from what the user expects or may not meet the requirements of a specific scenario.
4.2 Increasing Robot Scene Generalization Ability
The robot comes pre-configured with training samples related to course cases (detailed in the large model configuration course). These training samples provide the large model with reference information for specific scenarios. Users can also add their own training samples to customize their专属 robot for different application domains.
4.3 Reducing Model Prompt Requirements
If the number of training samples and knowledge bases is small, they can be placed directly in the large model's prompt. The prompt is the preset role and requirements given by the user to the large model. As the knowledge base grows, if the prompt becomes too long, it will consume more token quota. Therefore, RAG retrieval enhancement is introduced to uniformly manage the robot's action function library and training samples.
4.4 Easy Expansion and Management of Robot Capabilities
The Alibaba Bailian Large Model Platform (also known as the Tongyi Qianwen platform) provides online management of knowledge bases and training samples, allowing users to conveniently manage and expand data. Domestic users default to using the Alibaba Bailian Large Model Platform to manage the action function library and training samples, while international users use the locally deployed Dify to manage knowledge base content.