Prompt Templates for Fine-tuning
Overview
Columns from your dataset are incorporated into the prompt via the prompt template. (See our quickstart guide on fine-tuning.)
Include
- One (or more) columns from your dataset as a variable in curly brackets {} to indicate where to insert the input feature. Multiple columns can be inserted, e.g.: The {color} {animal} jumped over the {size} {object}, where every term in curly brackets is a column in the dataset.
Additional tips
- Provide necessary boilerplate needed to make the LLM respond in the correct way (for example, with a response to a question rather than a continuation of the input sequence).
- Provide additional context to the model that can help it understand the task, or provide restrictions to prevent hallucinations.
- For tabular datasets, you can combine multiple columns from a dataset into a single text input feature (see TabLLM).
info
In the Predibase UI, you are required to included a prompt template with at least one column from your dataset included. For more advanced users, the prompt template is not strictly required. We recommend using the SDK to edit and train a more advanced, custom config.
Examples
Sentiment Analysis:
Given the following text, classify the sentiment as positive, negative, or neutral.
Text: {input_text}
Sentiment:Text Summarization:
Summarize the following passage into a concise paragraph.
Paragraph: {paragraph}
Summary:Named Entity Recognition:
Identify and label the named entities in the following sentence.
Sentence: {sentence}
Named Entities:Language Translation:
Translate the following sentence from English to French.
Sentence: {sentence}
French Translation:Question Answering:
Answer the following question based on the provided text.
Question: {question}
Answer:Text Classification:
Assign the appropriate category label to the following text. The label choices are good, bad, neutral.
Text: {input_text}
Category Label:Paraphrasing:
Rewrite the following sentence while retaining the original meaning - the goal is to paraphrase the sentence.
Try not to use very complicated language and make the paraphrased sentences easy to understand.
Sentence: {sentence}
Paraphrase:Text Generation (Creative Writing):
Here are a few lines from a story. Continue the story by writing the next paragraph.
Story: {story}
Continuation:Conversational AI:
You are a conversation AI assistant. Generate a response for the following dialogue:
Dialog: {dialog}
Response: