Learn Before
Example of a Demonstration in a Code-like Prompt
A demonstration within a code-style prompt can be presented using a key-value format. For instance, in a translation task, a demonstration might be formatted as [English] = [I have an apple.] to show the model an example of the input language and corresponding text.
0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
Example of a Code-like Prompt for Machine Translation
Example of a Generic Code-like Prompt Template
Name:Content Prompt Formatting Style
Example of a Demonstration in a Code-like Prompt
A developer needs a large language model to perform two tasks on a given text: create a one-sentence summary and extract the names of any people mentioned. Below are two potential prompt structures for this task.
Structure A:
Summarize the following text in one sentence and list the names of any people mentioned. Text: {input_text}Structure B:
[INPUT_TEXT] = "{input_text}" [TASK_1] = Create a one-sentence summary. [TASK_2] = Extract all names of people. [OUTPUT] summary: people:Which of the following statements best analyzes why Structure B is a more effective prompt design for ensuring reliable and consistent results?
Improving Prompt Reliability for Information Extraction
Using Descriptive Prompts for Complex Tasks
Critiquing a Multi-Task Prompt
Learn After
Analyze the following prompt, which is designed to extract the primary color mentioned in a product description. What is the fundamental flaw in the way the example is provided to the model?
Task: Extract the primary color from the product description. [Description] = [This t-shirt is available in many colors.] [Description] = [The vibrant red car gleamed in the sun.] [Color] =Constructing a Code-like Prompt for Entity Extraction
Refining a Prompt's Demonstrations