One-shot learning enables a model to recognize a new pattern from one example or a very small number of examples. In phishing detection, prompt engineering can show ChatGPT one genuine email and one phishing email before asking it to classify another message. section 5.2.4 section 4.3
The technique is useful when a new pattern is too rare or specific to justify retraining a model from scratch:
- Provide representative examples of the target pattern in the prompt. section 5.2.4
- Ask the model to classify a new input using the demonstrated distinction. section 5.2.4
- Use Siamese networks when the system must learn new patterns from one or a few similar samples without full retraining. section 4.3
Teaching a phishing pattern
ChatGPT initially treats an email from a ghost domain as genuine because it has not encountered that website pattern. Supplying a genuine email and a phishing email in the prompt lets it correctly identify the previously misclassified message. The same workflow can return a classification, confidence score, and explanation through an application using the ChatGPT API. section 5.2.4
Figure 5.18 One-shot prompting to teach ChatGPT to catch a particular kind of phishing email from a specific domain.
Shows the one-shot prompt structure for teaching ChatGPT to detect a particular phishing pattern from a specific domain. section 5.2.4

