Example of a Few-Shot Prompt for Grammar Correction
To enable few-shot learning for a grammatical error correction task, a prompt can include multiple demonstrations. For example, after establishing the system's role, the prompt provides several examples of incorrect sentences paired with their corrected versions:
SYSTEM You are a helpful assistant, and are great at grammar correction.
DEMO1 You will be provided with a sentence in English. The task is to output the correct sentence. Input: There is many reasons to celebrate. Output: There are many reasons to celebrate.
DEMO2 You will be provided with a sentence in English. The task is to output the correct sentence. Input: Me and my friend goes to the gym every day. Output: My friend and I go to the gym every day.
USER You will be provided with a sentence in English. The task is to output the correct sentence. Input: She don't like going to the park. Output:
This structure allows the language model to identify the pattern of correcting grammatical errors from the given examples before predicting the output for the new input.
0
1
Tags
Foundations of Large Language Models
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
A developer is prompting a large language model to convert customer reviews into a structured summary containing only the product's pros and cons. The initial prompt includes a single example of a review and its corresponding summary, but the model's outputs are inconsistent. Which of the following changes to the prompt is most likely to improve the model's reliability in generating the desired structured summaries?
Improving a Ticket Classification Prompt
Justifying the Use of Multiple Demonstrations
Example of a Few-Shot Prompt for Grammar Correction