Learn Before
Example of a Prompt for Sequence Completion
This is an example of a prompt that asks a large language model to complete a sequence of characters, ensuring that the syntax is correct, such as properly closing brackets or parentheses. An example prompt is: 'Complete the rest of the sequence, making sure that the parentheses are closed properly. Input: [ {'". A correct completion for this sequence would be '} ]'.
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 Prompt for Sequence Completion
Examples of Prompts for Python Code Generation
A developer has started writing a Python function but needs help finishing the implementation. They have the following code:
def calculate_factorial(n): """Calculates the factorial of a non-negative integer n.""" # Implementation needed hereThey want to use a language model to generate the rest of the function's code. Which of the following prompts is most likely to yield a correct, efficient, and contextually appropriate code completion?
Critiquing an AI-Generated Code Snippet
A developer provides a language model with the following Python code and comment, asking it to complete the function:
def find_even_numbers(num_list): # return a new list containing only the even numbers from num_listBelow are four different outputs the model could generate. Match each output to the most accurate description of its quality or potential issue.
Learn After
Example of a Prompt for Nested Bracket Completion
Chain-of-Thought Prompting
A developer is using a language model to generate a simple, syntactically correct data structure. The developer provides the model with the starting text
{"name": "Alex",and wants the model to finish it, for example, as"id": 123}. Which of the following prompts is most effectively structured to guide the model toward this specific kind of completion?Debugging a Sequence Completion Prompt
Crafting a Sequence Completion Prompt