Views
No views yet
[!IMPORTANT] Take-home message
- Balanced Efficiency: SDAR unifies the efficient training of AR models with the parallel inference of diffusion, achieving both fast training and inference.
- Fair Comparisons: In rigorously controlled experiments, SDAR achieves on-par general task performance with strong AR baselines, ensuring credibility and reproducibility.
- Superior Learning Efficiency: On complex scientific reasoning tasks (e.g., GPQA, ChemBench, Physics), SDAR shows clear gains over AR models of the same scale, approaching or even exceeding leading closed-source systems.
1git clone https://github.com/Labman42/JetEngine.git
2cd JetEngine
3pip install .1import os
2from jetengine import LLM, SamplingParams
3from transformers import AutoTokenizer
4
5model_path = os.path.expanduser("/path/to/your/sdar-model")
6tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
7# Initialize the LLM
8llm = LLM(
9 model_path,
10 enforce_eager=True,
11 tensor_parallel_size=1,
12 mask_token_id=151669, # Optional: only needed for masked/diffusion models
13 block_length=4
14)
15
16# Set sampling/generation parameters
17sampling_params = SamplingParams(
18 temperature=1.0,
19 topk=0,
20 topp=1.0,
21 max_tokens=256,
22 remasking_strategy="low_confidence_dynamic",
23 block_length=4,
24 denoising_steps=4,
25 dynamic_threshold=0.9
26)
27
28# Prepare a simple chat-style prompt
29prompt = tokenizer.apply_chat_template(
30 [{"role": "user", "content": "Explain what reinforcement learning is in simple terms."}],
31 tokenize=False,
32 add_generation_prompt=True
33)
34
35# Generate text
36outputs = llm.generate_streaming([prompt], sampling_params)block_length = 4, denoising_steps = 4, greedy decoding.

