date
type
status
slug
summary
tags
category
icon
password
July 29, 2023 • 4 min read
by Simon Meng, mp.weixin.qq.com • See original
Recently, I finally had the chance to start watching a series of short courses on LLMs (Large Language Models) by Andrew Ng. To keep myself motivated and accountable, I will be sharing my study notes over this period, aiming to progress together with everyone! 🤗Course link: https://learn.deeplearning.ai/
Guidelines
- For complex tasks, give AI more time: Break down a complex problem into simpler steps and let the AI solve it step by step, rather than all at once.
- If the AI's output is incorrect, feed the error back to the AI so it can reflect on the mistake; usually, this leads to the correct answer.
Iterative Process
- There is no perfect prompt; only one that continually improves based on your needs. When your prompt doesn't work, analyze the possible reasons, especially whether you have given clear enough instructions. Revise and resubmit, then iterate again based on the feedback.
- You can set specific constraints on the output, such as limiting it to a certain number of sentences, words, or characters.
Summarizing
- When having GPT analyze text, specify a focus, whether it's more on data or narrative.
- You can request a summary of specific items, i.e., only the content you designate.
- The output can also be in the form of an HTML table or JSON format.
Inferring
- Large language models can effectively replace some traditional NLP (Natural Language Processing) model functions, such as sentiment analysis, content extraction, and topic determination.
- They are more flexible to use, require no additional training, and can be directed with natural language task descriptions.
Transforming
- You can instruct GPT to provide specific information, then integrate this information into a preformatted text, which allows for a more stable output and saves tokens.
- Easily convert text between different formats, such as from JSON to HTML.
- Compare differences before and after edits using Python's
redlines
.
- Specify a particular academic writing style for the output, for example:
- Proofread and correct this review. Make it more compelling.
- Ensure it follows the APA style guide and targets an advanced reader.
Expanding
- Provide as detailed guidance as necessary for the desired response. Achieving the required level of detail often involves iterative refinement.
- The temperature parameter is proportional to the randomness and diversity of GPT's responses.
- For deterministic and stable output, use a temperature of 0 (the same input will always produce the same output).
- For more divergent and creative output, use a temperature of 0.7.
Chatbot
- In API calls, you can assign different roles: system, user, and assistant (GPT conversation history).
- With a sufficiently detailed description, you can create a bot capable of performing specific tasks. (The example in the tutorial is a chatbot that automatically takes orders and generates receipts.)
- This method can be used to feed conversation history to GPT.
- A question here: So, within a chatbot, do we continuously feed the previous context to the AI? Wouldn't that mean longer conversations would consume more tokens and memory?
- The following example seems to involve a bit of natural language programming.
Summary
- Principle: Write clear and customized instructions; break down problems to give the model ample "time" (steps) to think.
- Continuously refine your prompts until they approach the desired outcome.
- Capabilities of LLMs: summarization, inference, transformation, and expansion.
- 作者:Simon Shengyu Meng
- 链接:https://shengyu.me//article/gpt-prompt-engineering1-en
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章
DreamGaussian: The Stable Diffusion Moment of AIGC 3D Generation
How I Used AI to Create a Promotional Video for Xiaomi's Daniel Arsham Limited Edition Smartphone
3D scene editing has entered the era of AI text interaction
The Basic Principles of ChatGPT
From Hand Modeling to Text Modeling: A Comprehensive Explanation of the Latest AI Algorithms for Generating 3D Models from Text
The Correct Way to Unleash AI Creation: Chevrolet × Able Slide × Simon Shengyu Meng | A Case Study Review of AIGC Commercial Implementation