rlt-core 0.1.1

Recurrent Looped Transformer (RLT): causal encoder with global KV memory plus a recurrent decoder with sliding-window attention. Full-BPTT training and RL replay. Pure Rust (candle).
Documentation
//! Recurrent Looped Transformer (RLT).
//!
//! A causal encoder builds global key–value memory; a recurrent decoder merges each
//! token's encoder representation with the previous decoder output and maintains the
//! complete state `H_t = (s_t, C_t^D)` (recurrent output + per-layer SWA caches)
//! across every prompt and response token. See `Recurrent_Looped_Transformer.pdf`
//! (Zhang, 2026) for the reference semantics.
//!
//! ```
//! use rlt_core::{Rlt, RltConfig, ByteTokenizer, Device};
//! # fn main() -> rlt_core::Result<()> {
//! let model = Rlt::new(RltConfig::default(), Device::Cpu)?;
//! let tok = ByteTokenizer::new(258)?;
//! let (logits, state) = model.prefill(&tok.encode("Hi", true, false))?;
//! assert_eq!(logits.len(), 3);
//! # Ok(()) }
//! ```

pub mod checkpoint;
pub mod config;
pub mod error;
pub mod execution;
pub mod model;
pub mod nn;
pub mod replay;
pub mod sampling;
pub mod state;
pub mod tokenizer;

pub use candle_core::{Device, Tensor};
pub use checkpoint::{load_checkpoint, save_checkpoint};
pub use config::RltConfig;
pub use error::{Result, RltError};
pub use model::Rlt;
pub use replay::{replay, ReplayResult, Rollout, SamplingMetadata};
pub use sampling::{sample_from_logits, SampledToken, Sampler};
pub use state::{GroupKv, LayerKv, RltState};
pub use tokenizer::{ByteTokenizer, BOS_ID, EOS_ID, MIN_VOCAB};