Automated Reasoning and Learning for Automated Payroll Management

Sebastijan Dumancic, Wannes Meert, Stijn Goethals, Tim Stuyckens, Jelle Huygen, Koen DeniesAAAI 2021 · DOI

Introduction

Payroll management is traditionally viewed as a series of static calculations. However, for self-employed individuals and business owners, it is fundamentally an optimization problem. A common question might be: "How many days should I work, and at what rate, to maximize my net income without crossing into a higher tax bracket that diminishes my take-home pay?"

The primary obstacle to automating these answers is the nature of tax legislation. Tax laws are notoriously complex, non-linear, and filled with conditional logic. Traditional optimization techniques, such as Linear Programming (LP) or Mixed-Integer Programming (MIP), often struggle with the "if-then-else" structures and non-linear arithmetic inherent in fiscal rules. This paper presents a hybrid system that combines formal automated reasoning with machine learning to bridge the gap between legal compliance and computational efficiency.

Formal Modeling of Tax Legislation

To handle the complexity of the law, the authors utilize the VIREN Financial Modelling Language (FML). FML is a domain-specific language designed to allow legal experts and accountants to define rules using a structure that mirrors spreadsheet formulas but maintains mathematical rigor.

The hierarchical structure of the VIREN Financial Modelling Language (FML), illustrating how complex tax rules are decomposed into simple, composite, and switch blocks.

As shown in the modeling hierarchy, FML organizes rules into three types of blocks:

  • Simple Blocks: Contain basic expressions and arithmetic.
  • Composite Blocks: Compose multiple blocks together, defining the relationships between their inputs and outputs.
  • Switch Blocks: Handle conditional logic (e.g., "if HasWork is true, then..."), which is essential for representing different tax brackets or eligibility criteria.

Constraint Solving and Optimization

Once the legal rules are modeled in FML, they are compiled into constraints for a Satisfiability Modulo Theory (SMT) solver, specifically Microsoft’s Z3. SMT solvers are uniquely suited for this task because they can handle decimal numbers and non-linear equality constraints (such as Gross = Wage * Days) more effectively than standard constraint programming tools.

Because SMT solvers are typically designed to find any valid solution rather than the optimal one, the authors developed a custom algorithm called VMinimize. This algorithm employs a strategic bisection search. A key insight discovered during development was that SMT solvers often prove a problem is "unsatisfiable" (i.e., no solution exists for a given target) faster than they find a valid assignment. VMinimize exploits this by using a "skewed" bisection (a 40/60 split) to prioritize checking lower bounds, thereby pruning the search space more rapidly.

Machine Learning for Acceleration

While the SMT solver ensures 100% legal correctness, solving nearly a thousand constraints per case can be computationally expensive when scaled to thousands of employees. To address this, the authors integrated a Random Forest model to provide a "warm start."

By training the model on historical optimization data, it can predict a likely optimal value for a new case. The SMT solver then uses this prediction as its initial starting point. This hybrid approach maintains the reliability of formal reasoning—if the ML model predicts an "illegal" or sub-optimal value, the SMT engine will simply correct it—while significantly reducing the number of iterations required to reach the true optimum.

Results and Impact

The system was evaluated using a real-world dataset of 3,016 payroll cases from Xerius, a Belgian social insurance fund. The results demonstrate a transformative improvement in performance.

A comparison of solving times showing that the integration of machine learning (blue) significantly reduces latency and variance compared to a standard 'cold start' solver (orange).

Key performance metrics include:

  • 4–5x Speedup: The transition from a "cold start" to an ML-accelerated "warm start" reduced average solving times from 0.7 seconds to just 0.1 seconds per case.
  • Scalability: For a large organization with 10,000 employees, this optimization reduces a two-hour task to approximately 16 minutes.
  • Constraint Reduction: By propagating fixed variables (like an employee's birth date) before the solver begins, the system reduces the number of active constraints by a factor of 10.

Conclusion

This research demonstrates that tax legislation is a "natural fit" for constraint solving due to its deterministic and precisely defined nature. By combining the rigorous verification of SMT solvers with the predictive speed of machine learning, the authors have created a solution that is both legally compliant and performant enough for large-scale industrial use. The system has been successfully deployed in the Belgian social insurance sector for over a year, handling millions of calculations and providing a blueprint for automated reasoning in other highly regulated financial domains.

Summary updated

BibTeX
@inproceedings{dumancic2021automated,
  author = {Sebastijan Dumancic and Wannes Meert and Stijn Goethals and Tim Stuyckens and Jelle Huygen and Koen Denies},
  title = {{Automated Reasoning and Learning for Automated Payroll Management}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i17.17774},
}
Figure