# Reversible networks trade compute for lower training memory

Markdown copy of https://realalpha.app/s/reversible-networks-trade-compute-for-lower-training-memory/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Reiner Pope](https://realalpha.app/builders/reiner-pope/) · Reiner Pope is CEO of MatX. · Co-founded MatX to design chips for LLMs, betting on HBM and SRAM; former Google TPU architect.
- Host: [Dwarkesh Patel](https://realalpha.app/people/dwarkesh-patel/) · Host, Dwarkesh Podcast · Co-wrote The Scaling Era, an oral history of AI; named to TIME100 AI.
- Show: Dwarkesh Podcast
- Episode: [How GPT, Claude, and Gemini are actually trained and served – Reiner Pope](https://realalpha.app/v/xmkSf5IS-zw/), Apr 29, 2026
- Moment: 2:08:08 to 2:13:28 of the episode (5 min), playing on https://realalpha.app/s/reversible-networks-trade-compute-for-lower-training-memory/; the episode from there: https://realalpha.app/v/xmkSf5IS-zw/?t=7688

## Quote

> “because it's invertible, **I don't need to store this at all**. I can completely rematerialize it when I'm running my backwards pass.”
> — [Reiner Pope](https://realalpha.app/builders/reiner-pope/) at [2:12:37](https://realalpha.app/v/xmkSf5IS-zw/?t=7957) · Dwarkesh Podcast

## Takeaways

1. An invertible update lets the backward pass reconstruct activations.
2. Reversible networks can avoid storing every layer's activations in HBM.
3. The memory savings come at the cost of recomputation.

## About this segment

A Feistel-style construction makes a network's forward pass invertible, so activations can be recomputed during backprop instead of stored. That trades extra compute for less HBM.

From “How GPT, Claude, and Gemini are actually trained and served – Reiner Pope”, Apr 29, 2026. [Watch the full episode](https://realalpha.app/v/xmkSf5IS-zw/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[2:08:21](https://realalpha.app/v/xmkSf5IS-zw/?t=7701) Yeah, so using neural nets for cryptography, well, in general, cryptography, like creating a new cipher is a very, very dangerous proposition. Like almost all of them are broken, like 99% of them are broken. So probably a bad place to start. But the other direction has been very, like in at least one very clear case, quite productive. So there's this construction in, so a construction that exists in ciphers and then was imported into neural nets called a Feistel cipher.

[2:08:52](https://realalpha.app/v/xmkSf5IS-zw/?t=7732) So the idea is that you may have some function f, which is not invertible, but you like the function because it does interesting things, like it does an MLP, for example, or it mixes it in an interesting way. You'd like to build something out of this that is invertible. So the construction we're going to make is going to actually be a two-input function rather than a one-input function. and we're going to apply f of x we need to actually remember what x was so we're going to stick x over here so that we can work backwards and then we also can't drop y so we're going to remember y and we're going to add them together and so we form this topple so um the the way to invert this like if you think i have this output and i want to recover x and y? Well, I can easily recover x. That's right there. I just read it off.

[2:09:50](https://realalpha.app/v/xmkSf5IS-zw/?t=7790) And then to recover y, if this thing was called z, I can recover y by z minus f of x because I've already recovered x. So that means that this construction is invertible. This was used in ciphers like a ton. Still is used. It's one of the main mechanisms of constructing ciphers. Often you want ciphers to be invertible, especially the layers of ciphers you want to be invertible because that has better cryptographic properties.

[2:10:20](https://realalpha.app/v/xmkSf5IS-zw/?t=7820) This has actually been ported over into neural nets. There's a 2017-18 paper called RevNets, Reversible Networks. And what it does is it actually makes the entire, like you can apply it to any network, like a transformer network. You can make, I do a forwards pass, but then I can actually run the entire pass backwards as well so the whole neural network is invertible with exactly this construction and so this paper reversible networks like applied to some layer like a transformer layer for example we've got this function f which is our transformer layer now normally we would have just an input and then a residual connection coming out and it gets added like this over here.

[2:11:09](https://realalpha.app/v/xmkSf5IS-zw/?t=7869) But now the variation of this is going to be we've got two inputs, x and y. So we've got x and y inputs. x goes through the function, gets added to y. And then this becomes the new x, the output x. and then this x becomes the output y. So really what this is doing, this is like, this is actually sort of doing, if you think of two layers back, this is actually the thing you mentioned before. It's actually doing the residual connection from two layers back.

[2:11:52](https://realalpha.app/v/xmkSf5IS-zw/?t=7912) Like, this Y came from the previous layer and was the residual connection there. But because of this construction, the whole thing is invertible. Why do I care? What does invertible matter for? The big thing that it can be interesting for is for training. If I think of a forward pass of training, so I will, let's say I have four layers, I run them in 0, 1, 2, 3 order. I have to write all of the activations to HBM.

[2:12:19](https://realalpha.app/v/xmkSf5IS-zw/?t=7939) um and so i get an hpm footprint um here that is kind of like linear linear in a number of layers yep um so this this actually can be uh the largest memory footprint during training um and so this is normal training and then and then i run the backwards pass and i read it kind of in reverse like i i run them sort of forward pass goes forward backward pass goes backwards and I have to read them back out.

[2:12:47](https://realalpha.app/v/xmkSf5IS-zw/?t=7967) The idea of this Revenet's paper is that because it's invertible, I don't need to store this at all. I can completely rematerialize it when I'm running my backwards pass. So I run my forwards pass and then when I'm running my backwards pass, I'm simultaneously in lockstep undoing all of the forwards pass steps that I did in order to have the activations that I need here. So this ends up being a memory saving, which is a nice idea.

[2:13:12](https://realalpha.app/v/xmkSf5IS-zw/?t=7992) Interesting. In some sense, you're spending more compute to save memory. That's right, yeah. Interesting.
