LWM (Large World Model) is a general-purpose large-context multimodal autoregressive model designed to improve AI's understanding of world knowledge by jointly modeling text and video. The model is trained on diverse long-video and book datasets, uses RingAttention technology to achieve million-token context processing, and progressively extends context length from 4K to 1M tokens.
Main capabilities include:
- High-accuracy fact retrieval at a 1M context length;
- Question answering over YouTube videos longer than 1 hour;
- Conversation with images;
- Generating video and images from text.
The model offers both pure language and video-language versions, with context lengths covering 32K, 128K, 256K, and 1M tokens. The vision-language models are available only in the Jax version, while the pure language models are available in both PyTorch and Jax versions. All models have 7 billion parameters.
Usage: The codebase supports the Ubuntu system and recommends TPUs for training and inference; GPUs can also be used (but are less optimized). Users can run training, evaluation, and sampling tasks through the provided scripts, for example:
- Language model training: bash scripts/run_train_text.sh
- Vision-language model training: bash scripts/run_train_vision_text.sh
- Single-needle evaluation: bash scripts/run_eval_needle.sh
- Multi-needle evaluation: bash scripts/run_eval_needle_multi.sh
- Image sampling: bash scripts/run_sample_image.sh
- Video sampling: bash scripts/run_sample_video.sh
- Image/video understanding: bash scripts/run_vision_chat.sh
For PyTorch models, currently only inference for text and text chat models is supported; they can be loaded as Hugging Face's LlamaForCausalLM model, and sampling is run with python scripts/sample_pyt.py.
Applicable scenarios: LWM is suitable for research and application scenarios that require processing long text and long-video understanding and generation, such as long-document question answering, video content analysis, and multimodal dialogue.
Limitations:
- The codebase has only been tested on Ubuntu, not on Windows or macOS;
- Vision-language models are available only in the Jax version;
- The PyTorch version supports only text inference;
- Training and inference require substantial computational resources (TPU recommended).
License: The code uses the Apache 2.0 license, and the models use the Llama-2 license.