# Supervised Fine-Tuning Strategies

As we discussed in the previous chapter, supervised fine-tuning is a method used to **adapt a pre-trained Language Model** for specific tasks **using labeled data.** Unlike unsupervised techniques, supervised fine-tuning uses a dataset of pre-validated responses, which is its key distinguishing feature. During supervised fine-tuning, the model's weights are adjusted using **supervised learning techniques**. The adjustment process uses task-specific loss calculations, which measure how much the model's output differs from the known correct answers **(ground truth labels).** This helps the model learn the specific patterns and nuances needed for its intended task.

### **Here's a practical example:**&#x20;

Consider a pre-trained LLM responding to "Can you summarize this research paper for me?" with a basic response like "The paper discusses the effects of caffeine on sleep patterns and finds negative correlations between evening coffee consumption and sleep quality." While technically accurate, this response might not meet the standards for an academic writing assistant, which typically requires proper structure, methodology highlights, and key findings in context.

<figure><img src="/files/af9BcsBTtQgNMoUKRBtR" alt=""><figcaption></figcaption></figure>

This is where supervised fine-tuning becomes valuable. By training the model on a set of **validated examples** that demonstrate proper academic summaries, the model learns to provide more comprehensive and appropriate responses. These examples might include structured sections (introduction, methodology, results, conclusions), critical analysis of the methodology, limitations of the study, and connections to related research – all following academic writing conventions.

<figure><img src="/files/6HG2qYLIJIftaAl3NMP3" alt=""><figcaption></figcaption></figure>

Through supervised fine-tuning with validated training examples, the model learns to enhance its responses while maintaining accuracy, effectively adapting its output style to match the requirements of academic writing and research analysis.

### **Supervised Fine-Tuning Strategies**

In this section, we will be discussing useful supervised fine-tuning techniques that can help you effectively adapt pre-trained language models for your specific use cases. These techniques will enable you to achieve better performance and more consistent outputs aligned with your requirements.

{% content-ref url="/pages/YmnNkCW9YSvNT6gEXfm6" %}
[Full Parameter Fine-Tuning](/llm-guide/supervised-fine-tuning-strategies/full-parameter-fine-tuning.md)
{% endcontent-ref %}

{% content-ref url="/pages/RHpqcPkO8PKZyM1MOLLq" %}
[Half Fine-Tuning (HFT)](/llm-guide/supervised-fine-tuning-strategies/half-fine-tuning-hft.md)
{% endcontent-ref %}

{% content-ref url="/pages/wFQK5xXQiAp6tTavG0Ew" %}
[Parameter-Efficient Fine-Tuning (PEFT)](/llm-guide/supervised-fine-tuning-strategies/parameter-efficient-fine-tuning-peft.md)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://ubiai.gitbook.io/llm-guide/supervised-fine-tuning-strategies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
