AIGC 時代的提示 (Prompt) 基本概念與技巧 ── 以 ChatGPT 為例

Camille Xu
翻譯柑仔店
Published in
6 min readFeb 20, 2023

在 AIGC (AI-generated content) 時代,「提示工程」(prompt engineering),或者說跟 AI 溝通會變成一項特殊技能。過去在使用 AI (如AI 繪圖、AI 編曲等)需要提供機器很多的指令、調整很多的參數,進入的門檻相對較高,但在 ChatGPT 推出後,AI 應用變得平易近人,友善的介面大大的降低了人們的使用門檻。

台灣知名的求職網上,2023 年 已經有企業刊出相關職缺 ──「AI 溝通師」。

NVIDIA 執行長黃仁勳近期表示:ChatGPT 是 AI 的「iPhone 時刻」。不過要善用 ChatGPT 等 AI 技術是需要訓練跟累積經驗的。跟 AI 溝通時,如果想要得到更準確地回應,就需要對其約束範圍,並做好提示工程。

何謂提示工程?

簡單來說,就是提示者透過聰明、準確、適當長度的文字提示,設定好上下文場景,一步步把 AI 帶入場景,讓它更了解提示者的意圖,產生最符合提示者期待的結果。

Photo by Artem Maltsev on Unsplash

Facebook 粉絲頁「黑貓老師」以 AI 繪圖為例,淺顯易懂的說明提示工程的原理,以及如何下提示的技巧。

雖然網路上有許多提示工程的教學與討論,但針對語言服務相關的討論目前較少。因此基於個人經驗與試驗成果,本文以 ChatGPT 為例,分享幾個好用的「提示」(prompt) 基礎步驟和技巧:

> Proper Context:提供 ChatGPT 提示者欲建立的世界觀

  1. 建構討論的範疇
    提示:
    * Linguitronics is a language services provider based in Asia. Here are some information introducing Linguitronics: [references]
    * You are a professional translator answering user’s questions related to translations of [the issue at hand]
  2. 提供討論的範例
    提示:
    * The source text: [source context]。
    * The source text has been translated into English: [English translation]
    Provide three other translations that match the meaning of the original text based on the style of the English translation.

> Issue Statement:引導 ChatGPT 任務方向

  1. 說明特定條件或要求
    基本提示:Write a love poem
    更佳提示:As a social media editor, write a love poem for translators around the world, with a sonnet format related to valentine’s day.
  2. 提供先前已有的參考資料
    New product information: [References]
    提示:Give me 5 ad creative ideas for the new product launch.

> Request Check:確認 ChatGPT 回應符合期待

  1. 限制回覆
    提示:
    * Translate the poem into traditional chinese in the poet Yu Kwang-chung’s style.
    * Based on the 2nd ad creative idea, create headlines, body text, and calls to action for the new product.
  2. 限制格式
    提示:
    * Based on the 2nd ad creative idea, create headlines, body text, and calls to action for the new product.
    * Based on the information you provide, create a customer email to reply to complaints. Remember to remain positive and show gratitude that you value the client’s time.
  3. 跳脫框架的問法:追問(eg. 將大問題拆解成小問題)、反問、語境嘗試
    如果……為何……
    作為 [職業/角色] 你會如何……
    * As a [profession/ role], how would you…

Linguitronics 今年情人節的貼文我們就是利用上述提到的技巧,請 ChatGPT 針對我們的需求作詩贈與譯者。大家覺得成果怎麼樣呢?

不過如果 ChatGPT 這麼厲害,那麼以後我們是否就不再需要翻譯師、繪圖師、作曲家了?

Meta 的 AI 首席科學家 Yan LeCun 最近對 ChatGPT 這樣的 LLM 技術提出的看法,恰恰說明了要正確、精準的使用 ChatGPT 這樣的 LLM 技術不是輕鬆隨便下三兩句話就可以達成的事情。

MetaAI — FAIR 在二月發表的「Augmented Language Models: a Survey」一文認為:

LLMs often provide nonfactual but seemingly plausible predictions, often referred to as hallucinations.
LLMs 這樣的技術經常提供使用者非經實證但看似合理的預測,通稱「唬爛」(胡言亂語)。

對於語言服務行業來說,ChatGPT 這樣的技術會對行業帶來哪些影響還需要時間觀察。如同我一直在闡述的觀點:「人為舟,力為帆」 ──我們會不會被機器取代關鍵在於,我們是否注意人類意識的發展,而非只關注科技發展。這也是 Linguitronics 的企業理念 “Powered by People”,即「人 (才) 為舵,技術為帆」。*

了解新技術與行業趨勢,深入了解、嘗試與練習「提示工程」(prompt engineering) 或許可以為人類這艘「舟」提供更多前進的動力,但要留意技術到底會帶人類往哪個方向前進。

*本段兩句中文口號,是我們餵了 ChatGPT 一堆背景知識和材料後,ChatGPT 對於我們的觀點給出中文「詮釋」。

--

--

Camille Xu
翻譯柑仔店

是個愛幻想的夢想家,但總被誤會是理智的實踐者