Views
No views yet
NRGPT: An Energy-Based Alternative for GPT Nima Dehmamy*, Benjamin Hoover*, Bishwajit Saha*, Leo Kozachkov, Jean-Jacques Slotine, Dmitry Krotov* ICLR 2025
torch.func.grad. This yields the conventional FF of transformers plus a second gradient term.n_layer times (6 iterations), each application being one step of energy descent on the token landscape| Property | Value |
|---|---|
| Parameters | 128M (non-embedding) |
| Embedding dim | 1536 |
| Layers (iterations) | 6 |
| Attention heads | 12 |
| Context length | 1024 |
| Vocab size | 50,304 (GPT-2 BPE) |
| Training data | OpenWebText |
| Training iterations | 500,000 |
| Train loss | 3.29 |
| Validation loss | 3.30 |
| Metric | NRGPT_H_FF2W | GPT | GPT_Rec_Parallel |
|---|---|---|---|
| Perplexity (GPT-2) | 105 | 78 | 74 |
| GQS | 0.946 | 0.947 | 0.950 |
| APCS | 0.306 | 0.274 | 0.275 |
| Distinct-1 | 0.650 | 0.638 | 0.613 |
| Distinct-2 | 0.960 | 0.963 | 0.962 |
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4# Load model (requires trust_remote_code for custom architecture)
5model = AutoModelForCausalLM.from_pretrained("bsaha205/NRGPT-H-FF2W-128M-OWT", trust_remote_code=True)
6tokenizer = AutoTokenizer.from_pretrained("bsaha205/NRGPT-H-FF2W-128M-OWT")
7
8# Generate text
9model.eval()
10input_ids = tokenizer.encode("In recent years, researchers have discovered that ", return_tensors="pt")
11with torch.no_grad():
12 output = model.generate(input_ids, max_new_tokens=200)
13print(tokenizer.decode(output[0]))1@inproceedings{dehmamy2025nrgpt,
2 title={NRGPT: An Energy-Based Alternative for GPT},
3 author={Dehmamy, Nima and Hoover, Benjamin and Saha, Bishwajit and Kozachkov, Leo and Slotine, Jean-Jacques and Krotov, Dmitry},
4 booktitle={International Conference on Learning Representations (ICLR)},
5 year={2025},
6 url={https://arxiv.org/abs/2512.16762}
7}