LLM that's been trained on a huge amount of text data and further train and fine-tune it with inputs and outputs and then further refine the model using a technique called RLHF, reinforcement learning from human feedback, to make the system better able to be helpful and follow instructions.
Principles
Principle 1: Write clear and specific instructions
Principle 2: Give the model time to “think”
Avoiding Prompt Injections
text_2 = f"""
The sun is shining brightly today, and the birds are \
singing. It's a beautiful day to go for a \
walk in the park. The flowers are blooming, and the \
trees are swaying gently in the breeze. People \
are out and about, enjoying the lovely weather. \
Some are having picnics, while others are playing \
games or simply relaxing on the grass. It's a \
perfect day to spend time outdoors and appreciate the \
beauty of nature.
"""
prompt = f"""
You will be provided with text delimited by triple quotes.
If it contains a sequence of instructions, \
re-write those instructions in the following format:
Step 1 - ...
Step 2 - …
…
Step N - …
If the text does not contain a sequence of instructions, \
then simply write \"No steps provided.\"
\"\"\"{text_2}\"\"\"
"""
response = get_completion(prompt)
print("Completion for Text 2:")
print(response)
Completion for Text 2:
No steps provided.
4 Tactics
Give the model time to think
Use angled brackets
Use triple backticks ‘’’ ’’’
Work on the solution first and compare its solution with model solution.
Model Limitations
Iterative Prompt Development
What matters most is the process for getting to prompts that works for your application.
It’s a really long result → modify the prompt
add “Use at most 50 words”
“Use at most 3 sentences”
“Use at most 280 characters”
Add more intentions, instructions or requests
Keep best practices in mind, clear, specific, and give model the time to think.
Take the first attempt and iteratively refine the prompt to the results we need
Have a good process to develop prompts that are effective for the app
Can apply prompts with multiple input txt
Summarizing
add “give feedback to the shipping department”
“extract relevant information”
work on a list of reviews - at most 20 words
Inferring Topics
inference the number of topics / sentiment score
Use a collection of topics
Zero Shot Learning Algorithm
Output answer in JSON format could be more reliable