In Situ Backpropagation Explained
- In situ backpropagation involves computing neural network gradients within the physical or dynamical substrate that performs forward computation, rather than using an external digital processor.
- It aims to reduce computational cost and latency by relocating operations directly to neural architecture or hardware, making it highly relevant for large-scale, real-time applications.
- It diverges into locally constrained backpropagated credit signals, exact physical adjoint methods, and feedforward optimization techniques, offering various implementations depending on exactness, locality, and biological plausibility.
In situ backpropagation denotes the computation of neural-network gradients within, or directly through, the physical or dynamical substrate that performs the forward computation, rather than exclusively in an external digital processor. The term encompasses several distinct mechanisms: local dynamical state updates that embed backward sensitivities in neurons, adjoint experiments in optical or mechanical systems, spike-based propagation of signed error signals, and hardware-in-the-loop gradient estimation. These mechanisms share the objective of reducing the model–reality gap and the data movement associated with conventional reverse-mode automatic differentiation, but they differ substantially in exactness, locality, biological plausibility, and the amount of digital control retained.
1. Conceptual foundations and terminology
Conventional backpropagation computes a global loss, propagates error signals through transposed downstream operators, and updates parameters using products of presynaptic activity and postsynaptic sensitivity. For a typical weighted-sum neuron, the local update has the form
where is the input, is a downstream correction, is the activation derivative, and is the learning rate. In a multilayer network, the corresponding error recursion is
In situ backpropagation relocates some or all of these operations into the computational substrate. The forward system may itself generate the adjoint or error field, local parameters may be updated from measured forward–backward overlaps, and intermediate states need not be transferred to a separate differentiable simulator.
The expression is not used uniformly. “In situ” may refer to exact physical adjoint differentiation, as in reciprocal photonic, mechanical, or wave systems; to local approximations of backpropagated credit signals; to recursive backpropagation over a computational data structure; or to forward-only zeroth-order optimization. These cases should not be conflated:
- Exact physical adjoint methods derive the gradient of the realized device and obtain it from a forward experiment plus an adjoint experiment.
- Integrated neuronal formalisms incorporate error entities and training control into each neuron’s dynamical state.
- Biologically plausible local-learning methods avoid explicit error backpropagation, often using dendritic, interneuron, heterosynaptic, or learned-feedback mechanisms.
- Spike-based methods represent activations, signed errors, and updates as spike trains.
- Forward-only methods avoid reverse-mode differentiation but generally optimize a surrogate objective or use an unbiased estimator rather than the exact global gradient.
- Hardware-in-the-loop methods measure physical outputs while retaining digital optimization and control.
The central distinction is between local parameter updating and local credit assignment. A rule can compute a parameter-dependent learning-rate factor locally while still relying on externally computed backpropagated gradients. Conversely, a physical adjoint method can calculate exact global sensitivities through a second physical propagation, although the final parameter update may remain digital.
2. Neuronal and dynamical formulations
“Neural networks with dynamical coefficients and adjustable connections on the basis of integrated backpropagation” embeds backpropagation into the state and local update rule of each neuron (Nazarov, 2018). A neuron carries ordinary forward variables—connections, inputs, weights, bias, aggregation and activation functions, and output—together with a local backpropagation-error entity , a training-control signal , reference inputs, and structural indicators.
A reference-input neuron receives a desired value and forms a local correction
For an ordinary neuron, the correction is assembled from downstream backpropagation coefficients:
0
The backward coefficient transmitted through an input connection is
1
while the synaptic update is
2
When the reference error, downstream aggregation, activation derivative, and current weights satisfy the ordinary chain rule, 3 equals the standard sensitivity with respect to the corresponding input. When the training gate 4 is zero, forward operation can proceed without updating weights or exchanging backward signals; when it is positive, training is enabled.
The formalism represents feedforward and recurrent connections explicitly. A feedforward input uses a current output, whereas a recurrent connection supplies a delayed value:
5
For recurrent networks, integrated backpropagation through time uses stack memories for external inputs and reference inputs. A sequence is first presented and stored with 6, then replayed in reverse with 7. The stack depth is the maximum unrolled sequence length. This realizes a temporally staged version of BPTT, although it introduces explicit memory and synchronization requirements.
The same local structure is extended to convolutional units, pooling, multiplication and summation blocks, Gaussian units, Euclidean-distance neurons, LSTM components, radial-basis-function networks, multilayer perceptrons, and convolutional architectures. In convolutional units, the shared kernel gradient accumulates local products over spatial positions. In max pooling, the backward signal is routed to the winning input. Multiplication blocks propagate each input’s sensitivity according to the value of the other input, allowing composite systems such as LSTM to be decomposed into elementary local operations.
The proposal also includes dynamic topology. A connection may be deleted when its weight remains below 8 for a specified number of iterations. New connections may be introduced when existing weights cannot correct the local error or when the correction oscillates while the input remains nearly unchanged. Weight-paralysis and local-minimum indicators guide these changes. The suggested benefits for sparsity and overfitting avoidance remain heuristic rather than theoretically guaranteed.
A related dynamical interpretation treats backpropagation as the interaction of forward and backward waves. In “Backprop Diffusion is Biologically Plausible,” a delayed network evolves according to
9
so forward activity propagates through the layers with finite delay. Output supervision generates a backward wave,
0
At a synapse, the local update is the product of a forward-propagated input and a backward-propagated error. The update is exact at the synchronization layer for odd-depth feedforward networks and approximately correct elsewhere when the input varies slowly relative to the network’s propagation delay (Betti et al., 2019). Rapidly changing inputs and increasing depth produce temporal mismatches between the two factors. The framework therefore provides a spatiotemporal interpretation of gradient computation, but does not eliminate transpose-weight requirements or establish exact biological backpropagation for arbitrary recurrent systems.
3. Local learning, biological plausibility, and surrogate credit assignment
Several approaches seek to make credit assignment more biologically or physically local without directly implementing the exact reverse-mode chain rule.
A Lagrangian formulation of supervised learning introduces weights, neural outputs, and Lagrange multipliers into a joint “learning adjoint space.” Standard backpropagation emerges as one consequence of the constrained optimization, while alternative local algorithms search for saddle points involving these variables. The abstract also introduces support neurons, whose optimization-related activity may participate in constructing the network architecture (Betti et al., 2018). The available formulation does not establish whether the resulting algorithms reproduce exact gradients, eliminate weight transport, or operate without globally coordinated teaching signals.
“Learning to solve the credit assignment problem” uses random perturbations of neural activity and changes in a global loss to learn feedback weights. A perturbation estimator has the form
1
The perturbation-derived estimate trains feedback matrices 2, which subsequently generate synthetic errors for the feedforward network. For feedback-alignment-style feedback,
3
The feedback weights are not required to equal the forward weights during practical learning. Under assumptions including subgaussian perturbations, analytic losses, full-rank error covariance, and suitable remainder bounds, the paper proves convergence to true forward matrices in shallow analytic and deep linear cases. General convergence for deep nonlinear networks is not established. The method is therefore learned feedback alignment with perturbation-trained synthetic gradients rather than exact in situ backpropagation (Lansdell et al., 2019).
Biological multi-variate regression (BMVR) avoids explicitly forming the output error in a two-layer network by imposing a gain-control constraint on hidden activity. Its local updates are
4
5
6
where 7 is a target-driven distal signal and 8 is an inhibitory covariance signal. The difference 9 is interpreted as an apical or calcium-plateau-like teaching signal. In the linear case, the constrained formulation reaches the same optimum as ordinary regression under rank and covariance assumptions, while the nonlinear MNIST extension is empirical rather than theoretically equivalent (Golkar et al., 2020).
The proposed cortical circuit in “Self-Assembly of a Biologically Plausible Learning Circuit” uses four plastic synapses connecting ascending and descending cortical streams and heterosynaptic plasticity. Its central claim is that the circuit can self-assemble from initially random connectivity and yield anatomical and physiological predictions (Liao et al., 2024). The available abstract does not specify the four synapses, the exact plasticity rules, or whether the resulting update is an exact gradient, an unbiased estimator, or merely descent-correlated.
Dynamic learning rate (DLR) modifies optimization rather than credit assignment. Its effective synapse-specific learning rate depends on current weight magnitude and a local vector norm:
0
DLR avoids stored histories of gradients used by Adam, RMSprop, and related optimizers. Its reported advantage is conditional: it was fastest for small MNIST networks, while Adam performed better as networks became larger. Because DLR still requires backpropagated gradients, it is a locally implementable optimizer for backpropagated signals, not a fully local replacement for credit assignment (Li, 2020).
BNeuralT applies ordinary recursive reverse-mode differentiation to a stochastic neural tree. The forward pass uses post-order depth-first traversal, and the backward pass uses pre-order traversal. For an edge from child 1 to parent 2,
3
and for a node bias,
4
The tree is sparse and dendritic in its computational organization, but the error signal still derives from the global loss and is recursively propagated from the root. It is therefore a sparse computational graph trained by ordinary backpropagation, not a demonstrated biologically local learning mechanism (Ojha et al., 2022).
4. Optical and electromagnetic physical adjoints
Integrated photonic systems provide a prominent setting for exact in situ gradient computation. In “Training of photonic neural networks through in situ backpropagation,” a photonic layer is represented as
5
where 6 is implemented by a mesh of Mach–Zehnder interferometers. Reciprocity allows an error vector to be injected from the output side so that the optical field propagates through 7, realizing the backward linear operation (Hughes et al., 2018).
The electromagnetic adjoint method derives the gradient with respect to local permittivity from a forward field 8 and an adjoint field 9. If 0 is the Maxwell operator, the fields satisfy
1
2
The resulting gradient is
3
For a phase-shifter region, this becomes a local overlap of forward and adjoint fields. Since the overlap can be evaluated at all tunable locations simultaneously, the number of optical propagations is ideally independent of the number of parameters.
The time-reversal interference method (TRIM) converts this overlap into an intensity measurement. Interfering the forward field with the conjugated adjoint field yields
4
Subtracting the individual intensities isolates the gradient-bearing cross term. The method requires coherent complex-field generation, bidirectional propagation, local intensity detection, phase stability, and reciprocity. It does not require direct phase measurement at every phase shifter if interference is used.
The first experimental realization of this principle in a nanophotonic neural network used a packaged silicon photonic chip with a 5 triangular mesh containing 15 MZIs and an embedded 6 unitary transformation. Bidirectional propagation, grating-tap monitors, and universal complex-field generation and readout enabled physical forward computation, backward error propagation, and local gradient measurement (Pai et al., 2022). The nonlinearities and some control functions remained digital. The chip achieved approximately 7 model training and 8 model test accuracy on a circle task, and approximately 9 training and 0 test accuracy on a two-moons task using measured phases. Ground-truth phase values improved the latter to approximately 1 training and 2 test accuracy. Camera-based monitoring was a major bottleneck, motivating integrated detectors and analog update circuits.
A later signed incoherent photonic matrix core on thin-film lithium niobate implements native signed inputs and weights using dual wavelengths and differential detection. Signed quantities are represented by differences of nonnegative optical channels,
3
while signed weights are represented by wavelength-dependent transmission differences. Differential detection produces a signed product proportional to 4. The same 5 core performs forward multiplication, transpose multiplication for error propagation, and signed products for gradient formation (Ren et al., 23 Sep 2026).
The demonstration used a 6 PReLU network on 200 noisy XOR samples. Measured outputs formed the terminal error, the same physical weight array was addressed transposed for backward propagation, and gradient products were measured optically. Parameter accumulation, batch processing, calibration, clipping, and updates remained electronic. The processor achieved approximately 8-bit multiplication and 10-bit accumulation precision across 256 channels, approximately 9.87-bit precision in tiled 7 matrix computation, and a reported peak physical processing rate of 51.2 TOPS. A BERT-mini inference demonstration used the core for tiled linear operations but did not demonstrate Transformer training.
The broader theory of physical backpropagation identifies the conditions under which a physical system can generate its own adjoint (Bösch et al., 12 Aug 2026). For linear systems, reciprocity or a more general intertwining relation is sufficient; damping, loss, and gain are admissible if the relevant transpose symmetry is preserved. For nonlinear trajectories, a time-reversal mirror and reciprocity of the linearized dynamics are additionally required. Nonlinear systems generally require infinitesimal nudging, whereas linear systems permit finite-amplitude adjoint experiments. The framework recovers Equilibrium Propagation, Hamiltonian echo backpropagation, fully forward-mode training, and integrated photonic adjoint methods as special cases.
An experimentally realized nonlinear microwave system extends physical adjoints to a lossy, multipath, non-Hermitian environment. In-situ Nonlinear Adjoint Propagation (iNAP) uses a pump–probe experiment around a driven nonlinear diode-loaded cavity. A phase-engineered pump establishes the nonlinear operating point, while a weak probe generates the physical linearized adjoint response. The adjoint field is inferred from
8
where 9 is the forward field and 0 is the pumped-and-probed response (Guillamon et al., 13 Aug 2026). The method was validated on arbitrary power splitting, nonlinear coherent perfect absorption with 1, and asymmetric transport with approximately a 60% directional transmission advantage.
5. Mechanical, topological, and wave-based implementations
For a linear elastic mechanical neural network, static equilibrium is
2
with stiffness matrix
3
where 4 maps nodal displacements to bond elongations and 5 contains bond stiffnesses. The adjoint displacement solves
6
The gradient with respect to bond stiffness 7 is
8
where 9 and 0 are the forward and adjoint elongations of the same bond. Thus, two equilibrium experiments yield the gradient for every bond, independent of the number of trainable stiffnesses (Li et al., 2024).
The first experiment used a printed Agilus30 network. A forward force was applied, an output-derived adjoint force was applied in a second experiment, and bond elongations were multiplied bond by bond. Measured gradients achieved more than 90% accuracy relative to the simulated exact gradient. Subsequent demonstrations addressed behavior learning, linear regression, and Iris classification. The current system still updated bond widths numerically; fully physical updates would require tunable bars, magnetoactive materials, phase-changing materials, or phototunable materials. The work therefore demonstrates physical gradient measurement and hybrid optimization rather than a completely autonomous self-learning material.
Topological mechanical neural networks use elastic waves and pseudospin-protected interface modes. A honeycomb metamaterial with domains of opposite topology supports counterpropagating modes, 1 and 2. The directional output ratio is
3
For harmonic dynamics,
4
and the adjoint field satisfies the same type of physical equation with an adjoint force. If 5 and 6, the local stiffness gradient is
7
The forward and adjoint waves are measured, local products are formed, and stiffnesses are updated. Classification was demonstrated on Iris, Penguins, and Seeds datasets, with reported test accuracies of approximately 86%, 92%, and 94%, respectively (Li et al., 10 Mar 2025). Frequency-division multiplexing assigned the tasks to normalized frequencies 1.154, 1.186, and 1.217. Dynamic mode decomposition separated the simultaneous responses. Bond pruning showed that interface bonds were more critical than bulk bonds, although the networks retained substantial damage tolerance.
These mechanical systems differ from optical adjoints in their physical state variables and readout, but the mathematical mechanism is the same: the derivative of a global output with respect to a local parameter is expressed as an overlap between a forward state and an adjoint state. The physical network solves the globally coupled equilibrium or wave-propagation problem, while the local parameter update uses only nearby forward and adjoint quantities.
6. Spike-based, forward-only, and hardware-in-the-loop alternatives
Stochastic SNN backpropagation (SSNN-BP) represents forward activity and signed errors entirely with spikes. A composite neuron contains a feedforward compartment and positive and negative gradient compartments:
8
The output error is represented by separate positive and negative spike streams. Hidden-layer errors propagate through transposed weights, and the weight update is generated by spike coincidence:
9
The coincidence operation implements a stochastic approximation to the outer product between a backward gradient and a forward activation. The algorithm operates concurrently rather than requiring a stored forward phase followed by an externally computed backward phase. Positive and negative streams, transpose pathways, stochastic spike generation, and analog accumulative synaptic memory remain necessary (Biswas et al., 2022).
On MNIST, the rate-based SSNN-BP baseline reached approximately 0 test accuracy, close to the equivalent ANN baseline of approximately 98.67%. Reported results included approximately 90.5% on Fashion-MNIST, 85.76% on balanced EMNIST with dropout and WTA, and 98.26% on N-MNIST. The method remains limited by finite spike-train duration, update quantization, signed-gradient routing, transpose-weight requirements, and the need for stochastic independence assumptions.
Forward gradient descent eliminates the conventional reverse-mode pass by using a directional derivative computed with forward-mode automatic differentiation. For a random direction 1,
2
and, when the direction has identity covariance,
3
The method is therefore unbiased in expectation but not exact for an individual direction. It avoids reverse tapes and backward propagation, but optimizes using a noisy estimator. Reported experiments showed favorable runtime ratios on logistic regression, multilayer perceptrons, and convolutional networks, including approximately twofold speed advantages in selected configurations (Baydin et al., 2022). It is related to in situ learning because all sensitivities move forward, but it is not exact physical backpropagation.
FFzero combines layer-wise forward-forward objectives, fixed prototype representations, and directional-derivative optimization. Each layer maps samples toward a class prototype on a hypersphere or toward one of two antipodal regression prototypes. The local goodness is a cosine similarity,
4
The layer is optimized using central finite differences along random directions. For a normalized perturbation direction 5,
6
The expected update recovers the local gradient:
7
FFzero trains layers sequentially and independently, without transmitting later-layer errors to earlier layers. It was more stable than global directional-derivative backpropagation as MLP and CNN depth or width increased, although AD-based methods generally achieved higher accuracy. Its photonic experiment used a simulated MZI network and demonstrated a route to forward-only physical learning without a differentiable model of the physical nonlinearity (Guo et al., 25 Mar 2026).
A photonic CNN using a differentiable digital twin followed by SPSA illustrates a different compromise. The twin was trained with exact digital backpropagation, then the phase parameters were transferred to the physical model and fine-tuned by two-sided simultaneous perturbations. With 2,132 phase-shifter parameters, SPSA required two perturbed forward evaluations per iteration rather than approximately 4,264 evaluations for coordinate-wise finite differences. The reported digital-twin accuracy was 96.92%, transferred ideal-hardware accuracy was 94.23%, severe thermal-crosstalk accuracy was 93.80%, and the result after 100 SPSA iterations was 94.00% (Ranjan et al., 2 Apr 2026). This is hardware-in-the-loop zeroth-order optimization, not optical error backpropagation.
7. Scope, trade-offs, and unresolved issues
The main advantage of in situ backpropagation is that the physical device can differentiate its realized behavior rather than an idealized digital twin. Loss, fabrication variation, thermal coupling, parasitic reflection, nonlinear response, and disorder are incorporated into the measured forward and adjoint fields. For linear reciprocal systems, a finite-amplitude adjoint experiment can produce exact gradients with two physical propagations. For nonlinear trajectories, exactness requires stronger conditions involving time reversal, tangent reciprocity, and infinitesimal perturbations.
The principal architectural trade-offs are:
- Exactness versus locality: physical adjoint methods can be exact for the modeled device, whereas biologically local and spike-based methods often approximate gradients.
- Reverse propagation versus forward-only optimization: reciprocal photonic, mechanical, and wave systems can physically propagate adjoints, while FFzero and forward-gradient methods avoid reverse propagation at the cost of surrogate objectives or estimator variance.
- Physical computation versus digital control: most demonstrations retain digital loss evaluation, parameter scheduling, measurement processing, optimizer state, or weight updates.
- Parallel gradient extraction versus measurement burden: adjoint overlaps scale favorably with the number of parameters, but distributed sensing, phase control, calibration, and detector placement can dominate implementation complexity.
- Biological plausibility versus mathematical equivalence: learned feedback, dendritic circuits, heterosynaptic plasticity, and spike-based rules may remove exact weight transport while retaining global teaching signals, transpose pathways, or synchronization assumptions.
- Hardware efficiency versus training overhead: optical and mechanical inference can be highly parallel and energy-efficient, while in situ training may require repeated measurements, settling time, reprogramming, and calibration.
Several limitations recur across the literature. Many systems require reciprocal or intertwining operator structure; nonlinear dissipative dynamics are substantially more difficult than linear systems; signed quantities require differential channels or paired representations; finite measurement precision limits gradient fidelity; and physical parameter updates are frequently not yet autonomous. Biological proposals additionally face unresolved issues concerning error-signal delivery, timing, derivative representation, stability, and deep credit assignment.
The most general synthesis is provided by the adjoint perspective: in situ gradient computation is possible when the physical system can generate the adjoint associated with its own forward operator, either directly through reciprocity, through a known transformation, through time reversal, through equilibrium nudging, or through a controlled linear-response experiment. When these conditions are unavailable, alternatives such as learned feedback, spike coincidence, directional derivatives, SPSA, or layer-wise prototype optimization may still produce useful training signals, but they should be described as approximations or substitutes for exact in situ backpropagation rather than as equivalent implementations.