Learn Before
Designing a Penalty Function for High-Quality Code Generation
Imagine you are tasked with developing a large language model that generates Python code snippets. To ensure the generated code is high-quality, you decide to implement a penalty function during the decoding process. Describe how you would design this penalty function to be flexible enough to enforce the following three distinct requirements: 1) adherence to a specific style guide (e.g., line length, variable naming conventions), 2) avoidance of specific deprecated library functions, and 3) inclusion of explanatory comments for any code block longer than 10 lines. For each requirement, explain what the penalty function would look for in the generated text.
0
1
Tags
Ch.5 Inference - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Creation in Bloom's Taxonomy
Cognitive Psychology
Psychology
Social Science
Empirical Science
Science
Related
Penalty Function Design for a Safety-Critical Chatbot
A development team is building a language model to generate historical fiction narratives. Their goal is to ensure that while the story is creative, specific entities like dates and the names of historical figures remain factually accurate. Which of the following describes the most effective application of a flexible penalty function to balance these two requirements during text generation?
Designing a Penalty Function for High-Quality Code Generation