Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Self-Supervised Transformers as Iterative Solution Improvers for Constraint Satisfaction

About

We present a Transformer-based framework for Constraint Satisfaction Problems (CSPs). CSPs find use in many applications and thus accelerating their solution with machine learning is of wide interest. Most existing approaches rely on supervised learning from feasible solutions or reinforcement learning, paradigms that require either feasible solutions to these NP-Complete CSPs or large training budgets and a complex expert-designed reward signal. To address these challenges, we propose ConsFormer, a self-supervised framework that leverages a Transformer as a solution refiner. ConsFormer constructs a solution to a CSP iteratively in a process that mimics local search. Instead of using feasible solutions as labeled data, we devise differentiable approximations to the discrete constraints of a CSP to guide model training. Our model is trained to improve random assignments for a single step but is deployed iteratively at test time, circumventing the bottlenecks of supervised and reinforcement learning. Experiments on Sudoku, Graph Coloring, Nurse Rostering, and MAXCUT demonstrate that our method can tackle out-of-distribution CSPs simply through additional iterations.

Yudong W. Xu, Wenhao Li, Scott Sanner, Elias B. Khalil• 2025

Related benchmarks

TaskDatasetResultRank
MaxCutGSET (|V|=800)
Average Gap to Best Known Cut16.33
9
MaxCutGSET (|V|=1K)
Average Gap to Best Known Cut12.44
9
MaxCutGSET (|V|>=3K)
Average Gap to Best Known Cut115.3
8
MaxCutGSET |V|=2K
Average Gap to Best Known Cut52.11
8
Sudoku SolvingSudoku In-distribution (test)
Accuracy100
6
Sudoku SolvingSudoku OOD - RRN (test)
Instance Solved Rate85.8
6
Graph ColoringGraph-Coloring-10 n=100 (test)
Instance Solved Percentage53.6
5
Graph ColoringGraph-Coloring-5 n=50 (test)
Instance Solved Rate81.6
5
Graph ColoringGraph-Coloring-5 n=100 (OOD)
Instance Solved (%)47.33
5
Graph ColoringGraph-Coloring-10 OOD n=200
Instance Solved Rate10.2
5
Showing 10 of 10 rows

Other info

Follow for update