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
19
MaxCutGSET (|V|=1K)
Average Gap to Best Known Cut12.44
19
MaxCutGSET (|V|>=3K)
Average Gap to Best Known Cut115.3
18
MaxCutGSET |V|=2K
Average Gap to Best Known Cut52.11
18
Sudoku SolvingSudoku Easy
Accuracy100
9
Sudoku SolvingSudoku Hard
Success Rate77.7
9
Graph ColoringGraph Coloring 10 Colors, n=100
Success Rate52.6
8
Graph ColoringGraph Coloring 10 Colors, n=200
Success Rate11.92
8
Graph ColoringGraph Coloring 5 Colors n=50
Solved Instances Rate81
8
Graph ColoringGraph Coloring 5 Colors, n=100
Success Rate47.33
8
Showing 10 of 16 rows

Other info

Follow for update