GenAI Basics · Question 12 · Hard

In a transformer model, what does the self-attention mechanism do?

  1. It stores the training data so that the model can look it up later
  2. It lets each token weigh how relevant every other token in the sequence is when building its own representation
  3. It converts text into audio
  4. It removes stop words before processing
Answer and explanation

Answer: B. It lets each token weigh how relevant every other token in the sequence is when building its own representation

Explanation: Self-attention computes, for every position, a weighted combination of all positions, with weights from query-key similarity. This captures context and long-range dependencies in parallel.

Previous: A company's product price list changes every day, and its chatbot must answer… · Next: Which order of steps is correct for answering a user question with a typical…

Practise genai basics

Try a fresh set of genai basics questions with an explanation after every answer, free and without signing up: GenAI Basics practice. Or sit a full placement mock test.

More genai basics questions

More technical & programming practice

Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms · Object-Oriented Programming · DBMS

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge