> For the complete documentation index, see [llms.txt](https://docs.texti.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.texti.ai/fine-tuning.md).

# Fine-tuning

## What is Fine-tuning?  <a href="#what-is-fine-tuning" id="what-is-fine-tuning"></a>

Fine-tuning is a powerful technique used to improve the accuracy of AI models. It involves training a pre-existing model on a smaller, more specific dataset to learn a new task. This allows the model to make more accurate predictions for the specific task at hand.

[Please refer to this mindmap to understand how the responses of foundational models are altered based on the chosen customization technique.](/overview.md)

## Fine-tuning vs In-Context Learning vs Prompt Engineering <a href="#fine-tuning-vs-prompt-engineering" id="fine-tuning-vs-prompt-engineering"></a>

**Fine-tuning** involves adapting a pre-trained language model by training it on a smaller, domain-specific dataset. While this method is effective for domain adaptation and enhancing accuracy, its most distinguishing advantage is providing structure to the model's responses or completions. However, achieving optimal results through fine-tuning requires a substantial amount of data, computing power, and technical expertise, making the process potentially time-consuming.\
\
**In-Context Learning (for Building AI Co-Pilots)** using the Retrieval Augmented Generation (RAG) pattern enhances large language models (LLMs) by integrating them with external information retrieval systems. Rather than relying exclusively on an LLM's pre-trained knowledge, RAG taps into external sources to provide contextually rich responses. This is crucial since the knowledge within LLMs is confined to a specific cutoff date. Building AI Co-Pilots utilizing this approach demands a considerable amount of technical expertise, given the requirements such as creating embeddings, devising chunking strategies, and establishing a vector database.

**Prompt engineering** involves crafting a prompt or a series of prompts that guide the language model to produce specific outputs. This method can yield high-quality results with minimal data and computing power. Unlike fine-tuning, prompt engineering is more accessible; it doesn't demand extensive technical knowledge and allows users to utilize any model without the need for customization.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.texti.ai/fine-tuning.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
