Artificial Intelligence
Clean your AI's input, not its reasoning. The speed gains are absurd.
Researchers at CRIL demonstrate that preprocessing techniques preserving model counts dramatically speed up model sampling, enumeration, and direct access queries when formulas are compiled into d-DNNF circuits. The study tests 1,425 benchmarks and shows that removing defined variables with compatible orderings solves up to 47 more instances than no preprocessing.
Emmanuel Fabrice Omgbwa Yasse AI-assisted
2026-07-29 · 4 min read

A logical formula and a reasoning query are not the same thing, but in many AI pipelines they travel together: a knowledge base expressed in conjunctive normal form (CNF) gets compiled into a compact circuit, and that circuit answers questions about its models. For decades, practitioners have debated whether to preprocess the CNF first, and if so, which simplifications are safe. A study published by researchers at CRIL, a joint CNRS and Université d'Artois lab, offers a clear answer: preprocessors that preserve model counts, and retain the definitions of eliminated variables, unlock significant performance gains, while those that only preserve satisfiability are useless for sampling and enumeration. This mirrors a broader lesson across AI, the input pipeline often matters more than the reasoning engine, as seen in best practices for AI coding agents.
The preprocessing landscape
The paper, led by Jean Marie Lagniez and Emmanuel Lonca, examines three families of preprocessing techniques: those that preserve logical equivalence (vivification, backbone detection, occurrence reduction), those that only preserve satisfiability (variable elimination, blocked clause elimination), and those that preserve the model count by removing defined variables. For tasks like uniform sampling, direct access (returning the k-th model under a lexicographic order), and model enumeration, the distinction matters deeply.
The authors prove that satisfiability-preserving techniques like variable elimination and blocked clause elimination are fundamentally incompatible with these queries. In a simple counterexample, the formula a ∨ b reduces to ⊤ under both methods, losing all information about the original models. "From Φ' it is impossible to retrieve the models of Φ," they write, confirming a known limitation for model counting as well. This echoes a pattern in machine learning where hidden assumptions in preprocessing can silently break downstream tasks, a point explored in research on cognitive debt in AI education.
More surprising is the finding that even model-count-preserving techniques, eliminating variables that are implicitly or explicitly defined by other variables, cannot be applied directly. The preprocessed formula alone lacks the mapping needed to reconstruct the original models. However, when the eliminated variables' definitions are stored in a compatible evaluation function, the approach becomes viable for uniform sampling and complete model enumeration.
Direct access demands order
Direct access queries, where a user asks for the k-th model under a specific lexicographic variable order, add a further constraint. The authors define a "compatible order" that places all eliminated variables after their defining variables. This guarantees that the k-th model of the preprocessed formula, when extended with the evaluation function, corresponds exactly to the k-th model of the original. Two strategies emerge: either the preprocessing step fixes the tail of the variable order, or it restricts elimination to variables whose definers all appear earlier in the given order. The first eliminates more variables; the second gives the user full freedom.
Partial model enumeration is where the approach hits a hard limit. The researchers show an example where eliminating a variable defined by an XOR leads to an exponential gap between the number of partial models in the original and simplified formulas, the parity function has no compact representation, so preprocessing effectively destroys the structure needed for partial enumeration. This trade-off is reminiscent of the visibility-versus-magic tension in AI coding tools, as highlighted by Alibaba's Qoder approach.
Experimental evidence from 1,425 benchmarks
The team ran extensive experiments using the B+E preprocessor and the d4 knowledge compiler on benchmarks from previous uniform sampling studies. They tested four configurations: no preprocessing, equivalence-preserving only (equiv), equivalence plus elimination of explicitly defined variables (#equiv-explicit), and the latter with compatible ordering enforced (#equiv-explicit-ordered).
The cactus plot reveals a clear hierarchy. Equiv-only preprocessing offers marginal gains, solving only eight more instances than no preprocessing. #equiv-explicit-ordered handles 47 more instances than the baseline, a substantial improvement, while #equiv-explicit solves 55 more, though it cannot directly answer direct access queries without ordering constraints. For uniform sampling and enumeration, the authors report significant runtime reductions, with the preprocessed circuits consistently outperforming their raw counterparts. These results align with the broader push toward efficiency in AI infrastructure, as seen in DSpark's systems-level approach to LLM inference.
The work underscores a practical principle for AI engineers: if the downstream task involves model counting, sampling, or enumeration, invest in preprocessors that preserve model counts and carry the variable definitions forward. The overhead of tracking those definitions is tiny compared to the compilation time saved. For engineers building production AI systems, this lesson extends beyond logic, clean inputs are foundational, as emphasized inthe gap between prototype and production.
Get the tech essentials in 3 minutes every morning
One email, every weekday, with what actually matters in AI and tech.