跳到正文
DEV Community· Bella·· 3 小時前AI 評分40

提示詞工程:我如何學會讓生成式 AI 給出更好的答案

Prompt Engineering: What I Learned About Getting Better Answers from Gen AI

AI 導讀

提示詞工程可改善生成式 AI 的回答;Google Digital Skills 課程提供了「任務 + 背景 + 參考資料 + 評估 + 迭代」的提示詞框架。輸出可能含有模型幻覺,因此需要閲讀並評估結果,再按需要調整提示詞。

正文

Generative AI: what is it?

The biggest challenge in using such a powerful tool as generative AI is learning how to get better answers, and how that process can be automated in some way.

I've been studying some ways to do that, and I came across prompt engineering. I really like the approach I found in the Google AI Prompt Essentials course.

Generative AI (or GenAI, for short) is software that takes a prompt, understands your request, and generates a response. It can create text, summaries and emails, answers to questions, reports and insights, computer code, images, translations, and call summaries.

Generative AI sits under the AI umbrella:

Artificial Intelligence → Generative AI → Large Language Models (LLMs) → tools such as ChatGPT

The consequence of a bad prompt

This is a gray zone. Every time you create a different prompt, you can receive a very different output. If you simply ask, "Generate a script to tell my team how to sell more," that's very vague. Which team? Sell what? What information should it use? Do you have references?

The GenAI will return a script, but it will be very poor and unfocused, because it doesn't know what you really need. That's why prompt engineering is so important.

The framework

While studying prompt engineering on Google Digital Skills, I learned a good framework that helped me get better outputs. Basically, you write your prompt based on:

Task + Context + References + Evaluate + Iterate

Evaluate: It's critical to actually read the output and evaluate whether it's coherent and heading in the direction you want for your idea.

GenAI can have hallucinations: when it returns a very confident answer that is incorrect or made up. This can happen because AI works by prediction. It's likely to produce whatever comes next based on patterns, but it doesn't "know" everything. Be careful!

Main takeaways

• A framework helps, but you can also explore other ways to improve your prompt.
• Don't rely on outputs with your eyes closed.
• Refined prompt, better results!

來源:DEV Community · dev.to