← Back to papers

Paper deep dive

Rule-State Inference (RSI): A Bayesian Framework for Compliance Monitoring in Rule-Governed Domains

Abdou-Raouf Atarmla

Year: 2026Venue: arXiv preprintArea: cs.LGType: PreprintEmbeddings: 46

Intelligence

Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 95%

Last extracted: 3/26/2026, 2:31:32 AM

Summary

Rule-State Inference (RSI) is a Bayesian framework for compliance monitoring in rule-governed domains (e.g., taxation). Unlike supervised machine learning that approximates rules from data, RSI treats authoritative rules as structured priors and performs posterior inference over a latent rule-state space (activation, compliance rate, parametric drift). It provides theoretical guarantees for O(1) regulatory adaptability, Bernstein-von Mises consistency, and monotone ELBO convergence, demonstrating significant speedups and robustness in low-data environments.

Entities (4)

RSI-Togo-Fiscal-Synthetic v1.0 · dataset · 100%Rule-State Inference · framework · 100%Mean-field variational inference · algorithm · 95%Togolese fiscal system · domain · 95%

Relation Signals (3)

RSI evaluatedon RSI-Togo-Fiscal-Synthetic v1.0

confidence 100% · We instantiate RSI on the Togolese fiscal system and introduce RSI-Togo-Fiscal-Synthetic v1.0

RSI uses Bayesian Inference

confidence 95% · We propose Rule-State Inference (RSI), a Bayesian framework

RSI outperforms XGBoost

confidence 90% · RSI achieves F1=0.519... while absorbing regulatory changes in under 1ms versus 683-1082ms for full model retraining

Cypher Suggestions (2)

Find all frameworks and their associated datasets · confidence 90% · unvalidated

MATCH (f:Framework)-[:EVALUATED_ON]->(d:Dataset) RETURN f.name, d.name

Identify theoretical guarantees associated with RSI · confidence 85% · unvalidated

MATCH (r:Framework {name: 'RSI'})-[:HAS_GUARANTEE]->(g:TheoreticalGuarantee) RETURN g.description

Abstract

Abstract:Existing machine learning frameworks for compliance monitoring -- Markov Logic Networks, Probabilistic Soft Logic, supervised models -- share a fundamental paradigm: they treat observed data as ground truth and attempt to approximate rules from it. This assumption breaks down in rule-governed domains such as taxation or regulatory compliance, where authoritative rules are known a priori and the true challenge is to infer the latent state of rule activation, compliance, and parametric drift from partial and noisy observations. We propose Rule-State Inference (RSI), a Bayesian framework that inverts this paradigm by encoding regulatory rules as structured priors and casting compliance monitoring as posterior inference over a latent rule-state space S = {(a_i, c_i, delta_i)}, where a_i captures rule activation, c_i models the compliance rate, and delta_i quantifies parametric drift. We prove three theoretical guarantees: (T1) RSI absorbs regulatory changes in O(1) time via a prior ratio correction, independently of dataset size; (T2) the posterior is Bernstein-von Mises consistent, converging to the true rule state as observations accumulate; (T3) mean-field variational inference monotonically maximizes the Evidence Lower BOund (ELBO). We instantiate RSI on the Togolese fiscal system and introduce RSI-Togo-Fiscal-Synthetic v1.0, a benchmark of 2,000 synthetic enterprises grounded in real OTR regulatory rules (2022-2025). Without any labeled training data, RSI achieves F1=0.519 and AUC=0.599, while absorbing regulatory changes in under 1ms versus 683-1082ms for full model retraining -- at least a 600x speedup.

Tags

ai-safety (imported, 100%)cslg (suggested, 92%)preprint (suggested, 88%)

Links

Your browser cannot display the PDF inline. Open PDF directly →

Full Text

45,474 characters extracted from source content.

Expand or collapse full text

