File size: 3,999 Bytes
95b2ae8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
license: apache-2.0
tags:
  - ml-intern
  - reproduction
  - masked-diffusion
  - boolean-satisfiability
---

# SearchDiff SAT reproduction (from-scratch rebuild)

Independent reproduction attempt of the Boolean-SAT claim in **"Search-Augmented
Masked Diffusion Models for Constrained Generation"** ([arXiv:2602.02727](https://arxiv.org/abs/2602.02727),
Table 10): vanilla masked-diffusion decoding ≈ 9.6% vs. last-step refinement ≈ 11.4% vs.
SearchDiff ≈ 76.0% SAT accuracy at T=20 on random 3-SAT (n=7 variables, 45 clauses).

**Authentication:** the author repo ([Tahuubinh/searchdiff @ 7a31e92](https://github.com/Tahuubinh/searchdiff))
contains no symbolic-task code, data, or checkpoints (verified against the full file tree
at the pinned commit), so this is a from-scratch rebuild from the paper text, not a
reproduction of their assets.

**Key diagnostic:** with the standard clause convention, only **25.4% of random 45-clause
7-variable formulas are satisfiable** (exhaustive 128-assignment oracle over the 512-formula
test set). Any reported accuracy above ~25% on an unrestricted cohort is impossible; the
paper's 76% therefore cannot be measured on all formulas, and its denominator is not
disclosed anywhere in the paper.

## Results (512 test formulas; SAT-only cohort = 130; all independently verified)

| Method (T=20) | all-formulas % | SAT-only % | paper (Table 10) |
|---|---|---|---|
| vanilla MDM | 1.24 ± 0.40 | 4.9 ± 1.6 | 9.6 |
| last-step refinement | 1.75 ± 0.56 | 6.9 ± 2.3 | 11.4 |
| SearchDiff (K=32) | 21.6 ± 0.7 | 85.1 ± 2.8 | 76.0 |
| no-model hill climb (budget-matched) | 11.5 ± 0.8 | 45.1 ± 2.9 | — |
| SearchDiff w/ random proposals | 19.7 | 77.7 | — |

T-sweep (SearchDiff, SAT-only %): 81.5 / 76.2 / 82.3 / 82.3 / 85.1 at T = 1/5/10/15/20 —
T=1 already reaches 81.5% with only ~46 evaluator calls. K-sweep at T=20: 43.1 / 60.8 /
85.1 / 96.9% for K = 1/8/32/128 (K=128 → 24.6% all-formulas, vs the 25.4% satisfiability
ceiling).

**Findings:** (1) the qualitative claim reproduces — throughout-search ≫ last-step ≫ vanilla;
(2) the paper's 76% exceeds the 25.4% satisfiable fraction of unrestricted random formulas,
so Table 10's denominator must be an undisclosed satisfiable-only selection (we report both);
(3) most of the gain is search compute: random-candidate proposals with identical search
machinery recover 77.7% SAT-only vs 85.1% model-guided at the same budget, and search at
T=1 alone matches T=20.

## What is here
- `sat_core.py` — seeded 3-SAT generator, exhaustive oracle, tokenizer, independent
  parse-and-check verifier (invalid/missing/wrong-length outputs count as failures).
- `gen_data.py` — builds the inventories (train 20k + val 1k SAT-only, test 512 all-types,
  both oracle-labelled) → [Rami/searchdiff-sat-inventory](https://huggingface.co/datasets/Rami/searchdiff-sat-inventory).
- `train_mdm.py` — 6.09M-param bidirectional GPT-2-style masked-diffusion model trained on
  FORMULA[SEP]ASSIGNMENT with an MDLM-style absorbing diffusion (linear schedule).
- `sample_eval.py` — vanilla decoding, last-step search, SearchDiff (CSS + clause-based
  local refinement), and the controls: random-candidate search (no learned proposals) and
  model-free hill climbing at matched evaluator budget.
- `mdm_sat.pt` — the trained checkpoint.

<div style="display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 2em"><a href="https://hf.co/chat?mode=ml-intern"><img src="https://hf.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-lg.svg" alt="Built with ML Intern" style="margin:0"></a><a href="https://hf.co/chat?mode=ml-intern&prompt=Rerun%20the%20SearchDiff%20Boolean-SAT%20evaluation%20with%2010%20seeds%20and%20report%20error%20bars" style="display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border:1.5px solid #eee;border-radius:16px;background:#f9fbfc;color:#c2410c;font-weight:600;font-size:14px;text-decoration:none">Rerun with 10 seeds ›</a></div>