Model tuning
With Yandex Foundation Models, you can tune YandexGPT Lite and Llama 8B1 text generation models and YandexGPT Lite-based classifiers using the LoRA
Model tuning in Yandex Foundation Models is at the Preview stage.
Fine-tuning text generation models
You cannot fine-tune a text generation model based on new data, e.g., the knowledge base of your support service. However, you can train the model to generate responses in a specific format or analyze texts. You can train the model to:
- Summarize and rewrite texts.
- Generate questions and answers from text input.
- Provide responses in a particular format or style.
- Classify texts, queries, and conversations.
- Extract entities from texts.
Fine-tuning in Foundation Models
For more information on tuning data requirements, see Text generation datasets and Text classification datasets.
You need to upload the prepared data to Yandex Cloud as a dataset. By default, you can upload up to 5 GB of tuning data into one dataset. For all limitations, see Quotas and limits in Yandex Foundation Models.
After you upload a dataset, start tuning by specifying its type and parameters (optional). Tuning can take from 1 to 24 hours depending on the amount of data and system workload.
For a model tuning example, see Tuning a text generation model.
You will need an ai.editor
role for model tuning in Foundation Models. This role allows you to upload data and start the tuning process.
Requests to fine-tuned models
Once you complete tuning your model, you will get its ID. Provide this ID in the modelUri
field of the request body. You can submit requests to a fine-tuned text generation model through the text generation API, AI Assistant API, or from Yandex DataSphere and other applications. To send a request to a fine-tuned classifier, use the classify Text Classification API method. You can also use Yandex Cloud ML SDK to work with fine-tuned models:
Note
To make sure the fine-tuned model works properly, specify the prompt used for training in the message with the system
sender role.
To send API requests in DataSphereai.languageModels.user
role.
Examples
1 Llama was created by Meta. Meta is designated as an extremist organization and its activities are prohibited in Russia.