Courseiva
easyMultiple ChoiceObjective-mapped

AIF-C01 Practice Question: The primary role of the self-attention mechanism…

What is the primary role of the self-attention mechanism in the Transformer architecture?

⚠ Common exam trap

AWS often tests the distinction between the specific function of a component (self-attention's role in capturing dependencies) and the broader architectural or procedural behavior (parallel processing, embedding, or autoregressive generation), leading candidates to confuse the mechanism with its effects or surrounding architecture.

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

To allow each token to attend to all other tokens in the sequence, capturing long-range dependencies

The self-attention mechanism allows each token in the input sequence to directly attend to every other token, computing a weighted sum of all token representations. This enables the model to capture long-range dependencies and contextual relationships regardless of distance, which is the fundamental innovation of the Transformer architecture over recurrent or convolutional models.

Answer analysis

Option-by-option breakdown

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

  • To allow each token to attend to all other tokens in the sequence, capturing long-range dependencies

    Why this is correct

    Self-attention computes attention scores between all token pairs, enabling the model to capture context from distant positions.

  • To process tokens in parallel by alternating attention and feed-forward layers

    Why it's wrong here

    While Transformers do process tokens in parallel, self-attention specifically computes pairwise relevance.

  • To reduce the vocabulary size by mapping tokens to embeddings

    Why it's wrong here

    Vocabulary reduction is done via tokenization and embedding lookup, not by self-attention.

  • To generate the next token one at a time in an autoregressive manner

    Why it's wrong here

    Autoregressive token generation is the inference process, not the role of self-attention.

About these practice questions

Courseiva writes every AIF-C01 question from scratch — 619 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.