Knowledge / Reasoning
verifiedLogical Constraint
Some things must never be output: a schedule with two events in one room, a molecule that violates valence, an answer contradicting a rule the domain guarantees. A logical constraint is that requirement expressed so a learned system respects it — and the interesting question is whether it is enforced or merely encouraged.
Two ways, and they are not interchangeable. Add the violation to the loss and the model learns to avoid it usually, which is cheap, differentiable and provides no guarantee. Or enforce it at decoding, where the constraint is checked against partial output and violating continuations are removed, which guarantees the property and costs a checker in the inner loop. Constrained Decoding is the second applied to output SHAPE; this is the same machinery applied to output CONTENT, which is harder because content constraints are rarely prefix-checkable.
Prefix-checkability is the property that decides which method is available. A constraint you can evaluate on a partial output can be enforced by masking, because you know at each step whether a continuation is still viable. A constraint that can only be evaluated on a complete output cannot — you would have to generate first and reject after, which turns a guarantee into a retry loop whose expected cost grows as the satisfying fraction shrinks.
rejected-generations holds 29% of the budget; rest holds the remaining 71%.
Complete outputs generated and thrown away for violating a constraint, against the ones accepted, in outputs. Drag the rejected count up to watch a guarantee become a retry loop — which is what happens whenever the constraint is not prefix-checkable.
Reviewed by opendroid · 2026-08-18
- arXiv:1805.10872 — DeepProbLog: Neural Probabilistic Logic Programming
- arXiv:2306.08302 — Unifying Large Language Models and Knowledge Graphs: A Roadmap