Introduction
Declarative modeling allows users to specify what a problem is rather than how to solve it. However, translating real-world requirements into formal constraints and optimization functions remains a significant bottleneck. Expert knowledge is often required to define these models, and even then, the process is error-prone and time-consuming. In "Learning Constraints and Optimization Criteria," Samuel Kolb proposes a framework to automate this by learning first-order weighted MAX-SAT theories directly from examples and user preferences.
The Two-Step Learning Framework
The proposed approach addresses the limitations of previous propositional methods, which were often tied to specific problem instances. By using first-order logic, the learned models can generalize across different problem sizes and structures. The framework operates through a two-step pipeline:
- Clausal Discovery (ILP): Utilizing Inductive Logic Programming (ILP), the system identifies first-order clauses (rules) satisfied by provided examples. A refinement operator starts with general rules and progressively adds literals to specialize them. This step distinguishes between "hard" constraints (always satisfied) and "soft" constraints (occasionally satisfied).
- Preference Learning ($SVM^{rank}$): To determine the relative importance of these rules, the system employs preference learning. Each example is represented as a feature vector based on clause satisfaction. $SVM^{rank}$ then calculates weights for these features to align with user-provided pairwise preferences (e.g., "Configuration A is better than B").
The final output is a weighted first-order MAX-SAT theory compatible with standard solvers like IDP.
Experimental Evaluation
The framework was tested on four diverse optimization problems:
- Map Coloring: Learning adjacency constraints.
- Sudoku: Discovering grid rules from a single $4 \times 4$ solution.
- Elevator Scheduling: Minimizing "panic" through soft constraints.
- Co-housing: Balancing housing and work preferences with background knowledge.
Results and Analysis
Accuracy and Data Efficiency
The system demonstrates strong performance even with limited data. As shown in Figure 5, accuracy improves significantly as both the training set size ($p_{train}$) and the amount of preference data ($p_{pref}$) increase. Even with a training set of only 20% ($p_{train} = 0.2$), the system achieves respectable accuracy, which climbs toward 80-90% as more preferences are provided or the training set grows.
Robustness to Noise
A key advantage of this approach is its resilience to inconsistent user input. In real-world scenarios, human preferences can be noisy or contradictory. Figure 6 illustrates how the system maintains high accuracy even when a portion of the preferences are intentionally flipped ($p_{error}$). The statistical nature of the SVM helps mitigate the impact of these errors, ensuring the learned model remains robust.
Efficiency Gains
Beyond accuracy, the learned theories often proved more computationally efficient than human-written ones. For instance, in the Sudoku task, the solver using the learned theory found solutions in 0.310 seconds, compared to 1.453 seconds for the human-programmed version. This is attributed to the ILP process discovering redundant or structural constraints that help the solver prune the search space more effectively.
Conclusion
This research provides a viable path toward automating the complex task of declarative modeling. By combining ILP with preference learning, the framework captures both the hard rules and the subjective goals of optimization problems. While scalability remains a challenge for larger predicate sets, the ability to learn generalizable, efficient models from simple pairwise preferences marks a significant step forward in human-in-the-loop optimization.
Summary updated