TL;DR
This paper introduces CRANE2, a fully automated algorithm for First-Order Model Counting (FOMC). CRANE2 significantly improves upon previous methods by automatically generating C++ code with arbitrary-precision arithmetic, enabling it to handle domain sizes over 500,000 times larger than existing state-of-the-art approaches. This advancement is crucial for applying lifted inference techniques to complex probabilistic models.
What Problem Does This Paper Address?
First-Order Model Counting (FOMC) is the problem of determining how many ways a sentence in first-order logic can be true over a given domain. This is a fundamental problem in artificial intelligence, particularly for "lifted inference" techniques, which aim to make probabilistic reasoning more efficient by exploiting symmetries. While previous methods, like CRANE, could compile sentences into recursive functions to compute model counts, they required manual intervention to evaluate these functions and lacked proper base cases, limiting their practicality. The challenge was to create a fully automated system that could not only compile these sentences but also generate efficient, executable code capable of handling very large domains.
Methods
The core contribution is CRANE2, an automated algorithm that builds upon the CRANE framework. CRANE2 introduces several key innovations:
- Automated Base Case Identification: CRANE2 automatically identifies and incorporates necessary base cases for recursive functions generated by CRANE, preventing infinite loops during evaluation.
- C++ Code Generation: It transforms the compiled function definitions into C++ code. This allows for direct execution and computation of model counts.
- Arbitrary-Precision Arithmetic: The generated C++ code uses arbitrary-precision arithmetic, enabling it to handle extremely large numbers that arise from counting models over large domains, a limitation of previous methods.
- Recursive Compilation: CRANE2 employs a recursive compilation process that can call CRANE on derived sentences, ensuring that all necessary components, including base cases, are handled.
- Simplification and Propagation: The algorithm incorporates algebraic simplification and a novel "propagation" procedure to handle domain size assumptions efficiently.
Datasets
The paper does not introduce new datasets. Instead, it uses three established benchmarks for evaluation:
- Bijections: A problem of counting bijective mappings between two sets.
- Friends & Smokers: A variant of a Markov logic network used to model social networks with probabilistic relationships (smoking, friendship, cancer).
- Functions: A problem involving counting functions from one domain to another.
These benchmarks are translated into different logical formalisms (FO, C², UFO² + CC) to test the algorithms across various logical expressivities.
Key Insights and Ideas
- Automation is Key: The transition from CRANE's manual evaluation to CRANE2's fully automated C++ code generation is the most significant leap, making FOMC practical for a much wider range of users and applications.
- Arbitrary-Precision Arithmetic is Crucial for Scalability: The ability to handle arbitrarily large numbers is not just an enhancement but a necessity for scaling FOMC to the large domain sizes that are relevant in real-world probabilistic reasoning.
- Recursive Compilation is Powerful: The recursive nature of CRANE2's compilation process allows it to systematically derive and complete function definitions, including base cases, which were a major hurdle in prior work.
- Logics Matter for Performance: The paper highlights how different logical formalisms (FO, C², UFO² + CC) impact the performance and expressiveness of FOMC algorithms, with FO being the input format for CRANE2.
Key Results
CRANE2 demonstrated a dramatic improvement in scalability:
- Domain Size: CRANE2 could handle domain sizes over 500,000 times larger than the state-of-the-art. For instance, it successfully computed model counts for domains up to 67,108,864 for the "Friends & Smokers" benchmark.
- Benchmark Performance:
- For the "Bijections" problem, only FASTWFOMC and CRANE2-BFS could handle it, with CRANE2 scaling to larger domains.
- For "Friends & Smokers," CRANE2 significantly outperformed FASTWFOMC and FORCLIFT, scaling to much larger domain sizes.
- For "Functions," CRANE2 also showed superior scalability compared to FASTWFOMC and FORCLIFT.
- Compilation Time: While FORCLIFT generally had lower compilation times, CRANE2's overall runtime advantage in handling larger domains made it the more efficient choice for complex problems.
Limitations and Future Work
- Limitations:
- While CRANE2 significantly outperforms previous methods, the paper notes that the runtime of FASTWFOMC and FORCLIFT can be slightly higher for the smallest domain sizes due to just-in-time (JIT) compilation.
- The paper focuses on FOMC, and extending support for WFOMC (weighted FOMC) would require using floating-point numbers.
- Future Work:
- Conducting comprehensive experimental comparisons of FOMC algorithms across a wider range of sentences.
- Theoretically characterizing the capabilities of CRANE2 for specific logic fragments.
- Analyzing the fine-grained complexity of FOMC solutions to gain deeper insights into computational demands.
Summary updated