Vision-language models such as CLIP score an image against a text by taking one dot product between two embeddings. That works for "a dog on a beach" but breaks down for queries with logical structure, such as "the object behind the cup", "every plate on the table is empty", or "a car without tires". A single similarity number cannot represent "there exists some y such that x is behind y", and it cannot represent "for all". This proposal builds a training-free inference layer that runs first-order formulas (statements with variables, relations between objects, and quantifiers like "some" and "every") directly over a frozen model's scores for image regions. It keeps uncertainty as soft truth values throughout and never commits to a hard scene graph, the explicit object-and-relation list that existing pipelines build first.
The reason this is not just plumbing is the modality gap: in contrastive models, image and text embeddings sit in separate narrow cones, so the raw cosine between them is a small, image-dependent number and not a truth value. Logic needs inputs that behave like probabilities. Our central claim is that combining many atomic scores (conjunction across objects, maximum over a quantified variable, counting) amplifies the image-dependent offset the gap introduces. Removing that offset per image is therefore the ingredient that makes first-order composition work at all. In two sentences: we lift a recent propositional score-editing method to first-order relational queries over soft region scores, and we test whether per-image, gap-aware calibration is what lets those scores be composed without a scene graph.
Core Claim and Positioning
The closest work is Similarity Is Not Logic (LCSE). It shows that CLIP-style models treat a query as a "bag of concepts", so negations and disjunctions count as positive evidence. Its fix splits a query into atoms with a small LLM, scores each atom separately, turns the scores into probabilities with a sigmoid, and combines them with power means. LCSE is explicitly propositional: it handles AND, OR and NOT over whole-image atoms, with no variables, relations or quantifiers. We reuse its operator design and extend it in two ways. Atoms become predicates over image regions or pairs of regions, and quantifiers become power means over the set of regions. A predicate here is a property or relation that can be true of an object, such as "is a cup" or "is behind".
The other anchor is DeiSAM. It handles relational first-order rules such as target(X) :- on(X,Y), type(Y,boat) by building a discrete scene graph, matching vocabulary through word embeddings, and running a differentiable forward reasoner. The authors' own analysis identifies cascading perceptual errors as its weakness: a missed edge in the graph means the reasoner works over false facts. Our proposal does not threshold anything. Every region and every relation keeps a calibrated probability, so an uncertain edge contributes partial evidence and is not silently deleted.
Three further papers shape the design. Mind the Gap explains the gap: separate encoders produce narrow cones that point in different directions at initialization, and contrastive training keeps them apart. It also warns that forcing the gap closed can hurt zero-shot accuracy and fairness. AlignCLIP shows that naively subtracting the mean offset between the two clusters damages fine-distinction ability within a modality. Together these two rule out editing the embedding space itself. We correct the scores and leave the embeddings alone. Seeing What's Not There supplies the method we borrow for the correction. It shows that comparing a caption against an anchor built from semantically neutral words isolates meaningful directions in CLIP space, and it uses this for training-free negation handling.
VALSE constrains the design. CLIP-family models perform near chance on spatial relations and on action role reversals, so we cannot expect the frozen encoder to score "behind" from a crop. Geometric relations therefore come from region boxes and depth ordering. Only semantic relations, such as "holding" or "riding", are scored by the encoder, using the crop around both regions and a prompt that describes the relation.
Research Program
The pipeline has four parts.
First, a class-agnostic region proposer (for example SAM masks) defines the domain $D$ of candidate objects.
Second, unary predicates (object types and attributes) are scored on region crops. Pairwise relations are scored either geometrically, from boxes and monocular depth, or semantically, from the encoder on the union crop.
Third, every raw score is calibrated per image against a neutral anchor:
$$p(P, r) = \sigma\big(a_P \,[\, s(r, t_P) - s(r, t_{\varnothing}) \,] + b_P\big)$$
Here $s(r,t)$ is the cosine between region $r$ and text $t$, $t_P$ is the prompt for predicate $P$, $t_{\varnothing}$ is the neutral anchor prompt, $\sigma$ is the logistic function, and $a_P, b_P$ are a slope and offset fitted once per predicate type (object, attribute, semantic relation) on a small held-out split. Subtracting the anchor score removes the part of the cosine that depends on where this image's embedding sits relative to the text cone. A plain sigmoid calibration, as used in LCSE, cannot remove that part because its parameters are shared across all images.
Fourth, an LLM parser translates the query into a first-order formula. The formula is evaluated with power means. For a formula $\phi$, existential quantification is
$$[\exists y\, \phi(y)] = \Big(\tfrac{1}{|D|}\textstyle\sum_{y\in D} [\phi(y)]^{q}\Big)^{1/q}$$
with large $q$ approximating a maximum over the domain. Universal quantification uses negative $q$, approximating a minimum. Conjunction and disjunction reuse LCSE's harmonic-like and high-power means, and negation is $1-p$. Counting queries ("two cups") are scored as the probability that exactly $k$ regions satisfy the predicate. Because each region independently satisfies it with its own probability, this probability follows a Poisson-binomial distribution, which can be computed exactly by dynamic programming.
For retrieval and classification, the formula's truth value edits the holistic CLIP score additively, as in LCSE. For segmentation, the target variable's per-region truth values rank masks.
The analysis component asks why composition fails without calibration. For each benchmark we measure how the variance of the anchor-free offset across images grows with the number of atoms and quantified variables in the formula. We expect deeper formulas to suffer more, because every atom carries the same image-dependent bias and the max and min operators select it rather than average it out. This is the testable mechanism linking the gap to logic, and it is what LOGICZSL and its relatives leave unexamined: they apply fuzzy losses directly to raw similarities.
Baselines
The naive reference is the frozen CLIP or SigLIP model scoring the full query text against the image, or against each mask crop for segmentation. It shows how much the bag-of-concepts failure costs. On FACTOR-Bench, LCSE reports 58.3% accuracy for base CLIP, and VALSE reports near-chance performance on spatial relations.
The strongest relational competitor is DeiSAM, which reports 87.83% mAP on DeiVG3 against 75.79% for LISA, and about 99% mAP on DeiCLEVR against below 15% for neural baselines. To isolate reasoning from perception, we run DeiSAM with the same region proposer, the same detector vocabulary and the same LLM parser as our method. We also run it a second time with its original components. Beating DeiSAM means higher mAP on DeiVG with matched perception. On DeiCLEVR, where synthetic scenes make scene graphs nearly perfect, we do not expect to beat it. There the claim is graceful degradation: when we randomly drop or corrupt a controlled fraction of detected objects and relations, our mAP should fall more slowly than DeiSAM's.
The strongest propositional competitor is LCSE, which reports 85.5% on FACTOR-Bench with CLIP and 90.7% with SigLIP 2, and 65.2% COCO multiple-choice accuracy on NegBench. We run it unchanged, using the same encoder and the same parser, treating each relational phrase as a whole-image atom. On FACTOR-Bench and NegBench our method should at least match LCSE, since it reduces to LCSE on Boolean queries. The real test is DeiVG, DeiRefCOCO+ and the VALSE counting and spatial-relation subsets, where LCSE has no way to bind variables. For negation, the vector correction from Seeing What's Not There reports 72.5% on NegBench COCO multiple choice, and we include it on that benchmark.
The key ablation replaces anchor-relative calibration with LCSE-style global sigmoid calibration, with the rest of the pipeline unchanged. A second ablation uses raw cosines with no calibration. Calibration parameters are fitted on the same held-out split in all variants. If anchor-relative calibration does not beat global calibration, and the advantage does not grow with formula depth, the central claim fails.
Why not just…?
Why not just use DeiSAM with a better scene-graph generator? This is a real threat. If perception becomes reliable enough, hard graphs plus forward chaining may be all that is needed, and DeiCLEVR already shows near-perfect results when the graph is clean. The noise-injection experiment settles it. If DeiSAM's mAP holds up under realistic detection error rates on DeiVG, our soft execution adds little and we would say so. Our hypothesis is that thresholding throws away exactly the uncertain evidence that relational queries depend on.
Why not just fine-tune on relational and negated hard negatives? Seeing What's Not There reports that negation fine-tuning degrades general zero-shot classification and retrieval. On FACTOR-Bench, the fine-tuned NegationCLIP reaches 73.2% against LCSE's training-free 85.5%. Fine-tuning also gives no handle on quantifiers over a variable number of objects. We will still report standard zero-shot accuracy on CIFAR-10/100 to show that our method, being training-free, leaves it untouched.
Why not just ask a large generative VLM such as LISA? On DeiVG3, LISA trails DeiSAM by twelve points (75.79% vs 87.83%), and pure neural baselines are below 15% on DeiCLEVR. For the newest large multimodal chat models we found no reported result on Lacuna for DeiVG or DeiCLEVR. We will include one such model as an unmatched-compute reference and will not claim superiority if it wins.
Why not just shift embeddings by the mean modality offset? AlignCLIP shows that this distorts neighborhoods within a modality, and a constant shift cannot remove an image-dependent bias anyway. We include the global-shift variant alongside the calibration ablation.
Proposed Experiments and Decisive Checks
The main suite uses DeiVG (stratified by relational depth), DeiRefCOCO+, DeiCLEVR with controlled perception noise, VALSE's counting, existence and spatial-relation subsets, FACTOR-Bench, and NegBench. Encoders are CLIP and SigLIP. Metrics are mask mAP, multiple-choice accuracy and VALSE pairwise ranking accuracy. We also check that ordinary retrieval on MSCOCO is preserved, using LCSE's reported 0.999 Spearman correlation with base CLIP as the bar.
Three results would be decisive. First, on DeiVG with matched perception, our method beats DeiSAM, and its advantage widens as injected noise increases. Second, on VALSE counting and on universally quantified queries we built from DeiVG annotations, the method improves on LCSE, which cannot represent these queries. Third, the gain of anchor-relative over global calibration grows with the number of quantified variables, as the offset-amplification account predicts. If the third check fails, the work is still a useful first-order extension of factored inference, but the claimed link between the modality gap and logic would be wrong, and we would report that.
References
- Similarity Is Not Logic: Factored Inference for Dual-Encoder Vision-Language Models
- DeiSAM: Segment Anything with Deictic Prompting
- Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learning
- Mitigate the Gap: Improving Cross-Modal Alignment in CLIP
- Seeing What’s Not There: Negation Understanding Needs More Than Training
- VALSE: A Task-Independent Benchmark for Vision and Language Models Centered on Linguistic Phenomena
- LOGICZSL: Exploring Logic-induced Representation for Compositional Zero-shot Learning