Image making · Research feature

LogicVal:A Logic-Formalized Benchmark for Constraint Satisfaction in Text-to-Image Generation

The study subjects text-to-image generation models, comparing their ability to satisfy logical constraints such as object attributes, counts, and relationships involving universal or existential quantifiers.

Adapted from research by Savitha Sam Abraham, Marjan Alirezaie, Hossein Rahnama.

arXiv preprint revision · 2026-10-16 · Attribution & reuse
In this article
Editorial illustration of aperture mechanism.

Editor’s introduction

The study subjects text-to-image generation models, comparing their ability to satisfy logical constraints such as object attributes, counts, and relationships involving universal or existential quantifiers. It measures how well models perform across nine constraint types, from simple single-object attributes to complex multi-object logical conditions. Results show a sharp drop in performance—98% accuracy on simple constraints versus just 53% on complex ones—and a decline from 84% to 20% when multiple constraints are combined. The best model correctly identifies only 23% of unsatisfiable constraints, indicating difficulty in detecting logical contradictions. These findings highlight limitations in current models’ compositional reasoning and constraint satisfaction. The study introduces LogicVal, a benchmark combining visual detection with logical validation, achieving ROC-AUC scores between 0.88 and 0.98, showing strong alignment with human judgments. However, performance degrades in scenes with occlusion or deformed objects, and relies on accurate domain-specific object detection, which remains a challenge for open-vocabulary models and real-world applications.

Introduction

Text-to-Image (T2I) generative models have made impressive progress in recent years, producing images that capture both realistic scenarios and highly imaginative concepts. This progress has enabled the widespread adoption of T2I models across a range of applications including fashion, architecture, and beyond. As T2I models become increasingly capable, an important question arises: What comes next? A key challenge is moving beyond generating visually compelling images toward generating images that reliably satisfy the constraints specified in a prompt. Current T2I models typically treat prompts as a form of soft conditioning, providing no formal guarantee that all specified requirements will be satisfied in the generated image. This gap is particularly important for applications where controllability and reliability are critical. The appeal and educational potential of T2I models in medical pedagogy have been investigated by, which highlights concerns regarding their reliability in educational settings.

Enabling further progress toward controllable and reliable T2I generation requires benchmarks that can systematically characterize what a model can and cannot satisfy. Existing T2I benchmarks have made important progress in this direction, with much of the literature focusing on three core capabilities: attribute binding to objects, numeracy, and spatial relationships between objects. These benchmarks typically define their own sets of objects, attributes, and relations, together with prompt templates that are instantiated using elements from these sets. Evaluation is then commonly performed using multimodal large language model (MLLM)-based metrics like Soft-TIFA or other learned similarity measures like CLIPScore. Existing T2I evaluation often lacks a formal specification of the properties that an image is required to satisfy. We introduce such a specification, and use it to turn evaluation into a logical constraint-satisfaction problem.

T2I Image Generative Models

Text-to-Image (T2I) generation has evolved through a variety of generative modeling paradigms, including Generative Adversarial Networks (GANs), Vector-Quantized Variational Autoencoders (VQ-VAEs), diffusion models, normalizing flows, and, more recently, flow-matching models. In this work, we evaluate models spanning multiple recent T2I generation paradigms. Specifically, we evaluate Qwen-Image, which is based on diffusion, and FLUX.1-dev, which uses flow matching, as well as GPT Image, which follows an autoregressive generation paradigm. We additionally evaluate Gemini, a proprietary multimodal model with image-generation capabilities whose underlying image-generation architecture is not publicly specified in sufficient detail for a precise architectural classification.

T2I Benchmarking

Existing T2I benchmarks fall into two broad categories: those evaluating literal prompt–image alignment and those assessing reasoning based on implicit commonsense or domain knowledge. The first includes GenEval, GenEval 2, and T2I-CompBench, which assess attribute binding, object relationships, numeracy, and compositional generation. NegT2IBench focuses on negation, while GenAI-Bench also evaluates counting and universal quantification. These benchmarks primarily use predefined prompt templates, except GenAI-Bench, which uses human-curated prompts.

The second category includes reasoning-oriented benchmarks such as T2I-ReasonBench, R2I-Bench, WorldGenBench, which evaluate whether generated images reflect implicit world knowledge or scientific principles. This knowledge-intensive reasoning lies beyond LogicVal’s scope, which focuses on formally specified, explicit logical constraints.

Domain specification

The domain specification defines objects, their attributes, and inter-object relationships on which constraints can be specified. We represent the CLEVR domain, with its vocabulary of eight colours, three shapes, and two materials, and divide scenes into four regions on a 2x2 grid, following CLEVR-POC. Spatial relations left, right, front, and behind are defined by a background ASP program. Objects in different regions inherit their regions’ spatial relations, while objects within the same region are freely ordered subject to anti-symmetry, inverse, and transitivity axioms (Appendix A).

Verbalisation

A deterministic verbaliser renders each constraint in a short and a long register; the long one spells out the quantifier scope explicitly. It also produces sub-questions with expected answers, which are used by the Soft-TIFA metric (§4.3). Appendix C shows the prompt template and examples of prompts in both registers.

Benchmark composition

We generate 6 main dataset packages. Each package is a collection of prompts. A package is named by its number of constraints m followed by its label, e.g. 1SAT or 3SAT or 1UNSAT - m denotes the number of constraints to be satisfied in a single prompt. The LogicVal benchmark contains 509 prompts: 355/25 1SAT/1UNSAT, 25/10 3SAT/3UNSAT, and 25/69 6SAT/6UNSAT prompts.

Models

To help the open models produce CLEVR-style scenes with the requested vocabulary, we finetune them with LoRA on CLEVR images captioned with C1–C9 constraints that hold in them using the same natural-language templates as those used to generate the benchmark prompts (Appendix F).

Meta-Evaluation

We assess the alignment between automatic metrics and human judgments using the point-biserial correlation and the area under the receiver operating characteristic curve (ROC-AUC). Point-biserial correlation measures the strength and direction of the association between continuous metric scores and binary human judgments, while ROC-AUC measures how well a metric distinguishes between positive and negative human judgments across decision thresholds. Higher absolute point-biserial correlation indicates a stronger association, whereas a higher ROC-AUC indicates better discrimination with 0.5 corresponding to random performance and 1.0 to perfect discrimination.

Composing Multiple Constraints

We investigate whether handling multiple constraints simultaneously poses a greater challenge. Our results show that conjoining constraints sharply lowers success. Gemini-3-Pro-Image falls from 0.85 on one constraint to 0.48 on three (3SAT) and 0.20 on six (6SAT). GPT-Image-2 falls from 0.58 to 0.20 and to 0. Neither open model satisfies a single composed specification. These results suggest that satisfying multiple constraints requires explicit reasoning to guide object arrangement during generation.

Recognising Unsatisfiable Specifications

None of the tested T2I models reliably detects contradictory specifications. We evaluated their ability to recognise unsatisfiable constraints using 129 prompts with no valid solution. Gemini-3-Pro-Image correctly identified 23.25% of these specifications, abstaining by returning a blank image with a white background, as instructed. In contrast, the other models, including GPT-Image-2, almost never abstained (at most 1%), instead generating scenes that necessarily violated at least one constraint. The open models abstain on at most 2% of specifications.

Counting Errors

Every prompt states the number of objects in the scene, followed by a logical constraint drawn from C1 to C9 that must be satisfied by the objects. For example, a prompt might state: “There are 5 objects in the scene. At least 2 are red”. A model may generate an image containing at least two red objects while failing to produce five objects.

Conclusion

We formulate text-to-image generation under explicit logical requirements as a constraint-satisfaction problem and introduce LogicVal, a solver-labelled benchmark for evaluating constraint satisfaction through scene-graph verification. Our results show that current generators struggle with exact counts, universally quantified relations, and composed constraints, and rarely recognise contradictions. Widely used alignment metrics fail to capture these shortcomings for the strongest models, whereas LogicVal provides a more effective, though still imperfect, means of assessing constraint satisfaction. In future work, we aim to extend LogicVal to a probabilistic formulation that accounts for uncertainty in object attribute prediction. Future work will also explore generation pipelines that integrate probabilistic LogicVal scores for solver-guided feedback.

Human Annotation Errors

Human judgement is susceptible to perceptual errors in colour, material, and spatial relations. Human judgments may, for example, confuse cyan with blue or misidentify materials and object positions. Resource constraints limited annotation to two annotators (two of the authors), who labelled non-overlapping subsets of images, precluding inter-annotator agreement analysis.

Limitations of LogicVal score

LogicVal score’s performance degrades on complex scenes involving occlusion or deformed objects. For example, some generated shapes, particularly from open models, appeared to combine features of cylinders and cubes, leading the detector to assign one of these labels to shapes that fit neither category. Reliable evaluation also depends on improvements in both domain-specific detection models, particularly when extending LogicVal to domains such as healthcare, and open-vocabulary object detection and attribute classification.

Domain

The above definition allows deriving the spatial relations between objects based on the regions they are placed. For example, since region r0 is left of region r1, an object placed in the former region is also left of an object placed in the latter region. Every pair of distinct objects is ordered along both axes, following anti-symmetry, inverse and transitivity axioms.

LogicVal Score

LogicVal evaluation involves a perception stage that extracts a scene graph from the generated image. The resulting scene graph is then passed to the CLINGO solver alongside the constraints used to generate the image to determine whether they are satisfied. In this section, we describe the perception pipeline used to construct the scene graph.

Object Detection and Bounding Boxes: We use Grounding DINO for bounding-box (BB) detection, with a confidence threshold of 0.15. To remove duplicate detections, we apply a post-processing step that suppresses a lower-confidence detection when either: its intersection over union (IoU) with a higher-confidence detection exceeds a specified threshold or it is mostly contained within a higher-confidence detection.

CLIPScore

We use LongCLIP (LongCLIP-GmP-ViT-L-14; ), which supports text inputs of up to 248 tokens, compared with the 77-token limit of standard CLIP. Prompts in the 1SAT package fall within this limit, whereas those in the 3SAT and 6SAT packages exceed it. Tokens beyond the model’s input limit are truncated during scoring, potentially resulting in scores that do not reflect the full prompt. We report the raw cosine similarity between the image and text CLIP embeddings, without the usual rescaling.

Soft-TIFA

A cited study evaluates the correctness of a generated image by decomposing the original prompt into sub-questions and assessing the image based on the answers to these questions. We implement Soft-TIFA using GPT-4o as the visual question answering (VQA) backend.

Captions

A cited study finds a match with the instantiation (P1′: color, V1′: red). The instantiated template is then translated into it’s natural language form with the benchmark’s verbaliser. Every image is paired with a prompt that is generated in a similar way. Every prompt begins with a sentence that specifies the number of objects in the image followed by one or more constraints, e.g. “There are 6 objects in the scene. There must be at least one red object in the scene.”. The prompts are balanced across all constraint classes, with each constraint class instance occurring an equal number of times in the training set.

Batches and selection

The (prompt,image) pairs are split into batches of about 2,000. Each batch targets the same number of instances for every one of the 61 (class, template) pairs that occur in the training data, and no image is reused in a batch. Training continues from one batch to the next, initialised from the previous checkpoint. After every 50 steps, the loss is computed on a fixed, class-balanced held-out set of 99 images (11 per class) that never appear in any batch. We select the checkpoint with the lowest held-out loss: FLUX.1-dev after batch 1 (held-out loss 0.280) and Qwen-Image after batch 3 (0.048), both at 1,000 steps.

Annotation tool

The annotation was carried out by two annotators, working in a browser-based web application that shows one generated image at a time. The web application was partially developed using Claude Code. The application allows the annotator to select a T2I model, a benchmark package and an image generated by the T2I model for one of the prompts in the selected package from drop-down menus. The annotator can then edit the annotation present for the image, and every edit is saved automatically. The tool runs as a password-protected web service, which allowed both annotators to work remotely on the same files.

From annotation to verdict

For each image, the annotation is stored as a scene graph in the same format as the automatic perception output. It is converted into ASP facts (object/1, hasProperty/3, hasRelationship/3) and solved together with the instantiated specification by clingo; the image is judged correct if the solver finds the specification satisfied (or, for an unsatisfiable specification, if the scene is empty).

Per-Template Results

Gemini-3-Pro-Image satisfies most object-level (C1–C3) and plain counting (C8, C9) templates perfectly; its failures concentrate on templates that tie a requirement to a relation. The hardest template for both proprietary models is C5 pair_relA_propC (GPT-Image-2: 0.0, Gemini-3-Pro-Image: 0.2), which requires every object that stands in a given relation to another one to have a property, so the condition is triggered by the layout of the scene rather than by an attribute. Statements like ‘For all x there exists exactly n y objects such that … ’ is similarly hard (C7 1prop_exact: 0.0 and 0.4). Within C8, adding a relational context reduces the performance of Gemini-3-Pro-Image from 1.0 on most plain counts to 0.4–0.6 on four of its six relational templates, including all three negated ones.

GPT-Image-2 shows a sharper split. It is perfect on nine templates, all object-level except one counting template (C8 1prop_atmost_neg), and lies between 0.4 and 0.8 on most other object-level and counting templates. On the subgraph classes C4–C7 it never exceeds 0.6, and five of its six C7 templates (1prop_exact and the four propRel templates) score 0.2 or lower, as does C5 pair_relA_propC (0.0). Unlike Gemini-3-Pro-Image, it also struggles with count comparison: on C9 1prop, which requires two sets to be equally large, it reaches 0.2 against Gemini-3-Pro-Image’s 1.0.

Negation does not make templates uniformly harder: for GPT-Image-2 on C1, the negated two-attribute template (2prop_neg, 1.0) is easier than its positive counterpart (2prop, 0.4), while the single-attribute one shows the opposite (1prop 1.0 vs. 1prop_neg 0.4). Likewise, constraining more attributes does not consistently lower performance (C1 4prop: 0.8 vs. 2prop: 0.4 for GPT-Image-2). The open models succeed on only a few templates, with performance never above 0.4.