OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Rlt

Rlt is a Python implementation of a recurrent-looped transformer, with a PyTorch model for computing training loss and generating token sequences from prompts.

Independent OpenViST project profile, based on linked sources.

Rlt — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Rlt when you want to work directly with a recurrent-looped transformer implementation in Python, including its documented loss, generation, and recurrence controls.

Who it is for

  • Python and PyTorch developers exploring recurrent transformer models.
  • Researchers or practitioners experimenting with sequence modeling, token generation, or recurrent block configurations.

Documented uses

  • Calculate training loss for token sequences and run backpropagation.
  • Generate additional tokens from a prompt.
  • Vary recurrent block lengths across a sequence.
  • Compare a training setup with or without the optional next-latent prediction loss.
Before you choose

Requirements & limits

The repository is public and identifies the project as MIT-licensed. Its documented installation command is `pip install rlt-pytorch`.

  • The implementation exposes configurable encoder and decoder depth, decoder sliding-window size, and an optional truncated backpropagation-through-time step size.
  • Next-latent prediction loss is an optional model setting.
  • Variable recurrent lengths must sum to the input sequence length; during generation, recurrent state advances at block boundaries.
  • The README documents an enwik8 training command but does not provide a complete text-tokenization workflow.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Calculate training loss and generate a token sequence

Use the documented RLT methods to calculate model loss and extend a token prompt.

Before you start

  • Install the package with pip install rlt-pytorch.
  • Have PyTorch available and tokenized inputs whose IDs fit the configured num_tokens vocabulary.

Steps

  1. Import torch and RLT from RLT.

  2. Construct an RLT model with num_tokens, dim, enc_depth, dec_depth, and dec_sliding_window_size configured for the intended inputs.

  3. Pass a token tensor to model(tokens, return_loss=True) and call loss.backward() for the shown training-loss flow.

  4. Pass a token prompt to model.generate(prompt, max_len=128) to generate additional tokens.

Expected outcome

A computed training loss with a backward pass, and a generated token sequence extending the supplied prompt.

Guide limitations

  • The examples use randomly generated token IDs and do not document text tokenization or corpus preparation.
  • The README does not specify model checkpoints, evaluation, or production deployment.
Source-based practical guide

Train with variable recurrent block lengths

Pass explicit recurrent block lengths to the documented training-loss call.

Before you start

  • Install rlt-pytorch and use the PyTorch RLT implementation.
  • Prepare a token sequence whose length equals the sum of the recurrent block lengths.

Steps

  1. Define a sequence of block lengths, such as (1, 2, 5, 2, 1, 3).

  2. Create a token tensor with sequence length equal to the sum of those lengths.

  3. Call model(tokens, return_loss=True, recurrent_lengths=block_lengths) and use loss.backward() as shown.

Expected outcome

A training loss is calculated using the supplied recurrent block layout.

Guide limitations

  • The block lengths must sum to the sequence length.
  • The README notes that during generation the recurrent state advances only at block boundaries.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
lucidrains/RLT · Official homepage title · retained in its source language