Subscribe
AI
7 min read

What Is the Kalman Filter? The 1960 Math That Navigates Rockets, Robots and Modern AI

Every robot that moves through the world has to answer one question: where am I, really? The GPS fix is off by meters. The wheel encoders drift. The camera only sees part of the scene. The standard way to turn that pile of contradictory evidence into a single usable answer is a 66-year-old algorithm that predates the microprocessors it now runs on: the Kalman filter. It is also the direct intellectual ancestor of the state space models, Mamba above all, that LLM researchers now pitch as successo

What Is the Kalman Filter? The 1960 Math That Navigates Rockets, Robots and Modern AI

Every robot that moves through the world has to answer one question: where am I, really? The GPS fix is off by meters. The wheel encoders drift. The camera only sees part of the scene. The standard way to turn that pile of contradictory evidence into a single usable answer is a 66-year-old algorithm that predates the microprocessors it now runs on: the Kalman filter. It is also the direct intellectual ancestor of the state space models, Mamba above all, that LLM researchers now pitch as successors to the transformer.

Prediction and correction: noisy measurements (left) are merged with a model forecast to produce a tight trajectory estimate (right)

The problem: estimating what you cannot see

Suppose a spacecraft is coasting toward the moon and you want to know its position and velocity. You cannot measure either directly from Earth. You can measure radar range and angle, and every measurement arrives wrapped in noise. The deeper issue is that the true state of the system is hidden. You only ever see degraded projections of it.

Before 1960 the dominant answer was Wiener filtering, developed in the 1940s for stationary signals and published in book form in 1949. It worked in the frequency domain, assumed the statistics never changed, and had to be recomputed from scratch as new data arrived, with memory that grew with time. For a multivariable, nonstationary problem like spacecraft navigation, it was a bad fit.

Rudolf Emil Kalman, then a mathematician at the Research Institute for Advanced Study in Baltimore, published the replacement in March 1960 in the Transactions of the ASME, Journal of Basic Engineering: "A New Approach to Linear Filtering and Prediction Problems." His reformulation did three things at once. It described the system in state space, a set of first-order difference equations tracking hidden variables, rather than as an input-output transfer function. It gave a recursive solution: the new estimate is computed from the previous estimate plus the new measurement, so the filter holds a fixed amount of memory regardless of how long it has run. And it showed the filtering problem is the dual of the noise-free regulator problem, linking optimal estimation to optimal control in one mathematical frame. That duality is the reason "state" and "state space" became the shared vocabulary of control engineering, signal processing, and eventually machine learning. The continuous-time version followed in 1961 with Richard Bucy, and the Kalman-Bucy filter is still the standard reference.

The loop: predict, then correct

The algorithm is a two-step loop, repeated for every new measurement.

Predict: push the current estimate forward using the system model. A spacecraft in a known gravity field obeys physics, so the filter propagates position and velocity to the present instant. Uncertainty grows during this step, because the model is never perfectly right.

Correct: compare the actual measurement with the measurement the filter would have expected. The gap is called the innovation. The filter then blends prediction and observation using a single dial, the Kalman gain, computed from the two uncertainty levels. If the measurement noise is small, the gain is large and the estimate jumps toward the data. If the model is confident and the sensor is noisy, the gain is small and the estimate barely moves.

Under linear dynamics and Gaussian noise, this weighting is provably optimal: no other estimator has lower mean squared error. Greg Welch and Gary Bishop's UNC tutorial, TR 95-041, which has been the entry point for generations of graphics and robotics researchers, walks the five equations of the discrete filter and its extended nonlinear variant end to end. The recursion never looks back at old data. A Kalman filter that has run for ten thousand steps stores the same amount of information as one that has run for ten, and does real-time work on machines with almost no memory.

From a rejected paper to Apollo

The 1960 paper is now a canonical document of engineering science, but acceptance was slow. According to Grewal and Andrews' history of the field, as retold in Lototsky's SIAM review, Kalman's follow-up paper was rejected by an electrical engineering journal, one referee declaring that "it cannot possibly be true." The filter's fame instead came from where it was used first.

Stanley F. Schmidt, an engineer at NASA's Ames Research Center, read Kalman's paper in 1960 and saw it could be adapted to the nonlinear trajectory problems of the coming Apollo missions. Because Kalman's optimality proof only holds for linear systems, Schmidt's team linearized around the filter's own running estimate at each step, producing what is now called the extended Kalman filter. NASA's own historical account of this work, published as a technical memorandum by Schmidt and McGee, describes Ames' circumlunar feasibility studies as the setting where the filter was recognized as a practical aerospace tool. The lineage reaches flight hardware: Battin and Potter's group at MIT devised the square-root filter formulation used in the Apollo system, and NASA's 2018 Navigation Filter Best Practices monograph states plainly that Kalman filtering in the onboard navigation systems of the Apollo Command Module and Lunar Excursion Module was an important factor in the lunar landing program. In 2009, President Obama awarded Kalman the National Medal of Science with a citation crediting the filter as critical to the moon landings and to the creation of the Global Positioning System.

The Kalman filter lineage: 1960 state equations and Apollo-era navigation through modern state space model layers

Why LLM people should care

Most Kalman filters today are boring and everywhere: GPS receivers, drone attitude control, robot sensor fusion, the tracking stacks that let a robotaxi fuse cameras, lidar and radar into one picture of traffic. The interesting connection for this readership is architectural.

A transformer consumes a sequence by letting every token look back at all previous tokens through attention, with memory and compute that grow with context length. A state space model does the opposite: it compresses the entire history into a fixed-size hidden state h_t that is updated at each step by a linear recurrence, h_t = A h_t-1 + B x_t, exactly the state equation Kalman wrote down in 1960, with an output h read through a projection. The Structured State Spaces sequence model paper by Albert Gu, Karan Goel and Christopher Ré (arXiv 2111.00396) parameterized that recurrence with structured matrices and trained A, B and C end to end, making the classical linear dynamical system into a competitive deep sequence model. Mamba (arXiv 2312.00752) made the transition matrices input-dependent so the model can choose what to remember and what to forget per token, keeping linear-time training and constant-memory inference. AI21's Jamba (arXiv 2403.19887) interleaves Mamba layers with attention layers in a production-scale language model, betting that a fixed state plus a little exact retrieval beats either alone.

The conceptual echo is precise. Kalman's innovation term, the correction that closes the gap between expectation and observation, is what every training loop performs at the level of weights instead of states. And Kalman's trade-off is the one state space models still carry: a bounded state is cheap but lossy. A fixed-size h cannot store everything, which is why the pure SSM line keeps borrowing attention back for retrieval-heavy tasks, in the same spirit as the KV cache eviction literature this site has covered.

The fine print

Three limits belong in any honest description. Optimality is a linear-Gaussian guarantee; real systems violate both assumptions, and extended filters can diverge badly when the linearization is poor, a failure mode documented since the Apollo era. The filter fuses known models with unknown noise; it cannot discover a model that is missing, which is why modern stacks wrap it in learned components or replace it with particle filters when the geometry is hostile. And the state-space framing, unlike attention, says nothing about what the sequence means; it is a bookkeeping device for uncertainty. Whether that makes it a better substrate for language is an open empirical question that Mamba, Jamba and their successors are still answering.

Sixty-six years on, the filter is the rare piece of 1960s mathematics that never needed to be rediscovered, only relabeled. When it reappeared inside a language model architecture in 2023, the equations were recognizable at a glance. That is what durable math looks like.

Sources

AILLMeducational