Hydrological models that predict river flow from rain and temperature usually treat the land surface as fixed. They assume a catchment's vegetation, soils and built-up area behave the same way in 2020 as in the years the model was tuned on. That assumption is false. Physics-embedded learning finds that the share of river flow coming from groundwater, and the share of rain returned to the air, have shifted by up to about 20% worldwide over two decades (Ji et al.). The best current fix lets a neural network output the physical model's parameters as they change over time. This approach is called differentiable parameter learning, and it couples a recurrent network to a conceptual hydrology model (HBV). The network, however, absorbs change silently. Nothing in it says which past regime the catchment resembles, or when the catchment has moved into a regime the network has never seen.
We propose to treat dynamic parameterization as memory retrieval. A bank of stored "catchment regimes" pairs a binary code of recent weather and flow history with the HBV parameters that worked under that history. Each day the model retrieves a blend of parameters by measuring how well today's code matches each stored code. The match is computed by a weightless neural network, a model whose "neurons" are small random-access lookup tables addressed by groups of input bits rather than weighted sums. Associative-memory theory predicts that retrieval does not degrade gracefully: it collapses abruptly once memories crowd together. That collapse is normally a failure mode. Here we use it as a measurable, explicit signal that the land surface has left the stored repertoire. A weightless memory can then write a new regime in one step instead of being retrained.
Core Claim
Three claims, testable in this order. First, an explicit, inspectable regime memory can match the streamflow skill of LSTM-driven parameter learning on CAMELS when train and test periods come from the same conditions. Second, when the catchment changes, write-on-novelty recovers skill without retraining. Under a temporal split or a synthetic parameter drift, a memory that detects low retrieval confidence and writes a new slot should recover skill faster than an LSTM generator, which must be retrained. Third, the point where retrieval breaks down depends on how strongly the stored patterns resemble each other. Real hydrological histories are highly correlated across seasons and years, so the abrupt-collapse load should arrive far earlier than independent-pattern theory predicts. Decorrelating encodings, namely random bit-group sampling and Bloom-filter hashing, should move the collapse point measurably. The third claim is a direct empirical answer to an open question in capacity theory.
What Exists and Where This Differs
The hydrology side motivates the work. Feng et al. embed an LSTM that outputs time-varying HBV parameters, reaching median Nash-Sutcliffe efficiency (NSE, a skill score where 1 is perfect and 0 equals predicting the mean) of 0.715–0.732 on 671 CAMELS basins while staying mass-conserving. Ji et al. scale this globally and expose the partitioning shifts. Both learn change implicitly. Neither stores regimes, flags novelty, or adds a regime without retraining. That gap is the cost that Seo et al. document for black-box flood models that "require total retraining," and the one Kovář et al. document as calibration degrading once land use evolves.
The memory side supplies the method. Ramsauer et al. show that softmax attention is the update rule of a continuous Hopfield memory with exponential capacity. Bricken and Pehlevan show that the same softmax approximates Kanerva's Sparse Distributed Memory, which is binary and address-based. In that picture, the softmax temperature sets a read radius in Hamming space. This is the bridge we use: a Hamming-distance softmax over binary codes is a principled retrieval rule. Weightless networks compute Hamming-like agreement natively, through counts of matching lookup-table addresses (WiSARD-style discriminators). Neither memory paper touches weightless hardware or real environmental data.
Capacity theory constrains the design. Lucibello and Mézard prove an all-or-nothing retrieval cliff at a critical load. They also show that pattern geometry matters: Gaussian rather than spherical patterns produce a "condensed" phase in which a subset of memories dominates the crosstalk. Their results assume independent random patterns, and they flag correlated real data as open. Seasonal hydrological histories are an extreme case of correlation. On the weightless side, Santiago et al. compress lookup tables with Bloom filters at negligible accuracy cost (91.5% vs 91.7% on MNIST). Napoli et al. do the same with count-min sketches. Both treat hash collisions as benign noise, and neither asks whether collisions bring the retrieval cliff forward. Bacellar et al. make lookup tables trainable by gradient. We reuse that for an optional learned encoder, and we treat their 2522x energy-delay gain over binary networks as a secondary deployment motivation rather than the core claim.
Research Program
The model has three parts. The first part is the cue. It is a binarized window of the last $L$ days of forcing (precipitation, temperature, radiation) plus observed flow where available, thermometer-encoded and split by a fixed random mapping into $n$-bit groups. The second part is the memory. It holds $P$ slots. Slot $\mu$ has a weightless discriminator, a set of lookup tables written with the cue windows assigned to that slot, together with a continuous HBV parameter vector $\theta_\mu$. The third part is the retrieval rule:
$$\theta_t = \sum_{\mu=1}^{P} \frac{\exp(\beta\, s_\mu(x_t))}{\sum_{\nu} \exp(\beta\, s_\nu(x_t))}\,\theta_\mu, \qquad c_t = \max_\mu s_\mu(x_t).$$
Here $x_t$ is today's binary cue, $s_\mu(x_t)\in[0,1]$ is the fraction of slot $\mu$'s lookup-table addresses that $x_t$ hits, and $\beta$ is the read sharpness. $\theta_t$ drives the differentiable HBV model, and $c_t$ is the retrieval confidence. Addressing is weightless. The values $\theta_\mu$ and $\beta$ are trained by backpropagating streamflow error through HBV, as in Feng et al.. Slots are initialized by clustering training-period cues, and static catchment attributes condition the initial $\theta_\mu$ through a small regionalization map.
Write-on-novelty works as follows. When $c_t$ stays below a threshold $\tau$ for $k$ consecutive days, a new slot is allocated and written with the recent cues. Its $\theta$ is fitted on only the recent window, a few hundred days, with the rest of the memory frozen. This step is cheap and local, and it leaves old regimes intact.
The analysis has two parts. For capacity, we sweep $P$ and the number of cue windows written per slot. We measure the load at which retrieval accuracy collapses, defined as the fraction of held-out cues routed to their true slot in synthetic tests, and compare it with the independent-pattern prediction. We then repeat the sweep with decorrelating encodings (random group mapping, then Bloom hashing at several filter sizes) and with a measured cue-autocorrelation statistic as the explanatory variable. For interpretability, we project each slot's stored bits back to input space (Lima Filho et al.) and check whether slots correspond to recognizable regimes, such as snowmelt-dominated or wet-season periods, and whether the timing of new writes tracks known change.
Baselines
The naive reference is static HBV calibrated once on the training period and never changed. This is the literal static-land-cover assumption, and every method must beat it on the shifted test period. The file's closest reported figure is the regionalized-model median NSE of about 0.53 on CAMELS (Feng et al.). We will rerun it on our splits rather than quote it.
A second naive reference is periodic sliding-window recalibration of static HBV. It uses the same post-shift data budget that write-on-novelty receives, so the comparison isolates whether memory adds anything beyond "refit on recent data."
The strongest competitor is δHBV, the LSTM parameter generator coupled to differentiable HBV (Feng et al.). It reports median NSE 0.715–0.732 on 671 CAMELS basins, with evapotranspiration correlation 0.848 against MODIS and baseflow correlation 0.745 against USGS. A pure LSTM reports 0.72–0.748 and serves as the upper reference for unconstrained skill. We will retrain both on identical basins, forcings, splits and hyperparameter-search budgets. On the shifted test period, δHBV gets two treatments: frozen, and fine-tuned on the same post-shift window the memory uses. That fine-tuned variant is the fair comparison for write-on-novelty.
For Caravan there is no reported result found on Lacuna for streamflow models (Kratzert et al.), so all Caravan baselines are run by us.
Two ablations isolate the key ingredients. The first replaces the weightless match score with a continuous Hopfield layer, softmax attention over float-valued cue embeddings (Ramsauer et al.). This tests whether lookup-table addressing matters beyond the memory structure itself. The second replaces it with exact Hamming k-nearest-neighbor retrieval on the same binary cues, which tests whether random group sampling contributes generalization.
Beating the strongest baseline means three things. In-distribution median NSE must be within 0.02 of δHBV, with ET and baseflow correlations no worse. On shifted periods, the memory must show a statistically significant per-basin NSE gain over frozen δHBV and match or exceed fine-tuned δHBV, while degrading pre-shift skill less than fine-tuning does.
Why not just…?
Why not just keep the LSTM generator and fine-tune it after a change? This is the real threat. Fine-tuning may recover post-shift skill just as well. What it cannot do is say when to fine-tune, and it risks overwriting earlier regimes. We test both directly. The fine-tuned δHBV baseline gets the same post-shift data, and we measure skill on a return to earlier conditions after adaptation. If fine-tuned δHBV matches the memory on both, the remaining contributions are the novelty signal and the capacity analysis, and we will report the result that way.
Why not just use nearest-neighbor analog retrieval of parameters? Exact Hamming k-nearest-neighbor retrieval has one-shot writing and a distance-based novelty signal for free. If it matches the weightless memory, the lookup-table structure is justified only by hardware cost. The k-nearest-neighbor ablation decides this. Our expectation, which the experiment can refute, is that random bit-group sampling generalizes better on short, noisy records, and that its collapse point responds differently to decorrelation.
Why not just use novelty detection on forcings with an off-the-shelf drift test? Drift in rainfall statistics is not the same as land-surface change. The surface can change under identical weather. Because our cue includes observed flow and the confidence is tied to the parameters in use, it should respond to land-surface change specifically. The synthetic test below holds forcing statistics fixed while drifting parameters. A forcing-only drift test should miss that change and the memory's confidence should catch it. If it does not, the claim fails.
Why not just quantize the LSTM or use a binary network for edge use? Low power is secondary here, and Bacellar et al. already report large energy gains for weightless networks over binary ones. We report lookup-table count and microcontroller inference cost, but the proposal stands or falls on the adaptation and capacity results.
Proposed Experiments and Decisive Checks
The first experiment is a synthetic test with ground truth. On CAMELS forcings we generate streamflow from HBV with parameters that drift on a known schedule: step changes mimicking deforestation, and slow ramps mimicking urbanization. Forcing statistics stay unchanged. The decisive checks are whether low-confidence alarms coincide with step changes within $k$ days, whether recovered parameters track the true drift, and where retrieval collapses as more regimes are packed into a fixed memory. Comparing that collapse load across encodings directly tests the correlation question left open by Lucibello and Mézard. It also tests whether Bloom hashing (Santiago et al.) delays or hastens the collapse.
The second experiment is a real temporal split on CAMELS. We train on early years and test on later years. Basins are stratified by the change in runoff ratio and baseflow ratio between periods, computed from the data itself, following the signatures used by Ji et al.. The prediction is that the memory's advantage over frozen δHBV grows with the size of this change, and that write events cluster in high-change basins. A flat advantage across strata would falsify the mechanism even if average NSE improved.
The third experiment transfers the setup to Caravan, with its 31-year median records, to test whether results hold beyond the contiguous US. It includes the arid and cold basins that Kratzert et al. note are under-represented.
The single most decisive outcome is the combination of three results: in-distribution parity with δHBV, a shift-dependent gain over frozen δHBV, and confidence alarms that catch synthetic land-surface drift that forcing-only tests miss. Together these would show that an explicit regime memory, with its collapse behavior understood, is a better account of non-stationary catchments than a network that absorbs change silently.
References
- Distinct hydrologic response patterns and trends worldwide revealed by physics-embedded learning
- Differentiable, Learnable, Regionalized Process‐Based Models With Multiphysical Outputs can Approach State‐Of‐The‐Art Hydrologic Prediction Accuracy
- Dam Inflow Forecasting for Short Term Flood Based on Neural Networks in Nakdong River Basin
- Choosing an appropriate hydrological model for rainfall-runoff extremes in small catchments
- Hopfield Networks is All You Need
- Attention Approximates Sparse Distributed Memory
- Exponential Capacity of Dense Associative Memories
- Memory Efficient Weightless Neural Network using Bloom Filter
- Efficient Knowledge Aggregation Methods for Weightless Neural Networks
- Differentiable Weightless Neural Networks
- Interpretation of Model Agnostic Classifiers via Local Mental Images
- Caravan - A global community dataset for large-sample hydrology