File size: 5,292 Bytes
5cea346
188209c
9b13530
5cea346
 
 
 
 
dc07a76
5cea346
9b13530
5cea346
 
 
 
 
 
188209c
5cea346
188209c
5cea346
188209c
 
 
5cea346
188209c
 
5cea346
188209c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5cea346
188209c
 
 
 
 
 
ac641cf
188209c
 
 
 
ac641cf
188209c
 
 
 
 
 
5cea346
188209c
 
5cea346
ac641cf
 
 
 
 
188209c
 
 
 
 
5cea346
 
 
ac641cf
5cea346
 
 
17d6930
 
 
188209c
17d6930
 
 
188209c
17d6930
ac641cf
188209c
17d6930
 
 
5cea346
 
 
188209c
5cea346
188209c
5cea346
 
188209c
5cea346
ac641cf
188209c
 
 
 
 
 
5cea346
 
188209c
 
c7c8f15
188209c
 
 
5cea346
 
188209c
 
 
 
 
5cea346
188209c
5cea346
188209c
 
 
5cea346
 
 
 
 
 
 
 
 
 
 
 
 
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
library_name: transformers
pipeline_tag: reinforcement-learning
base_model: GSAI-ML/LLaDA-8B-Instruct
base_model_relation: finetune
license: mit
tags:
  - llada
  - llm
  - diffusion-language-model
  - reinforcement-learning
  - black-box-optimization
  - offline-black-box-optimization
  - design-bench
  - dibo
---

# DiBO-TFBind8

Final task-specific DiBO model for `TFBind8-Exact-v0`, released with
[Training Diffusion Language Models for Black-Box Optimization](https://arxiv.org/abs/2603.17919)
(ICML 2026 Spotlight). See also the
[Hugging Face paper page](https://huggingface.co/papers/2603.17919) and the
[DiBO code repository](https://github.com/zpointS/DiBO).

This model completed domain adaptation (DA), supervised fine-tuning (SFT),
and reinforcement learning (RL).

## Available model formats

This repository provides the same final task-specific DiBO model in two formats.

1. **Original PyTorch checkpoint.** `dibo_tfbind8_final.pt` is the canonical
   paper-faithful checkpoint produced by the DiBO training pipeline. It stores
   the state dictionary under the `model` key and is
   loaded through the DiBO codebase on top of the pinned LLaDA base revision.
2. **Transformers/safetensors export.** The root-level config, tokenizer,
   custom modeling code, and sharded safetensors files are a validated
   convenience export derived deterministically from the original checkpoint.
   They load directly with `AutoModel.from_pretrained(...)`.

The safetensors model was not trained separately. The LLaDA base weights are
not duplicated in this repository.

## A. Load the standard Transformers export

```python
from transformers import AutoModel, AutoTokenizer

repo_id = "zpointsun/DiBO-TFBind8"
tokenizer = AutoTokenizer.from_pretrained(
    repo_id,
    revision="v1.1.7",
    trust_remote_code=True,
)
model = AutoModel.from_pretrained(
    repo_id,
    revision="v1.1.7",
    trust_remote_code=True,
    use_safetensors=True,
    torch_dtype="auto",
)
model.eval()
```

The packaged tokenizer already includes the four DiBO delimiter tokens. Do not
add them or resize embeddings again after loading this export.

The tokenizer configuration retains LLaDA's `chat_template` metadata, but DiBO
does not call `apply_chat_template` during training or evaluation. DiBO directly
tokenizes its rendered unified prompt-response corpus with the delimiter tokens
above; do not insert chat headers when reproducing the released evaluation path.

## B. Download and load the original checkpoint

The original artifact uses the released DiBO loader, which initializes the
pinned LLaDA base, adds the four delimiter tokens, resizes the input embedding,
and strictly loads `checkpoint["model"]`.

```bash
hf download zpointsun/DiBO-TFBind8 dibo_tfbind8_final.pt \
  --revision v1.1.7 --local-dir checkpoints/dibo-tfbind8
```

```python
import torch
from huggingface_hub import hf_hub_download
from src.model.dllm import DEFAULT_MODEL_ID, LLADA_MODEL_REVISION, load_model_and_tokenizer

assert DEFAULT_MODEL_ID == "GSAI-ML/LLaDA-8B-Instruct"
assert LLADA_MODEL_REVISION == "08b83a6feb34df1a6011b80c3c00c7563e963b07"
checkpoint_path = hf_hub_download(
    "zpointsun/DiBO-TFBind8",
    filename="dibo_tfbind8_final.pt",
    revision="v1.1.7",
)
model, tokenizer = load_model_and_tokenizer(DEFAULT_MODEL_ID, device="cuda")
checkpoint = torch.load(checkpoint_path, map_location="cuda")
model.load_state_dict(checkpoint["model"], strict=True)
model.eval()
```

## C. Evaluate either format

From a checkout of the released DiBO code and its oracle environment:

```bash
# Standard Transformers export
python eval.py --tasks TFBind8-Exact-v0 \
  --model_name_or_path zpointsun/DiBO-TFBind8 --model_revision v1.1.7 \
  --seeds <SEEDS> --max_attempts 1000

# Canonical local .pt checkpoint
python eval.py --tasks TFBind8-Exact-v0 \
  --checkpoint_path checkpoints/dibo-tfbind8/dibo_tfbind8_final.pt \
  --seeds <SEEDS> --max_attempts 1000
```

Both choices share the same downstream DiBO evaluation path. Direct oracle
evaluation requires the Design-Bench data cache and task dependencies described
in the [DiBO repository](https://github.com/zpointS/DiBO).
For the exact Design-Bench snapshot used in the DiBO experiments, see
[DiBO-DesignBench-Snapshot](https://huggingface.co/datasets/zpointsun/DiBO-DesignBench-Snapshot).

## Limitations

Practical inference requires a CUDA-capable PyTorch environment. These
task-specific models are designed for DiBO's masked-response generation and
evaluation workflow; this release does not claim generic text-generation
pipeline support. Loading a released final model is for evaluation or use and
does not reproduce the DA/SFT/RL training process.

## Other DiBO task models

- [DiBO-TFBind10](https://huggingface.co/zpointsun/DiBO-TFBind10)
- [DiBO-AntMorphology](https://huggingface.co/zpointsun/DiBO-AntMorphology)
- [DiBO-DKittyMorphology](https://huggingface.co/zpointsun/DiBO-DKittyMorphology)

## Citation

If you find DiBO helpful, please cite:

```bibtex
@article{sun2026training,
  title={Training diffusion language models for black-box optimization},
  author={Sun, Zipeng and Chen, Can and Yuan, Ye and Wu, Haolun and Gu, Jiayao and Pal, Christopher and Liu, Xue},
  journal={arXiv preprint arXiv:2603.17919},
  year={2026}
}
```