Views
No views yet
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3model = AutoModelForCausalLM.from_pretrained("smcleish/Recurrent-TinyLlama-3T-train-recurrence-4", torch_dtype=torch.float32, trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("smcleish/Recurrent-TinyLlama-3T-train-recurrence-4")num_steps, the model will execute a forward pass with that amount of compute:1input_ids = tokenizer.encode("The capital of Westphalia is", return_tensors="pt", add_special_tokens=True).to(device)
2model.eval()
3model.to(device)
4model(input_ids, num_steps=32)@article{mcleish2025teaching,
title={Teaching Pretrained Language Models to Think Deeper with Retrofitted Recurrence},
author={Sean McLeish and Ang Li and John Kirchenbauer and Dayal Singh Kalra and Brian R. Bartoldson and Bhavya Kailkhura and Avi Schwarzschild and Jonas Geiping and Tom Goldstein and Micah Goldblum},
journal={arXiv preprint arXiv:2511.07384},
year={2025}
}