Example

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

Updated 2026-04-29

Contributors are:

Who are from:

Tags

Foundations of Large Language Models

Ch.3 Prompting - Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences