Learn Before
LLM Application: Code Completion
Large Language Models that have been trained on datasets containing both natural language and programming code can be prompted to carry out code completion tasks.
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
LLM Application: Code Completion
An AI research lab trains two language models of similar size and architecture. Model A is trained exclusively on a vast corpus of natural language texts. Model B is trained on the same text corpus plus a large volume of programming code. When evaluated on tasks requiring complex, multi-step logical reasoning (such as solving intricate word puzzles), Model B significantly outperforms Model A. What is the most likely explanation for Model B's superior reasoning ability?
Improving LLM Logical Reasoning
Strategic Data Selection for LLM Development
Learn After
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.