Which LLM Feature Converts Natural Language Comments to Code?
Short answer
B Text generation
Question
Key Takeaways
The key distinction is that text generation creates entirely new content from scratch based on a prompt, while text completion simply continues or finishes an existing piece of text — code generation from comments requires generating new content, not just completing existing code.
This question tests knowledge of LLM capabilities, specifically distinguishing between text generation and text completion when converting natural language comments into executable code. The community largely agrees that text generation is the correct answer for producing code from natural language descriptions.
Common mistake: Many candidates choose text completion (C) because they view code generation as 'completing' a comment with code, but this misunderstands that text completion refers to finishing partial text/code, not generating entirely new content from natural language descriptions.
Expert Analysis
Understanding LLM Capabilities for Code Generation
When a company wants to use large language models to produce code from natural language code comments, they need an LLM feature that can generate entirely new content based on descriptive input. This is fundamentally a text generation task.
Why Text Generation is Correct
Text generation refers to the capability of LLMs to create new, original content based on input prompts. When you provide a natural language comment like "Calculate the factorial of a number," the LLM must generate completely new code that didn't exist before. The model is not simply finishing or extending existing code — it's creating new content from scratch based on semantic understanding of the natural language description.
This aligns with how modern AI coding assistants work: you describe what you want in plain language, and the model generates the corresponding code implementation.
Why Text Completion is Incorrect
The confusion arises because some candidates view the process as "completing" a comment with code. However, text completion in LLM terminology refers specifically to continuing or finishing partial text that already exists. For example:
- Input: "def calculate_sum(a, b):\n "
- Completion: "return a + b"
Why Other Options Are Wrong
- Text summarization (A): This condenses longer text into shorter summaries — the opposite of what's needed here
- Text classification (D): This categorizes text into predefined categories, which doesn't involve creating new content
Community Consensus
The majority of candidates (75%) correctly identified text generation as the answer, recognizing that producing code from natural language requires generating new content. The 25% who chose text completion likely misunderstood the distinction between completing partial text versus generating new content from descriptions.
Official Reference
https://docs.aws.amazon.com/machine-learning/latest/dg/generative-ai.html
This link opens the official vendor documentation in a new tab.
Exam Strategy
When distinguishing between similar LLM capabilities, focus on whether the task requires creating entirely new content (generation) versus finishing existing content (completion). Code generation from natural language descriptions always falls under generation, not completion.
Community Votes
75% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 4 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 4
-
sudarshanbisht 👍 1 Answered CThe task described — producing code from natural language comments — involves continuing or completing a prompt (in this case, natural language) with appropriate code. This is best handled by the text completion capability of large language models (LLMs). You provide a prompt such as: # This function calculates the factorial of a number\n def factorial(n): The model completes the rest with actual code. Text completion is specifically designed for this kind of task, where the model infers the most likely continuation of a given input, which can be natural language or code.
-
Jessiii 👍 1 Answered BLarge language models (LLMs) that convert natural language comments into code need the ability to generate new content based on the provided input. This aligns with the text generation feature, where the model produces human-like text, including writing code from natural language descriptions.
-
may2021_r 👍 1 Answered BThe correct answer is B. Text generation is the appropriate feature for converting natural language into code.
-
aws_Tamilan 👍 1 Answered BTo produce code from natural language code comments, text generation is the appropriate feature of an LLM.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AIF-C01 Questions
Access 100 questions with complete answers and detailed explanations.
View Full AIF-C01 Practice Test →