QuestionsConfirmed
Is a read-write model just a data cleaner?
On injected faults, CorrectorLSTM's writing is cleaning done inside the model; Trim's is mostly cleaning. On real building meters, Trim also sets aside normal values, mostly the edges of daily switching, and forecasts better for it.
The question
A read-write model changes two things while it trains: its weights, like any neural network, and its own training data. Our models do this to time series. They give no weight to training values they cannot explain, or they write new values in their place. Faulty sensor data is the main use case, so a natural question follows: is this just data cleaning done inside the model? If it were, you could get the same result by running a cleaning filter first and then training an ordinary model.
What we expected
If writing were cleaning, two things would follow. First, the writes would only matter on data with faults; on clean data there would be nothing to write and no gain. Second, the written data would be better data for any model, not only for the model that wrote it. A cleaned series should help a classical forecaster too.
What we found
Both predictions fail, in our confirmed experiments.
Writing helps on data that is mostly clean. On 709 M4 and FRED-MD series, real benchmark data with no injected faults, the read-write LSTM (Trim) has 1.66% lower error than the same LSTM with writing switched off (95% interval 1.29% to 2.06%; better on 86 series, worse on 37, the rest tied). The gain is small, as it should be on data that is mostly clean. A pure cleaner would have nothing to do here.
The writes are made for the model that makes them. In our fault-injection experiment we put spikes, level shifts, stuck values and dropouts into the training part of 631 series. The improved CorrectorLSTM, which writes new values into its copy of the series, has 22.63% lower error than the same LSTM without writing (95% interval 20.57% to 24.78%). So its writes clearly help its own learning. We then gave its written series to ARIMA, a classical forecaster, and compared that with ARIMA on the same faulty series after a standard cleaning filter (Hampel). If the writes were cleaning, ARIMA should do at least as well on them. It does not: ARIMA on the written series has 80% more error than ARIMA after the filter, and is worse on 438 of the 631 series. This was one of our pre-registered claims, and it failed. We report it because it is informative: what the model writes is useful to the model, not a cleaned dataset for anyone.
Where the writes fall: the confirmation
Many writes fall on values that look normal: no standard outlier detector flags them. So we let each model write only where a detector (Hampel, or a seasonal decomposition with an interquartile rule) or the data owner would also flag a value, or only where none would, and compared, on fresh series with three seeds, pre-registered.
CorrectorLSTM: writing is cleaning. On series with injected faults, writing only where a detector agrees is not worse than all its writes (0.45% lower error, 95% interval 0.24% to 0.67%), and 99.4% of its writes on injected faults move the value toward the clean one (2,318 of 2,331). On real meters its writes are not reliably better than the same number of writes at random positions (0.19% lower error, interval -0.02% to 0.42%). For this model, writing is cleaning done inside the model, with the two differences above: no separate cleaning step, and the written data is not a cleaned dataset for other forecasters.
Trim on injected faults: mostly cleaning. Its trims on normal-looking values, used alone, make the forecast worse than no trimming (3.91% higher error, interval 1.93% to 5.97%). Together with its trims on the faults they still add a little: all its trims beat trimming only what a detector flags by 1.47% (interval 0.52% to 2.54%).
Trim on real building meters: more than cleaning. Here its trims on normal-looking values, used alone, make the forecast better than no trimming: 3.70% lower error (interval 2.30% to 5.07%) on 291 fresh meters. By a rule fixed before the run, 92.6% of these trims (4,752 of 5,132) sit on the edges of switching: an hour whose change from the previous hour is among the largest 20% for that meter, or next to one. Those values are not faults; the model learns better without the sharpest edges. On strict on/off schedules, where the edges are the signal, this can hurt, so compare with writing off there.
Are Trim's trimmed series a cleaned dataset? Partly. Gradient-boosted trees (LightGBM) trained on them gain 2.95% (interval 1.16% to 4.78%, a secondary result), but another LSTM with a different seed does not gain reliably (1.03%, interval -1.23% to 2.78%).
What would change our mind
- For CorrectorLSTM the confirmation agrees with the pilot: on such data it behaves like an adaptive cleaner built into the model, and we describe it that way.
- If a cleaning filter tuned per series matched the read-write model on faulty data, the case for writing inside the model would rest on convenience (one step instead of two), not on results.
- If the clean-data gain disappeared on a fresh, untouched set of series, the first finding above would not hold.
Further reading
- Fault injection results and the context (a cleaning filter brings ARIMA and ETS close to the read-write model on faulty data): the Results page, "Faults injected".
- Can a read-write model over-write its data? Confirmed: no over-writing found.
Every number on this page comes from a pre-registered test, run once on fresh data. Open work is described without numbers until its test has run.