Back to directory

Next-Latent Prediction Transformer

The official research codebase for a paper showing that predicting the next latent state, instead of the next token, trains transformers to learn more compact world models.

Next-Latent Prediction Transformer

This repository is the official implementation accompanying the paper 'Next-Latent Prediction Transformers Learn Compact World Models,' including the Next-Latent Prediction (NextLat) algorithm and baseline algorithms such as next-token prediction (GPT-style), multi-token prediction, joint multi-token prediction and the Belief State Transformer, each implemented in its own model file for direct comparison through their compute_loss functions.

Training scripts support single-GPU and distributed runs, with YAML configuration files reproducing the paper's experiments and a sweep parameter for grid search across seeds and hyperparameters. Evaluation covers Manhattan taxi rides, TinyStories and FineWeb-Edu pretraining benchmarks. Requires PyTorch 2.6 or later, and 2.9 or later for the Muon optimizer.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.