“Train the AI on our documents” is a common request. It can refer to several goals: finding an up-to-date procedure, using specific vocabulary, following a format or performing a specialised task. The technical solution depends on the intended result.
RAG provides sources when the system answers
Retrieval-augmented generation, usually called RAG, retrieves relevant passages from authorised sources and supplies them to the model to help it answer. The system must handle document ingestion, chunking, retrieval and the presentation of references. The model’s weights do not necessarily change.
For a document assistant, this approach lets you update a collection without retraining the model every time a procedure changes. You still need to manage the removal of outdated versions, synchronisation and access control. Answer quality also depends on finding the right passage.
Fine-tuning adapts an existing model
Fine-tuning continues the training of a pretrained model using a dataset intended for a task or domain. Hugging Face’s documentation distinguishes this from training with randomly initialised weights.
It can be worth investigating when a repeated need concerns, for example, an output structure or a specialised task that is difficult to stabilise through instructions alone. It requires good examples, clear usage rights and evaluation separate from the training data. Its value should be measured against a simpler solution.
Start with a concrete comparison
Consider three fictional requests. One team wants to find the applicable reimbursement procedure: freshness and source citation point first towards document retrieval. Another wants a structured object that follows a schema: instructions and automatic validation may be enough. A third wants a lasting improvement to a repeated business task: fine-tuning may become an option if baseline tests reveal a measurable gap.
These situations are examples for reasoning, not universal rules. A system can combine several approaches. Adding them all from the outset, however, increases the number of components that must be maintained and evaluated.
Test retrieval and the answer separately
When an assistant gives a poor answer, the model is not always the first cause. The document may be missing, the index outdated, the passage incomplete or access denied. Separating these stages helps identify the right problem to fix. Hugging Face’s RAG evaluation guide illustrates how a reference set of questions and answers can help observe changes in a system.
Our practical checklist includes simple questions, requests that combine two sources, contradictory documents and questions with no available answer. It also checks that users cannot obtain a passage they are not allowed to read. Examples should reflect working conditions, including expected failures.
Do not confuse specialisation with security
A retrieved document can contain malicious instructions. OWASP describes this indirect injection risk and recommends multiple layers of protection. Neither RAG nor fine-tuning removes the need to restrict available tools, validate their parameters and control sensitive actions on the server.
To prepare a project, start with representative cases and success criteria. Our model training and adaptation page explains the stages of work. The aim is to choose an architecture justified by results, then document how it will be operated.


