Courseiva
LLM Architecture →easyMultiple Choice

NCP-GENL LLM Architecture Practice Question

A developer is building a decoder-only generative model and wants to prevent the model from attending to future tokens during training so that each position can only use information from itself and earlier positions. Which architectural mechanism should they implement in the self-attention layer?

⚠ Common exam trap

Many candidates confuse a padding mask, which hides filler tokens, with a causal mask, which hides future tokens.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

A causal attention mask that sets attention scores for future positions to negative infinity before the softmax.

Decoder-only generative models must not see future tokens during training, otherwise next-token prediction becomes trivial and the model will not generalize to autoregressive inference. A causal attention mask accomplishes this by making future positions invisible to the softmax, ensuring each position only conditions on itself and earlier tokens.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    A padding mask that ignores tokens added to equalize sequence lengths across a batch.

    Why it's wrong here

    A padding mask only excludes padded positions from attention so they do not contribute to the output. It does not prevent a real token from attending to later real tokens, so it cannot enforce autoregressive causality in a decoder-only model.

  • ✗

    A learned positional embedding added to the token embeddings at the input layer.

    Why it's wrong here

    Positional embeddings inject order information into the token representations, but they do not restrict which positions can attend to which. Without a causal mask, a decoder-only model could still look ahead during training and fail to learn proper next-token prediction.

  • ✓

    A causal attention mask that sets attention scores for future positions to negative infinity before the softmax.

    Why this is correct

    A causal mask adds negative infinity to the attention logits of positions after the current token, so after softmax those future positions receive zero probability. This enforces left-to-right autoregressive conditioning during training and matches the inference behavior where future tokens are unavailable.

  • ✗

    A residual connection that adds the attention output back to the input hidden state.

    Why it's wrong here

    Residual connections help gradient flow and preserve information across layers, but they do not control attention visibility. They cannot prevent a token from attending to future positions, so they are unrelated to enforcing causal, left-to-right generation.

About these practice questions

One of 352 original NCP-GENL practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official NVIDIA exam blueprint

This NCP-GENL practice question is part of Courseiva's free NVIDIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the NCP-GENL exam.