Class Priors from Finite Counting: Bounding PU Priors with Schema Axioms

Many weakly supervised classifiers are trained without any confirmed negative examples. They see a few labeled positives and a large unlabeled pool, and they need one number to work at all: the class prior, meaning the fraction of the population that is positive. Get that number wrong and the training objective can go negative. Deep networks then exploit the error and collapse. The damage is worst exactly when positives are rare. In relational data such as knowledge graphs, protein annotations and database-like records, that number is not free. The data obeys a schema: every employee has exactly one manager, a manager heads at most three teams, every order has at least one line item. We propose to read the prior off the schema. We compile the schema's counting rules, together with the counts already observed, into a small linear program. Solving it gives a guaranteed interval $[\pi_{\min}, \pi_{\max}]$ that every consistent completion of the data must respect. The learner's prior, and the share of unlabeled points it pseudo-labels positive, are then kept inside that interval.

This needs finite model reasoning (logic restricted to structures with finitely many objects), not ordinary logical reasoning, and the reason is concrete. Take the rules "each A is linked to exactly one B" and "each B is linked back to exactly one A." They force $|A| = |B|$ in any finite database. In the infinite models that standard ontology reasoners assume, both sets can be infinite, and the rules say nothing about their ratio. A class prior is a ratio. So the constraints that pin priors down are exactly the ones that only appear under the finite-domain assumption. The machinery for finding them already exists: the mosaic technique of Lutz et al. and Lutz et al. reduces finite satisfiability in the description logic $\mathcal{ALCQI}$ to a system of linear inequalities over object counts. That work treats the system only as a yes/no satisfiability test. We use its feasible region as a statistical constraint.

Core Claim

Description logic $\mathcal{ALCQI}$ is an ontology language with number restrictions ("at most $n$ R-neighbours of kind C") and inverse roles (following a relation backwards). Its finite-model counting system, intersected with the counts observed in a partially labeled dataset, defines a polytope of admissible type frequencies. Minimizing and maximizing the target concept's share over that polytope gives sound prior bounds. We claim these bounds are tighter than anything obtainable from unrestricted (infinite-model) entailments or from checking each axiom on its own. We further claim that confining the prior and the pseudo-label marginals to this interval prevents both prior-induced risk collapse and moving-average drift, most visibly when the true prior is below a few percent.

The central object is simple. Let $x_t \ge 0$ be the number of domain objects of type $t$, where a type is a consistent combination of the relevant concept names. For every number restriction and its inverse, the linear balance constraints of the mosaic construction must hold. A typical example is

$$\sum_{t \ni A} x_t \cdot m \;\le\; \sum_{t' \ni B} x_{t'} \cdot k ,$$

which says that if every A needs at least $m$ R-links to B, and every B accepts at most $k$ incoming R-links, then B's must be numerous enough to absorb the demand. Observed facts add lower bounds such as "at least the labeled positives are A" and fix the total domain size $N$. The prior interval is then

$$\pi_{\min} = \min_{x \in P} \tfrac{1}{N}\textstyle\sum_{t \ni A} x_t, \qquad \pi_{\max} = \max_{x \in P} \tfrac{1}{N}\textstyle\sum_{t \ni A} x_t ,$$

where $P$ is the feasible polytope. We solve the rational relaxation. It can only widen the interval, so the bounds stay sound even though we skip integer programming.

Relation to Prior Work

Three lines of work motivate the gap. Nan Lu et al. show that unbiased risk estimators go negative when the prior is overestimated or the model is flexible. Their fix clips the risk components, but it takes $\pi$ as given. du Plessis et al. show that sensitivity to prior error is sharply asymmetric: it is harmless when $\pi$ is large and damaging when $\pi$ is small. SoLar resolves the circularity between label disambiguation and prior estimation with a moving average inside an optimal transport step. However, A Closer Look to Positive-Unlabeled Learning reports that moving averages often hurt in the positive-unlabeled (PU) setting because early predictions are biased. That finding constrains our design: a purely self-referential prior update is not enough, and some outside guardrail is needed.

