🟢 Giving Instructions
- Understand instruction prompting
- Understand complex applications of instruction prompting
We will now cover our first prompting technique, instruction prompting12. We have already seen simple instructions used in previous articles (e.g. getting an AI to solve the math problem). However, we can instruct Gen AIs to do much more complex tasks.
Name Parsing Example
A common problem when collecting name data is that different people format their names differently. Some might have
Jr.. Additionally, the first and last name could be out of order. In the past, cleaning data like this has been a boring, manual task. Now, we can fully automate it with a simple prompt.
Try changing the name until you find one that the prompt does not properly handle. If you are able to do this, perhaps you will be able to improve to prompt as well! This is a fun exercise to improve your prompt engineering skills!
Personally Identifiable Information Removal Example
PII removal is another relevant task. Before releasing private documents, corporations or governments may manually redact information from documents. Gen AI can be used to remove PII automatically, removing the need for intensive human effortab.
Here is the AI's responsec:
It is very exciting to see how the model can extrapolate from the instructions. For example, it knows
Cheap Dealz with
Jimmy Smith with
[SALESPERSON], even though
we did not explicitly tell it to do so.
Essay Evaluation and Feedback Example
Gen AI can be utilized to evaluate and provide feedback on essays based on a complex set of criteria. This includes elements such as grammar, clarity, coherence, and argument quality.
The AI's response:
Instruction prompting consists of giving a Gen AI some task or direction. Although the concept is simple, Gen AIs are able to follow very complex instructions. Instruction prompting will be used frequently throughout this course.
- Efrat, A., & Levy, O. (2020). The Turking Test: Can Language Models Understand Instructions? ↩
- Mishra, S., Khashabi, D., Baral, C., Choi, Y., & Hajishirzi, H. (2022). Reframing Instructional Prompts to GPTk’s Language. Findings of the Association for Computational Linguistics: ACL 2022. https://doi.org/10.18653/v1/2022.findings-acl.50 ↩
- Allowing AI to remove PII from text is a promising approach, but it should be used with extraordinary caution as it may make mistakes.↩
- It should also be noted in this example that you are sending PII to a third-party (e.g. OpenAI if you are using ChatGPT), and these services may record and use your prompts for their own needs. c We used a different Gen AI, GPT-3, for this example.↩