# AI Generated Content (AIGC) models talk
2023/05/12
https://docs.google.com/presentation/d/1o5a0jjOm9cs0HbtwPmI2YALqIazvJyl9wHI4LWbIRtM/edit?usp=sharing
## Content
### Introduction (10~15 mins) [Jimmy]
- AI evolution
- Large language model
- ChatGPT
- ???
- Image generative model
- DALLE2
- Midjourney
- StableDiffusion
- General application
### How GPT/ ~~Diffusion~~ works? (10~15 mins) [Jsaon]
- How to learn the AI model
- 上下文模型
- RL Human feedback 強化問答感
- Dataset
- Limitations of AIGC model
### Applications for aetherAI (10~15 mins) [Kaminyou]
- Prompt engineering
- Instructed tuned LM
- Princiople
- Clear and Specific instruction
- Clear != short
- Use delimiers: """, ```, ---, <>, <tag></tag>
- summarize the text delimited by triple backticks into a single sentence ```{text}```. -> 避免prompt injection (text中間有文字叫GPT遺忘)
- Ask for structured output: provide in JSON format with xxx, yyy keys.
- 給一些if/else: 讓model知道如果做不到應該回答什麼,例如請model summarize一段話成步驟,若不行,要知會
- Few-shot prompting:讓model先知道style
- Give the LM the time to think
- 提供steps讓GPT model完成: 一段話->取出資料->做成JSON 或是 summarize->翻譯成中文->取出一些資料->做成某format
- 對於一個 問題答案pair 請model先自己想答案,再回答某個題目的答案對不對
- Limitation
- Hallucination: 看起來對的但是是錯的
- 如何避免:請model先找相關領域的資料,再根據資料回答
- Iterative prompt development: 根據答案不斷修正prompt
- 一開始產生的太長,修正prompt加上限制字數,或是限制sentence數量,或是限制char數量
- 請model產生時多focus上某些方面上
- 可以最後多一點操作,例如請model summarize後產生HTML
- Summarize (app.)
```py
prompt = f"""
Your task is to generate a short summary of a product \
review from an ecommerce site.
Summarize the review below, delimited by triple
backticks, in at most 30 words.
Review: ```{prod_review}```
"""
```
```python
prompt = f"""
Your task is to generate a short summary of a product \
review from an ecommerce site to give feedback to the \
Shipping deparmtment. # ++details
Summarize the review below, delimited by triple
backticks, in at most 30 words, and focusing on any aspects \
that mention shipping and delivery of the product.
Review: ```{prod_review}```
"""
```
```python
prompt = f"""
Your task is to generate a short summary of a product \
review from an ecommerce site to give feedback to the \
pricing deparmtment, responsible for determining the \
price of the product. # specific focus on some part
Summarize the review below, delimited by triple
backticks, in at most 30 words, and focusing on any aspects \
that are relevant to the price and perceived value.
Review: ```{prod_review}```
"""
```
```python
# extract but not summarize
prompt = f"""
Your task is to extract relevant information from \
a product review from an ecommerce site to give \
feedback to the Shipping department.
From the review below, delimited by triple quotes \
extract the information relevant to shipping and \
delivery. Limit to 30 words.
Review: ```{prod_review}```
"""
```
- Inferring (zero-shot)
- sentiment (+/-)
```python
prompt = f"""
What is the sentiment of the following product review,
which is delimited with triple backticks?
Review text: '''{lamp_review}'''
"""
```
```python
prompt = f"""
What is the sentiment of the following product review,
which is delimited with triple backticks?
Give your answer as a single word, either "positive" \
or "negative".
Review text: '''{lamp_review}'''
"""
```
- emotions
```python
prompt = f"""
Identify a list of emotions that the writer of the \
following review is expressing. Include no more than \
five items in the list. Format your answer as a list of \
lower-case words separated by commas.
Review text: '''{lamp_review}'''
"""
```
- identify anger
```python
prompt = f"""
Is the writer of the following review expressing anger?\
The review is delimited with triple backticks. \
Give your answer as either yes or no.
Review text: '''{lamp_review}'''
"""
```
- extract something
```python
prompt = f"""
Identify the following items from the review text:
- Item purchased by reviewer
- Company that made the item
The review is delimited with triple backticks. \
Format your response as a JSON object with \
"Item" and "Brand" as the keys.
If the information isn't present, use "unknown" \
as the value.
Make your response as short as possible.
Review text: '''{lamp_review}'''
"""
```
- do multiple tasks
```python
prompt = f"""
Identify the following items from the review text:
- Sentiment (positive or negative)
- Is the reviewer expressing anger? (true or false)
- Item purchased by reviewer
- Company that made the item
The review is delimited with triple backticks. \
Format your response as a JSON object with \
"Sentiment", "Anger", "Item" and "Brand" as the keys.
If the information isn't present, use "unknown" \
as the value.
Make your response as short as possible.
Format the Anger value as a boolean.
Review text: '''{lamp_review}'''
"""
```
- Infer $N$ topics
```python
prompt = f"""
Determine five topics that are being discussed in the \
following text, which is delimited by triple backticks.
Make each item one or two words long.
Format your response as a list of items separated by commas.
Text sample: '''{story}'''
"""
```
- Check topics **This is robust**
```python
prompt = f"""
Determine whether each item in the following list of \
topics is a topic in the text below, which
is delimited with triple backticks.
Give your answer as list with 0 or 1 for each topic.\
List of topics: {", ".join(topic_list)}
Text sample: '''{story}'''
"""
```
- Transform
```python
prompt = f"""
Translate the following English text to Spanish: \
```Hi, I would like to order a blender```
"""
```
```python
# tone
prompt = f"""
Translate the following from slang to a business letter:
'Dude, This is Joe, check out this spec on this standing lamp.'
"""
```
```python
# Spellcheck/Grammar check
prompt = f"""Proofread and correct the following text
and rewrite the corrected version. If you don't find
and errors, just say "No errors found". Don't use
any punctuation around the text:
```{t}```"""
```
```python
# Spellcheck/Grammar check
prompt = f"proofread and correct this review: ```{text}```"
```
```python
# Spellcheck/Grammar check
prompt = f"""
proofread and correct this review. Make it more compelling.
Ensure it follows APA style guide and targets an advanced reader.
Output in markdown format.
Text: ```{text}```
"""
```
- Expanding
- Customize the automated reply to a customer email
- Tempature!
- Email/Document embellishment
- Proposal
- Paper polish or translation
### Security issues [Kaminyou]
- Does your question reveal any business secret
### Some useful tools
- [ChatGPT-Shortcut](https://www.aishort.top/en/): 讓生產力加倍的ChatGPT 快捷指令,按照領域和功能分區,可對提示詞進行標籤篩選、關鍵詞搜索和一鍵複製。
- [ChatPDF](https://www.chatpdf.com/): 基於ChatGPT API 的讀取PDF 工具ChatPDF:可以直接把需要閱讀的pitch deck、白皮書、文檔、論文、圖書餵給它,讓它做總結和提問