Macalinao StudioLearnAll enriched lessons ↗
High school path · 7 sectionsSwitch to college ↗

High school / LONGER LESSON 23

Multimodal learning: alignment is not cross-attention

Distinguish CLIP-style matching from a model that routes information across modalities.

Preparation: Vector similarity and attention shapes.

Plan 20–35 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.

Section 01 / 07

Represent different inputs

High-school path. Distinguish CLIP-style matching from a model that routes information across modalities.

Preparation: Vector similarity and attention shapes. Work through one section at a time. Predict the experiment result before changing its controls, then explain what the example leaves out.

Images and text begin with different structures. Encoders map them into representations that a later objective or fusion mechanism can compare or combine. A picture and its caption need translation into compatible descriptions before a similarity calculation makes sense.

Worked step 1. Encode one image and three captions.

Worked step 2. Check vector widths.

Worked step 3. Compare scores only under the model’s intended normalization.

Try it yourself. Does equal vector length prove semantic compatibility?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. The encoders and training objective must establish the useful relationship.

Section 02 / 07

Learn a contrastive match

CLIP trains image and text encoders to match paired examples against other examples in a batch. Its contrastive alignment should not be described as inherently cross-attention between every image and word token. The task resembles matching each photograph with its caption among distractors.

Worked step 1. Two images and two captions produce a 2 by 2 similarity table.

Worked step 2. Correct pairs occupy the intended diagonal.

Worked step 3. Train both retrieval directions.

Try it yourself. Is CLIP’s similarity table a token-level cross-attention map?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. It compares encoded examples in the contrastive objective.

Section 03 / 07

Cross-attention routes another stream

Cross-attention takes queries from one stream and keys and values from another. The output follows the query positions while incorporating weighted information from the other stream. Three written questions can consult five visual notes without becoming five questions.

scores: T×P; context: T×dᵥ

Worked step 1. Use T=3, P=5 and value width 4.

Worked step 2. Scores are 3 by 5.

Worked step 3. The context is 3 by 4.

Try it yourself. Which axis determines how many output positions there are?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. The query axis: three in this example.

Section 04 / 07

Similarity can miss a critical relation

Two captions can mention the same objects but reverse who acts on whom. A high global similarity can overlook counting, negation, spatial relations or a small identifying detail. A dog chasing a person and a person chasing a dog share words but tell different stories.

Worked step 1. Compare captions with reversed roles.

Worked step 2. Keep nouns unchanged.

Worked step 3. Inspect whether the system distinguishes the relation.

Try it yourself. Does a high match score establish every caption detail?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. Test the details directly with appropriate labels and counterexamples.

Section 05 / 07

Keep masking and preprocessing visible

Padding, image resizing and token selection affect what the fusion layer can observe. A model cannot reliably use evidence that preprocessing removed. Cropping a sign out of a photograph cannot be repaired merely by asking a better question about the sign.

Worked step 1. Mark a small text region in an image.

Worked step 2. Apply the production resize and crop.

Worked step 3. Check whether its pixels remain legible.

Try it yourself. Can the fusion layer recover information that was entirely discarded?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. Not from that input alone. It may guess from priors, which is different from reading the evidence.

Section 06 / 07

Evaluate claims with counterexamples

Use paired examples that differ in one important detail. Ask whether the system’s answer changes appropriately and whether it admits uncertainty when evidence is insufficient. Swap left and right, one and two, or present and absent, then check the answer.

Worked step 1. Create an image-caption pair and a minimally changed incorrect caption.

Worked step 2. Measure both scores.

Worked step 3. Inspect the margin and failure pattern.

Try it yourself. Is a positive similarity score itself a probability of truth?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. Its interpretation depends on the model and calibration procedure.

Section 07 / 07

Mastery and transfer

Bring the pieces together. First answer the checkpoint without the worked solutions. Then explain the mechanism in your own words, using one numerical example from this lesson.

CLIP’s original training is primarily… Option 1: Pairwise image-text contrastive alignment. Option 2: Always token-level cross-attention fusion. Option 3: A guarantee of exact visual counting.

Pause here and choose an answer before continuing. The checkpoint explanation follows.

Reveal worked solution

The correct choice is option 1: Pairwise image-text contrastive alignment. Contrastive alignment and cross-attention are distinct mechanisms.

Transfer task. Change one assumption in the worked example. State your prediction, calculate or test it in Workbench, then explain whether the result supports your prediction.

Reveal worked solution

Self-check rubric. Name the changed assumption, keep the other inputs fixed, show at least one intermediate calculation, and distinguish what the toy example guarantees from what would require a trained model or a real measurement.

MODERN MODEL CASE STUDY

DeepSeek V4.1 Flash: where this idea goes next

Connect image features, pixel unshuffle and modality-specific expert balancing. Follow the worked examples, then evaluate the reported gains and their limits.

Open the high-school case study →

Added October 21, 2026. This optional extension has its own complete local narration.

Sources and scope

Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.

Reset this high school path?

This removes only this path’s notes, progress and experiments from this browser.