LACE: Latent Alignment via Counterfactual Embeddings

Harsh Udai, Konda Reddy MopuriNeurIPS 2026

TL;DR

Vision-language models like CLIP are notoriously bad at distinguishing “a red suitcase next to a black backpack” from “a black suitcase next to a red backpack.” Trying to fix this by feeding the model tricky text variations alone actually warps its internal geometry, creating lopsided representations. LACE solves this by surgically editing both image and text embeddings directly in latent space—skipping expensive image generators entirely—to teach models compositional reasoning while keeping their shared embedding space healthy and symmetric.

What Problem Does This Paper Address?

Modern dual-encoder vision-language models (VLMs) align images and text in a shared mathematical space. While great at coarse recognition, they often act like "bags of words"—recognizing what objects and attributes are present, but failing at compositionality (knowing which attribute binds to which object, or how objects relate spatially).

A popular fix is training with hard negatives: near-miss distractors that force the model to pay attention to details. Because editing text is cheap (just swap two words!) and editing pixels is expensive and artifact-prone (requiring diffusion models or heavy curation), researchers mostly use text-only hard negatives.

The authors show this creates an asymmetric training signal: the text encoder gets a rigorous workout resolving fine-grained differences, while the vision encoder coasts. Even when benchmark accuracy goes up, the underlying shared geometry quietly breaks down. It develops hubness (where a few "super-hub" points crowd out everything else as nearest neighbors) and loses reciprocity (if Image A's closest match is Text B, Text B's closest match is no longer Image A).

Methods

To restore balance without touching pixels, the authors introduce LACE (Latent Alignment via Counterfactual Embeddings), a training-only framework that synthesizes both image-side and text-side hard negatives on the fly using pure vector math.

LACE decomposes embeddings into sparse concept weights over a fixed dictionary, swaps or edits active atoms, and reconstructs counterfactual embeddings.

Here is how LACE works:

  1. Fixed Concept Dictionary: Using a standard text encoder, they pre-compute normalized embeddings for ~14,000 curated concepts (objects, attributes, and relations) to act as reusable "semantic atoms."
  2. Sparse Concept Decomposition: Given an image or text embedding, LACE uses sparse coding (Lasso regression) to approximate that vector as a sparse mixture of dictionary atoms. To avoid editing noise, it filters for atoms that have both high sparse weights and high cosine similarity to the original embedding.
  3. Latent Surgery: To create a counterfactual (say, turning a sheep into a zebra in latent space), LACE swaps the active source atom in the dictionary with a same-type target atom, then multiplies it back by the original sparse weights. Because non-edited weights stay untouched, the surrounding context (like grassy backgrounds) is preserved.
  4. Symmetric Training: Both image and text counterfactuals are fed into a symmetric contrastive loss (tested on both CLIP's softmax InfoNCE and SigLIP's pairwise sigmoid loss). At inference time, all LACE machinery is discarded—zero extra overhead.

Datasets

No new datasets are introduced, though the authors build a diagnostic suite around existing ones:

  • Fine-Tuning: MS-COCO image-caption pairs.
  • Geometry Diagnostics: A fixed 50k subset of CC3M (Conceptual Captions 3M).
  • Compositional Benchmarks: COLA, What’sUp, Winoground, SugarCrepe (SC), and SugarCrepe++ (SC++).
  • Transfer, Retrieval & Visual Detail: ImageNetV2 (zero-shot classification), MS-COCO and Flickr30k (retrieval), and MMVP-VLM (fine-grained visual patterns).

Key Insights and Ideas

  • Standard retrieval metrics lie about space health: High Recall@K can mask a warped latent topology. Text-centric hard-negative methods (like NegCLIP, DAC, and CE-CLIP) boost compositional scores while causing severe hubness spikes and reciprocity drops.
Table 1: Global embedding-geometry diagnostics on CC3M-50k (K = 10). Hubness is measured by Gini and Top-1% mass (lower is better, ↓). Reciprocity measures neighborhood symmetry (higher is better, ↑). Top-1% mass and reciprocity are reported in %.
  • The "Fragility Gap" in local edits: Measuring how far an embedding moves when you swap a word doesn't tell you if the neighborhood is stable. Some models move embeddings only slightly under an edit, yet suffer high "brittle failure" rates (still retrieving the wrong counterfactual image).
  • Visual pressure is the missing ingredient: Methods that constrain the image branch (even expensive generative ones like TripletCLIP, and now lightweight LACE) maintain far healthier cross-modal symmetry than text-only perturbations.

Key Results

Fine-tuning OpenCLIP (ViT-B/32) with LACE yields broad compositional gains without sacrificing general capabilities or distorting embedding geometry:

Benchmark summary comparing LACE against baseline CLIP and prior hard-negative methods.
  • Compositional & Visual Boosts: Over base CLIP, LACE jumps +16.19% on COLA (to 39.05%), +21.28% on SugarCrepe Add (to 93.96%), and +8.14% on fine-grained MMVP-VLM (to 35.56%).
  • Preserved Transfer: Unlike several baselines that tank zero-shot classification (e.g., CE-CLIP drops ImageNetV2 from 55.96% to 43.32%), LACE slightly improves ImageNetV2 Top-1 to 56.66% and boosts average retrieval by +8.41%.
  • Healthier Geometry: Compared to a matched fine-tuning baseline, LACE raises Mutual Reciprocity@10 from 46.57% to 51.41%, lowers image-to-text hubness (Gini drops from 0.480 to 0.455), and cuts local edit brittle failure rates by more than half (from 3.27%/4.65% down to 1.10%/1.60%).
  • Architecture Agnostic: Applied to SigLIP (ViT-B/16), LACE lifts the overall compositional average from 45.76% (fine-tuned baseline) to 49.44%.

Limitations and Future Work

  • Dictionary Bottlenecks: LACE's edits are only as good as its fixed 14k-concept dictionary and sparse solver; rare, highly abstract, or out-of-vocabulary concepts may decompose poorly.
  • High-Level Approximations: Latent vector edits approximate semantic shifts well, but they cannot capture nuanced, low-level pixel appearance changes (like lighting or texture shifts).
  • Future Work: The authors highlight extending latent counterfactual supervision beyond dual-encoder retrieval models into generative multimodal models (MLLMs).

Summary updated

Abstract

Improving compositional understanding in CLIP-style vision-language models remains difficult, models with strong coarse alignment often fail on attribute binding, relations, and multi-object semantics. A common remedy is text-side hard negatives (negations, perturbations, or mined confusions), but concentrating difficulty on the text branch can skew the training signal, exacerbate modality asymmetry, and distort joint-space geometry (e.g., increased hubness and reduced mutual reciprocity), even when Recall@K improves. We propose LACE (Latent Alignment via Counterfactual Embeddings), a lightweight approach that injects structured, semantics-preserving latent edits into the image and text embedding streams without pixel-space editing or external generators. LACE synthesizes counterfactual image and text embeddings by attenuating, swapping, or transplanting a small set of factors tied to target objects, attributes, or relations, producing image-side and text-side hard negatives that rebalance supervision while preserving global alignment. Across compositional and retrieval benchmarks, LACE improves robustness to binding and relational confusions and yields a healthier embedding geometry with improved reciprocity and competitive hubness/local-stability trade-offs.
BibTeX
@inproceedings{udai2026lace,
  author = {Harsh Udai and Konda Reddy Mopuri},
  title = {{LACE: Latent Alignment via Counterfactual Embeddings}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=OhzpFEscSy},
}
Figure