Views
No views yet
1git clone https://github.com/LuLuLuyi/TDAR.git
2cd TDAR
3
4# Install lmdeploy
5cd third_party/lmdeploy-0.10.2
6pip3 install -e .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.
1from lmdeploy import pipeline, PytorchEngineConfig, GenerationConfig
2
3# Model path
4model_path = "lulululuyi/TDAR-8B-Thinking-bs4"
5
6# Configure engine with BACD (Bounded Adaptive Confidence Decoding)
7engine_config = PytorchEngineConfig(
8 tp=1,
9 dp=1,
10 dtype="bfloat16",
11 max_prefill_token_num=4096,
12 cache_max_entry_count=0.8,
13 enable_prefix_caching=True,
14 session_len=8192,
15
16 # BACD parameters
17 dllm_block_length=4,
18 dllm_denoising_steps=1,
19 dllm_unmasking_strategy="bounded_adaptive_confidence_decoding",
20 dllm_confidence_upper_threshold=0.9,
21 dllm_confidence_lower_threshold=0.6
22)
23
24# Load model
25pipe = pipeline(model_path, backend_config=engine_config)
26
27# Prepare prompt
28question = "Write $\\frac{3}{20}$ as a decimal."
29prompt = 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>"""
30
31# Generation config
32gen_config = GenerationConfig(
33 top_k=0,
34 temperature=1.0,
35 top_p=1.0,
36 do_sample=True,
37 max_new_tokens=4096,
38 ignore_eos=False,
39 repetition_penalty=1.00
40)
41
42# Generate
43output = pipe([prompt], gen_config=gen_config)
44print(output[0].text)
45
46# Clean up
47pipe.close()| Method | Math500 | AIME24 | AIME25 | AMC23 | LCB | GPQA | AVG | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TPF | ACC | TPF | AVG@8 | TPF | AVG@8 | TPF | AVG@8 | TPF | ACC | TPF | ACC | TPF | ACC | |
| Autoregressive LM | ||||||||||||||
| 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 |
| Masked Diffusion LM | ||||||||||||||
| 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 |
| 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 |
| 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 |
| Block Diffusion LM | ||||||||||||||
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| + 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 |
| + 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 |
Note: TPF = Tokens Per Forward Pass (higher is faster); † indicates models derived from Qwen3-8B-Base with identical CPT and SFT.