The closest works that bring structure into PU learning each stop short of counting constraints. PU-GO sets priors for Gene Ontology terms from their depth in the hierarchy. This yields monotone, subsumption-style priors: a child term never gets a larger prior than its parent. It cannot express balance between different related entities. PUDA treats unobserved knowledge-graph triples as unlabeled and adds adversarial augmentation, but it uses no schema at all. LSDAN combines non-negative PU risk with multi-hop attention on plain citation graphs. None of these derives priors from cardinality or inverse-role axioms, and none distinguishes finite from infinite semantics.

On the logic side, the mosaic inequality systems of Lutz et al. supply our method. The Horn-$\mathcal{SHIQ}$ cycle-reversion work of Lutz et al. supplies a cheaper route for Horn schemas, which are schemas whose rules have only one conclusion each. The result of Gutiérrez-Basulto et al., that counting over transitive roles breaks finite controllability, sets a boundary: we exclude transitive roles with counting from the fragment we support.

Research Program

The first component is a compiler. It takes an $\mathcal{ALCQI}$ schema module, restricted to the concepts and roles relevant to the target class, plus the observed counts of a dataset. It outputs the linear system and the interval. Full type sets are exponential in the number of concepts. We therefore extract a small syntactic module around the target concept, which usually has tens of concept names, and fall back to projecting onto subsets of concepts. Each projection still yields sound, looser bounds. We will prove soundness: the true prior of any finite completion consistent with the schema and observations lies in the interval. We will also characterize when the interval collapses to a point, which happens for exact-cardinality chains with inverses such as the $|A|=|B|$ example.

The second component attaches the interval to learners. In the simplest variant, any prior estimate is projected into $[\pi_{\min}, \pi_{\max}]$ before training a non-negative PU learner. In the robust variant, we minimize the worst-case corrected risk over $\pi$ in the interval. This matters because overestimation is the dangerous direction for negative-risk collapse. In the transductive variant, the pseudo-label marginal in a SoLar-style Sinkhorn step is constrained to the interval rather than to a moving average. The interval acts as a fixed outer boundary, and the statistical estimate moves only inside it.

The third component is analysis. We will measure how interval width depends on schema expressivity (subsumption only, adding functionality, adding qualified counts, adding inverses) and on the fraction of the data that is observed. We will also relate downstream accuracy to width, with particular attention to the low-prior regime where du Plessis et al. predict the largest benefit.

Baselines

The naive reference is non-negative PU learning (nnPU) with the prior taken as the labeled fraction or as a standard mixture-proportion estimate. We will run it through the PU-Bench code so that data pipelines, SCAR/SAR labeling (labeled positives chosen uniformly at random vs. with feature-dependent bias), and proxy validation are identical across methods. The oracle reference is the same learner given the true prior, which shows how much of the gap our bounds can close.

The strongest statistical competitor for an unknown prior is the corrected-risk learner of Nan Lu et al. (UU-LReLU and nnPU-style clipping) combined with the best prior estimator. On MNIST they report 90.34% accuracy against 53.34% for the unbiased estimator. That number is for the UU setting (learning from two unlabeled sets), not ours, so it serves only as evidence that clipping is a strong defense against collapse.

The strongest adaptive-prior competitor is SoLar's moving-average marginal. It is reported to improve tail-class accuracy by 15.12% on CIFAR10-LT, which is again a different setting. We re-run it on our tasks with identical backbones and the same tuning budget, using the same number of configurations per method on the same validation proxy.

On structured benchmarks, the strongest existing systems are PU-GO, which reports $F_{\max}$ 0.5317 on the MFO similarity split, and PUDA, which reports MRR 0.369 on FB15k-237 (PU-GO; PUDA). We plug our prior into their pipelines rather than replacing their scorers.

