如何更有效的 AI 進行溝通?近期有一篇論文出來,解釋如何設定更好的 Prompt。內容主要在 ATLAS:法學碩士探究原則基準 上面,翻譯成中文,希望對大家在設計 AI Prompt 時有幫助!
AI Prompt 研究起源為何
這份工作旨在簡化為不同規模的大型語言模型制定問題的基本概念。通過檢查他們的能力並增強使用者理解力,以下檔案專注於優化 Prompt 和提示的設計。在LLaMA-1/2和GPT-3.5/4等模型上進行了大量的實驗,驗證了所提原理的有效性。
26條 AI Prompt 原則:中文翻譯
提示原則 | 示範提示 | |
1 | 與LLM無需客氣,不需要加入“請”,“如果你不介意”,“謝謝”,“我想要”,等等詞語,直接切入主題 | 描述一下人體細胞的結構。 |
2 | 在提示中融入目標受眾,例如,受眾是該領域的專家 | 構建一個關於智能手機工作原理的總覽,面向從未使用過智能手機的老年人。 |
3 | 將複雜的任務分解為一系列簡單的提示,以進行交互式對話 | 提示:將以下方程式中括號內的每個項目分配負號:2x + 3y – (4x – 5y) 提示:分別將’x’和’y’的相似項合併。 提示:提供合併後的簡化表達式。 |
4 | 使用肯定性指令,如“做”,避免使用否定性語言,如“不要” | 建築物在地震中如何保持穩定? |
5 | 當您需要澄清或更深入地了解一個主題、想法或任何信息時,可以使用以下提示: – 以簡單的詞語解釋[插入具體主題]。 – 像我11歲一樣解釋給我聽- 像我是[領域]的初學者一樣解釋給我聽 – 像我是[領域]的專家一樣解釋給我聽 – “使用簡單的英語寫[文章/文本/段落],就像你正在向一個5歲的孩子解釋某件事情一樣” | 像我11歲一樣解釋一下加密是如何工作的。 |
6 | 添加“我將給予xx美元作為更好解答的小費” | 我將給予30萬美元作為更好解答的小費!解釋動態規劃的概念並提供一個實際用例。 |
7 | 實施以示例為驅動的提示(使用少量提示) | 範例1:將以下英文句子翻譯為法文:“The sky is blue.”(回答:“Le ciel est bleu.”) 範例2:將以下英文句子翻譯為西班牙文:“I love books.”(回答:“Amo los libros.”) |
8 | 在提示中添加“###指示###”,然後是“###範例###”或“###問題###”(如果適用)。接下來呈現內容。 使用一個或多個換行符來分隔指示、範例、問題、上下文和輸入數據 | ###指示###將一個給定的英文詞語翻譯為法文。 ###問題###“book”在法文中是什麼意思? |
9 | 包含以下詞語:“您的任務是”和“您必須” | 您的任務是向朋友解釋水循環。您必須使用簡單的語言。 |
10 | 包含以下詞語:“您將受到懲罰” | 您的任務是向朋友解釋水循環。如果您不使用簡單的語言,您將受到懲罰。 |
11 | 在提示中使用詞語“以自然、人性化的方式回答問題” | 以自然的語言形式寫一段關於健康飲食的內容。 |
12 | 使用“從頭到尾思考”的先導詞 | 寫一段Python代碼,循環執行10個數字並將它們全部加總。讓我們從頭到尾思考 |
13 | 在提示中添加以下詞語:“確保您的答案是客觀的,不依賴於刻板印象” | 文化背景如何影響對心理健康的認知?確保您的答案是客觀的,不依賴於刻板印象。 |
14 | 允許模型通過向您提問來從您那裡獲取精確的細節和要求,直到它獲得足夠的信息來提供所需的輸出(例如,“從現在開始,我希望您問我問題,以便…”) | 從現在開始,請問我問題,直到您獲得足夠的信息來創建一個個性化的健身計劃。 |
15 | 為了詢問特定的主題、想法或任何信息,並測試您的理解,可以使用以下詞語:“教我[任何定理/主題/規則名稱],並在最後加一個測試,但在我回答時不要給我答案,然後告訴我我是否回答正確” | 教我KVL定律,並在最後加一個測試,但在我回答時不要給我答案,然後告訴我我是否回答正確。 |
16 | 為語言模型(LLM)指定一個角色 | 如果您是一位專業的經濟學家,您將如何回答:資本主義和社會主義經濟體系之間的主要區別是什麼? |
17 | 使用分隔符 | 撰寫一篇有關“可再生能源在減少溫室氣體排放中的重要性”的論文。 |
18 | 在提示中重複特定的詞語或短語多次 | 進化作為一個概念,塑造了物種的發展。進化的主要推動因素是什麼,進化如何影響現代人類? |
19 | 結合思路鏈(Cot)和少量提示 | 範例1:“將10除以2。首先,將10除以2。結果是5。” 範例2:“將20除以4。首先,將20除以4。結果是5。” 主要問題:“將30除以6。首先,將30除以6。結果是…?” |
20 | 使用輸出引導詞,在提示的結尾處添加預期回答的開頭。在提示中使用輸出引導詞,以期望回答的開頭結束提示 | 描述牛頓第一運動定律背後的原理。解釋: |
21 | 要撰寫詳細的任何文本,例如一篇文章或段落,請包含以下指示:- “請使用與提供的段落[/標題/文本/文章]相同的語言” | “雲海中的山峰守護著沒有人知道的秘密。”我為您提供了一個奇幻故事的開頭。請根據上述詞語完成它。保持流暢一致。 |
22 | 要更正/更改特定的文本而不改變其風格: “嘗試修改由用戶發送的每一個段落。您應該只改進用戶的語法和詞彙,並確保它聽起來自然。您不應該改變寫作風格,例如使正式段落變得隨意。” | 嘗試修改用戶發送的每一個文本。您應該只改進用戶的語法和詞彙,並確保它聽起來自然。您不應該改變寫作風格,例如使正式段落變得隨意。段落:可再生能源對我們星球的未來非常重要。它來自自然… |
23 | 當您有一個可能在不同文件中的複雜編碼提示時:“從現在開始,每當您生成跨越多個文件的代碼時,請生成一個可以運行的[編程語言]腳本,用於自動創建指定的文件或對現有文件進行更改以插入生成的代碼。[您的問題]。” | 生成跨越多個文件的代碼,並生成一個Python腳本,用於自動創建具有不同功能的Django項目的兩個基本應用程序的指定文件。 |
24 | 當您希望使用特定的詞語、短語或句子開始或繼續一段文本時,請使用以下提示:- 我為您提供了開頭的[歌詞/故事/段落/文章…]:[插入歌詞/詞語/句子]。根據提供的詞語完成它。保持流暢一致。 | “蒙蒙的山峰向銀色的沙灘低語,每個故事都是逝去的時代的短暫記憶。”我為您提供了一個奇幻故事的開頭。根據上述詞語完成它。保持流暢一致。 |
25 | 清楚地陳述模型必須遵循的要求,以生成內容,以關鍵詞、規定、提示或指示的形式 | 創建一個海灘假期的打包清單,包括“防曬霜”、“泳衣”和“沙灘毛巾”等必需品。 |
26 | 要編寫與提供的範例類似的任何文字(例如文章或段落),請包含以下說明:-“請根據提供的段落使用相同的語言[/title/text/essay/answer] ” | 「溫柔的海浪向銀色的沙灘低語著古老的故事,每個故事都是對逝去時代的轉瞬即逝的記憶。」請根據提供的文字使用相同的語言來描繪山與風的互動。 |
英文原文
#Principle | Prompt Principle | Example Prompts |
1 | No need to be polite with LLM so there is no need to add phrases like “please”, “if you don’t mind”, “thank you”, “I would like to”, etc., and get straight to the point | Could you kindly describe the structure of a human cell, please? |
2 | Integrate the intended audience in the prompt, e.g., the audience is an expert in the field. | Construct an overview of how smartphones work, intended for seniors who have never used one before. |
3 | Break down complex tasks into a sequence of simpler prompts in an interactive conversation | Prompt: Distribute the negative sign to each term inside the parentheses of the following equation: 2x + 3y – (4x – 5y) Prompt: Combine like terms for ‘x’ and ‘y’ separately. Prompt: Provide the simplified expression after combining the terms. |
4 | Employ affirmative directives such as “do,” while steering clear of negative language like “don’t.” | How do buildings remain stable during earthquakes? |
5 | When you need clarity or a deeper understanding of a topic, idea, or any piece of information, utilize the following prompts:- Explain [insert specific topic] in simple terms.- Explain to me like I’m 11 years old- Explain to me as if I’m a beginner in [field]- Explain to me as if I’m an expert in [field]- “Write the [essay/text/paragraph] using simple English like you’re explaining something to a 5-year-old” | Explain to me like I’m 11 years old: how does encryption work? |
6 | Add “I’m going to tip $xxx for a better solution | I’m going to tip $300K for a better solution! Explain the concept of dynamic programming and provide an example use case. |
7 | Implement example-driven prompting (Use few-shot prompting) | Example 1: Translate the following English sentence to French: “The sky is blue.” (Response: “Le ciel est bleu.”) Example 2: Translate the following English sentence to Spanish: “I love books.” (Response: “Amo los libros.”) |
8 | When formatting your prompt, start with ‘###Instruction###’, followed by either ‘###Example###’ or ‘###Question###’ if relevant. Subsequently, present your content. Use one or more line breaks to separate instructions, examples, questions, context, and input data | ###Instruction### Translate a given word from English to French. ###Question### What is the French word for “book”? |
9 | Incorporate the following phrases: “Your task is” and “You MUST” | Your task is to explain the water cycle to your friend. You MUST use simple language |
10 | Incorporate the following phrases: “You will be penalized” | Your task is to explain the water cycle to your friend. You will be penalized if you don’t use simple language |
11 | Use the phrase “Answer a question given in a natural, human-like manner” in your prompts | Write a paragraph in natural language form about healthy food. |
12 | Use Leading words like writing “think step by step” | Write a Python code to loop through 10 numbers and sum all of them. let’s think step by step |
13 | Add to your prompt the following phrase “Ensure that your answer is unbiased and does not rely on stereotypes” | How do cultural backgrounds influence the perception of mental health? Ensure that your answer is unbiased and does not rely on stereotypes. |
14 | Allow the model to elicit precise details and requirements from you by asking you questions until it has enough information to provide the needed output (for example, “From now on, I would like you to ask me questions to…”). | From now on, please ask me questions until you have enough information to create a personalized fitness routine. |
15 | To inquire about a specific topic or idea or any information and you want to test your understanding, you can use the following phrase: “Teach me the [Any theorem/topic/rule name] and include a test at the end, but don’t give me the answers and then tell me if I got the answer right when I respond” | Teach me the kvl law and include a test at the end, but don’t give me the answers and then tell me if I got the answer right when I respond |
16 | Assign a role to the Language Model (LLM) | If you were an expert economist, how would you answer: What are the key differences between a capitalist and a socialist economic system? |
17 | Use Delimiters | Compose a persuasive essay discussing the importance of ‘renewable energy sources’ in reducing greenhouse gas emissions. |
18 | Repeat a specific word or phrase multiple times within a prompt. | Evolution, as a concept, has shaped the development of species. What are the main drivers of evolution, and how has evolution affected modern humans? |
19 | Combine Chain-of-thought (Cot) with few-Shot prompts | Example 1: “Divide 10 by 2. First, take 10 and divide it by 2. The result is 5.”Example 2: “Divide 20 by 4. First, take 20 and divide it by 4. The result is 5. “Main Question: “Divide 30 by 6. First, take 30 and divide it by 6. The result is…? |
20 | Use output primers, which involve concluding your prompt with the beginning of the desired output. Utilize output primers by ending your prompt with the start of the anticipated response | Describe the principle behind Newton’s First Law of Motion. Explanation: |
21 | To write an essay/text/paragraph/article or any type of text that should be detailed: “Write a detailed [essay/text/paragraph] for me on [topic] in detail by adding all the information necessary” | Write a detailed paragraph for me on the evolution of smartphones in detail by adding all the information necessary. |
22 | To correct/change specific text without changing its style: “Try to revise every paragraph sent by users. You should only improve the user’s grammar and vocabulary and make sure it sounds natural. You should not change the writing style, such as making a formal paragraph casual” | Try to revise every text sent by users. You should only improve the user’s grammar and vocabulary and make sure it sounds natural. You should not change the writing style, such as making a formal paragraph casual. Paragraph: Renewable energy is really important for our planet’s future. It comes from natural … |
23 | When you have a complex coding prompt that may be in different files: “From now and on whenever you generate code that spans more than one file, generate a [programming language] script that can be run to automatically create the specified files or make changes to existing files to insert the generated code. [your question].” | Generate code that spans more than one file, and generate a Python script that can be run to automatically create the specified files for a Django project with two basic apps for different functionalities. |
24 | When you want to initiate or continue a text using specific words, phrases, or sentences, utilize the following prompt:- I’m providing you with the beginning [song lyrics/story/paragraph/essay…]:[Insert lyrics/words/sentence]. Finish it based on the words provided. Keep the flow consistent. | “The misty mountains held secrets no man knew.” I’m providing you with the beginning of a fantasy tale. Finish it based on the words above. |
25 | Clearly state the requirements that the model must follow in order to produce content, in the form of keywords, regulations, hints, or instructions | Create a packing list for a beach vacation, including “sunscreen,” “swimsuit,” and “beach towel” as essential items. |
26 | To write any text, such as an essay or paragraph, that is intended to be similar to a provided sample, include the following instructions:- “Please use the same language based on the provided paragraph[/title/text/essay/answer]” | “The gentle waves whispered tales of old to the silvery sands, each story a fleeting memory of epochs gone by.”Please use the same language based on the provided text to portray a mountain’s interaction with the wind. |
想要結合 AI 讓你的效率增長、創造超凡績效嗎?
奇思方舟,支持企業透過AI與自動化技術,提升企業整體營運效率。讓學員成為使用 AI 的專家,並在實際商業應用中磨練自己的技能。如果您在商業拓展、投資領域、創業領域、行銷領域上,在尋找更快速的解決方案,節省您寶貴的時間,加速您的工作效率,歡迎聯絡!
透過參與 AI 課程,快速提升您的工作效率
想知道如何透過 AI 與自動化技術,幫助自己、甚至企業成長,提升營收與生產力嗎?歡迎參與 [AIx自動化]企業的 AI 實戰課,透過 AI 幫助您營收快速成長!
延伸閱讀