Skip to content
DAGroup-PKUPublic

About

G-STAR: Group-Scaled Token Capacity for Deeply Compressed AutoRegressive Generation

Resources

Stars

34 stars

Watchers

0 watching

Forks

Repository files navigation

G-STAR: Group-Scaled Token Capacity for Deeply Compressed Autoregressive Generation 🔥

Xu Huang1,2* · Ye Huang1* · Xiaotong Li2†‡ · Zhengrong Yue2,3 · Jialv Zou2,4 · Minhao Jing2
Haodong Li2,5 · Wenhao Yan2,6 · Yaxin Luo2,7 · Duomin Wang1 · Daquan Zhou1‡

1 Peking University   2 Meituan Longcat   3 Shanghai Jiao Tong University   4 Huazhong University of Science and Technology
5 The Chinese University of Hong Kong   6 Tsinghua University   7 MBZUAI

* Equal contribution   † Project lead   ‡ Corresponding author

arXiv Project Page Hugging Face Models GitHub Python PyTorch License: MIT

Installation & Usage · Results · Citation

G-STAR sample: magazine cover with a portrait and typography G-STAR sample: Chinese ink landscape with calligraphy G-STAR sample: illustrated egg tart recipe infographic G-STAR sample: Cinema by the Sea graphic poster G-STAR sample: red panda beside calligraphy G-STAR sample: ornate gold-and-black portrait

G-STAR is a spatial–group co-scaling framework for discrete autoregressive image generation. Under a fixed nominal information budget, the group size of a product-quantized tokenizer should scale quadratically with the per-axis spatial compression factor. Following this principle, G-STAR reaches 32× and effective 64× compression while preserving strong reconstruction, understanding and generation, and a semi-autoregressive head models the intra-group code dependencies cheaply. At 1024 × 1024, G-STAR-Flash-1.7B generates an image in 2.5 s on a single NVIDIA H200, and G-STAR-Pro-8B scores 0.84 on GenEval and 7.45 on GEdit-Bench.

G-STAR-Pro-8B = quality-oriented, 32× compression  |  G-STAR-Flash-1.7B = low-latency, effective 64× compression

🔥 News

  • [2026.11.24] ⚡ Faster inference, on by default, optimized with ResearchBoost-Agent (RBA). Per image on one H200 with the model loaded, against the previous code: 6.18× for G-STAR-Pro-8B with the one-step SR2x refiner, now the default (65.1 → 10.5 s); 2.73× with the 52-step refiner (138.6 → 50.8 s); 2.72× for G-STAR-Flash-1.7B (33.2 → 12.2 s). Image codes are bit-identical to the reference; refiner pixels differ only by rounding (PSNR ≈ 57–59 dB). GSTAR_FAST=0 turns it off. See Fast inference paths.
  • [2026.11.04] 🔥 We release the inference and training code of G-STAR: text-to-image generation, instruction-based image editing, pretraining and SFT!

📑 Todo List

  • Inference code for text-to-image generation and image editing
  • Training code (pretraining & SFT) with AR and DSpark image heads
  • Text-to-image checkpoint with its matching tokenizer and SR2x refiner on Hugging Face
  • Remaining checkpoints and their matching visual refiners on Hugging Face
  • arXiv paper
  • Project page
  • Demo video

🎥 Demo

demo.1.mp4

58 s, captions burned in · MP4 · Transcript (VTT)

💡 Overview

Long token sequences keep images faithful but make autoregressive decoding slow; aggressive spatial compression shortens the sequence but starves each token of capacity. G-STAR keeps the global sequence short and gives every position enough discrete codes to represent the image.

Component Role
Spatial–group co-scaling When per-axis compression grows by α, grow the group size by α². The sequence gets α² shorter while the nominal bit budget stays constant.
Lossless spatial packing Pack a 2 × 2 neighborhood of native 32× tokens into one global step. The effective 64× interface keeps every quantized code.
Semi-autoregressive head Compute features for all group slots in one parallel pass, then sample them with a single-layer causal Transformer (dspark in the configs).
Qwen3 backbone A Qwen3 LLM with an embedding bridge and the image head supports text-to-image generation, instruction-based editing and image understanding, trained with pretraining and SFT.

Grouped tokenizer, lossless 2x2 packing and spatial–group co-scaling

Grouped tokenization and spatial–group co-scaling. Effective 64× compression uses native 32× tokenization plus lossless spatial packing.

Causal autoregressive, parallel and semi-autoregressive prediction heads

A fully causal head repeats expensive computation for every code; a fully parallel head drops intra-group dependencies. The semi-AR head runs the heavy trunk once and keeps only a lightweight causal module sequential.

📈 Results

Text-to-image generation

Higher is better for all five scores. Bold = G-STAR.

Model Compression Params GenEval DPG PRISM LongText Qwen-Image
GPT Image 1 — — 0.84 85.15 8.07 0.956 54.07
Seedream 3.0 — — 0.84 88.27 7.62 0.896 —
HiDream-I1-Full 16× 17B 0.83 85.89 7.26 0.543 43.08
FLUX.1 [dev] 16× 12B 0.66 83.84 6.85 0.607 21.58
BAGEL 16× 14B 0.88 85.07 6.20 0.373 42.04
Z-Image 16× 6B 0.84 88.14 7.56 0.935 49.10
Qwen-Image 16× 20B 0.87 88.32 7.41 0.943 49.23
OmniGen2 16× 4B 0.86 83.57 6.48 0.561 40.70
SANA-1.5 32× 4.8B 0.81 84.70 6.51 0.050 35.14
Autoregressive
Janus-Pro-7B 16× 7B 0.80 84.19 6.21 0.019 23.53
GLM-Image 16× 16B 0.72 84.78 7.32 0.952 48.19
Emu3.5 16× 34.1B 0.86 88.26 7.52 0.976 49.89
BitDance 16× 14B 0.86 88.28 7.19 0.837 45.19
G-STAR-Pro-8B 32× 8B 0.84 83.38 6.98 0.935 50.07
G-STAR-Flash-1.7B 64×* 1.7B 0.76 80.18 6.81 0.853 46.88

