Dual-encoder vision-language models (VLMs) like CLIP and SigLIP excel at zero-shot retrieval but frequently stumble on compositional constraints. A logical query such as "umbrella and no person" often retrieves images containing both, even when the model can reliably detect each concept in isolation. This paper identifies the root cause of this "logical blind spot" and introduces a training-free solution, Logic-Constrained Score Editing (LCSE), which significantly boosts compositional accuracy while preserving standard retrieval performance.
The Root Cause: The "Bag-of-Concepts" Bottleneck
Why do VLMs fail at basic logic? The authors trace this failure to the holistic similarity interface itself. In dual-encoder architectures, text and image are compressed into single vectors, and their match is determined by a scalar dot product.
Through span-residual decomposition, the authors demonstrate that this scalar value behaves like a "Bag-of-Concepts" aggregator. It effectively averages the evidence for every concept mentioned in the prompt, ignoring logical operators like "and," "or," or "not." Even if the text embedding contains operator-dependent signals, they are relegated to a tiny residual that is too weak or misaligned to override the dominant concept span. Consequently, mentioning a concept—even to explicitly negate it—acts as positive evidence for its presence.
The Solution: Factored Inference and LCSE
Fine-tuning models to understand negation often degrades their general retrieval capabilities because the bottleneck is how similarity aggregates evidence, not just what the encoders represent. Instead, the authors propose Factored Inference, which separates evidence extraction from constraint execution.
Their method, LCSE, operates as an interface-level fix using frozen encoders:
- Parsing: A lightweight LLM (e.g., GPT-4o-mini) parses the query into atomic concepts and logical operators (e.g., "A AND NOT B").
- Evidence Extraction: The frozen VLM calculates individual similarity scores for each atomic concept.
- Calibration: Raw scores are converted into probabilities ($p$) using a sigmoid function calibrated on a small held-out dataset.
- External Logic: Boolean constraints are executed using Power Means. Conjunctions (AND) use a harmonic-like mean to emphasize the weakest link, disjunctions (OR) use a high-power mean to emphasize the strongest evidence, and negations (NOT) are calculated as $1 - p$.
- Score Editing: Rather than replacing the original score, LCSE applies an additive correction to the holistic similarity. This enforces strict logical constraints while preserving the "vibes" (style, lighting, spatial context) captured by the base VLM.
Evaluation and Key Results
The authors evaluated LCSE across several benchmarks, including FACTOR-Bench, a newly introduced diagnostic dataset containing 1,695 samples. FACTOR-Bench uses "operator-contrastive pairs" (e.g., "car or bicycle" vs. "car and bicycle") to ensure models are executing logic rather than relying on keyword matching.
- FACTOR-Bench: LCSE achieved 85.5% accuracy, vastly outperforming base CLIP (58.3%) and the best fine-tuned baseline, NegationCLIP (73.2%). When applied to the newer SigLIP 2 model, accuracy reached 90.7%.
- NegBench: On the COCO MCQ task for negation handling, LCSE improved accuracy from 27.2% to 65.2%.
- Zero Degradation: LCSE maintained a 0.999 Spearman correlation with original CLIP rankings on standard retrieval tasks (COCO & PASCAL Sentences), meaning it only alters scores when explicit logical operators are present.
- Efficiency: The method adds only about 4% wall-clock overhead during retrieval.
Limitations and Future Directions
While highly effective, LCSE relies on accurate LLM parsing; if the parser fails to identify the logical structure, the system defaults to the flawed holistic score. Furthermore, external logic cannot fix a VLM's inability to detect rare or complex atomic concepts.
Currently focused on Boolean logic (AND, OR, NOT), the authors suggest that future work could extend this factored approach to other compositional structures, such as attribute binding ("red car" vs. "blue car"), spatial relations, and counting.
Summary updated