OneShot Prompting (original) (raw)

One-Shot Prompting

Last Updated : 2 May, 2026

One-shot prompting is a technique where a model is given one example of a task before performing similar tasks. It helps the model understand the expected output format and improves accuracy.

Working

One-shot-Prompting

One-Shot Prompting

A typical one-shot prompt includes:

**Example (Sentiment Analysis):

The model uses the single example to infer that it should classify sentiment and then applies this logic to the new input.

Classify the sentiment of the following text as positive, negative or neutral.

**Text: The product is terrible.
**Sentiment: Negative

**Text: I think the vacation was okay.
**Sentiment: Neutral

Applications

Advantages

Limitations

Best Practices