Organizations: The Chinese University of Hong Kong, Shenzhen · The Hong Kong University of Science and Technology (Guangzhou) · Southern University of Science and Technology
Non-intrusive load monitoring (NILM) estimates appliance-level consumption from a whole-home meter, but appliance-specific models and fixed output inventories make coverage costly to extend. We present FM4NILM (Foundation Model for NILM), a single prompt-programmable model that estimates a requested appliance's power trajectory from aggregate measurements, a natural-language description, and optional activation exemplars. A lightweight cadence-aware transformer is pretrained by masked reconstruction on 645k sequences from seven public corpora spanning 1-60 s sampling intervals, then aligned with appliance requests using observation-masked losses for partially labeled households. A Bernoulli-lognormal decoder separates activity detection from conditional power estimation. On held-out households and time periods from REDD, UK-DALE, and REFIT, one frozen text-prompted model serves twelve appliance-corpus requests, achieving 0.556 event F1, 0.625 AUPRC, and the lowest active-window MAE (251.8 W) among seven appliance-specific baselines. Streaming score aggregation raises event F1 to 0.582 with a 60 s aggregation delay. In a separate category-held-out evaluation, adding ten activation exemplars raises microwave AUPRC from 0.132 to 0.214 without parameter updates. Input-intervention ablations probe the model's dependence on appliance requests and aggregate measurements. These results demonstrate competitive disaggregation with one shared model and support extending appliance coverage through prompts and examples rather than additional specialist networks.
Figures & tables
Figure 1. FM4NILM : one foundation model for different appliance requests. (a) Text and optional cross-home exemplars form query qa through a multilayer perceptron (MLP), modality masking, mode and count embeddings, and layer normalization (LN); the snowflake marks frozen parameters. (b) Six-channel inputs become patch tokens with physical-time encodings; the inset repeats LN, attention (Attn), and a feed-forward network (FFN) with residual connections six times. The dashed link denotes shared encoder weights; tokens H feed query-to-signal attention, and a convolution (conv) upsamples features U . (c) Activation probability multiplies conditional mean on-power to produce expected power. Gray aggregates and teal predictions show two requests answered by fixed weights. Waveforms are schematic; window scoring and streaming are described in § 4.3 . Text and exemplar waveforms form a query. Aggregate waveforms become patch tokens, receive physical-time encoding, and pass through six shared attention and feed-forward layers with residual connections. Cross-attention and additive fusion condition two output heads. Activation probability times conditional mean power yields the requested trajectory, illustrated for dishwasher and microwave on the same aggregate.
Corpus
Aggregate
Lab. (%)
Agg. (W)
Res. (W)
Exc. (%)
REDD
site meter
30.6
309
205
0.08
UK-DALE
site meter
19.7
362
243
0.17
REFIT
site meter
6.2
543
459
0.74
ECO
site meter
30.1
417
305
0.47
IDEAL
site meter
25.3
485
346
2.23
GREEND
synth. (all meters)
34.6
257
142
0.00
Table 1. Aggregate provenance and label coverage. In the header, Lab., Agg., Res., and Exc. denote labeled share, aggregate power, residual power, and exceeds, respectively. Labeled share is the mean ratio of observed submeter power to aggregate power. Residual is the remaining consumption, and exceeds is the fraction of samples where the labeled sum is larger than the independently measured aggregate.
Model
Deployed
Event F1 (%)
AUPRC (%)
MAE-on (W)
Appliance-specific, source-local (12 models)
FHMM ( Kolter and Jaakkola, 2012 )
12 ⋅ tiny
34.9 ± 5.9
18.5 ± 2.5
661.3 ± 53.7
XGBoost ( Chen and Guestrin, 2016 )
12 ⋅ trees
51.6 ± 0.6
59.3 ± 1.1
420.9 ± 13.3
Seq2Point ( Zhang et al., 2018 )
222 M
47.3 ± 1.3
44.4 ± 0.7
878.0 ± 3.5
Seq2Seq ( Zhang et al., 2018 )
226 M
53.5 ± 0.8
59.5 ± 1.5
563.8 ± 15.1
BiLSTM ( Kelly and Knottenbelt, 2015a )
6.9 M
54.9 ± 1.6
61.5 ± 2.5
325.2 ± 18.8
Table 2. Held-out test results over 18,912 windows from unseen houses and periods using five seeds. Specialist baselines use one model per appliance and corpus, totaling twelve models. The closed-vocabulary control replaces the text prompt with a learned appliance identity. FM4NILM uses one shared, text-addressed network. “Deployed” gives the total parameter count for all twelve appliance–corpus requests. Best values are bold.
Variant
Event F1 (%)
AUPRC (%)
MAE-on (W)
FM4NILM (full)
55.6 ± 0.4
62.5 ± 2.2
251.8 ± 6.3
− masked pretraining
54.3 ± 0.9
60.3 ± 1.8
269.1 ± 8.5
− text (learned ID)
49.6 ± 5.3
49.4 ± 18.6
431.0 ± 172.8
− exemplar episodes
53.3 ± 1.2
59.8 ± 2.6
369.6 ± 24.4
+ amplitude roles
54.1 ± 1.6
63.6 ± 1.1
297.8 ± 16.3
three corpora
53.1 ± 1.3
63.5 ± 1.1
287.2 ± 11.7
Table 3. Five-seed ablations (text-only prompts). Δ AUPRC is the paired per-seed mean against the full FM4NILM model with a bootstrap 95% confidence interval (CI); an interval excluding zero is significant.
Figure 2. Model and pretraining scale. Points show five-seed means; bands show ±1 standard deviation. (a) Detection scores across model sizes, spaced categorically; the shaded column marks the selected 3.7M model. (b) Event F1 improves overall as the pretraining pool grows from 10% to 100%, while AUPRC peaks at 25%. Two line charts show event F1 and AUPRC against model parameter count and pretraining-data fraction. The selected model has 3.7 million parameters.
Figure 3. Exemplar benefit and activation duration. Each point is the paired AUPRC gain from ten exemplars over text alone, averaged across five seeds; bars show ±1 standard error. Duration is the median from submeter activations, shown on a log scale. Kettle and microwave show the largest gains. A scatter plot relates exemplar AUPRC gain to median appliance activation duration; short microwave and kettle events show larger gains than long multi-phase loads.
Category
Prompt
Event F1 (%)
AUPRC (%)
MAE-on (W)
Microwave
text only
31.1 ± 9.3
13.2 ± 8.9
968.4 ± 140.5
text + 1 ex.
24.5 ± 2.2
11.2 ± 1.1
1113.6 ± 35.6
text + 5 ex.
28.1 ± 4.1
16.5 ± 3.2
1021.8 ± 45.2
text + 10 ex.
36.5 ± 4.7
21.4 ± 3.7
924.1 ± 52.1
5 ex. only
27.5 ± 2.8
17.1 ± 2.3
1026.0 ± 33.2
Dishwasher
text only
12.8 ± 0.7
6.0 ± 1.1
1013.3 ± 48.3
Table 4. Zero-/few-shot transfer to categories excluded from all supervision and from pretraining submeter channels. Dense held-out test windows; five seeds × five exemplar draws. The held-out category is absent from supervision, checkpoint selection, and the pretraining submeter pool.
Figure 4. Transfer through exemplar requests. Curves show five-seed mean AUPRC with ±1 standard deviation; K=0 denotes text alone. (a) Microwave improves from one to ten exemplars, while dishwasher stays near its mismatched-exemplar control. Dashed references use five mismatched exemplars with text omitted. (b) REFIT transfer under strict exclusion and with unlabeled target pretraining. The dash-dot line is the supervised REFIT reference. AUPRC versus exemplar count for excluded microwave and dishwasher categories and for the excluded REFIT corpus. Each appliance has its own mismatched-exemplar reference. REFIT curves compare strict exclusion with unlabeled target pretraining.
Training
Prompt
Event F1 (%)
AUPRC (%)
REFIT trained (reference)
text
32.2 ± 2.2
47.5 ± 6.3
Strict
text
23.4 ± 2.0
28.9 ± 2.5
+ 1 enroll.
20.6 ± 2.6
24.1 ± 1.9
+ 5 enroll.
21.2 ± 3.3
27.1 ± 3.1
+ 5 cross-src.
23.8 ± 2.5
30.1 ± 2.3
+ unlab. target
text
29.4 ± 2.1
34.2 ± 1.1
Table 5. Dataset exclusion (REFIT test houses 13/20). Strict exclusion removes REFIT from supervision and pretraining; the unlabeled-target variant admits only its unlabeled aggregates to pretraining. Enrollment draws exemplars from REFIT non-test houses at inference. MAE-on is in the released per-run JavaScript Object Notation (JSON) files.
Figure 5. Input interventions. Bars show five-seed mean AUPRC with ±1 standard deviation. (a) Text requests across all evaluated appliance–corpus pairs. (b) Five exemplars without text for the excluded microwave. Altering the request or removing the aggregate signal reduces accuracy; panels use different AUPRC scales. Bar charts compare canonical prompts with altered text, missing aggregate input, and wrong-category exemplars; each intervention reduces AUPRC.
Setting
False power (W)
Energy ratio
FM4NILM (held-out households)
31.5 ± 2.5
2.54 ± 0.08
Closed vocab. (ID)
37.5 ± 22.8
4.35 ± 3.08
FM4NILM , unseen (strict)
20.7 ± 4.1
1.29 ± 0.23
FM4NILM , unseen (+unlab.)
24.1 ± 5.8
1.54 ± 0.35
Table 6. Scale containment. False power is the mean predicted wattage while the requested appliance is off; energy ratio is predicted energy divided by true energy. Their ideal values are zero and one, respectively.
Metric
All seven corpora
REFIT held out
Actual MAE-on (W)
202 ± 3
249 ± 16
Rescaled MAE-on (W)
163 ± 7
188 ± 9
Scale share
19%
25%
Median factor: seen
1.08
1.08
Median factor: REFIT
1.25
2.11
Under-predicted groups
93%
100%
Table 7. Power-error decomposition using a diagnostic multiplier fitted per household–appliance group. Values are macro-averaged over 14 groups, a different weighting from the equal-corpus main result. Factors above one indicate under-prediction.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Arm
seeds
Δ event F1 (pts)
Δ AUPRC (pts)
Δ MAE-on (W)
calendar time
5
+2.71 [ +1.01 , +4.34 ]
+2.39 [ +0.79 , +4.72 ]
−3.2 [ −30.0 , +17.2 ]
control: timestamps shuffled
5
−0.36 [ −1.80 , +0.70 ]
+1.15 [ −0.52 , +2.82 ]
−13.7 [ −50.1 , +12.6 ]
window-relative normalization
5
−0.96 [ −2.21 , +0.13 ]
+4.67 [ +3.76 , +5.26 ]
−3.7 [ −34.1 , +19.3 ]
local dynamics
3
+0.05 [ −2.03 , +2.89 ]
+1.27 [ +0.08 , +3.02 ]
+5.5 [ −12.9 , +23.7 ]
all channels
5
+1.49 [ −0.31 , +3.02 ]
+3.52 [ +1.64 , +5.16 ]
+6.4 [ −29.0 , +28.6 ]
static physical covariates
3
+0.21 [ −3.83 , +2.81 ]
−2.47 [ −12.98 , +3.26 ]
+49.6 [ −3.5 , +132.8 ]
Appendix
Table 8. Covariates and watt-head parameterizations on the frozen test set, reported as paired differences from the deployed operator. Shuffling timestamps preserves their marginal distribution while removing their association with each window. Calendar channels improve both detection metrics; static physical covariates and the tested watt heads provide no consistent MAE-on gain.
Table 14
Span (s)
Token (s)
ts-AUPRC (%)
ts-AUPRC, multi-phase (%)
MAE-on (W)
seeds
480
4
74.57
84.16
219
reference
1920
16
+2.49 [ +0.62 , +6.12 ]
+9.23 [ +7.81 , +10.74 ]
+20 [ −64 , +126 ]
3
1920
4
+1.53 [ −0.77 , +5.51 ]
+2.76 [ −3.75 , +8.63 ]
+27 [ +5 , +42 ]
3
7200
16
−6.07 [ −8.66 , −0.95 ]
−6.24 [ −17.83 , +3.58 ]
+158 [ +42 , +234 ]
3
7200
60
−5.39 [ −8.49 , −0.84 ]
+2.37 [ −3.02 , +5.42 ]
+161 [ +82 , +260 ]
3
Appendix
Table 11. Request geometry scored per instant on the reconstructed timeline. Physical span and token span vary independently on the same recordings. The reference row gives absolute values and the remaining rows give paired differences. A 1920 s span gives the largest gain for multi-phase categories; extending to two hours reduces the number of independent training windows and reverses the overall gain. MAE-on remains stable across the 480–1920 s settings.
Channel
Context / rule
Delay
Δ event F1 (pts)
Pooled Δ
REDD
UK-DALE
REFIT
pooled
AUPRC (pts) / MAE-on
State
past 120 s
0 s
+2.78
+1.49
+0.00
+1.42
−0.41 / +0.0 W
State
past 120 s + future 60 s
60 s
+4.48
+3.08
+0.00
+2.52
−0.14 / +0.0 W
State
past 120 s + future 120 s
120 s
+4.48
+3.09
+0.00
+2.52
−0.12 / +0.0 W
Power
uniform average
n/a
+0.00
+0.00
+0.00
+0.00
+70.8 W
Power
Hann average
n/a
+0.00
+0.00
+0.00
+0.00
+36.5 W
Appendix
Table 12. Streaming inference with the final FM4NILM model over five seeds. State rows use the fixed 0.5 threshold and report paired changes from single-window inference. REDD and UK-DALE have 7.98-fold realized coverage; the selected REFIT windows have no neighbor within 120 s. Power rows modify power trajectories while preserving event scores.
MAE-on (W)
amplitude ratio
ts-AUPRC (pts)
Scope
Corpus
base
revised
Δ
base
revised
Δ
Δ
attributable
REDD
730
709
−20 [ −91 , +41 ]
0.543
0.670
+0.127 [ +0.086 , +0.175 ]
+0.00
attributable
UK-DALE
753
470
−283 [ −338 , −217 ]
0.440
0.840
+0.400 [ +0.358 , +0.426 ]
+0.00
attributable
REFIT
824
703
−121 [ −140 , −107 ]
0.558
0.721
+0.163 [ +0.154 , +0.171 ]
+0.00
all requested
REDD
282
275
−7 [ −30 , +14 ]
0.755
0.798
+0.042 [ +0.029 , +0.058 ]
+0.00
all requested
UK-DALE
473
303
−170 [ −203 , −130 ]
0.612
0.852
+0.240 [ +0.215 , +0.255 ]
+0.00
Appendix
Table 13. Retroactive edge anchoring over five seeds. A switch-off paired with an earlier switch-on defines an interval whose watts are set from the measured step height. “Attributable” covers categories described by a separable, uninterrupted power plateau. Other categories retain their original outputs, diluting the effect in the “all requested” rows. The rule updates the watt channel, so detection remains unchanged up to numerical noise.
AUPRC (%)
Fridge
Microwave
Dishwasher
Kettle
Toaster
Washing machine
Canonical
79.5
50.0
72.9
75.6
20.4
41.1
User mean
72.9
17.4
32.3
27.0
10.9
34.5
User worst
66.7
9.1
13.3
4.3
4.5
28.4
Retention
92%
35%
44%
36%
54%
84%
Appendix
Table 14. Prompt-phrasing robustness over five seeds. “Canonical” is the structured appliance card; “user phrasings” are held-out colloquial requests for the same appliance. Retention is mean user-phrasing AUPRC divided by canonical AUPRC. Categories with distinctive electrical signatures retain the most accuracy.
Modality
Intervention
AUPRC (%)
Text
canonical card
62.5 ± 2.2
matched confuser
27.4 ± 0.7
deranged permutation
13.8 ± 1.9
zero signal
7.8 ± 0.0
Exemplar
correct category ( K=5 )
17.1 ± 2.3
wrong category ( K=5 )
1.3 ± 0.3
Appendix
Table 15. Causal controls at inference (five seeds). Text controls apply to the full model over all requests; exemplar controls apply to the held-out microwave under the unseen-appliance protocol, in exemplar-only mode. These are the values plotted in Fig. 5 .
Corpus
Cad.
Win
Train
Val
Test
Houses (tr/va/te)
REDD
1 s
480
25,844
3,577
7,332
1/2;1/2;1/2
UKDALE
1 s
480
23,147
3,203
6,580
1/2;1/2;1/2
REFIT
8 s
120
10,000
5,000
5,000
3/5/6/9;2/11;13/20
ECO
8 s
120
6,822
3,565
0
1/3/4/6;2/5;–
IDEAL
8 s
120
33,532
3,993
0
25 houses;105/175/311/328;–
GREEND
8 s
120
5,388
3,589
0
1/4/5;2/6;–
Appendix
Table 16. Per-corpus splits and window counts under the fixed splits. Houses are disjoint across splits for REFIT; REDD and UK-DALE use strict chronological within-house splits with purge gaps; the four auxiliary corpora supply supervision and pretraining but carry no frozen test split. All windows are non-overlapping at the listed stride.
Corpus
Appliance
Thr. (W)
Events
Pos. (%)
Peak (W)
REDD
fridge
50
582
34.9
188
REDD
microwave
200
246
0.9
1575
REDD
dishwasher
50
180
2.4
1107
UKDALE
kettle
200
128
0.9
2979
UKDALE
microwave
200
169
0.5
1339
UKDALE
fridge
50
708
39.5
95
Appendix
Table 17. Per-appliance statistics under the fixed splits: on/off threshold, number of complete activation events, positive-window rate (fraction of observed windows in which the appliance is active), and median on-state peak power. Only appliances that are actually submetered in a corpus are listed.
Table 22
FM4NILM (shared)
BERT4NILM (per-appliance)
Corpus
Appliance
F1 (%)
AUPRC (%)
MAE (W)
F1 (%)
AUPRC (%)
MAE (W)
REDD
fridge
78.7
90.4
29
80.9
89.6
69
REDD
microwave
84.4
56.0
418
85.6
60.4
345
REDD
dishwasher
53.8
77.4
60
62.6
74.4
92
UKDALE
kettle
94.6
86.7
357
95.6
92.7
154
UKDALE
microwave
79.4
62.4
402
90.1
74.5
196
Appendix
Table 20. Per-corpus, per-appliance results (five-seed means): one shared FM4NILM with a text prompt versus BERT4NILM, the strongest per-appliance specialist with a dedicated model for each row. Detection is mixed across categories; FM4NILM has lower MAE-on for most appliances while using one network.
Figure 6. Examples of requested disaggregation. Gray lines show aggregate power, blue traces and shading show the target, and dashed teal lines show predicted power, all in kW. (a) A UK-DALE kettle requested by text. (b) A REFIT microwave with a low event score and underestimated amplitude. (c) A microwave excluded from supervision and pretraining submeter channels, requested with text and ten exemplars. Each panel reports its saved window event score. Table 4 summarizes category transfer across test windows. Three time-series panels compare aggregate, target, predicted power, and window event score for a supervised kettle, a REFIT microwave, and a held-out microwave prompted with ten exemplars.
Systèmes et Applications des Technologies de l’Information et de l’Energie laboratory, Cergy-Pontoise · Dipartimento di Ingegneria dell’Informazione ed Elettrica e Matematica Applicata/DIEM, University of Salerno, 84084 Fisciano