Courseiva
easyMultiple Choice

AIF-C01 Practice Question: Which component of the Transformer architecture…

Which component of the Transformer architecture allows the model to weigh the importance of different tokens in the input sequence when generating output?

⚠ Common exam trap

AWS often tests the distinction between components that add information (positional encoding) versus those that compute relationships (self-attention), leading candidates to confuse positional encoding as the mechanism for weighting token importance.

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

✓

Self-attention mechanism

The self-attention mechanism (B) is the core component that enables the Transformer to dynamically assign importance weights to every token in the input sequence relative to every other token. This allows the model to capture long-range dependencies and contextual relationships, which is essential for generating coherent output in tasks like translation or summarization.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Layer normalization

    Why it's wrong here

    Layer normalisation stabilises training by normalising activations across features within each layer; it does not compute token-to-token relevance. It is tempting because it is a core Transformer block component, but attention is the mechanism that assigns weights across input tokens when producing output.

  • ✓

    Self-attention mechanism

    Why this is correct

    Self-attention computes pairwise compatibility scores between every token and all others, producing weighted representations that emphasise contextually relevant tokens. This directly satisfies the stem's requirement to weigh token importance during output generation, unlike feed-forward layers or positional encodings, which handle transformation and ordering respectively.

  • ✗

    Positional encoding

    Why it's wrong here

    Positional encoding injects sequence-order information into token embeddings, since attention itself is order-agnostic. It is tempting because it is essential to Transformer input handling, but it only encodes positions; the weighting of token importance during generation is performed by the attention mechanism.

  • ✗

    Feed-forward neural network

    Why it's wrong here

    The feed-forward network applies the same non-linear transformation to each token position independently, mixing no information between tokens. It is tempting as a major Transformer sublayer, but cross-token weighting requires attention, which computes pairwise relevance scores before the feed-forward stage processes each position.

About these practice questions

This AIF-C01 question is part of Courseiva's 862-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AIF-C01 practice question is part of Courseiva's free Amazon Web Services 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 AIF-C01 exam.