NLP - Sequence Models for NLPWhich of the following correctly represents the formula to compute attention weights using query (Q) and key (K) vectors?ASigmoid(Q - K)BSoftmax(Q + K)CReLU(Q x K)DSoftmax(Q x K^T)Check Answer
Step-by-Step SolutionSolution:Step 1: Recall attention weight calculationAttention weights are computed by taking the dot product of query and key vectors, then applying softmax.Step 2: Match formula to optionsSoftmax(Q x K^T) shows softmax applied to Q multiplied by the transpose of K, which is correct.Final Answer:Softmax(Q x K^T) -> Option DQuick Check:Attention weights = softmax(dot product) [OK]Quick Trick: Attention weights = softmax of query-key dot product [OK]Common Mistakes:MISTAKESAdding Q and K instead of dot productUsing ReLU or Sigmoid instead of softmaxIgnoring transpose on key vector
Master "Sequence Models for NLP" in NLP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepModelTryChallengeExperimentRecallMetrics
More NLP Quizzes Sentiment Analysis Advanced - Aspect-based sentiment analysis - Quiz 5medium Sequence Models for NLP - Embedding layer usage - Quiz 13medium Sequence Models for NLP - GRU for text - Quiz 2easy Sequence Models for NLP - Padding and sequence length - Quiz 7medium Text Similarity and Search - Semantic similarity with embeddings - Quiz 8hard Text Similarity and Search - Semantic similarity with embeddings - Quiz 11easy Topic Modeling - Choosing number of topics - Quiz 10hard Topic Modeling - LDA with scikit-learn - Quiz 8hard Word Embeddings - Pre-trained embedding usage - Quiz 11easy Word Embeddings - GloVe embeddings - Quiz 13medium