Basics of Prompt Engineering
Basics of Prompt Engineering
Engineering
Prompt:
Explain antibiotics
A:
Output:
Prompt:
Output:
Prompt:
Output:
There are many ways we can improve the results above, but this is
already very useful.
Question Answering
● One of the best ways to get the model to respond to specific answers is to
improve the format of the prompt.
● A prompt could combine instructions, context, input, and output indicators to
get improved results.
● While these components are not required, it becomes a good practice as the
more specific you are with instruction, the better results you will get.
● Next is an example of how this would look following a more structured
prompt.
Example:
Prompt:
Answer the question based on the context below. Keep the answer short.
Respond "Unsure about answer" if not sure about the answer.
Context: Teplizumab traces its roots to a New Jersey drug company called
Ortho Pharmaceutical. There, scientists generated an early version of the
antibody, dubbed OKT3. Originally sourced from mice, the molecule was able
to bind to the surface of T cells and limit their cell-killing potential.
In 1986, it was approved to help prevent organ rejection after kidney
transplants, making it the first therapeutic antibody allowed for human
use.
Answer:
Output
Output:
Mice.
One application where LLMs are quite effective is code generation. Copilot is a great example of
this. There are a vast number of code-generation tasks you can perform with clever prompts.
Let's look at a few examples below.
Prompt:
/*
*/
Output
Output:
console.log(`Hello, ${name}!`);
You can see that we didn't even need to specify the language to use.