Which LLM Feature Converts Natural Language Comments to Code?

A company wants to use large language models (LLMs) to produce code from natural language code comments. Which LLM feature meets these requirements?

  1. Text summarization
  2. Text generation Source Reference Answer
  3. Text completion
  4. Text classification

Community Votes

B
75%
C
25%

75% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

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.

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.

Community Discussion (4 comments)

sudarshanbisht 👍 1 Selected: C
The 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 Selected: B
Large 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 Selected: B
The correct answer is B. Text generation is the appropriate feature for converting natural language into code.
aws_Tamilan 👍 1 Selected: B
To produce code from natural language code comments, text generation is the appropriate feature of an LLM.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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"
In text completion, you're providing the beginning of something and asking the model to finish it. The task described in the question — converting natural language comments into code — requires the model to understand the intent and generate entirely new code, which is generation, not completion.

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

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.

Related Analysis

Practice All AIF-C01 Questions

Access 100 questions with complete answers and detailed explanations.

View Full AIF-C01 Practice Test →

← Back to AIF-C01 Study Guide