Learn Before
Example of a Generic Code-like Prompt Template
A generic example of a code-like prompt template can be structured with distinct fields for different parts of the prompt. For instance, a template might follow the format message = {*c1*} ... {*ck*} input: {*x*} output:, where the message field provides context or instructions, the input field holds the primary data for the task, and the output field is designated for the model's generated response.
0
1
Tags
Ch.2 Generative Models - 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
A developer wants to instruct a language model to summarize a specific block of text into one sentence. Given the structured format
message = {instruction} input: {data} output:, which of the following options correctly applies this structure for the developer's task?Debugging a Prompt Template
Constructing a Structured Prompt