openwebtext-128 / README.md
nielsr's picture
nielsr HF Staff
Enhance dataset card: Add paper link, code link, task categories, abstract, and sample usage
44b2d84 verified
|
raw
history blame
4.45 kB
metadata
dataset_info:
  features:
    - name: text_trg
      dtype: string
  splits:
    - name: train
      num_bytes: 16486231249
      num_examples: 36074196
    - name: test
      num_bytes: 22761845
      num_examples: 50000
  download_size: 11310715074
  dataset_size: 16508993094
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: test
        path: data/test-*
task_categories:
  - text-generation
language:
  - en

This dataset is associated with the paper Compressed and Smooth Latent Space for Text Diffusion Modeling, which introduces COSMOS, a novel approach to text generation that operates entirely in a compressed, smooth latent space tailored specifically for diffusion models. This space is learned using an autoencoder trained simultaneously for token-level reconstruction and alignment with frozen activations from a pretrained language encoder, providing robust semantic grounding.

The dataset, featuring text_trg (target text), is used to train and evaluate models within the COSMOS framework across diverse generative tasks, including story generation, question generation, summarization, and detoxification. The paper demonstrates that text representations can be compressed by $8\times$ while maintaining generation quality comparable to token-level diffusion models, and can surpass both diffusion-based and autoregressive baselines.

Paper Abstract

Autoregressive language models dominate modern text generation, yet their sequential nature introduces fundamental limitations: decoding is slow, and maintaining global coherence remains challenging. Diffusion models offer a promising alternative by enabling parallel generation and flexible control; however, their application to text generation is hindered by the high dimensionality of token-level representations. We introduce Cosmos, a novel approach to text generation that operates entirely in a compressed, smooth latent space tailored specifically for diffusion. This space is learned using an autoencoder trained simultaneously for token-level reconstruction and alignment with frozen activations from a pretrained language encoder, providing robust semantic grounding and enabling effective perturbation-based augmentations. Empirically, we demonstrate that text representations can be compressed by $8\times$ while maintaining generation quality comparable to token-level diffusion models. Furthermore, increasing the latent sequence length allows Cosmos to surpass both diffusion-based and autoregressive baselines. We evaluate Cosmos on four diverse generative tasks including story generation, question generation, summarization, and detoxification and compare it with various generative paradigms. Cosmos achieves comparable or superior generation quality while offering more than $2\times$ faster inference. Code is released at \href{ this https URL }{GitHub}

Sample Usage

After training the diffusion model, you can generate new text samples using the following command, as described in the project's GitHub repository:

CUDA_LAUNCH_BLOCKING=1 \
HYDRA_FULL_ERROR=1 \
uv run \
torchrun --nproc_per_node=4 --master_port=12345 \
generate.py \
dataset=rocstories \
diffusion.dynamic.N=200 \
diffusion.dynamic.d=5 \
diffusion.training.batch_size=512 \
encoder.latent.num_latents=16 \
encoder.embedding.max_position_embeddings=128 \
decoder.latent.num_latents=16 \
decoder.embedding.max_position_embeddings=128 \
autoencoder.model.load_checkpoint='"autoencoder-num_latents=16-wikipedia-final-128/100000.pth"' \
diffusion.model.load_checkpoint='"diffusion-rocstories-16-d=5-final/180000.pth"' \
diffusion.generation.num_gen_texts=2000 \
training=""

Citation

If you use this work or the associated dataset, please cite the paper:

@misc{meshchaninov2025compressed,
      title={Compressed and Smooth Latent Space for Text Diffusion Modeling},
      author={Viacheslav Meshchaninov and Egor Chimbulatov and Alexander Shabalin and Aleksandr Abramov and Dmitry Vetrov},
      year={2025},
          eprint={2506.21170},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2506.21170},
}