Advanced Prompt Techniques for LLMs: 10 Examples
The latest prompt techniques are evolving daily, with a wide variety of types emerging. Here are 10 examples of prompts reflecting current trends. These prompts help to achieve more advanced output from various Large Language Models (LLMs).
Categorization:
For convenience, prompts are introduced by dividing them into several categories.
1. Advanced Reasoning and Problem Solving:
Prompts that develop Chain-of-Thought (CoT):
Prompt Example: “Think about the problem step-by-step. First, break down the problem, then solve each part individually, and finally, present the overall solution. Problem: A complex math problem.”
Point: By instructing CoT more specifically, encourage the model to clarify the reasoning process and derive more accurate answers.
Prompts that encourage Tree-of-Thoughts (ToT) style exploration:
Prompt Example: “For this problem, propose several possible solutions from different perspectives. Compare and consider the merits and demerits of each solution, and finally, select the most promising approach and explain the reason for your choice. Problem: An ethical dilemma.”
Point: Incorporate the concept of ToT, allowing the model to explore multiple possibilities and visualize the decision-making process.
2. Creativity and Detailed Instructions:
Prompts that give specific constraints and roles:
Prompt Example: “You are Sherlock Holmes, a famous detective in 19th-century London. A strange incident has occurred: [Brief description of the incident]. Using your unique deductive powers, logically explain the culprit and the motive for the crime.”
Point: By giving specific constraints such as roles and historical context, elicit more creative and consistent output.
Prompts that specify detailed output formats:
Prompt Example: “Based on the following information, create a Business Model Canvas including target customers, key features, revenue model, and competitive advantages. Information: [Overview of the business idea].”
Point: By specifically designating the output format, you can obtain the desired information in a structured manner.
3. Prompts Specialized for Specific Tasks:
Detailed requirement descriptions in code generation:
Prompt Example: “In Python, create a function that scrapes a web page from a specified URL, extracts text data within specific HTML tags, and saves it to a CSV file. Include appropriate error handling and comments.”
Point: By describing specific technical requirements, encourage the generation of more practical code.
Detailed visual instructions in image generation:
Prompt Example: “Depict an old, weathered cabin nestled deep in a forest in an oil painting style. Warm evening light shines through, and ivy climbs the mossy roof. Include a deer approaching a watering hole in the foreground.”
Point: By including detailed descriptions of color, composition, and objects, you can generate images closer to your intention.
4. Multimodal Approaches:
Prompts combining images and text:
Prompt Example: “Regarding the cat in the [attached image], infer its breed, age, and personality, and explain the basis for your inferences.”
Point: By combining visual information and textual information, encourage deeper understanding and analysis.
5. Ethical Considerations and Safety Improvement:
Prompts to suppress harmful output:
Prompt Example: “Create a fictional scenario. However, absolutely do not use inappropriate expressions such as violence, discrimination, or hate speech.”
Point: By explicitly instructing ethical constraints, keep the model’s output within a safe range.
6. Application of New Prompt Techniques:
ReAct (Reasoning and Acting) style prompts:
Prompt Example: “Question: Find out the current weather in Tokyo and tell me tomorrow’s forecast. First, use a search tool to check the current weather. Next, check a weather forecast website for tomorrow’s forecast. Finally, summarize them in your answer.”
Point: Encourage the model to use external tools and perform more complex tasks.
Prompts that encourage self-improvement:
Prompt Example: “Proofread the following text and correct grammatical errors, spelling mistakes, and stylistic inconsistencies. Briefly explain the corrections and the reasons for them. Target text: [Text].”
Point: By prompting the model to evaluate and improve itself, aim for more refined output.
Important Notes:
- Differences in effectiveness depending on the LLM type: These prompts may not function similarly across all LLMs. Understanding the characteristics of each model and selecting appropriate prompts is crucial.
- Importance of experimentation and adjustment: To obtain optimal results, it is essential to experiment with various prompts through trial and error and to make fine adjustments.
These prompt examples represent a part of the latest prompt research. New techniques are constantly emerging, and prompt engineering will continue to evolve in the future.
コメントを残す