A visual question answering model answers "What colour is the car?" correctly, but you want to see which image regions it used. What helps?
- Exam domain
- Data Analysis10% of the exam
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why the exam asks this
Data Analysis (10% of the exam)
Objective in the exam guide: Develop content for attention maps in multimodal settings.
Attention maps are a standard way to inspect multimodal models.
Why D is the answer
Visualizing cross-attention maps over the image
Attention maps show which image regions the model attended to for each text token, which helps check whether it looked at the car.
Remember: Attention maps show where the model looked.
How it works
Attention maps visualize which inputs a model weighted when producing an output.
In detail
- Attention maps link tokens to regions.
- They are a guide, not proof of reasoning.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Measuring the training loss curveWrongMost tempting
Loss curves show training progress, not focus.
Why it tempts: Loss curves are the usual plot, but they do not explain one answer.
B. Printing the model's parameter countWrong
Parameter count says nothing about focus.
C. Raising the batch sizeWrong
Batch size affects training, not explanation.
D. Visualizing cross-attention maps over the imageRight
Attention maps show where the model looked.
Use case
An illustrative scenario, not a real incident.
Illustrative: the heatmap shows the model looked at a red sign, not the car, so the correct answer was luck.
See it in different ways
sequenceDiagram participant P0 as Text token car participant P1 as Cross-attention participant P2 as Image patches P0->>P1: query P1->>P2: attend P2-->>P1: weights per patch P1-->>P0: heatmap
How to read this chart
- 1. Text token car sends "query" to Cross-attention.
- 2. Cross-attention sends "attend" to Image patches.
- 3. Cross-attention gets a reply from Image patches: "weights per patch".
- 4. Text token car gets a reply from Cross-attention: "heatmap".
mindmap
root(("Explainability"))
n1["Attention maps"]
n2["Token to region weights"]
n3["Grad-CAM"]
n4["Gradient-based heatmaps"]
n5["Caveat"]
n6["Correlation, not proof"]How to read this chart
- The centre is "Explainability".
- "Attention maps" covers "Token to region weights".
- "Grad-CAM" covers "Gradient-based heatmaps".
- "Caveat" covers "Correlation, not proof".
Related questions
Learn more
- Our lesson: Experiments, data quality and analysis
- Practise Data Analysis questions in the mock exam
- Source: Attention Is All You Need (arXiv)
- Source: Grad-CAM: Visual Explanations from Deep Networks (arXiv)
- Cross-validation (scikit-learn)
- Metrics and scoring (scikit-learn)
- Common pitfalls and recommended practices (scikit-learn)
- Grad-CAM: Visual Explanations from Deep Networks (arXiv)
- Matplotlib documentation