Compression is the per-axis spatial factor; * Flash uses the packed effective 64× interface. PRISM: English combined score (0–10), Qwen2.5-VL-72B judge. LongText: English subset. Qwen-Image: Qwen-Image-Bench overall score (0–100). “—” means unreported.

Low-latency generation

G-STAR-Flash-1.7B, 1024 × 1024, batch size 1, BF16, single NVIDIA H200. Each row adds to the one above.

Pipeline Latency Speedup
Causal head baseline 22.23 s 1.0×
Semi-AR head 14.93 s 1.5×
+ CUDA Graph 5.85 s 3.8×
+ Kernel fusion 3.37 s 6.6×
+ SGLang serving 2.50 s 8.9×

Median of three timed trials after three warm-up iterations.

Prediction heads

Matched ablation: Qwen3-1.7B initialization, 32×, G = 16, 512².

Head GenEval DPG PRISM Head latency ↓
Causal AR 0.8386 82.48 5.46 6.44 s
Parallel 0.7800 79.98 4.72 1.77 s
Semi-AR 0.8253 82.60 5.46 3.41 s

The semi-AR head stays close to the causal head in quality at about half its head latency, while the fully parallel head loses quality.

Reconstruction, understanding and editing

  • Reconstruction. On ImageNet 512², the 32× tokenizer reaches 25.12 dB PSNR; the effective 64× variant reaches 23.90 dB, close to Open-MAGVIT2 at 16× (23.98 dB).
  • Understanding. The discrete f32g16 tokenizer averages 64.7 over eight understanding benchmarks, on par with continuous visual features (64.6).
  • Editing. G-STAR-Pro-8B scores 7.45 overall on GEdit-Bench (English, full set).
Original Edited Original Edited
Original photograph of a woman in a red dress Watercolor edit of the portrait Original blackboard Blackboard with the G-STAR title
Watercolor illustration Replace the blackboard heading

All numbers are reported in the paper, which includes the full per-benchmark tables and ablations.

⚙️ Installation & Usage

git clone -b main --single-branch https://github.com/DAGroup-PKU/G-STAR.git
cd G-STAR

See the Installation & Usage guide for dependencies, weights and complete commands. Run all commands from the repository root.

Get started Guide
Install dependencies Environment setup
Download a checkpoint and its matching visual refiner Weights
Generate images from text Text-to-image
Edit images with instructions Image editing
Choose an image head AR / DSpark heads
Faster inference (on by default) and its opt-outs Fast inference paths
Build training data Records, descriptors & manifests
Pretrain and fine-tune Pretraining & SFT
Run the checks Tests

💡 Tip: We recommend enhancing your prompt with Qwen-Image-2.1-PE first — just add --prompt-enhance to inference.py (see Prompt enhancement).

Inference runs on a single CUDA GPU (verified on an 80 GB H100). Model weights are distributed separately: always pair each checkpoint with the visual refiner released with it, since g8 and g16 exports are incompatible.

🗂️ Repository Structure

train.py               Pretraining and SFT (YAML config + command-line overrides)
validate.py            Validation loss of checkpoints on held-out data
inference.py           Text-to-image, editing, image-to-text; --prompt-file for many prompts
init_checkpoint.py     New checkpoint from a Qwen backbone, or a fresh image head
distributed_train.sh   torchrun launcher for single- and multi-node training
gstar/models/          Architecture registry, create_model, checkpoint loading (configs/: architectures)
gstar/data/            Weighted JSONL sources, multimodal processing, packing and collation
gstar/optim/           AdamW with the image-head learning rate; gstar/scheduler/: LR schedules
gstar/trainer/         Trainer subclass and periodic image sampling
gstar/generation/      Text-to-image, editing and prompt enhancement
gstar/vendor/          Backbone modeling, image heads, refiner, multimodal processor and KV-cache generation
configs/               Pretrain / SFT configs, DeepSpeed and role configs
tools/                 Data preparation and data-pipeline checks
tests/                 Unit tests and a two-GPU distributed smoke test
docs/                  Project page and the installation & usage guide

🙏 Acknowledgement

Our work builds on many excellent projects: Qwen3, Baichuan-Omni-1.5, CosyVoice, Matcha-TTS, Transformers, DeepSpeed, FlashAttention and SGLang.

✏️ Citation

If you find G-STAR useful, please consider giving a ⭐ and citing:

@misc{huang2026gstargroupscaledtokencapacity,
      title={G-STAR: Group-Scaled Token Capacity for Deeply Compressed Autoregressive Generation},
      author={Xu Huang and Ye Huang and Xiaotong Li and Zhengrong Yue and Jialv Zou and Minhao Jing and Haodong Li and Wenhao Yan and Yaxin Luo and Duomin Wang and Daquan Zhou},
      year={2026},
      eprint={2611.13004},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2611.13004},
}

License

Original G-STAR code is released under the MIT License. Third-party components retain their respective licenses and copyright notices. Model weights and datasets are subject to their own terms.

About

G-STAR: Group-Scaled Token Capacity for Deeply Compressed AutoRegressive Generation

Resources

Stars

34 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages