A switch that can run backward #
Imagine a switch with three input bits. One bit controls whether the switch exchanges the other two. With the control off, the pair goes through unchanged. With it on, the pair changes places. Given the three outputs, one can recover the three inputs by operating the same switch again. Fredkin and Toffoli studied circuits built from such controlled exchanges. Their gate has a second property called conservation. The output contains exactly as many ones as the input.
The switch can compute an ordinary AND. Put the two operands on the control and first data wire and supply zero on the second data wire. The second data output is one only when both operands were one. The other outputs retain enough information to recover the original bits. Throwing those wires away would change the physical accounting. Landauer’s principle applies when a device discards information, so the fate of the unused outputs matters just as much as the output a program reads.
How to clean up a calculation #
In 1973 Charles Bennett gave a reversible simulation of an ordinary computation. The simulator records information that each forward step would otherwise destroy. At the end it has an answer, the input, and a history occupying working storage. It copies the classical answer into a fresh output register and runs its own steps in reverse. The history disappears in reverse order as each piece of information is used to undo the operation that produced it.
Copying itself can be reversible. An instruction can toggle a destination bit when the source bit is one. Starting with a zero destination leaves a copy in it. Applying the same instruction again recovers the original zero. The requirement for an initially blank register is significant. A device that produces a stream of answers must supply output storage or arrange for a recipient to take the results.
Spending time to recover space #
Keeping every intermediate state until the end can make a long calculation impractical. Bennett later analyzed a simulation that divides a calculation into intervals and retains selected checkpoints. Once a checkpoint is available, the program can reverse the short computation that made it and release the temporary history while retaining a copy of the checkpoint. A later stage can reconstruct intermediate states when they are needed again.
Bennett formalized the problem as a pebble game. A pebble marks a stored state. The rule for clearing a checkpoint requires access to a predecessor from which the checkpoint could be recreated. A schedule can use fewer pebbles by returning to earlier positions more often. The analysis shows how to trade additional execution time for less memory, two costs that matter even in a machine with very inexpensive individual switches.
A gate on a chip #
Takeuchi and colleagues fabricated a superconducting circuit and tested its logic in 2014. They connected gates in different orientations to check that a signal could pass through in both directions and recover the original bits. A later paper calculated the energy dissipated as the circuits switched. In their simulation, slowing the drive reduced dissipation in the reversible gate below the reference energy for erasing one unbiased bit at the circuit temperature.
Testing the input and output bits establishes the circuit’s logic. Calculating heat for a modeled gate addresses a different part of the argument. A useful comparison for an AI workload would measure energy at the wall, including refrigeration, control electronics and memory, at a specified rate of correct answers. Slower switching can improve one gate’s energy figure while increasing the number of gates required to sustain that rate.
An application in neural networks #
Gomez and colleagues used reversibility at the level of a network layer. Their residual blocks allow backpropagation to recover earlier activations from later ones, saving memory during training. Reconstruction costs extra arithmetic, and rounding limits its accuracy on real hardware. Their experiments compared classification results and memory requirements on conventional computers. A software designer can exploit the ability to undo a calculation even when the processor executing its instructions dissipates ordinary amounts of heat.
Sources
- Edward Fredkin and Tommaso Toffoli · Conservative Logic (1981 technical report) hdl.handle.netCited in
- Rolf Landauer · Irreversibility and Heat Generation in the Computing Process (1961) dna.caltech.eduCited in
- Charles H. Bennett · Logical Reversibility of Computation (1973) doi.org
- Charles H. Bennett · Time/Space Trade-Offs for Reversible Computation (1989) math.ucsd.eduCited in
- Naoki Takeuchi and colleagues · Reversible logic gate using adiabatic superconducting devices (2014) nature.comCited in
- Naoki Takeuchi, Yuki Yamanashi and Nobuyuki Yoshikawa · Reversibility and energy dissipation in adiabatic superconductor logic (2017) doi.orgCited in
- Aidan N. Gomez and colleagues · The Reversible Residual Network: Backpropagation Without Storing Activations (2017) papers.neurips.cc