The `SNOWFLAKE.CORTEX.FINETUNE` function enables supervised fine-tuning of supported base models using labeled conversational datasets stored within Snowflake tables or views.
When calling the function, developers must pass a query string via the `training_data_query` parameter (as well as an optional `validation_data_query`). Snowflake strictly requires that this query project two specific, named columns:
1. **`prompt`:** A string column containing the training input, instruction, or dialogue context provided to the model.
2. **`completion`:** A string column containing the expected, ground-truth completion that the fine-tuned model is trained to generate.
The fine-tuning validation engine inspects column projections; if either the `prompt` or `completion` alias is missing from the query result, the fine-tuning job fails with an invalid schema exception. The base model identifier is supplied as a separate top-level argument to the function, not as a column in the training dataset.
References & Study Guide Topics:
* Snowflake Gen AI Functions: `SNOWFLAKE.CORTEX.FINETUNE` API Syntax
* Model Adaptation: Supervised Training Dataset Schema Requirements (`prompt`, `completion`)
Submit