dobejamin← Neural memory with two loops

DEEP EQUILIBRIUM MODEL

A neural net
that settles.

Reuse the same neurons until their state stops changing: a deep equilibrium model. Train one here.

input→state→answer

01 Train the loop

12 neurons. 193 learned numbers. Browser only.

UNTRAINED
Inner ringOuter ringDots = training examples
UNSEEN ACCURACY—320 fresh points
TRAINING LOSS—lower is better
UPDATES0weights change here

Start training to watch a nonlinear boundary form.

Inside one answer

SETTLED

Pick a map point.

−1 +1Lines = strongest feedback links
tick 0
ANSWER AT THIS TICK—
STATE STILL CHANGING BY—

Weights stay fixed while settling; training changes them between answers.

Different start, same equilibrium.
The actual computation

z ← tanh(Wz + Ux + b)
answer = sigmoid(v·z + c)

Input x enters every tick, or a unique final state would forget it.

Training solves (I − J)ᵀλ = ∂L/∂z at equilibrium, updating weights with λ without saving a stack of ticks. W's row absolute sums stay below 0.88; tanh's slope is at most 1. This contraction guarantees one equilibrium from any starting state.

Run the numerical checks ↗
THE CATCH

A settled state isn’t
automatically a memory.

One equilibrium makes answers reliable but erases history. Memory needs a separate carried state, or several stable states chosen by history. Try the second option below.

02 Give the loop a memory

A hand-set one-neuron latch; no training.

Two histories. Same silence.

Two copies receive opposite pulses, then identical zero input.

z ← tanh(feedback × z + input)

ONE STABLE STATEAFTER 50 TICKS OF SILENCE
Positive history 0.000Negative history 0.000

Weak feedback erases the pulse. Both copies return to the same zero state.

WHAT THIS MEANS FOR YOUR IDEA

Combine deep equilibrium computation with recurrent / state-space memory: choose what settles and what survives. An FPGA could reuse one block across ticks; speed or efficiency gains need a hardware implementation and benchmark.