Shift by Analogy for Compositional Zero-Shot Learning

Zanwu Liu, Bo Li, Guanglin NiuarXiv 2026

It’s late, your brain is a bit fried, and you’re trying to wrap your head around how AI can recognize something it has never actually seen. Welcome to the world of Compositional Zero-Shot Learning (CZSL).

The goal is simple to state but hard to do: if a model has seen "fresh bread" and "sliced tomatoes," can it recognize "sliced bread"? Most models struggle because "sliced" looks different on a tomato than it does on a loaf of sourdough. There’s a "modality gap" between the clean, abstract text and the messy, varied visual reality.

The paper "Shift by Analogy (SBA)" offers a clever, intuitive way to bridge this gap.

TL;DR

SBA recognizes unseen attribute-object pairs (like "sliced bread") by mathematically "hallucinating" what they should look like. It takes the visual difference between "fresh tomato" and "sliced tomato," applies that same transformation to "fresh bread," and creates a high-quality visual proxy to match against new images.

What Problem Does This Paper Address?

In CZSL, we have a vocabulary of attributes (like sliced, rusty, blue) and objects (like bread, car, dog). We train on some combinations, but at test time, we’re hit with "unseen" pairs.

Current heavyweights like CLIP are great at general associations, but they lack a specific visual reference for these new combinations. A text prompt like "a photo of sliced bread" is just a point in a high-dimensional space; it doesn't capture the specific geometric "shift" that happens to an object's appearance when it undergoes a state change. Without a visual anchor, the model is essentially guessing in the dark.

Methods

The authors introduce a "shift-then-match" process. The core is the add-subtract-add rule, which operates on image-text residuals.

Think of a "residual" ($r$) as the vector pointing from a text embedding (the word "tomato") to the average visual center of actual tomato images.

  1. The Analogy: To find the visual reference for "sliced bread" ($r_{ao}$), they look for a source object (tomato) that has been seen in both the target state (sliced) and a reference state (fresh).
  2. The Math: $$r_{sliced\_bread} \approx r_{sliced\_tomato} - r_{fresh\_tomato} + r_{fresh\_bread}$$ By subtracting "fresh tomato" from "sliced tomato," you isolate the "slicing" effect. Adding that to "fresh bread" anchors the effect to the new object.

  3. The Library: They build an "Analogy Library" of these transferred residuals.

  4. Refinement: Since this math is a bit "linear" for a non-linear world, they use a small neural network (a "refinement" MLP) to polish these estimates into visual proxies.
Figure 1. Making unseen compositions visually seen. (a) Three seen pairs support the missing sliced bread. (b) Constructing the missing visual reference by analogy. Cosine similarity to the visual center is shown for text and SBA’s cross-object proxy, averaged over 400 unseen MIT-States compositions.

During recognition, the model uses two branches: one that looks at these cross-object analogies and another that looks at other states of the same object (e.g., looking at "burnt bread" to help understand "sliced bread").

Figure 2. Overview of Shift by Analogy (SBA). (1) Seen image-text residuals form a support bank; add-subtract-add paths populate the analogy library. (2) Candidate lookup and same-object attention construct visual proxies for joint recognition. Flames and snowflakes denote trainable and frozen components, respectively.

Datasets

The authors tested SBA on three standard CZSL benchmarks:

  • MIT-States: 53k images of objects in various natural states (e.g., damp, cracked).
  • UT-Zappos: 29k images of fine-grained footwear (e.g., leather sandals, canvas sneakers).
  • C-GQA: 39k images of complex, real-world scenes.

Key Insights and Ideas

  • "Making the Unseen Seen": The most powerful idea here is that we don't need training images for every pair if we can model the relationship between attributes. By constructing an explicit visual proxy, the model treats "unseen" pairs almost like "seen" ones.
  • Residuals are Better than Raw Features: Instead of trying to learn a "sliced" feature that works everywhere, SBA learns how "sliced" displaces an object in feature space. This geometric approach is much more robust.
  • The Power of Averages: The model doesn't just rely on one analogy. It averages all "legal" paths (e.g., using "sliced lemon" and "sliced pizza" to help define "sliced bread"), which smooths out the noise.

Key Results

SBA consistently set new state-of-the-art records across the board:

  • Accuracy Boost: On the C-GQA dataset, SBA achieved 42.8% unseen accuracy, beating the previous best by 3.4 points.
  • Closing the Gap: On MIT-States, the cosine similarity between the model's "proxy" and the actual visual center of unseen images jumped from 0.2944 (using just text) to 0.5395 (using SBA). That’s a massive improvement in "visual alignment."
  • Qualitative Success: Visualizations (like Grad-CAM) show that SBA-trained models focus much more accurately on the relevant parts of an image—like the texture of a "frayed wire"—compared to standard baselines.

Limitations and Future Work

  • Dependency on "Legal Paths": SBA requires that the attribute you're looking for has been seen on some other object, and the object you're looking for has been seen in some other state. If you encounter a completely new object or attribute, the analogy library remains empty.
  • Linear Assumption: While the refinement MLP helps, the core logic assumes attribute changes are somewhat additive. In reality, some attributes might transform an object's appearance in ways that are too complex for simple vector math.
  • Future Directions: The authors suggest this "shift by analogy" logic could be extended to other zero-shot tasks, like recognizing complex actions in video or multi-attribute object detection.

In short, SBA proves that if you want an AI to understand the unknown, you should teach it to reason by analogy—just like we do. Now, go get some sleep. Your own neural network needs a rest.

Summary updated

BibTeX
@misc{liu2026shift,
  author = {Zanwu Liu and Bo Li and Guanglin Niu},
  title = {{Shift by Analogy for Compositional Zero-Shot Learning}},
  year = {2026},
  eprint = {2611.30342},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.30342},
}
Figure