Skip to content
WhenGIXPublic

About

Code Implementation of "LLaCO: Continuous Diffusion for Large Language Models with Competition-Aware Semantic Scheduling"

Resources

Stars

11 stars

Watchers

0 watching

Forks

Repository files navigation

LLaCO: Continuous Diffusion for Large Language Models with Competition-Aware Semantic Scheduling

Zijian Jia*, Peixuan Zhang*, Genying Li, Di Wu, Yujie Fu, Si Li, Boxin Shi, Shuchen Weng

*Equal contribution

arXiv Project Page Hugging Face

Abstract

LLaCO is a continuous diffusion framework for large language models, powered by Competition-Aware Semantic Scheduling.

CLICK for the full abstract Continuous diffusion models have emerged as a promising non-autoregressive paradigm for text generation, enabling bidirectional contextual planning and fine-grained semantic transitions over continuous embedding spaces. Along the continuous trajectory, the residual token identity in an intermediate state directly shapes the denoising objective at each step. However, the geometric trajectory strictly misaligns with temporal progression, triggering severe temporal compression near the noisy endpoint. In this paper, we show that embedding norm decay causes Euclidean distance to yield spurious overtaking, indicating that token competition must be evaluated directionally. In this space, a candidate overtakes the source token only when the effective noise magnitude surpasses their semantic separation. We formalize these pairwise dynamics as the Competition Threshold Theory (CTT). Crucially, high-dimensional overtaking requires extreme noise levels, causing standard trajectories to concentrate identity decay into a narrow window near the noisy endpoint. To resolve this, we propose Semantic Retention Scheduling (SRS) to align time allocation with the progression of identity decay, and demonstrate that existing token identity metrics are fundamentally statistical aggregations of these pairwise crossings. Building on these theoretical insights, we introduce LLaCO, a generative framework powered by competition-aware semantic scheduling. LLaCO adapts a pretrained backbone to continuous representations via an embedding directional adapter and timestep-conditioned modulation. To operate within the directional space, LLaCO employs a spherical noising process formulated as a geodesic interpolation toward a mask-biased endpoint, eliminating norm decay while preserving accurate token competition. Guided by SRS, LLaCO reallocates the denoising trajectory proportionally to the logarithmic rank decay, dedicating maximum optimization budget to critical identity transitions. Instantiated as an 8B model, LLaCO comprehensively outperforms previous continuous diffusion baselines across extensive benchmarks and rivals discrete diffusion models of comparable scale, laying a principled foundation for future exploration.

💡 News

  • 2026.10.28 LLaCO-8B checkpoint, inference code, and training code released.
  • 2026.10.27 Paper released on arXiv.
  • 2026.10.23 Project page and technical report released.

📑 Todo List

  • Release inference code
  • Release LLaCO-8B checkpoint
  • Release training code

📥 Download

Download LLaCO-8B from Hugging Face:

hf download escapist413/LLaCO-8B --local-dir checkpoints/LLaCO-8B

🛠️ Installation

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip

# PyTorch with CUDA 12.4
python -m pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 \
  --index-url https://download.pytorch.org/whl/cu124

bash scripts/setup_env.sh
source scripts/env.sh

🚀 Inference

source scripts/env.sh

CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.run \
  --standalone --nproc_per_node=1 \
  -m llaco.infer \
  --checkpoint checkpoints/LLaCO-8B \
  --tokenizer checkpoints/LLaCO-8B/tokenizer \
  --prompt 'A bookstore sells notebooks for $4 each. Emma buys 3 notebooks and pays with a $20 bill. How much change should she receive? Show your reasoning and put the final answer in \boxed{}.' \
  --output outputs/inference.json

🏋️ Training

First convert the JSONL conversations in examples/data/train.jsonl into the prepared dataset format used by training.

source scripts/env.sh
python scripts/prepare_spherical_data.py \
  --selection examples/data/selection.json \
  --output data/prepared/example \
  --workers 2 \
  --validation-fraction 0

This creates data/prepared/example/manifest.json and the token shards used by the loader. For your own data, replace examples/data/train.jsonl and update data_root and glob in selection.json.

Then train from the released LLaCO-8B checkpoint:

source scripts/env.sh
export SPHERICAL_TP_SIZE=4 SPHERICAL_DP_SIZE=2

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
python -m torch.distributed.run --standalone --nproc_per_node=8 \
  -m llaco.train \
  --checkpoint checkpoints/LLaCO-8B \
  --tokenizer checkpoints/LLaCO-8B/tokenizer \
  --prepared-manifest data/prepared/example/manifest.json \
  --output-dir outputs/train \
  --run-name llaco_train \
  --train-iters 10000 \
  --panel-interval 500 \
  --model-only-interval 2000 \
  checkpoint.save_interval=500

Acknowledgements

LLaCO is built on Megatron-Bridge, and LLaCO-8B is adapted from the pretrained Nemotron-Labs-Diffusion model. We thank the authors for open-sourcing their work.

Citation

@article{jia2026llaco,
  title   = {LLaCO: Continuous Diffusion for Large Language Models with Competition-Aware Semantic Scheduling},
  author  = {Jia, Zijian and Zhang, Peixuan and Li, Genying and Wu, Di and Fu, Yujie and Li, Si and Shi, Boxin and Weng, Shuchen},
  journal = {arXiv preprint arXiv:2610.32604},
  year    = {2026}
}

About

Code Implementation of "LLaCO: Continuous Diffusion for Large Language Models with Competition-Aware Semantic Scheduling"

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages