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|
| 8 |
+
---
|
| 9 |
+
<div align="center">
|
| 10 |
+
|
| 11 |
+
<h1>
|
| 12 |
+
TDAR-8B-Thinking
|
| 13 |
+
</h1>
|
| 14 |
+
|
| 15 |
+
<p><strong>Advancing Block Diffusion Language Models for Test-Time Scaling</strong></p>
|
| 16 |
+
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<p align="center">
|
| 20 |
+
📃 <a href="https://arxiv.org/abs/2602.09555" target="_blank">Paper</a> •
|
| 21 |
+
💻 <a href="https://github.com/LuLuLuyi/TDAR" target="_blank">GitHub</a>
|
| 22 |
+
</p>
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
## Model Description
|
| 26 |
+
|
| 27 |
+
**TDAR-8B-Thinking** is a state-of-the-art Block Diffusion Language Model (BDLM) designed for efficient test-time scaling on complex reasoning tasks. Built on Qwen3-8B architecture, it achieves **3.37× speedup** over autoregressive baselines while maintaining superior reasoning quality.
|
| 28 |
+
|
| 29 |
+
### Key Features
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
- 🚀 **Bounded Adaptive Confidence Decoding (BACD)**: Dynamically adapts denoising process based on local difficulty signals
|
| 33 |
+
- 💡 **Think Coarse, Critic Fine (TCCF)**: Allocates computation based on functional roles in reasoning trajectories
|
| 34 |
+
- 📈 **Progressive Block Size Extension**: Trained with gradually increasing block sizes (B=4→64) for optimal efficiency
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
## Basic Inference
|
| 39 |
+
|
| 40 |
+
We use **LMDeploy 0.10.2** with modifications for Bounded Adaptive Confidence Decoding support.
|
| 41 |
+
|
| 42 |
+
**Quick Installation (Inference Only):**
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
git clone https://github.com/LuLuLuyi/TDAR.git
|
| 46 |
+
cd TDAR
|
| 47 |
+
|
| 48 |
+
# Install lmdeploy
|
| 49 |
+
cd third_party/lmdeploy-0.10.2
|
| 50 |
+
pip3 install -e .
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
> **Note**: This is a minimal setup for inference only. For full installation including training and evaluation dependencies, please refer to our comprehensive Installation Guide on [GitHub](https://github.com/LuLuLuyi/TDAR?tab=readme-ov-file#tdar).
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
The following example shows how to quickly load the model and run inference end-to-end with BACD (Bounded Adaptive Confidence Decoding) for optimal speed-quality trade-off:
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
from lmdeploy import pipeline, PytorchEngineConfig, GenerationConfig
|
| 60 |
+
|
| 61 |
+
# Model path
|
| 62 |
+
model_path = "lulululuyi/TDAR-8B-Thinking-bs8"
|
| 63 |
+
|
| 64 |
+
# Configure engine with BACD (Bounded Adaptive Confidence Decoding)
|
| 65 |
+
engine_config = PytorchEngineConfig(
|
| 66 |
+
tp=1,
|
| 67 |
+
dp=1,
|
| 68 |
+
dtype="bfloat16",
|
| 69 |
+
max_prefill_token_num=4096,
|
| 70 |
+
cache_max_entry_count=0.8,
|
| 71 |
+
enable_prefix_caching=True,
|
| 72 |
+
session_len=8192,
|
| 73 |
+
|
| 74 |
+
# BACD parameters
|
| 75 |
+
dllm_block_length=8,
|
| 76 |
+
dllm_denoising_steps=1,
|
| 77 |
+
dllm_unmasking_strategy="bounded_adaptive_confidence_decoding",
|
| 78 |
+
dllm_confidence_upper_threshold=0.9,
|
| 79 |
+
dllm_confidence_lower_threshold=0.6
|
| 80 |
+
)
|
| 81 |
+
|
| 82 |
+
# Load model
|
| 83 |
+
pipe = pipeline(model_path, backend_config=engine_config)
|
| 84 |
+
|
| 85 |
+
# Prepare prompt
|
| 86 |
+
question = "Write $\\frac{3}{20}$ as a decimal."
|
| 87 |
+
prompt = f"""<|im_start|>user\n{question}Please reason step by step and put the final answer in \\boxed{{}}.\n<|im_end|>\n<|im_start|>assistant\n<think>"""
|
| 88 |
+
|
| 89 |
+
# Generation config
|
| 90 |
+
gen_config = GenerationConfig(
|
| 91 |
+
top_k=0,
|
| 92 |
+
temperature=1.0,
|
| 93 |
+
top_p=1.0,
|
| 94 |
+
do_sample=True,
|
| 95 |
+
max_new_tokens=4096,
|
| 96 |
+
ignore_eos=False,
|
| 97 |
+
repetition_penalty=1.00
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
+
# Generate
|
| 101 |
+
output = pipe([prompt], gen_config=gen_config)
|
| 102 |
+
print(output[0].text)
|
| 103 |
+
|
| 104 |
+
# Clean up
|
| 105 |
+
pipe.close()
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
## Performance
|
| 110 |
+
We comprehensively evaluate TDAR on 6 diverse reasoning benchmarks covering mathematical reasoning, code generation, and STEM tasks:
|
| 111 |
+
|
| 112 |
+
| Method | **Math500** | | **AIME24** | | **AIME25** | | **AMC23** | | **LCB** | | **GPQA** | | **AVG** | |
|
| 113 |
+
|--------|---------|------|--------|------|--------|------|-------|------|-----|------|------|------|---------|------|
|
| 114 |
+
| | TPF | ACC | TPF | AVG@8 | TPF | AVG@8 | TPF | AVG@8 | TPF | ACC | TPF | ACC | TPF | ACC |
|
| 115 |
+
| **Autoregressive LM** |
|
| 116 |
+
| Qwen3-8B-Thinking† | 1.00 | 88.2 | 1.00 | 63.3 | 1.00 | 55.8 | 1.00 | 88.8 | 1.00 | 59.5 | 1.00 | 49.0 | 1.00 | 67.4 |
|
| 117 |
+
| **Masked Diffusion LM** |
|
| 118 |
+
| LLaDA | 3.91 | 41.2 | 3.44 | 6.7 | 3.66 | 0.0 | 4.07 | 12.5 | 2.83 | 4.7 | 3.14 | 17.2 | 3.51 | 13.7 |
|
| 119 |
+
| LLaDA-1.5 | 3.97 | 42.2 | 3.34 | 0.0 | 3.68 | 0.0 | 4.01 | 10.0 | 2.86 | 4.3 | 3.01 | 24.2 | 3.48 | 13.5 |
|
| 120 |
+
| LLaDA-MoE | 2.70 | 56.6 | 2.89 | 3.3 | 2.71 | 0.0 | 3.16 | 32.5 | 2.05 | 12.9 | 2.18 | 27.8 | 2.62 | 22.2 |
|
| 121 |
+
| **Block Diffusion LM** |
|
| 122 |
+
| Fast-dLLM-v2 | 2.81 | 59.4 | 2.58 | 0.0 | 2.58 | 0.0 | 2.77 | 25.0 | 1.73 | 6.8 | 2.09 | 28.3 | 2.43 | 19.9 |
|
| 123 |
+
| SDAR-8B-Chat | 2.21 | 52.6 | 2.96 | 5.0 | 2.35 | 7.1 | 2.83 | 22.5 | 1.60 | 7.5 | 1.32 | 10.6 | 2.21 | 17.6 |
|
| 124 |
+
| DiRL-8B-Instruct | 2.30 | 78.2 | 1.96 | 18.8 | 1.92 | 15.8 | 2.05 | 65.6 | 2.64 | 10.4 | 2.27 | 44.4 | 2.19 | 38.9 |
|
| 125 |
+
| TraDo-8B-Instruct | 2.36 | 75.0 | 2.13 | 13.3 | 2.00 | 12.5 | 2.23 | 55.3 | 1.42 | 7.2 | 1.43 | 27.3 | 1.93 | 31.8 |
|
| 126 |
+
| TraDo-8B-Thinking | 1.28 | 84.0 | 1.35 | 31.3 | 1.35 | 26.3 | 1.37 | 72.8 | 1.10 | 22.6 | 1.16 | 46.0 | 1.27 | 47.1 |
|
| 127 |
+
| TraDo + BACD | 1.33 | 85.0 | 1.44 | 32.9 | 1.44 | 27.5 | 1.45 | 73.8 | 1.15 | 23.3 | 1.18 | 49.5 | 1.33 | 48.7 |
|
| 128 |
+
| TraDo + BACD + TCCF | 1.28 | 85.6 | 1.36 | 35.8 | 1.33 | 27.1 | 1.36 | 74.1 | 1.11 | 21.9 | 1.14 | 49.5 | 1.27 | 49.0 |
|
| 129 |
+
| **TDAR-8B-thinking (Ours)** | **1.62** | **81.6** | **4.47** | **34.6** | **4.17** | **30.8** | **5.03** | **69.1** | **1.25** | **40.5** | **1.28** | **46.5** | **2.97** | **50.5** |
|
| 130 |
+
| **+ BACD** | **1.88** | **83.4** | **5.07** | **36.3** | **4.73** | **30.4** | **5.59** | **71.3** | **1.46** | **40.1** | **1.49** | **46.0** | **3.37** | **51.2** |
|
| 131 |
+
| **+ BACD + TCCF** | **1.75** | **84.0** | **3.04** | **42.9** | **2.79** | **35.8** | **2.68** | **80.0** | **1.32** | **42.6** | **1.39** | **50.0** | **2.16** | **55.9** |
|
| 132 |
+
|
| 133 |
+
> **Note:** TPF = Tokens Per Forward Pass (higher is faster); † indicates models derived from Qwen3-8B-Base with identical CPT and SFT.
|
| 134 |
+
|
| 135 |
+
### Key Findings
|
| 136 |
+
|
| 137 |
+
**🏆 State-of-the-Art Performance**
|
| 138 |
+
- Achieves **55.9%** average accuracy with BACD + TCCF (best among all 8B BDLMs)
|
| 139 |
+
- Outperforms TraDo-8B-Thinking by **+8.8 points** while being **2.34× faster** (2.97 TPF vs 1.27 TPF)
|
| 140 |
+
- Strong results on challenging benchmarks: **42.9** on AIME24, **35.8** on AIME25, **80.0** on AMC23
|
| 141 |
+
|
| 142 |
+
**⚡ Superior Efficiency**
|
| 143 |
+
- **3.37× speedup** with BACD alone (maximum efficiency, 51.2% accuracy)
|
| 144 |
+
- **2.16× speedup** with BACD + TCCF (best quality, 55.9% accuracy)
|