The key ablation replaces the finite counting system with the constraints available under unrestricted semantics: subsumption orderings and single-axiom checks, the same information PU-GO-style priors use. If finite reasoning is the active ingredient, the full system must beat this ablation specifically on schemas with inverse cardinality chains. Beating a baseline means a statistically significant gain across at least five seeds on F1 or AUC in the low-prior regime ($\pi \le 0.05$), with no loss at high prior.

Why not just…?

Why not just clip the risk as nnPU and UU-LReLU do? Clipping stops the objective from going negative, but it does not fix the wrong prior. The classifier still trades positives against negatives at the wrong ratio. PU-Bench reports high variance for nnPU across modalities and under SAR labeling (PU-Bench). Our design keeps clipping and adds the interval, so the experiment directly measures what the prior bound contributes on top of clipping. If clipping plus a decent estimator already sits inside our interval most of the time, the gain will be small, and we will report that.

Why not just estimate the prior from the model's own predictions? That is the moving-average or EM route. The PU empirical study found moving averages frequently hurt because early predictions are biased (A Closer Look to Positive-Unlabeled Learning). Our transductive variant is exactly SoLar's procedure with the marginal confined to the interval. The head-to-head comparison therefore isolates the value of the guardrail.

Why not just compute each cardinality ratio by hand, or add the axioms as a soft penalty on predictions? This is the most serious alternative. For a single functional relation, "at most one positive per head entity" is obvious and needs no logic, and a semantic penalty on predictions could enforce it. The linear program earns its place only when bounds propagate through chains: A's are bounded by B's through one inverse restriction, B's by C's through another, and combined with observed C counts this yields a tight bound on A that no single axiom gives. We will test this directly. We will measure interval width from per-axiom local bounds against the full system, and train with a soft-constraint penalty as an extra baseline. If the widths coincide on realistic schemas, we will restrict our claim to the synthetic chained regime rather than argue around it.

Why not just use tree-depth priors as PU-GO does? Depth priors are the unrestricted-semantics ablation above. By construction they cannot express balance across different entity types.

Proposed Experiments

We start with a controlled benchmark, because none of the benchmarks in the file ships with counting axioms. We generate random $\mathcal{ALCQI}$ schemas with tunable chains of inverse number restrictions, sample finite databases consistent with them, and hide labels under SCAR and SAR mechanisms. Node features come from noisy type indicators passed through a small graph encoder. Here the true prior is known, so we can measure bound soundness (the true prior must fall inside the interval 100% of the time), interval width, and downstream F1 as the true prior sweeps from 0.5 down to 0.005. The finite-versus-unrestricted gap should be largest where chains are longest. There is no reported result on Lacuna for this setup.

Second, on FB15k-237 and WN18RR, we mine functionality and inverse-functionality constraints on relations, check them against the training graph, and treat each (head, relation) query as a PU problem. The resulting per-query prior bound tightens PUDA's unlabeled weighting. The reference is PUDA's MRR of 0.369 on FB15k-237. No WN18RR number was found in the file.

Third, on UniProtKB/Swiss-Prot with the Gene Ontology, we add the ontology's part-of and regulates relations as inverse-role constraints on top of PU-GO's depth priors, using PU-GO's released code and splits. The reference is $F_{\max}$ 0.5317 on MFO. We expect only modest gains here, because GO has few counting axioms. That makes this a check that the method does no harm, not a showcase.

Fourth, on Citeseer at 1% labeled positives, we test whether mined degree constraints add anything beyond LSDAN's F1 of 0.786. We expect little, since citation graphs lack a schema, so this serves as a negative control.

The decisive check is the combination of the synthetic ablation and the knowledge-graph experiment. If the full finite system gives materially narrower intervals than per-axiom and subsumption-only bounds, and that narrowing translates into better low-prior F1 than clipping plus the best estimator, the finite-model view is doing real work. If not, the honest conclusion is that simple local cardinality ratios suffice for PU priors.