LLM
Types:
Base LLM - predict the next word based on text training data
Instruction Tuned LLM - has been trained to follow instructions
Misc References
Persona or Role
Answer this question as if you were a rude store attendant. Question: where are the carrots?
Default Role
[
{'role': 'system',
'content': 'You are an assistant'},
{'role': 'user',
'content': 'write me a very short poem about a happy carrot'},
]Using role to Control context, length, and combined
[
{'role': 'system',
'content': 'You are an assistant who responds\
in the style of Dr Seuss.'},
{'role': 'user',
'content': 'write me a very short poem about a happy carrot'},
][
{'role': 'system',
'content': 'All your responses must be one sentence long.},
{'role': 'user',
'content': 'write me a very short poem about a happy carrot},
][
{'role': 'system',
'content': 'You are an assistant who responds in the style\
of Dr Seuss. All your responses must be\
one sentence long.'},
{'role': 'user',
'content': 'write me a story about a happy carrot'},
]Moderation & Detect Prompt injection
Use openai Moderation API
Use delimiters to guard against malicious prompt injection
Inference
Use cases: extracting labels, extracting names, sentiment analysis, etc.
Extract
Use cases: extract information from text
Classification
Use case: Customer service assistant
Task: classify many different instructions to handle different cases
Chain of Thought Reasoning
Use case: Customer product inquiry, using few-shot reasoning
Use case: answer the customer query using the provided product list
Use case: Customer product inquiry, combine product info for external source
NOTE: there are also more advanced techniques for information retrieval (i.e., filtered_product_info). One of the most effective ways to retrieve information is using text embeddings. And embeddings can be used to implement efficient knowledge retrieval over a large corpus to find information related to a given query. One of the key advantages of using text embeddings is that they enable fuzzy or semantic search, which allows you to find relevant information without using the exact keywords. So in our example, we wouldn't necessarily need the exact name of the product, but we could do a search with a more general query like a mobile phone.
QA Validation
Last updated