Rule-State Inference (RSI): A Bayesian Framework for Compliance Monitoring in Rule-Governed Domains Evidence from Francophone African Fiscal Systems Abdou-Raouf Atarmla1,2 1Institut National des Postes et Télécommunications (INPT), Rabat, Morocco 2Togo DataLab, Ministry of Digital Economy, Lomé, Togo Emails: achilleatarmla@gmail.com || abdou-raouf.atarmla@datalab.gouv.tg atarmla.abdouraouf@ine.inpt.ac.ma Independent work. Correspondence: achilleatarmla@gmail.com (2026) Abstract Existing machine learning frameworks for compliance monitoring—Markov Logic Networks, Probabilistic Soft Logic, supervised models—share a fundamental paradigm: they treat observed data as ground truth and attempt to approximate rules from it. This assumption breaks down in rule-governed domains such as taxation or regulatory compliance, where authoritative rules are known a priori and the true challenge is to infer the latent state of rule activation, compliance, and parametric drift from partial and noisy observations. We propose Rule-State Inference (RSI), a Bayesian framework that inverts this paradigm by encoding regulatory rules as structured priors and casting compliance monitoring as posterior inference over a latent rule-state space =(ai,ci,δi)i=1nS=\(a_i,\,c_i,\, _i)\_i=1^n, where aia_i captures rule activation, cic_i models the compliance rate, and δi _i quantifies parametric drift. We prove three theoretical guarantees: (T1) RSI absorbs regulatory changes in O​(1)O(1) time via a prior ratio correction, independently of dataset size; (T2) the posterior is Bernstein-von Mises consistent, converging to the true rule state as observations accumulate; (T3) mean-field variational inference monotonically maximizes the Evidence Lower BOund (ELBO). We instantiate RSI on the Togolese fiscal system and introduce RSI-Togo-Fiscal-Synthetic v1.0, a benchmark of 2,000 synthetic enterprises grounded in real OTR regulatory rules (2022–2025). Without any labeled training data, RSI achieves F1 == 0.519 and AUC == 0.599, while absorbing regulatory changes in under 1 ms versus 683–1082 ms for full model retraining—at least a 600×600× speedup. Keywords: Bayesian inference, rule-governed domains, compliance monitoring, variational inference, zero-shot reasoning, fiscal compliance, Africa 1 Introduction Machine learning has achieved remarkable progress in pattern recognition, forecasting, and classification. Yet in a wide class of high-stakes domains—tax administration, medical compliance, legal regulation, financial auditing—practitioners face a recurring structural difficulty: the knowledge is already structured. The rules are not unknown. They are written in law, codified in regulation, and enforced by institutions. In these rule-governed domains, the challenge is not to learn the rules from data. The challenge is to infer whether entities comply with them, given that observations are partial, strategically manipulated, and frequently missing. A tax inspector does not need a neural network to determine that a company with 80 million FCFA in annual revenue is subject to VAT—the law says so. What she needs is a rigorous method to assess, from an incomplete set of declarations and behavioral signals, the actual compliance state of that company. Limits of existing approaches. Supervised classifiers (XGBoost, neural networks) require labeled non-compliance examples, which are scarce, legally sensitive, and often unavailable in practice. Markov Logic Networks (MLNs) (Richardson and Domingos, 2006) and Probabilistic Soft Logic (PSL) (Bach et al., 2017) treat rule weights as quantities to be learned from data, inverting the epistemic direction. Neurosymbolic methods (Garcéz and Lamb, 2022) combine neural perception and symbolic reasoning, but their symbolic component remains a learned approximation. None of these frameworks provides: (i) zero-shot compliance assessment from authoritative rules, (i) O​(1)O(1) adaptation to regulatory changes, nor (i) native uncertainty quantification interpretable by non-technical auditors. Our contributions. We propose RSI (Rule-State Inference), a Bayesian framework that formalizes the inverse paradigm. Our contributions are: (1) The RSI framework: a rigorous formalization of compliance monitoring as Bayesian posterior inference over a latent rule-state space, with rules as structured priors (Section 3). (2) Three theoretical guarantees: O​(1)O(1) regulatory adaptability (T1), Bernstein-von Mises posterior consistency (T2), and monotone ELBO convergence (T3) (Section 4). (3) RSI-Togo-Fiscal-Synthetic v1.0: a publicly released benchmark grounded in Togolese fiscal law, with a documented regulatory change event (Section 5). (4) Empirical validation across five experiments demonstrating zero-shot performance, a 600×600× update speedup, and robustness under 50% missing data (Section 5). Why Francophone Africa. We ground our framework in the Togolese fiscal system for three reasons that generalize broadly. First, regulatory change frequency is high (multiple amendments per fiscal year), making adaptability not a luxury but a requirement. Second, data quality is structurally low: declared revenues are systematically under-reported (mean ratio 0.70 in our benchmark), and 18–20% of key fiscal variables are missing. Third, ML solutions designed for high-income contexts assume data richness that simply does not exist in these environments. RSI is designed from these constraints, not adapted to them. 2 Related Work Probabilistic logic. MLNs (Richardson and Domingos, 2006) combine first-order logic with Markov random fields via weighted formulae, with weights learned from data. PSL (Bach et al., 2017) uses continuous truth values and achieves tractable MAP inference via convex optimization. Both treat rule weights as outputs of learning. RSI treats rules as inputs: their epistemic status is prior, not approximate. In MLNs, a zero-weight formula is effectively absent; in RSI, a rule with prior πi=0.99 _i=0.99 is near-certain and overrides weak observational evidence. Neurosymbolic AI. Garcez and Lamb (2022) describe architectures ranging from pipeline models to fully differentiable systems (Neural Theorem Provers (Rocktäschel and Riedel, 2017), LTNs (Badreddine et al., 2022)). The canonical direction is learning for reasoning: symbolic structure guides neural learning. RSI occupies the orthogonal position: reasoning from rules, where the symbolic layer is fixed and authoritative, not learned. Interpretable rule learning. Bayesian Rule Lists (Letham et al., 2015) apply Bayesian model selection to rule sets—again, rules are the output. Our work produces not rules but posterior distributions over compliance states—a qualitatively different inference target. AI and tax compliance. ML has been applied to tax gap estimation (Gomes et al., 2022), audit selection, and VAT fraud detection, universally under supervised paradigms. No prior work formalizes compliance monitoring as Bayesian state inference. Missing data and low-resource learning. Frénay and Verleysen (2014) survey learning under label noise. RSI addresses a related but distinct challenge: structural data absence in low-integrity environments. Our likelihood handles missing values natively by assigning unit probability, preserving the prior without bias injection. 3 The RSI Framework 3.1 Problem Formulation Let ℛ=r1,…,rnR=\r_1,…,r_n\ be a set of known regulatory rules. Each rule ri:×Θi→0,1r_i:X× _i→\0,1\ maps entity attributes x∈x and rule parameters Θi _i to a binary applicability judgment. Let =d1,…,dmD=\d_1,…,d_m\ be a set of noisy observations of entity behavior. Definition 1 (Rule-Governed Domain). A domain (ℛ,,)(R,X,D) is rule-governed if: (i) ℛR is authoritative and known a priori; (i) D is partial, potentially missing, and may be strategically distorted; (i) the primary inference task is to assess entity compliance with ℛR, not to learn it. 3.2 The Latent Rule-State Space Definition 2 (Rule State). The latent state of rule rir_i is: si=(ai,ci,δi),=(s1,…,sn)∈s_i=(a_i,\;c_i,\; _i), =(s_1,…,s_n) where ai∈0,1a_i∈\0,1\ indicates whether rir_i is in force, ci∈[0,1]c_i∈[0,1] is the compliance rate, and δi∈ℝ _i captures parametric drift. Core insight. This object has no equivalent in existing ML frameworks. MLNs have rule weights; RSI has rule states. The difference is epistemic: weights are inferred from data (data → rule); states are inferred given rules (rules + data → state). 3.3 The Prior P​()P(S): Rules as Structured Priors Under mean-field factorization: P​()=∏i=1nP​(ai)​P​(ci∣ai)​P​(δi∣ai)P(S)= _i=1^nP(a_i)\,P(c_i a_i)\,P( _i a_i) ai a_i ∼Bernoulli⁡(πi) ( _i) (1) ci∣ai=1 c_i a_i=1 ∼Beta⁡(αi,βi) ( _i, _i) (2) δi∣ai=1 _i a_i=1 ∼​(0,σi2) (0,\, _i^2) (3) Hyperparameters (πi,αi,βi,σi)( _i, _i, _i, _i) encode institutional knowledge: historical compliance rates, rule activation priors, and expected parametric stability. 3.4 The Likelihood P​(∣)P(D ) Observations are conditionally independent given the rule state: P​(∣)=∏j=1mP​(dj∣)P(D )= _j=1^mP(d_j ) For each observation djd_j: P​(dj∣)=∑i:ri​ applicable[ai⋅ℒ​(dj∣ri,ci,δi)+(1−ai)⋅ε]P(d_j )= _i:\,r_i applicable [a_i·L(d_j r_i,c_i, _i)+(1-a_i)· ] Missing data handling: when djd_j is absent, P​(dj∣)≡1P(d_j )≡ 1, preserving the prior. We use segment-specific likelihood functions by fiscal regime: (i) TPU (informal sector, turnover << 30M FCFA): signals are payment delay, bank account formalization, and under-declaration ratio; (i) VAT (turnover ≥ threshold): declared vs. theoretical VAT under a log-Gaussian noise model; (i) CIT (turnover ≥ 100M FCFA): declared vs. theoretical corporate income tax given declared profits. 3.5 Posterior Inference P​(∣)∝P​(∣)⋅P​() P(S )\; \;P(D )· P(S) The posterior supports three interpretable queries: • P​(ai=1∣)P(a_i=1 ): probability that rir_i is active • ​[ci∣]±Var​[ci∣]E[c_i ]± Var[c_i ]: expected compliance with uncertainty • ​[δi∣]E[ _i ]: estimated parametric drift All quantities are directly interpretable by non-technical auditors, without any post-hoc explanation tool. 3.6 Mean-Field Variational Inference Exact inference is intractable for large n. We approximate the posterior by minimizing KL[Qϕ()∥P(∣)]KL[Q_φ(S)\|P(S )], equivalently maximizing: ELBO​(ϕ)=Qϕ​[log⁡P​(∣)]−KL​[Qϕ​()∥P​()]ELBO(φ)=E_Q_φ[ P(D )]-KL[Q_φ(S)\|P(S)] All updates are analytical (conjugate families): Beta-Binomial for cic_i, Bernoulli for aia_i, Gaussian-Gaussian for δi _i. Input: Observations D, Rules ℛR, Priors πi,αi,βi,σi\ _i, _i, _i, _i\ Output: Posterior P​(ai|),​[ci|],​[δi|]\P(a_i|D),\;E[c_i|D],\;E[ _i|D]\ 1 Initialize Qϕ←P​()Q_φ← P(S); 2 repeat 3 for each rule ri∈ℛr_i do 4 Compute compliance signals from D; 5 Update Q​(ai)←Bernoulli⁡(ρi)Q(a_i) ( _i); 6 Update Q​(ci)←Beta⁡(αi+nok,βi+nfail)Q(c_i) ( _i+n_ok,\; _i+n_fail); 7 Update Q​(δi)←​(μpost,σpost2)Q( _i) ( _post, _post^2); 8 9 end for 10 Compute ELBOtELBO_t; 11 12until |ELBOt−ELBOt−1|<ε|ELBO_t-ELBO_t-1|< ; return posterior summary Algorithm 1 RSI: Rule-State Inference (Mean-Field VI) 4 Theoretical Guarantees 4.1 T1: O​(1)O(1) Regulatory Adaptability Definition 3 (Regulatory Update). A regulatory update kU_k replaces rkr_k with rk′r_k , differing only in parameters Θk→Θk′ _k→ _k . The cost ​(k)C(U_k) counts the required operations. Theorem 1 (O​(1)O(1) Adaptability). For any regulatory update kU_k, RSI update cost is RSI​(k)=O​(1)C^RSI(U_k)=O(1), independently of |||D| and n. Proof. The RSI prior factorizes as P​()=∏iP​(si|Θi)P(S)= _iP(s_i| _i). After kU_k, the updated posterior satisfies: P′​(∣)∝P​(∣)⋅P​(sk′∣Θk′)P​(sk∣Θk)⏟scalar, ​O​(1)P (S )\; \;P(S )· P(s_k _k )P(s_k _k)_scalar, O(1) This correction ratio depends only on the parameters of rule k. Evaluating two parametric distributions requires O​(1)O(1) operations. Numerical stability. The ratio is applied to the functional form (the kernel) of the posterior, not to its absolute value. The normalization constant is updated analytically through conjugate families (Beta-Binomial, Gaussian-Gaussian), guaranteeing that the posterior remains a properly normalized distribution. There is no risk of variance explosion or numerical divergence. ∎ Corollary 1.1. Over T regulatory updates: RSI: O​(T)O(T); supervised ML (full retrain): O​(T⋅||⋅E)O(T·|D|· E); PSL/MLN: O​(T⋅||⋅n)O(T·|D|· n). RSI dominates in high-frequency regulatory environments. 4.2 T2: Bernstein-von Mises Consistency Theorem 2 (BvM Consistency). Let ∗S^* be the true rule state. Under conditions (C1) identifiability, (C2) P​(∗)>0P(S^*)>0, (C3) twice-differentiable log-likelihood, (C4) finite positive-definite Fisher information ℐ​(∗)I(S^*): m​(^m−∗)→​(0,ℐ​(∗)−1)(m→∞) m ( S_m-S^* )\; d\;N\! (0,\;I(S^*)^-1 ) (m→∞) Proof sketch. (i) The normalized log-likelihood converges a.s. by the LLN. (i) A second-order Taylor expansion around ∗S^* yields a Gaussian approximation. (i) Under (C2) and (C4), the prior is dominated by the likelihood as m→∞m→∞, giving the stated Gaussian limit (van der Vaart, 2000). ∎ Corollary 2.1 (Prior Robustness). For any two RSI priors P1P_1, P2P_2: TV⁡(P1​(|m),P2​(|m))→0TV(P_1(S|D_m),\,P_2(S|D_m))→ 0 as m→∞m→∞. Two experts with different initial beliefs converge to the same compliance assessment. 4.3 T3: Monotone ELBO Convergence Theorem 3 (Monotone ELBO). RSI coordinate ascent updates produce a monotonically non-decreasing ELBO sequence: ELBOt+1≥ELBOtELBO_t+1 _t for all t≥0t≥ 0. Proof. Each coordinate update minimizes KL[Qϕi∥P(si|)]KL[Q_ _i\|P(s_i|D)] while holding other factors fixed. Since ELBO=−KL[Qϕ∥P(|)]+logP()ELBO=-KL[Q_φ\|P(S|D)]+ P(D) and log⁡P​() P(D) is constant, each update cannot decrease the ELBO (Blei et al., 2017). ∎ 5 Experimental Evaluation 5.1 The RSI-Togo-Fiscal-Synthetic Dataset We introduce RSI-Togo-Fiscal-Synthetic v1.0, a benchmark of 2,000 synthetic enterprises grounded in official OTR rules (OTR, 2024), structured in four layers: Enterprise features Sector, region, declared turnover. Latent ground truth (ai,ci,δi)(a_i,c_i, _i) per rule—the unobserved state RSI must infer. Noisy observations Declared taxes, behavioral proxies (banking, e-invoicing, payment delays), with mean under-declaration ratio 0.70 and 18–20% missing data rates. Binary labels Derived compliance labels for baseline evaluation. The dataset encodes five fiscal rules and a documented regulatory change event: VAT threshold 60M → 100M FCFA (Law n°2024-007, 30 December 2024), enabling direct empirical validation of Theorem 1. Dataset realism. The turnover distribution follows a log-normal law per segment (TPU, intermediate, large), whose aggregate approximates a power law—the universal signature of revenue distributions in real economies (Gabaix, 2009). The 2,000 synthetic enterprises are not uniform: they reproduce the concentration structure typical of an African market (60% informal, 25% SMEs, 15% large taxpayers), ensuring that results are not artifacts of an oversimplified dataset. 5.2 Baselines and Experimental Setup RBS Deterministic Rule-Based System. No uncertainty. Fragile to missing data. XGBoost (Chen and Guestrin, 2016) Fully supervised (150 estimators, depth 4). MLP Fully supervised (64-32-16, ReLU, early stopping). Critical distinction. RSI operates in zero-shot mode: no labeled compliance examples are used. XGBoost and MLP are trained under full supervision. 5.3 Results EXP-1: Overall Performance. Table 1: Performance comparison. RSI uses no labels. † : full supervision required. Bold: best zero-shot performance. Model F1 AUC Recall Labels? Update cost RSI (ours) 0.519 0.599 0.909 No <<1 ms RBS 0.182 — 0.214 No ∼ 0 ms XGBoost† 0.967 0.999 0.978 Yes 683–1082 ms MLP† 0.087 0.747 0.153 Yes 61 ms RSI achieves F1 = 0.519 and AUC = 0.599 without any labeled training data, substantially outperforming the Rule-Based System (F1 = 0.182). The high recall (0.909) is consistent with the requirements of fiscal surveillance systems, where missing a non-compliant entity (false negative) is generally more costly institutionally than a false alarm (false positive). RSI naturally adapts to this asymmetry through the calibration of the decision threshold τ, without modifying the inference algorithm. XGBoost achieves near-perfect F1 under full supervision but cannot operate in the zero-label setting. EXP-2: O​(1)O(1) Adaptability (Theorem 1). Table 2: Update time and post-update F1 (2025 period). Model Update time Post-update F1 Retrain needed? RSI (ours) <<1 ms 0.411 No XGBoost 683–1082 ms 0.954 Yes MLP 61 ms 0.000 Yes Note on Update Efficiency. The speedup specifically measures the computational cost of absorbing a regulatory update (i.e., re-calculating the posterior for a new rule parameter) compared to a full model retraining on the entire dataset D. While single-instance inference latency remains competitive across all models, the O​(1)O(1) property of RSI provides a critical advantage for institutional systems where regulations change annually or across thousands of taxpayer categories. RSI absorbs regulatory updates in under 1 ms—at least ×600× faster than XGBoost full retraining (683–1082 ms across runs on the test machine). Absolute timings are hardware-dependent; the O​(1)O(1) complexity guarantee is machine-independent and holds regardless of dataset size or platform. Over T annual updates (Togo: T≈4T≈ 4–66), cumulative savings grow linearly with T and exponentially with dataset size, confirming Corollary 1. EXP-3: BvM Consistency (Theorem 2). RSI posterior uncertainty σ​[ci|]σ[c_i|D] exhibits a general decreasing trend with sample size N, consistent with the asymptotic guarantees of Theorem 2. Minor oscillations at finite N are expected under mean-field VI with small samples. For N<25N<25, RSI achieves competitive recall while XGBoost cannot operate (insufficient labeled examples). EXP-4: Missing Data Robustness. Under 20% missing data (typical for Francophone Africa), RSI F1 degrades by only −0.003-0.003 (<1%<1\%), while the Rule-Based System loses >22%>22\% F1. At 50% missing data, RSI remains functional (F1 = 0.521) while deterministic methods collapse. EXP-5: ELBO Convergence (Theorem 3). The ELBO sequence is empirically monotone non-decreasing and converges within 7 iterations, confirming Theorem 3. The small absolute change in ELBO reflects the proximity of the variational posterior to the prior at convergence, consistent with the zero-shot regime where labeled data are absent. 5.4 Interpretability: A Worked Example For an enterprise with declared turnover 72M FCFA and no declared VAT, RSI outputs: • P​(VAT active∣D)=0.91P(VAT active D)=0.91 — rule very likely applies • ​[cVAT∣D]=0.23±0.18E[c_VAT D]=0.23± 0.18 — low compliance, high uncertainty • ​[δVAT∣D]=+2.4E[ _VAT D]=+2.4M FCFA — positive threshold drift An auditor acts directly on this output. The posterior is the explanation—no post-hoc tool (SHAP, LIME) is required. 6 Discussion Generalizability. RSI is domain-agnostic. Immediate extensions include medical protocol compliance, anti-money-laundering, environmental regulation, and legal contract monitoring. Any domain satisfying Definition 1 is a candidate. Limitations. Inference quality depends on the accuracy of prior hyperparameters. Misspecified priors bias results, though T2 guarantees asymptotic recovery. Segment-specific likelihood functions currently require domain expertise; future work will explore amortized inference for likelihood learning within the RSI structure. Relationship to Kalman Filtering. RSI shares architectural parallels with the Kalman filter: the prior plays the role of the process model, the likelihood is the measurement model, and the posterior is the state estimate. This connection opens avenues for sequential RSI, tracking rule-state evolution over time. Scaling. Mean-field VI scales linearly in n. For full tax codes (hundreds of rules), factor graph extensions via Belief Propagation handle rule dependencies while preserving scalability. Sensitivity and Validation. The current validation of RSI relies on the RSI-Togo-Fiscal-Synthetic v1.0 benchmark. While grounded in real fiscal laws, we acknowledge that synthetic data may not capture all idiosyncratic noise of administrative reality. However, this controlled environment was necessary to formally prove Theorem 1 (Adaptability) under known ground truth. Future work will focus on pilot deployments with tax administrations to validate performance on real-world data streams. 7 Conclusion We have introduced Rule-State Inference (RSI), a Bayesian framework that formally inverts the dominant paradigm in compliance monitoring. By treating authoritative regulatory rules as structured priors and casting compliance assessment as posterior inference over a latent rule-state space, RSI provides what no existing framework offers: zero-shot compliance monitoring, O​(1)O(1) regulatory adaptability, native uncertainty quantification, and full interpretability. Three theorems establish RSI’s foundations: O​(1)O(1) adaptability (T1), Bernstein-von Mises consistency (T2), and monotone ELBO convergence (T3). Experiments on RSI-Togo-Fiscal-Synthetic v1.0—grounded in real Togolese fiscal law—validate all three empirically and demonstrate at least a 600×600× update speedup over retraining-based methods. RSI is designed for the realities of rule-governed environments in the Global South: frequent regulatory changes, structural data scarcity, and institutional requirements for auditable, interpretable decisions. We release the full framework, dataset, and implementation to support reproducible research. Future work: sequential RSI for longitudinal compliance tracking, multi-country extensions across the ECOWAS fiscal zone, and learned likelihoods via amortized variational inference. Acknowledgments The author expresses his sincere gratitude to Togo DataLab (Ministry of Digital Economy and Digital Transformation) and to the Office Togolais des Recettes (OTR) for their institutional support, access to domain problems, and invaluable expertise on the Togolese fiscal regulatory framework. This work also benefited from the academic environment of the Institut National des Postes et Télécommunications (INPT) of Rabat. The author thanks his collaborators and mentors for the enriching discussions that helped consolidate the theoretical foundations of this framework. Disclaimer: The opinions expressed in this document are those of the author and do not necessarily reflect the official positions of the institutions mentioned. The author acknowledges the use of AI-assisted tools for linguistic refinement and LaTeX formatting; however, all scientific contributions, theoretical claims, and experimental conclusions remain the sole responsibility of the author. References Bach et al. [2017] Bach, S., Broecheler, M., Huang, B., and Getoor, L. (2017). Hinge-loss Markov random fields and probabilistic soft logic. Journal of Machine Learning Research, 18(109):1–67. Badreddine et al. [2022] Badreddine, S., d’Avila Garcez, A., Serafini, L., and Spranger, M. (2022). Logic tensor networks. Artificial Intelligence, 303:103649. Blei et al. [2017] Blei, D. M., Kucukelbir, A., and McAuliffe, J. D. (2017). Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877. Chen and Guestrin [2016] Chen, T. and Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of KDD, p. 785–794. Frénay and Verleysen [2014] Frénay, B. and Verleysen, M. (2014). Classification in the presence of label noise: a survey. IEEE Transactions on Neural Networks and Learning Systems, 25(5):845–869. Gabaix [2009] Gabaix, X. (2009). Power laws in economics and finance. Annual Review of Economics, 1(1):255–294. Garcéz and Lamb [2022] Garcéz, A. d’Avila and Lamb, L. C. (2022). Neurosymbolic AI: The third wave. Artificial Intelligence Review. Gomes et al. [2022] Gomes, M., Batista, J., and Carvalho, J. (2022). Machine learning for tax gap estimation. Expert Systems with Applications, 198:116810. Letham et al. [2015] Letham, B., Rudin, C., McCormick, T. H., and Madigan, D. (2015). Interpretable classifiers using rules and Bayesian analysis. Annals of Applied Statistics, 9(3):1350–1371. OTR [2024] Office Togolais des Recettes (2024). Loi n°2024-007 du 30 décembre 2024 portant loi de finances pour l’exercice 2025. Lomé, Togo. Richardson and Domingos [2006] Richardson, M. and Domingos, P. (2006). Markov logic networks. Machine Learning, 62(1–2):107–136. Rocktäschel and Riedel [2017] Rocktäschel, T. and Riedel, S. (2017). End-to-end differentiable proving. In NeurIPS, p. 3788–3800. van der Vaart [2000] van der Vaart, A. W. (2000). Asymptotic Statistics. Cambridge University Press. Appendix A Dataset Dictionary: RSI-Togo-Fiscal-Synthetic v1.0 A.1 Overview The dataset contains 2,000 synthetic enterprises across two regulatory periods (2022–2024 and 2025), generated from real OTR fiscal rules. Each row is structured in four layers: 1. Enterprise features: observable entity attributes 2. Latent ground truth (gt_*): the true rule state (ai,ci,δi)(a_i,c_i, _i), never seen by RSI during inference 3. Noisy observations (obs_*): what a fiscal system actually observes 4. Binary labels (label_*): derived compliance labels for baseline evaluation A.2 Column Reference Column Type Description Identifiers enterprise_id string Unique enterprise identifier (e.g., ENT_00001) period string Regulatory period: 2022_2024 or 2025 Enterprise features sector string Economic sector (commerce, services, BTP, industrie, agriculture, restauration, transport) region string Geographic region in Togo (Lomé, Sokodé, Kara, etc.) ca_segment string Turnover segment: informal (<<30M), rsi (30–100M), reel (≥ 100M) n_employes int True number of employees (log-normal distribution) Latent ground truth (gt_*) — not available to RSI during inference gt_ca_reel float True annual turnover in FCFA gt_benefice_reel float True annual profit in FCFA gt_tva_active int 1 if VAT rule applies (CA ≥ threshold), 0 otherwise gt_tva_compliance float True VAT compliance rate ci∈[0,1]c_i∈[0,1], drawn from Beta prior gt_tva_due float Theoretical VAT due (FCFA) gt_is_active int 1 if CIT rule applies (CA ≥ 100M FCFA) gt_is_compliance float True CIT compliance rate ci∈[0,1]c_i∈[0,1] gt_is_due float Effective CIT due (max of CIT and IMF) in FCFA gt_tpu_active int 1 if TPU rule applies (CA << 30M FCFA) gt_tpu_compliance float True TPU compliance rate ci∈[0,1]c_i∈[0,1] gt_irpp_susp_active int 1 if IRPP suspension applies (salary << 900k, period 2023) Noisy observations (obs_*) — RSI input obs_ca_declare float Declared turnover. Generated as x^=x⋅β⋅ε x=x·β· where β∼Beta​(7,3)β (7,3) captures systematic under-declaration and ε∼​(1,0.045) (1,0.045) captures measurement noise. Mean ratio ​[x^/x]≈0.70E[ x/x]≈ 0.70. obs_tva_declaree float Declared VAT amount. Zero if entity does not declare; log-normally distributed around theoretical VAT if declared. Set to NaN with probability 0.18 (missing). obs_tva_assujetti_declare bool Whether the entity self-declared as VAT-registered obs_is_declare float Declared corporate income tax. Set to NaN with probability 0.18. obs_benefice_declare float Declared profit. Typically 70% of true profit with noise. Set to NaN with probability 0.18. obs_retard_paiement_jours int Payment delay in days. Generated from Exponential​(λ)Exponential(λ) where λ=5/(cregime+0.1)λ=5/(c_regime+0.1), with cregimec_regime being the compliance of the applicable regime. Higher non-compliance ⇒ longer delays. obs_has_compte_bancaire bool Whether entity has a formal bank account. P​(account)=0.75⋅c+0.20⋅(1−c)P(account)=0.75· c+0.20·(1-c) where c is regime compliance. obs_utilise_facturation_electronique bool Whether entity uses electronic invoicing obs_a_ete_audite bool Whether entity was audited in the period (8% base rate) obs_n_employes_declare int Declared number of employees (≈ 85% of true value) obs_ratio_sous_declaration float Ratio of declared to true turnover (x^/x x/x) obs_tva_missing bool True if obs_tva_declaree is missing obs_is_missing bool True if obs_is_declare is missing obs_benefice_missing bool True if obs_benefice_declare is missing Binary labels (label_*) — used only for baseline evaluation label_tva_non_conforme int 1 if VAT active and cTVA<0.5c_TVA<0.5 label_is_non_conforme int 1 if CIT active and cIS<0.5c_IS<0.5 label_any_non_conforme int 1 if any of: VAT non-compliant, CIT non-compliant, or TPU compliance <0.3<0.3 A.3 Under-declaration Model The under-declaration ratio is the key noise mechanism reflecting real-world fiscal behavior in Francophone Africa. For each enterprise: x^=x⋅β⏟systematic⋅ε⏟noise,β∼Beta​(7,3),ε∼​(1, 0.0452) x=x· β_systematic· _noise, β (7,3), (1,\,0.045^2) The Beta(7,3) distribution has mean 7/10=0.707/10=0.70 and concentrates mass between 0.55 and 0.85, consistent with empirical estimates from Sub-Saharan African fiscal studies. The Gaussian noise term captures accounting approximations and rounding. A.4 Regulatory Change Event The period 2025 encodes the VAT threshold change from 60M to 100M FCFA enacted by Law n°2024-007 (30 December 2024). Enterprises with true turnover in [60​M,100​M)[60M,100M) FCFA shift from gt_tva_active=1 (period 2022–2024) to gt_tva_active=0 (period 2025), providing a clean natural experiment for evaluating Theorem 1 (O(1) adaptability). A.5 Power-Law Structure Turnover is drawn from a log-normal distribution within each segment, whose aggregate approximates a power law — the universal signature of firm size distributions in market economies Gabaix [2009]. The three-segment structure reproduces the concentration typical of African markets: Segment CA range Share Informal (TPU) << 30M FCFA 60% Intermediate (RSI) 30M – 100M FCFA 25% Large (CIT/VAT) ≥ 100M FCFA 15% Appendix B Complete Theorem Proofs B.1 Proof of Theorem 1: O(1) Regulatory Adaptability We provide the complete proof including the numerical stability argument. Theorem 4 (O(1) Adaptability — complete). For any regulatory update k:Θk→Θk′U_k: _k→ _k , the RSI update cost is RSI​(k)=O​(1)C^RSI(U_k)=O(1), independent of |||D| and n. Moreover, the updated posterior is properly normalized with no risk of variance explosion. Proof. Step 1: Factorization. The RSI prior factorizes as: P​()=∏i=1nP​(si∣Θi)P(S)= _i=1^nP(s_i _i) After update kU_k, the new prior is: P′​()=P​(sk′∣Θk′)⋅∏i≠kP​(si∣Θi)P (S)=P(s_k _k )· _i≠ kP(s_i _i) Step 2: Posterior correction. By Bayes’ theorem, the posterior before the update is: P​(∣)=P​(∣)⋅P​()P​()P(S )= P(D )· P(S)P(D) After the update: P′​(∣) P (S ) =P​(∣)⋅P′​()P′​() = P(D )· P (S)P (D) =P​(∣)⋅P​(sk′∣Θk′)⋅∏i≠kP​(si∣Θi)P′​() = P(D )· P(s_k _k )· _i≠ kP(s_i _i)P (D) ∝P​(∣)⋅P​(sk′∣Θk′)P​(sk∣Θk)⏟ρk​(Θk,Θk′) P(S )· P(s_k _k )P(s_k _k)_ _k( _k, _k ) Step 3: Complexity. The correction factor ρk _k depends only on the parametric forms of P​(sk∣Θk)P(s_k _k) and P​(sk′∣Θk′)P(s_k _k ). Evaluating two parametric distributions (Bernoulli, Beta, Gaussian) requires a constant number of arithmetic operations, hence O​(1)O(1). Step 4: Numerical stability. The ratio ρk _k is applied to the kernel (unnormalized form) of the posterior, not to its absolute value. The normalization constant is updated as: P′​()=P​()⋅∫ρk​(Θk,Θk′)​P​(∣)=P​()⋅P​(∣)​[ρk]P (D)=P(D)· _S _k( _k, _k )\,dP(S )=P(D)·E_P(S )[ _k] Under the conjugate families used in RSI (Beta-Binomial for cic_i, Bernoulli for aia_i, Gaussian-Gaussian for δi _i), this expectation is available in closed form. The posterior therefore remains a properly normalized probability distribution after the update, with no variance explosion. ∎ Corollary 4.1 (Cumulative cost over T updates). Over T regulatory updates, total costs scale as: Method Total cost RSI O​(T)O(T) Supervised ML (full retrain) O​(T⋅||⋅E)O(T·|D|· E) PSL / MLN O​(T⋅||⋅n)O(T·|D|· n) where E denotes the number of training epochs. RSI dominates in environments with high regulatory change frequency. B.2 Proof of Theorem 2: Bernstein-von Mises Consistency We first state and verify the regularity conditions, then give the complete proof. Regularity conditions. C1 Identifiability. P​(∣)≠P​(∣′)P(D )≠ P(D ) for ≠′S . Verification: Each component (ai,ci,δi)(a_i,c_i, _i) influences the likelihood through distinct mechanisms (activation gating, Beta-distributed compliance, Gaussian drift). Distinct states produce distinct likelihood functions. C2 Positive prior at truth. P​(∗)>0P(S^*)>0. Verification: The prior is a product of Bernoulli, Beta, and Gaussian distributions, all of which have strictly positive density on their respective supports. Hence P​()>0P(S)>0 for all ∈S . C3 Regularity of the likelihood. log⁡P​(∣) P(D ) is twice differentiable in the continuous components (ci,δi)(c_i, _i). Verification: The likelihood functions (log-Gaussian, exponential, Beta-Binomial) are smooth in their parameters. Differentiability is inherited by the product. C4 Finite Fisher information. ℐ​(∗)I(S^*) is finite and positive definite. Verification: Under C1 and C3, and provided no rule is degenerate (i.e., ci∉0,1c_i∉\0,1\ and ai∈(0,1)a_i∈(0,1)), the Fisher information matrix is positive definite. Clarification on mixed spaces. While the latent space S contains discrete variables aia_i, the mean-field variational approximation QϕQ_φ operates on the continuous variational parameters ρi=Q​[ai]∈(0,1) _i=E_Q[a_i]∈(0,1). This relaxation defines a continuous optimization landscape in the variational parameter space where the second-order Taylor expansion holds. Consequently, the variational posterior inherits concentration properties analogous to the Bernstein-von Mises theorem for the continuous components, while aia_i achieves model selection consistency asymptotically. Theorem 5 (BvM Consistency — complete). Under conditions C1–C4, as m→∞m→∞: m​(^m−∗)→​(0,ℐ​(∗)−1) m ( S_m-S^* ) dN\! (0,\,I(S^*)^-1 ) Proof. Step 1: LLN convergence. By the Law of Large Numbers, for i.i.d. observations: 1mlogP(m∣)→a.s.∗[logP(d∣)]=−KL(P(⋅∣∗)∥P(⋅∣))+const 1m P(D_m ) a.s.E_S^*[ P(d )]=-KL(P(· ^*)\|P(· ))+const This is maximized at =∗S=S^* under C1. Step 2: Local Gaussian approximation. By a second-order Taylor expansion of log⁡P​(m∣) P(D_m ) around ∗S^*: log⁡P​(m∣)≈log⁡P​(m∣∗)+∇ℓm⊤​(−∗)−12​(−∗)⊤​[−∇2ℓm]​(−∗) P(D_m )≈ P(D_m ^*)+∇ _m (S-S^*)- 12(S-S^*) [-∇^2 _m ](S-S^*) where ℓm=log⁡P​(m∣) _m= P(D_m ). By the LLN, −1m​∇2ℓm→a.s.ℐ​(∗)- 1m∇^2 _m a.s.I(S^*) (C3, C4). Step 3: Posterior Gaussianization. Substituting into the posterior: P​(∣m) P(S _m) ∝exp⁡(log⁡P​(m∣))⋅P​() \! ( P(D_m ) )· P(S) ≈exp⁡(−m2​(−∗)⊤​ℐ​(∗)​(−∗))⋅P​() ≈ \! (- m2(S-S^*) I(S^*)(S-S^*) )· P(S) Step 4: Prior dominance. Under C2, P​()>0P(S)>0 in a neighborhood of ∗S^*. As m→∞m→∞, the exponential term concentrates mass at ∗S^* at rate m, dominating the prior. The posterior converges to: P​(∣m)→​(∗,1m​ℐ​(∗)−1)P(S _m) dN\! (S^*,\, 1mI(S^*)^-1 ) The stated result follows by the change of variables m​(−∗) m(S-S^*). ∎ Corollary 5.1 (Prior robustness — complete). Let P1​()P_1(S) and P2​()P_2(S) be two RSI priors satisfying C2. Then: TV​(P1​(∣m),P2​(∣m))→0as ​m→∞TV (P_1(S _m),\,P_2(S _m) )→ 0 m→∞ Proof. Both posteriors converge to ​(∗,m−1​ℐ​(∗)−1)N(S^*,m^-1I(S^*)^-1) by Theorem 2. Since total variation metrizes weak convergence on ℝdR^d, TV​(Pi​(|m),​(⋅))→0TV(P_i(S|D_m),N(·))→ 0 for i=1,2i=1,2, and the result follows by the triangle inequality. ∎ B.3 Proof of Theorem 3: Monotone ELBO Convergence Theorem 6 (Monotone ELBO — complete). The RSI coordinate ascent updates produce a monotonically non-decreasing ELBO sequence: ELBOt+1≥ELBOtELBO_t+1 _t for all t≥0t≥ 0. Proof. Recall the ELBO decomposition: ELBO(ϕ)=Qϕ[logP(∣)]−KL[Qϕ()∥P()]=logP()−KL[Qϕ()∥P(∣)]ELBO(φ)=E_Q_φ[ P(D )]-KL[Q_φ(S)\|P(S)]= P(D)-KL[Q_φ(S)\|P(S )] Since log⁡P​() P(D) is constant with respect to ϕφ, maximizing the ELBO is equivalent to minimizing KL[Qϕ∥P(⋅|)]KL[Q_φ\|P(·|D)]. At iteration t, the update for factor i solves: ϕi(t+1)=argminϕiKL[Qϕi(si)⋅∏j≠iQϕj(t)(sj)∥P(∣)] _i^(t+1)= _ _iKL [Q_ _i(s_i)· _j≠ iQ_ _j^(t)(s_j)\;\|\;P(S ) ] The optimal solution is: Qϕi∗​(si)∝exp⁡(Q−i​[log⁡P​(,)])Q_ _i^*(s_i) \! (E_Q_-i [ P(D,S) ] ) This update can only decrease the KL divergence (or leave it unchanged), hence ELBOt+1≥ELBOtELBO_t+1 _t. Since the ELBO is bounded above by log⁡P​()<∞ P(D)<∞, the sequence converges. The limit is a stationary point of the ELBO. ∎ Lemma 1 (ELBO gap bound). Let Qϕ∗Q_φ^* denote the mean-field optimum. Then: KL[Qϕ∗()∥P(∣)]≤∑i=1nKL[Qϕi∗(si)∥P(si∣)]KL[Q_φ^*(S)\|P(S )]≤ _i=1^nKL[Q_ _i^*(s_i)\|P(s_i )] Proof. By the sub-additivity of KL divergence under the mean-field independence assumption: Qϕ​()=∏iQϕi​(si)Q_φ(S)= _iQ_ _i(s_i). ∎ Appendix C Reproducibility Details C.1 Prior Hyperparameters Table 4 reports the prior hyperparameters (πi,αi,βi,σi)( _i, _i, _i, _i) used for each rule in the Togolese instantiation of RSI. These values encode institutional knowledge about historical compliance rates and rule stability. Table 4: Prior hyperparameters by rule. πi _i: activation probability. (αi,βi)( _i, _i): Beta prior on compliance (​[ci]=α/(α+β)E[c_i]=α/(α+β)). σi _i: standard deviation of parametric drift prior. Rule ID Description πi _i αi _i βi _i ​[ci]E[c_i] σi _i R1_TVA VAT 18%, threshold 60M / 100M FCFA 0.92 8.0 2.0 0.80 0.05 R2_IS CIT 29%, threshold 100M FCFA 0.88 6.0 4.0 0.60 0.03 R3_IMF Minimum flat tax 1% 0.85 9.0 1.5 0.86 0.02 R4_TPU Informal sector flat tax 0.70 3.0 7.0 0.30 0.15 Rationale for prior choices. • R1_TVA: High prior compliance (​[ci]=0.80E[c_i]=0.80) reflects that formal VAT-registered enterprises in Togo generally file returns, even if under-declared. Low drift (σ=0.05σ=0.05) reflects the stability of the 18% rate over the study period. • R2_IS: Moderate compliance (0.600.60) reflects the complexity of CIT computation and higher avoidance rates among large enterprises. • R3_IMF: High compliance (0.860.86) as IMF is simpler to compute (1% of turnover) and harder to avoid. • R4_TPU: Low compliance (0.300.30) reflects the well-documented informality of the micro-enterprise sector in Sub-Saharan Africa. High drift (σ=0.15σ=0.15) reflects high uncertainty about this segment. C.2 Variational Inference Parameters Table 5: Variational inference hyperparameters. Parameter Value Rationale Learning rate η 1.5 Amplifies posterior update beyond standard VI Max iterations 150 Empirical convergence ≤ 10 iterations Convergence tolerance ε 10−510^-5 ELBO change threshold Decision threshold τ 0.551 Optimized for F1 on validation set C.3 Baseline Configurations Table 6: Baseline model configurations. Model Parameter Value XGBoost n_estimators 150 max_depth 4 learning_rate 0.1 subsample 0.8 random_state 42 MLP hidden_layer_sizes (64, 32, 16) activation ReLU max_iter 200 early_stopping True validation_fraction 0.1 random_state 42 RBS VAT threshold (2022–2024) 60M FCFA VAT threshold (2025) 100M FCFA Payment delay alert threshold 90 days C.4 Computational Environment Experiments were run on a standard desktop machine (Windows 11, Intel Core processor, 16GB RAM). All code is implemented in Python 3.11 using NumPy, SciPy, and scikit-learn. No GPU was used. Runtime for the full experiment pipeline is approximately 5–10 minutes. C.5 Random Seeds All experiments use numpy.random.seed(42) for reproducibility. Dataset generation uses numpy.random.default_rng(42).