id
stringlengths 33
34
| updated
unknown | published
unknown | title
stringlengths 9
212
| summary
stringlengths 75
2.46k
| author
sequence | arxiv:doi
stringlengths 0
71
| link
list | arxiv:journal_ref
sequence | arxiv:primary_category
dict | category
sequence | content
stringlengths 0
1.25M
|
---|---|---|---|---|---|---|---|---|---|---|---|
http://arxiv.org/abs/2310.04941v1 | "2023-10-07T23:21:25" | "2023-10-07T23:21:25" | Reliable Test-Time Adaptation via Agreement-on-the-Line | Test-time adaptation (TTA) methods aim to improve robustness to distribution
shifts by adapting models using unlabeled data from the shifted test
distribution. However, there remain unresolved challenges that undermine the
reliability of TTA, which include difficulties in evaluating TTA performance,
miscalibration after TTA, and unreliable hyperparameter tuning for adaptation.
In this work, we make a notable and surprising observation that TTAed models
strongly show the agreement-on-the-line phenomenon (Baek et al., 2022) across a
wide range of distribution shifts. We find such linear trends occur
consistently in a wide range of models adapted with various hyperparameters,
and persist in distributions where the phenomenon fails to hold in vanilla
models (i.e., before adaptation). We leverage these observations to make TTA
methods more reliable in three perspectives: (i) estimating OOD accuracy
(without labeled data) to determine when TTA helps and when it hurts, (ii)
calibrating TTAed models without label information, and (iii) reliably
determining hyperparameters for TTA without any labeled validation data.
Through extensive experiments, we demonstrate that various TTA methods can be
precisely evaluated, both in terms of their improvements and degradations.
Moreover, our proposed methods on unsupervised calibration and hyperparameters
tuning for TTA achieve results close to the ones assuming access to
ground-truth labels, in terms of both OOD accuracy and calibration error. | [
"Eungyeup Kim",
"Mingjie Sun",
"Aditi Raghunathan",
"Zico Kolter"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04941v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04941v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
1
4
9
4
0
.
0
1
3
2
:
v
i
X
r
a
RELIABLE TEST-TIME ADAPTATION VIA
AGREEMENT-ON-THE-LINE
Eungyeup Kim1 Mingjie Sun1 Aditi Raghunathan1
1Carnegie Mellon University 2Bosch Center for AI
{eungyeuk, mingjies, raditi, zkolter}@cs.cmu.edu
J. Zico Kolter1,2
ABSTRACT
Test-time adaptation (TTA) methods aim to improve robustness to distribution
shifts by adapting models using unlabeled data from the shifted test distribution.
However, there remain unresolved challenges that undermine the reliability of
TTA, which include difficulties in evaluating TTA performance, miscalibration
after TTA, and unreliable hyperparameter tuning for adaptation. In this work, we
make a notable and surprising observation that TTAed models strongly show the
agreement-on-the-line phenomenon (Baek et al., 2022) across a wide range of dis-
tribution shifts. We find such linear trends occur consistently in a wide range of
models adapted with various hyperparameters, and persist in distributions where
the phenomenon fails to hold in vanilla models (i.e., before adaptation). We lever-
age these observations to make TTA methods more reliable in three perspectives:
(i) estimating OOD accuracy (without labeled data) to determine when TTA helps
and when it hurts, (ii) calibrating TTAed models without label information, and
(iii) reliably determining hyperparameters for TTA without any labeled validation
data. Through extensive experiments, we demonstrate that various TTA methods
can be precisely evaluated, both in terms of their improvements and degradations.
Moreover, our proposed methods on unsupervised calibration and hyperparame-
ters tuning for TTA achieve results close to the ones assuming access to ground-
truth labels, in terms of both OOD accuracy and calibration error.
1
INTRODUCTION
Machine learning models often fail to generalize to new distributions (Arjovsky et al., 2020; Gulra-
jani & Lopez-Paz, 2021; Sagawa et al., 2022) – so-called out-of-distribution (OOD) data - which
differ from the one they were trained on, referred to as in-distribution (ID) data. This can lead to a
significant degradation in their performance during test time. Recently, there has been a surge in re-
search on test-time adaptation (TTA), a technique that adapts models to the target distribution using
only unlabeled test data. These involve adaptation strategies including estimating test-time feature
statistics (Schneider et al., 2020), self-supervision (Sun et al., 2020; Liu et al., 2021; Gandelsaman
et al., 2022), entropy minimization (Liang et al., 2020; Wang et al., 2021; Zhang et al., 2022; Niu
et al., 2022; 2023), and self-training with pseudo-labels (Liang et al., 2020; Rusak et al., 2022; Goyal
et al., 2022). These efforts have aimed to enhance model robustness in the face of distribution shifts
where labeled data is unavailable.
Despite the progress in TTA, several critical bottlenecks persist, undermining the reliable applica-
tions of such adaptation methods in practice. Firstly, TTA is not universally effective for all dis-
tribution shifts and can sometimes lead to performance degradation (Wang et al., 2021; Liu et al.,
2021; Zhao et al., 2023). Moreover, the absence of labeled test data hinders the evaluation of model
performance in practice, thereby making it unclear in advance whether these methods will work or
not. Secondly, TTA methods often result in poorly calibrated models (Eastwood et al., 2022; Chen
et al., 2022; Rusak et al., 2022), posing potential risks in safety-critical applications. Thirdly, TTA
methods are often extremely sensitive to their hyperparameters during adaptation (Boudiaf et al.,
2022; Zhao et al., 2023), and their tuning procedures lack clarity. Most of them often follow the
same settings of the previous studies (Niu et al., 2022; 2023), or rely on some held-out labeled
data (Iwasawa & Matsuo, 2021; Zhang et al., 2022; Goyal et al., 2022), which might be unavailable
1
Figure 1: Various TTA methods make the correlations in agreement and accuracy notably stronger
than their base counterparts, with their R2 values substantially increased. We test SHOT, TENT, and
ETA on CIFAR10 (first row) and ImageNet (second row) against their Gaussian Noise corruption.
Each blue point indicates the accuracy of the models, while pink denotes the agreement between a
pair of them. The axes are probit scaled. Additional results are provided in appendix A.5.
in practice. To our knowledge, there is little work addressing these shortcomings given no access to
the labels during test time.
In a separate line of work, Baek et al. (2022) show that the ID and OOD agreement between clas-
sifiers (i.e., the average extent to which two classifiers make the same prediction on an unlabeled
datasets) show a strong linear correlation, akin to the same phenomenon showed for ID vs. OOD
accuracy, demonstrated by Miller et al. (2021). Taken together, these phenomena, the so-called
agreement-on-the-line (AGL) and accuracy-on-the-line (ACL) present a method for assessing OOD
accuracy without labeled data.
In this paper, we observe a noteworthy phenomenon: after applying TTA, AGL and ACL persist
or even hold to a stronger degree than in their base counterparts. In other words, when we assess
the accuracies and agreements of the models adapted to OOD data, the strong correlations in ID vs.
OOD consistently hold across distribution shifts, including those where vanilla models do not exhibit
such trends. Interestingly, these correlations occur not only when TTA improves OOD accuracy, but
also when it fails to enhance or even negatively affects OOD accuracy, especially under real-world
shifts. We observe such trends not just among the models with different architectures, but within
those with same architecture but adapted with varying values of their adaptation hyperparameters,
including learning rates, the number of adaptation steps, and others.
These findings, with strong AGL and ACL after TTA, lead to the enhancement of TTA methods for
improved reliability. We can first predict the effectiveness of TTA methods, i.e., whether they succeed
or fail and to what extent, across distribution shifts. Specifically, our approach uses the ALine-S and
ALine-D techniques from Baek et al. (2022), and applies them to test-time adapted models. The
result is that, without any labeled data at all, we can estimate the accuracy of TTAed models better
than we can for vanilla models, especially for shifts where vanilla falls short (estimation error of
14.22% in vanilla vs. 1.51% after TENT (Wang et al., 2021) on CIFAR10-C Gaussian Noise).
Such estimation results also enable the identification of shifts where TTA methods might potentially
struggle to improve accuracy, such as in ImageNetV2 (Recht et al., 2019). Second, we introduce a
novel variant of the temperature-scaling method, which achieves model calibration solely through
estimated accuracy, representing an unsupervised approach that eliminates the need for labeled data
as required by the original temperature scaling (Guo et al., 2017). We observe that it effectively
reduces the expected calibration error (ECE) (Guo et al., 2017) close to the best achievable lower-
bound using ground-truth labels. Finally, we introduce the reliable hyperparameter optimization
strategy for adaptations without access to labels: selecting model with the highest ID accuracy.
Across all TTA baselines we employ, the majority of models chosen through our approach exhibit
performance comparable to those selected using ground-truth labels, with an accuracy gap of less
than 1% on CIFAR10-C.
To summarize our contributions:
2
0.70.9CIFAR-10 Test0.10.30.50.70.9Gaussian NoiseVanillaAgreement, R2:0.16Accuracy, R2:0.00y=x0.50.70.9CIFAR-10 Test0.30.50.70.9SHOTAgreement, R2:0.84Accuracy, R2:0.850.50.70.9CIFAR-10 Test0.30.50.70.9TENTAgreement, R2:0.93Accuracy, R2:0.910.50.70.9CIFAR-10 Test0.30.50.70.9ETAAgreement, R2:0.95Accuracy, R2:0.950.30.50.70.9ImageNet Test0.10.30.5Gaussian NoiseVanillaAgreement, R2:0.01Accuracy, R2:0.35y=x0.30.50.70.9ImageNet Test0.10.30.50.7SHOTAgreement, R2:0.91Accuracy, R2:0.930.30.50.70.9ImageNet Test0.10.30.50.7TENTAgreement, R2:0.90Accuracy, R2:0.920.10.30.50.70.9ImageNet Test0.10.30.50.7ETAAgreement, R2:0.98Accuracy, R2:0.98Figure 2: Across real-world shifts, such as CIFAR10.1, ImageNetV2, ImageNet-R, and FMoW-
WILDS, the models after TTA maintain their strong linear trends. Notably, this observation also
holds true despite possible accuracy degradation, e.g., on CIFAR10.1 and ImageNetV2 (See Ta-
ble 2).
• We observe that AGL and ACL trends between TTAed models persist or can be stronger
than those before adaptation, and such trends robustly occur across models with different
architectures and TTA setups under both synthetic and real-world shift datasets.
• By leveraging this phenomenon in TTA, we enhance TTA methods in OOD accuracy pre-
dictions, calibration, and reliable hyperparameter tuning-all without the need for labels.
Our methods enhance OOD accuracy estimation for TTAed models across a broader range
of shifts compared to those before adaptations, while also enabling the selection of highly
accurate, well-calibrated models comparable to those using ground-truth labels.
2 STRONG AGREEMENT-ON-THE-LINE AFTER TTA
This section presents the motivating finding of the paper, an empirical study highlighting the fact
that TTAed models often exhibit better AGL than their vanilla counterparts.
2.1 EXPERIMENTAL SETUP
Datasets and models. We evaluate on both synthetic corruptions (CIFAR10-C, CIFAR100-C,
ImageNet-C (Hendrycks & Dietterich, 2019)) with highest severity, datasets reproductions (CI-
FAR10.1 (Recht et al., 2018), CIFAR10.2 (Lu et al., 2020), ImageNetV2 (Recht et al., 2019)),
and real-world shifts (ImageNet-R (Hendrycks et al., 2021), FMoW-WILDS (Christie et al., 2018;
Sagawa et al., 2022)). We leverage a variety of different network architectures, which encompass
ResNet (He et al., 2016; Zagoruyko & Komodakis, 2017), ResNext (Xie et al., 2016), VGG (Si-
monyan & Zisserman, 2015), GoogLeNet (Szegedy et al., 2014), DenseNet (Huang et al., 2017),
and MobileNet (Sandler et al., 2018) with differing depths and widths. For evaluation on ImageNet
and its shifts, we use pretrained weights publicly accessible from torchvision1, except for ConjPL,
which require training with polylos (Leng et al., 2022). We train models for the other datasets.
Test-time adaptation baselines. To gain generality, we test TTA methods that involve differ-
ent update parameters (e.g., batch normalization (BN) layers, entire encoder parameters), objec-
tives (e.g., entropy minimization, self-supervision task), and source-training objectives (e.g., cross-
entropy loss, polyloss). These include BN Adapt (Schneider et al., 2020), SHOT (Liang et al.,
2020), TTT (Sun et al., 2020), TENT (Wang et al., 2021), ConjPL (Goyal et al., 2022), ETA (Niu
et al., 2022), and SAR (Niu et al., 2023). We examine their key adaptation hyperparameters that are
shared among all baselines, including learning rates, number of adapt steps, and batch size. We also
test different checkpoints of the source-trained model as another possible hyperparameter to select.
1https://pytorch.org/vision/stable/models.html
3
0.70.9CIFAR-10 Test0.50.70.9CIFAR-10.1 TestVanillaAgreement, R2:0.85Accuracy, R2:0.89y=x0.70.9CIFAR-10 Test0.50.70.9TENTAgreement, R2:0.90Accuracy, R2:0.900.50.70.9ImageNet Test0.30.50.70.9ImageNetV2 TestVanillaAgreement, R2:0.97Accuracy, R2:0.960.50.70.9ImageNet Test0.30.50.70.9TENTAgreement, R2:0.98Accuracy, R2:0.990.50.70.9ImageNet Test0.10.30.50.70.9ImageNet-R TestVanillaAgreement, R2:0.78Accuracy, R2:0.830.50.70.9ImageNet Test0.10.30.50.70.9TENTAgreement, R2:0.96Accuracy, R2:0.910.30.50.70.9FMoW Test0.10.30.50.70.9FMoW-OOD TestVanillaAgreement, R2:0.97Accuracy, R2:0.960.30.50.70.9FMoW Test0.10.30.50.70.9TENTAgreement, R2:0.93Accuracy, R2:0.91Figure 3: We observe strong AGL and ACL among models adapted with varying values of TTA
setups, including learning rates, the number of adapt steps, batch sizes, and checkpoints of the
source-trained model. We plot the results of TENT-adapted models on CIFAR10-C Gaussian Noise
in the first row, and ETA-adapted models on ImageNet-C Gaussian Noise in the second row. Each
point denote models using different values in each hyperparameter.
Calculating agreement. Given any pair of models (h, h′) ∈ H that are tested on distribution D,
the expected agreement of the models is defined as
Agreement(h, h′) = E
x∼D
where h(x) and h′(x) are final classification outputs of models h and h′ given data x. Follow-
ing Miller et al. (2021) and Baek et al. (2022), we apply the inverse of the cumulative density func-
tion of the standard Gaussian distribution, namely probit-transformation (Φ−1 : [0, 1] → [−∞, ∞]),
on the axes of accuracy and agreement, for a better linear fit.
(cid:2)1{h(x) = h′(x)}(cid:3),
(1)
Additional details on experimental setups are provided in appendix A.1.
2.2 MAIN OBSERVATION
Agreement (and accuracy) on-the-line persists or holds stronger after TTA. We find that after
TTA methods, there are strong correlations in agreement (and accuracy) between ID and OOD across
both synthetic and real-world shifts. Most importantly, we notice that such trends become more
persistent after adaptations, exhibiting strong correlations even across datasets where the models
before adaptations have failed to have, as noted in Miller et al. (2021) and Baek et al. (2022).
We show such phenomenon in Figure 1, when tested on CIFAR10 test vs. Gaussian Noise cor-
ruption, models with different architectures have weak correlations with their coefficients of de-
termination (R2) values being significantly low. After applying various TTA methods, SHOT,
TENT, and ETA, these models consistently have much stronger AGL and ACL (e.g., R2 improves
0.16 → 0.95, 0.00 → 0.95 after ETA), as well as the alignment between the lines. Furthermore,
these linear trends also occur in real-world shifts, where TTA sometimes even fails to improve OOD
accuracy, as shown in Figure 2. Here, we examine on CIFAR10.1, ImageNetV2, and ImageNet-R,
and FMoW-WILDS, where models before and after TENT have similar linear trends and maintain
high R2 values. In particular, as seen in the plots of CIFAR10.1 and ImageNetV2, TENT does not
improve generalization, or even results in degradation (Wang et al., 2021; Zhao et al., 2023). This
highlights the consistent AGL and ACL trends across TTA methods, irrespective of TTA's actual
performance improvement across diverse distribution shifts where it may succeed or falter.
Such linear trends are also observed when varying TTA hyperparameters. We find that these
trends in TTA can also be obtained by leveraging models adapted with varying values of certain
hyperparameters. As mentioned in Section 2.1, we examine learning rates, the number of adaptation
steps, batch size, and the checkpoints of the source-trained model.
Here we fix the model architecture while systematically varying specific hyperparameters within
defined ranges (See appendix A.1). Figure 3 shows that models adapted with different hyperparam-
eter values exhibit strong AGL trends among them, with their R2 values close to 1, when tested on
4
0.10.30.50.70.9CIFAR10 Test0.10.30.50.70.9Gaussian NoiseLearning RateAgreement, R2:1.00Accuracy, R2:1.000.10.30.50.70.9CIFAR10 Test0.10.30.50.70.9Adapt StepAgreement, R2:1.00Accuracy, R2:1.000.10.30.50.70.9CIFAR10 Test0.10.30.50.70.9Batch SizeAgreement, R2:1.00Accuracy, R2:1.000.50.70.9CIFAR10 Test0.30.50.70.9CheckpointAgreement, R2:0.98Accuracy, R2:0.960.10.30.50.70.9ImageNet Test0.10.30.50.70.9Gaussian NoiseLearning RateAgreement, R2:0.91Accuracy, R2:0.990.10.30.50.70.9ImageNet Test0.10.30.50.7Adapt StepAgreement, R2:0.90Accuracy, R2:0.990.10.30.50.70.9ImageNet Test0.10.30.50.70.9Batch SizeAgreement, R2:0.75Accuracy, R2:0.850.10.30.50.70.9ImageNet Test0.10.30.50.70.9CheckpointAgreement, R2:0.95Accuracy, R2:0.92Dataset
CIFAR10-C
CIFAR100-C
ImageNet-C
ImageNet-R
Method ATC DOC-feat
9.26
Vanilla
2.91
SHOT
9.21
TENT
10.18
ETA
1.14
SAR
5.20
Vanilla
4.49
SHOT
19.17
TENT
25.40
ETA
1.85
SAR
4.27
Vanilla
5.83
SHOT
10.92
TENT
6.34
ETA
7.04
SAR
1.72
Vanilla
5.29
SHOT
9.14
TENT
11.71
ETA
3.78
SAR
14.44
5.32
5.32
5.10
4.71
10.42
6.57
6.53
4.10
3.48
13.47
4.46
6.30
5.94
3.86
14.31
12.91
14.94
12.61
9.44
AC
16.74
9.94
10.08
11.02
7.76
14.35
18.34
21.96
28.32
16.68
17.76
9.84
20.25
23.56
11.00
17.74
17.85
24.10
34.12
13.49
Agreement ALine-S ALine-D
5.50
0.73
0.73
0.71
0.89
8.37
0.84
0.82
0.70
0.90
5.87
4.17
4.16
4.00
4.31
7.62
3.22
3.44
2.33
2.82
7.70
1.48
1.51
1.50
1.79
15.07
4.87
5.16
6.18
4.54
22.28
14.74
13.74
13.20
12.27
21.56
17.92
18.30
17.49
16.11
5.17
0.56
0.53
0.56
0.77
8.20
0.69
0.67
1.07
0.77
5.87
4.13
4.18
4.21
5.25
7.62
3.22
3.44
2.17
2.44
Table 1: Mean absolute error (MAE) (%) of the accuracy estimation on TTAed models with different
architectures. ALine-S/D on TTAed models lead to substantially lower errors in accuracy estimation,
compared to ALine-S/D applied on the vanilla models as well as other estimation baselines.
CIFAR10 and ImageNet against their Gaussian Noise corruptions. The resulting TTA performances
vary according to the different hyperparameter values, and they seem sensitive particularly in terms
of learning rates and batch sizes. Still, these results, improved or degraded, lie on the same positive
correlation line in both agreement and accuracy. Such linear trends are of significant practical value
in TTA. Specifically, leveraging models with different architectures necessitates the training of them
separately in advance, while simply using different values of hyperparameters on a single model can
eliminate such unnecessary prerequisites.
3 RELIABLE TEST-TIME ADAPTATION
Based on these observations, we investigate the enhancement of existing TTA methods in three ways:
(i) accurate estimation of OOD accuracy, (ii) calibration after TTA, and (iii) reliable hyperparameter
optimization – all performed without assuming access to the labels.
3.1 ACCURACY ESTIMATION
Algorithm 1 Accurate Estimation of TTA
1: Inputs: Labeled ID data XID, YID, unlabeled OOD
data XOOD, a set of ID-trained n models H =
{hθ, ..., hθ}, sets PID = ∅, POOD = ∅.
In this section, we illustrate how the strong
AGL trend shown among TTAed models en-
ables the precise accuracy estimation on tar-
get OOD data. We employ the estima-
tion methods, ALine-S and ALine-D in Baek
et al. (2022), but utilize them within the
context of TTA models.
Specifically, we
leverage the stronger correlations and align-
ments in agreement and accuracy exhibited
by TTAed models to enhance the effective-
ness of these estimation methods. The de-
tails of our TTA accuracy estimation proce-
dure are described in Algorithm 1. This ap-
proach yields improved accuracy estimation
compared to vanilla models and other estimation baselines (Table 1). More importantly, we demon-
strate the forecastability of TTAed models using the estimated accuracy, across various distribution
shifts (Table 2). Details of ALine-S/D are provided in appendix A.2.
2: Algorithms: TTA objective LTTA(*), ALine-S/D(*).
3:
4: for batch xID, xOOD in XID, XOOD do
5:
6:
7:
8:
9:
10: end for
11: return ALine-S/D(cid:0)PID, YID, POOD
θ ← θ − η∇LTTA(hθ(xOOD)) ▷ Apply TTA
PID = PID ∪ hθ(xID)
POOD = POOD ∪ hθ(xOOD)
for hθ ∈ H do
end for
(cid:1)
5
Dataset
SHOT
TENT
ETA
SAR
GT
Est.
GT
Est.
GT
Est.
GT
Est.
CIFAR10C-Snow
CIFAR100C-Bright
ImageNetC-Gauss
ImageNet-R
CIFAR10.1
CIFAR10.2
ImageNetV2
FMoW-WILDS
+3.94
+6.59
+24.53
+6.94
-2.30
-1.70
-0.27
-0.22
+4.32
+8.28
+13.45
+2.70
-1.51
-1.64
-2.50
-0.73
+4.09
+6.79
+25.79
+6.19
-2.10
-1.80
-1.18
+0.37
+4.45
+8.24
+14.64
+2.52
-1.68
-1.65
-3.42
+1.03
+4.51
7.55
+30.25
+10.35
-2.25
-1.40
-10.34
+0.29
+4.69
+8.72
+22.82
+5.30
-1.33
-0.66
-12.60
+0.70
+2.54
+7.34
+31.28
+8.9
-2.30
-1.90
-0.21
+0.62
+2.80
+8.29
+22.19
+2.44
-1.56
-1.44
-2.40
+0.85
Table 2: Actual (GT) and estimated (Est.) improvement/degradation (%) in OOD accuracy after
applying each TTA method with respect to their base counterparts. The values with green indicate
the improvement, whiled red is the degradation. Our estimations consistently have the same predic-
tions (i.e., colors) on whether TTA methods enhance or diminish accuracy across distribution shifts,
enabling to forecast their generalizations without labeled data.
Strong ACL and AGL in TTA lead to precise accuracy estimation. Table 1 reports the mean
absolute error (MAE) between the actual and the estimated OOD accuracy for both vanilla and
the adapted models using various TTA baselines. We evaluate them on widely used benchmarking
distribution shifts in TTA literature, including CIFAR10-C, CIFAR100-C, ImageNet-C (averaged
over corruptions), and ImageNet-R.
Of particular note is that, especially in CIFAR10-C and CIFAR100-C, applying ALine-S/D on
TTAed models achieve substantially lower MAE compared to that of vanilla models (e.g., 5.17% →
0.53% of ALine-D after TENT on CIFAR10-C). This suggests that application of ALine-S/D can
be significantly more effective in estimating accuracy of the TTAed models, primarily attributed to
their stronger AGL than vanilla models. We also compare them with other estimation baselines,
such as average thresholded confidence (ATC) (Garg et al., 2021), difference of confidence (DOC)-
feat (Guillory et al., 2021), average confidence (Hendrycks & Gimpel, 2017), and agreement (Jiang
et al., 2022). We find that across different datasets, ALine-S and ALine-D consistently outperform
existing baselines on estimating TTA performance.
TTA effectiveness is forecastable given OOD datasets in the wild. Here, we extend to vari-
ous datasets that include common corruptions in CIFAR10-C, CIFAR100-C, ImageNet-C, and real-
world shifts, such as ImageNet-R, CIFAR10.1, CIFAR10.2, ImageNetV2, and FMoW-WILDS. In
Table 2, we present actual and estimated OOD accuracy improvement or degradation by each TTA
baseline, including SHOT, TENT, ETA, and SAR, with respect to their base counterparts. Specifi-
cally, we first obtain the actual (by using ground-truth labels) and estimated OOD accuracy of both
TTAed models and vanilla models, and calculate the differences between them.
We initially observe that TTA methods sometimes fail to enhance generalization under real-world
shifts, e.g., CIFAR10.1, CIFAR10.2 and ImageNetV2, as shown as red in columns of "GT", con-
strated with their effectiveness in synthetic datasets, denoted as green.
Interestingly, the overall
trend of such relative accuracy changes after TTA, represented by red or green, in estimated OOD
accuracy in the "Est." columns closely mirrors that of GT columns. For instance, the generalization
trends of different TTA methods on FMoW-WILDS precisely align with those revealed in the esti-
mated results, i.e., all TTA baselines except SHOT improve accuracy. This underscores the potential
of our accuracy estimation on TTA, which offers practical guidance for selecting or determining the
suitability of TTA methods in the face of distribution shifts from the wild, with no labeled data.
We provide the details of estimation baselines (A.2) as well as additional analysis on accuracy esti-
mation results (A.3, A.4) in appendix.
3.2 UNSUPERVISED CALIBRATION
Proposed method. In this section, we introduce a variant of temperature-scaling (Guo et al., 2017)
that calibrates models only with the estimated accuracy of the model, without any need for labeled
data. Specifically, let X denote the random variable for input data and f (X) be the logit output of the
neural network f given input X for classifying among c categories. We define a simple root-finding
6
Method
CIFAR10-C
Ours
Uncalib.
Oracle Uncalib.
Oracle Uncalib.
CIFAR100-C
Ours
ImageNet-C
Ours
Vanilla
BN Adapt
TENT
ETA
Vanilla∗
ConjPL
17.48
7.99
7.76
7.72
21.80
11.89
9.71
2.73
3.11
3.13
12.99
4.43
3.42
2.49
2.77
2.74
3.96
3.56
15.25
9.59
13.40
15.66
25.70
25.48
15.82
2.85
2.10
4.93
15.66
3.01
3.09
2.37
2.06
4.48
2.90
3.00
14.97
3.21
7.38
12.80
30.32
17.13
7.92
1.98
4.56
8.23
11.63
5.50
Oracle
1.79
1.67
2.94
7.40
2.03
3.84
Table 3: Expected calibration error (ECE) (%) of the vanilla, BN Adapt, TENT, ETA, and ConjPL
without calibration method (named as "Uncalib."), using our method (named as "Ours") and the
oracle lower-bound using ground-truth labels (named as "Oracle"). Vanilla and Vanilla∗ denote
pretrained models with cross-entropy loss and polyloss respectively. After various TTA methods,
our unsupervised calibration method significantly reduces the ECE compared to that of vanilla,
manifesting negligible gap comparable to oracle-bound results.
problem that finds an optimal temperature value τ which scales the model's averaged confidence to
match the estimated accuracy Accest. This can be written as
Find τ such that E
(cid:20)
max
c
softmax
(cid:19)(cid:21)
(cid:18) f (X)
τ
= Accest,
(2)
and we use Newton's method to solve this problem. Once the optimal τ is found, we then
temperature-scale the f (X) using this value to have final prediction probability.
Note that, instead of the negative log-likelihood loss used in the original temperature scaling
method (Guo et al., 2017), our approach minimizes discrepancies between the model's averaged
confidence and accuracy over the entire test set. This formulation bears analogy to the definition
of the ECE metric (Guo et al., 2017), which calculates (a weighted average of) such discrepancies
but within multiple confidence intervals. Our method can be regarded as directly minimizing such
calibration error metric but using a single bin that includes the entire samples. Furthermore, it is
worth noting that the standard temperature scaling methods (Guo et al., 2017) rely on a held-out
labeled validation set for calibration predictions on test data, while our method leverages unlabeled
test data directly for calibration.
Experimental results. In Table 3, we present a comparison of the calibration error between vanilla
and adapted models using various TTA methods, including BN Adapt, TENT, ETA, and ConjPL.
In this experiment, we employ different checkpoints of a source-trained model, one of the hyperpa-
rameters we observed for having strong AGL and ACL (Figure 3). Note that for ConjPL, we use
the pretrained model with polyloss (Leng et al., 2022), thus we have "Vanilla" and "Vanilla∗" to dif-
ferentiate models that are pretrained with cross-entropy and polyloss, respectively. For each model,
we provide ECE values for (i) no calibration, (ii) calibration using our method, and (iii) calibration
using an oracle approach. The "oracle" approach represents the lower-bound of the best achievable
ECE through temperature scaling, where we sweep over the grids of temperature candidates and find
τ that minimizes ECE using ground-truth labels.
The results first demonstrate that adaptations via minimizing entropy can result in worse calibration,
as evidenced by the "Uncalib." results for CIFAR100-C and ImageNet-C. In these cases, TENT,
ETA, and ConjPL lead to an increase in ECE compared to that of BN Adapt. This indicates that
models make overconfident predictions, particularly on samples that are incorrectly classified. This
is mainly attributed to entropy minimization employed in TENT, ETA, and ConjPL, applied across
all samples regardless of their correctness (Prabhu et al., 2021; Rusak et al., 2022; Chen et al., 2022).
After applying our calibration method, however, their calibration errors substantially decrease to
Interestingly, when we
levels close to the lower-bound achieved by the oracle in every dataset.
apply our method to vanilla models, where the presence of AGL and ACL are less pronounced, a
substantial disparity still remains in the calibration results between our method and the lower bound
represented by the oracle. This emphasizes the effectiveness of our unsupervised calibration method
specifically in the setting of TTA where we observe prominent AGL and ACL.
7
HyperParameter
TTA Method
BN Adapt
SHOT
TENT
ETA ConjPL
SAR TTT
Learning Rate
Adapt Step
Architecture
Batch Size
Checkpoints
–
–
0.21
0.0
0.0
0.65
0.23
0.03
0.73
0.07
0.72
0.23
0.03
0.77
0.05
0.72
0.24
0.01
0.77
0.01
0.42
0.12
0.04
0.18
0.11
0.24
0.43
0.20
0.06
0.01
3.71
0.04
0.49
–
0.48
Table 4: Mean Absolute Error (MAE) (%) between accuracies of models selected by our method
vs. ground-truth, tested on the CIFAR10-C dataset. Since BN Adapt do not involve parameter
updates, we exclude learning rate and the adaptation steps. In addition, TTT uses a single batch,
and we exclude the batch size as well. Our analysis demonstrates that across TTA methods, our
hyperparameter selection method consistently identifies hyperparameters that lead to TTAed models
achieving OOD accuracy levels comparable to those selected using ground-truth labels.
3.3 RELIABLE HYPERPARAMETER OPTIMIZATION
Given the ACL phenomena of TTAed models across varying hyperparameter values, as depicted in
Figure 3, selecting the best-performing model on ID data emerges as a straightforward and effective
strategy for model selection in OOD shifts. While this strategy has been acknowledged in a few
prior studies (Miller et al., 2021; Wenzel et al., 2022), our contribution lies in its novel application
for optimizing hyperparameters within the TTA framework. Notably, hyperparameter tuning has
remained a significant challenge even in the most recent TTA studies (Boudiaf et al., 2022; Zhao
et al., 2023), owing to the absence of OOD test data. To find the best hyperparameters, we first
explore a wide range of hyperparameter candidates, by systematically sweeping through various
values for each parameter. Then, we simply select the model that best performs in ID.
Table 4 reports the OOD accuracy gap between the models selected by our approach vs. best-
performing in OOD using ground-truth labels, tested on CIFAR10-C. The results show that across
different corruptions and TTA baselines, selecting the best-performing hyperparameters in ID con-
sistently results in models with high OOD accuracy less than 1% MAE compared to those selected
with labeled data. Even for sensitive hyperparameters, such as learning rates and batch sizes, where
incorrect selections can lead to significant performance degradation (as shown in Figure 3), our ap-
proach consistently identifies near-optimal parameters for different TTA baselines. Still, in TTT
where we vary different learning rates, our method fails to select optimal hyperparameters, resulting
in large MAE. This failure is primarily attributed to the absence of a strong ACL among models us-
ing varying learning rates, which is evidenced by Figure 4. We will discuss this failure case further
in Section 5.
4 RELATED WORK
Test-time adaptation and its pitfalls of reliability Test-time adaptation (TTA) enhances model
robustness by adapting models to unlabeled test data. One research direction uses self-supervision
tasks during both training and testing (Sun et al., 2020; Liu et al., 2021; Gandelsaman et al., 2022),
while another explores "fully" test-time adaptations that require no specific pretraining procedures,
relying on objectives such as entropy minimization (Wang et al., 2021; Niu et al., 2022; 2023),
data augmentation invariance (Zhang et al., 2022; Chen et al., 2022), and self-training with pseudo-
labels (Rusak et al., 2022; Goyal et al., 2022; Wang & Wibisono, 2023).
Some studies have extended their evaluation beyond corruptions to include more challenging shifts,
such as datasets reproductions (Liu et al., 2021; Zhang et al., 2022), domain generalization bench-
marks (Iwasawa & Matsuo, 2021; Zhao et al., 2023), and WILDS (Rusak et al., 2022). Yet, as
pointed out in Zhao et al. (2023), TTA methods may not effectively address the full spectrum of
distribution shifts in the wild. Another persistent issue is that TTA, especially those based on en-
tropy minimization, can lead to overconfident predictions. Specifically, while Nado et al. (2021)
showed that using test-time batch statistics enhances calibration under distribution shifts (Ovadia
et al., 2019), several work (Rusak et al., 2022; Chen et al., 2022) observed that entropy minimiza-
tion diminishes this effect. Moreover, the performance of TTA methods can be severely impacted by
the negligent selection of hyperparameters such as learning rates (Boudiaf et al., 2022; Zhao et al.,
8
2023), adaptation steps (Zhao et al., 2023), or batch sizes (Niu et al., 2023; Khurana et al., 2022).
A recent study (Boudiaf et al., 2022) addresses this issue by adapting only the model's outputs in-
stead of its parameters. Our study leverages the remarkable observation of the agreement-on-the-line
phenomena within TTA, offering promising solutions to these reliability issues.
Accuracy and agreement-on-the-line As mentioned above, the basic accuracy-on-the-line and
agreement-on-the-line phenomena were first identified in Miller et al. (2021) and Baek et al. (2022)
respectively. However, the underlying reason for such phenomenon remain unclear, and certain
datasets reveal weak accuracy and agreement-on-the-line trends, as observed in CIFAR10 test vs.
Gaussian Noise corruption in CIFAR10-C. Recent work (Wenzel et al., 2022; Teney et al., 2023;
Liang et al., 2023) have investigated the broader types of distribution shifts, identifying shifts that
show different trends beyond the linear correlations.
In this study, we investigate the impact of
model adaptation on reinforcing (or maintaining) linear correlations, and identify novel conditions
that lead to such trends–adapting with varying TTA hyperparameters.
5 LIMITATIONS
Even though we consistently observe the linear
trends across various models and distribution
shifts during TTA, we also find an exceptional
case where such trends do not manifest. As
shown in Figure 4 right, we empirically observe
that varying learning rates in TTT (Sun et al.,
2020) exhibits that the ID and OOD accuracies
are negatively correlated, leading to a complete
misalignment with the agreement line. While
in other experimental setups, such as using dif-
ferent architectures, we still observe the strong
AGL and ACL among the models, as shown in
Figure 4 left. Such negative correlation results
in the accuracy of the models selected using our
method, i.e., best-performing ID accuracy, suf-
fer significant deviation from the best-performing OOD accuracy, as shown in Table 4.
Figure 4: Compared to the adapted models
with varying architectures, using learning rates in
TTT (Sun et al., 2020) shows negative correlation
in accuracy, resulting in misalignment between
agreement and accuracy lines.
6 CONCLUSION AND DISCUSSIONS
In this work, we observe that adapting models during test time maintains or even reinforces the
strong linear ID vs. OOD correlations in their accuracy and agreement, across models and dis-
tributions. Such observations motivate us to enhance the TTA methods' reliability in surprisingly
simple but effective ways, specifically in three perspectives: accurate performance estimation of
TTA methods, calibration of confidence in TTAed models, and reliable hyperparameter tuning, all
without need for labels. We conduct extensive experiments across distribution shifts, TTA baselines
and their hyperparameters, and demonstrate the effective estimation of the TTAed models' perfor-
mances. We then forecast their successes (as well as their possible failures) of generalization under
various shifts including real-world datasets. Moreover, we perform model calibration and reliable
hyperparameter optimization, achieving results comparable to the level of those assuming access to
the ground-truth labels.
Our results show that existing adaptation strategies under distribution shifts lead to strong AGL
and ACL linear trends. This naturally raises questions about how to theoretically characterize the
conditions under which adaptations enhance these linear trends. We believe this is a promising
future research directions that can ascertain the reliable observations of AGL, leading to reliable
TTA across any types of distribution shifts. Additionally, we recognize that, to observe AGL and
ACL, access to ID test data (and its labels for ACL) is required. This might raise privacy concerns
due to the potential inclusion of sensitive information, and also demand additional computational
resources. Therefore, overcoming such dependencies on ID data and exploring "fully" test-time
approach of observing AGL and ACL remain promising directions for future research.
9
0.70.9CIFAR10 Test0.70.9Gaussian NoiseArchitectureAgreement, R2:0.91Accuracy, R2:0.860.70.9CIFAR10 Test0.50.70.9Learning RateAgreement, R2:0.86Accuracy, R2:0.64Acknowledgments. Eungyeup Kim and Mingjie Sun are supported by funding from the Bosch
Center for Artificial Intelligence. Aditi Raghunathan gratefully acknowledges support from Open
Philanthropy, Google, Apple and Schmidt AI2050 Early Career Fellowship.
REFERENCES
Martin Arjovsky, L ́eon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization,
2020. 1
Christina Baek, Yiding Jiang, Aditi Raghunathan, and J. Zico Kolter. Agreement-on-the-line: Pre-
dicting the performance of neural networks under distribution shift. In Advances in Neural Infor-
mation Processing Systems, volume 35, pp. 19274–19289, 2022. 1, 2, 4, 5, 9, 14
Malik Boudiaf, Romain Mueller, Ismail Ben Ayed, and Luca Bertinetto. Parameter-free online test-
time adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern
Recognition (CVPR), pp. 8344–8353, June 2022. 1, 8, 9
Dian Chen, Dequan Wang, Trevor Darrell, and Sayna Ebrahimi. Contrastive test-time adaptation. In
CVPR, 2022. 1, 7, 8
Gordon Christie, Neil Fendley, James Wilson, and Ryan Mukherjee. Functional map of the world.
In CVPR, 2018. 3
Cian Eastwood, Ian Mason, Christopher K. I. Williams, and Bernhard Sch ̈olkopf. Source-free adap-
In International Conference on
tation to measurement shift via bottom-up feature restoration.
Learning Representations, 2022. 1
Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimiza-
tion for efficiently improving generalization. In International Conference on Learning Represen-
tations, 2021. 13
Yossi Gandelsaman, Yu Sun, Xinlei Chen, and Alexei A. Efros. Test-time training with masked
autoencoders. In Advances in Neural Information Processing Systems, 2022. 1, 8
Saurabh Garg, Sivaraman Balakrishnan, Zachary Chase Lipton, Behnam Neyshabur, and Hanie
Sedghi. Leveraging unlabeled data to predict out-of-distribution performance. In NeurIPS 2021
Workshop on Distribution Shifts: Connecting Methods and Applications, 2021. 6, 14
Sachin Goyal, Mingjie Sun, Aditi Raghunanthan, and Zico Kolter. Test-time adaptation via conju-
gate pseudo-labels. Advances in Neural Information Processing Systems, 2022. 1, 3, 8, 13
Devin Guillory, Vaishaal Shankar, Sayna Ebrahimi, Trevor Darrell, and Ludwig Schmidt. Predicting
with confidence on unseen distributions. In Proceedings of the IEEE/CVF International Confer-
ence on Computer Vision (ICCV), pp. 1134–1144, October 2021. 6, 14
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In International
Conference on Learning Representations, 2021. 1
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural
networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70
of Proceedings of Machine Learning Research, pp. 1321–1330. PMLR, 06–11 Aug 2017. 2, 6, 7
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image
Recognition. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recog-
nition, CVPR '16, pp. 770–778. IEEE, June 2016. doi: 10.1109/CVPR.2016.90. 3, 13
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common cor-
ruptions and perturbations. Proceedings of the International Conference on Learning Represen-
tations, 2019. 3, 13
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution
examples in neural networks. Proceedings of International Conference on Learning Representa-
tions, 2017. 6, 14
10
Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul
Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer.
The many faces of robustness: A critical analysis of out-of-distribution generalization. ICCV,
2021. 3, 13
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q Weinberger. Densely connected
convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern
Recognition, 2017. 3, 13
Yusuke Iwasawa and Yutaka Matsuo. Test-time classifier adjustment module for model-agnostic
domain generalization. In Advances in Neural Information Processing Systems, volume 34, pp.
2427–2440. Curran Associates, Inc., 2021. 1, 8
Yiding Jiang, Vaishnavh Nagarajan, Christina Baek, and J Zico Kolter. Assessing generalization of
SGD via disagreement. In International Conference on Learning Representations, 2022. 6, 14
Ansh Khurana, Sujoy Paul, Piyush Rai, Soma Biswas, and Gaurav Aggarwal. Sita: Single image
test-time adaptation, 2022. 9
Zhaoqi Leng, Mingxing Tan, Chenxi Liu, Ekin Dogus Cubuk, Jay Shi, Shuyang Cheng, and
Dragomir Anguelov. Polyloss: A polynomial expansion perspective of classification loss func-
tions. In International Conference on Learning Representations, 2022. 3, 7
Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? source
hypothesis transfer for unsupervised domain adaptation. In International Conference on Machine
Learning (ICML), pp. 6028–6039, 2020. 1, 3, 13
Weixin Liang, Yining Mao, Yongchan Kwon, Xinyu Yang, and James Zou. Accuracy on the curve:
On the nonlinear correlation of ml performance between data subpopulations, 2023. 9
Yuejiang Liu, Parth Kothari, Bastien Germain van Delft, Baptiste Bellot-Gurlet, Taylor Mordan,
and Alexandre Alahi. Ttt++: When does self-supervised test-time training fail or thrive?
In
Thirty-Fifth Conference on Neural Information Processing Systems, 2021. 1, 8, 13
Shangyun Lu, Bradley Nott, Aaron Olson, Alberto Todeschini, Hossein Vahabi, Yair Carmon, and
Ludwig Schmidt. Harder or different? a closer look at distribution shift in dataset reproduction.
In ICML Workshop on Uncertainty and Robustness in Deep Learning, 2020. 3, 13
John P Miller, Rohan Taori, Aditi Raghunathan, Shiori Sagawa, Pang Wei Koh, Vaishaal Shankar,
Percy Liang, Yair Carmon, and Ludwig Schmidt. Accuracy on the line: on the strong corre-
lation between out-of-distribution and in-distribution generalization. In Proceedings of the 38th
International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning
Research, pp. 7721–7735. PMLR, 18–24 Jul 2021. 2, 4, 8, 9, 13
Zachary Nado, Shreyas Padhy, D. Sculley, Alexander D'Amour, Balaji Lakshminarayanan, and
Jasper Snoek. Evaluating prediction-time batch normalization for robustness under covariate
shift, 2021. 8
Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Yaofo Chen, Shijian Zheng, Peilin Zhao, and Mingkui
Tan. Efficient test-time model adaptation without forgetting. In The Internetional Conference on
Machine Learning, 2022. 1, 3, 8, 13
Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Zhiquan Wen, Yaofo Chen, Peilin Zhao, and Mingkui
Tan. Towards stable test-time adaptation in dynamic wild world. In Internetional Conference on
Learning Representations, 2023. 1, 3, 8, 9, 13
Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, D. Sculley, Sebastian Nowozin, Joshua Dillon,
Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating
predictive uncertainty under dataset shift. In Advances in Neural Information Processing Systems,
volume 32. Curran Associates, Inc., 2019. 8
Viraj Prabhu, Shivam Khare, Deeksha Kartik, and Judy Hoffman. Sentry: Selective entropy opti-
mization via committee consistency for unsupervised domain adaptation. In Proceedings of the
IEEE/CVF International Conference on Computer Vision, pp. 8558–8567, 2021. 7
11
Benjamin Recht, Rebecca Roelofs, Ludwig Schimidt, and Vaishaal Shankar. Do cifar-10 classifiers
generalize to cifar-10? arXiv preprint arXiv: 1806.00451, 2018. 3, 13
Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do ImageNet classifiers
generalize to ImageNet? In Proceedings of the 36th International Conference on Machine Learn-
ing, volume 97 of Proceedings of Machine Learning Research, pp. 5389–5400. PMLR, 09–15
Jun 2019. 2, 3, 13
Evgenia. Rusak, Steffen Schneider, George Pachitariu, Luisa Eck, Peter Gehler, Oliver Bringmann,
Wieland Brendel, and Matthias Bethge. If your data distribution shifts, use self-learning. Trans-
actions of Machine Learning Research, 2022. 1, 7, 8
Shiori Sagawa, Pang Wei Koh, Tony Lee, Irena Gao, Sang Michael Xie, Kendrick Shen, Ananya
Kumar, Weihua Hu, Michihiro Yasunaga, Henrik Marklund, Sara Beery, Etienne David, Ian
Stavness, Wei Guo, Jure Leskovec, Kate Saenko, Tatsunori Hashimoto, Sergey Levine, Chelsea
Finn, and Percy Liang. Extending the wilds benchmark for unsupervised adaptation. In Interna-
tional Conference on Learning Representations (ICLR), 2022. 1, 3, 13
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mo-
bilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on
Computer Vision and Pattern Recognition (CVPR), June 2018. 3, 13
Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias
Bethge.
In
Advances in Neural Information Processing Systems, volume 33, pp. 11539–11551. Curran As-
sociates, Inc., 2020. 1, 3, 13
Improving robustness against common corruptions by covariate shift adaptation.
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image
recognition. In International Conference on Learning Representations, 2015. 3, 13
Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, and Moritz Hardt. Test-time
training with self-supervision for generalization under distribution shifts. In International Con-
ference on Machine Learning (ICML), 2020. 1, 3, 8, 9, 13
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Du-
mitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions,
2014. 3
Damien Teney, Yong Lin, Seong Joon Oh, and Ehsan Abbasnejad.
sometimes inversely correlated on real-world datasets, 2023. 9
Id and ood performance are
Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully
test-time adaptation by entropy minimization. In International Conference on Learning Repre-
sentations, 2021. 1, 2, 3, 4, 8, 13
Jun-Kun Wang and Andre Wibisono. Towards understanding gd with hard and conjugate pseudo-
labels for test-time adaptation. In Internetional Conference on Learning Representations, 2023.
8
Florian Wenzel, Andrea Dittadi, Peter V. Gehler, Carl-Johann Simon-Gabriel, Max Horn, Dominik
Zietlow, David Kernert, Chris Russell, Thomas Brox, Bernt Schiele, Bernhard Sch ̈olkopf, and
Francesco Locatello. Assaying out-of-distribution generalization in transfer learning. In Neural
Information Processing Systems, 2022. 8, 9
Saining Xie, Ross Girshick, Piotr Doll ́ar, Zhuowen Tu, and Kaiming He. Aggregated residual trans-
formations for deep neural networks. arXiv preprint arXiv:1611.05431, 2016. 3, 13
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks, 2017. 3, 13
Marvin Zhang, Sergey Levine, and Chelsea Finn. MEMO: Test time robustness via adaptation and
augmentation. In Advances in Neural Information Processing Systems, 2022. 1, 8
Hao Zhao, Yuejiang Liu, Alexandre Alahi, and Tao Lin. On pitfalls of test-time adaptation.
In
International Conference on Machine Learning (ICML), 2023. 1, 4, 8, 9, 13
12
A APPENDIX
A.1 EXPERIMENTAL SETUP
This section provides the experimental details used throughout the paper, including distribution
shifts, network architectures, and adaptation setups.
Distribution shifts. We test the models on 8 different distribution shifts that include synthetic
corruptions and real-world shifts. Synthetic corruptions datasets, CIFAR10-C, CIFAR100-C, and
ImageNet-C (Hendrycks & Dietterich, 2019) are designed to apply the 15 different types of cor-
ruptions, such as Gaussian Noise, on their original dataset counterparts. We use the most severe
corruptions, which have severity of 5, in all experiments. These corruptions datasets are most com-
monly evalutated distribution shifts in a wide range of TTA papers (Schneider et al., 2020; Sun et al.,
2020; Liu et al., 2021; Liang et al., 2020; Wang et al., 2021; Goyal et al., 2022; Niu et al., 2022;
2023; Zhao et al., 2023).
We also test on real-world shifts, which include CIFAR10.1 (Recht et al., 2018), CIFAR10.2 (Lu
et al., 2020), ImageNetV2 (Recht et al., 2019), ImageNet-R (Hendrycks et al., 2021), and FMoW-
WILDS (Sagawa et al., 2022). CIFAR10.1, CIFAR10.2, and ImageNetV2 are the reproduced
datasets of their base counterparts by following the original dataset creation procedures. ImageNet-
R is the variant of ImageNet which contains the images with renditions of various styles, such as
paintings or cartoons. FMoW-WILDS (Sagawa et al., 2022) contains the spatio-temporal satellite
imagery of 62 different use of land or building categories, where distribution shifts originate from
the years that the imagery is taken. Specifically, following Miller et al. (2021), we use ID set consists
of images taken from 2002 to 2013, and OOD set taken between 2013 and 2016.
Network architectures. We use a different set of the network architectures for specific datasets
and their shifts in Sections 2 and 3.1. Specifically, for CIFAR10 and CIFAR100 vs.
their
OOD shifts, we use ResNet-18,26,34,50,101 (He et al., 2016), WideResNet-28-10 (Zagoruyko
& Komodakis, 2017), MobileNetV2 (Sandler et al., 2018), VGG11,13,16,19 (Simonyan & Zis-
serman, 2015). For ImageNet and FMoW-WILDS vs.
their OOD shifts, we leverage ResNet-
18,34,50,101,152, WideResNet-50,101, DenseNet121 (Huang et al., 2017), ResNeXt50-32x4d (Xie
et al., 2016). As mentioned in Section 2.1, we use the pretrained model weights from torchvision,
except for TTT (Sun et al., 2020) and ConjPL (Goyal et al., 2022). In addition, since TTT requires
the rotation-prediction task during pretraining on source data, we train them ourselves using ResNet-
14,26,32,50,104, and 152, which are available in their original implementation2 and use them for
Section 3.3. For Figure 3 and Tables 2, 3, and 4, we use the default network architecture, which is
ResNet-26 for CIFAR10 and CIFAR100, and ResNet-50 for ImageNet and FMoW.
Optimizer and learning rates. We use SGD optimizer with momentum of 0.9 for all TTA base-
lines except for SAR, which uses sharpness-aware minimization (SAM) optimizer (Foret et al.,
2021). For Tables 1, 4, and Figure 3, we adapt the models adapted with different learning rates.
Specifically, for Table 1, we evaluate the models with different architectures but adapted with the
same learning rates, and then we average their estimation results across learning rates. For Ta-
ble 4 and Figure 3, we evaluate the models (with same architecture) adapted with different learn-
ing rates, and observe the linear trends. For these experiments, we sweep over in the grid of
{10−4, 2 * 10−4, 5 * 10−4, 10−3, 2 * 10−3, 5 * 10−3, 10−2} for CIFAR10, CIFAR100, and their OOD
shifts, while using {5 * 10−5, 10−4, 2 * 10−4, 5 * 10−4, 10−3, 2 * 10−3, 5 * 10−3} for ImageNet and
their OOD counterparts. For Figures 1, 2 and Tables 2, 3, we use the fixed learning rates of 10−3 for
CIFAR10, CIFAR100 and their OOD counterparts, and 2.5 * 10−4 for ImageNet, FMoW and their
counterparts.
Batch sizes.
In Figure 3 and Table 4, we test a wide spectrum of different values of batch sizes,
by sweeping over the grid of {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}. For the rest of the experiments,
we fix the batch size of 128 for TTA on CIFAR10, CIFAR100 and their OOD, and 64 on ImageNet,
FMoW for their OOD. Note that for TTT, we use a single batch following the original paper setup.
2https://github.com/yueatsprograms/ttt cifar release
13
Algorithm 2 ALine-S and ALine-D
1: Input: ID predictions PID and labels YID, OOD predictions POOD.
2: Function: Probit transform Φ−1(*), Linear regression F(*).
3:
4: ˆa, ˆb = F(Φ−1(Agr(PID)), Φ−1(Agr(POOD)))
OOD = Φ(ˆa * Acc(PID, yID) + ˆb)
5: (cid:100)Acc
6: Initialize A ∈ R n(n−1)
7: i=0
8: for (pj,ID, pk,ID), (pj,OOD, pk,OOD) ∈ PID, POOD do
9:
2 ×n, b = R n(n−1)
S
2
2 , Aik = 1
Aij = 1
bi = Φ−1(Agr(pj,OOD, pk,OOD))+ ˆa*(cid:0) Φ−1(Acc(pj,ID,yID)+Φ−1(Acc(pk,ID,yID))
i=i+1
2 , Ail = 0∀l /∈ j, k
2
10:
11:
12: end for
13: w∗ = arg minw∈Rn ||Aw − b||2
14: (cid:100)Acc
15: return (cid:100)Acc
D
OOD = Φ(w∗
S
OOD, (cid:100)Acc
i )∀i ∈ [n]
D
OOD
2
▷ Estimate slope and bias of linear fit
▷ ALine-S
−Φ−1(Agr(pj,ID, pk,ID))(cid:1)
▷ ALine-D
Number of adapt steps.
In Figure 3 and Table 4, we sweep through one to five adaptation steps for
every TTA baseline we use. For the rest of the experiments, we use a single step of the adaptations.
We utilize the online adaptation (i.e., no initialization for each batch) strategy for all baselines.
A.2 OOD ACCURACY ESTIMATION METHODS
ALine-S and ALine-D Baek et al. (2022) propose ALine-S and ALine-D, which assess the mod-
els' OOD accuracy without access to labels by leveraging the agreement-on-the-line among models.
We provide the detailed algorithm of ALine-S and ALine-D in Algorithm 2.
Average thresholded confidence (ATC) Garg et al. (2021) introduce OOD accuracy estimation
method, ATC, which learns the confidence threshold and predicts the OOD accuracy by using the
fraction of unlabeled OOD samples for which model's negative entropy is less that threshold. Specif-
ically, let h(x) ∈ Rc denote the softmax output of model h given data x from XOOD for classifying
among c classes. The method can be written as below:
(cid:100)AccOOD = E (cid:2)1{s(h(x)) < t}(cid:3),
where s is the negative entropy, i.e., s(h(x)) = (cid:80)
c hc(x) log(hc(x)), and t satisfies
E (cid:2)1{s(h(x)) < t}(cid:3) = E (cid:2)1(cid:8) arg max
c
hc(x) ̸= y(cid:9)(cid:3).
(3)
(4)
Difference of confidence (DOC)-feat Guillory et al. (2021) observe that the shift of distributions
is encoded in the difference of model's confidences between them. Based on this observation, they
leverage such differences in confidences as the accuracy gap under distribution shifts for calculating
the final OOD accuracy. Specifically,
(cid:100)AccOOD = AccID −
(cid:18)
E (cid:2) max
c
hc(xID)(cid:3) − E (cid:2) max
c
(cid:19)
hc(xOOD)(cid:3)
(5)
Average confidence (AC) Hendrycks & Gimpel (2017) estimate the OOD accuracy based on
model's averaged confidence, which can be written as
(cid:100)AccOOD = E (cid:2) max
h(xOOD)(cid:3).
(6)
c
Agreement
Jiang et al. (2022) observe that disagreement between the models that are trained with
different setups closely tracks the error of models in ID. We adopt this as the baseline for assessing
generalization under distribution shifts, where we can estimate (cid:100)AccOOD = Agr(POOD), where POOD
denotes the set of predictions of the models on OOD data XOOD.
14
Figure 5: Comparison of GT vs. estimated OOD accuracy of vanilla and TTAed models under real-
world shifts. Each pink dot represents vanilla, blue the TENT, orange the ETA, and gray the SAR
results. The dotted y = x line denotes the perfect estimation line, where the closer dots are located
to the line, the more accurate the estimations are.
Figure 6: Distribution of MAE of accuracy estimation over different number of models. We test
models adapted with different TTA setups. The results on first row are those adapted by TENT on
CIFAR10-C Gaussian Noise, and those on second row are adapted by ETA on ImageNet-C Gaussian
Noise.
A.3 ACCURACY ESTIMATION RESULTS ON REAL-WORLD SHIFTS.
Given the strong AGL and ACL trends that persist under real-world shifts (Figure 2), we demonstrate
the estimation results of the TTAed models' OOD accuracy by comparing them with the ground-
truth accuracy on such shifts. In Figure 5, we compare the estimated and ground-truth OOD accuracy
of vanilla and the adapted models using TENT, ETA, and SAR. It shows that their accuracies can
be closely estimated to the actual accuracies (i.e., closer to y = x) on CIFAR10.1, ImageNetV2,
ImageNet-R, and FMoW-WILDS. In particular, as shown in ImageNetV2 and ImageNet-R, the
estimation results of TTAed models are located closer to y = x than those of vanilla, indicating
TTAed models' accurate estimation performances compared to those of vanilla models.
A.4 ANALYSIS ON THE NUMBER OF TTAED MODELS FOR ACCURATE ESTIMATION.
In this section, we investigate how the accuracy estimation of test-time adapted model's perfor-
mances change as we vary the number of the models used in estimation. To this end, we examine
the models with different architectures as well as the hyperparameters examined in Section 3.3,
which include learning rates, batch sizes, and the checkpoints of the source-trained models. We
vary the size of models, n, and for each size, we calculate all possible sets of models' estimation
error.
Figure 6 illustrates the changes of the distributions of the estimation error (MAE) with respect to
the number of models used for implementing AGL and ACL. We test TENT on CIFAR10 test vs.
ImageNet-C Gaussian Noise. We
CIFAR10-C Gaussian Noise, and ETA on ImageNet test vs.
observe that even using the minimum number of models for estimation, which is three, the estimation
results achieve the low MAE, particularly when using different architectures or the checkpoints of
the source-trained models. In addition, we note the rapid decrease in MAE is easily attainable by
adding only a small number of additional models, which is pronounced when using learning rates
15
0.70.9GT OOD Acc0.9Est. OOD AccCIFAR-10.1vanillatentetasary=x0.50.7GT OOD Acc0.50.7ImageNetV2vanillatentetasar0.30.5GT OOD Acc0.5ImageNet-Rvanillatentetasar0.5GT OOD Acc0.5FMoW-WILDSvanillatentetasar3456789101112Number of Models1.01.52.02.53.0MAE (%)ArchitectureALine-SALine-D345678910Number of Models0510152025Learning RateALine-SALine-D3456789Number of Models1234Batch SizeALine-SALine-D345678910Number of Models0.250.500.751.001.251.50CheckpointALine-SALine-D3456789Number of Models1234MAE (%)ArchitectureALine-SALine-D34567Number of Models2.55.07.510.012.515.0Learning RateALine-SALine-D345678Number of Models0246810Batch SizeALine-SALine-D345678910Number of Models02468CheckpointALine-SALine-Dor batch size (in ImageNet-C). These results indicate that during TTA, accurate estimation of OOD
accuracy can be achieved with a reasonable number of models, each with different hyperparameter
values, thereby offering practical feasibility during testing.
A.5 ADDITIONAL EXPERIMENTAL RESULTS
Strong ACL and AGL after TTA.
In this section, we supplement the Section 2 by providing
additional results of TTAed models exhibiting strong AGL and ACL linear trends across datasets
and TTA methods. Specifically, in Figures 7 and 8, we provide the results of SHOT, TENT, ETA,
and SAR comparing with those of vanilla, across every corruption types of CIFAR10-C with highest
severity. The axes are probit-scaled, and each blue and pink dot represent the accuracy and agree-
ment of the model, respectively. In Figure 9, we add the results on CIFAR10.2 along with other
TTA methods' results on the real-world shifts to supplement the Figure 2. We consistently observe
that AGL and ACL consistently persist or even become stronger than vanilla models, when apply-
ing various TTA methods across distribution shifts, evidenced by the high R2 values in most of the
cases.
16
Figure 7: Additional results across every corruption types of CIFAR10-C, where models after TTA
show strong AGL and ACL than vanilla models.
17
0.70.9CIFAR-10 Test0.10.30.50.70.9Gaussian NoiseVanillaAgreement, R2:0.09Accuracy, R2:0.07y=x0.50.70.9CIFAR-10 Test0.30.50.70.9SHOTAgreement, R2:0.77Accuracy, R2:0.660.50.70.9CIFAR-10 Test0.30.50.70.9TENTAgreement, R2:0.80Accuracy, R2:0.680.50.70.9CIFAR-10 Test0.30.50.70.9ETAAgreement, R2:0.94Accuracy, R2:0.900.50.70.9CIFAR-10 Test0.50.70.9SARAgreement, R2:0.54Accuracy, R2:0.370.70.9CIFAR-10 Test0.10.30.50.70.9Shot NoiseAgreement, R2:0.10Accuracy, R2:0.05y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.82Accuracy, R2:0.720.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.84Accuracy, R2:0.750.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.89Accuracy, R2:0.890.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.65Accuracy, R2:0.570.70.9CIFAR-10 Test0.10.30.50.70.9Impulse NoiseAgreement, R2:0.19Accuracy, R2:0.16y=x0.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.86Accuracy, R2:0.750.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.92Accuracy, R2:0.750.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.91Accuracy, R2:0.880.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.68Accuracy, R2:0.530.70.9CIFAR-10 Test0.50.70.9Defocus BlurAgreement, R2:0.91Accuracy, R2:0.94y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.95Accuracy, R2:0.940.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.940.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.91Accuracy, R2:0.930.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.930.70.9CIFAR-10 Test0.30.50.70.9Glass BlurAgreement, R2:0.00Accuracy, R2:0.64y=x0.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.85Accuracy, R2:0.690.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.76Accuracy, R2:0.540.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.94Accuracy, R2:0.930.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.85Accuracy, R2:0.700.70.9CIFAR-10 Test0.50.70.9Motion BlurAgreement, R2:0.57Accuracy, R2:0.01y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.93Accuracy, R2:0.960.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.86Accuracy, R2:0.900.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.95Accuracy, R2:0.960.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.93Accuracy, R2:0.910.70.9CIFAR-10 Test0.50.70.9Zoom blurAgreement, R2:0.83Accuracy, R2:0.81y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.90Accuracy, R2:0.940.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.88Accuracy, R2:0.890.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.950.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.93Accuracy, R2:0.94Figure 8: Additional results across every corruption types of CIFAR10-C, where models after TTA
show strong AGL and ACL than vanilla models.
18
0.70.9CIFAR-10 Test0.50.70.9SnowVanillaAgreement, R2:0.74Accuracy, R2:0.66y=x0.50.70.9CIFAR-10 Test0.50.70.9SHOTAgreement, R2:0.92Accuracy, R2:0.920.50.70.9CIFAR-10 Test0.50.70.9TENTAgreement, R2:0.94Accuracy, R2:0.910.50.70.9CIFAR-10 Test0.50.70.9ETAAgreement, R2:0.96Accuracy, R2:0.960.70.9CIFAR-10 Test0.50.70.9SARAgreement, R2:0.95Accuracy, R2:0.940.70.9CIFAR-10 Test0.50.70.9FrostAgreement, R2:0.39Accuracy, R2:0.24y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.950.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.88Accuracy, R2:0.920.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.98Accuracy, R2:0.980.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.91Accuracy, R2:0.910.70.9CIFAR-10 Test0.30.50.70.9FogAgreement, R2:0.71Accuracy, R2:0.54y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.900.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.900.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.91Accuracy, R2:0.920.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.91Accuracy, R2:0.860.70.9CIFAR-10 Test0.50.70.9BrightnessAgreement, R2:0.91Accuracy, R2:0.88y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.93Accuracy, R2:0.960.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.94Accuracy, R2:0.950.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.97Accuracy, R2:0.960.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.96Accuracy, R2:0.970.70.9CIFAR-10 Test0.10.30.50.70.9ContrastAgreement, R2:0.77Accuracy, R2:0.51y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.92Accuracy, R2:0.920.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.89Accuracy, R2:0.860.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.91Accuracy, R2:0.900.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.89Accuracy, R2:0.870.70.9CIFAR-10 Test0.50.70.9Elastic TransformAgreement, R2:0.45Accuracy, R2:0.00y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.86Accuracy, R2:0.710.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.75Accuracy, R2:0.650.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.93Accuracy, R2:0.890.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.78Accuracy, R2:0.910.70.9CIFAR-10 Test0.30.50.70.9PixelateAgreement, R2:0.22Accuracy, R2:0.16y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.90Accuracy, R2:0.930.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.85Accuracy, R2:0.920.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.96Accuracy, R2:0.970.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.97Accuracy, R2:0.970.70.9CIFAR-10 Test0.50.70.9Jpeg CompressionAgreement, R2:0.29Accuracy, R2:0.30y=x0.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.74Accuracy, R2:0.540.50.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.83Accuracy, R2:0.730.50.70.9CIFAR-10 Test0.30.50.70.9Agreement, R2:0.90Accuracy, R2:0.840.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.51Accuracy, R2:0.05Figure 9: Additional TTA baselines' results under real-world shifts, CIFAR10.1, CIFAR10.2, Ima-
geNetV2, ImageNet-R, and FMoW-WILDS, where models after TTA persist strong AGL and ACL.
19
0.70.9CIFAR-10 Test0.70.9CIFAR-10.1VanillaAgreement, R2:0.85Accuracy, R2:0.89y=x0.70.9CIFAR-10 Test0.70.9SHOTAgreement, R2:0.83Accuracy, R2:0.810.70.9CIFAR-10 Test0.70.9TENTAgreement, R2:0.82Accuracy, R2:0.810.70.9CIFAR-10 Test0.70.9ETAAgreement, R2:0.77Accuracy, R2:0.800.70.9CIFAR-10 Test0.50.70.9SARAgreement, R2:0.90Accuracy, R2:0.890.70.9CIFAR-10 Test0.50.70.9CIFAR-10.2Agreement, R2:0.77Accuracy, R2:0.910.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.80Accuracy, R2:0.660.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.79Accuracy, R2:0.700.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.82Accuracy, R2:0.720.70.9CIFAR-10 Test0.50.70.9Agreement, R2:0.83Accuracy, R2:0.840.50.70.9ImageNet Test0.30.50.70.9ImageNetV2Agreement, R2:0.97Accuracy, R2:0.960.50.70.9ImageNet Test0.30.50.70.9Agreement, R2:0.97Accuracy, R2:0.990.50.70.9ImageNet Test0.30.50.70.9Agreement, R2:0.98Accuracy, R2:0.990.50.70.9ImageNet Test0.30.50.70.9Agreement, R2:0.98Accuracy, R2:0.990.50.70.9ImageNet Test0.30.50.70.9Agreement, R2:0.98Accuracy, R2:0.990.50.70.9ImageNet Test0.10.30.50.7ImageNet-RAgreement, R2:0.78Accuracy, R2:0.830.50.70.9ImageNet Test0.10.30.50.7Agreement, R2:0.94Accuracy, R2:0.900.50.70.9ImageNet Test0.10.30.50.70.9Agreement, R2:0.95Accuracy, R2:0.900.50.70.9ImageNet Test0.10.30.50.70.9Agreement, R2:0.96Accuracy, R2:0.910.50.70.9ImageNet Test0.10.30.50.7Agreement, R2:0.86Accuracy, R2:0.810.30.50.70.9FMoW Test0.30.50.7FMoW-OODAgreement, R2:0.97Accuracy, R2:0.960.30.50.7FMoW Test0.30.50.7Agreement, R2:0.94Accuracy, R2:0.940.30.50.7FMoW Test0.30.50.7Agreement, R2:0.95Accuracy, R2:0.950.30.50.7FMoW Test0.30.50.7Agreement, R2:0.93Accuracy, R2:0.910.30.50.7FMoW Test0.30.50.7Agreement, R2:0.96Accuracy, R2:0.95 |
|
http://arxiv.org/abs/2310.04935v1 | "2023-10-07T22:35:26" | "2023-10-07T22:35:26" | Statistical Guarantees for Variational Autoencoders using PAC-Bayesian
Theory | Since their inception, Variational Autoencoders (VAEs) have become central in
machine learning. Despite their widespread use, numerous questions regarding
their theoretical properties remain open. Using PAC-Bayesian theory, this work
develops statistical guarantees for VAEs. First, we derive the first
PAC-Bayesian bound for posterior distributions conditioned on individual
samples from the data-generating distribution. Then, we utilize this result to
develop generalization guarantees for the VAE's reconstruction loss, as well as
upper bounds on the distance between the input and the regenerated
distributions. More importantly, we provide upper bounds on the Wasserstein
distance between the input distribution and the distribution defined by the
VAE's generative model. | [
"Sokhna Diarra Mbacke",
"Florence Clerc",
"Pascal Germain"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04935v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04935v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"stat.ML"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
5
3
9
4
0
.
0
1
3
2
:
v
i
X
r
a
Statistical Guarantees for Variational Autoencoders
using PAC-Bayesian Theory
Sokhna Diarra Mbacke
Université Laval
sokhna-diarra.mbacke.1@ulaval.ca
Florence Clerc
McGill University
florence.clerc@mail.mcgill.ca
Pascal Germain
Université Laval
pascal.germain@ift.ulaval.ca
Abstract
Since their inception, Variational Autoencoders (VAEs) have become central in
machine learning. Despite their widespread use, numerous questions regarding
their theoretical properties remain open. Using PAC-Bayesian theory, this work
develops statistical guarantees for VAEs. First, we derive the first PAC-Bayesian
bound for posterior distributions conditioned on individual samples from the data-
generating distribution. Then, we utilize this result to develop generalization
guarantees for the VAE's reconstruction loss, as well as upper bounds on the
distance between the input and the regenerated distributions. More importantly, we
provide upper bounds on the Wasserstein distance between the input distribution
and the distribution defined by the VAE's generative model.
1
Introduction
In recent years, deep generative models have exhibited tremendous empirical success. Two of
the most important families of generative models are Generative Adversarial Networks (GANs)
(Goodfellow et al., 2014) and Variational Autoencoders (Kingma and Welling, 2014; Rezende et al.,
2014). GANs take an adversarial approach, whereas VAEs are based on maximum likelihood
estimation and variational inference. VAEs comprise two main components: an encoder which
parameterizes an approximation of the posterior distribution over the latent variables, and a decoder
which parameterizes the likelihood. In addition to generative modelling tasks such as image generation
(Vahdat and Kautz, 2020) and text generation (Bowman et al., 2016), VAEs have been successfully
applied to other topics such as semi-supervised learning (Kingma et al., 2014), anomaly detection
(An and Cho, 2015), and dimensionality reduction (Kaur et al., 2021). However, despite their
empirical success, the question of statistical guarantees for the performance of VAEs remains largely
open. Namely, how can one certify that VAEs generalize well, both in terms of reconstruction and
generation?
PAC-Bayesian theory (McAllester, 1999; Catoni, 2003) is an influential tool of statistical learning
theory dedicated to providing generalization bounds for machine learning models. PAC-Bayes has
been applied to a wide variety of problems such as classification (Germain et al., 2009; Parrado-
Hernández et al., 2012), meta-learning (Amit and Meir, 2018), co-clustering (Seldin and Tishby,
2010), domain adaptation (Germain et al., 2020), and online learning (Haddouche and Guedj, 2022).
In recent years, PAC-Bayes has been used to derive non-vacuous generalization bounds for supervised
learning algorithms based on neural networks (Dziugaite and Roy, 2018; Pérez-Ortiz et al., 2021).
See Guedj (2019) and Alquier (2021) for excellent surveys.
37th Conference on Neural Information Processing Systems (NeurIPS 2023).
The objective of this work is to utilize PAC-Bayesian theory to derive statistical guarantees for VAEs.
Our generalization bounds investigate the reconstruction, regeneration, as well as the generation
properties of VAEs.
1.1 Related Works
In order to explain the empirical success of deep generative models, a lot of attention has been
put into deriving theoretical guarantees for these models. Most of the results, however, have been
dedicated to GANs and their variants (Arora et al., 2017; Zhang et al., 2018; Liang, 2021; Singh et al.,
2018; Schreuder et al., 2021; Biau et al., 2021; Mbacke et al., 2023). A possible explanation for this
plethora of theoretical results is the adversarial loss function, which directly offers an estimation of
the discrepancy between the input distribution and the generator's distribution. Despite being central
tools in modern machine learning, VAEs have not benefited from such a thorough theoretical analysis
(Chakrabarty and Das, 2021).
The work of Chakrabarty and Das (2021) studies the regeneration properties of Wasserstein autoen-
coders (WAEs) (Tolstikhin et al., 2018), which come from the same family as VAEs. Using VC
theory, Chakrabarty and Das (2021) derive rates of convergence for the Wasserstein distance between
the input distribution and the distribution regenerated by the WAE, as well as the total variation
distance between the empirical latent distribution and the latent prior. Taking a more empirical
approach, Chérief-Abdellatif et al. (2022) use PAC-Bayes to study the generalization properties of
stochastic reconstruction models. They define a [0, 1]-bounded reconstruction loss function, then
utilize McAllester's bound (McAllester, 2003) to formulate a generalization bound for models with
probabilistic neural networks (Langford and Caruana, 2001). Then, they re-scale their loss and
compare the empirical results to the reconstruction of standard VAEs on benchmark datasets.
We also mention the work of Mbacke et al. (2023), who developed PAC-Bayesian bounds for the
analysis of adversarial generative models. Using McDiarmid's inequality, they proved upper bounds
on the distance between the input distribution and the generator's distribution, for WGANs (Arjovsky
et al., 2017) and EBGANs (Zhao et al., 2017).
1.2 Our Contributions
In this work, we derive theoretical guarantees for variational autoencoders using PAC-Bayesian theory.
We provide three types of guarantees: reconstruction guarantees showing that VAEs can successfully
reconstruct unseen samples from the input distribution; regeneration guarantees proving upper bounds
on the Wasserstein distance between the input distribution and the distribution regenerated by the
VAE, given the training set as input; and finally, generation guarantees showing upper bounds on the
Wasserstein distance between the data-generating distribution and the VAE's generated distribution
defined by the latent prior and the decoder. To the best of our knowledge, these are the first
generalization bounds for the standard VAE's reconstruction and regeneration properties, as well as
the first statistical guarantees for the VAE's generative model.
In our analysis, the PAC-Bayesian posterior coincides with the variational posterior, which requires
the PAC-Bayesian posterior to be conditional. Since, to the best of our knowledge, such PAC-Bayes
bounds do not exist in the literature, we start by developing the first PAC-Bayesian bound for
conditional posterior distributions. Then, we provide upper bounds for the VAE's performance under
two main assumptions: we start by assuming the instance space is bounded, then we take advantage
of the manifold hypothesis. Our bounds are functions of the optimization objective of the VAE,
namely, the empirical reconstruction loss, and the empirical KL-loss.
The remainder of this paper is organized as follows. In Section 2, we define some preliminary
concepts, then briefly introduce VAEs and PAC-Bayesian theory. Section 3 presents our general PAC-
Bayesian theorem for conditional posteriors. Then, in Sections 4 and 5, we present our generalization
bounds for the reconstruction loss, and the regeneration and generation guarantees.
2
2 Preliminaries
2.1 Definitions and Notations
Given metric spaces (X , d) and (Y, d′), and a real number K > 0, a function f : X → Y is
K-Lipschitz continuous if for any x, y ∈ X , we have
d′(f (x), f (y)) ≤ Kd(x, y).
The smallest K such that this condition is satisfied is called the Lipschitz norm or Lipschitz constant
of f and is denoted ∥f ∥Lip. Moreover, the set of K-Lipschitz continuous functions f : X → Y is
denoted LipK(X , Y) (the underlying metrics will be clear from the context).
Throughout the paper, we use lower case letters p, q to denote both probability distributions and
their densities w.r.t. the Lebesgue measure. We may add variables between parentheses to improve
readability (e.g. p(z) to emphasize that p is a distribution on the space of variables z, and q(z|x) to
indicate that q is a conditional distribution). The set of probability measures on a space X is denoted
M1
+(X ) is denoted KL(p || q). We
omit the absolute continuity condition p ≪ q in the statements of the results below, since if it is not
satisfied, then one may assume the KL divergence is infinite and the bounds hold trivially.
+(X ). The Kullback–Leibler (KL) divergence between p, q ∈ M1
Integral Probability Metrics (IPM, see Müller (1997)) are a class of pseudo-metrics defined on the
space of probability measures. Given a family F of real-valued functions defined on X , the IPM
defined by F is denoted dF and defined as
dF (p, q) = sup
f ∈F
(cid:90)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
f dp −
(cid:90)
f dq
(cid:12)
(cid:12)
(cid:12)
(cid:12)
,
∀p, q ∈ M1
+(X ).
(1)
Stemming from the theory of optimal transportation (Villani, 2009), the Wasserstein distances (see
Definition A.2) are a class of metrics between probability measures. The Wasserstein distance
of order 1, also referred to simply as the Wasserstein distance, is the IPM defined by the set
F = {f : X → R s.t. ∥f ∥Lip ≤ 1}.
Finally, we recall the definition of a pushforward measure. Let p be a probability distribution on a
space Z and g : Z → X be a measurable function. The pushforward measure defined by g and p and
denoted g♯p is a probability distribution on X defined as g♯p(A) = p(g−1(A)), for any measurable
set A ⊆ X . In other words, sampling x ∼ g♯p means sampling z ∼ p first, then setting x = g(z).
2.2 Variational Autoencoders
We consider a Euclidean observation space X , a data-generating distribution μ ∈ M1
+(X ), and a
latent space Z = RdZ . VAEs comprise two main components: the encoder network whose parameters
are denoted φ, and the decoder network whose parameters are denoted θ. For simplicity, we may refer
to φ and θ as the encoder and decoder respectively. The encoder parameterizes a distribution qφ(z|x)
over the latent space Z, which is a variational approximation of the Bayesian posterior pθ(z|x). The
likelihood pθ(x|z) is parameterized by the decoder network. In this work, we consider the standard
VAE, with a standard Gaussian prior p(z) = N (0, I) on Z and Gaussian latent distributions qφ(z|x).
More precisely, for any x ∈ X , the distribution qφ(z|x) is a Gaussian distribution with a diagonal
covariance matrix N (μφ (x) , diag(σ2
φ (x))), where
μφ : X → Z = RdZ
and
σφ : X → RdZ
≥0.
Note that diag(σ) denotes the diagonal matrix whose main diagonal is the vector σ. In order to
simplify some of the expressions below, it may be useful to express the encoder network as a function
Qφ : X → R2dZ , where Qφ (x) =
(cid:21)
(cid:20)μφ (x)
σφ (x)
.
(2)
We express the decoder as a parametric function gθ : Z → X . For any x ∈ X , upon receiving z ∼
qφ(z|x), the decoder's output gθ(z) is a reconstruction of x. Given a training set S = {x1, . . . , xn},
the encoder and decoder networks are jointly trained by minimizing the following objective:
LVAE(φ, θ) =
1
n
n
(cid:88)
i=1
(cid:20)
E
z∼qφ(z|xi)
[− log pθ(xi|z)] + βKL(qφ(z|xi) || p(z))
(cid:21)
,
(3)
3
where the first part of (3) is the reconstruction loss and the second part is the KL-divergence between
the latent distributions (associated to the training samples) and the prior over the latent space, weighted
by a hyperparameter β > 0 (Higgins et al., 2017). The reconstruction loss measures the similarity
between x and its reconstruction gθ(z), and can be defined in many ways. With a Gaussian likelihood,
the reconstruction loss is the squared L2 norm ∥x − gθ(z)∥2.
After training, the VAE defines a generative model using the prior p(z) and the decoder gθ (Kingma
and Welling, 2014). The distribution gθ♯p(z) ∈ M1
+(X ) allows one to generate new samples by first
sampling a latent vector from the prior, then passing it through the decoder. We refer to gθ♯p(z) as
the VAE's generated distribution.
2.3 A Brief Introduction to PAC-Bayesian Theory
Dating back to McAllester (1999), PAC-Bayesian theory develops high-probability generalization
bounds for machine learning algorithms. In essence, PAC-Bayes frames the output of such algorithm
as a posterior distribution over a class of hypotheses, and provides an upper bound on the discrepancy
between a model's empirical risk and its population risk.
PAC-Bayes considers the following concepts: a hypothesis class H, a training set S = {x1, . . . , xn}
iid sampled from an unknown distribution μ over an instance space X 1, and a real-valued loss
function l : H × X → [0, ∞). Moreover, the primary goal of PAC-Bayes is to provide generalization
bounds uniformly valid for any posterior q ∈ M1
+(H). These bounds are dependent on the empirical
performance of q and its closeness to a chosen prior distribution p ∈ M1
+(H), as measured by the
KL-divergence. The empirical and true risks of a posterior distribution q ∈ M1
+(H) are defined as
ˆRS(q) = E
h∼q(h)
(cid:34)
1
n
n
(cid:88)
i=1
(cid:35)
l(h, xi)
and R(q) = E
h∼q(h)
(cid:20)
E
x∼μ
(cid:21)
l(h, x)
.
As an illustration, consider the following PAC-Bayesian bound for bounded loss functions developed
by Catoni (2003).
Theorem 2.1. Given a probability measure μ on X , a hypothesis class H, a prior distribution p on
H, a loss function l : H × X → [0, 1], real numbers δ ∈ (0, 1) and λ > 0, with probability at least
1 − δ over the random draw of S ∼ μ⊗n, the following holds for any posterior q ∈ M1
+(H):
R(q) ≤ ˆRS(q) +
λ
8n
+
KL(q || p) + log 1
δ
λ
.
The connection between PAC-Bayesian theory and Bayesian inference was highlighted by Grünwald
(2012) and Germain et al. (2016), who showed that with a proper choice of λ and the negative
log-likelihood as the loss function l, the optimal posterior minimizing the right-hand side of Catoni's
bound is the Bayesian posterior. Note that although the Bayesian posterior is unique (for a given prior
and likelihood), a "PAC-Bayesian posterior" could be, in principle, any distribution over H.
In our PAC-Bayesian analysis of VAEs, we will use the latent space Z as our hypothesis class, so that
the VAE's prior will coincide with the PAC-Bayesian prior and the variational posterior qφ(z|x) will
stand for our PAC-Bayesian posterior. An immediate concern with this approach is that the encoder's
distributions are conditioned on individual samples x ∼ μ, whereas the usual PAC-Bayesian bounds
hold for unconditional posteriors q(h). We address this issue in the next section, by developing a
novel PAC-Bayesian bound for posterior distributions q(*|x). This general result will be later utilized
to analyze VAEs.
3 A General PAC-Bayesian Bound with a Conditional Posterior
In this section, we present our general PAC-Bayesian bound with a conditional posterior distribution.
Note that the novelty of this result is not the conditioning on observations, since this can be achieved
by exploiting the existing PAC-Bayesian bounds. Indeed, Haddouche and Guedj (2022) utilized
the general theorem of Rivasplata et al. (2020) to derive bounds for the online learning framework.
1In supervised learning, the instance space has the form X × Y where X is a set of features, and Y a set of
labels. We use a more general formulation to encompass the unsupervised learning setting.
4
Instead, the contribution of Theorem 3.1 is to predict the behavior of q(h|x), for any (previously
unseen) x ∼ μ, when the posterior q was only learned using the training samples {x1, . . . , xn}. To
the best of our knowledge, this is the first PAC-Bayesian bound where the posterior distribution is a
conditional distribution conditioned on individual elements from the instance space. This bound will
require the posterior q and the loss function l to satisfy the following technical assumption.
Assumption 1. We say that a distribution q(*|x) and a loss function l satisfy Assumption 1 with a
constant K > 0 if there exists a family E of functions H → R such that the following properties
hold.
1. The function x (cid:55)→ q(*|x) is continuous in the following sense: for any x1, x2 ∈ X ,
dE (q(h|x1), q(h|x2)) ≤ Kd(x1, x2).
2. For any x ∈ X , the function l(*, x) : H → R is in E:
l(*, x) ∈ E,
for any x ∈ X .
Before stating the general result, let us pause and discuss this assumption. Intuitively, the goal of
a generalization bound is to predict the behavior of the posterior distribution q(h|x) on previously
unseen examples x ∼ μ. Since the posterior q(h|x) is learned by minimizing the loss function l on
the training samples S = {x1, . . . , xn}, one may need two things to be true.
First, the mapping x (cid:55)→ q(h|x) has to be somewhat continuous. This is ensured by the first part of
Assumption 1, which states that the posterior q is Lipschitz-continuous2 with respect to the IPM dE
and the underlying metric d on X . Indeed, this tells us that if x1 and x2 are close w.r.t. the underlying
metric on X , then q(h|x1) and q(h|x2) are close, w.r.t. the IPM dE .
Second, that continuity has to be "understood" by the loss function l, which corresponds to the second
part of the assumption. It states that the loss function's discriminative power is weaker than the
one defined by the IPM dE . In other words, the discrepancy measure used to measure the similarity
between the distributions q(h|x1) and q(h|x2) needs to be just strong enough to fool the loss function
into thinking that the distributions are close to each other. An alternate formulation of Assumption 1
is provided in the supplementary material (Remark F.1).
Finally, we emphasize that Assumption 1 is not as restrictive as it may seem at first. For instance,
it is satisfied by a VAE's variational posterior, when the encoder and decoder networks have finite
Lipschitz norms and the reconstruction loss is defined with the L2 norm (see Proposition 4.1). We
are ready to state our first result.
Theorem 3.1. Let (X , d) be a metric space. Consider a probability measure μ on X , a hypothesis
class H, a prior distribution p(h) on H, a loss function l : H×X →R, real numbers δ ∈ (0, 1) and
λ > 0. With probability at least 1 − δ over the random draw of S ∼ μ⊗n, the following holds for
any conditional posterior q(h|x) such that Assumption 1 is satisfied by q(h|x) and l with constant
K > 0:
E
x∼μ
E
h∼q(h|x)
l(h, x) −
1
n
n
(cid:88)
i=1
E
h∼q(h|xi)
l(h, xi) ≤
log
1
λ
1
δ
(cid:34) n
(cid:88)
i=1
KL(q(h|xi) || p(h)) +
n
(cid:88)
λK
n
E
x∼μ
d(x, xi) +
i=1
eλ(Ex∼μ[l(h,x)]− 1
n
(cid:80)n
i=1 l(h,xi))
(cid:21)
.
+ log E
S∼μ⊗n
E
h∼p(h)
In order to prove Theorem 3.1, we start by deriving a bound where the expected loss for samples x ∼ μ
is computed w.r.t. distributions q(h|xi) associated to the training samples (see Lemma B.1). This
result uses standard PAC-Bayesian techniques, with a key difference: we start with n iid hypotheses
from the prior p(h), then we perform the change of measure with n posteriors qφ(z|x1), . . . , qφ(z|xn),
and show that the resulting exponential moment is equal to the one in Theorem 3.1. Moreover, one of
the original aspects of this work comes from Assumption 1, which enables us to obtain a bound where
the expected loss for x ∼ μ is computed w.r.t. the posterior q(h|x), associated to x itself instead of
all the training samples. However, the price to pay for having a posterior q(h|x) for each x ∈ X is
that the bound depends on 1
n
Ex∼μ d(x, xi), which we refer to as the average distance.
(cid:80)n
i=1
2dE is a pseudo-metric in the general case, so we abuse the definition by calling this Lipschitz continuity,
since the latter concept is only defined for metric spaces.
5
Applied to supervised learning, Theorem 3.1 bounds the expected risk of a Gibbs posterior q which,
upon receiving a previously unseen datapoint x ∼ μ, samples a predictor h dependent on x, and uses
it to make a prediction. Note that the family E from Assumption 1 does not appear in the bound,
which has nice consequences in practice. Indeed one may pick a loss function l that fits the problem,
and then find a family E for which the continuity assumption is satisfied with constant K that is as
small as possible.
Note also that, in the tradition of PAC-Bayesian bounds, Theorem 3.1 does not make any assumptions
on the nature of the elements of H (e.g. H could be a class of functions, a set of neural network's
parameters, etc). Therefore, the theorem is very general and could be applied to different domains
and models. In the following sections, we will use a specific kind of hypothesis class H = Z, in
order to capture the VAE's latent space.
4 Generalization bounds for the Reconstruction Loss
For the remainder of this work, ∥*∥ denotes the L2 norm, and we assume the instance space X is
Euclidean, and the latent space Z = RdZ , where dZ > 0. Both X and Z are equipped with the
Euclidean distance as the underlying metric. Therefore, if x, x′ ∈ X , d(x, x′) = ∥x − x′∥.
The following assumption states that the encoder and decoder networks have finite Lipschitz norms.
Assumption 2. The encoder and decoder are Lipschitz-continuous w.r.t. their inputs, meaning there
exist real numbers Kφ, Kθ > 0 such that for any x1, x2 ∈ X and z1, z2 ∈ Z,
and
∥Qφ (x1) − Qφ (x2)∥ ≤ Kφ ∥x1 − x2∥
∥gθ(z1) − gθ(z2)∥ ≤ Kθ ∥z1 − z2∥ .
(4)
(5)
Recall the definition of Qφ from Equation (2). Note that in practice, one can estimate the Lipschitz
constant of trained networks (Fazlyab et al., 2019; Latorre et al., 2020) or train the VAE with preset
Lipschitz constants (Barrett et al., 2022).
Moreover, we define the reconstruction loss lθ
rec with the L2 norm, instead of the squared L2 norm,
which enables us to exploit the properties of a metric. We discuss this choice in Section 6. In
order to be consistent with the PAC-Bayesian framework, we define the loss function as follows:
lθ
rec : Z × X → [0, ∞),
lθ
rec(z, x) = ∥x − gθ(z)∥ .
(6)
Our goal is to apply the general bound of Theorem 3.1 to the VAE model. But first, since Theorem 3.1
requires Assumption 1 to be satisfied, we start by showing that if the encoder and decoder networks
have finite Lipschitz norms, then Assumption 1 holds.
Proposition 4.1. Consider a VAE with parameters φ and θ and let Kφ, Kθ ∈ R be the Lipschitz
norms of the encoder and decoder respectively. Then the variational distribution qφ(z|x) satisfies
Assumption 1, with E = {f : Z → R s.t. ∥f ∥Lip ≤ Kθ}, l = lθ
rec, and K = KφKθ.
Proof idea. The proof of Proposition 4.1 is in Appendix C, we provide a brief summary here. To
prove the first part of Assumption 1, we first notice that if E is the set of real-valued Kθ-Lipschitz
continuous functions, then dE is a scaling of the Wasserstein distance. In addition, since W1 ≤ W2,
using the closed form of the Wasserstein-2 distance between Gaussian distributions, one can show
that dE (qφ(*|x1), qφ(*|x2)) ≤ KφKθ ∥x1 − x2∥. Finally, the second part of the assumption is a
consequence of the definition of the loss function and the Lipschitz continuity of the decoder.
Proposition 4.1 tells us that Assumption 1 holds for VAEs. Consequently, we can utilize our general
bound of Theorem 3.1 to obtain generalization guarantees. This leads to the following general
PAC-Bayesian bound for the VAE's reconstruction loss.
Theorem 4.2. Let X be the instance space, μ ∈ M1
latent space, p(z) ∈ M1
+(X ) the data-generating distribution, Z the
+(Z) the prior distribution on the latent space, θ the decoder's parameters,
6
δ ∈ (0, 1), λ > 0 be real numbers. With probability at least 1 − δ over the random draw of S ∼ μ⊗n,
the following holds for any posterior qφ(z|x):
E
x∼μ
E
qφ(z|x)
lθ
rec(z, x) ≤
1
n
n
(cid:88)
i=1
E
qφ(z|xi)
lθ
rec(z, xi) +
1
λ
(cid:34) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z))+
λKφKθ
n
n
(cid:88)
i=1
E
x∼μ
d(x, xi) + log 1
δ + log E
S∼μ⊗n
E
z∼p(z)
eλ(Ex∼μ[lθ
rec(z,x)]− 1
n
(cid:80)n
i=1 lθ
rec(z,xi))
(cid:35)
,
where Kφ and Kθ are the Lipschitz norms of the encoder and the decoder (see (4) and (5)) and
Eqφ(z|x) is a shorthand for Ez∼qφ(z|x) .
Note that the choice of the hyperparameter β in the VAE's optimization objective (3) correlates with
the choice of the hyperparameter λ in Theorem 4.2 (e.g. λ = n corresponds to β = 1). Note also that
the encoder and decoder are not treated the same way in Theorem 4.2. Indeed, the inequality holds
for a given decoder, but uniformly for any encoder. We discuss this subtle difference and its practical
consequences in Section 6.
Theorem 4.2 can be seen as a general framework. In order to obtain a useful upper bound, one needs
to bound the average distance and the exponential moment on the right-hand side. In the sections
below, we provide upper bounds for these terms under various assumptions on the instance space.
4.1 Reconstruction Guarantees for Bounded Instance Spaces
In the following theorem, we provide a special case of Theorem 4.2 when the instance space's
diameter ∆ def= supx,x′∈X d(x, x′) is finite (see Section C.2 for the proof).
Theorem 4.3. Let X be the instance space, ∆ < ∞ its diameter, μ ∈ M1
+(X ) the data-generating
distribution, Z the latent space, p(z) ∈ M1
+(Z) the prior on the latent space, θ the decoder's
parameters, δ ∈ (0, 1), λ > 0 be real numbers. With probability at least 1 − δ over the random draw
of S ∼ μ⊗n, the following holds for any posterior qφ(z|x):
E
x∼μ
E
qφ(z|x)
lθ
rec(z, x) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
(cid:27)
lθ
rec(z, xi)
+
1
λ
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) +
λKφKθ∆ + log
1
δ
+
(cid:19)
.
λ2∆2
8n
The left-hand side of this inequality is the expected reconstruction loss for samples x ∼ μ, while the
right-hand side is the empirical reconstruction and KL losses, plus an additional term depending on
the Lipschitz constants of the VAE and the model's diameter.
Note that for real-life datasets, the diameter of the instance space might be very large and non-
representative of the structure and complexity of the data. Indeed, it is common to scale image
datasets in order to utilize a specific architecture (Radford et al., 2016). In the following section, we
provide a special case of Theorem 4.2 under the manifold hypothesis on the data-generating process.
4.2 Reconstruction Guarantees under the Manifold Assumption
The manifold assumption (Fodor, 2002; Narayanan and Mitter, 2010; Fefferman et al., 2016) states
that most high-dimensional datasets encountered in practice lie close to low-dimensional manifolds.
This assumption is exploited by latent variable generative models such as GANs and VAEs, which
approximate high-dimensional datasets using transformations of distributions on a low-dimensional
space. The works of Schreuder et al. (2021) and Mbacke et al. (2023) provide generalization bounds
for GANs, by assuming that the data-generating distribution is a smooth transformation of the uniform
distribution on [0, 1]d∗
, where d∗ is the intrinsic dimension. However, since the standard VAE calls for
a standard Gaussian prior, in the following theorem, we assume μ is a smooth transformation of the
standard Gaussian distribution p∗ on Rd∗
. We consider the case when p∗ is the uniform distribution
on [0, 1]d∗
in the supplementary material.
7
Theorem 4.4. Let X be the instance space, μ ∈ M1
+(X ) the data-generating distribution, Z the
latent space, p(z) ∈ M1
+(Z) the prior distribution on the latent space, θ the decoder's parameters,
δ ∈ (0, 1), λ > 0, a > 0 real numbers. Assume the data-generating distribution μ = g∗♯p∗, where
p∗ is the standard Gaussian distribution on Rd∗
and g∗ ∈ LipK∗
, X ). With probability at least
1 − δ − nd∗
2 e−a2/2 over the random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x):
(Rd∗
E
x∼μ
E
qφ(z|x)
lθ
rec(z, x) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
(cid:27)
lθ
rec(z, xi)
+
1
λ
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) +
λKφKθK∗
(cid:112)(1 + a2)d∗ + log
1
δ
+
(cid:19)
.
λ2K 2
∗
2n
Let us clarify the role of the new parameter a > 0. Each training sample xi ∈ S can be expressed
as xi = g∗(wi), where wi ∼ p∗. Since p∗ is the standard Gaussian distribution on Rd∗
, all samples
wi will be inside a hypercube [−a, a]d∗
, with high probability. This uncertainty is reflected in the
lowered confidence (from 1 − δ in Theorem 4.2 to 1 − δ − nd∗
2 e−a2/2 in Theorem 4.4), and can be
controlled by choosing a large enough value of a. The proof of Theorem 4.4 is in the supplementary
material (Section C.3), we provide a short summary below.
Proof idea. The proof starts with Theorem 4.2, and uses the assumptions of Theorem 4.4 to obtain
upper bounds on the exponential moment and the average distance. To derive the upper bound on the
exponential moment, we observe that the function z (cid:55)→ lθ
rec(z, x) is K∗-Lipschitz continuous, then we
use a dimension-free upper bound on the MGF of Lipschitz-continuous functions of Gaussian random
Ex∼μ ∥x − xi∥,
variables. Furthermore, we obtain the upper bound on the average distance 1
n
by using Holder's inequality and the expectation of a non-central χ2 distribution. Then, we upper-
bound the probability that wi ∈ [−a, a]d∗
for all 1 ≤ i ≤ n using the error function and Bernoulli's
inequality. Finally, we use the union bound to update the overall confidence.
(cid:80)n
i=1
5 Generalization Bounds for Regeneration and Generation
Let ˆμφ,θ be the empirical regenerated distribution, meaning
ˆμφ,θ = 1
n
(cid:80)n
i=1 gθ♯qφ(z|xi).
(7)
In other words, sampling x ∼ ˆμφ,θ is done by sampling z ∼ qφ(z|xi) where i is uniformly sampled
from {1, . . . , n}, then passing z through the decoder: x = gθ(z). It is therefore the distribution
regenerated by the VAE, given the training set S = {x1, . . . , xn} as input.
In this section, we provide statistical guarantees on the regenerative and generative properties of
VAEs. More precisely, we derive upper bounds for the quantities W1(μ, ˆμφ,θ) and W1(μ, gθ♯p(z)).
Note that the average distance term does not appear in the bounds of this section. This is because
instead of relying on Theorem 3.1, the results of this section depend upon a preliminary lemma
(Lemma B.1), which does not necessitate Assumption 1.
5.1 Regeneration and Generation Guarantees for Bounded Instance Spaces
The following theorem presents our first upper bound on the distance between the input distribution
and the empirical regenerated distribution.
Theorem 5.1. Under the definitions and assumptions of Theorem 4.3, we have that with probability
at least 1 − δ over the random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x):
(cid:33)
W1(μ, ˆμφ,θ) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
lθ
rec(z, xi)
(cid:27)
+
1
λ
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) + log
+
1
δ
λ2∆2
8n
.
As we can see, the right-hand side of Theorem 5.1 depends on the empirical reconstruction loss
and KL-divergence. This guarantees that as the VAE's empirical risk decreases, the regenerated
distribution gets closer to the data-generating distribution. The proof of Theorem 5.1 exploits the fact
8
that the underlying metric on X is the Euclidean distance d(x, x′) = ∥x − x′∥, which is also used to
define the reconstruction loss lθ
rec (see Equation 6). The full proof can be found in Appendix D.
The following theorem provides an upper bound of the distance between the input distribution and
the VAE's generated distribution.
Theorem 5.2. Under the definitions and assumptions of Theorem 4.3, we have that with probability
at least 1 − δ over the random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x):
W1(μ, gθ♯p(z)) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
(cid:27)
lθ
rec(z, xi)
log
+
1
δ
(cid:19)
+
λ2∆2
8n
Kθ
n
n
(cid:88)
i=1
where ⃗1 ∈ RdZ denotes the vector whose entries are all 1.
+
1
λ
(cid:114)
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z))+
∥μφ (xi)∥2 +
(cid:13)
(cid:13)σφ (xi) − ⃗1
(cid:13)
(cid:13)
2
(cid:13)
(cid:13)
,
The right-hand side of Theorem 5.2 is equal to the right-hand side of Theorem 5.1, plus an additional
term depending on the Wasserstein-2 distance W2(qφ(z|xi), p(z)), which is used in the proof because
of its closed form for Gaussian distributions. Hence, the right-hand side of Theorem 5.2 augments
the VAE's optimization objective with W2(qφ(z|xi), p(z)), suggesting that a good generative perfor-
mance may require the latent codes to be even closer to the prior. This is consistent with the findings
of Zhao et al. (2019), who showed that in order to improve generative performance, the latent codes
need to be much closer to the prior, which may disrupt the balance between reconstruction loss and
KL-loss.
5.2 Regeneration and Generation Guarantees under the Manifold Assumption
Similar to what we did in Section 4.2, we assume that the data-generating distribution is a smooth
transformation of the standard Gaussian distribution on Rd∗
, where d∗ is the intrinsic dimension of
the dataset. This yields the following results.
Theorem 5.3. Under the definitions and assumptions of Theorem 4.4, with probability at least 1 − δ
over the random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x):
W1(μ, ˆμφ,θ) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
(cid:27)
lθ
rec(z, xi)
+
1
λ
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) + log
1
δ
+
λ2K 2
∗
2n
(cid:33)
.
Note that the intrinsic and extrinsic dimensions do not explicitly appear in this inequality, although
they may affect the reconstruction and KL loss.
We now present our last result, an upper bound on the Wasserstein distance between the input
distribution and the VAE's generated distribution, under the manifold assumption.
Theorem 5.4. Under the definitions and assumptions of Theorem 4.4, with probability at least 1 − δ
over the random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x) :
W1(μ, gθ♯p(z)) ≤
1
n
n
(cid:88)
(cid:26)
i=1
log
E
qφ(z|xi)
lθ
rec(z, xi)
1
δ
+
λ2K 2
∗
2n
(cid:19)
+
Kθ
n
(cid:27)
+
n
(cid:88)
1
λ
(cid:114)
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) +
∥μφ (xi)∥2 +
(cid:13)
(cid:13)σφ (xi) − ⃗1
(cid:13)
(cid:13)
2
(cid:13)
(cid:13)
,
i=1
where ⃗1 ∈ RdZ denotes the vector whose entries are all 1.
Theorem 5.2 and Theorem 5.4 show that by minimizing the VAE's objective, one is also minimizing
the Wasserstein distance between the input distribution and the VAE's generated distribution.
√
From the upper bounds given by Theorems 5.1 and 5.3, one can deduce rates of convergence of
O(n−1/2) (when λ ≈
n) for the empirical regenerated distribution. Note that λ ≈ n leads to the
much faster rate of n−1, but then the bounds do not converge to the empirical risk, but to a larger
positive number, dependent on the input distribution. Similarly, Theorems 5.2 and 5.4 provide rates
of convergence of O(n−1/2) for the VAE's generated distribution.
9
6 Discussion and Conclusion
The different treatments of θ and φ. The bounds we've presented in this work hold for a given
decoder θ, but uniformly for all encoders. In practice, this means that the risk certificate has to be
computed using samples different from the ones used to train the VAE. This is different from the
usual PAC-Bayesian trick (Germain et al., 2009; Parrado-Hernández et al., 2012; Pérez-Ortiz et al.,
2021, see also Remark F.2) of splitting the training set to learn the prior, then training the model
on the whole training set, because the decoder and encoder are jointly optimized. Instead, one has
to make sure that the model is only trained on samples distinct from the ones used to compute the
bound. The same method would be necessary when computing the risk certificates given by the
recent PAC-Bayesian bounds of Rivasplata et al. (2020) and Haddouche and Guedj (2022), since
those bounds are not uniformly valid for any posterior.
In our bounds, the reconstruction loss is the L2 norm (RMSE), instead
The reconstruction loss.
of the squared L2 norm (MSE). In practice, one can still optimize a VAE with the MSE (or any
other reconstruction loss, e.g. the cross entropy loss), and then compute the bounds using the RMSE.
However, if the reconstruction loss is not the RMSE, then the optima of the chosen optimization
objective might differ from the ones minimizing the right-hand side of the bounds. Therefore, if the
goal is to minimize the bounds, one should utilize the RMSE as the reconstruction loss.
Conclusion.
It is common, when applying PAC-Bayesian theory to new problems, to add additional
stochasticity in order to account for the PAC-Bayesian distributions on the hypothesis class. For
instance, Mbacke et al. (2023) added distributions on the parameters of a WGAN's generator, in
order to perform a PAC-Bayesian analysis. However, because of the seamless integration of the
PAC-Bayesian and VAE frameworks, such modification to the original problem has been avoided
in this work. We matched the prior and posterior distributions on the VAE's latent space to the
PAC-Bayesian prior and posterior, which allowed us to recover the VAE's optimization objective. We
provide preliminary experiments on synthetic datasets in the supplementary material.
This work is a humble contribution to the theoretical understanding of VAEs. We developed novel
PAC-Bayesian bounds suited to the analysis of VAEs and provided generalizations bounds for the
VAE's reconstruction loss. In addition, we also derived upper bounds on the Wasserstein distance
between the input distribution and the VAE's generative model's distribution. These bounds depend
on the VAE's empirical optimization objective and the data-generating process. By integrating the
VAE and PAC-Bayesian frameworks, we hope to establish PAC-Bayesian theory as a prime tool for
the theoretical analysis of VAEs.
Acknowledgements
This research is supported by the Canada CIFAR AI Chair Program, and the NSERC Discovery grant
RGPIN-2020- 07223. F. Clerc is funded by IVADO through the DEEL Project CRDPJ 537462 18
and by a grant from NSERC.
References
Alquier, P. (2021).
arXiv:2110.11216.
User-friendly introduction to PAC-Bayes bounds.
arXiv preprint
Amit, R. and Meir, R. (2018). Meta-learning by adjusting priors based on extended PAC-Bayes
theory. In International Conference on Machine Learning, pages 205–214. PMLR.
An, J. and Cho, S. (2015). Variational autoencoder based anomaly detection using reconstruction
probability. Special Lecture on IE, 2(1):1–18.
Anil, C., Lucas, J., and Grosse, R. (2019). Sorting out Lipschitz function approximation.
In
International Conference on Machine Learning, pages 291–301. PMLR.
Arjovsky, M., Chintala, S., and Bottou, L. (2017). Wasserstein generative adversarial networks. In
International Conference on Machine Learning, pages 214–223. PMLR.
10
Arora, S., Ge, R., Liang, Y., Ma, T., and Zhang, Y. (2017). Generalization and equilibrium in
generative adversarial nets (GANs). In International Conference on Machine Learning, pages
224–232. PMLR.
Barrett, B., Camuto, A., Willetts, M., and Rainforth, T. (2022). Certifiably robust variational
autoencoders. In International Conference on Artificial Intelligence and Statistics, pages 3663–
3683. PMLR.
Biau, G., Sangnier, M., and Tanielian, U. (2021). Some theoretical insights into Wasserstein GANs.
Journal of Machine Learning Research.
Björck, Å. and Bowie, C. (1971). An iterative algorithm for computing the best estimate of an
orthogonal matrix. SIAM Journal on Numerical Analysis, 8(2):358–364.
Boucheron, S., Lugosi, G., and Massart, P. (2013). Concentration inequalities: A nonasymptotic
theory of independence. Oxford university press.
Bowman, S. R., Vilnis, L., Vinyals, O., Dai, A. M., Józefowicz, R., and Bengio, S. (2016). Generating
sentences from a continuous space. In Conference on Computational Natural Language Learning,
CoNLL, pages 10–21. ACL.
Catoni, O. (2003). A PAC-Bayesian approach to adaptive classification. preprint LPMA, 840.
Chakrabarty, A. and Das, S. (2021). Statistical regeneration guarantees of the Wasserstein autoencoder
with latent space consistency. In Advances in Neural Information Processing Systems.
Chérief-Abdellatif, B.-E., Shi, Y., Doucet, A., and Guedj, B. (2022). On PAC-Bayesian reconstruction
guarantees for VAEs. In International Conference on Artificial Intelligence and Statistics, pages
3066–3079. PMLR.
Chu, J. T. (1955). On bounds for the normal integral. Biometrika, 42(1/2):263–265.
Donsker, M. D. and Varadhan, S. S. (1976). Asymptotic evaluation of certain markov process
expectations for large time-iii. Communications on pure and applied Mathematics, 29(4):389–
461.
Dziugaite, G. K. and Roy, D. M. (2018). Data-dependent PAC-Bayes priors via differential privacy.
In Advances in Neural Information Processing Systems, volume 31.
Fazlyab, M., Robey, A., Hassani, H., Morari, M., and Pappas, G. (2019). Efficient and accurate
estimation of Lipschitz constants for deep neural networks. In Advances in Neural Information
Processing Systems, volume 32.
Fefferman, C., Mitter, S., and Narayanan, H. (2016). Testing the manifold hypothesis. Journal of the
American Mathematical Society, 29(4):983–1049.
Fodor, I. K. (2002). A survey of dimension reduction techniques. Technical report, Lawrence
Livermore National Lab., CA (US).
Germain, P., Bach, F., Lacoste, A., and Lacoste-Julien, S. (2016). PAC-Bayesian theory meets
Bayesian inference. In Advances in Neural Information Processing Systems, volume 29.
Germain, P., Habrard, A., Laviolette, F., and Morvant, E. (2020). PAC-Bayes and domain adaptation.
Neurocomputing, 379:379–397.
Germain, P., Lacasse, A., Laviolette, F., and Marchand, M. (2009). PAC-Bayesian learning of linear
classifiers. In International Conference on Machine Learning, page 353–360.
Givens, C. R. and Shortt, R. M. (1984). A class of Wasserstein metrics for probability distributions.
Michigan Mathematical Journal, 31(2):231–240.
Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and
Bengio, Y. (2014). Generative adversarial nets. In Advances in Neural Information Processing
Systems, volume 27.
11
Grünwald, P. (2012). The safe Bayesian - learning the learning rate via the mixability gap. In
Algorithmic Learning Theory, volume 7568 of Lecture Notes in Computer Science, pages 169–183.
Springer.
Guedj, B. (2019). A primer on PAC-Bayesian learning. In Proceedings of the French Mathematical
Society, volume 33, pages 391–414. Société Mathématique de France.
Haddouche, M. and Guedj, B. (2022). Online PAC-Bayes learning. In Advances in Neural Information
Processing Systems.
Higgins, I., Matthey, L., Pal, A., Burgess, C., Glorot, X., Botvinick, M., Mohamed, S., and Lerchner,
A. (2017). beta-VAE: Learning basic visual concepts with a constrained variational framework. In
International Conference on Learning Representations.
Kaur, D., Islam, S. N., and Mahmud, M. A. (2021). A variational autoencoder-based dimensionality
In 2021 IEEE
reduction technique for generation forecasting in cyber-physical smart grids.
International Conference on Communications Workshops (ICC Workshops), pages 1–6. IEEE.
Kingma, D. P., Mohamed, S., Jimenez Rezende, D., and Welling, M. (2014). Semi-supervised
learning with deep generative models. In Advances in Neural Information Processing Systems,
volume 27.
Kingma, D. P. and Welling, M. (2014). Auto-encoding Variational Bayes. In International Conference
on Learning Representations.
Langford, J. and Caruana, R. (2001). (not) bounding the true error. In Advances in Neural Information
Processing Systems, volume 14.
Latorre, F., Rolland, P., and Cevher, V. (2020). Lipschitz constant estimation of neural networks via
sparse polynomial optimization. In International Conference on Learning Representations.
Liang, T. (2021). How well generative adversarial networks learn distributions. Journal of Machine
Learning Research, 22(228):1–41.
Mbacke, S. D., Clerc, F., and Germain, P. (2023). PAC-Bayesian generalization bounds for adversarial
generative models. In International Conference on Machine Learning, volume 202, pages 24271–
24290. PMLR.
McAllester, D. A. (1999). Some PAC-Bayesian theorems. Machine Learning, 37(3):355–363.
McAllester, D. A. (2003). PAC-Bayesian stochastic model selection. Machine Learning, 51(1):5–21.
Mitrinovic, D. S. and Vasic, P. M. (1970). Analytic inequalities, volume 1. Springer.
Müller, A. (1997). Integral probability metrics and their generating classes of functions. Advances in
Applied Probability, 29(2):429–443.
Narayanan, H. and Mitter, S. (2010). Sample complexity of testing the manifold hypothesis. In
Advances in Neural Information Processing Systems, volume 23.
Parrado-Hernández, E., Ambroladze, A., Shawe-Taylor, J., and Sun, S. (2012). PAC-Bayes bounds
with data dependent priors. Journal of Machine Learning Research, 13(1):3507–3531.
Pérez-Ortiz, M., Rivasplata, O., Shawe-Taylor, J., and Szepesvári, C. (2021). Tighter risk certificates
for neural networks. Journal of Machine Learning Research, 22.
Petersen, K. B. and Pedersen, M. S. (2008). The matrix cookbook. Version 20081110.
Radford, A., Metz, L., and Chintala, S. (2016). Unsupervised representation learning with deep
convolutional generative adversarial networks. In International Conference on Learning Represen-
tations.
Rezende, D. J., Mohamed, S., and Wierstra, D. (2014). Stochastic backpropagation and approximate
inference in deep generative models. In International Conference on Machine Learning, pages
1278–1286. PMLR.
12
Rivasplata, O., Kuzborskij, I., Szepesvári, C., and Shawe-Taylor, J. (2020). PAC-Bayes analysis
beyond the usual bounds. In Advances in Neural Information Processing Systems, volume 33,
pages 16833–16845.
Schreuder, N., Brunel, V.-E., and Dalalyan, A. (2021). Statistical guarantees for generative models
without domination. In Algorithmic Learning Theory, pages 1051–1071. PMLR.
Seeger, M. (2002). PAC-Bayesian generalisation error bounds for Gaussian process classification.
Journal of Machine Learning Research, 3(Oct):233–269.
Seldin, Y. and Tishby, N. (2010). PAC-Bayesian analysis of co-clustering and beyond. Journal of
Machine Learning Research, 11(12).
Singh, S., Uppal, A., Li, B., Li, C.-L., Zaheer, M., and Póczos, B. (2018). Nonparametric density
In Advances in Neural Information Processing Systems,
estimation under adversarial losses.
volume 31.
Thiemann, N., Igel, C., Wintenberger, O., and Seldin, Y. (2017). A strongly quasiconvex PAC-
Bayesian bound. In International Conference on Algorithmic Learning Theory, volume 76, pages
466–492. PMLR.
Tolstikhin, I., Bousquet, O., Gelly, S., and Schoelkopf, B. (2018). Wasserstein auto-encoders. In
International Conference on Learning Representations.
Vahdat, A. and Kautz, J. (2020). NVAE: A deep hierarchical variational autoencoder. In Advances in
Neural Information Processing Systems, volume 33, pages 19667–19679.
Villani, C. (2009). Optimal transport: old and new, volume 338. Springer.
Zhang, P., Liu, Q., Zhou, D., Xu, T., and He, X. (2018). On the discrimination-generalization tradeoff
in GANs. In International Conference on Learning Representations.
Zhao, J., Mathieu, M., and LeCun, Y. (2017). Energy-based generative adversarial networks. In
International Conference on Learning Representations.
Zhao, S., Song, J., and Ermon, S. (2019). InfoVAE: Balancing learning and inference in variational
autoencoders. In AAAI Conference on Artificial Intelligence, volume 33, pages 5885–5892.
13
Statistical Guarantees for Variational Autoencoders
using PAC-Bayesian Theory: Supplementary Material
Sokhna Diarra Mbacke
Université Laval
sokhna-diarra.mbacke.1@ulaval.ca
Florence Clerc
McGill University
florence.clerc@mail.mcgill.ca
Pascal Germain
Université Laval
pascal.germain@ift.ulaval.ca
A Preliminaries
Definition A.1 (Coupling). Let p, q ∈ M1
+(X ). A distribution γ on X × X is a coupling (Villani,
2009) of p and q if for every measurable set B ⊂ X , γ(B × X ) = p(B) and γ(X × B) = q(B).
In other words, a coupling of p and q is a distribution on X × X whose marginals are p and q
respectively.
For example, the product measure p ⊗ q is a coupling of p and q.
Definition A.2 (Wasserstein distances). Let (X , d) be a Polish metric space and p, q ∈ M1
Given a real number k ≥ 1, the Wasserstein-k distance Wk is defined as
+(X )
(cid:18)
Wk(p, q) =
inf
π∈Γ(p,q)
(cid:90)
d(x, y)k dπ(x, y)
(cid:19)1/k
,
where Γ(p, q) denotes the set of couplings of p and q (see Definition A.1 above). As stated in the
main paper, W1 is referred to as the Wasserstein distance.
Given two Gaussian distributions p = N (μ1, Σ1) and q = N (μ2, Σ2) on Rd∗
distance has the following closed form (Givens and Shortt, 1984):
, the Wasserstein-2
W2(p, q)2 = ∥μ1 − μ2∥2 + Tr
(cid:18)
Σ1 + Σ2 − 2
(cid:16)
1 Σ2Σ1/2
Σ1/2
1
(cid:17)1/2(cid:19)
.
(A.1)
This expression can be greatly simplified when the distributions have diagonal covariance matrices.
Indeed, if Σ1 = diag(σ2
, then the product of the covariance
matrices commutes Σ1Σ2 = Σ2Σ1 and we get
2) where σ1, σ2 ∈ Rd∗
1) and Σ2 = diag(σ2
(cid:16)
1 Σ2Σ1/2
Σ1/2
1
(cid:17)1/2
= Σ1/2
1 Σ1/2
2
,
which, combined with the symmetry of covariance matrices and the definition of the Frobenius norm
∥*∥Fr (Petersen and Pedersen, 2008), implies
(cid:18)
Tr
Σ1 + Σ2 − 2
(cid:16)
1 Σ2Σ1/2
Σ1/2
1
(cid:17)1/2(cid:19)
=
(cid:13)
(cid:13)Σ1/2
(cid:13)
1 − Σ1/2
2
(cid:13)
2
(cid:13)
(cid:13)
Fr
= ∥σ1 − σ2∥2 .
Hence, if p = N (μ1, diag(σ2
p and q is
1)) and q = N (μ2, diag(σ2
2)), then the Wasserstein-2 distance between
W2(p, q) = ∥μ1 − μ2∥2 + ∥σ1 − σ2∥2 .
(A.2)
We will use this equality to prove some of the results of Section 5.
14
The following change of measure theorem dates back to Donsker and Varadhan (1976) and has been
used in the proof of many PAC-Bayesian theorems. A proof can be found in Boucheron et al. (2013,
Corollary 4.15).
Proposition A.1 (Donsker-Varadhan change of measure). Let p, q be probability measures on a
space H such that q ≪ p, and let g : H → R be a function such that Eh∼p eg(h) < ∞. Then,
eg(h) ≥ eEh∼q[g(h)]−KL(q || p).
E
h∼p
There are many different formulations of this proposition, we chose a formulation that facilitates
readability of the proof of the following lemma.
B Proofs of the results in Section 3
We state and prove our first result. Note that the following lemma does not use Assumption 1.
Moreover, the main difference between the inequality of this lemma and the one of Theorem 3.1 is the
left-hand side. In Lemma B.1, the expected loss for samples x ∼ μ is computed w.r.t. distributions
q(h|xi) associated to the training samples. In contrast, in Theorem 3.1, the expected loss for each
x ∼ μ is computed w.r.t. the distribution q(h|x) associated to x itself.
Lemma B.1. Let X be the instance space, μ ∈ M1
+(X ) the data-generating distribution, H the
hypothesis class, l : H × X → R the loss function, p(h) ∈ M1
+(H) the prior distribution and
δ ∈ (0, 1), λ > 0 real numbers. Then with probability at least 1 − δ over the random draw
of the training set S = {x1, . . . , xn} ∼ μ⊗n, the following holds for any conditional posterior
q(h|x) ∈ M1
+(H):
1
n
n
(cid:88)
(cid:26)
i=1
E
h∼q(h|xi)
E
x∼μ
(cid:27)
l(h, x)
≤
1
n
n
(cid:88)
(cid:26)
E
h∼q(h|xi)
(cid:27)
l(h, xi)
+
1
λ
(cid:34) n
(cid:88)
KL(q(h|xi) || p(h))+
i=1
1
δ
log
+ log E
S∼μ⊗n
E
h∼p(h)
i=1
eλ(Ex∼μ[l(h,x)]− 1
n
(cid:80)n
i=1 l(h,xi))
(cid:21)
.
(B.1)
Proof. First, we consider a set H = {h1, . . . , hn} ∼ p(h)⊗n iid sampled from p(h). By applying
Markov's inequality to the positive random variable Y , defined as
Y def=
E
H∼p(h)⊗n
exp
(cid:34)
λ
n
n
(cid:88)
(cid:26)
i=1
E
x∼μ
[l(hi, x)] − l(hi, xi)
,
(cid:27)(cid:35)
we obtain that with probability at least 1 − δ over the draw of S ∼ μ⊗n, Y ≤ 1
δ
E [Y ], meaning
E
H∼p(h)⊗n
exp
(cid:34)
λ
n
1
δ
n
(cid:88)
(cid:26)
i=1
E
x∼μ
[l(hi, x)] − l(hi, xi)
≤
(cid:27)(cid:35)
E
S∼μ⊗n
E
H∼p(h)⊗n
exp
(cid:34)
λ
n
n
(cid:88)
(cid:26)
i=1
E
x∼μ
15
[l(hi, x)] − l(hi, xi)
.
(cid:27)(cid:35)
(B.2)
Let us focus on the left-hand side of (B.2). We have
E
H∼p(h)⊗n
exp
(cid:34)
λ
n
n
(cid:88)
(cid:26)
i=1
E
x∼μ
[l(hi, x)] − l(hi, xi)
(cid:27)(cid:35)
=
E
H∼p(h)⊗n
n
(cid:89)
i=1
exp
(cid:18)
(cid:20) λ
n
E
x∼μ
[l(hi, x)] − l(hi, xi)
(cid:19)(cid:21)
=
=
≥
n
(cid:89)
i=1
n
(cid:89)
i=1
n
(cid:89)
i=1
E
hi∼p(h)
exp
(cid:18)
(cid:20) λ
n
E
x∼μ
[l(hi, x)] − l(hi, xi)
(cid:19)(cid:21)
E
h∼p(h)
exp
(cid:18)
(cid:20) λ
n
E
x∼μ
[l(h, x)] − l(h, xi)
(cid:19)(cid:21)
exp
(cid:20)
E
h∼q(h|xi)
(cid:20) λ
n
(cid:18)
E
x∼μ
[l(h, x)] − l(h, xi)
− KL(q(h|xi) || p(h))
(cid:19)(cid:21)
(cid:21)
,
where the inequality uses the Donsker-Varadhan change of measure theorem (Proposition A.1).
Applying the logarithm, we obtain
n
(cid:88)
(cid:26)
E
x∼μ
[l(hi, x)] − l(hi, xi)
(cid:27)(cid:35)
log
E
H∼p(h)⊗n
exp
(cid:34)
λ
n
≥ log
n
(cid:89)
i=1
exp
(cid:20)
E
h∼q(h|xi)
i=1
(cid:20) λ
n
(cid:18)
E
x∼μ
[l(h, x)] − l(h, xi)
− KL(q(h|xi) || p(h))
(cid:19)(cid:21)
(cid:21)
=
=
n
(cid:88)
(cid:18)
i=1
E
h∼q(h|xi)
(cid:18)
(cid:20) λ
n
E
x∼μ
[l(h, x)] − l(h, xi)
− KL(q(h|xi) || p(h))
(cid:19)(cid:21)
(cid:19)
n
(cid:88)
λ
n
(cid:20)
E
h∼q(h|xi)
E
x∼μ
[l(h, x)] − l(h, xi)
−
(cid:21)
n
(cid:88)
i=1
KL(q(h|xi) || p(h)).
i=1
This, combined with (B.2) yields
λ
n
n
(cid:88)
i=1
E
h∼q(h|xi)
(cid:20)
E
x∼μ
(cid:21)
[l(h, x)] − l(h, xi)
−
n
(cid:88)
KL(q(h|xi) || p(h)) ≤
1
δ
E
S∼μ⊗n
E
H∼p(h)⊗n
exp
(cid:34)
λ
n
n
(cid:88)
(cid:26)
i=1
E
x∼μ
i=1
[l(hi, x)] − l(hi, xi)
.
(cid:27)(cid:35)
(B.3)
It remains to show that the exponential moment on the right-hand side of Equation (B.3) can be
modified by replacing the expectation w.r.t. p(h)⊗n with an expectation w.r.t. p(h). Similar to what
we did in the first part of the first derivation, we can use Fubini's theorem to obtain
E
H∼p(h)⊗n
exp
=
n
(cid:89)
i=1
E
h∼p(h)
exp
= E
h∼p(h)
n
(cid:89)
i=1
exp
(cid:34)
λ
n
(cid:20) λ
n
(cid:20) λ
n
(cid:34)
(cid:32)
n
(cid:88)
(cid:26)
i=1
E
x∼μ
[l(hi, x)] − l(hi, xi)
(cid:27)(cid:35)
(cid:18)
(cid:18)
E
x∼μ
E
x∼μ
[l(h, x)] − l(h, xi)
(cid:19)(cid:21)
[l(h, x)] − l(h, xi)
(cid:19)(cid:21)
(cid:33)(cid:35)
l(h, xi)
.
1
n
n
(cid:88)
i=1
= E
h∼p(h)
exp
λ
E
x∼μ
[l(h, x)] −
16
Combining this equation with Equation (B.3) yields the theorem.
The reader familiar with PAC-Bayes bounds may notice that the proof of Lemma B.1 is similar to
the usual derivation of PAC-Bayesian bounds, with a key difference. We start with an iid set of n
hypotheses sampled from the prior, which allows us to apply the change of measure theorem to
n posteriors q(h|x1), . . . , q(h|xn). Then, we show that the exponential moment obtained with n
hypotheses instead of one is equal to the exponential moment obtained with one hypothesis.
B.1 Proof of Theorem 3.1
The first summand on the left-hand side of Lemma B.1 is the risk on samples x ∼ μ, when the
hypotheses are uniformly sampled from q(h|xi), 1 ≤ i ≤ n. In order to replace q(h|xi) by q(h|x) in
that term and derive Theorem 3.1, we utilize Assumption 1.
First, recall that Theorem 3.1 states that under the assumptions of Lemma B.1, if Assumption 1 holds
with a constant K > 0, then the following inequality holds with probability at least 1 − δ:
E
x∼μ
E
h∼q(h|x)
l(h, x) −
1
n
n
(cid:88)
i=1
E
h∼q(h|xi)
l(h, xi) ≤
log
1
λ
1
δ
(cid:34) n
(cid:88)
i=1
+ log E
S∼μ⊗n
E
h∼p(h)
n
(cid:88)
λK
n
E
x∼μ
i=1
eλ(Ex∼μ[l(h,x)]− 1
n
KL(q(h|xi) || p(h)) +
[d(x, xi)]+
(cid:80)n
i=1 l(h,xi))
(cid:21)
.
(B.4)
Proof of Theorem 3.1. Using the definition of an IPM and Assumption 1, for any xi ∈ S, x ∈ X , we
have
E
h∼q(h|x)
l(h, x) −
E
h∼q(h|xi)
l(h, x) ≤ dE (q(h|x), q(h|xi)) ≤ Kd(x, xi).
Combined with Fubini's theorem, we obtain
n
(cid:88)
n
(cid:88)
(cid:20)
E
h∼q(h|xi)
E
x∼μ
l(h, x) =
E
x∼μ
E
h∼q(h|xi)
i=1
i=1
(cid:21)
l(h, x)
≥
n
(cid:88)
i=1
E
x∼μ
(cid:20)
E
h∼q(h|x)
l(h, x) − Kd(x, xi)
(cid:21)
.
Combining this with Lemma B.1, yields Theorem 3.1.
C Proofs of the results in Section 4
C.1 Proof of Proposition 4.1
First, we recall the statement of Proposition 4.1.
Proposition C.1 (Restatement of Proposition 4.1). If there exists positive real numbers Kφ and Kθ
such that the encoder and decoder are respectively Kφ-Lipschitz and Kθ-Lipschitz continuous, then
dE (qφ(z|x1), qφ(z|x2)) ≤ KφKθ ∥x1 − x2∥ ,
(C.1)
and
where E = LipKθ
Proof.
for any x ∈ X .
(C.2)
(Z, R) is the set of real-valued Kθ-Lipschitz continuous functions defined on Z.
l(*, x) ∈ E,
1. Let us prove (C.1). First, since qφ(z|xi) = N (μφ (xi) , diag(σ2
φ (xi))), by (A.2), the
Wasserstein-2 distance W2(qφ(z|x1), qφ(z|x2)) has the following closed form:
W2(qφ(z|x1), qφ(z|x2))2 = ∥μφ (x1) − μφ (x2)∥2 + ∥σφ (x1) − σφ (x2)∥2 ,
which, combined with the definition Qφ (x) =
(cid:20)μφ (x)
σφ (x)
(cid:21)
, yields
∥Qφ (x1) − Qφ (x2)∥2 = W2(qφ(z|x1), qφ(z|x2))2.
17
Since Qφ is Kφ-Lipschitz continuous, we have ∥Qφ (x1) − Qφ (x2)∥ ≤ Kφ ∥x1 − x2∥,
and
W2(qφ(z|x1), qφ(z|x2)) ≤ Kφ ∥x1 − x2∥ .
(C.3)
On the other hand, the definition E = LipKθ
(Z, R) and the Kantorovich duality imply
dE (qφ(z|x1), qφ(z|x2)) = KθW1(qφ(z|x1), qφ(z|x2)).
Since W1 ≤ W2, this equation, combined with (C.3) yields
dE (qφ(z|x1), qφ(z|x2)) ≤ KθKφ ∥x1 − x2∥ .
2. Now, we shall prove (C.2), meaning, we show that l(*, x) ∈ LipKθ
z1, z2 ∈ Z. We have
(Z, R) . Let x ∈ X and
l(z1, x) − l(z2, x) = ∥x − gθ(z1)∥ − ∥x − gθ(z2)∥
= ∥x − gθ(z1) + gθ(z2) − gθ(z2)∥ − ∥x − gθ(z2)∥
≤ ∥x − gθ(z2)∥ + ∥gθ(z2) − gθ(z1)∥ − ∥x − gθ(z2)∥
= ∥gθ(z2) − gθ(z1)∥
≤ Kθ ∥z1 − z2∥ ,
where the first inequality uses the triangle inequality and the second uses the Lipschitz
assumption on gθ.
C.2 Proof of Theorem 4.3
Proof of Theorem 4.3. In order to prove Theorem 4.3, we need to upper bound the average distance
and the exponential moment of Theorem 4.2, under the finite diameter assumption:
More precisely, we need to prove the two following inequalities.
d(x, x′) = ∆ < ∞.
sup
x,x′∈X
n
(cid:88)
i=1
E
x∼μ
d(x, xi) ≤ n∆
and
(cid:34)
(cid:32)
E
z∼p(z)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
1
n
n
(cid:88)
i=1
(cid:33)(cid:35)
lθ
rec(z, xi)
≤ exp
(cid:20) λ2∆2
8n
(cid:21)
.
(C.4)
(C.5)
(C.6)
First, (C.5) is a direct consequence of the definition of the diameter ∆.
Now, let us prove (C.6). Let z ∈ Z. Since lθ
between x and gθ(z), the definition of ∆ implies lθ
Hoeffding's lemma on the random variables li = lθ
rec(z, x)(cid:3) − lθ
rec(z, x) = ∥x − gθ(z)∥ = d(x, gθ(z)) is the distance
rec(z, x) ∈ [0, ∆], for any x ∈ X . Hence, applying
rec(z, xi) ∈ [0, ∆], we obtain
(cid:20) λ2∆2
(cid:21)
8n2
rec(z, xi)
E
xi∼μ
(cid:20) λ
n
E
x∼μ
≤ exp
(cid:2)lθ
exp
(cid:19)(cid:21)
(cid:18)
.
Using Fubini's theorem, we have that:
(cid:34)
(cid:32)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
(cid:33)(cid:35)
lθ
rec(z, xi)
1
n
n
(cid:88)
i=1
=
n
(cid:89)
i=1
E
xi∼μ
exp
(cid:20) λ
n
(cid:18)
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) − lθ
rec(z, xi)
(cid:19)(cid:21)
which leads to
(cid:34)
(cid:32)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
(cid:33)(cid:35)
lθ
rec(z, xi)
1
n
n
(cid:88)
i=1
(cid:18)
≤
exp
(cid:20) λ2∆2
8n2
(cid:21)(cid:19)n
= exp
(cid:21)
(cid:20) λ2∆2
8n
18
C.3 Proof of Theorem 4.4
We need to bound the average distance and the exponential moment of Theorem 4.2, under the
assumption μ = g∗♯p∗, with p∗ = N (0, I) is the standard Gaussian distribution on Rd∗
, and
g∗ ∈ LipK∗
Lemma C.2. Under the hypotheses of Theorem 4.4, the following inequality holds:
(Rd∗
, X ).
(cid:34)
(cid:32)
log E
z∼p(z)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
1
n
n
(cid:88)
i=1
(cid:33)(cid:35)
lθ
rec(z, xi)
≤
λ2K 2
∗
2n
.
(C.7)
Proof. We have
(cid:34)
(cid:32)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
(cid:33)(cid:35)
lθ
rec(z, xi)
1
n
n
(cid:88)
i=1
(cid:34)
(cid:32)
= E
S∼μ⊗n
exp
λ
E
x∼μ
[∥x − gθ(z)∥] −
(cid:33)(cid:35)
∥xi − gθ(z)∥
1
n
n
(cid:88)
i=1
(cid:19)(cid:35)
(cid:18)
E
x∼μ
= E
S∼μ⊗n
exp
= E
S∼μ⊗n
n
(cid:89)
i=1
exp
(cid:34) n
(cid:88)
i=1
λ
n
(cid:20) λ
n
[∥x − gθ(z)∥] − ∥xi − gθ(z)∥
(cid:18)
E
x∼μ
[∥x − gθ(z)∥] − ∥xi − gθ(z)∥
(cid:19)(cid:21)
Since all the xi are samples iid, we can use Fubini's theorem to obtain:
E
S∼μ⊗n
=
n
(cid:89)
i=1
eλ(Ex∼μ[lθ
rec(z,x)]− 1
n
(cid:80)n
i=1 lθ
rec(z,xi))
E
xi∼μ
exp
(cid:20) λ
n
(cid:18)
E
x∼μ
[∥x − gθ(z)∥] − ∥xi − gθ(z)∥
(cid:19)(cid:21)
Recall that μ = g∗♯p∗, where p∗ is the standard Gaussian distribution on Rd∗
and g∗ is K∗-Lipschitz
continuous. This means we can rewrite an expectation wrt xi ∼ μ as an expectation wrt wi ∼ p∗ as
follows:
(cid:34)
(cid:32)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
(cid:33)(cid:35)
lθ
rec(z, xi)
1
n
n
(cid:88)
i=1
=
=
n
(cid:89)
i=1
n
(cid:89)
i=1
(cid:20)
exp
(cid:20) λ
n
E
xi∼μ
(cid:18)
E
x∼μ
[∥x − gθ(z)∥] − ∥xi − gθ(z)∥
(cid:19)(cid:21)(cid:21)
E
wi∼p∗
(cid:18)
(cid:20)
exp
(cid:20) λ
n
E
w′∼p∗
[∥g∗(w′) − gθ(z)∥] − ∥g∗(wi) − gθ(z)∥
(cid:19)(cid:21)(cid:21)
(∗)
≤
n
(cid:89)
i=1
exp
(cid:21)
(cid:20) λ2K 2
∗
2n2
= exp
(cid:21)
(cid:20) λ2K 2
∗
2n
We still need to justify
(∗)
≤ . Define for any arbitrary α ∈ X the function f : Rd∗
→ R as:
f (w) = ∥g∗(w) − α∥ .
19
Since g∗ ∈ LipK∗
(Rd∗
, X ), the function f is K∗-Lipschitz. Indeed, for any w1, w2 ∈ Rd∗
,
f (w1) − f (w2) = ∥g∗(w1) − α∥ − ∥g∗(w2) − α∥
= ∥g∗(w1) − α + g∗(w2) − g∗(w2)∥ − ∥g∗(w2) − α∥
≤ ∥g∗(w1) − g∗(w2)∥ + ∥g∗(w2) − α∥ − ∥g∗(w2) − α∥
= ∥g∗(w1) − g∗(w2)∥
≤ K∗ ∥w1 − w2∥
Moreover, it is known (see Theorem 5.5 of Boucheron et al. (2013)) that if f is a K∗-Lipschitz
function of a standard normal random variable z, then
E eλ(E[f (z)]−f (z)) ≤ e
λ2K2
∗
2
.
Hence,
E
wi∼p∗
(cid:20)
exp
(cid:20) λ
n
(cid:18)
E
w′∼p∗
[∥g∗(w′) − gθ(z)∥] − ∥g∗(wi) − gθ(z)∥
(cid:19)(cid:21)(cid:21)
≤ exp
(cid:20) λ2K 2
∗
2n2
(cid:21)
,
which proves
(∗)
≤ and concludes this proof.
Lemma C.3. Under the hypotheses of Theorem 4.4, with probability at least 1 − nd∗
2 e
random draw of S,
n
(cid:88)
i=1
d(x, xi) ≤ nK∗
(cid:112)(1 + a2)d∗
E
x∼μ
−a2
2 over the
(C.8)
Proof. First, since the training set S = {x1, . . . , xn} iid∼ μ, for each 1 ≤ i ≤ n, there exists wi ∼ p∗
such that xi = g∗(wi). Let a > 0 be a positive real number. By definition of p∗, we have
P
(cid:104)
∀i, wi ∈ [−a, a]d∗ (cid:105)
(cid:18)
=
erf
(cid:18) a
√
2
(cid:19)(cid:19)nd∗
,
where erf (*) denotes the error function. Since the error function verifies (see Chu (1955))
erf
(cid:18) a
√
2
(cid:19)
(cid:113)
≥
1 − e
−a2
2 ,
we can use Bernoulli's inequality (see Section 2.4 of Mitrinovic and Vasic (1970)) to obtain
(cid:16)
(cid:17)nd∗/2
P
∀i, wi ∈ [−a, a]d∗ (cid:105)
(cid:104)
≥
1 − e
−a2
2
≥ 1 −
nd∗
2
−a2
2 .
e
Now we assume wi ∈ [−a, a]d∗
for all 1 ≤ i ≤ n and we shall prove the desired inequality:
n
(cid:88)
d(x, xi) ≤ nK∗
(cid:112)(1 + a2)d∗
E
x∼μ
Let us prove (C.10). We have
i=1
(C.9)
(C.10)
E
x∼μ
d(x, xi) = E
x∼μ
∥x − xi∥ = E
w∼p∗
∥g∗(w) − g∗(wi)∥ ≤ K∗ E
w∼p∗
∥w − wi∥ ,
(C.11)
where the inequality follows from the assumption g∗ ∈ LipK∗
, X ). Using Holder's inequality,
the fact that ∥w − wi∥2 is a non-central χ2 random variable with d∗ degrees of freedom and non-
centrality coefficient ∥wi∥2, and the assumption wi ∈ [−a, a]d∗
, we obtain
(Rd∗
E
w∼p∗
∥w − wi∥ ≤
(cid:18)
E
w∼p∗
∥w − wi∥2
(cid:19)1/2
d∗ + ∥wi∥2(cid:17)1/2
(cid:16)
=
≤ (cid:0)d∗ + a2d∗(cid:1)1/2
.
Hence,
which proves (C.10).
∥x − xi∥ ≤ K∗
(cid:112)(1 + a2)d∗
E
x∼μ
20
Proof of Theorem 4.4. Lemmas C.2 and C.3 applied to the result from Theorem 4.2 provide us with
the inequality of Theorem 4.4. Finally, the confidence of 1 − δ − nd∗
2 e
is obtained by using
the union bound: the inequality in Theorem 4.2 holds with probability at least 1 − δ, whereas the
inequality appearing in Lemma C.3 holds with probability at least 1 − nd∗
2 e
−a2
2 .
−a2
2
, instead of the standard Gaussian distribution on Rd∗
In the following proposition, we provide an alternate version of Theorem 4.4, where the distribution
p∗ is the uniform distribution3 on [0, 1]d∗
Proposition C.4. Let X be the instance space, Z the latent space, p(z) ∈ M1
+(Z) the prior
distribution, θ the parameters of the decoder, δ ∈ (0, 1), λ > 0, a > 0 be real numbers. Assume
the data-generating distribution μ = g∗♯p∗, where p∗ = U([0, 1]d∗
) is the uniform distribution on
[0, 1]d∗
, X ) is K∗-Lipschitz continuous. With probability at least 1 − δ over
the random draw of S, the following holds for any posterior qφ(z|x):
(cid:32) n
(cid:88)
and g∗ ∈ LipK∗
(Rd∗
n
(cid:88)
(cid:26)
(cid:27)
.
E
x∼μ
E
qφ(z|x)
lθ
rec(z, x) −
1
n
i=1
E
qφ(z|xi)
lθ
rec(z, xi)
≤
1
λ
KL(qφ(z|xi) || p(z))+
i=1
√
λKφKθK∗
d∗ + log
1
δ
+
(cid:19)
.
λ2K 2
∗
2n
Proof. Let {w1, . . . , wn} ⊆ [0, 1]d∗
of [0, 1]d∗
√
is
d∗, using the assumptions on μ and g∗, we obtain
be such that for all 1 ≤ i ≤ n, xi = g∗(wi). Since the diameter
n
(cid:88)
i=1
E
x∼μ
d(x, xi) =
n
(cid:88)
i=1
E
w∼p∗
d(g∗(w), g∗(wi)) ≤ K∗
n
(cid:88)
i=1
E
w∼p∗
∥w − wi∥ ≤ nK∗
√
d∗.
Applying the inequality above to Theorem 4.2 yields the desired result.
Note that unlike Theorem 4.4, the confidence 1 − δ of Theorem 4.2 is not lowered in Proposition C.4.
D Proofs of the results in Section 5
To simplify the proofs of the theorems of Section 5, we start by proving Lemmas D.1 and D.2 below.
First, recall the definition of ˆμφ,θ:
ˆμφ,θ =
1
n
n
(cid:88)
i=1
gθ♯qφ(z|xi).
The triangle inequality implies
W1(μ, gθ♯p(z)) ≤ W1(μ, ˆμφ,θ) + W1(ˆμφ,θ, gθ♯p(z)).
(D.1)
Let us state and prove the first lemma of this section.
Lemma D.1. The following inequality holds with probability at least 1 − δ over the random draw of
S ∼ μ⊗n:
λW1(μ, ˆμφ,θ) ≤
λ
n
n
(cid:88)
i=1
(cid:18)
E
z∼q(z|xi)
(cid:19)
lθ
rec(z, xi)
+
n
(cid:88)
i=1
KL(q(z|xi) || p(z))+
log
1
δ
+ log E
S∼μ⊗n
E
z∼p(z)
eλ(Ex∼μ[lθ
rec(z,x)]− 1
n
(cid:80)n
i=1 lθ
rec(z,xi)).
Proof. Recall the expression for the Wasserstein distance based on couplings:
W1(μ, ˆμφ,θ) =
inf
π∈Γ(μ,ˆμφ,θ)
(cid:90)
X ×X
∥x − y∥ dπ(x, y)
3Note that the result holds for any distribution on [0, 1]d∗
, not just the uniform distribution.
21
In particular, W1(μ, ˆμφ,θ) is less than the right-hand side obtained by the product coupling which
can be rewritten, using Fubini's theorem, as:
W1(μ, ˆμφ,θ) ≤
(cid:90)
∥x − y∥ dμ(x)dˆμφ,θ(y)
X ×X
= E
y∼ˆμφ,θ
E
x∼μ
∥x − y∥ .
Using the derivation above and the definition of ˆμφ,θ, we obtain
W1(μ, ˆμφ,θ) ≤ E
y∼ˆμφ,θ
E
x∼μ
∥x − y∥ =
=
1
n
1
n
n
(cid:88)
i=1
n
(cid:88)
i=1
(cid:18)
E
z∼qφ(z|xi)
(cid:18)
E
z∼qφ(z|xi)
E
x∼μ
E
x∼μ
(cid:19)
∥x − gθ(z)∥
(cid:19)
lθ
rec(z, x)
.
We can upper bound this expression using Lemma B.1 with H = Z and l = lθ
probability at least 1 − δ over the random draw of S ∼ μ⊗n:
rec. We get that with
λ
n
n
(cid:88)
i=1
(cid:18)
E
z∼q(z|xi)
E
x∼μ
lθ
rec(z, x)
(cid:19)
≤
λ
n
n
(cid:88)
(cid:18)
i=1
E
z∼q(z|xi)
(cid:19)
lθ
rec(z, xi)
+
n
(cid:88)
i=1
KL(q(z|xi) || p(z))+
log
1
δ
+ log E
S∼μ⊗n
E
z∼p(z)
eλ(Ex∼μ[lθ
rec(z,x)]− 1
n
(cid:80)n
i=1 lθ
rec(z,xi)).
Therefore, using the upper bounds on the exponential moment from Section 4, we can prove Theorems
5.1 and 5.3 in the following sections.
Next, we prove the following lemma.
Lemma D.2. The following inequality holds.
W1(ˆμφ,θ, gθ♯p(z)) ≤
Kθ
n
n
(cid:88)
i=1
(cid:114)
∥μφ (xi)∥2 +
(cid:13)
(cid:13)σφ (xi) − ⃗1
(cid:13)
(cid:13)
2
(cid:13)
(cid:13)
,
where ⃗1 ∈ RdZ denotes the vector whose entries are all 1.
Proof. Defining the mixture of measures
ˆqφ(z) =
1
n
n
(cid:88)
i=1
qφ(z|xi),
the definition of ˆμφ,θ and the definition of a pushforward measures yield
ˆμφ,θ =
1
n
n
(cid:88)
i=1
gθ♯qφ(z|xi) = gθ♯ˆqφ(z).
Using the dual formulation of the Wasserstein distance, we have
W1(ˆμφ,θ, gθ♯p(z)) = W1 (gθ♯ˆqφ(z), gθ♯p(z))
=
sup
f ∈Lip1(X ,R)
(cid:20)(cid:90)
Z
f ◦ gθ(z) dˆqφ(z) −
(cid:90)
(cid:21)
f ◦ gθ(z) dp(z)
= sup
g∈Gθ
(cid:20)(cid:90)
Z
g(z) dˆqφ(z) −
Z
(cid:21)
g(z) dp(z)
(cid:90)
Z
≤
sup
g∈LipKθ
(Z,R)
(cid:20)(cid:90)
Z
g(z) dˆqφ(z) −
(cid:21)
g(z) dp(z)
(cid:90)
Z
= KθW1(ˆqφ(z), p(z)),
22
where Gθ = {g : Z → R s.t. g = f ◦ gθ and f ∈ Lip1(X , R)} and the inequality holds because
(Z, R), since gθ : Z → X is Kθ-Lipschitz. Now, since (p, q) (cid:55)→ W1(p, q) is convex,
Gθ ⊆ LipKθ
the definition of ˆqφ(z) implies
W1(ˆqφ(z), p(z)) ≤
1
n
n
(cid:88)
i=1
W1(qφ(z|xi), p(z)) ≤
1
n
n
(cid:88)
i=1
W2(qφ(z|xi), p(z)).
(D.2)
Since, by Equation (A.2),
we obtain
W2(qφ(z|xi), p(z))2 = ∥μφ (xi)∥2 +
(cid:13)
(cid:13)
2
(cid:13)σφ (xi) − ⃗1
(cid:13)
(cid:13)
(cid:13)
,
W1(ˆμφ,θ, gθ♯p(z)) ≤
Kθ
n
n
(cid:88)
i=1
(cid:114)
∥μφ (xi)∥2 +
(cid:13)
(cid:13)σφ (xi) − ⃗1
(cid:13)
(cid:13)
2
(cid:13)
(cid:13)
.
D.1 Proof of Theorem 5.1
Proof of Theorem 5.1. Recall from Lemma D.1 that with probability at least 1 − δ over the random
draw of S ∼ μ⊗n,
λW1(μ, ˆμφ,θ) ≤
λ
n
n
(cid:88)
i=1
(cid:18)
E
z∼q(z|xi)
(cid:19)
lθ
rec(z, xi)
+
n
(cid:88)
i=1
KL(q(z|xi) || p(z))+
log
1
δ
+ log E
S∼μ⊗n
E
z∼p(z)
eλ(Ex∼μ[lθ
rec(z,x)]− 1
n
(cid:80)n
i=1 lθ
rec(z,xi)).
(D.3)
In order to prove Theorem 4.3 in section C.2, we proved that
(cid:34)
(cid:32)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
1
n
n
(cid:88)
i=1
(cid:33)(cid:35)
lθ
rec(z, xi)
≤ exp
(cid:20) λ2∆2
8n
(cid:21)
.
Now, we can reuse this inequality to upper-bound the last term on the right-hand side of Equation (D.3).
We obtain the desired theorem: under the assumptions of Theorem 4.3, with probability at least 1 − δ
over the random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x):
W1(μ, ˆμφ,θ) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
lθ
rec(z, xi)
(cid:27)
+
1
λ
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) + log
1
δ
+
λ2∆2
8n
(cid:33)
.
D.2 Proof of Theorem 5.2
Proof of Theorem 5.2. Theorem 5.2 is a direct consequence of Theorem 5.1 and Lemma D.2 applied
to Equation (D.1).
D.3 Proof of Theorem 5.3
Proof of Theorem 5.3. Recall from Lemma D.1 that with probability at least 1 − δ over the random
draw of S ∼ μ⊗n,
λW1(μ, ˆμφ,θ) ≤
λ
n
n
(cid:88)
i=1
(cid:18)
E
z∼q(z|xi)
(cid:19)
lθ
rec(z, xi)
+
n
(cid:88)
i=1
KL(q(z|xi) || p(z))+
log
1
δ
+ log E
S∼μ⊗n
E
z∼p(z)
eλ(Ex∼μ[lθ
rec(z,x)]− 1
n
(cid:80)n
i=1 lθ
rec(z,xi)).
We can then use Lemma C.2 which stated that
(cid:34)
(cid:32)
log E
z∼p(z)
E
S∼μ⊗n
exp
λ
E
x∼μ
(cid:2)lθ
rec(z, x)(cid:3) −
23
1
n
n
(cid:88)
i=1
(cid:33)(cid:35)
lθ
rec(z, xi)
≤
λ2K 2
∗
2n
.
(D.4)
Figure 1: Samples from the real datasets
The expectations over z and S can be swapped using Fubini's Theorem. Hence, combining
Lemma C.2 and Lemma D.1, we obtain Theorem 5.3: with probability at least 1 − δ over the
random draw of S ∼ μ⊗n, the following holds for any posterior qφ(z|x).
W1(μ, ˆμφ,θ) ≤
1
n
n
(cid:88)
(cid:26)
i=1
E
qφ(z|xi)
lθ
rec(z, xi)
(cid:27)
+
1
λ
(cid:32) n
(cid:88)
i=1
KL(qφ(z|xi) || p(z)) + log
1
δ
+
λ2K 2
∗
2n
(cid:33)
.
D.4 Proof of Theorem 5.4
Proof of Theorem 5.4. Theorem 5.4 is a direct consequence of Theorem 5.3 and Lemma D.2 applied
to Equation (D.1).
E Numerical Experiments
We computed the numerical value of the bound of Theorem 4.3. We performed the experiments on
two 2-dimensional synthetic datasets. The first one is a mixture of two isotropic Gaussian distributions
on R2 centered at (−1, 0) and (1, 0) respectively, and with standard deviation σ = 0.1 and null
covariances. The second dataset consists of noisy samples arranged in a circle centered at the origin,
with radius 1.5 and standard deviation σ = 0.1. Both datasets are truncated so that no sample is over
4 standard deviations away from its corresponding mean. This is to formally ensure that the diameter
of the instance spaces is finite, as required by Theorem 4.3. The sizes of the training, validation and
test sets are respectively 50,000, 20,000 and 20,000. Samples from the two datasets are shown in
Figure 1.
We used the same architecture and hyperparameters for both datasets. The encoder and decoder
are fully connected networks with 3 hidden layers and 100 hidden units per layer. We also set the
Lipschitz constants of the encoder and decoder networks to Kφ = Kθ = 2. In order to enforce
Lipschitz continuity, we used Björk orthonormalization (Björck and Bowie, 1971) with GroupSort
activations (Anil et al., 2019), and we utilized the implementation of Lipschitz layers by Anil et al.
(2019). Note that Barrett et al. (2022) performed experiments with VAEs with fixed Lipschitz
constants, but we did not directly use their implementation because of a difference in the definition of
the Lipschitz norm of the encoder, which affects the implementation. Note also that unlike the usual
computations of PAC-Bayesian bounds (Pérez-Ortiz et al., 2021), our implementation does not use
probabilistic neural networks. It uses deterministic networks, as it is usual for VAEs, because our
analysis did not include additional stochasticity. We used the MSE as the reconstruction loss during
training, and computed the bounds on validation datasets. The samples from the different models are
displayed in Figure 2.
24
Figure 2: Samples from the models trained on the 2-Gaussian dataset (top) and the Circle dataset
(bottom).
λ
n/0.01
n/0.025
n/0.05
n/0.075
n/0.1
n/0.25
n/0.5
n/0.75
n/1
Test Rec. loss Emp. Rec. loss Emp. KL loss Exp. moment Bound
99.80
46.45
28.70
22.83
19.92
14.89
13.63
13.54
13.78
0.1107
0.1228
0.1299
0.1388
0.1425
0.1707
0.2120
0.2718
0.3586
0.1110
0.1237
0.1299
0.1403
0.1436
0.1732
0.2162
0.2725
0.3596
0.0192
0.0505
0.1010
0.1511
0.2003
0.4883
0.9602
1.4122
1.8593
89.00
35.60
17.80
11.867
8.900
3.560
1.780
1.1868
0.8901
Table 1: Table showing the values of the different quantities of Equation E.1 for the "2-Gaussian"
dataset. The upper bound on the average distance term is 10.67.
Recall the inequality of Theorem 4.3:
lθ
rec(z, x)
E
x∼μ
(cid:124)
E
qφ(z|x)
(cid:123)(cid:122)
Test Rec. Loss
(cid:125)
≤
n
(cid:88)
i=1
1
n
(cid:124)
(cid:26)
lθ
rec(z, xi)
E
qφ(z|xi)
(cid:123)(cid:122)
Emp. Rec. Loss
(cid:27)
(cid:125)
n
(cid:88)
i=1
+
1
λ
(cid:124)
KL(qφ(z|xi) || p(z))
+
(cid:123)(cid:122)
Emp. KL loss
λ∆2
8n
(cid:124) (cid:123)(cid:122) (cid:125)
Exp. moment
(cid:125)
(E.1)
+
1
λ
log
1
δ
.
+
KφKθ∆
(cid:124) (cid:123)(cid:122) (cid:125)
Avg distance
Tables 1 and 2 show the numerical values of the bound of Theorem 4.3 for different values of λ.
The first column is approximated using the test set, and the last one refers to all the right-hand side
of (E.1). The empirical reconstruction and KL losses are computed using the validation set, since,
as mentioned in the main paper, the bounds need to be computed using a set independent from the
training set.
From Tables 1 and 2, once can see that the bounds are dominated by two terms: the average distance
and the exponential moment. Although as λ approaches n, the exponential moment gets smaller and
the main influence comes from the upper bound on the average distance. Hence, in order to tighten
the bound, one may need to derive tighter upper bounds on the average distance, or derive versions of
Theorem 4.3 where this term is replaced by a numerically smaller one.
25
λ
n/0.01
n/0.025
n/0.05
n/0.075
n/0.1
n/0.25
n/0.5
n/0.75
n/1
Test Rec. loss Emp. Rec. loss Emp. KL loss Exp. moment Bound
195.81
87.59
51.58
39.63
33.69
23.28
20.30
19.691
19.686
0.095
0.1354
0.1785
0.2005
0.2245
0.3498
0.5026
0.6171
0.7513
180.50
72.20
36.10
24.07
18.05
7.220
3.610
2.406
1.805
0.0959
0.1362
0.1783
0.2020
0.2247
0.3486
0.4940
0.6154
0.7499
0.0197
0.0525
0.1058
0.1587
0.2117
0.5160
0.9997
1.4691
1.9314
Table 2: Table showing the values of the different quantities of Equation E.1 for the "Circle" dataset.
The upper bound on the average distance term is 15.2.
F Additional Results and Remarks
This section contains additional remarks and discussions. We start with possible extensions of our
results.
F.1 The variance of the likelihood
Our definition of the decoder network's output (the function gθ : Z → X ) only considers the
deterministic part of the decoder. In other words, our results only apply to VAEs whose likelihood
has constant variance. However, they can be extended to cases when the variance of the likelihood
is optimized, but at a cost. We discuss separately the two cases where the variance depends on
individual datapoints or not.
If the standard deviation σ of the decoder is fixed, then we have
Instance-independent variance.
σ ∝ n
λ , (recall the hyperparameter λ from Theorem 3.1 and subsequent theorems). Hence, optimizing
σ corresponds to optimizing λ, which is non-trivial in PAC-Bayes. Indeed, most PAC-Bayes bounds
(including ours) do not directly allow one to optimize λ (see Section 2.1.4 of Alquier (2021)).
Although there are some ways around this restriction, we are not aware of any results that allow
one to optimize in the general case (meaning continuous values of λ and unbounded loss). For
[0, 1]-bounded loss functions, Thiemann et al. (2017) developed a PAC-Bayes bound uniformly valid
for a trade-off parameter λ′, and show that one can optimize w.r.t. both the posterior and λ′, under
certain assumptions. For unbounded losses, if one assumes λ ∈ Λ, where |Λ| is finite, a union bound
argument allows one to make the bound uniform with respect to λ, at the cost of log |Λ| (see Alquier
(2021)). One can still optimize with respect to a continuous set Λ, by considering a grid. For instance,
if one considers Λ ∩ {1, . . . , n}, then the penalty is log n and if one considers Λ ∩ {ek : 1 ≤ k ≤ n},
the penalty is log log n.
Instance-dependent variance. Now, assume the standard deviation is dependent on individual
instances. Say we define the reconstruction loss as lθ(z, x) = 1
σθ(z) ∥x − gθ(z)∥, where σθ : Z →
R>0. Because of the division by σθ(z), let us assume that there is a fixed upper bound σ1 > 0 such
that σθ(z) > σ1, for any z ∈ Z. There are two main tasks: making sure Assumption 1 is satisfied,
and bounding the exponential moment of Theorem 4.2, with this new loss function.
Verifying Assumption 1 is equivalent to showing that Proposition 4.1 is verified for this new loss
function lθ. The second part of the proof of Proposition 4.1 tells us that we need to show that lθ
is Lipschitz-continuous. Note that in general, the product of real-valued Lipschitz functions is not
Lipschitz. Hence, we assume, in addition, that ∥x − gθ(z)∥ ≤ M < ∞. The following proposition
shows that Assumption 1 is satisfied with the constant K = Kφ
Proposition F.1. Consider a VAE with parameters φ and θ and let Kφ, Kθ ∈ R be the Lipschitz
rec : Z × X → R
norms of the encoder and decoder respectively. Also, consider the loss function lθ
defined as
(cid:16) KσM
σ2
1
+ Kθ
σ1
(cid:17)
.
lθ
rec(z, x) =
∥x − gθ(z)∥
1
σθ(z)
26
where σθ : Z → R>0 is Kσ-Lipschitz. Assume and for all z ∈ Z, σθ(z) > σ1 and ∥x − gθ(z)∥ ≤ M
for some fixed 0 < σ1 < 1 and M > 0. Then the variational distribution qφ(z|x) satisfies Assumption
1 with E = {f : Z → R : ∥f ∥Lip ≤ KσM
σ2
1
(cid:16) KσM
σ2
1
, and l = lθ
}, K = Kφ
+ Kθ
σ1
+ Kθ
σ1
rec.
(cid:17)
Proof. The first part of Assumption 1 is satisfied, since KσM
σ2
1
of Assumption 1, we need to show that lθ
-Lipschitz continuous. First,
+ Kθ
σ1
> Kθ. Now, for the second part
rec is KσM
σ2
1
+ Kθ
σ1
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1
σθ(z1)
−
1
σθ(z2)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
=
(cid:12)
(cid:12)
(cid:12)
(cid:12)
σθ(z2) − σθ(z1)
σθ(z1)σθ(z2)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
≤
Kσ ∥z1 − z2∥
σ2
1
.
We have
(cid:12)
rec(z1, x) − lθ
(cid:12)lθ
rec(z2, x(cid:12)
(cid:12) =
=
≤
=
(cid:12)
1
(cid:12)
(cid:12)
σθ(z1)
(cid:12)
(cid:12)
1
(cid:12)
(cid:12)
σθ(z1)
(cid:12)
KσM
σ2
1
(cid:18) KσM
σ2
1
∥x − gθ(z1)∥ −
1
σθ(z2)
(cid:12)
(cid:12)
∥x − gθ(z2)∥
(cid:12)
(cid:12)
−
1
σθ(z2)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
∥z1 − z2∥ +
1
σθ(z2)
∥x − gθ(z1)∥ +
Kθ
σ1
∥z1 − z2∥
|∥x − gθ(z1)∥ − ∥x − gθ(z2)∥|
(cid:19)
+
Kθ
σ1
∥z1 − z2∥
Now, let us focus on bounding the exponential moment. In this case, when the instance space is
bounded, the upper bound on the exponential moment (in the proof of Theorem 4.3) is:
λ2∆2
8nσ2
1
,
instead of
λ2∆2
8n
.
And under the manifold assumption, we get the following upper bound (in the proof of Theorem 4.4):
λ2K 2
∗
2nσ2
1
,
instead of
λ2K 2
∗
2n
Note that although the upper bounds on the average distance remain unchanged, the coefficient KφKθ
is replaced by Kφ
, which is larger, specially if σ1 is very small.
(cid:17)
(cid:16) KσM
σ2
1
+ Kθ
σ1
F.2 Uniformity with respect to θ
As mentioned in the main paper, although our bounds hold uniformly for any encoder φ, they only
hold for a given decoder θ. the consequence of this limitation is that the numerical computations of
the bounds need to be done on a sample set disjoint from the training set (e.g. a validation or test set).
Let Θ denote a set of decoder parameters over which the optimization is performed.
From a theoretical perspective, the union bound can be used to circumvent this issue, when we
consider a finite set of parameters Θ. In that case, the log 1
δ , which
loosens the bound. Moreover, since Θ denotes a set of neural network parameters, this assumption
may not be appropriate unless one chooses a very large set Θ, which can significantly loosen the
bound.
δ in Theorem 3.1 becomes log |Θ|
Another option would be to make assumptions on the complexity of the set of loss functions
{lθ
rec : θ ∈ Θ} parameterized by decoder parameters θ ∈ Θ (e.g. the Rademacher complexity), in
order to obtain uniform bounds in a more general case. We leave such explorations to future works.
F.3 Additional Remarks
Remark F.1 (Alternate formulation of Assumption 1). We can provide an equivalent formulation of
Assumption 1. A posterior q(h|x) and a loss function l satisfy Assumption 1 with a constant K > 0
27
if and only if for any x ∈ X ,
(cid:12)
(cid:12)
(cid:12)
(cid:12)
E
h∼q(h|x1)
l(h, x) −
E
h∼q(h|x2)
l(h, x)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
≤ Kd(x1, x2).
The formulation given in the paper is more intuitive, but this expression shows that the specific choice
of E does not matter. The equivalence of the two formulations is a consequence of the definition of
an IPM.
Remark F.2 (Prior Learning in PAC-Bayes). The majority of PAC-Bayesian bounds (McAllester,
1999; Seeger, 2002; Germain et al., 2009; Mbacke et al., 2023) require the prior distribution p on
the hypothesis class to be independent of the training set4. In practice, this means one has to use
data-free priors when minimizing PAC-Bayes bounds. Since, in that case, the learned posterior is
likely very far from the prior, the KL-divergence tends to be orders of magnitude larger than the
empirical risk. In practice, this means the optimization is monopolized by the KL-divergence, leading
to a poor performance of the learning algorithm. In order to avoid this issue and still obtain a valid
certificate, the following "prior learning trick" is used. Split the training set S = {x1, . . . , xn} in
two disjoint subsets S1, S2, where |S1| = n0, |S2| = n − n0 with n0 < n. Then, learn the prior p on
S1, learn the posterior q on S (the whole training set), and compute the certificate on S2.
The reason why this trick cannot be directly applied to circumvent the fact that our bounds are valid
for a given decoder, is that the encoder and the decoder are jointly optimized in VAEs. Hence, one
has to make sure the samples used to learn the encoder (hence, train the model) are not used in
the computation of the risk certificate. We emphasize that in our case, the issue does not lie in the
learning of the prior (the standard VAE considers a standard Gaussian prior), but of the loss function
lθ
rec, which is dependent on the decoder's parameters θ.
4PAC-Bayesian bounds with data-dependent priors were developed by Dziugaite and Roy (2018); Rivasplata
et al. (2020).
28
|
|
http://arxiv.org/abs/2310.04930v2 | "2023-10-10T01:36:56" | "2023-10-07T22:01:49" | Diff-Transfer: Model-based Robotic Manipulation Skill Transfer via
Differentiable Physics Simulation | The capability to transfer mastered skills to accomplish a range of similar
yet novel tasks is crucial for intelligent robots. In this work, we introduce
$\textit{Diff-Transfer}$, a novel framework leveraging differentiable physics
simulation to efficiently transfer robotic skills. Specifically,
$\textit{Diff-Transfer}$ discovers a feasible path within the task space that
brings the source task to the target task. At each pair of adjacent points
along this task path, which is two sub-tasks, $\textit{Diff-Transfer}$ adapts
known actions from one sub-task to tackle the other sub-task successfully. The
adaptation is guided by the gradient information from differentiable physics
simulations. We propose a novel path-planning method to generate sub-tasks,
leveraging $Q$-learning with a task-level state and reward. We implement our
framework in simulation experiments and execute four challenging transfer tasks
on robotic manipulation, demonstrating the efficacy of $\textit{Diff-Transfer}$
through comprehensive experiments. Supplementary and Videos are on the website
https://sites.google.com/view/difftransfer | [
"Yuqi Xiang",
"Feitong Chen",
"Qinsi Wang",
"Yang Gang",
"Xiang Zhang",
"Xinghao Zhu",
"Xingyu Liu",
"Lin Shao"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04930v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04930v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.RO",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.RO",
"cs.AI",
"cs.LG"
] | Preprint
DIFF-TRANSFER: MODEL-BASED ROBOTIC MANIP-
ULATION SKILL TRANSFER VIA DIFFERENTIABLE
PHYSICS SIMULATION
Yuqi Xiang1, Feitong Chen2, Qinsi Wang3, Yang Gang2, Xiang Zhang4, Xinghao Zhu4,
Xingyu Liu5, Lin Shao2
1Nanjing University
3University of Science and Technology of China
5Carnegie Mellon University
4University of California, Berkeley
2National University of Singapore
3
2
0
2
t
c
O
0
1
]
O
R
.
s
c
[
2
v
0
3
9
4
0
.
0
1
3
2
:
v
i
X
r
a
ABSTRACT
The capability to transfer mastered skills to accomplish a range of similar yet
In this work, we introduce Diff-
novel tasks is crucial for intelligent robots.
Transfer, a novel framework leveraging differentiable physics simulation to ef-
ficiently transfer robotic skills. Specifically, Diff-Transfer discovers a feasible
path within the task space that brings the source task to the target task. At
each pair of adjacent points along this task path, which is two sub-tasks, Diff-
Transfer adapts known actions from one sub-task to tackle the other sub-task
successfully. The adaptation is guided by the gradient information from differ-
entiable physics simulations. We propose a novel path-planning method to gen-
erate sub-tasks, leveraging Q-learning with a task-level state and reward. We im-
plement our framework in simulation experiments and execute four challenging
transfer tasks on robotic manipulation, demonstrating the efficacy of Diff-Transfer
through comprehensive experiments. Supplementary and Videos are on the web-
site https://sites.google.com/view/difftransfer
1
INTRODUCTION
The capacity for rapidly acquiring new skills in object manipulation is crucial for intelligent robots
operating in real-world environments. One might wonder, how can robots efficiently learn manip-
ulation skills across diverse objects? A straightforward approach would involve teaching a robot a
new manipulation skill for every distinct object and task. However, this method lacks efficiency and
is infeasible due to the vast variety of objects and possible robot interactions. Nonetheless, we could
also notice that different manipulation skills may share common properties. As shown in Fig. 1, the
one-directional pushing skill could be correlated to an object reorientation skill. Thus, it may be
feasible to leverage prior knowledge acquired from one task to aid in learning another similar task.
Transferring this prior knowledge and acquired skill set to new tasks could greatly enhance learning
efficiency compared to starting from scratch.
Our intuition to solve this transfer learning problem is that Newton's Laws apply universally in
our physical world. Therefore, when involved in similar tasks where objects are moved by similar
poses, robots should interact with objects in similar ways. In this way, efficiently leveraging the
local information hidden in the variation of manipulation tasks could be the key to efficient task
transfer learning.
In this paper, we investigate the problem of transferring manipulation skills between two object
manipulation tasks. Our proposed framework is depicted in Fig. 1. We approach this problem
by interpolating the source task and target task by producing a large number of intermediate sub-
tasks between them which gradually transform from the source task toward the target task. These
continuously and gradually transforming intermediate sub-tasks act as the bridge for transferring the
action sequence from the source task to the target task.
To better leverage the physical property associated with the object shape and pose transformation,
we leverage differentiable simulation to capture model-based gradient information and use it in
1
Preprint
Figure 1: The overall approach of Diff-Transfer includes a path of L − 1 sub-tasks. Diff-Transfer
leverages Local Sampler, Q-function Network and argmax function to select the best candidate to
generate the (i+1)th sub-task given the ith sub-task, and learn the action sequence via differentiable
physics simulation.
transforming robot action sequences. We introduce a refined Q-learning method for path planning
in the pose transfer problem, where we use a high-level state and a well-designed reward to generate
the path of seamlessly connected sub-tasks with a sample-based searching method.
We execute a series of challenging manipulation tasks using Jade(Yang et al., 2023), a differen-
tiable physics simulator designed for articulated rigid bodies. We undertake four tasks: Close Grill,
Change Clock, Open Door, and Open Drawer. The outcomes demonstrate that our system surpasses
prevalent baselines for transfer learning and direct transfer without path planning through differen-
tiable simulation, highlighting the efficacy and merits of our approach. Additionally, we perform
several ablation studies.
In summary, we make the following contributions:
• We propose a systematic framework for model-based transfer learning, leveraging the dif-
ferentiable physics-based simulation and applying our framework for pose transfer and
object shape transfer.
• We propose a novel path planning method for generating multiple sub-tasks in the task
space and learning an action sequence for a new sub-task with the proximity property and
leveraging Q-learning and differentiable physics simulation.
• We conduct comprehensive experiments to demonstrate the effectiveness of our proposed
transfer learning framework.
2 RELATED WORK
2.1 DIFFERENTIABLE SIMULATION FOR MANIPULATION.
Significant advancements have been achieved in the field of differentiable physics engines, thanks to
the evolution of automatic differentiation techniques (Paszke et al., 2019; Team et al., 2016; Hu et al.,
2019a; Bell, 2020; Bradbury et al., 2018; Agarwal et al.). Various differentiable physics simulations
have been developed for specific applications, such as rigid bodies (de Avila Belbute-Peres et al.,
2018; Degrave et al., 2019; Yang et al., 2023), soft bodies (Hu et al., 2019a;b; Jatavallabhula et al.,
2021; Geilinger et al., 2020; Du et al., 2021), cloth (Liang et al., 2019; Qiao et al., 2020; Li et al.,
2022; Yu et al., 2023), articulated bodies (Werling et al., 2021; Ha et al., 2017; Qiao et al., 2021),
2
Q-functionNetwork0.10.90.5argmaxSub-Task Accomlishmentvia Differentiable SimulationLocalSamplerith sub-taskscoresSampled candidatesfor (i+1)th sub-task(i+1)th sub-taskbestcandidatesource tasktarget task0.9Preprint
and fluids (Um et al., 2020; Wandel et al., 2020; Holl et al., 2020; Takahashi et al., 2021). Sev-
eral studies have applied differentiable physics simulations to robotic manipulations. Turpin et al.
(2022) focused on multi-fingered grasp synthesis, while Lv et al. (2022) guided robots in manipu-
lating articulated objects. Zhu et al. (2023a;b) enabled model-based learning from demonstrations
by optimizing over dynamics, and Lin et al. (2022a;b) targeted deformable object manipulation.
Yang et al. (2023) developed a differentiable simulation called Jade for articulated rigid bodies with
Intersection-Free Frictional Contact.
However, the incorporation of contact dynamics often results in non-convex optimization challenges
due to discontinuities from contact mode switching (Suh et al., 2022; Antonova et al., 2022; Zhu
et al., 2023a). To mitigate this, contact-centric trajectory planning has been proposed (Mordatch
et al., 2012; Marcucci et al., 2017; Cheng et al., 2021; Gabiccini et al., 2018; Zhu et al., 2023a; Chen
et al., 2021; Huo et al., 2023), which plans both contact points and forces and generate manipula-
tion actions afterward. Additionally, Pang et al. (2022) introduced smoothing techniques for contact
gradients and employed a convex quasi-dynamics model for feasible action searching. In align-
ment with existing research, our study utilizes differentiable physics simulations for the purpose of
transferring robotic manipulation skills across different task spaces.
2.2 TRANSFER LEARNING IN ROBOTICS.
Transfer learning has become a cornerstone in robotics, aiming to generalize skills across varying
tasks, environments, or robotic platforms. Although still an open challenge, the majority of re-
search has employed reinforcement learning (RL) for skill transfer (Taylor & Stone, 2009). Several
approaches have been proposed to address this challenge. Lazaric et al. (2008); Xu et al. (2021);
Jian et al. (2021); Zhang et al. (2022; 2023b) utilize domain randomization during training to en-
hance agent robustness across diverse physical environments and to focus on task-relevant features.
Tirinzoni et al. (2018); Hu et al. (2023) fine-tune reward and value functions on new tasks, while
Konidaris & Barto (2007), Liu et al. (2021), Zhang et al. (2023a), and Zhao et al. (2022) directly
adapt policies to new environments. Finn et al. (2017) introduces a meta-learning framework to
improve agent adaptability across various tasks. Chi et al. (2022) employs an iterative policy and
approximates residual dynamics for runtime adaptation. Liu et al. (2022a;b) use continuous robot in-
terpolation and sequentially fine-tune RL policy to transfer skills from one robot to another. Distinct
from these approaches, our work adopts a model-based perspective for policy transfer. We utilize
differentiable simulations to approximate physical dynamics and directly optimize pre-existing poli-
cies. We address the key differences between source and target environments as rewards where we
accommodate varying manipulation goals that yield different reward functions.
3 PROBLEM STATEMENT
r,source, s(t)
We consider two object manipulation tasks on a robot with m joints. We assume the source ma-
nipulation task is specified by the goal of object pose change ∆ssource ∈ R6. Suppose applying a
given expert action sequence Asource = [a(t)
t=1 on the task would yield a state-action trajectory
o,source ∈ R6, a(t)
r,source ∈ Rm, s(t)
τsource = [(s(t)
source ∈ Rm denotes
robot state, object state and robot action at time t. We assume action sequence Asource can suc-
cessfully complete the task, i.e. moving the object from the starting pose s(1)
o,source to the goal pose
o,source = s(1)
s(T )
t=1
that can successfully complete a new target manipulation task ∆starget specified by the goal of object
pose change ∆starget.
o,source + ∆ssource. Our objective is to derive an action sequence Atarget = [a(t)
source]T
t=1 where s(t)
o,source, a(t)
source)]T
target]T
4 TECHNICAL APPROACH
We approach this problem by defining a path consisting of L tasks
P = [∆s1, ∆s2, . . . , ∆sL]
(1)
that connects the source and target tasks where ∆s1 = ∆ssource is the source task and ∆sL = ∆starget
is the target task. Our approach consists of L − 1 steps of action transfer. At step i, our goal is to
transfer a well-optimized action sequence Ai on task ∆si to be a well-optimized action sequence
3
Preprint
Ai+1 on the next task in the sequence ∆si+1. For any i, we assume the difference between tasks
∆si and ∆si+1 is sufficiently small so that the it is relatively easy to use local information such as
differentiable simulation gradient to optimization for actions transfer.
||∆si − ∆si+1|| < ε1
(2)
where ε1 denotes the upper limit between the final object state for two consecutive sub-tasks. This
property is crucial to our gradient-based method in the following sub-section.
4.1 HOW TO ACCOMPLISH A SUB-TASK
Our approach to deduce the requisite actions is through a gradient-based methodology. Under the
assumption that the subsequent sub-task goal pose deviates from the current goal pose with a limited
distance as described in Eq. 2, we posit that the actions for the sub-task are in close proximity to the
actions of the source. This postulation naturally lends itself to the application of gradient descent for
optimization. We aim to optimize our current action sequence {a(t)
t=1, denoted as Acur, with its
initialization of Ai. The rollout trajectory based on Acur is denoted τcur = {(s(t)
To elaborate, for each specific task, we introduce a loss function, Ltask.
o,cur, a(t)
r,cur, s(t)
cur)}T
cur}T
t=1
Ltask = ||∆scur − ∆si+1||2
(3)
where ∆starget is the object pose change of (i + 1)th sub-task goal and ∆scur is the object pose
change of our rollout trajectory. We regard the task as accomplished if Ltask is smaller than a
certain threshold εt.
Utilizing the capabilities of the differentiable simulation framework Jade, we compute the gradient
(cid:26) ∂Ltask
∂a(t)
cur
. Subsequently, the current actions Acur are updated to minimize
∂Ltask
∂Acur
, denoted as
(cid:27)T
t=1
the task loss Ltask.
Acur ← Acur − η
∂Ltask
∂Acur
(4)
Thus we introduce Algorithm 1 as a function TRANSFERSTEP, since we will reuse this function in
Section 4.1. It takes the trajectory τi for ith sub-task and the object pose change ∆si+1 for (i + 1)th
sub-task as input. And it will output the optimized task loss Ltask, the boolean value X indicating
if the sub-task is successfully completed, and the rollout trajectory τi+1 based on the optimized
actions Acur. If X is True, then Acur is the desired Ai+1. This algorithm iteratively refines the action
sequence Acur over a maximum of nepoch iterations or until a convergence criterion is met.
4.2 SUB-TASKS GENERATION
Given Algorithm 1 and the path P, it is easy to compute the optimized actions At for our target
task, since we can use dynamic programming to optimize Ai+1 based on Ai. The only problem is
to generate one feasible path P where not only the property in Eq. 2 holds but also the Algorithm
1 tends to return the successful result with optimized action sequence Ai+1 and the corresponding
trajectory τi+1 for (i + 1)th sub-task for each index i. This reduces the problem into a path planning
problem in the goal pose space where each node in the space denotes a goal final object state and
we aim to build a path connecting the source goal pose and the target one.
While there are lots of traditional path-planning algorithms in 3-D Euclidean space, they fail to solve
our problem because the goal pose space is in a higher dimension and the obstacle is harder to detect.
We introduce our innovative reinforcement learning method by predicting the difficulty of sub-tasks
using a refined Q-function neural network Q(x; θ) parameterized by θ. Instead of taking input of
the conventional state and action at time t, the network takes a high-level state input x, which could
be any object pose change like ∆starget. The output r would be the estimated reward.
4
Preprint
t=1, ∆si+1
i )}T
o,i, a(t)
Algorithm 1 Sub-Task Accomplishment
1: Input: τi = {(s(t)
r,i , s(t)
2: Output: Ltask, X, τi+1
3: function TRANSFERSTEP(τs, ∆si+1)
s(1)
r,i , a(t)
r,cur ← s(1)
4:
for e in 1, 2, . . . , nepoch do
5:
6:
7:
for t in 1, 2, . . . , T − 1 do
r,cur , s(t+1)
cur ← a(t)
i
, t = 1, 2, . . . , T
o,cur ) ← simulate(s(t)
r,cur, s(t)
o,cur, a(t)
cur)
(s(t+1)
∆scur ← s(T )
o,cur − s(1)
o,cur
Ltask ← ||∆scur − ∆si+1||2
Acur ← Acur − η
if Ltask ≤ εt then
∂Ltask
∂Acur
return Ltask, True, {(s(t)
r,cur, s(t)
return Ltask, False, {(s(t)
r,cur, s(t)
o,cur, a(t)
o,cur, a(t)
cur)}T
t=1
cur)}T
t=1
8:
9:
10:
11:
12:
13:
Unlike traditional RL problems with clear task rewards, the reward in our problem needs an elaborate
design because we are performing path planning on a higher task-space level. We introduce the
reward function as
r(x) = −(λt * Ltask + λd * ||x − ∆starget||2)
(5)
To illustrate this equation, the first term Ltask is computed using Eq. 3 where ∆si+1 is given as x and
∆scur is given by the optimized actions Acur for sub-task goal x. The second term ||x − ∆starget||2,
shortly as Ldis, describes the distance from pose change x to the target pose change ∆starget. Finally,
λt and λd are weight coefficients to balance these two terms. Therefore, such reward results in a
better path-planning algorithm because when the reward is high, both the task loss Ltask and the
distance to target goal Ldis are low.
Suppose we have the accurate Q(x; θ) network, we can generate the path P in either a gradient-based
way or a sample-based way. We employ the sampled-based approach for the current pose transfer
problem to increase the robustness of stochastic noise from the inaccurate network in reality. In
detail, given ith sub-task with a pose change ∆si, we sample n vectors {xj}n
j=1, denoted as S, in
the task space in the neighbourhood of the ith sub-task goal ∆si, so that
||∆si − xj|| < εsample, j = 1, 2, . . . , n
(6)
where εsample is the radius of the neighbourhood. In these n candidates for the (i + 1) sub-task, we
choose the best one k based on our current knowledge to maximize the reward rk
k = arg max
j
rj, j = 1, 2, . . . , n
(7)
Once we get the best candidate xk, we call the function TRANSFERSTEP in Algorithm 1, in an
attempt to optimize an action sequence Ai+1 for the given (i + 1)th sub-task. Should this process
be successful, we shall continue to generate the next sub-task recursively until the target goal is
attained. Otherwise, we shall discard this candidate xk and find an alternative best candidate from
S iteratively, as is shown in Algorithm 2.
To learn an approximate network Q(x; θ), we maintain a dataset D dynamically during the path-
planning process. Each time after we call the TRANSFERSTEP function and get more information
about the task space, we add the data pair (xk, rk) into D, update θ with the Q-learning method to
gain a better network and proceed on path planning.
5
Preprint
4.3
IMPLEMENTATION DETAILS
In this section, we discuss the implementation details of Diff-Transfer in Algorithm 2. To begin
with, we pre-train our network Q(x; θ) with a refined initial reward in Eq. 5, where Ltask is set to a
certain constant ct because we cannot know the difficulty of any sub-task beforehand. Specifically,
we generate labels (xpre, rpre) randomly to build a dataset Dpre and use it to fit θ using a supervised
learning method via minimizing the loss lpre(θ) = ||Q(xpre; θ) − rpre||2. With online dataset D =
{(xk, rk)}m
k=1 collected during execution of our path-planning method, network parameters θ will
be fine-tuned to minimize the loss l(θ) = ||Q(xk; θ)−rk||2. It is worth noting that D doesn't contain
data from Dpre because data in D collected from rollouts in simulation reflect the actual rewards of
sub-tasks while Dpre just provides a rough estimation under the hypothesis that all sub-tasks have
same difficulties, which is hardly true in the real transfer problem.
j=1 in the neighbourhood of ∆si
return τi
if ||∆si − ∆starget|| ≤ εpose then
Randomly sample n vectors S ← {xj}n
rj ← Qθ(xj), j = 1, 2...n.
while S ̸= ∅ do
Algorithm 2 Q-function Network Guided Path Planning
1: function PATHSEARCH(τi, ∆starget)
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
k ← arg maxj rj
Ltask, X, τi+1 ← TRANSFERSTEP(τi, xk)
Ldis ← ||xk − ∆starget||2
rk ← −(λt * Ltask + λd * Ldis)
D ← D ∪ {(xk, rk)}
Update θ using dataset D
if X = True then
S ← S − {xk}
continue
PATHSEARCH(τi+1, ∆starget)
return failure
else
5 EXPERIMENTS
In this section, we present a rigorous experimental framework meticulously designed to elucidate
the effectiveness of our proposed system Diff-Transfer. This exhaustive evaluation encompasses an
assessment of the system's performance across diverse conditions, while also subjecting it to rigor-
ous scrutiny in the presence of unforeseen challenges. The tests conducted in this study are geared
towards offering a comprehensive panorama of the system's capabilities. Our foremost objective
is to substantiate the theoretical foundations expounded earlier and establish a seamless connection
between theory and practical implementation, thereby affirming the system's scalability and adapt-
ability across a multitude of application domains.
5.1 EXPERIMENTAL SETUP
5.1.1 SIMULATION SETTING
We choose multiple manipulation tasks from RLBench (James et al., 2020) and adapt the environ-
ment to the Jade(Yang et al., 2023) simulation. Specifically, we acquire the trajectory of states for
each task, along with the objects' Unified Robot Description Format (URDF) files and correspond-
ing mesh files. Actions are computed utilizing inverse dynamics and optimization within Jade,
providing us with a comprehensive initial trajectory of both states and actions, denoted as τsource.
6
Preprint
(a)
(b)
(c)
(d)
Figure 2: Source Task (grey object) and Target Task (orange object) for (a) Change Clock, (b) Close
Grill, (c) Open Door, and (d) Open Drawer.
5.1.2 EVALUATION METRIC
We employ the number of iterations N in the optimization loop to evaluate the efficiency of our
methods and compare the results. We also report the distance d, which is a task-related metric
describing the completeness of manipulation. For each specific manipulation task, we run 5 times
our method to reduce the effect of randomness and report the mean value for both the iterative steps
and the distance as ̄N and ̄d, and the standard deviation as σN and σd.
5.1.3 MANIPULATION SKILL TRANSFER TASKS
Close Grill The robot is required to close a grill lid. This task is considered successful if the grill
lid has been rotated to close. The distance d describes the distance from the final angle of the grill
lid joint to the target angle, with a unit of degrees.
Change Clock The robot is required to change a clock. This task is considered successful if the
clock pointer has been revoluted to a specific orientation. The distance d describes the distance from
the final angle of the clock pointer to the target angle, with a unit of degrees.
Open Door The robot is required to open a door. This task is considered successful if the door
has been rotated to a specific orientation from the door frame. The distance d describes the distance
from the final angle of the door to the target angle, with a unit of degrees.
Open Drawer The robot is required to open a drawer. The chest has 3 drawers. This task is
considered successful if the specific drawer has been pulled out from the chest. The distance d
describes the distance from the final translation of the drawer to the target angle, with a unit of
meters.
5.1.4
IMPLEMENTATION DETAILS
To illustrate the details presented in Section 4, we define ∆si, the objective of the ith sub-task, as the
base pose change of the manipulated object from its pose in the source task. This definition slightly
diverges from the description in Section 3, as these intricate manipulation tasks require the robot to
manipulate the object's joint, rather than altering its pose by pushing.
We employ a three-layer MLP to implement the Q-function network Q(x; θ). Rather than directly
utilizing the reward function in Eq. 5, we characterize the output network as an estimated loss with
a value of −r(x), explaining why the landscapes in Fig. 3 exhibit a minimum area instead of a
maximum, a point to be discussed in subsequent Section 5.3.
5.2 BASELINE
DMP DMP (Dynamic Movement Primitives) is a method for learning and reproducing complex
dynamic movement skills in robots and other systems, making it easier for them to perform tasks
such as reaching and grasping objects. Specifically, for a transfer task, we use the robot trajectory
of the source task to fit the dmp function, modify the object target on the target task and reproduce
the motion trajectory.
7
Preprint
Method
Task Name
Change Clock
Close Grill
Open Door
Open Drawer
Diff-Transfer (Ours)
MAML
DMG
Direct Transfer
̄N
55.6
66.4
57.8
123.8
σN
61.1
11.5
38.2
103.9
̄d
3.72
1.80
0.64
0.06
σd
1.38
0.55
0.43
0.00
d
success
d
success
N
d
success
10.27
18.54
9.20
0.08
×
×
×
×
27.46
56.71
41.91
0.18
×
×
×
×
1000+
1000+
255
1000+
19.66
8.53
1.40
0.12
×
×
✓
×
Table 1: Experiment Results for MAML, DMG, Direct Transfer and our Diff-Transfer. Diff-Transfer
is executed using 5 distinct random seeds.
Method
Task Name
Change Clock
Close grill
Open Door
Open Drawer
Diff-Transfer
̄d
3.72
1.80
0.64
0.06
σN
61.1
11.5
38.2
103.9
̄N
55.6
66.4
57.8
123.8
Diff-Transfer (λt = 0)
Linear Interpolation
σd
1.38
0.55
0.43
0.00
̄N
51.0
96.6
185.4
527.0
σN
28.7
28.4
118.3
712.0
̄d
3.23
2.45
2.78
0.06
σd
1.70
0.55
2.16
0.00
N
68.0
157.0
113.0
309.0
success
✓
✓
✓
×
d
5.43
3.36
4.11
0.38
Table 2: Experiment Results for Diff-Transfer (Ours), Diff-Transfer (λt = 0), and Linear Interpola-
tion. Both Diff-Transfer and Diff-Transfer (λt = 0) are executed using 5 distinct random seeds.
MAML Model-agnostic meta-learning (MAML) is a meta-learning algorithm that enables ma-
chine learning models to quickly adapt to new tasks with minimal training data by learning good
initializations that can be fine-tuned for specific tasks, making it highly applicable to a variety of
applications. application. Specifically, for a transfer task, we perform learning on 4 source tasks and
perform trajectory prediction on a target task. In our experiments, the trained policy is a two-layer
MLP network with 128 hidden units in each layer. We use the adam optimizer and SGD loss function
to train the policy for 1000 epochs. In each epoch, we perform task-level training and meta-training.
During each task-level training, we sample 20 trajectories on four source tasks to update the param-
eters of the task-level strategy. During each meta-training, we use task-level update parameters to
sample 5 trajectories on 4 source tasks and update the policy parameters. We will train the final
trained policy on the target task for 20 epochs to fine-tune the parameters, and calculate whether the
policy given at this time can complete the target task.
Direct Transfer To demonstrate the efficacy of our path-searching method, we assess the direct
transferring technique on each task, using it as one of the baselines, denoted as Direct Transfer.
Contrary to constructing a path where the source task and the target task are cohesively linked
via several intermediate sub-tasks as in Algorithm 2, Direct Transfer solely endeavors to optimize
an action sequence for the target task, directly drawing from the source task trajectory through
differentiable simulation, as outlined in Algorithm 1.
5.3 EXPERIMENT RESULTS
The iteration counts N and distances d are detailed in Table 1 for Diff-Transfer, MAML, DMG, and
Direct Transfer. As illustrated in the table, our algorithm manifests superior efficacy across all eval-
uated tasks. While MAML and DMG are unable to successfully accomplish any of the four tasks, and
Direct Transfer only yields a successful outcome in the Open Door task, our Diff-Transfer manages
to fulfill all four tasks, achieving a success rate of 100% across 5 varied random seeds. Additionally,
Diff-Transfer requires significantly fewer iterative steps compared to Direct Transfer to accomplish
the transfer task, underscoring the criticality of constructing a seamless path to mitigate the complex-
ity of each sub-task transfer, and highlighting that attempts to transfer via brute force are frequently
either impractical or necessitate more iterations. Regarding MAML and DMG, these methods, being
somewhat antiquated, struggle to finalize this innovative transfer task within a reasonable time.
To confirm the validity of our path-planning approach, we have depicted the landscape of our Q-
function network in Fig. 3. In each depiction, the horizontal axis denotes the translation, and the
vertical axis denotes the orientation, together constituting a task space for any alterations in pose.
The origin represents the target pose change ∆starget while the top right corner represents the source
8
Preprint
(a)
(b)
(c)
(d)
Figure 3: Visualization of learned Q-function Landscapes for (a) Change Clock, (b) Close Grill,
(c) Open Door, and (d) Open Drawer. The x-axis represents translation, and the y-axis represents
orientation. The origin symbolizes the change in target pose, ∆starget, while the top right corner
denotes the change in source task pose, ∆ssource.
task pose change ∆ssource. As exhibited in the images, there exists a minimum area surrounding the
origin, indicating that the network directs correctly toward the target task. Moreover, this area does
not necessarily need to be precisely at the origin; given the varying complexities of different tasks,
completing a sub-task pose near the ∆ssource is often more feasible, resulting in a lower value of
Ltask in Eq. 3 and, subsequently, contributing to a reduced total loss. This task-level characteristic
elucidates why these landscapes exhibit a similar pattern with the aforementioned minimum area
around the origin, aligning with our anticipations, even though the low-level manipulations might
significantly diverge.
5.4 ABLATION STUDY: Employ Different Path-Planning Methods
We conduct two different ablation tests for Diff-Transfer with distinct path-planning methods.
1. We remove the Q-learning network and replace it with a deterministic linear interpolation
method between ∆ssource and ∆starget, denoted as Linear Interpolation.
2. We refine the reward function in Eq. 5 by removing the task loss term, with λt = 0, denoted
as Diff-Transfer (λt = 0).
Our experiment results for the ablation study are presented in Table 2. Generally speaking, both
Diff-Transfer and Diff-Transfer (λt = 0) achieve a 100% success rate across four tasks, employing
5 distinct random seeds, while Linear Interpolation succeeds in three out of the four transfer tasks.
This denotes that path planning, even by naive methods, can substantially elevate the success rate in
transferring manipulation tasks. To elaborate, the data reveals that our Diff-Transfer excels in tasks
such as Close grill, Open Door, and Open Drawer, exhibiting quicker convergence (smaller N ) and
heightened precision in manipulation outcomes (smaller d) compared to Diff-Transfer (λt = 0) and
Linear Interpolation. Regarding the Change Clock task, Diff-Transfer, ablation, and Linear Interpo-
lation display comparable performance, suggesting that accomplishing this transfer task via differen-
tiable physics simulation is relatively uncomplicated. In conclusion, the path-planning methodology
employed in Diff-Transfer is imperative and efficient, leading to enhanced success rates and reduced
time expenditures in most instances.
6 CONCLUSION
In this paper, we introduced an advanced framework aiming to revolutionize the paradigm of robotic
manipulation skill acquisition through transfer learning. Drawing inspiration from the omnipresence
of Newtonian principles, our method centers on the potential to generalize manipulation strategies
across object poses in 3-D Euclidean space. To navigate the complex landscape, we instigate a
bridge mechanism, employing a continuum of intermediate sub-tasks as conduits for the seamless
relay of skills between distinct object poses, where the path of sub-tasks is generated through a re-
fined Q-function network with task-level states and rewards. This focus is further bolstered by our
integration of differentiable simulation, affording us an intricate understanding of the physical in-
tricacies inherent in pose transformations. The compelling results from our meticulous experiments
9
Preprint
underscore the robustness and efficacy of our proposed framework. In summation, our pioneering
contributions herald a new era in robotic adaptability, reducing the dependency on ground-up learn-
ing and accelerating the skill transfer processes, particularly in the realms of manipulations with
different object poses.
REFERENCES
Sameer Agarwal, Keir Mierle, and Others. Ceres solver. http://ceres-solver.org.
Rika Antonova, Jingyun Yang, Krishna Murthy Jatavallabhula, and Jeannette Bohg. Rethinking
optimization with differentiable simulation from a global perspective. In 6th Annual Conference
on Robot Learning, 2022.
Bradley Bell. Cppad: a package for c++ algorithmic differentiation. http://www.coin-or.
org/CppAD, 2020.
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal
Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao
JAX: composable transformations of Python+NumPy programs, 2018. URL http:
Zhang.
//github.com/google/jax.
Claire Chen, Preston Culbertson, Marion Lepert, Mac Schwager, and Jeannette Bohg. Trajectotree:
Trajectory optimization meets tree search for planning multi-contact dexterous manipulation. In
2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 8262–
8268, 2021. doi: 10.1109/IROS51168.2021.9636346.
Xianyi Cheng, Eric Huang, Yifan Hou, and Matthew T. Mason. Contact mode guided sampling-
based planning for quasistatic dexterous manipulation in 2d. In 2021 IEEE International Confer-
ence on Robotics and Automation (ICRA), pp. 6520–6526, 2021. doi: 10.1109/ICRA48506.2021.
9560766.
Cheng Chi, Benjamin Burchfiel, Eric Cousineau, Siyuan Feng, and Shuran Song. Iterative resid-
ual policy for goal-conditioned dynamic manipulation of deformable objects. In Proceedings of
Robotics: Science and Systems (RSS), 2022.
End-to-end differentiable physics
Filipe de Avila Belbute-Peres, Kevin Smith, Kelsey Allen, Josh Tenenbaum, and J. Zico
In S. Ben-
Kolter.
and R. Garnett
gio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi,
(eds.), Advances in Neural
Information Processing Systems, volume 31. Curran Asso-
ciates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/
842424a1d0595b76ec4fa03c46e8d755-Paper.pdf.
learning and control.
for
Jonas Degrave, Michiel Hermans, Joni Dambre, et al. A differentiable physics engine for deep
learning in robotics. Frontiers in neurorobotics, pp. 6, 2019.
Tao Du, Kui Wu, Pingchuan Ma, Sebastien Wah, Andrew Spielberg, Daniela Rus, and Wojciech
Matusik. Diffpd: Differentiable projective dynamics. ACM Trans. Graph., 41(2), nov 2021.
ISSN 0730-0301. doi: 10.1145/3490168. URL https://doi.org/10.1145/3490168.
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation
of deep networks. In International conference on machine learning, pp. 1126–1135. PMLR, 2017.
Marco Gabiccini, Alessio Artoni, Gabriele Pannocchia, and Joris Gillis. A Computational Frame-
work for Environment-Aware Robotic Manipulation Planning, pp. 363–385. Springer Interna-
tional Publishing, 2018. ISBN 978-3-319-60916-4. doi: 10.1007/978-3-319-60916-4 21.
Moritz Geilinger, David Hahn, Jonas Zehnder, Moritz B ̈acher, Bernhard Thomaszewski, and Stelian
Coros. Add: Analytically differentiable dynamics for multi-body systems with frictional contact.
ACM Transactions on Graphics (TOG), 39(6):1–15, 2020.
10
Preprint
Sehoon Ha, Stelian Coros, Alexander Alspach, Joohyung Kim, and Katsu Yamane. Joint optimiza-
tion of robot design and motion parameters using the implicit function theorem. In Siddhartha
Srinivasa, Nora Ayanian, Nancy Amato, and Scott Kuindersma (eds.), Robotics, Robotics: Sci-
ence and Systems, United States, 2017. MIT Press Journals. doi: 10.15607/rss.2017.xiii.003.
Publisher Copyright: © 2017 MIT Press Journals. All rights reserved.; 2017 Robotics: Science
and Systems, RSS 2017 ; Conference date: 12-07-2017 Through 16-07-2017.
Philipp Holl, Vladlen Koltun, and Nils Thuerey. Learning to control pdes with differentiable physics.
arXiv preprint arXiv:2001.07457, 2020.
Yuanming Hu, Tzu-Mao Li, Luke Anderson, Jonathan Ragan-Kelley, and Fr ́edo Durand. Taichi: a
language for high-performance computation on spatially sparse data structures. ACM Transac-
tions on Graphics (TOG), 38(6):201, 2019a.
Yuanming Hu, Jiancheng Liu, Andrew Spielberg, Joshua B Tenenbaum, William T Freeman, Jiajun
Wu, Daniela Rus, and Wojciech Matusik. Chainqueen: A real-time differentiable physical simu-
lator for soft robotics. In 2019 International conference on robotics and automation (ICRA), pp.
6265–6271. IEEE, 2019b.
Zheyuan Hu, Aaron Rovinsky, Jianlan Luo, Vikash Kumar, Abhishek Gupta, and Sergey Levine.
Reboot: Reuse data for bootstrapping efficient real-world dexterous manipulation. arXiv preprint
arXiv:2309.03322, 2023.
Mingxiao Huo, Mingyu Ding, Chenfeng Xu, Thomas Tian, Xinghao Zhu, Yao Mu, Lingfeng Sun,
Masayoshi Tomizuka, and Wei Zhan. Human-oriented Representation Learning for Robotic Ma-
nipulation. arXiv e-prints, art. arXiv:2310.03023, October 2023.
Stephen James, Zicong Ma, David Rovick Arrojo, and Andrew J Davison. Rlbench: The robot
learning benchmark & learning environment. IEEE Robotics and Automation Letters, 5(2):3019–
3026, 2020.
Krishna Murthy Jatavallabhula, Miles Macklin, Florian Golemo, Vikram Voleti, Linda Petrini, Mar-
tin Weiss, Breandan Considine, J ́erˆome Parent-L ́evesque, Kevin Xie, Kenny Erleben, et al. grad-
sim: Differentiable simulation for system identification and visuomotor control. arXiv preprint
arXiv:2104.02646, 2021.
Pingcheng Jian, Chao Yang, Di Guo, Huaping Liu, and Fuchun Sun. Adversarial skill learning
for robust manipulation. In 2021 IEEE International Conference on Robotics and Automation
(ICRA), pp. 2555–2561. IEEE, 2021.
George Dimitri Konidaris and Andrew G Barto. Building portable options: Skill transfer in rein-
forcement learning. In Ijcai, volume 7, pp. 895–900, 2007.
Alessandro Lazaric, Marcello Restelli, and Andrea Bonarini. Transfer of samples in batch rein-
forcement learning. In Proceedings of the 25th international conference on Machine learning,
pp. 544–551, 2008.
Yifei Li, Tao Du, Kui Wu, Jie Xu, and Wojciech Matusik. Diffcloth: Differentiable cloth simulation
ISSN 0730-0301. doi: 10.1145/
with dry frictional contact. ACM Trans. Graph., mar 2022.
3527660. URL https://doi.org/10.1145/3527660. Just Accepted.
Junbang Liang, Ming Lin, and Vladlen Koltun. Differentiable cloth simulation for inverse prob-
In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alch ́e-Buc, E. Fox, and R. Gar-
lems.
nett (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Asso-
ciates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/
28f0b864598a1291557bed248a998d4e-Paper.pdf.
Xingyu Lin, Zhiao Huang, Yunzhu Li, Joshua B. Tenenbaum, David Held, and Chuang Gan. Diff-
skill: Skill abstraction from differentiable physics for deformable object manipulations with tools.
2022a.
11
Preprint
Xingyu Lin, Carl Qi, Yunchu Zhang, Zhiao Huang, Katerina Fragkiadaki, Yunzhu Li, Chuang Gan,
and David Held. Planning with spatial-temporal abstraction from point clouds for deformable
object manipulation. In 6th Annual Conference on Robot Learning, 2022b. URL https://
openreview.net/forum?id=tyxyBj2w4vw.
Chenyu Liu, Yan Zhang, Yi Shen, and Michael M Zavlanos. Learning without knowing: Unobserved
context in continuous transfer reinforcement learning. In Learning for Dynamics and Control, pp.
791–802. PMLR, 2021.
Xingyu Liu, Deepak Pathak, and Kris Kitani. Revolver: Continuous evolutionary models for robot-
to-robot policy transfer. In International Conference on Machine Learning, pp. 13995–14007.
PMLR, 2022a.
Xingyu Liu, Deepak Pathak, and Kris M Kitani. Herd: Continuous human-to-robot evolution for
learning from human demonstration. In 6th Annual Conference on Robot Learning, 2022b.
Jun Lv, Qiaojun Yu, Lin Shao, Wenhai Liu, Wenqiang Xu, and Cewu Lu. Sagci-system: Towards
In 2022 IEEE
sample-efficient, generalizable, compositional, and incremental robot learning.
International Conference on Robotics and Automation (ICRA). IEEE, 2022.
Tobia Marcucci, Marco Gabiccini, and Alessio Artoni. A two-stage trajectory optimization strat-
egy for articulated bodies with unscheduled contact sequences. IEEE Robotics and Automation
Letters, 2(1):104–111, 2017. doi: 10.1109/LRA.2016.2547024.
Igor Mordatch, Zoran Popovi ́c, and Emanuel Todorov. Contact-invariant optimization for hand
manipulation. In Proceedings of the ACM SIGGRAPH/Eurographics Symposium on Computer
Animation, SCA '12, pp. 137–144. Eurographics Association, 2012. ISBN 9783905674378.
Tao Pang, H. J. Terry Suh, Lujie Yang, and Russ Tedrake. Global planning for contact-rich manipu-
lation via local smoothing of quasi-dynamic contact models, 2022.
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor
Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style,
high-performance deep learning library. Advances in neural information processing systems, 32:
8026–8037, 2019.
Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, and Ming C Lin. Scalable differentiable physics for
learning and control. arXiv preprint arXiv:2007.02168, 2020.
Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, and Ming C Lin. Efficient differentiable simulation
of articulated bodies. In International Conference on Machine Learning, pp. 8661–8671. PMLR,
2021.
Hyung Ju Suh, Max Simchowitz, Kaiqing Zhang, and Russ Tedrake. Do differentiable simulators
give better policy gradients? In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepes-
vari, Gang Niu, and Sivan Sabato (eds.), Proceedings of the 39th International Conference on Ma-
chine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 20668–20696.
PMLR, 17–23 Jul 2022.
Tetsuya Takahashi, Junbang Liang, Yi-Ling Qiao, and Ming C. Lin. Differentiable fluids with solid
coupling for learning and control. Proceedings of the AAAI Conference on Artificial Intelligence,
35(7):6138–6146, May 2021. doi: 10.1609/aaai.v35i7.16764. URL https://ojs.aaai.
org/index.php/AAAI/article/view/16764.
Matthew E Taylor and Peter Stone. Transfer learning for reinforcement learning domains: A survey.
Journal of Machine Learning Research, 10(7), 2009.
The Theano Development Team, Rami Al-Rfou, Guillaume Alain, Amjad Almahairi, Christof
Angermueller, Dzmitry Bahdanau, Nicolas Ballas, Fr ́ed ́eric Bastien, Justin Bayer, Anatoly Be-
likov, et al. Theano: A python framework for fast computation of mathematical expressions.
arXiv preprint arXiv:1605.02688, 2016.
12
Preprint
Andrea Tirinzoni, Rafael Rodriguez Sanchez, and Marcello Restelli. Transfer of value functions via
variational methods. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi,
and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31. Cur-
ran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper_files/
paper/2018/file/9023effe3c16b0477df9b93e26d57e2c-Paper.pdf.
Dylan Turpin, Liquan Wang, Eric Heiden, Yun-Chun Chen, Miles Macklin, Stavros Tsogkas, Sven
Dickinson, and Animesh Garg. Grasp'd: Differentiable contact-rich grasp synthesis for multi-
fingered hands. In Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel,
October 23–27, 2022, Proceedings, Part VI, pp. 201–221. Springer, 2022.
Kiwon Um, Robert Brand, Yun Raymond Fei, Philipp Holl, and Nils Thuerey. Solver-in-the-loop:
Learning from differentiable physics to interact with iterative pde-solvers. Advances in Neural
Information Processing Systems, 33:6111–6122, 2020.
Nils Wandel, Michael Weinmann, and Reinhard Klein. Learning incompressible fluid dynam-
arXiv preprint
ics from scratch–towards fast, differentiable fluid models that generalize.
arXiv:2006.08762, 2020.
Keenon Werling, Dalton Omens, Jeongseok Lee, Ioannis Exarchos, and C Karen Liu. Fast and
feature-complete differentiable physics for articulated rigid bodies with contact. In Proceedings
of Robotics: Science and Systems (RSS), July 2021.
Zhuo Xu, Wenhao Yu, Alexander Herzog, Wenlong Lu, Chuyuan Fu, Masayoshi Tomizuka, Yunfei
Bai, C Karen Liu, and Daniel Ho. Cocoi: Contact-aware online context inference for generaliz-
able non-planar pushing. In 2021 IEEE/RSJ International Conference on Intelligent Robots and
Systems (IROS), pp. 176–182. IEEE, 2021.
Gang Yang, Siyuan Luo, and Lin Shao. Jade: A differentiable physics engine for articulated rigid
bodies with intersection-free frictional contact. arXiv preprint arXiv:2309.04710, 2023.
Xinyuan Yu, Siheng Zhao, Siyuan Luo, Gang Yang, and Lin Shao. Diffclothai: Differentiable
cloth simulation with intersection-free frictional contact and differentiable two-way coupling with
articulated rigid bodies. In 2023 IEEE/RSJ International Conference on Intelligent Robots and
Systems (IROS). IEEE, 2023.
Xiang Zhang, Shiyu Jin, Changhao Wang, Xinghao Zhu, and Masayoshi Tomizuka. Learning inser-
tion primitives with discrete-continuous hybrid action space for robotic assembly tasks. In 2022
International Conference on Robotics and Automation (ICRA), pp. 9881–9887. IEEE, 2022.
Xiang Zhang, Siddarth Jain, Baichuan Huang, Masayoshi Tomizuka, and Diego Romeres. Learning
generalizable pivoting skills. arXiv preprint arXiv:2305.02554, 2023a.
Xiang Zhang, Changhao Wang, Lingfeng Sun, Zheng Wu, Xinghao Zhu, and Masayoshi Tomizuka.
Efficient sim-to-real transfer of contact-rich manipulation skills with online admittance residual
learning. In 7th Annual Conference on Robot Learning, 2023b.
Tony Z. Zhao, Jianlan Luo, Oleg Sushkov, Rugile Pevceviciute, Nicolas Heess, Jon Scholz, Stefan
Schaal, and Sergey Levine. Offline meta-reinforcement learning for industrial insertion. In 2022
International Conference on Robotics and Automation (ICRA), pp. 6386–6393, 2022. doi: 10.
1109/ICRA46639.2022.9812312.
Xinghao Zhu, JingHan Ke, Zhixuan Xu, Zhixin Sun, Bizhe Bai, Jun Lv, Qingtao Liu, Yuwei Zeng,
Qi Ye, Cewu Lu, Masayoshi Tomizuka, and Lin Shao. Diff-lfd: Contact-aware model-based
learning from visual demonstration for robotic manipulation via differentiable physics-based sim-
ulation and rendering. In Conference on Robot Learning. PMLR, 2023a.
Xinghao Zhu, Wenzhao Lian, Bodi Yuan, C. Daniel Freeman, and Masayoshi Tomizuka. Allowing
safe contact in robotic goal-reaching: Planning and tracking in operational and null spaces. In
2023 IEEE International Conference on Robotics and Automation (ICRA), pp. 8120–8126, 2023b.
doi: 10.1109/ICRA48891.2023.10160649.
13
|
|
http://arxiv.org/abs/2310.04929v1 | "2023-10-07T21:57:23" | "2023-10-07T21:57:23" | DISCOVER: Making Vision Networks Interpretable via Competition and
Dissection | Modern deep networks are highly complex and their inferential outcome very
hard to interpret. This is a serious obstacle to their transparent deployment
in safety-critical or bias-aware applications. This work contributes to
post-hoc interpretability, and specifically Network Dissection. Our goal is to
present a framework that makes it easier to discover the individual
functionality of each neuron in a network trained on a vision task; discovery
is performed in terms of textual description generation. To achieve this
objective, we leverage: (i) recent advances in multimodal vision-text models
and (ii) network layers founded upon the novel concept of stochastic local
competition between linear units. In this setting, only a small subset of layer
neurons are activated for a given input, leading to extremely high activation
sparsity (as low as only $\approx 4\%$). Crucially, our proposed method infers
(sparse) neuron activation patterns that enables the neurons to
activate/specialize to inputs with specific characteristics, diversifying their
individual functionality. This capacity of our method supercharges the
potential of dissection processes: human understandable descriptions are
generated only for the very few active neurons, thus facilitating the direct
investigation of the network's decision process. As we experimentally show, our
approach: (i) yields Vision Networks that retain or improve classification
performance, and (ii) realizes a principled framework for text-based
description and examination of the generated neuronal representations. | [
"Konstantinos P. Panousis",
"Sotirios Chatzis"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04929v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04929v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.LG",
"stat.ML"
] | 3
2
0
2
t
c
O
7
]
V
C
.
s
c
[
1
v
9
2
9
4
0
.
0
1
3
2
:
v
i
X
r
a
DISCOVER:
Making Vision Networks Interpretable via
Competition and Dissection
Konstantinos Panousis
Department of Electrical Eng., Computer Eng., and Informatics
Cyprus University of Technology
Limassol 3036, Cyprus
k.panousis@cut.ac.cy
Sotirios Chatzis
Department of Electrical Eng., Computer Eng., and Informatics
Cyprus University of Technology
Limassol 3036, Cyprus
sotirios.chatzis@cut.ac.cy
Abstract
Modern deep networks are highly complex and their inferential outcome very
hard to interpret. This is a serious obstacle to their transparent deployment in
safety-critical or bias-aware applications. This work contributes to post-hoc inter-
pretability, and specifically Network Dissection. Our goal is to present a framework
that makes it easier to discover the individual functionality of each neuron in a net-
work trained on a vision task; discovery is performed in terms of textual description
generation. To achieve this objective, we leverage: (i) recent advances in multi-
modal vision-text models and (ii) network layers founded upon the novel concept
of stochastic local competition between linear units. In this setting, only a small
subset of layer neurons are activated for a given input, leading to extremely high
activation sparsity (as low as only ≈ 4%). Crucially, our proposed method infers
(sparse) neuron activation patterns that enables the neurons to activate/specialize to
inputs with specific characteristics, diversifying their individual functionality. This
capacity of our method supercharges the potential of dissection processes: human
understandable descriptions are generated only for the very few active neurons,
thus facilitating the direct investigation of the network's decision process. As
we experimentally show, our approach: (i) yields Vision Networks that retain or
improve classification performance, and (ii) realizes a principled framework for
text-based description and examination of the generated neuronal representations.
1
Introduction
In recent years, Deep Neural Networks (DNNs) have exhibited an overwhelming success in a variety
of tasks and applications, achieving state-of-the-art results in Machine Vision, Automatic Speech
Recognition, and NLP. This unprecedented success is however accompanied with a limited capacity
to audit them in view of reliability standards. Indeed, due to the immense complexity of their
architectures, DNNs are usually employed as off-the-shelf solutions for a variety of applications.
However, their vast and highly accelerated adoption rate emphasizes the importance of being able
to explain how DNNs function and interpret how predictions are made. This process will allow for
37th Conference on Neural Information Processing Systems (NeurIPS 2023).
uncovering their inherent biases and even for correcting the failures in their decision making process,
facilitating a safe, trustworthy and robust real-world deployment in safety-critical applications.
Fortunately, this limitation has recently received a lot of attention in the Deep Learning (DL) research
community, leading to the development of ways forward towards Interpretable Deep Networks. In
this context, we can identify two major approaches: ante- and post-hoc methods. In the former, the
main rationale is to build networks from scratch, that integrate intepretability components into the
network itself; Concept Bottleneck Models (CBMs) are a characteristic case [13, 17, 19, 25]. In
post-hoc approaches, backbone architectures are augmented with novel frameworks aiming to provide
explanations of the prediction process, e.g. saliency maps [15, 27] and Network Dissection [2, 9].
Each approach exhibits its own advantages and drawbacks. For example, ante-hoc models usually
suffer from significant performance drop, often requiring additional data to train. On the other hand,
even though post-hoc models avoid the complexity of re-training, the results may lend themselves to
subjective interpretations that depend on the method's assumptions.
This work takes a novel route: it aims at improving the efficacy of post-hoc methods by addressing
some fundamental building blocks of Deep Networks. Specifically, we depart from the commonly
used forms of non-linearities in Deep Networks and propose the use of competition-based activations
imposed upon otherwise linear projection units; these form the so-called Stochastic Local Winner-
Takes-All (LWTA) layers [22]. Our inspiration stems from biological arguments: it has been shown
that brain neurons with similar functions aggregate together in blocks and locally compete for their
activation; the winner gets to pass its response to other neurons outside the block while the rest are
inhibited to silence [30, 1, 14]. Stochastic LWTA activations have recently been employed on DNNs
with striking success, exhibiting: (i) significant compression capabilities [22], (ii) unique representa-
tion diversification ability [23], (iii) strong adversarial robustness against powerful adversarial attacks
[24], (iv) the best ever reported performance in model-agnostic meta-learning (MAML), in terms
of both accuracy and network footprint [11]. Other significant properties of LWTA-based networks
include noise suppression, specialization, automatic gain control and robustness to catastrophic
forgetting[29, 8, 3], while their prowess has also been shown in Transformer networks dealing with
end-to-end translation of sign-language video into text [32].
In building interpretable networks, the proposed competition-based rationale comes with two impor-
tant benefits: (i) a naturally arising activation sparsity: only the winner unit in each block passes its
computed output to the next layer, while the rest pass zero values; and (ii) a data-driven pattern of
neuron functionality, based on the probability of a unit being the active winner for a given input.
This mode of operation naturally lends itself to the post-hoc paradigm of unraveling and inspecting
individual neuron functionality, which this work addresses. In this setting, recent works on automated
methods aim to provide high quality descriptions of neurons by leveraging multi-modal models to
match neuron functionality to text-based unrestricted concepts.
We leverage these ideas to address the interpretation limitations of conventional architectures, by intro-
ducing the Dissection of Competitive Vision Networks (DISCOVER) approach, a novel framework
towards interpretable Vision Networks. Our contributions can be summarized as follows:
• We construct, implement and train a variety of Competitive Vision Networks (CVNs) utiliz-
ing novel competition arguments, including both CNN and Transformer-based architectures.
This is the first time in the literature that CVNs are trained on a large scale and their behavior
is investigated with respect to both: (i) performance, and (ii) interpretation properties.
• We perform post-hoc network dissection using multimodal models to identify the underlying
functionality and contribution of each individual neuron; to this end, we leverage the unique
characteristics of competition between neurons and novel Network Dissection approaches.
• We examine the specialization properties of CVNs in the context of interpretability by
investigating the generated per-example neuronal representations.
2 Background
Image-Text Models. Contrastive Language-Image Pre-training (CLIP) [26] constitutes one of the
best-known methods for multimodal deep learning, combining visual representations with natural
language supervision. The main operating principle of CLIP relies on the usage of image-caption
2
pairs in order to obtain representations. Specifically, CLIP comprises an image encoder, denoted
by ET (*) and a text encoder EI (*) that are trained simultaneously on the grounds of a contrastive
learning objective[28, 4]. Specifically, assuming a batch of N (image, text) pairs, i.e. {(xi, ti)}N
i=1,
CLIP learns a multi-modal embedding space by maximizing the cosine similarity of the embeddings
Ii = EI (xi) and Ti = ET (ti), between the N correct pairs, while minimizing the cosine similarity
between the other N 2 − N combinations. During inference, we can use natural language supervision
to perform zero-shot classification of any given image and labels. Thus, given a test image xtest and
some labels {tj}M
j=1, we can use the learned encoders and select the image-label pair that has the
highest similarity of all the possible combinations.
Network Dissection. Network Dissection constitutes one of the most popular approaches for
understanding and describing the contribution of individual deep network units in the produced
inferential outcomes. In [2], a method that yields descriptive outcomes in terms of concepts is
presented. To this end, the authors introduce a newly developed densely-labeled dataset, named
Broden; this contains pre-determined concepts, images and their associated pixel-level labels. The
main principle is to use the Intersection over Union (IoU) score as a measure of relevance between
each concept and neuron in the set. However, the proposed method requires the use of dense labels
for training, while at the same time the concepts are restricted to the pre-defined label set.
This limitation inspired the development of MILAN [9], an automated method that addresses the
notion of pre-defined concepts through the generation of unrestricted description via generative
image-to-text models. Nevertheless, the requirement for human annotation is still present, similar
to Network Dissection [2]. CLIP-Dissect [20] bypasses this restriction by leveraging multimodal
image-text models, and specifically CLIP; this allows for decoupling the dependence between the
concept set and the probing dataset. Thus, any network can be dissected, using any text corpus to
form the concept set, any image probing dataset, and any appropriate similarity measure for matching
concepts to neurons.
In this work, we exploit the flexibility of CLIP-Dissect and extend it in the context of Competitive
Vision Networks. Differently than CLIP-Dissect, we mainly focus our analysis on the properties of
Vision Transformer architectures with respect to neuron identification.
Competitive Vision Networks. Recent works have explored a fundamentally different paradigm
for the latent unit operation of DNNs, based on the concept of local competition among units (LWTA)
[29]. In this setting, latent units compute their response and compete for their activation. The winner
passes its (linear) response to the next layer, while the rest output zero values. In the following, we
will be referring to these networks as Competitive Vision Networks (CVNs).
Let us consider an input x ∈ RJ presented to a hidden layer of a DNN comprising K hidden units
and a weight matrix W ∈ RJ×K. To compute a typical non-linear activation, each hidden unit in
the layer performs an inner product computation with its respective weights wk ∈ RJ yielding the
k x ∈ R; this usually passes through a non-linear activation σ(*), such
intermediate response hk = wT
that the final layer output reads: y = [y1, . . . , yK], where yk = σ(hk), ∀k.
In a corresponding LWTA-based layer, U singular units are grouped together forming the so-called
LWTA blocks. Hereinafter, we denote by B the number of LWTA blocks in the layer, and with U the
number of linear competing units therein. The aggregation operation is manifested via the definition of
the layer's weights as a three-dimensional matrix W ∈ RJ×B×U ; this structural modification implies
that each input dimension of x is now presented to each block b and each unit u therein; in turn, all
b,ux ∈ R, ∀b, u
units compute their response via the standard inner-product computation hb,u = wT
and competition takes place among them. The fundamental principle of competition is that out of
the U competing units, only one can be the winner. This unit gets to convey its activation outside
the block, i.e. the next layer, while the rest output zero values. This process is instantiated via an
appropriate competition function that encodes the outcome of the competition in each block.
Contrary to the conventional definition, where the layer's output arises as the concatenation of
the individual response of each unit, in the LWTA-based framework, the final output yB*U is now
constructed from B sub-vectors, one for each LWTA block that contains a single non-zero entry; this
corresponds to the response of the winner unit in said block. Thus, an inherent property of the LWTA
mechanism is the naturally emerging sparse representations. Indeed, considering a fixed number of
units per layer, we can observe that the higher the number of competitors U , the sparser the layer
3
Figure 1: Detailed bisection of the bth Stochastic LWTA block. Presented with an input x ∈ RJ , each
unit u computes its activation hb,u via different weights wb,u ∈ RJ , i.e., hb,u = wT
b,ux. The linear
responses are concatenated, s.t., hb = [hb,1, . . . , hb,U ], and transformed into probabilities via the
softmax operation. Then, a Discrete sample ξb = [ξb,1, . . . , ξb,U ] is drawn, which is a one-hot vector
with a single non-zero entry at position u′, denoting the winner unit in the block; unit u′, passes its
linear response to the next layer, while the rest pass zero values. Image from [23].
output: when U = 2, only 50% of the units will be active per example, when U = 4 only 25% and
so on. This gives rise to a sparse activation mode of operation that has been empirically shown to
endow deep architectures with significant properties including strong adversarial robustness [24] and
substantial representation diversification [23]. One design choice that we need to address concerns
the nature of the competition: deterministic or stochastic. The former is the most typical approach
in the LWTA literature; in this case, the unit with the highest activation is deemed the winner each
time. The latter is founded upon novel stochastic arguments proposed in [22]. This formulation has
been shown to consistently outperform its deterministic counterpart [21, 24, 32, 11]. Thus, we adopt
stochastic competition in our approach.
The stochastic variant of the competition function entails the introduction of an appropriate set of
discrete latent variables for each LWTA block b, ξb ∈ one_hot(U ), that encode the (stochastic) out-
come of the competition therein. The latent indicators constitute one-hot vectors with U components;
that is, vectors containing a single non-zero entry at the index position corresponding to the winner
unit in the block. The output y of a stochastic LWTA layer's (b, u)th component yb,u yields:
yb,u = ξb,u
J
(cid:88)
j=1
wj,b,u * xj ∈ R
(1)
We postulate that these latent indicators ξb, ∀b, are drawn from a Categorical distribution driven from
the intermediate linear inner-product computations that each unit performs. Evidently, the higher the
response of a particular unit in a block (relative to the others), the higher its probability of being the
winner; however, the final decision remains stochastic. We can formulate this rationale as:
q(ξb) = Categorical
ξb
(cid:32)
(cid:33)
(cid:12)
(cid:12)
(cid:12)
Πb(x)
(cid:12)
(cid:12)
, Πb(x) = Softmax
J
(cid:88)
[wj,b,u]U
u=1 * xj
,
∀b
(2)
j=1
u=1 denotes the vector concatenation of the set {wj,b,u}U
where Πb(x) is a vector comprising the activation probability of each neuron in the block, and
[wj,b,u]U
u=1. Each unit in each block computes
its intermediate linear inner-product; these are then passed to a softmax transformation and used to
draw samples from a categorical distribution. The resulting discrete vector contains a single non-zero
entry denoting the winner of the block. The intermediate computation of the winner unit passes out
as its activation; the rest units pass zero-valued activations. A graphical illustration of the stochastic
LWTA structure is provided in Fig. 1.
In the context of attention-based architectures, the encoder of Vision Transformers (ViTs) [6]
comprises alternating layers of Multi-head Self-Attention (MSA), MLP blocks, Layer Normalization
4
(LN) and residual connections. Each MLP block comprises two layers with a GELU non-linearity
in between. Within the CVN framework, we replace GELU layers with stochastic LWTA layers.
This modeling decision is motivated by recent works that have shown that transformer MLPs encode
knowledge attributes [5, 7, 18]. We posit that this formulation facilitates neuron identification and
interpretation via analysis of the arising competition patterns; we explore its potency in the following
sections.
Further, convolutional operations also constitute an integral part of various architectures. To account
for this fact, and for completeness, we also consider the convolutional variant of the stochastic
LWTA layer proposed in [22]. Due to space constraints, and since we mainly focus our analysis on
attention-based architectures, we provide the formulation in the Supplemental Material.
3 DISCOVER
3.1 Training and Inference Algorithms for CVNs
CVNs comprise additional auxiliary variables denoting the winner in each LWTA block; thus, we
need to devise an appropriate training regime that takes into consideration the stochastic nature of said
variables. To this end, we turn to Stochastic Gradient Variational Bayes (SGVB) [12], and construct
an Evidence Lower Bound (ELBO) objective. Assuming a dataset D = {X i, yi}N
i=1, and denoting
as f (X i; ˆξ) the cross-entropy between the target labels yi and the target probabilities emerging from
a CVN, the objective reads:
LCVN = −
(cid:88)
(cid:16)
(cid:17)
yi, f (X i; ˆξ)
CE
− KL[q(ξ)||p(ξ)]
(3)
X i,yi∈D
where ˆξ denotes samples from the (posterior) distributions of all latent variables, ξ, in all layers,
and KL[q(ξ)||p(ξ)] denotes the Kullback-Leibler divergence between the posterior and the prior.
We assume a symmetric Categorical prior for the latent variable indicators ξ; hence, p(ξb) =
Categorical(1/U ), ∀b. For all the computations we draw just one sample, but we consider it
as a differentiable expression; this allows for very low variance gradients during training, which
ensures convergence (reparameterization trick). Since the Categorical distribution is not amenable
to differentiation, we enable reparameterization by resorting to a continuous relaxation, namely
Gumbel-Softmax (GS) [16, 10]. In contrast to previous works [22, 23], we use the Straight-Through
variant of GS, which we have seen to offer better convergence properties. We present the exact
sampling procedure in the Supplemental Material. During inference, we directly draw samples from
the trained posteriors and determine the winning units in each layer along with their responses (Eq.
2).
3.2 Dissection
For dissecting the considered CVNs, we draw inspiration from CLIP-Dissect [20]. We employ a
CLIP model to identify the functionality of each neuron in a stochastic LWTA block in terms of a
given concept set; this will be matched with a textual description. There are three key components
that define the approach: (i) a concept set S, where |S| = M , (ii) a dataset that is used as a probe to
identify the individual functionality of neurons denoted by Dprobe, where |Dprobe| = N , and (iii) the
network to be investigated, denoted by f (x). The main principle is to match neuronal activations
with concepts using: (i) the activation matrix P that measures the similarity between images and
concepts, and (ii) a summary of the individual neuronal activations of the network being probed to
the given probe dataset.
Concept Activation Matrix. We use the image and text encoder of the CLIP model, denoted by
EI and ET respectively, and compute the respective embeddings Ii and Ti for each image xi and
concept ti. This results in a concept activation matrix P ∈ RN ×M , where each entry (i, j) denotes
the cosine similarity between image xi and concept tj in the CLIP embedding space.
Record Activations for each Competitive Neuron. Given a neuron k and for each image in the
probe dataset {X n}N
n=1,
n=1, CLIP-Dissect computes the neuron's non-linear responses {Ak(X n)}N
5
Figure 2: The DISCOVER framework. Given a probe dataset Dprobe : {X n}N
n=1, a concept set
S, |S| = M , and a layer to be dissected: compute the concept activation matrix P ∈ RN ×M using
CLIP; then, for each LWTA block b and each neuron u therein, compute the responses Ab,u(X n), ∀n,
s.t. qb,u = [Ab,u(X 1), . . . , Ab,u(X N )]. Each neuron b, u is then matched to the concept tl whose
activation vector P :,l has the highest similarity (sim) with the neuron's activation vector qb,u.
and records them into a single vector qk ∈ RN , s.t., qk = [Ak(X 1), . . . , Ak(X N )]. Each acti-
vation vector qk essentially encodes the activation of neuron k across the whole probing dataset.
Subsequently, it can be exploited as a data-wide neuron representation to match neurons to textual
descriptions as we describe next. When the response Ak(X n) is not a scalar, a summary function
that maps it to a real number is employed. For inner-product neurons, the response is already a
real-number. For convolutional kernels, we consider a mean over the spatial dimensions.
Our approach. Building on these outcomes, CVNs adopt a novel regard toward interpretation,
which leverages the sparse nature of the representations obtained from stochastic LWTA layers; here,
we focus on attention-based architectures. In this setting, the MLP blocks contain patch-specific
information relating to the tokens of each image; in principle, we could introduce a summary function
to aggregate the patch-wise information and output a real-number. However, we have access to
another representation: the feature embedding pertaining to the class token; this comprises a set of
units dedicated to capturing both global and local contextual information in each layer.
Within the framework of CVNs, this is treated in a local competition fashion: CVN units on each
MLP are grouped together in blocks of competitors and compete for the output of the block. Contrary
to the singular recording of activations in the base formulation for each neuron k, {Ak(X n)}N
n=1, the
activations are computed for each LWTA block b and unit u therein, yielding {Ab,u(X n)}N
n=1. These
activations can be negative, positive or exactly zero, depending not only on the linear computation of
the unit in consideration, but also the responses of the remaining units in its LWTA block, following
the form of Eq.1. We concatenate them to construct a summary for each competitive unit, such that
qb,u = [Ab,u(X 1), . . . , Ab,u(X N )].
Due to the nature of the proposed stochastic local competition, the emerging summary vectors will
be sparse; only the winner of each LWTA block will retain its linear computation and pass it as a
non-zero activation for each example X n; the rest units in the block pass zero activations. This mode
of operation not only encourages specialization, but can also diversify individual neuron identification;
we explore its potency in the next section.
Matching Neurons to Concepts. Having recorded the activations vectors for each LWTA block
b and each neuron u therein, qb,u ∈ RN , we aim to discover the most similar concept {tm}M
m=1 to
describe each neuron. To achieve this matching, a similarity function sim(tm, qb,u; P ) is defined;
6
{Bird, Water, Bridge, ..., Fox, Cat}T1T2T3...TMI3I2I1IN...I3T1I3T2I3T3...I3TMI1T1I1T2I1T3...I1TMI2T2I2T3...I2TM...............INT1INT2INT3...INTMI2T1Text EncoderImage EncoderRecord ActivationsMatching1122Block 1Block BFoxWaterBirdCatthis is used to quantify the relation (in terms of similarity) between the neuron's activation vector
qb,u ∈ RN and the concept's m activation vector, P :,m ∈ RN . For example, considering the cosine
similarity, we compute:
sim(tm, qb,u; P ) ∝ P :,mqT
b,u
Thus, for assigning a concept to neuron b, u, we compute its similarity to each concept in the set and
select the one that exhibits the highest value, s.t., tl = arg maxm sim(tm, qb,u; P ). Characteristic
similarity functions include, Rank Reorder, WPMI and SoftWPMI [20].
(4)
At this point, it is important to highlight a principal benefit of CVNs: After neuron identification, i.e.,
matching neurons to concepts, and since only a small subset of neurons is active for each example, it
becomes practically tractable to perform a per-example analysis on that particular small subset of
"winner" (active) neurons; this greatly facilitates practical concept interrogation.
4 Experimental Analysis
For evaluating and dissecting the proposed CVNs, we train two sets of models: (i) Transfomer-based,
and (ii) Convolutional architectures. We consider stochastic LWTA layers with different numbers of
competitors, ranging from U = 2 to U = 24. In every architecture, we retain the total number of
parameters of the conventional model by splitting a layer comprising K singular neurons to B blocks
of U competing neurons, such that B * U = K. This choice facilitates a fair -sizewise- comparison
between an original network and its CVN counterpart. The number of competitors has a direct effect
on the per example neuron activation in the respective layers. For example, when U = 2, only 50%
of neurons are activated for a given input, when U = 8 only 12.5% and so on.
For the Transformer architecture, we select the DeiT model, specifically DeiT-Tiny (DeiT-T, 5M
parameters) and DeiT-Small (DeiT-S, 22M parameters), which we train from scratch on ImageNet-1k.
For the convolutional paradigm, we chose the same network as in CLIP-Dissect [20] for comparability;
In all cases, we follow the original training schemes
that is ResNet-18 trained on Places365.
concerning the hyperparameters, and remove the excessive augmentations of DeiT, i.e., DropPath,
Color Jittering, Random Erase, CutMix and MixUp; we have found that these do not improve
accuracy of CVNs. For completeness, all hyperparameter settings for each model are provided in
the Supplementary Material. All models were trained on a single NVIDIA A6000 GPU. Our code
implementation is available at: https://github.com/konpanousis/DISCOVER.
Accuracy. We begin our evaluation with classification results pertaining to CVNs and how block
size (number of competitors in each block) affects performance. This is essential, since CVNs have
not been explored in the literature, especially when dealing with larger datasets and architectures,
and no baselines exist for the considered setup. However, it is highly important to note that this
work is not focused on achieving state-of-the-art performance for vision tasks using CVNs. Instead,
our focus is on providing a fundamental component towards a novel Network Dissection paradigm.
Thus, we focus on Network Dissection efficacy, as opposed to optimally tuning hyperparameters and
augmentation to increase accuracy by few points.
The obtained comparative results are presented in Table 1. Therein, we observe that despite the fact
that we did not aim for performance improvements, CVNs exhibit near or even superior performance
compared to their conventional counterparts. This finding persists even when using a large number of
competitors, which directly translates to high activation sparsity. Let us consider for example DeiT-
T/16; this model comprises LWTA blocks with 16 competing units each, leading to 1/16 = 6.25%
active (winning) neurons in each layer. We observe that this network exhibits only a 1% drop in
prediction accuracy (again without any tuning). On the other hand, when using a smaller number of
competitors, e.g., DeiT-T/2 or DeiT-T/8, we obtain better and on par performance to the conventional
architecture, respectively. Also note that, even though there is a minor computational overhead during
training (up to 10%), the computational costs of inference are comparable. Thus, accuracy-wise,
CVNs provide a realistic alternative to conventional Vision Networks that can even yield accuracy
improvements when trained with the same (potentially suboptimal) setup.
Quantitative Analysis. We follow the novel proposal of [20] to compare our CVN-based approach
to conventional non-competitive networks. In this context, we can compare the generated neuron
labels, for a specific layer of a network, with the ground truth descriptions, i.e., the class labels.
7
Table 1: Classification results for ImageNet and Places365.
architecture, e.g., using ReLU/GELU, while numbers denote the number of competitors U .
{⋆/ ∗}Locally reproduced results due to unavailability of pretrained models/resource limitations.
/None denotes a non-competitive
ImageNet-1k
Model/Competitors Accuracy + Std (%) Active Neurons Proportion
DeiT-T/None
DeiT-T/2
DeiT-T/8
DeiT-T/16
DeiT-T/24
DeiT-S/None
DeiT-S/2
DeiT-S/12
DeiT-S/16
Data Specific
0.500
0.125
0.062
0.041
Data Specific
0.500
0.083
0.062
72.2 ± N/A
72.5 ± 0.10
71.7 ± 0.15
71.1 ± 0.25
70.5 ± 0.45
77.0 ± N/A∗
77.3 ± 0.30
77.0 ± 0.25
76.7 ± 0.50
ResNet-18/None
ResNet-18/2
ResNet-18/4
ResNet-18/8
Places365
52.25 ± N/A⋆
53.9 ± 0.20
51.0 ± 0.50
49.5 ± 0.75
Data Specific
0.500
0.250
0.125
Specifically, we measure the cosine similarity in a text embedding space between the ground truth
class name and the description of the neuron. We use two different text encoders: (i) CLIP ViT-B/16,
denoted as CLIP cos and (ii) all-mpnet-base-v2, denoted as mpnet cos. Here, we focus on the last
layer of the MLP block of the DeiT-T model. The obtained comparative results are depicted in Table
2. Therein, we observe that the CVN consistently outperforms its non-competitive counterpart when
using both the best-performing softWPMI and the Cubed Cosine Similarity function proposed in
[20].
Table 2: Cosine similarity between the last layer neuron descriptions and ground truth labels on
DeiT-T/None and DeiT-T/16 trained on ImageNet. For the former we use softWPMI for identification,
while for CVNs, softWPMI and the cubed cosine similairity measure [20]. We use two text encoders:
(i) CLIP ViT-B/16 and (ii) all-mpnet-base-v2, denoted as mpnet cos.
Dprobe
Concept Set S
ImageNet Val
-"-
-"-
-"-
-"-
CIFAR100 Train
Broden
ImageNet Val & Broden
Broden
3k
10k
20k
ImageNet
20k
20k
20k
Vision Network
DeiT-T/None (SoftWMPI) DeiT-T/16 (SoftWPMI) DeiT-T/16 (CosSimCubed)
CLIP cos mpnet cos
CLIP cos
0.6460
0.6250
0.6650
0.6226
0.6553
0.6187
0.6455
0.6128
0.5854
0.5850
0.6533
0.6392
0.6470
0.6338
0.6333
0.6299
mpnet cos
0.1800
0.1688
0.1715
0.1758
0.1782
0.1765
0.1780
0.1821
mpnet cos
0.1918
0.1842
0.1831
0.1899
0.1835
0.1876
0.1546
0.1433
CLIP cos
0.6543
0.6699
0.6616
0.6519
0.5840
0.6530
0.6606
0.6729
0.1829
0.1895
0.1878
0.1929
0.1842
0.1969
0.1815
0.1876
To further assess the quality of the obtained neuronal descriptions, we turn to the neuron identification
accuracy metric proposed in [20]. In this context, and in situations where the considered concept set
contains exact class labels, we compute the percentage of neurons that have been assigned the exact
correct label. Evidently, this metric pertains to the classification layer of a considered network. We
consider four datasets: CIFAR-100 Train, Broden, ImageNet Val and ImageNet Val & Broden; we use
the ImageNet classes as the concept set S. For matching neurons to concepts, we use SoftWPMI,
since it outperformed all other similarity functions. Further results with the other similarity metrics
are provided in the Supplemental Material.
The comparative results for all conventional and competitive configurations are presented in Table
3. We observe that on average, CVNs consistently outperform their conventional ReLU/GELU
based counterparts, with up to 2% improvement. It is striking, that DeiT-S/12 improves accuracy on
CIFAR-100 Train by a staggering 10% compared to the conventional ResNet-50 that has the same
number of parameters; at the same time, DeiT-T/8, also provided a significant improvement of ≈ 7%.
8
Table 3: Accuracy as the percentage of neurons assigned the correct label, i.e., class name. Concept
Set S: ImageNet, Similarity: SoftWPMI. ResNet-50 results from [20].
Dprobe
CIFAR-100 Train
Broden
ImageNet Val
ImageNet Val & Broden
Average
Vision Network
ResNet-50/None DeiT-T/None DeiT-T/8 DeiT-T/16 DeiT-S/2 DeiT-S/12
56.10%
53.10%
68.10%
67.40%
95.60%
96.00%
94.80%
95.70%
78.65%
78.05%
46.20%
70.50%
95.00%
95.40%
76.78%
55.20%
68.30%
95.60%
95.00%
78.70%
50.80%
67.40%
95.30%
95.50%
78.30%
53.00%
68.80%
95.00%
95.20%
78.00%
Figure 3: Neuron Identification for the first and last DeiT-T/16 MLP blocks using: SoftWPMI, Dprobe:
ImageNet & Broden, S: 20K most common English words [20].
Qualitative Analysis. We now turn to a qualitative analysis of the obtained neuronal representation.
In this context, we visualize several neuron identification results in terms of generated descriptions
in Fig. 3. To this end, we select random neurons of the first and last MLP blocks of DeiT-T/16 and
use a combination of the ImageNet and Broden datasets as a probe; the concept set S comprises
the 20, 000 most common English words similar to [20]. Since we do not use the same pretrained
backbone, and the considered CVNs were trained from scratch, there isn't an exact matching between
the neurons presented therein and the neurons of our networks, enumeration-wise. Thus, we can not
make direct comparisons pertaining to the exact same neuron on an illustration basis. Nevertheless,
we observe that in the context of CVNs we obtain highly accurate descriptions of the functionality of
the networks' neurons. We observe that the randomly selected neurons are activated by semantically
similar inputs that may contain only a part of the matching concept.
A principal property of CVNs is the per-example sparsity that naturally arises due to the competition
mechanism; this can facilitate specialization and accelerate the process of examining the active
concepts for each test point, greatly enhancing the interpretability of the network. Indeed, we perform
this analysis for the last MLP block of the GELU-based DeiT-T/None, and its DeiT-T/8 and DeiT-T/16
competitive counterparts. This block comprises 768 neurons; for each example, DeiT-T/8 will activate
only 768/8 = 96 neurons and DeiT-T/16 only 48 neurons. The number of activated neurons for the
conventional DeiT-T/None will vary according to the probing dataset. For ImageNet Val, we found
that on average, 98% of neurons are activated for each example when using DeiT-T/None.
Thus, in Table 4, and for each architecture, we present the 7 most relevant concepts tied to neurons
with the highest magnitude of activation to the considered example, along with 6 concepts tied to
neurons with the lowest magnitude. Therein, we observe that the most contributing concepts in
the conventional setting contain descriptions that are highly irrelevant or even contradicting to the
presented input as "red/orange beak & legs", "black coat/tan markings" and "reddish brown fur";
at the same time 757/768 neurons are active for this example, rendering the concept investigation
a strenuous process. In stark contrast, the considered CVNs exhibit substantially more relevant
concepts, while allowing for a straightforward examination of the emerging per-example concepts.
Similar qualitative visualizations for different settings can be found in the Supplemental Material.
9
Neuron10:CLIP-Dissect(SoftWPMI):snorkelingNeuron20:CLIP-Dissect(SoftWPMI):greenNeuron70:CLIP-Dissect(SoftWPMI):redNeuron302:CLIP-Dissect(SoftWPMI):maroonNeuron41:CLIP-Dissect(SoftWPMI):dogNeuron218:CLIP-Dissect(SoftWPMI):wineNeuron357:CLIP-Dissect(SoftWPMI):snowNeuron512:CLIP-Dissect(SoftWPMI):coyoteTable 4: Concepts tied to activated neurons for a random image from the ImageNet validation set for
both DeiT-T/None and DeiT-T/16. For the former, 757/768 = 98.56% neurons are activated leading
to an arduous interpretation process; for DeiT-T/16 only 48/768 = 6.25% of neurons are active.
DeiT-T/None
DeiT-T/8
DeiT-T/16
Concepts
Act
Concepts
Act
Act
Concepts
+3.06 white fur under tail
a cucumber plant
a fox
pale/gray or cream fur
white fur under tail
red/orange beak & legs +2.53
+2.19
white plumage
black coat/tan markings +2.14
large/fluffy white dog
reddish/brown fur
shaggy/gray coat
a fox
large/fluffy white dog
chicken
klin
sharp talons/beak
camel rider
fluffy/white appearance
large/fluffy white dog
large/fluffy white dog
egret
+1.46 white plumage
+1.03 white/gray plumage
+0.71
cabbage-like leaves
−0.17
small/black dog
shaggy/black-brown coat +0.56 wolf-like appearance
−0.17
−0.17
product displays
−0.17
a large/elegant dog
−0.17
a bus driver
−0.17
an insect
+11.6
+10.5
+9.89
+9.32
+7.71
+8.90
+8.36
+7.37
+7.33 white/cream coloured coat +7.07
+6.87
+7.27
blue/gray body
+5.96
+7.04 white plumage
+1.29
+1.57
a cub
+0.96
+0.68
+0.37
+0.35
+0.08
bandage
egg-laying mammal
large/fluffy white dog
black/tan coat
+0.46
+0.34
+0.18
+0.08
5 Limitations & Conclusions
Limitations. Considering the use of the CLIP-Dissect approach for identifying neuron functionality
in CVNs, this comes with its respective limitations, such as disregarding the spatial information; this,
could allow for identifying lower level concepts and patterns. However, the structure of CVNs could
potentially accommodate such a functionality via block (high) level and unit (low) level descriptions;
we leave these explorations for future work. Finally, even though incorporating the competition
mechanism to Vision Networks is a quite straightforward task, they aren't still implemented in an
optimized way in popular frameworks, due to their limited adoption.
Conclusions.
In this work, we introduced DISCOVER, a novel framework towards Interpretable
vision architectures through Competitive Vision Networks and Network Dissection. For the first
time in the literature, we trained LWTA networks using sufficiently large datasets and architectures.
Despite the fact that we did not perform any hyperparameter tuning, the resulting networks yielded
on par or even improved performance, even when using up to 4% of active neurons per example.
Our qualitative and quantitative results vouch for the efficacy and interpretation capabilities of our
approach. We yielded highly interpretable neuron functionality, while using a small and explorable
subset of all the available neurons per datapoint.
Acknowledgements
This work has received funding from the European Union's Horizon 2020 research and innovation
program under grant agreement No 872139, project aiD.
References
[1] P Andersen, Gary N Gross, T Lomo, and Ola Sveen. Participation of inhibitory and excitatory
interneurones in the control of hippocampal cortical output. In UCLA forum in medical sciences,
1969.
[2] David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection:
Quantifying interpretability of deep visual representations. In Proc. CVPR, 2017.
[3] Gail A. Carpenter and Stephen Grossberg. The art of adaptive pattern recognition by a self-
organizing neural network. Computer, 1988.
[4] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework
for contrastive learning of visual representations. In Proc. ICML, 2020.
[5] Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang, and Furu Wei. Knowledge neurons
in pretrained transformers. In Proc. ACL, 2022.
10
[6] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai,
Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al.
An image is worth 16x16 words: Transformers for image recognition at scale. In Proc. ICLR,
2021.
[7] Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers
are key-value memories. In EMNLP, 2021.
[8] Stephen Grossberg. Contour enhancement, short term memory, and constancies in reverberating
neural networks. In Studies of mind and brain. Springer, 1982.
[9] Evan Hernandez, Sarah Schwettmann, David Bau, Teona Bagashvili, Antonio Torralba, and
Jacob Andreas. Natural language descriptions of deep visual features. In Proc. ICLR, 2022.
[10] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparametrization with gumbel-softmax. In
Proc. ICLR, 2017.
[11] Konstantinos Kalais and Sotirios Chatzis. Stochastic deep networks with linear competing units
for model-agnostic meta-learning. In Proc. ICML, 2022.
[12] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Proc. ICLR, 2014.
[13] Pang Wei Koh, Thao Nguyen, Yew Siang Tang, Stephen Mussmann, Emma Pierson, Been Kim,
and Percy Liang. Concept bottleneck models. In Proc. ICML, 2020.
[14] Anders Lansner. Associative memory models: from the cell-assembly theory to biophysically
detailed cortex simulations. Trends in neurosciences, 2009.
[15] Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In
Proc. NIPS, 2017.
[16] Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous
relaxation of discrete random variables. In Proc. ICLR, 2017.
[17] Diego Marcos, Ruth Fong, Sylvain Lobry, Rémi Flamary, Nicolas Courty, and Devis Tuia.
Contextual semantic interpretability. In Proc. ACCV, 2020.
[18] Kevin Meng, Arnab Sen Sharma, Alex J Andonian, Yonatan Belinkov, and David Bau. Mass-
editing memory in a transformer. In Proc. ICLR, 2023.
[19] Tuomas Oikarinen, Subhro Das, Lam M. Nguyen, and Tsui-Wei Weng. Label-free concept
bottleneck models. In Proc. ICLR, 2023.
[20] Tuomas Oikarinen and Tsui-Wei Weng. CLIP-dissect: Automatic description of neuron repre-
sentations in deep vision networks. In Proc. ICLR, 2023.
[21] Konstantinos Panousis, Sotirios Chatzis, Antonios Alexos, and Sergios Theodoridis. Local
competition and stochasticity for adversarial robustness in deep learning. In Proc. AISTATS,
2021.
[22] Konstantinos Panousis, Sotirios Chatzis, and Sergios Theodoridis. Nonparametric Bayesian
deep networks with local competition. In Proc. ICML, 2019.
[23] Konstantinos P Panousis, Anastasios Antoniadis, and Sotirios Chatzis. Competing mutual
information constraints with stochastic competition-based activations for learning diversified
representations. In Proc. AAAI, 2022.
[24] Konstantinos P Panousis and Sotirios Chatzis. Stochastic local winner-takes-all networks enable
profound adversarial robustness. In NIPS Bayesian Deep Learning (BDL) Workshop, 2022.
[25] Konstantinos Panagiotis Panousis, Dino Ienco, and Diego Marcos. Sparse linear concept
discovery models. In Proc. ICCV Workshops, 2023.
11
[26] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agar-
wal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya
Sutskever. Learning transferable visual models from natural language supervision. In Proc.
ICML, 2021.
[27] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should I trust you?": Explaining
the predictions of any classifier. In Proc. SIGKDD, 2016.
[28] Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In Proc.
NIPS, 2016.
[29] Rupesh K Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jürgen
Schmidhuber. Compete to compute. In Proc. NIPS, 2013.
[30] Costas Stefanis. Interneuronal mechanisms in the cortex. In UCLA forum in medical sciences,
1969.
[31] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and
Herve Jegou. Training data-efficient image transformers & distillation through attention. In
Proc. ICML, 2021.
[32] Andreas Voskou, Konstantinos P. Panousis, Dimitrios Kosmopoulos, Dimitris N. Metaxas, and
Sotirios Chatzis. Stochastic transformer networks with linear competing units: Application to
end-to-end sl translation. In Proc. ICCV, 2021.
12
A Supplemental Material
A.1 Experimental Details
Integrating the competition mechanism in modern architectures constitutes a pretty straightforward
task. One just needs to replace the existing calls to the conventional non-linear activations with a call
to a module/function implementing the LWTA rationale. This can be performed in-place without any
other changes necessary. Thus, in the accompanied code, we can directly change the definitions of the
Transformer or ResNet based models and train the model in the same manner as in the conventional
Vision Networks. In this context, for the DeiT architectures, we alter the definitions in the timm
library, while for ResNet-based architectures, we slightly alter the example implementation found in
the official Pytorch repository1. For dissecting CVNs, we use the official repository of CLIP-Dissect
[20]. We describe all changes in the respective README file. Our code and trained models will be
public after publication.
Transformers. For training the CVN counterparts of the DeiT-T and DeiT-S models, we use the
official implementation.2 We train both architectures from scratch using ImageNet-1k for 300 epochs
with the default parameters found therein. Specifically, we use a 5-epoch warm-up period, starting
with an initial learning rate of 10−6, following a cosine annealing schedule up to 5 * 10−4. We use the
same AdamW optimizer and changed the used weight decay from 0.05 to 0.02 since we found that
it hurt performance. We re-run the conventional GELU-based architectures with this selection and
observed no change in the obtained accuracy. In contrast, we turned off the excessive augmentation
setup, since it hurt the performance of CVNs. In this context, and in line with the initial ablation
study presented in [31], we found that performance deteriorates when augmentations are removed in
GELU-based networks. For training, we use a single sample for the Monte Carlo sampling estimation
for the Evidence Lower Bound loss, described in the main text. For this, we turn to the continuous
relaxation of the categorical distribution that allows for reparameterized samples and low variance
estimation, as we describe in the next section. During inference, we draw 4 samples, average the
logits in the Bayesian Averaging sense; we then compute the predicted loss and accuracy. We did not
observe any improvement when drawing more samples.
ResNet. For training the ResNet-18 model, we used the ResNet ImageNet example PyTorch script
and adapted the data loading for Places 365. We train the model for 90 epochs, using SGD with
an initial learning rate of 0.1 that is reduced by a factor of 0.1 every 30 epochs, a weight decay of
10−4 and 0.9 momentum. The batch size was set to 256. For the Gumbel-Softmax trick, we set
the temperature to 0.67 and used the Straight-Through estimator. During training, we only draw
one sample for the reparameterization trick, while during inference we draw 4 samples from the
trained posterior. We trained both conventional and CVN architectures since the official pretrained
models were not available online. For both methods, we used the standard RandomResizedCrop and
RandomHorizontal Flip augmentations.
A.2 The Gumbel-Softmax Trick
In our work, we perform Monte-Carlo sampling using a single reparameterized sample for each
of the corresponding latent variables. These are obtained via the reparameterization trick of the
continuous relaxation of the Categorical distribution [16, 10] as described next. We focus on the
reparameterization trick for the dense case; the convolutional case is analogous.
As a reminder, the latent indicators ξb, ∀b, are drawn from a Categorical distribution driven from the
intermediate linear inner-product computations that each unit performs.of q(ξ) (Eq. (2) in the main
text):
q(ξb) = Categorical
ξb
(cid:32)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:33)
Πb(x)
, ∀b, Πb(x) = Softmax
J
(cid:88)
[wj,b,u]U
u=1 * xj
(5)
j=1
where Πb(x) is a vector comprising the activation probability of each neuron in the block, and
[wj,b,u]U
u=1 denotes the vector concatenation of the set {wj,b,u}U
1https://github.com/pytorch/examples/tree/main/imagenet
2https://github.com/facebookresearch/deit.
u=1.
13
Then, the samples ˆξ are expressed as:
ˆξb,u = Softmax (log[Πb(x)]u + gb,u)/τ ) , ∀b = 1, . . . , B, u = 1, . . . , U
(6)
where gb,u = − log(− log Vb,u), Vb,u ∼ Uniform(0, 1), and τ ∈ (0, ∞) is a temperature factor,
controlling how "closely" the continuous relaxation approximates the Categorical distribution. In
this work, we use a temperature of τ = 0.67 as suggested in [16], and used in several other works
[22, 21].
A.3 Convolutional Formulation
In this setting, local competition is performed among feature maps on a position-wise basis. Each
kernel is treated as an LWTA block with competing feature maps; each layer comprises B kernels.
Specifically, each feature map u = 1, . . . , U in the bth LWTA block of a convolutional LWTA layer
computes:
H b,u = W b,u ⋆ X ∈ RH×L
Competition remains stochastic, and is now implemented on a position-wise basis as follows:
(cid:16)
q(ξb,h′,l′) = Categorical
ξb,h′,l′
(cid:12)
(cid:17)
(cid:12)
(cid:12)Πb,h′,l′(X)
, ∀h′, l′
(7)
(8)
where Πb,h′,l′(X) = Softmax ([H b,1,h′,l′, . . . , H b,U,h′,l′]) comprises the position-wise activation
probabilities for all neurons in the block.
For each position in a kernel, only the feature map that wins the said position contains a non-zero
entry. This yields sparse feature maps with mutually exclusive activated positions. Now, the output
Y ∈ RH×L×B*U is obtained via concatenation of the sub-tensors Y b,u that read:
Y b,u = Ξb,u
(cid:16)
W b,u ⋆ X
(cid:17)
, ∀b, u
(9)
where Ξb,u = [ξb,u,h′,l′]H,L
LWTA block can be found in the Appendix.
h′,l′=1. The corresponding detailed bisection of a convolutional stochastic
In the following, we use these definitions to construct Competitive Vision Networks by replacing
the usually employed non-linearities with the competition mechanism in each hidden layer of the
considered architecture.
Figure 4: A detailed bisection of the bth convolutional stochastic LWTA block. Presented with input
X ∈ RH×L×C, competition takes place among feature maps on a position-specific basis. Only the
winner feature map contains a non-zero entry in a specific position. This leads to sparse feature maps,
each comprising uniquely position-wise activated pixels. Image from [23].
B Further Qualitative Analysis
In this section, we provide further qualitative neuron identification results for various architectures
and similarity functions.
14
Figure 5: Neuron Identification for the first and last DeiT-T/8 MLP blocks using: SoftWPMI, Dprobe:
ImageNet & Broden, S: 20K most common English words[20].
Figure 6: Neuron Identification for the first and last DeiT-S/12 MLP block using the Cosine Similarity
Cubed similarity function [20]. For the former we use Dprobe: (i) ImageNet Val & Broden (Left), and
for the latter: (ii) ImageNet Val. We use the S: 20K most common English words for both settings.
Figure 7: Neuron Identification for the first and last DeiT-S/12 MLP block using the Rank Reorder
similarity function [20]. We use Dprobe: ImageNet Val and S: 20K most common English words for
both settings.
15
Neuron146:CLIP-Dissect(SoftWPMI):motifNeuron365:CLIP-Dissect(SoftWPMI):greenNeuron461:CLIP-Dissect(SoftWPMI):patternNeuron662:CLIP-Dissect(SoftWPMI):blueNeuron6:CLIP-Dissect(SoftWPMI):wildlifeNeuron32:CLIP-Dissect(SoftWPMI):labradorNeuron357:CLIP-Dissect(SoftWPMI):espressoNeuron450:CLIP-Dissect(SoftWPMI):compassNeuron21:CLIP-Dissect(CosSimilarity3):stripeNeuron672:CLIP-Dissect(CosSimilarity3):crimsonNeuron783:CLIP-Dissect(CosSimilarity3):yellowNeuron1084:CLIP-Dissect(CosSimilarity3):darkNeuron21:CLIP-Dissect(CosSimilarity3):lobsterNeuron672:CLIP-Dissect(CosSimilarity3):guineaNeuron783:CLIP-Dissect(CosSimilarity3):eagleNeuron1084:CLIP-Dissect(CosSimilarity3):frogNeuron227:CLIP-Dissect(RankReorder):yellowNeuron726:CLIP-Dissect(RankReorder):blueNeuron1104:CLIP-Dissect(RankReorder):mammalsNeuron1206:CLIP-Dissect(RankReorder):blueNeuron193:CLIP-Dissect(RankReorder):tortNeuron224:CLIP-Dissect(RankReorder):gentooNeuron726:CLIP-Dissect(RankReorder):birdingNeuron820:CLIP-Dissect(RankReorder):antarcticTable 5: Concepts tied to activated neurons for a random image from the ImageNet validation set for
DeiT-T/8 using various similarity functions.
Cos Similarity
WPMI
SoftWPMI
Concepts
Act
Concepts
Act
Act
Concepts
ferret
ferret
ferret
ferret
+10.5
Belgian Malinois
+9.55
green/yellow eyes
+8.90 white fur under tail
white fur underside
+8.51
black stripes on legs
herd Alpine ibex
+8.02
long/sharp quills
long/sharp quills
+7.53
fox
gray fur/white tips
+7.52 white/gray head
white/gray head
+0.96
baby stork
black fur/white markings +0.44
+0.35
large/fluffy white dog
+0.18
gills
+0.12
car towing RV
+0.12
other crocodiles
black ruff around neck +1.09
+0.44
black/tan coloration
+0.37
organ
+0.18
salamander
+0.12
headsail
+0.12
egg-laying mammal
+10.5
+9.55
+8.90 white fur under tail
+8.51
black/white stripes
+8.01
long/sharp quills
+7.53
fox
+7.52 white/gray head
+10.5
+9.55
+8.90
+8.51
+8.01
+7.53
+7.52
black ruff around neck +1.09
+0.44
black/tan coloration
+0.37
organ
+0.18
salamander
+0.12
headsail
+0.12
egg-laying mammal
Table 6: Concepts tied to activated neurons for a random image from the ImageNet validation set for
DeiT-T/None and DeiT-S/12 using various similarity functions.
DeiT-T/None (SoftWPMI)
DeiT-S/12 (SoftWPMI)
DeiT-S/12 (Rank Reorder)
Concepts
Act
Concepts
Act
Act
Concepts
+15.0
sea turtle
+11.7
cygnet
+10.9
large/elephant animal
hard shell covered in spines +9.96
sea turtle
python
doberman
dome-shaped cap
iguana
other crocodiles
case
players
exoskeleton
+15.2
sea turtle
large/webbed hind feet +11.7
+10.9
dark-colored carapace
+9.96
large/fleshy cap
+9.52
+9.32
tough/scaly exterior
+9.08
black/tan coloration
+1.41
round/spouted body
fluffy/white appearance +0.33
+0.22
operating system
+0.10
opponent
+0.10
hard/shiny exoskeleton +0.10
+9.52 marine ecosystem
+9.32
+9.08
+1.14
+0.63
+0.67
+0.22
+0.10 wings attached
+0.01
+1.18
a coast
+1.06
hard/shiny exoskeleton
+0.54
sea turtle
+0.54
large/red crab
+0.53
large/red crustacean
large/plant eating dinosaur +0.51
+0.46
short/bristly fur
+0.20
white bill
+0.17
a race
+0.06
large/fluffy white dog
−0.16
two-metal plates/trays
−0.16
white markings wings
−0.17
small/crab like body
16
|
|
http://arxiv.org/abs/2310.04925v1 | "2023-10-07T21:36:55" | "2023-10-07T21:36:55" | Crystal-GFN: sampling crystals with desirable properties and constraints | Accelerating material discovery holds the potential to greatly help mitigate
the climate crisis. Discovering new solid-state crystals such as
electrocatalysts, ionic conductors or photovoltaics can have a crucial impact,
for instance, in improving the efficiency of renewable energy production and
storage. In this paper, we introduce Crystal-GFlowNet, a generative model of
crystal structures that sequentially samples a crystal's composition, space
group and lattice parameters. This domain-inspired approach enables the
flexible incorporation of physical and geometrical constraints, as well as the
use of any available predictive model of a desired property as an objective
function. We evaluate the capabilities of Crystal-GFlowNet by using as
objective the formation energy of a crystal structure, as predicted by a new
proxy model trained on MatBench. The results demonstrate that Crystal-GFlowNet
is able to sample diverse crystals with low formation energy. | [
"Mila AI4Science",
"Alex Hernandez-Garcia",
"Alexandre Duval",
"Alexandra Volokhova",
"Yoshua Bengio",
"Divya Sharma",
"Pierre Luc Carrier",
"Michał Koziarski",
"Victor Schmidt"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04925v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04925v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
5
2
9
4
0
.
0
1
3
2
:
v
i
X
r
a
Crystal-GFN: sampling crystals with desirable
properties and constraints
Mila AI4Science0 Alex Hernandez-Garcia1,2 Alexandre Duval1,3
Alexandra Volokhova1,2 Yoshua Bengio1,2 Divya Sharma4
Pierre Luc Carrier1 Michał Koziarski1,2 Victor Schmidt1,2
1Mila, Quebec AI Institute
2Université de Montréal
3CentraleSupélec, Université Paris-Saclay
4Johns Hopkins University
0This team name is the way the authors have found to express that the customary
ordered list of authors hardly reflects their contributions. All authors have actively and
significantly contributed to this work. The list in this manuscript has been randomised.
Correspondence email: alex.hernandez-garcia@mila.quebec
Accelerating material discovery holds the potential to greatly help mitigate the climate
crisis. Discovering new solid-state crystals such as electrocatalysts, ionic conductors
or photovoltaics can have a crucial impact, for instance, in improving the efficiency
of renewable energy production and storage. In this paper, we introduce Crystal-
GFlowNet, a generative model of crystal structures that sequentially samples a crystal's
composition, space group and lattice parameters. This domain-inspired approach
enables the flexible incorporation of physical and geometrical constraints, as well as
the use of any available predictive model of a desired property as an objective function.
We evaluate the capabilities of Crystal-GFlowNet by using as objective the formation
energy of a crystal structure, as predicted by a new proxy model trained on MatBench.
The results demonstrate that Crystal-GFlowNet is able to sample diverse crystals
with low formation energy.
1 Introduction
Materials discovery plays a vital role in transforming numerous industries that are currently
responsible for a significant fraction of the global greenhouse gas emissions. From developing
cutting-edge photovoltaic panels to tackling carbon capture, catalysis or solid-state batteries,
the quest for innovative materials with targeted properties has the power to reshape the
technological landscape.
However, the discovery of new materials is an extremely complicated task at various
levels of innovation: crystal structure generation, property prediction and developing feasible
synthesis techniques. In practice, before scientists can think of producing a material with a
desirable property, they must search through the vast space of possible materials and use their
domain-expertise to investigate promising structures. Since this traditional trial-and-error
process is extremely costly both in terms of time and efforts, machine learning (ML) can
greatly accelerate the generation and evaluation of promising candidates.
October 10, 2023
© Released under CC BY-NC-SA 4.0
While ML has already made significant progress with respect to property prediction
and generation of small molecules (Long et al., 2021; Ren et al., 2022; Pakornchote et al.,
2023; Zheng et al., 2023), its impact for solid state materials lags behind. At the root of
this discrepancy lies the particular structure of materials, whose periodicity in 3D space
imposes periodic boundary conditions that make it difficult to use finite graphs for crystal
representation. As a result, the sole task of generating a stable candidate is complex. It
involves exploring the combinatorial space of chemical compositions, considering all possible
periodic arrangements of atoms as well as respecting complex physics that make them viable
and stable structures.
Indeed, the generation of crystal 3D structures involves a multitude of factors, including
specific bonding preferences between different atom types, geometric and chemical constraints,
and a positioning that is correlated with the local energy minimum defined by quantum
mechanics. Overall, current methods often struggle to capture the above complexities in
the generation process, failing to consistently generate valid structures. Besides, most such
approaches would not enable an efficient search through the crystal space or a search for
crystals with a specific property.
In this work, we introduce Crystal-GFlowNet, a generative model designed to sequentially
sample crystal structures in a space inspired by theoretical crystallography. Instead of directly
generating atom positions, Crystal-GFlowNet samples the composition, the space group and
the lattice parameters of a crystal (Section 4). This domain-inspired approach facilitates the
incorporation of chemical and geometrical constraints, as well as the possibility to extend
the sampling space, for example to obtain atom positions. The GFlowNet framework offers
the ability to sample proportionally to a reward function, which enables diverse sampling.
Through an empirical evaluation (Section 5) of a Crystal-GFlowNet trained with a predictive
model of the formation energy, we demonstrate that our proposed method is able to sample
diverse candidates with low formation energy.
2 Related Work
There exists a record of generative methods for molecular and crystal structure generation,
generally falling into one of these catagories: Variational Auto Encoders (VAE) (Ren et al.,
2022; Pakornchote et al., 2023), Generative Adversarial Networks (GANs) (Cao & Kipf, 2018;
Nouira et al., 2018; Long et al., 2021), Normalizing flows (Satorras et al., 2021; Ahmad & Cai,
2022) and Diffusion models (Zheng et al., 2023; Xu et al., 2022). In general, these methods
are trained to reconstruct the training data from a latent distribution by maximising its
likelihood or minimising the discrepancy between generated sampled and the real distribution.
Once trained, they can generate new instances by sampling from the learned latent space.
Hoffmann et al. (2019); Long et al. (2021); Court et al. (2020) treat materials as 3D
voxel images, but the process of decoding images back to atom types and coordinates often
results in low validity. Several methods (Ren et al., 2020; Kim et al., 2020; Zhao et al., 2021)
encode unit cell related information to generate crystals. GANCSP (Kim et al., 2020) and
CubicGAN (Zhao et al., 2021) use as input fractional coordinates, element properties, and
lattice parameters, to build models that generate crystals conditioned on composition or
both composition and space group. Such models are generally not invariant to any Euclidean
transformations.
CDVAE (Xie et al., 2021), employs a diffusion model in conjunction with a VAE to
sample new materials, leveraging lattice parameters. However, it does not enable imposing
domain-based constraints into the generation process. Overall, directly sampling 3D positions
2
without considering energy minimization can lead to physically unrealistic and unstable
structures. Cheng et al. (2022) leveraged physics and symmetry-based constraints to solve
an optimization problem over crystal graphs to obtain atomic coordinates, but it requires a
composition and lattice information as input.
Different from the above, auto-regressive methods like G-SchNet Gebauer et al. (2019) or
G-SphereNet generates 3D molecules sequentially, placing atom-by-atom. They are unaware
of periodicity and cannot generate the lattice, making them ill-suited for crystals. This also
applies to flow models Shi et al. (2020).
As most methods in the literature directly sample 3D positions, they struggle to embed
essential physical constraints like energy minimization, dihedral angles geometric constraints
or bonding preferences between different atom types, often leading to physically unrealistic
In our proposed model, by selecting the composition, lattice,
and unstable structures.
and space group and imposing validity constraints, our approach inherently incorporates
domain knowledge about materials science and crystallography, ensuring that the generated
crystals adhere to fundamental principles and constraints, resulting in more physically valid
structures.
3 Background
In this section, we briefly review the necessary background on GFlowNets and crystallography,
before describing our proposed method Crystal-GFlowNets.
3.1 GFlowNets
Generative Flow Networks (GFlowNets or GFN for short), were introduced by Bengio et al.
(2021) as an amortised inference method to sample from high-dimensional distributions,
where both traditional methods such as MCMC and reinforcement learning are inefficient
in terms of mode mixing. In essence, GFlowNets are designed to sample objects x ∈ X
proportionally to a non-negative reward function R(x), that is π(x) ∝ R(x). This facilitates
the discovery of multiple modes of a given function, which is a desirable objective in scientific
discovery (Jain et al., 2023). For instance, GFlowNets have been successfully applied for
biological sequence design and molecular property prediction as part of active learning loops
(Jain et al., 2022; Hernandez-Garcia et al., 2023).
A key property of GFlowNets is that objects are generated sequentially. Starting from
a special state s0, transitions st→st+1 ∈ A are applied between states s ∈ S, forming
trajectories τ = (s0 → s1 . . . x). This sequential construction of objects, together with the
fact that the transition policy is parameterised by a neural network, provides amortisation
and the potential of systematic generalisation. This can be the case if the decomposition into
partially constructed objects provides structure that can be learnt by a machine learning
model.
In order to obtain policy that samples proportionally to the reward distribution, several
training objectives have been proposed in the literature. Here, we will make use of the
Trajectory Balance objective (Malkin et al., 2022), which has proven effective in various tasks
(Jain et al., 2022; Hernandez-Garcia et al., 2023; Malkin et al., 2022). While GFlowNets
where initially introduced for discrete probabilistic modelling, Lahlou et al. (2023) recently
proposed a generalisation of the framework for continuous or hybrid state spaces. This work
empirically demonstrates this generalisation, as we propose a GFlowNet that operates in a
hybrid-mixture of discrete and continuous-state space.
3
3.2 Crystals
Crystals are highly structured solid materials defined by a unit cell made of atom types and
coordinates that repeat in the three spatial directions, as specified by the crystal's periodic
lattice. This ordered structure gives them their unique shapes and properties and their
understanding is crucial in the development of new materials. While there exists an infinite
number of crystal structures, the field of theoretical crystallography has developed ways to
systematically parameterise and classify crystals.
Lattice. An n-dimensional lattice Λ can be defined as the set of integral combinations of
the linearly independent lattice basis vectors ai ∈ Rn: Λ
i miai | mi ∈ Z} . In 3D, the
3 lattice basis vectors can be converted into 6 parameters: a, b, c determine the lengths of
each dimension and α, β, γ the angles between dimensions.
.
= {(cid:80)n
Composition. We call composition the set of all atom types present in the crystal's unit
cell and their respective quantities. Together with the lattice Λ, the atomic positions provide
a complete description of the crystal structure.
Space group. A space group is the symmetry group of the crystal's repeating pattern in
space, whose elements are the rigid transformations of the pattern that leave it unchanged.
A space group element can be described as a tuple (W, t), where W is the orthogonal
matrix and t the translation vector. An element maps a vector x ∈ Rn to Wx + t. In three
dimensions, space groups are classified into 230 types.
4 Crystal-GFlowNets
In this section, we describe the details of Crystal-GFlowNet, the main method we introduce
in this paper to explore the space of crystal structures and generate crystals with desirable
properties and domain constraints.
Drawing inspiration from crystallography, we propose to represent crystals as the concate-
nation of three distinct components or subspaces: composition (C), space group (SG) and
lattice parameters (LP) of the unit cell of a material. The Cartesian product of the spaces of
these three components would make the state space S = SC × SSG × SLP and sample space
X = XC ×XSG ×XLP of a naive, unrestricted implementation with GFlowNets. An important
advantage of the GFlowNet framework and of the domain-inspired data representation that
we propose to use is that it allows us to flexibly introduce domain knowledge such as well-
studied geometrical constraints from crystallography as well as chemical constraints. These
constraints are mostly introduced by restricting the action space A of the Crystal-GFlowNet,
both inter- and intra-subspace.
In this work, we design the Crystal-GFlowNet such that trajectories first select the
composition, then the space group and finally the lattice parameters. Below we describe the
three subspaces and the constraints we have introduced.
4.1 Composition
We represent a composition as the number of atoms of each element present in the unit cell.
Specifically, for a vocabulary of D elements, where each element can have up to K atoms, we
construct D-dimensional vectors where each entry indicates the number of atoms of element
d. This yields the space SC = {(k1, . . . kD)|kd ∈ {0, 1, . . . K}, d = 1, . . . D}. The action space
4
of the composition subspace consists of the choice of element and number of atoms, that is
AC = {1, . . . D} × {1, . . . K}, plus the special "stop" action to finish a trajectory.
As per the law of electroneutrality, the sum of of positive and negative charge in a solid
must be equal. Since we have control over the action space of the GFlowNet, we incorporate
a hard constraint to ensure that all the generated compositions can have neutral charge. We
argue that this is an advantage over methods that aim at learning such properties implicitly
from the data (Xie et al., 2021).
4.2 Space group
The sample space of the space group subspace of our Crystal-GFlowNet is XSG =
{1, 2, . . . 230}, corresponding to the space of the 230 symmetry groups that exist in three
dimensions. As discussed in Section 3.1, GFlowNets rely on the decomposition of objects into
multiple steps to facilitate generalisation. Therefore, we draw inspiration from theoretical
crystallography to incorporate additional structure into the space group subspace.
Crystals are classified into seven crystal systems: triclinic, monoclinic, orthorhombic,
tetragonal, trigonal, hexagonal and cubic. Each crystal system comprises a set of point
groups. Another related but slightly different category is the lattice system, with also
seven systems (see Fig. 1), each comprising a set of Bravais lattices. The lattice system
category is convenient for our purposes because it imposes specific constraints on the lattice
parameters. Here, we use the derived category resulting from the combination of crystal
system and lattice system. We refer to it as "crystal-lattice system" and it has eight categories:
triclinic, monoclinic, orthorhombic, tetragonal, trigonal-rhombohedral, trigonal-hexagonal,
hexagonal-hexagonal and cubic.
Besides the crystal-lattice system, we introduce another category in the Crystal-GFlowNet
space group subspace: the point symmetry (also known as site symmetry), which defines the
type of symmetry of a point group. We use the following five categories of point symmetries:
centrosymmetric, non-centrosymmetric, enantiomorphic, polar and enantiomorphic-polar.
We choose these categories because the combination of point symmetry and crystal system
gives rise to one of the 32 crystal classes or crystallographic point groups.
In sum, our space group subspace SSG is a three-dimensional set where the entries
correspond to the crystal-lattice system, the point symmetry and the space group. We define
the action space such that, starting from the source state s0, the transitions can set any of the
three dimensions. However, the selection of an option along any dimension restricts the valid
options of the remaining dimensions. For example, if point symmetry "non-centrosymmetric"
is selected from the source state, only three crystal-lattice systems remain valid and the valid
space groups are reduced to 25. The "stop" action is valid (and forced) if and only if the
space group has been selected.
Finally, we also have an opportunity to incorporate inter-subspace constraints between
the composition and the space group. Because of the symmetry imposed by each space group,
not all compositions are possible given a space group, and given a composition not all space
groups are valid. By way of illustration, the most restrictive space group-international
number 230–cannot accommodate compositions with fewer than 16 atoms per element. Since
here the trajectories of a Crystal-GFlowNet first sample a composition, we restrict the
set of valid space groups-and hence crystal-lattice systems and point groups-given the
composition. Empirically, we have estimated that this constraint reduces the size of the space
group state space by a factor of 6, for the specific case of our experimental setup presented
in Section 5.
5
4.3 Lattice parameters
The lattice parameters (a, b, c, α, β, γ), in combination with the lattice system (or crystal
system) determine the shape of the unit cell in three dimensions. While both the composition
and the space group subspaces are discrete, the lattice parameters are real-valued and thus
.
yield a continuous sample space XLP
= {(lmin, lmax)3 × (θmin, θmax)3}, where lmin and lmax
are the minimum and maximum lengths and θmin and θmax are the minimum and maximum
angles, respectively. In order to sample sets of continuous lattice parameters, the GFlowNet
policy model outputs the parameters of a six-dimensional mixture of Beta distributions.
Here, we incorporate an inter-subspace constraint from the space group. Every space
group is classified into a lattice system which, in turn, constrains the values of the lattice
parameters. For instance, for the cubic lattice system, a = b = c and α = β = γ = 90◦. The
remaining constraints are illustrated in Fig. 1. This drastically reduces the state space and
removes the need of having to learn such relationships and constraints from the data.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
Figure 1: The seven lattice systems and the constraints they impose on the lattice parameters.
In order a–g: triclinic, monoclinic, orthorhombic, tetragonal, rhombohedral, hexagonal and
cubic. Source of the figures: Wikimedia Commons, licensed under the Creative Commons
Attribution-Share Alike 3.0 Unported license.
4.4 Reward function
As explained in Section 3, our Crystal-GFlowNet is trained to sample proportionally to a
reward function. This offers the flexibility of using as reward any quantity of interest, such as
a desired property of materials. As an initial proof of concept for the method, we choose the
reward to be based on the formation energy (FE) of the sampled crystal structure, in order
to generate materials with higher likelihood of being thermodynamically stable. Because the
sampled crystal structure may be unknown or not characterised in existing data bases, its
true FE may be unknown too. This is why we train a proxy machine learning model to predict
the FE given a crystal x ∈ X , that is parameterised as the output of Crystal-GFlowNet.
In particular, we train a physics-informed Multi-Layer Perceptron (MLP) on the Mat-
Bench (Dunn et al., 2020) data set. For a given crystal structure, the input to the proxy
MLP is the concatenation of:
• A physical embedding of the crystal's elements using PhAST (Duval et al., 2022).
• A learned embedding for its space group.
• The standardized lattice parameters.
We stratify the MatBench data set into train, validation and test sets, controlling for
the distribution in target FE. The final reward function is a Boltzmann transformation of
6
210(cid:1) where T is a temperature hyper-parameter. This
the proxy output: R(x) = exp (cid:0) − MLP(x)
ensures that lower FE yields higher positive reward, and we can control our preference for
lower energies with the temperature T .
T
5 Empirical evaluation
In this section, we present the results of experiments designed to serve as proof of concept
for Crystal-GFlowNet. The motivation of using GFlowNet to generate crystal structures is
two-fold: One, we are interested in discovering structures with high scores of a property of
interest, in this case low formation energy. At the same time, we want to discover not just
one but multiple and diverse structures. The main reason to seek for diverse samples is that
often the target function is underspecified and the true objective is multifaceted or unknown.
A natural way of dealing with underspecification is to try multiple candidates to increase the
likelihood of finding successful structures for the downstream applications Jain et al. (2023);
Hernandez-Garcia et al. (2023). Thus, we here aim at analysing whether Crystal-GFlowNet
is able to discover diverse crystal structures with low formation energy.
5.1 Experimental setup
Exploring the infinitely large space of crystals to find the ones with certain properties is a
daunting "needle-in-a-haystack" task. In order to make the haystack a little smaller-though
still infinitely large-we restrict the search task to a subset of compositions and space groups,
and to a limited range of the lattice parameters, as described in Appendix B. We train
the Crystal-GFlowNet for 50,000 iterations, which amounts to 500,000 queries to the proxy
model and about 12 hours on a CPU-only machine. Further details about the experimental
setup are provided in Appendix B.
5.2 Results
In this section, we present results related to our proxy model, to the distribution of the
formation energy in Crystal-GFlowNet samples and to the diversity of these samples.
Proxy model of the formation energy. As presented in Section 4.4, our reward function
is based on a proxy MLP trained on MatBench. Since part of our analysis of the performance
of the proposed Crystal-GFlowNet depends on prediction of the formation energy by this
proxy model, it is important to first verify its accuracy. In contrast to other methods, it
does not rely on atom positions to predict the FE of a crystal, but rather on a high-level
description of the crystal, namely its composition, space group and lattice parameters, akin to
the outputs of Crystal-GFlowNet. It achieves a mean absolute error (MAE) of 0.10 ± 0.005 eV
on the validation set. We further describe its hyper-parameters and detailed performance
in Appendix C.2 and Appendix C.3.
Predicted formation energy of samples. Evaluating generative models is well-known to
be a hard, task-dependent problem. Here, in order to gain insights about the sampling policy
of the trained Crystal-GFlowNet, we sample 10,000 crystals and compare the distribution with
1) the validation set from MatBench and 2) 10,000 samples from a randomly initialised and
untrained Crystal-GFlowNet. Figure 2 shows the kernel density estimation of the formation
energies predicted by our proxy model in the aforementioned sets of samples. As main
conclusion, we can observe that training the Crystal-GFlowNet shifts the formation energy
of the sampled crystals towards a range that approaches that of the validation set. Given the
7
vast search space, it is remarkable that with a relatively short training, Crystal-GFlowNet
learns to sample from a distribution where nearly 90 % of the structures have negative
formation energy (as predicted by the proxy model).
Figure 2: A comparisons of the distributions of the formation energy predicted by our proxy
model in three relevant distributions of samples: in green, the validation set, representative
of the MatBench data base; in orange, samples from an untrained Crystal-GFlowNet; in
blue, samples from Crystal-GFlowNet after training. As a main conclusion, we observe that
Crystal-GFlowNet, after training, manages to sample crystals with predicted formation energies
in the range of the validation set.
Diversity of samples. As discussed before, an important goal in certain materials discovery
applications is to find diverse candidates. In other words, sampling crystals with low formation
energy would be almost useless for most applications if all the crystals were the same or
very similar. To gain insights about the diversity, we analyse the crystal structures sampled
by the trained Crystal-GFlowNet. The main conclusion is that Crystal-GFlowNet samples
candidates with very high diversity. In particular, regarding the composition, we find that
not only are all 12 elements contained in the samples from the Crystal-GFlowNet, but also
the distribution of co-occurrence of elements is similar to the distribution in the validation
set. As a matter of fact, all 12 elements are present in just the top-10 samples with lowest
formation energy. Regarding crystal categories and space groups, we find that 6 out of the 8
crystal-lattice systems and all 5 point symmetries are found in just the top-10 samples. While
not all 113 space groups are found in the 10,000 samples, we find 55 % of them. Finally,
in terms of lattice parameters, we also observe relatively similar distributions of lengths
and angles, compared to the MatBench data set. Further details and visualisations of these
results are provided in Appendix D.
6 Conclusions and future work
In this paper, we have introduced a new generative model, Crystal-GFlowNet, to sample
inorganic crystal structures proportionally to a property of interest. A key feature of Crystal-
GFlowNet is its flexibility to be trained with any available reward function and to incorporate
domain constraints. The latter is due to the fact that Crystal-GFlowNet constructs crystals
sequentially in the space of compositions, space groups and lattice parameters of the unit
cell. This parameterization, inspired by theoretical crystallography, has allowed to flexibly
8
420246Formation energy predicted by the proxy model0.00.10.20.30.40.50.6DensityCrystal-GFlowNetValidation setCrystal-GFlowNet random init.incorporate constraints regarding the neutral charge of the composition, the compatibility
between composition and space group and between space group and lattice parameters.
By training a Crystal-GFlowNet with a reward function based on the formation energy
predicted by a proxy model trained on the MatBench database, we have shown it learns to
sample candidates such that the distribution of the predicted formation energy approaches
the distribution of the MatBench data set. Importantly, it does so by sampling highly diverse
crystals, in terms of coverage of compositions, space groups and lattice parameters.
Interesting directions for future work include extending Crystal-GFlowNet with more
domain-inspired constraints as well as with additional subspaces to sample the atom positions
in the unit cell. Alternatively, crystal structure prediction from the samples could be
performed using pre-trained machine learning models that generate atomic coordinates.
Furthermore, it would be interesting to explore other properties of interest beyond the
formation energy of the sampled crystals.
Ethics Statement
Our work is motivated by the the climate crisis, the need to develop sustainable technology
and we envision applications of our approach in materials discovery. However, as with other
related work, there is a potential risk of dual use of the technology by nefarious actors (Urbina
et al., 2022). The authors strongly oppose any uses or derivations of this work intended to
cause harm to humans or the environment.
Code availability
The code of Crystal-GFlowNet algorithm presented in this paper is open source and is
available on https://github.com/alexhernandezgarcia/gflownet.
Acknowledgements
We thank Yasmine Benabed for her contribution to the conception and first steps of this
project. We also thank Bruno Rousseau, Simon Blackburn and Mickael Dollé for their
valuable insights from the materials science perspective. Sékou-Oumar Kaba and Michael
Kilgour have also participated in helpful discussions. We thank Mila's IDT team for their
support. Finally, we thank Quebec's Ministry of Economy, Innovation and Energy for their
financial support.
This research was enabled in part by compute resources provided by Mila (mila.quebec).
References
Ahmad, R. and Cai, W. Free energy calculation of crystalline solids using normalizing flows.
Modelling and Simulation in Materials Science and Engineering, 30(6):065007, 2022.
Bengio, E., Jain, M., Korablyov, M., Precup, D., and Bengio, Y. Flow network based
generative models for non-iterative diverse candidate generation. In Advances in Neural
Information Processing Systems (NeurIPS), volume 34, 2021.
Cao, N. D. and Kipf, T. Molgan: An implicit generative model for small molecular graphs.
arXiv preprint arXiv: 1805.11973, 2018.
9
Cheng, G., Gong, X.-G., and Yin, W.-J. Crystal structure prediction by combining graph
network and optimization algorithm. Nature Communications, 13(1), March 2022. doi:
10.1038/s41467-022-29241-4. URL https://doi.org/10.1038/s41467-022-29241-4.
Court, C. J., Yildirim, B., Jain, A., and Cole, J. M. 3-d inorganic crystal structure generation
and property prediction via representation learning. Journal of Chemical Information and
Modeling, 60(10):4518–4535, 2020.
Dunn, A., Wang, Q., Ganose, A., Dopp, D., Jain, and A. Benchmarking materials property
prediction methods: The matbench test set and automatminer reference algorithm., 2020.
URL https://matbench.materialsproject.org/#citing-matbench. Accessed 2023-09-
28.
Duval, A., Schmidt, V., Miret, S., Bengio, Y., Hernández-García, A., and Rolnick, D. Phast:
Physics-aware, scalable, and task-specific gnns for accelerated catalyst design. arXiv
preprint arXiv: 2211.12020, 2022. URL https://arxiv.org/abs/2211.12020v3.
Gebauer, N., Gastegger, M., and Schütt, K. Symmetry-adapted generation of 3d point sets
for the targeted discovery of molecules. Advances in neural information processing systems,
32, 2019.
Hernandez-Garcia, A., Saxena, N., Jain, M., Liu, C.-H., and Bengio, Y. Multi-fidelity
active learning with gflownets. arXiv preprint arXiv: 2306.11715, 2023. URL https:
//arxiv.org/abs/2306.11715v1.
Hoffmann, J., Maestrati, L., Sawada, Y., Tang, J., Sellier, J. M., and Bengio, Y. Data-driven
approach to encoding and decoding 3-d crystal structures. arXiv preprint arXiv:1909.00949,
2019.
Jain, M., Bengio, E., Hernandez-Garcia, A., Rector-Brooks, J., Dossou, B. F., Ekbote, C. A.,
Fu, J., Zhang, T., Kilgour, M., Zhang, D., et al. Biological sequence design with GFlowNets.
In International Conference on Machine Learning (ICML), volume 162. PMLR, 2022.
Jain, M., Deleu, T., Hartford, J., Liu, C.-H., Hernandez-Garcia, A., and Bengio, Y. GFlowNets
for AI-driven scientific discovery. Digital Discovery, 2023.
Kim, S., Noh, J., Gu, G. H., Aspuru-Guzik, A., and Jung, Y. Generative adversarial networks
for crystal structure prediction. ACS central science, 6(8):1412–1420, 2020.
Lahlou, S., Deleu, T., Lemos, P., Zhang, D., Volokhova, A., Hernández-García, A., Ezzine,
L. N., Bengio, Y., and Malkin, N. A theory of continuous generative flow networks. In
International Conference on Machine Learning (ICML), 2023.
Long, T., Fortunato, N. M., Opahle, I., Zhang, Y., Samathrakis, I., Shen, C., Gutfleisch, O.,
and Zhang, H. Constrained crystals deep convolutional generative adversarial network for
the inverse design of crystal structures. npj Computational Materials, 7(1):66, 2021.
Malkin, N., Jain, M., Bengio, E., Sun, C., and Bengio, Y. Trajectory balance: Improved
credit assignment in GFlowNets. In Advances in Neural Information Processing Systems
(NeurIPS), volume 35, 2022.
Nouira, A., Crivello, J., and Sokolovska, N. Crystalgan: Learning to discover crystallographic
structures with generative adversarial networks. AAAI Spring Symposium Combining
Machine Learning with Knowledge Engineering, 2018.
10
Pakornchote, T., Choomphon-anomakhun, N., Arrerut, S., Atthapak, C., Khamkaeo, S.,
Chotibut, T., and Bovornratanaraks, T. Diffusion probabilistic models enhance variational
autoencoder for crystal structure generative modeling. arXiv preprint arXiv:2308.02165,
2023.
Ren, Z., Noh, J., Tian, S., Oviedo, F., Xing, G., Liang, Q., Aberle, A., Liu, Y., Li, Q.,
Jayavelu, S., et al. Inverse design of crystals using generalized invertible crystallographic
representation. arXiv preprint arXiv:2005.07609, 3(6):7, 2020.
Ren, Z., Tian, S. I. P., Noh, J., Oviedo, F., Xing, G., Li, J., Liang, Q., Zhu, R., Aberle, A. G.,
Sun, S., et al. An invertible crystallographic representation for general inverse design of
inorganic crystals with targeted properties. Matter, 5(1):314–335, 2022.
Satorras, V. G., Hoogeboom, E., Fuchs, F., Posner, I., and Welling, M. E(n) equivariant
normalizing flows. Neural Information Processing Systems, 2021.
Shi, C., Xu, M., Zhu, Z., Zhang, W., Zhang, M., and Tang, J. Graphaf: a flow-based
autoregressive model for molecular graph generation. arXiv preprint arXiv:2001.09382,
2020.
Urbina, F., Lentzos, F., Invernizzi, C., and Ekins, S. Dual use of artificial-intelligence-powered
drug discovery. Nature Machine Intelligence, 4(3):189–191, 2022.
Xie, T., Fu, X., Ganea, O., Barzilay, R., and Jaakkola, T. Crystal diffusion variational
International Conference On Learning
autoencoder for periodic material generation.
Representations, 2021.
Xu, M., Yu, L., Song, Y., Shi, C., Ermon, S., and Tang, J. Geodiff: A geometric diffusion
model for molecular conformation generation. arXiv preprint arXiv:2203.02923, 2022.
Zhao, Y., Al-Fahdi, M., Hu, M., Siriwardane, E. M., Song, Y., Nasiri, A., and Hu, J.
High-throughput discovery of novel cubic crystal materials using deep generative neural
networks. Advanced Science, 8(20):2100566, 2021.
Zheng, S., He, J., Liu, C., Shi, Y., Lu, Z., Feng, W., Ju, F., Wang, J., Zhu, J., Min, Y., et al.
Towards predicting equilibrium distributions for molecular systems with deep learning.
arXiv preprint arXiv:2306.05445, 2023.
11
A Crystals
Materials. Materials encompass the substances that make up objects. Their distinctive
characteristics arise from a combination of factors, including their composition, structure,
and manufacturing processes. While materials come in various forms, our primary focus will
be on solid-state materials, specifically crystals, owing to their significance in many machine
learning applications we have encountered.
Solid state materials. Solid state materials consist of a multitude of smaller building
blocks, such as atoms or molecules, securely positioned in fixed locations. They exhibit
high-density packing and strong mutual attraction, resulting in a stable structure with a
well-defined volume. Materials that possess a well-ordered, infinitely repetitive structure
are categorized as crystals, while those lacking such long-range positional order are termed
amorphous.
Crystals. Also known as crystalline materials, crystals represent a category of solid substances
characterised by their periodic structure. This entails a consistent and predictable repetition
of atom or molecule placement within the crystal across all spatial dimensions. It is this
inherent periodicity that sets crystals apart from smaller molecules and confers unique
properties upon crystals. They manifest in diverse forms and showcase exceptional attributes
like transparency and elevated melting points. The study of crystals offers a pathway to
precise characterization and controlled manipulation, opening up avenues for engineering
materials with targeted properties to fulfill a wide range of needs. The subsequent section
delves into how machine learning models address and harness this periodicity.
A crystal structure includes the type and position of every atom as well as the translational
axes which allow the structure to repeat. Since crystal structures extend infinitely, we need
to define some small section that can be repeated. We call this small section a unit cell.
Unit cells are made of a lattice and basis. Lattices tell you how the crystal is repeated,
the basis tells you what is repeated. There are six parameters of a unit cell: 3 edges a, b, c
and the angles between the edges α, β, γ. The edges of a unit cell may be or may not
be perpendicular to each other. A crystal structure combines the lattice (how atoms are
translated) with a basis (which atoms are translated) which theoretically describes every
atom in the crystal. The lattice is just a mathematical idea, but the basis is the "real"
component which is repeated according to the mathematical lattice.
Lattice. The lattice is fully specified by its basis vectors ai and is associated with a group
of translations TΛ. The lattice Λ is the underlying structure of the unit cells, which have the
property of tilling the space Rn when translated by lattice vectors. Of particular prominence
.
= {(cid:80)n
is the primitive cell U for the basis ai: U
i xiai | 0 ≤ xi < 1} .
In a material, the unit cell comprises a set of atomic positions S = {(Zi, xi) | xi ∈ U },
where xi is the atom position (called the basis vector) and Zi its atomic number. S can
contain an arbitrary number of atoms and is not constrained to a particular structure.
Periodic boundary conditions. Periodic boundary conditions (pbc) are commonly used
to represent the infinite repeating nature of crystals and other periodic systems. Rather than
confining the analysis to a single unit cell housing all atoms, pbc envision an infinite array
of identical unit cells extending indefinitely in all directions. This means that if an atom
or molecule exits the cell on one side, it effectively re-enters from the opposite side, as if
traversing a continuous lattice. This approach enables scientists to simulate the behavior of
an infinitely extending crystal using a finite computational domain.
12
B Experimental setup
In this section, we provide additional details about the hyper-parameters and experimental
setup used to train the Crystal-GFlowNet to obtain the results presented in Section 5.
In order to reduce the search space in our experiments, we apply the following restrictions:
• Compositions consist of up to 5 different elements from the subset of these 12 elements:
H, Li, C, N, O, F, Mg, Si, P, S, Cl and Fe. These are the most common elements in the
MatBench data set used to train the proxy model. Note that even this reduced set yields
a combinatorially large search space.
• Compositions can contain up to 50 atoms in total and up to 16 atoms per element. This
number is obtained by finding the lowest Wyckoff position multiplicity for each space group,
and then computing the maximum of these values across all space groups. This means
that 16 is the lowest possible value that still makes it possible for the Crystal-GFlowNet
to generate samples from all space groups while respecting their symmetry constraints.
• Space groups are the intersection of train and validation space groups, from the proxy
model's data set. There are 113 of them.
• The minimum and maximum lengths of the unit cell are 0.9 and 100 angstroms, respectively;
the minimum and maximum angles are 50◦ and 150◦, respectively.
We train the Crystal-GFlowNet by sampling 10 trajectories per iteration from the current
forward policy. In order to encourage further exploration, 10 % of the steps in the trajectories
are sampled at random from a uniform distribution. In total, we train for 50,000 iterations,
which amounts to 500,000 queries to the proxy model. This took about 12 hours on a
CPU-only machine.
The architecture of both the forward and the backward GFlowNet policy models is
a 3-layer multi-layer perceptron with 256 units per layer. We trained with the Adam
optimiser and a learning rate of 0.0001. As is common with the Trajectory Balance objective
(Malkin et al., 2022), we set a higher learning rate (0.01) for the 16 learning weights used
to parameterised partition function. In order to sample structures with lower (negative)
formation energy, we set a temperature of 8 in the reward function defined in Section 4.4.
The distribution to sample the increments of the lattice parameters subspace is a mixture
of 5 Beta distributions. In order to ensure numerical stability during training, we restrict
the values of the coefficients of the Beta distributions to the range [0.1, 100]. One of the
conditions that must be satisfied by generalised GFlowNets is that trajectories must have
finite length. To this end we set a minimum increment of 10 % the range of each dimension.
C Proxy MLP
C.1 Architecture
For a given crystal structure, the input to the proxy MLP is the concatenation of: a physical
embedding of the crystal's elements using PhAST (Duval et al., 2022), a learned embedding
for its space group and the standardized lattice parameters. We stratify the MatBench data
set into train, validation and test sets, controlling for the distribution in target FE. The final
(cid:1) where T is a
reward function is a Boltzmann version of the proxy: R(x) = exp (cid:0) − MLP(x)
T
13
temperature hyper-parameter. This ensures that lower FE yields higher positive reward, and
we can control our preference for lower energies with the temperature T .
Overall, the architecture consists of concatenated representations for the composition
(hC), the space group hSG and the lattice parameters (hLP ) that are used as input to a
prediction MLP ˆy = MLPout([hC, hSG, hLP ]). In the following we describe how each h is
obtained from the data:
• hC: Each element Zi in the composition is embedded with PhAST (Duval et al., 2022):
it is a concatenation of 1/ static physical properties PZ projected into some latent space
with a small MLP 2/ a learned embedding for the atomic number Z, Period P and the
Group G of the element, noted Ei:
hC = MLPC
(cid:16)(cid:2)MLPP (PZ), EZ, EP , EG
(cid:3)(cid:17)
(1)
• hSG: Each space group is embedded as a lookup in a learnable embedding matrix.
• hLP: Lattice parameters are first standardize element-wise using the training set statistics.
This 6-dimensional vector is then passed through a small MLP:
hLP = MLPLP
(cid:0) LP(x) − μtrain(LP)
σtrain(LP)
(cid:1)
(2)
C.2 Performance
Our proxy MLP model achieves an overall Mean Absolute Error of 0.10 ± 0.005 eV1. For
reference, best performing methods in Matbench leaderboard2 can achieve up to 10× better
performance. However, they all use 3D positions of the crystals, and remarkably, our approach
outperforms some of them, indicating that leveraging composition, space-group and lattice
parametrs serves as a viable representation in the formation energy estimation task.
In Figures 3 and 4 we detail further the performance of our Proxy MLP on the MatBench
validation set. In particular we observe that it maintains good performance for structures
with FE up to ∼ 0.3ev. The MAE beyond that FE level becomes high and unstable, but this
is expected as those are the regions of the target space with least data available. Additionally
we can verify in Figure 3 that our stratification algorithm works as expected, with similar
FE distributions in the validation and train splits.
C.3 Hyper parameters
We present the hyper parameters of our Proxy MLP in Table 1 along with a description of
their role in the architecture.
195% confidence interval, computed modeling the MAE as a log-normal distribution. This is further
justified by Fig. 4.
2https://matbench.materialsproject.org/Leaderboards%20Per-Task/matbench_v0.1_matbench_mp_
e_form/
14
Hyper parameter
Value
Description
properties_proj_size
group_emb_size
period_emb_size
z_emb_size
sg_emb_size
lat_hidden_channels
lat_num_layers
num_layers
64
16
256
128
128
284
1
5
Projection size of atomic properties h = WpZ
Embedding size of element's group
Embedding size of element's period
Embedding size of element's atomic number
Crystal space group embedding size
Hidden channels for layers processing the lattice parameters
Number of hidden layers for the lattice parameters MLP
Number of layers for final MLP processing composition,
space group and lattice parameters hidden representations
hidden_channels
576
Size of final MLP hidden layers.
optimizer
lr
batch_size
Adam
0.0017
448
Learning rate
scheduler
ReduceLROnPlateau
Divide learning rate by 2 when validation MAE
es_patience
epochs
11
100
does not improve for 4 epochs
Early stopping patience (in epochs)
Total epochs (effective after early stopping: 97)
Table 1: Proxy MLP hyper parameters
15
Figure 3: Proxy MLP performance on the validation set and data split FE distributions. The
average MAE is 0.10eV. We can also see the effect of the stratification algorithm wich yields
similar FE distributions between the train and validation data set splits.
D Additional results
In this section, we provide additional results demonstrating the diversity of the samples
generated by the Crystal-GFlowNet. They are displayed in Figure 5, Figure 6, Figure 7 and
Figure 8.
16
1012345MAE +/- 1 std for each FE binValidation MAE per FE binValidation MAE mean4321012Formation Energy0.0000.0010.0020.0030.0040.005ProportionTraining setValidation setFigure 4: Distribution of FE values in the validation set and associated Proxy MLP MAE,
with 25%, 50% and 75% MAE quantiles.
17
106105104103102101100101MAE (eV)4321012Formation Energy (eV)25% quantile50% quantile75% quantile0100001000Figure 5: Distribution of element prevalence per data set (10k Crystal-GFlowNet samples,
MatBench val, MatBench train).
18
HLiCNOFMgSiPSClFeElement0.000.050.100.150.200.250.300.35FrequencyCrystal-GFlownetMatBench ValMatBench TrainFigure 6: Distribution of binarized element co-occurrences per data set (10k Crystal-GFlowNet
samples, MatBench val, MatBench train). A binarized co-occurrence is defined as element i
and element j both being present in a crystal, regardless of their respective stoichiometry in
that crystal.
19
0.000.010.020.030.040.050.06FrequencyH-HH-LiH-CH-NH-OH-FH-MgH-SiH-PH-SH-ClH-FeLi-HLi-LiLi-CLi-NLi-OLi-FLi-MgLi-SiLi-PLi-SLi-ClLi-FeC-HC-LiC-CC-NC-OC-FC-MgC-SiC-PC-SC-ClC-FeN-HN-LiN-CN-NN-ON-FN-MgN-SiN-PN-SN-ClN-FeO-HO-LiO-CO-NO-OO-FO-MgO-SiO-PO-SO-ClO-FeF-HF-LiF-CF-NF-OF-FF-MgF-SiF-PF-SF-ClF-FeMg-HMg-LiMg-CMg-NMg-OMg-FMg-MgMg-SiMg-PMg-SMg-ClMg-FeSi-HSi-LiSi-CSi-NSi-OSi-FSi-MgSi-SiSi-PSi-SSi-ClSi-FeP-HP-LiP-CP-NP-OP-FP-MgP-SiP-PP-SP-ClP-FeS-HS-LiS-CS-NS-OS-FS-MgS-SiS-PS-SS-ClS-FeCl-HCl-LiCl-CCl-NCl-OCl-FCl-MgCl-SiCl-PCl-SCl-ClCl-FeFe-HFe-LiFe-CFe-NFe-OFe-FFe-MgFe-SiFe-PFe-SFe-ClFe-FeElement pairCrystal-GFlownetMatBench ValMatBench TrainFigure 7: Distribution of Space Groups per data set (10k Crystal-GFlowNet samples, MatBench
val, MatBench train)
20
0.0000.0250.0500.0750.1000.1250.1500.1750.200Frequency230229227225224221220217216206205199198194192189187186185181176167166164163162161160156155150148147146141140139138137136131129126123122121114113107102999288878685848274727170696766656463626160595857565553525147464443414038363331302926252120191816151413121110987654321Space groupCrystal-GFlownetMatBench ValMatBench TrainFigure 8: Distribution of lattice parameters
21
0.9020.7240.5460.3680.18100.00a (normalized)507090110130150alpha (normalized)0.9020.7240.5460.3680.18100.00b (normalized)507090110130150beta (normalized)Crystal-GFlownetMatBench ValMatBench Train0.9020.7240.5460.3680.18100.00c (normalized)Crystal-GFlownetMatBench ValMatBench Train507090110130150gamma (normalized) |
|
http://arxiv.org/abs/2310.04921v2 | "2023-10-18T14:52:03" | "2023-10-07T21:23:58" | Crystal: Introspective Reasoners Reinforced with Self-Feedback | Extensive work has shown that the performance and interpretability of
commonsense reasoning can be improved via knowledge-augmented reasoning
methods, where the knowledge that underpins the reasoning process is explicitly
verbalized and utilized. However, existing implementations, including
"chain-of-thought" and its variants, fall short in capturing the introspective
nature of knowledge required in commonsense reasoning, and in accounting for
the mutual adaptation between the generation and utilization of knowledge. We
propose a novel method to develop an introspective commonsense reasoner,
Crystal. To tackle commonsense problems, it first introspects for knowledge
statements related to the given question, and subsequently makes an informed
prediction that is grounded in the previously introspected knowledge. The
knowledge introspection and knowledge-grounded reasoning modes of the model are
tuned via reinforcement learning to mutually adapt, where the reward derives
from the feedback given by the model itself. Experiments show that Crystal
significantly outperforms both the standard supervised finetuning and
chain-of-thought distilled methods, and enhances the transparency of the
commonsense reasoning process. Our work ultimately validates the feasibility
and potential of reinforcing a neural model with self-feedback. | [
"Jiacheng Liu",
"Ramakanth Pasunuru",
"Hannaneh Hajishirzi",
"Yejin Choi",
"Asli Celikyilmaz"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04921v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04921v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.AI",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.AI",
"cs.CL",
"cs.LG"
] | CRYSTAL: Introspective Reasoners Reinforced with Self-Feedback
Jiacheng Liu♡♣∗ Ramakanth Pasunuru♣
Hannaneh Hajishirzi♡♠ Yejin Choi♡♠ Asli Celikyilmaz♣
♡Paul G. Allen School of Computer Science & Engineering, University of Washington
♣FAIR, Meta
♠Allen Institute for Artificial Intelligence
liujc@cs.washington.edu
3
2
0
2
t
c
O
8
1
]
I
A
.
s
c
[
2
v
1
2
9
4
0
.
0
1
3
2
:
v
i
X
r
a
Abstract
Extensive work has shown that the performance
and interpretability of commonsense reasoning
can be improved via knowledge-augmented rea-
soning methods, where the knowledge that un-
derpins the reasoning process is explicitly ver-
balized and utilized. However, existing imple-
mentations, including "chain-of-thought" and
its variants, fall short in capturing the intro-
spective nature of knowledge required in com-
monsense reasoning, and in accounting for the
mutual adaptation between the generation and
utilization of knowledge. We propose a novel
method to develop an introspective common-
sense reasoner, CRYSTAL. To tackle common-
sense problems, it first introspects for knowl-
edge statements related to the given question,
and subsequently makes an informed prediction
that is grounded in the previously introspected
knowledge. The knowledge introspection and
knowledge-grounded reasoning modes of the
model are tuned via reinforcement learning to
mutually adapt, where the reward derives from
the feedback given by the model itself. Experi-
ments show that CRYSTAL significantly outper-
forms both the standard supervised finetuning
and chain-of-thought distilled methods, and en-
hances the transparency of the commonsense
reasoning process. Our work ultimately vali-
dates the feasibility and potential of reinforcing
a neural model with self-feedback. 1
1
Introduction
Commonsense reasoning poses unique challenges
to neural reasoning models. The underlying knowl-
edge that grounds the reasoning process is often
obscure and inexplicable, even to humans as we
mainly rely on intuitive inference for such prob-
lems (Mercier and Sperber, 2017). This is in stark
contrast with multi-step logical reasoning (e.g.,
∗Work done as a visiting researcher at FAIR, Meta.
1Code: github.com/liujch1998/crystal
Model: huggingface.co/liujch1998/crystal-11b
Demo: huggingface.co/spaces/liujch1998/crystal
Figure 1: Top: CRYSTAL performing introspective rea-
soning on a commonsense question. The model first
uses its knowledge introspection mode to generate rele-
vant knowledge statements, then invokes a knowledge-
grounded reasoning mode to predict an answer based
on the introspected knowledge. Bottom: chain-of-
thought prompting on the same question (generated by
text-davinci-003 with original few-shot prompts in
Wei et al. (2022)). The intermediate steps fail to provide
meaningful insight into the reasoning process.
math problems, logical deductions), where the
reasoning process consists of explicit and closed-
world deduction steps. Chain-of-thought (CoT)
(Wei et al., 2022) and its variants have been suc-
cessful in multi-step logical reasoning, yet their ef-
fectiveness on commonsense reasoning is marginal,
largely due to the lack of the above observation
when designing their few-shot prompts. Never-
theless, generating the reasoning process is still
instrumental for commonsense reasoning, as it im-
proves both performance and interpretability of
neural models (Shwartz et al., 2020; Liu et al.,
2022a, i.a.). For such knowledge-augmented rea-
soning approach, two components are indispens-
able: (1) introspecting for relevant, high-quality
knowledge, and (2) effectively and faithfully utiliz-
ing the knowledge to make informed final predic-
tions.
Our key insight is that these two components
are deeply adaptive to each other: knowledge in-
trospection should aim to produce knowledge that
would be most beneficial to grounding the subse-
quent reasoning, and knowledge-grounded reason-
ing should learn to best leverage the previously
introspected knowledge. Existing literature does
not comprehensively optimize these two compo-
nents and the bi-directional interaction between
them, and comes with additional complications.
Knowledge-augmented reasoning methods largely
employ task-specific engineering for knowledge
generation and are thus difficult to generalize to
unseen domains. As for CoT and its variants, the
reasoning chains hardly provide meaningful infor-
mation due to deficiency in their prompt design
(Figure 1).
We aim to systematically address the above con-
siderations and build a strong, interpretable and
generalizable model for commonsense reasoning.
The introspective reasoner we develop, named
CRYSTAL, tackles commonsense problems by the
following (illustrated in Figure 1): it first invokes a
knowledge introspection mode to generate knowl-
edge statements related to the given question, and
subsequently invokes a knowledge-grounded rea-
soning mode that ingests both the question and the
previously introspected knowledge to predict an an-
swer. CRYSTAL is trained with reinforcement learn-
ing (RL) to improve the synergy between the rea-
soning paths and the final predictions. The knowl-
edge introspection mode of the model is trained
with PPO (Schulman et al., 2017) to optimize a
reward function that characterizes if the generated
knowledge can fix prediction errors made by the
knowledge-grounded reasoning mode of the model.
In this sense, CRYSTAL is reinforced with self-
generated feedback. Concurrently, the knowledge-
grounded reasoning mode evolves to better utilize
the introspected knowledge statements for more
accurate predictions. These two learning objectives
are harmonized through a novel interleaved opti-
mization schedule, echoing the principles of the
EM algorithm (Dempster et al., 1977). We employ
a two-stage training process: the RL training stage
is preceded by a supervised training stage, where
CRYSTAL acquires preliminary skills to generate
and utilize knowledge by imitating a larger LM
(e.g., GPT-3).
Experimental results on 25 commonsense QA
benchmarks (10 seen, 15 unseen) show that CRYS-
TAL not only enhances performance within fixed
model sizes, but also amplifies the interpretabil-
ity of the reasoning process. CRYSTAL outper-
forms direct QA models finetuned with standard
supervised learning and the same data, improving
absolute accuracy by 1.5% to 2.5% on different
model sizes, and showcases good generalization
to unseen benchmarks. This highlights the bene-
fits of introspective reasoning over direct inference.
Additionally, CRYSTAL substantially outperforms
models distilled from CoT produced by large LMs.
Through CRYSTAL, we illustrate the potential and
viability of reinforcing neural reasoning models
with self-feedback. An additional benefit of our
approach is the memory and time-efficient imple-
mentation of PPO via model sharing, which allows
this state-of-the-art RL algorithm to be applied to
larger models with given amount of resources.
2 Method
We will first introduce the concept of introspective
reasoning (§2.1), followed by a description of our
introspective reasoner, CRYSTAL, including its ba-
sic functionality (§2.2), training objectives (§2.3),
adaptation of the RL algorithm and efficiency im-
provements (§2.4), and the design of model training
process (§2.5, §2.6).
2.1
Introspective Reasoning
Conventionally, commonsense QA models are de-
signed to directly predict answers for questions
(e.g. Lourie et al., 2021). These models operate
like black boxes and their predictions are difficult
to interpret. We consider introspective reasoning,
where a system first introspects for commonsense
knowledge statements that are relevant to reasoning
about the given question, and subsequently makes
an informed prediction that is grounded in the in-
trospected knowledge. We refer to the former step
as knowledge introspection, and the latter step as
knowledge-grounded reasoning.
Figure 1 exemplifies the introspective reasoning
process. Given the question "What comes from
cows?" with the correct answer "nutritious flu-
ids" provided among other incorrect choices, the
system first generates knowledge statements like
"Cows produce milk." Taking this knowledge state-
ment as additional input, the system then invokes
knowledge-grounded reasoning and makes a cor-
rect prediction.
Introspective reasoning has promise in enhanc-
ing model performance on commonsense reasoning
while making the reasoning process more inter-
pretable. The introspected knowledge reveals the
Mode
I/O Format
Knowledge
introspection
Knowledge-
grounded
reasoning
Input: What comes from cows? \n (A) pork
(B) can be organic ...
(G) nutritious
fluid (H) corn \n Knowledge:
Output: Cows produce milk.
Input: What comes from cows? \n (A) pork
(B) can be organic ...
(G) nutritious
fluid (H) corn \n Knowledge: Cows produce
milk. \n Answer:
Output: G
Table 1: CRYSTAL's I/O format for its two modes.
reasoning paths that lead to the final predictions,
which human users can observe. The system can
explore and ensemble multiple reasoning paths and
thus make a more informed final prediction.
Knowledge introspection. The term "knowledge
introspection" was introduced by Liu et al. (2022a),
which also developed a dedicated knowledge in-
trospection model, Rainier. Our work extends this
idea to a unified introspective reasoning model.
2.2 CRYSTAL
CRYSTAL, the introspective reasoner that we de-
velop, is a unified model that supports the end-to-
end workflow of an introspective reasoning sys-
tem. CRYSTAL has two modes of operation: knowl-
edge introspection and knowledge-grounded rea-
soning. In knowledge introspection, the model ac-
cepts a question as input, and outputs a knowledge
statement relevant to the question. In knowledge-
grounded reasoning, the model ingests both the
question and the previously generated knowledge
statement as input, and outputs a prediction. The
system produces an final prediction by consulting
and aggregating predictions resulted from all the
available reasoning paths, effectively harnessing
the power of ensembled reasoning.
I/O format. Since CRYSTAL has two modes of
operation, it needs to discern when to conduct
knowledge introspection and when to engage in
knowledge-grounded reasoning. Drawing inspira-
tion from Tafjord and Clark (2021), we structure
the input/output format as demonstrated in Table 1.
This format is adapted from UnifiedQA (Khashabi
et al., 2020), and we detail our modifications in §A.
Notation. CRYSTAL is a sequence-to-sequence
generative model parameterized by θ. In knowl-
edge introspection, the modeling of knowledge
k given question q is denoted as pQK(k|q; θ); in
knowledge-grounded reasoning, the modeling of
answer prediction a is denoted as pQKA(a|q, k; θ).
2.3 Training Objectives
To yield the desired outcome of an introspective rea-
soning system, we need to make knowledge intro-
spection and knowledge-grounded reasoning well-
adapted to each other. The knowledge introspec-
tion component should aim to produce knowledge
that would be most beneficial to ground the sub-
sequent reasoning, and the knowledge-grounded
reasoning component should learn to best leverage
the previously introspected knowledge. We design
the training objectives to account for this mutual
adaptation.
Adapting reasoning to introspection. Suppose
a knowledge statement is sampled online from
CRYSTAL in the knowledge introspection mode:
ˆk ∼ pQK(k|q; θ). We use standard supervision and
minimize a knowledge-grounded reasoning loss:
LQKA(θ) = − log pQKA(a∗|q, ˆk; θ),
where a∗ is the correct answer for question q.
Adapting introspection to reasoning. The de-
sirability of introspected knowledge is determined
by its effectiveness on the subsequent knowledge-
grounded reasoning. A knowledge statement is
good if grounding in it can remediate an other-
wise incorrect prediction, and is bad if it misleads
an otherwise correct prediction. Formally, a good
knowledge statement should yield
a∗ ̸= arg max
a∈A
a∗ = arg max
a∈A
pQKA(a|q, ε; θ),
pQKA(a|q, ˆk; θ),
where A is the candidate set for question q, and ε
stands for no knowledge; and vice versa for a bad
knowledge statement.
However, a knowledge statement consists of a se-
quence of discrete tokens, rendering standard gra-
dient methods infeasible for optimizing the intro-
spected knowledge. Following Liu et al. (2022a),
we formulate the problem as reinforcement learn-
ing (RL), and optimize a reward function that char-
acterizes the desirability of knowledge:
r =
(cid:104)
tanh (cid:0)s(a∗|q, ˆk) − max
1
2
− tanh (cid:0)s(a∗|q, ε) − max
a′∈A\{a∗}
s(a′|q, ˆk)(cid:1)
s(a′|q, ε)(cid:1)(cid:105)
,
a′∈A\{a∗}
where s(a|q, k) is the pre-softmax logit of
pQKA(a|q, k; θ) on the single-token answer a. The
reward approaches +1 for good knowledge state-
ments and −1 for bad ones.
We use the PPO algorithm to optimize this reward.
A knowledge introspection loss LPPO(θ) can be
defined as a function of the reward and the model
parameter θ, following Liu et al. (2022a). Since
this training loss is derived from the downstream
knowledge-grounded reasoning results produced
by the same model, the model is reinforced with
feedback given by itself.
During training, the two objectives, LPPO(θ) and
LQKA(θ), are optimized under an interleaved sched-
ule (rather than jointly), which is described in §2.6.
Leaving out the direct QA objective. To pre-
vent the model from taking reasoning shortcuts and
encourage it to leverage the introspected knowl-
edge, we deliberately left out a potential, direct QA
objective:
LQA = − log pQA(a∗|q).
(1)
As we will show in experiments, including this
direct QA loss hurts performance, probably by
allowing the model to take shortcuts around the
knowledge.
2.4 PPO and Model Sharing
PPO, or Proximal Policy Optimization (Schulman
et al., 2017), is an RL algorithm that has been
widely used in aligning LMs with human feedback
(Stiennon et al., 2020; Ouyang et al., 2022; OpenAI,
2022; Wu et al., 2023). It is also adopted by Liu
et al. (2022a) to train their knowledge introspection
model, Rainier.
Within the context of PPO terminology, CRYS-
TAL's knowledge introspection mode assumes the
role of the policy model, while its knowledge-
grounded reasoning mode functions as the reward
model. PPO further employs a value model to esti-
mate the value function for states containing partial
knowledge statements, and we propose to reuse
the parameters of CRYSTAL for the value model as
well. Consequently, while in conventional PPO the
policy, value and reward models are parameterized
separately, when training CRYSTAL they share the
same underlying parameters. CRYSTAL is essen-
tially a generative LM equipped with two heads: an
LM head that comes into play during the policy and
reward modeling, and a value regression head that
is activated in value modeling. This model sharing
Figure 2: Illustration of the interleaved optimization
schedule for both training stages. In training stage I,
during each cycle, LQK is optimized for SQK iterations,
and then LQKA is optimized for SQKA iterations. Pro-
gressing to training stage II, during each cycle, LPPO
is optimized for SPPO iterations, and then LQKA is opti-
mized for SQKA iterations.
results in improved memory and time efficiency for
PPO training, as discussed in §4.4.
2.5 Two-Staged Training
PPO requires that the policy model is initialized
from a reasonably good state. Typically, PPO train-
ing follows a supervised finetuning stage for the
policy model (Stiennon et al., 2020; Ouyang et al.,
2022). For Rainier, an imitation learning stage,
during which the model is supervised on silver
knowledge statements obtained from a few-shot
GPT-3, precedes the RL training stage. This im-
itation learning stage imparts the model with the
preliminary skill of generating question-specific
knowledge, and sets a promising starting point for
RL.
Drawing from this concept, we employ a two-
stage training process for CRYSTAL. In training
stage I, the model is tuned to conduct both knowl-
edge introspection (by imitating a few-shot GPT-3)
and knowledge-grounded reasoning. We minimize
two losses: a knowledge introspection loss
LQK(θ) = − log pQK(k|q; θ),
and a knowledge-grounded reasoning loss
LQKA(θ) = − log pQKA(a∗|q, k; θ),
where k is a silver knowledge statement generated
by the few-shot GPT-3. In training stage II, we
follow the procedure in §2.3 to adapt the knowledge
introspection and knowledge-grounded reasoning
modes to each other.
2.6
Interleaved Optimization Schedule
Through empirical analysis, we have observed in-
terleaving the two training losses in each stage
yields beneficial outcomes as opposed to jointly
optimizing them. In stage I, we optimize LQK for
a specific number of iterations, followed by opti-
mizing LQKA for another set number of iterations,
repeating this cycle. Similarly, In stage II, we op-
timize LPPO for a designated number of iterations,
followed by optimizing LQKA for another set num-
ber of iterations, repeating this cycle. This design
bears resemblance to the EM algorithm (Dempster
et al., 1977), wherein the hidden variable corre-
sponds to the knowledge statement. Optimizing
LPPO can be likened to estimating the hidden vari-
ables, while optimizing LQKA is akin to updating
the parameter estimation based on the current as-
signment of hidden variables. The interleaved opti-
mization schedule is illustrated in Figure 2.
3 Experimental Setup
Datasets. To promote generalization, we train
CRYSTAL on 10 datasets (following Liu et al.
(2022a)): OpenBookQA (Mihaylov et al., 2018),
ARC (easy and hard splits) (Clark et al., 2018),
AI2Science (elementary and middle splits) (Clark
et al., 2018), CommonsenseQA (Talmor et al.,
2019), QASC (Khot et al., 2020), PhysicalIQA
(Bisk et al., 2020), SocialIQA (Sap et al., 2019),
and Winogrande (Sakaguchi et al., 2020). We
use the development set of these datasets to eval-
uate model performance (i.e., seen evaluation).
For unseen evaluation, we use the development
set of 15 additional datasets: Com2Sense (Singh
et al., 2021), SciQ (Welbl et al., 2017), QuaRel
(Tafjord et al., 2019a), QuaRTz (Tafjord et al.,
2019b), CycIC, ComVE (Wang et al., 2020), Wino-
grad Schema Challenge (Levesque et al., 2011),
COPA (Gordon et al., 2012), NumerSense (Lin
et al., 2020), PROST (Aroca-Ouellette et al., 2021),
SWAG (Zellers et al., 2018), HellaSwag (Zellers
et al., 2019), CODAH (Chen et al., 2019), Story
Cloze Test (Mostafazadeh et al., 2016), and αNLI
(Bhagavatula et al., 2020). See Table 9 (appendix)
for details. On the training datasets, we get sil-
ver knowledge from the davinci version of GPT-3
(Brown et al., 2020), with the few-shot prompts in
Liu et al. (2022a).
Models. Similar to Liu et al. (2022a), we initial-
ize CRYSTAL with T5 (Raffel et al., 2020). The
value regression head is initialized from scratch
at the beginning of stage II training. We exper-
iment with three model sizes: T5-large, T5-3b,
and T5-11b. We train models on V100 GPUs (8
for T5-large, 16 for T5-3b, and 64 for T5-11b),
with the Huggingface Transformers and Accelerate
libraries (Wolf et al., 2019; Gugger et al., 2022).
See Table 10 (appendix) for the complete hyperpa-
rameter settings.
Baselines. We primarily compare CRYSTAL with
models trained on the same datasets using the stan-
dard QA objective (i.e., Equation 1), referred as
"Direct QA". These models are also based on the
pretrained T5 of the three sizes above. Addition-
ally, we compare our model to Rainier (Liu et al.,
2022a) and several CoT-distilled models. Among
these, fine-tune-CoT (Ho et al., 2022) use zero-shot
reasoning chains elicited from text-davinci-002
to finetune smaller variants of GPT-3; SCoTD (Li
et al., 2023a) employs a similar distillation strategy,
whereas the teacher model is code-davinci-002
and the target model is OPT up to 1.3B param-
eters; SCOTT (Wang et al., 2023) proposes addi-
tional techniques to improve the reasoning integrity,
including a contrastive decoding method to elicit
more consistent reasoning chains from the teacher
model and a counterfactual reasoning method to
train the target model, and yet does not enable full
bidirectional adaptation between the reasoning pro-
cess and the final prediction, as our method does.
It is worth noting that these CoT-distilled models
are often trained on specific datasets, so we only
present their reported performance on the datasets
they were trained on.
We also report the existing SOTA performance
achieved by non-retrieval methods on each seen
dataset.2 We exclude retrieval-based methods for
fair comparison, because CRYSTAL does not rely
on retrieval from extra sources.
4 Results
4.1 Performance
The performance results are presented in Table 2
and Table 3. We organize the results based on the
size of the models and compare them to baseline
models that are no smaller than our models.
On seen datasets, across all model sizes we ex-
periment with, CRYSTAL consistently outperforms
the direct QA baseline (by 1.5%∼2.5% depending
on model size). This demonstrates that our training
process is superior to the standard supervised train-
ing and brings substantial performance gains to the
2Accessed from the AI2 leaderboards on 08/24/2023.
Method
Base model
Size
All OBQA ARC_e ARC_h AI2Sci_e AI2Sci_m CSQA QASC PIQA SIQA WG
SOTA (w/o retrieval)
–
–
–
87.80
–
GPT-3-babbage 1.3B
–
–
Fine-tune-CoT
OPT-1.3b
1.3B
SCoTD
67.00
–
Rainier (+ UnifiedQA) T5-large
770M 62.58 69.60
T5-large
770M 65.07 63.00
Direct QA
T5-large
770M 66.74 64.20
CRYSTAL (ours)
Fine-tune-CoT
SCOTT
Direct QA
CRYSTAL (ours)
Direct QA
CRYSTAL (ours)
GPT-3-curie
T5-3b
T5-3b
T5-3b
T5-11b
T5-11b
6.7B
3B
3B
3B
–
–
–
–
75.84 72.00
78.33 74.20
11B 82.49 80.00
11B 84.58 85.40
–
–
67.72
64.74
65.61
–
–
77.19
78.25
84.56
87.54
81.14
–
–
55.18
48.49
52.84
–
–
63.55
66.22
72.91
73.24
–
–
–
68.29
72.36
71.54
–
–
83.74
84.55
87.80
89.43
–
82.20 72.28 90.13 83.15 91.28
–
–
63.20
65.60
68.00
–
–
75.20
79.20
84.00
84.80
–
–
–
–
–
43.08
67.00
–
67.24 54.97 65.67 57.01 56.91
67.40 54.75 75.19 69.19 69.93
70.52 56.80 75.68 69.81 72.38
–
–
–
–
56.76
75.40 65.00
–
76.99 67.82 83.03 76.77 82.08
80.10 74.30 84.49 78.40 83.58
–
–
–
–
81.98 78.29 88.36 78.45 88.56
82.31 81.97 88.08 82.24 90.77
Table 2: Results on seen datasets. Accuracy on the development set is reported.
Method
Size
All C2S SciQ QuaRel QuaRTz CycIC ComVE WSC COPA NumerSense PROST SWAG HellaSwag CODAH SCT aNLI
770M 60.93 55.75 66.80 71.22
Direct QA
CRYSTAL (ours) 770M 62.95 56.52 66.70 70.86
Direct QA
3B
CRYSTAL (ours) 3B
67.73 58.57 75.90 81.29
72.06 65.98 79.50 80.58
11B 76.83 75.45 83.20 86.69
Direct QA
CRYSTAL (ours) 11B 80.37 85.93 85.30 85.97
67.45
67.71
70.83
73.96
77.34
76.30
49.83
49.72
55.35
60.20
69.57
70.89
83.45 78.02 74.20
85.46 81.68 77.60
93.08 82.05 90.20
95.49 89.74 91.20
96.89 94.14 94.00
98.09 93.77 94.00
23.00
23.00
20.00
28.50
30.50
41.50
38.07
41.34
36.83
44.35
44.39
59.37
46.48
51.54
57.77
60.48
65.68
69.58
45.65
48.51
49.31
56.58
69.37
76.06
62.36 86.37 65.27
66.43 90.27 66.84
75.54 95.14 74.15
81.45 96.37 76.57
84.73 97.70 82.83
87.64 98.50 82.64
Table 3: Results on unseen datasets. Accuracy on the development set is reported.
model. CRYSTAL also outperforms the combina-
tion of Rainier and UnifiedQA, especially over the
last five datasets (which UnifiedQA is not trained
on). This shows the benefit of adapting knowledge-
grounded reasoning to the introspected knowledge.
CRYSTAL performs very closely to existing non-
retrieval SOTA methods, setting new SOTA on
two datasets (CommonsenseQA, QASC), and has
less than 3% gap on other four (OpenBookQA,
PIQA, SIQA, Winogrande). It is worth noting that
these SOTA methods are good on different datasets,
whereas CRYSTAL is a single model with strong
performance on all these benchmarks. CRYSTAL is
also competitive when compared with CoT-distilled
models with similar sizes. The large and 3b ver-
sions of CRYSTAL beat Fine-tune-CoT on Com-
monsenseQA by 27% and 23%, respectively, de-
spite having smaller model sizes. CRYSTAL-large
is comparable to SCoTD on OpenBookQA and
CommonsenseQA, and CRYSTAL-3b significantly
outperforms SCOTT on CommonsenseQA (by 5%)
and QASC (by 9%).
Being trained on multiple commonsense
datasets, CRYSTAL exhibits good generalization
to unseen datasets. As shown in Table 3, CRYSTAL
achieves a 2.0%∼4.3% average accuracy improve-
ment over the direct QA baseline on the unseen
evaluation benchmarks. The largest version of our
Figure 3: Expert annotation on the relationship between
the introspected knowledge and the final prediction.
model, CRYSTAL-11b, achieves an average accu-
racy of over 80% on these benchmarks.
4.2
Interpretability
Beside QA accuracy, we measure whether the in-
trospective reasoning conducted by CRYSTAL pro-
vides good interpretability to its reasoning process.
We asked three NLP experts to annotate the rela-
tionship between the introspected knowledge and
the final prediction. We randomly selected 100 ex-
amples (four from each of the 25 datasets, includ-
ing both seen and unseen ones), and each annotator
made a full pass over them. For each example, the
annotator chooses one of the following labels:
Question
CRYSTAL's introspected knowledge
Direct QA's pred
CRYSTAL's pred
Task
WG
They discussed the company's budget at the business meeting but the _ was boring and the
topic of the budget ran long. (A) budget (B) meeting
The topic of the meeting was boring.
PIQA
Find spices easily in the kitchen. (A) Arrange spices from hot to mild in the kitchen in order
to find them by taste. (B) Arrange your spices alphabetically to make finding them easy.
A spice alphabet is used to find spices.
QASC
What comes from cows? (A) pork (B) can be organic (C) holding nutrients (D) drinking
water (E) rice (F) antigens (G) nutritious fluid (H) corn
Cows produce milk.
CSQA
Paul wants carrots and doesn't need to drive anywhere. He gets them from where? (A)
refrigerator (B) store (C) farmer's market (D) supermarket (E) dryer
Carrots are stored in the refrigerator.
OBQA
Frilled sharks and angler fish live far beneath the surface of the ocean, which is why they are
known as (A) Deep sea animals (B) fish (C) Long Sea Fish (D) Far Sea Animals
Deep sea animals are found in the ocean.
ARC_e
An anemometer is a tool that measures (A) wind direction. (B) wind speed. (C) air pressure.
(D) air temperature.
An anemometer measures wind speed and direction.
A
B
A
B
A
G
D
A
D
A
B
C
Table 4: Examples of CRYSTAL's introspected knowledge and predictions grounded in the knowledge. The first
row of each section is the original question and the prediction made by the direct QA model; the second row is the
knowledge statement generated by CRYSTAL in the knowledge introspection mode, and the prediction made by
CRYSTAL under knowledge-grounded reasoning with this knowledge statement. We show correct answers in green
and incorrect answers in red.
• Support: The knowledge can be part of a
non-trivial reasoning chain that supports the
predicted answer.
• Trivial: The knowledge is a trivial paraphrase
of the question and the predicted answer.
• Repeat: The knowledge is a mere repetition
of known information given in the question.
• Related: The knowledge is topically related
to the question and/or the choices, but can-
not be part of a reasoning chain to support or
refute any of the choices.
• Unrelated: The knowledge is unrelated to the
question.
• Contradict: The knowledge can be part of
a reasoning chain that refutes the predicted
answer, or supports a different choice.
See Table 11 (appendix) for a detailed description
of these labels and some examples.
The annotators reached a moderate level of
agreement (Fleiss κ = 0.53 (Landis and Koch,
1977)). As shown in Figure 3, in 34% of the cases
the introspected knowledge is found to support the
final prediction in a non-trivial manner. In 19% of
the cases the knowledge trivially entails the predic-
tion, and in another 31% of the cases the knowledge
is otherwise related to the question. The knowledge
repeats known information in the question 5% of
the time, and is unrelated to the question or contra-
dicts with the prediction 11% of the time. Overall,
the reasoning process has good interpretability in
the majority of cases.
4.3 Qualitative Examples
We present several examples in Table 4 to illustrate
the reasoning process of CRYSTAL. In most cases,
the introspective reasoning carried out by CRYS-
TAL leads to more accurate predictions compared to
the direct QA model. The knowledge introspected
by CRYSTAL often proves to be beneficial in ar-
riving at the correct prediction from human inter-
pretation standpoint. For example, the knowledge
"Cow produce milk" aids in concluding that "Nu-
tritious fluid comes from cows" (with the implicit
knowledge that "Milk is nutritious fluid"). This
showcases how the knowledge-grounded reasoning
of CRYSTAL leverages introspected knowledge to
reach accurate predictions. However, there are ex-
ceptional cases where the knowledge-grounded rea-
soning fails to incorporate the introspected knowl-
Method
# trained models
# frozen models
# forwards
# backwards
# optimizer steps
Rainier
CRYSTAL
2
1
2
1
5 + 2s
4 + s
2s
s
2s
s
Table 5: Theoretical memory and time consumption of PPO training in CRYSTAL. s is the number of minor steps in
each PPO iteration. (In our experiments, we use s = 4.)
Model
Base model Trainable params
# GPUs Total GPU mem PPO training speed
Rainier
CRYSTAL
CRYSTAL
CRYSTAL
T5-large
T5-large
T5-3b
T5-11b
1.54B
770M
3B
11B
8
8
16
64
153 GiB
129 GiB
488 GiB
2032 GiB
10.97 s/it
6.96 s/it
14.07 s/it
60.30 s/it
Table 6: Empirical memory usage and speed of training CRYSTAL (stage II). Experiments are conducted on V100
GPUs. Fully sharded data parallel (FSDP) and bfloat16 mixed precision are enabled.
edge. For example, the correct knowledge that "An
anemometer measures wind speed and direction"
is introspected, but CRYSTAL still predicts "air
pressure" instead of "wind speed" as the thing
measured by anemometers.
4.4 Memory and Time Efficiency
As mentioned in §2.4, the PPO training in CRYS-
TAL improves efficiency of the conventional PPO
algorithm by model sharing.
In this section,
through theoretical and empirical analysis, we com-
pare the memory and time consumption of PPO
training in CRYSTAL and Rainier (Liu et al., 2022a),
which employs the conventional PPO.
PPO in Rainier requires three different mod-
els: a policy model, a value model, and a reward
model. The policy model is Rainier, while the re-
ward model is a fixed QA model. The value model
is a separate model that shares the same architec-
ture as Rainier, with the exception that it has a
value regression head instead of a language model-
ing head. The policy and value models are trained
simultaneously, while the reward model remains
frozen. Additionally, an initial version of the pol-
icy model must be retained (to calculate the KL
penalty term). Therefore, a total of four models are
stored, with two of them being actively updated.
In each PPO iteration, Rainier requires 5 + 2s for-
ward passes, 2s backward passes, and 2s optimizer
(s is the number of mi-
updates on the model.
nor steps in each PPO iteration.) This involves
executing a gradient-less rollout from the policy,
one gradient-less forward pass on the value model,
another gradient-less forward pass on the initial
policy model, two gradient-less forward passes on
the reward model, and for each minor step in the
iteration, conducting one forward-backward pass
and one optimizer update on the policy model and
the value model, respectively.
In contrast
to Rainier, PPO on CRYSTAL
needs to store only two models: a shared pol-
icy/value/reward model which is being actively up-
dated, and an initial version of the policy model
(to compute the KL penalty term). In each PPO
iteration, CRYSTAL needs 4 + s forward passes,
s backward passes, and s optimizer updates on
the model: a gradient-less rollout from the policy,
one gradient-less forward pass on the initial pol-
icy model, two gradient-less forward passes on the
reward model, plus for each minor step in the itera-
tion, one forward-backward pass and one optimizer
update on the policy/value model.
Table 5 summarizes the theoretical memory and
time consumption of Rainier and CRYSTAL, and
Table 6 reports the empirical memory usage and
speed in the stage II training of these models. Com-
pared with Rainier, CRYSTAL has less trainable
parameters, consumes less GPU memory, and has
faster training speed. The superior memory and
time efficiency of CRYSTAL enables training larger
models, and a 11b model can be reinforced with 64
V100 GPUs.
4.5 Ablations
The effect of RL. We report the impact of remov-
ing RL (i.e. training stage II) in Table 7. Across
different model sizes, the performance of CRYSTAL
on seen datasets consistently decreases by approx-
imately 0.5% to 0.6% when training stage II is
omitted. This highlights the significance of RL in
enchancing the knowledge introspection and knowl-
edge grounded reasoning capability of CRYSTAL.
Method
CRYSTAL (ours)
- Stage II
+ Direct QA loss
CRYSTAL (ours)
- Stage II
CRYSTAL (ours)
- Stage II
Size
Seen
770M 66.74
770M 66.16
770M 65.36
3B
3B
11B
11B
78.33
77.79
84.58
84.08
Table 7: Ablations on the RL training stage (i.e., stage
II). Average accuracy on the development set of seen
datasets is reported.
Stage I
Stage II
Seen
interleaved
joint
joint
interleaved
interleaved
joint
66.74
66.66
66.31
Table 8: Ablations on the interleaved training objec-
tives. Average accuracy on the development set of seen
datasets is reported.
Impact of the direct QA loss. We experimented
with training the stage I model with the addition of
the direct QA loss (§2.3, Equation 1). As shown
in Table 7, training with this additional loss hurts
performance by 0.8%. We therefore did not include
this loss in the training objective of CRYSTAL.
Interleaved objectives. To demonstrate the ad-
vantages of interleaving the training objectives, we
explore an alternative approach using a joint ob-
jective. In this approach, during training stage I,
we optimize the joint loss, LQK + LQKA, in each
iteration. Similarly, during training stage II, we
optimize the joint loss, LPPO + LQKA. Table 8
presents the results of this approach, where the
interleaved objectives are replaced with the joint
version. As such, the performance on seen datasets
decreases. This suggests that the interleaving of
objectives in CRYSTAL provides a benefit over the
joint optimization approach.
5 Related Work
Knowledge-augmented reasoning. There has
been numerous work that grounds reasoning in
model-generated knowledge (Bosselut et al., 2021;
Rajani et al., 2019; Latcinnik and Berant, 2020;
Shwartz et al., 2020; Paranjape et al., 2021; Liu
et al., 2022b; Gu et al., 2022; Liu et al., 2022a;
Wang et al., 2022b,a; Yu et al., 2022; Li et al.,
2023b; Wei et al., 2022). We summarize these
methods in Table 12 (appendix). Our method is
the first to account for the mutual adaptation of
knowledge generation and knowledge-grounded
reasoning in a unified model setting.
Relation to chain-of-thought distillation. A se-
ries of work endow smaller LMs with step-by-step
reasoning capabilities by distilling from chain-of-
thought (CoT) generated by large LMs (Li et al.,
2022; Shridhar et al., 2022; Magister et al., 2022;
Ho et al., 2022; Fu et al., 2023; Li et al., 2023a;
Wang et al., 2023). We share similarity with this
line of work in that our part of training process (i.e.,
training stage I) include distilling the emergent ca-
pability of a larger LM to a smaller one. We differ
in that we capture the introspective nature of knowl-
edge required for commonsense reasoning, and we
further use reinforcement learning to improve the
synergy between reasoning paths and final answer
predictions.
Improving from self-feedback. Several papers
have proposed to improve LMs using feedback
from themselves. For example, Zelikman et al.
(2022) proposes to train a model with its self-
generated reasoning steps that result in itself mak-
ing the correct final predictions. Huang et al. (2022)
chooses which self-generated reasoning chains to
train on by selecting the high-confidence, self-
consistent ones. Both papers use supervised loss
to improve the model. To our best knowledge, we
are the first to improve models from self-feedback
using RL.
Concurrent to our work, Madaan et al. (2023) pro-
poses an inference-time method to improve text
generation by taking an LM's own feedback on
the output, and yet it relies on the emergent behav-
ior of LLMs, whereas CRYSTAL improves through
RL and can be applied to smaller LMs to achieve
higher performance than larger LLMs.
6 Conclusion
We develop a method to build introspective reason-
ers that achieves superior performance and good
interpretability on commonsense reasoning tasks.
Compared with prior literature, our method com-
prehensively accounts for the introspective nature
of knowledge required in commonsense reason-
ing, and the mutual adaptation of knowledge intro-
spection and knowledge-grounded reasoning. Our
approach highlights the feasibility and benefit of
training neural models with self-feedback.
Limitations
CRYSTAL is intended to solve commonsense
QA problems, and its performance on non-
commonsense applications is unknown and thus
requires further investigation. There is also a limit
on the length of knowledge it generates in our ex-
perimental setting, and it has not been tested on gen-
erating long and coherent text. Extra care should
be taken when applying our model in production
environments, especially when making critical de-
cisions or exposing its generated contents directly
to human end users.
Acknowledgements
We thank members of the H2lab for their con-
structive feedback. This work was funded in part
by the DARPA MCS program through NIWC Pa-
cific (N66001-19-2-4031), NSF IIS-2044660, NSF
DMS-2134012, and ONR N00014-18-1-2826. JL
is supported in part by the Meta AI Mentorship
program.
References
Stéphane Aroca-Ouellette, Cory Paik, Alessandro Ron-
cone, and Katharina Kann. 2021. PROST: Physi-
cal reasoning about objects through space and time.
In Findings of the Association for Computational
Linguistics: ACL-IJCNLP 2021, pages 4597–4608,
Online. Association for Computational Linguistics.
Chandra Bhagavatula, Ronan Le Bras, Chaitanya
Malaviya, Keisuke Sakaguchi, Ari Holtzman, Han-
nah Rashkin, Doug Downey, Wen-tau Yih, and Yejin
Choi. 2020. Abductive commonsense reasoning. In
8th International Conference on Learning Represen-
tations, ICLR 2020, Addis Ababa, Ethiopia, April
26-30, 2020. OpenReview.net.
Yonatan Bisk, Rowan Zellers, Ronan LeBras, Jianfeng
Gao, and Yejin Choi. 2020. PIQA: reasoning about
physical commonsense in natural language. In The
Thirty-Fourth AAAI Conference on Artificial Intelli-
gence, AAAI 2020, The Thirty-Second Innovative Ap-
plications of Artificial Intelligence Conference, IAAI
2020, The Tenth AAAI Symposium on Educational
Advances in Artificial Intelligence, EAAI 2020, New
York, NY, USA, February 7-12, 2020, pages 7432–
7439. AAAI Press.
Antoine Bosselut, Ronan Le Bras, and Yejin Choi. 2021.
Dynamic neuro-symbolic knowledge graph construc-
tion for zero-shot commonsense question answering.
In Thirty-Fifth AAAI Conference on Artificial Intel-
ligence, AAAI 2021, Thirty-Third Conference on In-
novative Applications of Artificial Intelligence, IAAI
2021, The Eleventh Symposium on Educational Ad-
vances in Artificial Intelligence, EAAI 2021, Virtual
Event, February 2-9, 2021, pages 4923–4931. AAAI
Press.
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie
Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind
Neelakantan, Pranav Shyam, Girish Sastry, Amanda
Askell, Sandhini Agarwal, Ariel Herbert-Voss,
Gretchen Krueger, Tom Henighan, Rewon Child,
Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu,
Clemens Winter, Christopher Hesse, Mark Chen, Eric
Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess,
Jack Clark, Christopher Berner, Sam McCandlish,
Alec Radford, Ilya Sutskever, and Dario Amodei.
2020. Language models are few-shot learners. In Ad-
vances in Neural Information Processing Systems 33:
Annual Conference on Neural Information Process-
ing Systems 2020, NeurIPS 2020, December 6-12,
2020, virtual.
Michael Chen, Mike D'Arcy, Alisa Liu, Jared Fernan-
dez, and Doug Downey. 2019. Codah: An adversar-
ially authored question-answer dataset for common
sense. ArXiv preprint, abs/1904.04365.
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot,
Ashish Sabharwal, Carissa Schoenick, and Oyvind
Tafjord. 2018. Think you have solved question an-
swering? try arc, the ai2 reasoning challenge. ArXiv
preprint, abs/1803.05457.
Arthur P Dempster, Nan M Laird, and Donald B Rubin.
1977. Maximum likelihood from incomplete data
via the em algorithm. Journal of the royal statistical
society: series B (methodological), 39(1):1–22.
Yao Fu, Hao-Chun Peng, Litu Ou, Ashish Sabharwal,
and Tushar Khot. 2023. Specializing smaller lan-
guage models towards multi-step reasoning. ArXiv
preprint, abs/2301.12726.
Andrew Gordon, Zornitsa Kozareva, and Melissa Roem-
mele. 2012. SemEval-2012 task 7: Choice of plau-
sible alternatives: An evaluation of commonsense
causal reasoning. In *SEM 2012: The First Joint
Conference on Lexical and Computational Seman-
tics – Volume 1: Proceedings of the main conference
and the shared task, and Volume 2: Proceedings of
the Sixth International Workshop on Semantic Eval-
uation (SemEval 2012), pages 394–398, Montréal,
Canada. Association for Computational Linguistics.
Yuling Gu, Bhavana Dalvi, and Peter Clark. 2022.
DREAM: Improving situational QA by first elab-
In Proceedings of the 2022
orating the situation.
Conference of the North American Chapter of the
Association for Computational Linguistics: Human
Language Technologies, pages 1115–1127, Seattle,
United States. Association for Computational Lin-
guistics.
Sylvain Gugger, Lysandre Debut, Thomas Wolf, Philipp
Schmid, Zachary Mueller, and Sourab Mangrulkar.
2022. Accelerate: Training and inference at scale
made simple, efficient and adaptable. https://
github.com/huggingface/accelerate.
Namgyu Ho, Laura Schmid, and Se-Young Yun. 2022.
Large language models are reasoning teachers. ArXiv
preprint, abs/2212.10071.
Jiaxin Huang, Shixiang Shane Gu, Le Hou, Yuexin Wu,
Xuezhi Wang, Hongkun Yu, and Jiawei Han. 2022.
Large language models can self-improve. ArXiv
preprint, abs/2210.11610.
Daniel Khashabi, Sewon Min, Tushar Khot, Ashish
Sabharwal, Oyvind Tafjord, Peter Clark, and Han-
naneh Hajishirzi. 2020. UNIFIEDQA: Crossing for-
mat boundaries with a single QA system. In Find-
ings of the Association for Computational Linguistics:
EMNLP 2020, pages 1896–1907, Online. Association
for Computational Linguistics.
Tushar Khot, Peter Clark, Michal Guerquin, Peter
Jansen, and Ashish Sabharwal. 2020. QASC: A
dataset for question answering via sentence compo-
In The Thirty-Fourth AAAI Conference on
sition.
Artificial Intelligence, AAAI 2020, The Thirty-Second
Innovative Applications of Artificial Intelligence Con-
ference, IAAI 2020, The Tenth AAAI Symposium on
Educational Advances in Artificial Intelligence, EAAI
2020, New York, NY, USA, February 7-12, 2020,
pages 8082–8090. AAAI Press.
J Richard Landis and Gary G Koch. 1977. The mea-
surement of observer agreement for categorical data.
biometrics, pages 159–174.
Veronica Latcinnik and Jonathan Berant. 2020. Explain-
ing question answering models through text genera-
tion. ArXiv preprint, abs/2004.05569.
Hector J. Levesque, Ernest Davis, and L. Morgenstern.
2011. The winograd schema challenge. In Interna-
tional Conference on Principles of Knowledge Rep-
resentation and Reasoning.
Liunian Harold Li, Jack Hessel, Youngjae Yu, Xiang
Ren, Kai-Wei Chang, and Yejin Choi. 2023a. Sym-
bolic chain-of-thought distillation: Small models can
also "think" step-by-step. ArXiv.
Shiyang Li, Jianshu Chen, Yelong Shen, Zhiyu Chen,
Xinlu Zhang, Zekun Li, Hong Wang, Jingu Qian,
Baolin Peng, Yi Mao, Wenhu Chen, and Xifeng
Yan. 2022. Explanations from large language mod-
els make small reasoners better. ArXiv preprint,
abs/2210.06726.
Zekun Li, Baolin Peng, Pengcheng He, Michel Galley,
Jianfeng Gao, and Xi Yan. 2023b. Guiding large
language models via directional stimulus prompting.
ArXiv preprint, abs/2302.11520.
Bill Yuchen Lin, Seyeon Lee, Rahul Khanna, and Xiang
Ren. 2020. Birds have four legs?! NumerSense:
Probing Numerical Commonsense Knowledge of Pre-
Trained Language Models. In Proceedings of the
2020 Conference on Empirical Methods in Natural
Language Processing (EMNLP), pages 6862–6868,
Online. Association for Computational Linguistics.
Jiacheng Liu, Skyler Hallinan, Ximing Lu, Pengfei He,
Sean Welleck, Hannaneh Hajishirzi, and Yejin Choi.
2022a. Rainier: Reinforced knowledge introspector
for commonsense question answering. In Proceed-
ings of the 2022 Conference on Empirical Methods
in Natural Language Processing, pages 8938–8958,
Abu Dhabi, United Arab Emirates. Association for
Computational Linguistics.
Jiacheng Liu, Alisa Liu, Ximing Lu, Sean Welleck, Pe-
ter West, Ronan Le Bras, Yejin Choi, and Hannaneh
Hajishirzi. 2022b. Generated knowledge prompting
for commonsense reasoning. In Proceedings of the
60th Annual Meeting of the Association for Compu-
tational Linguistics (Volume 1: Long Papers), pages
3154–3169, Dublin, Ireland. Association for Compu-
tational Linguistics.
Nicholas Lourie, Ronan Le Bras, Chandra Bhagavatula,
and Yejin Choi. 2021. UNICORN on RAINBOW: A
universal commonsense reasoning model on a new
multitask benchmark. In Thirty-Fifth AAAI Confer-
ence on Artificial Intelligence, AAAI 2021, Thirty-
Third Conference on Innovative Applications of Arti-
ficial Intelligence, IAAI 2021, The Eleventh Sympo-
sium on Educational Advances in Artificial Intelli-
gence, EAAI 2021, Virtual Event, February 2-9, 2021,
pages 13480–13488. AAAI Press.
Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler
Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon,
Nouha Dziri, Shrimai Prabhumoye, Yiming Yang,
Sean Welleck, Bodhisattwa Prasad Majumder,
Shashank Gupta, Amir Yazdanbakhsh, and Peter
Clark. 2023. Self-refine: Iterative refinement with
self-feedback. ArXiv, abs/2303.17651.
Lucie Charlotte Magister, Jonathan Mallinson, Jakub
Adamek, Eric Malmi, and Aliaksei Severyn. 2022.
Teaching small language models to reason. ArXiv
preprint, abs/2212.08410.
Hugo Mercier and Dan Sperber. 2017. The enigma of
reason.
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish
Sabharwal. 2018. Can a suit of armor conduct elec-
tricity? a new dataset for open book question an-
swering. In Proceedings of the 2018 Conference on
Empirical Methods in Natural Language Processing,
pages 2381–2391, Brussels, Belgium. Association
for Computational Linguistics.
Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong
He, Devi Parikh, Dhruv Batra, Lucy Vanderwende,
Pushmeet Kohli, and James Allen. 2016. A corpus
and cloze evaluation for deeper understanding of
commonsense stories. In Proceedings of the 2016
Conference of the North American Chapter of the
Association for Computational Linguistics: Human
Language Technologies, pages 839–849, San Diego,
California. Association for Computational Linguis-
tics.
OpenAI. 2022. Introducing chatgpt.
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Car-
roll L. Wainwright, Pamela Mishkin, Chong Zhang,
Sandhini Agarwal, Katarina Slama, Alex Ray, John
Schulman, Jacob Hilton, Fraser Kelton, Luke E.
Miller, Maddie Simens, Amanda Askell, Peter Welin-
der, Paul Francis Christiano, Jan Leike, and Ryan J.
Lowe. 2022. Training language models to follow
instructions with human feedback. ArXiv preprint,
abs/2203.02155.
Bhargavi Paranjape,
Julian Michael, Marjan
Ghazvininejad, Hannaneh Hajishirzi, and Luke
Zettlemoyer. 2021. Prompting contrastive explana-
tions for commonsense reasoning tasks. In Findings
of the Association for Computational Linguistics:
ACL-IJCNLP 2021, pages 4179–4192, Online.
Association for Computational Linguistics.
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine
Lee, Sharan Narang, Michael Matena, Yanqi Zhou,
Wei Li, and Peter J. Liu. 2020. Exploring the limits
of transfer learning with a unified text-to-text trans-
former. J. Mach. Learn. Res., 21:140:1–140:67.
Nazneen Fatema Rajani, Bryan McCann, Caiming
Xiong, and Richard Socher. 2019. Explain your-
self! leveraging language models for commonsense
reasoning. In Proceedings of the 57th Annual Meet-
ing of the Association for Computational Linguistics,
pages 4932–4942, Florence, Italy. Association for
Computational Linguistics.
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavat-
ula, and Yejin Choi. 2020. Winogrande: An adver-
sarial winograd schema challenge at scale. In The
Thirty-Fourth AAAI Conference on Artificial Intelli-
gence, AAAI 2020, The Thirty-Second Innovative Ap-
plications of Artificial Intelligence Conference, IAAI
2020, The Tenth AAAI Symposium on Educational
Advances in Artificial Intelligence, EAAI 2020, New
York, NY, USA, February 7-12, 2020, pages 8732–
8740. AAAI Press.
Maarten Sap, Hannah Rashkin, Derek Chen, Ronan
Le Bras, and Yejin Choi. 2019. Social IQa: Com-
monsense reasoning about social interactions.
In
Proceedings of the 2019 Conference on Empirical
Methods in Natural Language Processing and the
9th International Joint Conference on Natural Lan-
guage Processing (EMNLP-IJCNLP), pages 4463–
4473, Hong Kong, China. Association for Computa-
tional Linguistics.
John Schulman, Filip Wolski, Prafulla Dhariwal,
Alec Radford, and Oleg Klimov. 2017. Proximal
policy optimization algorithms. ArXiv preprint,
abs/1707.06347.
Kumar Shridhar, Alessandro Stolfo, and Mrinmaya
Sachan. 2022. Distilling multi-step reasoning ca-
pabilities of large language models into smaller mod-
els via semantic decompositions. ArXiv preprint,
abs/2212.00193.
commonsense question answering with self-talk. In
Proceedings of the 2020 Conference on Empirical
Methods in Natural Language Processing (EMNLP),
pages 4615–4629, Online. Association for Computa-
tional Linguistics.
Shikhar Singh, Nuan Wen, Yu Hou, Pegah Alipoormo-
labashi, Te-lin Wu, Xuezhe Ma, and Nanyun Peng.
2021. COM2SENSE: A commonsense reasoning
benchmark with complementary sentences. In Find-
ings of the Association for Computational Linguistics:
ACL-IJCNLP 2021, pages 883–898, Online. Associa-
tion for Computational Linguistics.
Nisan Stiennon, Long Ouyang, Jeff Wu, Daniel M.
Ziegler, Ryan J. Lowe, Chelsea Voss, Alec Radford,
Dario Amodei, and Paul Christiano. 2020. Learning
to summarize from human feedback. ArXiv preprint,
abs/2009.01325.
Oyvind Tafjord and Peter Clark. 2021. General-purpose
question-answering with macaw. ArXiv preprint,
abs/2109.02593.
Oyvind Tafjord, Peter Clark, Matt Gardner, Wen-tau
Yih, and Ashish Sabharwal. 2019a. QUAREL: A
dataset and models for answering questions about
qualitative relationships. In The Thirty-Third AAAI
Conference on Artificial Intelligence, AAAI 2019, The
Thirty-First Innovative Applications of Artificial In-
telligence Conference, IAAI 2019, The Ninth AAAI
Symposium on Educational Advances in Artificial
Intelligence, EAAI 2019, Honolulu, Hawaii, USA,
January 27 - February 1, 2019, pages 7063–7071.
AAAI Press.
Oyvind Tafjord, Matt Gardner, Kevin Lin, and Peter
Clark. 2019b. QuaRTz: An open-domain dataset of
qualitative relationship questions. In Proceedings of
the 2019 Conference on Empirical Methods in Natu-
ral Language Processing and the 9th International
Joint Conference on Natural Language Processing
(EMNLP-IJCNLP), pages 5941–5946, Hong Kong,
China. Association for Computational Linguistics.
Alon Talmor, Jonathan Herzig, Nicholas Lourie, and
Jonathan Berant. 2019. CommonsenseQA: A ques-
tion answering challenge targeting commonsense
knowledge. In Proceedings of the 2019 Conference
of the North American Chapter of the Association for
Computational Linguistics: Human Language Tech-
nologies, Volume 1 (Long and Short Papers), pages
4149–4158, Minneapolis, Minnesota. Association for
Computational Linguistics.
Cunxiang Wang, Shuailong Liang, Yili Jin, Yilong
Wang, Xiaodan Zhu, and Yue Zhang. 2020. SemEval-
2020 task 4: Commonsense validation and explana-
In Proceedings of the Fourteenth Workshop
tion.
on Semantic Evaluation, pages 307–321, Barcelona
(online). International Committee for Computational
Linguistics.
Vered Shwartz, Peter West, Ronan Le Bras, Chandra
Bhagavatula, and Yejin Choi. 2020. Unsupervised
Peifeng Wang, Aaron Chan, Filip Ilievski, Muhao Chen,
and Xiang Ren. 2022a. Pinto: Faithful language
reasoning using prompt-generated rationales. ArXiv
preprint, abs/2211.01562.
Peifeng Wang, Zhengyang Wang, Zheng Li, Yifan
Gao, Bing Yin, and Xiang Ren. 2023.
Scott:
Self-consistent chain-of-thought distillation. ArXiv
preprint, abs/2305.01879.
Wenya Wang, Vivek Srikumar, Hannaneh Hajishirzi,
and Noah A. Smith. 2022b. Elaboration-generating
commonsense question answering at scale. ArXiv
preprint, abs/2209.01232.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten
Bosma, Ed Huai hsin Chi, F. Xia, Quoc Le, and
Denny Zhou. 2022. Chain of thought prompting
elicits reasoning in large language models. ArXiv
preprint, abs/2201.11903.
Johannes Welbl, Nelson F. Liu, and Matt Gardner. 2017.
Crowdsourcing multiple choice science questions.
In Proceedings of the 3rd Workshop on Noisy User-
generated Text, pages 94–106, Copenhagen, Den-
mark. Association for Computational Linguistics.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien
Chaumond, Clement Delangue, Anthony Moi, Pier-
ric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz,
and Jamie Brew. 2019. Huggingface's transformers:
State-of-the-art natural language processing. ArXiv
preprint, abs/1910.03771.
Zeqiu Wu, Yushi Hu, Weijia Shi, Nouha Dziri, Alane
Suhr, Prithviraj Ammanabrolu, Noah A. Smith, Mari
Ostendorf, and Hanna Hajishirzi. 2023. Fine-grained
human feedback gives better rewards for language
model training. ArXiv, abs/2306.01693.
W. Yu, Dan Iter, Shuohang Wang, Yichong Xu, Mingx-
uan Ju, Soumya Sanyal, Chenguang Zhu, Michael
Zeng, and Meng Jiang. 2022. Generate rather than
retrieve: Large language models are strong context
generators. ArXiv preprint, abs/2209.10063.
E. Zelikman, Yuhuai Wu, and Noah D. Goodman. 2022.
Star: Bootstrapping reasoning with reasoning. ArXiv
preprint, abs/2203.14465.
Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin
Choi. 2018. SWAG: A large-scale adversarial dataset
for grounded commonsense inference. In Proceed-
ings of the 2018 Conference on Empirical Methods in
Natural Language Processing, pages 93–104, Brus-
sels, Belgium. Association for Computational Lin-
guistics.
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali
Farhadi, and Yejin Choi. 2019. HellaSwag: Can a ma-
chine really finish your sentence? In Proceedings of
the 57th Annual Meeting of the Association for Com-
putational Linguistics, pages 4791–4800, Florence,
Italy. Association for Computational Linguistics.
A More on Method
C More on Results
Table 11 reports the detailed instructions for the
human evaluation.
D More on Related Work
Table 12 compares CRYSTAL with existing meth-
ods for knowledge-augmented commonsense rea-
soning.
I/O format of CRYSTAL. The input/output for-
mat illustrated in Table 1 is adapted from Khashabi
et al. (2020), based on which we made the follow-
ing changes:
• The input is appended with a marker that in-
dicates which mode of operation is desired.
In knowledge introspection this marker is
"Knowledge:", and in knowledge-grounded
reasoning it is "Answer:".
• The output is the letter for the predicted an-
swer choice, not the actual content of an an-
swer choice.
• The input and output text are not lowercased.
B More on Experimental Setup
Table 9 shows the datasets we use for training and
evaluation, along with their citations. Table 10
reports the hyperparameters.
Abbr.
Name
Citation
Link
TRAINING + EVALUATION (SEEN)
OBQA
ARC_e
ARC_h
AI2Sci_e
AI2Sci_m
CSQA
QASC
PIQA
SIQA
WG
Mihaylov et al. (2018)
OpenBookQA
Clark et al. (2018)
ARC (easy)
Clark et al. (2018)
ARC (hard)
AI2 Science (elem)
Clark et al. (2018)
AI2 Science (middle) Clark et al. (2018)
CommonsenseQA
QASC
Physical IQA
Social IQA
Winogrande
Talmor et al. (2019)
Khot et al. (2020)
Bisk et al. (2020)
Sap et al. (2019)
Sakaguchi et al. (2020)
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
https://github.com/allenai/unifiedqa
EVALUATION (UNSEEN)
C2S
Com2Sense (paired) Singh et al. (2021)
SciQ
QuaRel
QuaRTz
CycIC
SciQ
QuaRel
QuaRTz
CycIC (mc)
Welbl et al. (2017)
Tafjord et al. (2019a)
Tafjord et al. (2019b)
–
ComVE
ComVE (task A)
Wang et al. (2020)
WSC
COPA
NumerSense NumerSense
WSC
COPA
Levesque et al. (2011)
Gordon et al. (2012)
Lin et al. (2020)
https://github.com/PlusLabNLP/Com2Sense/tree/
master/data
https://allenai.org/data/sciq
https://allenai.org/data/quarel
https://allenai.org/data/quartz
https://leaderboard.allenai.org/cycic/
submissions/get-started
SemEval2020-Task4-Commonsense-Validation-and-
Explanation
https://huggingface.co/datasets/winograd_wsc
https://huggingface.co/datasets/super_glue
https://github.com/INK-USC/NumerSense/tree/main/
data
PROST
SWAG
PROST
SWAG
HellaSwag HellaSwag
CODAH
CODAH
SCT
αNLI
Story Cloze Test
αNLI
Zellers et al. (2019)
Aroca-Ouellette et al. (2021) https://huggingface.co/datasets/corypaik/prost
https://github.com/rowanz/swagaf/tree/master/
Zellers et al. (2018)
data
https://github.com/rowanz/hellaswag/tree/master/
data
https://github.com/Websail-NU/CODAH/tree/master/
data
https://cs.rochester.edu/nlp/rocstories/
https://leaderboard.allenai.org/anli/submissions/
get-started
Mostafazadeh et al. (2016)
Bhagavatula et al. (2020)
Chen et al. (2019)
Table 9: Dataset details. We show the link from which we retrieved each dataset.
Symbol
Value
Description
LQ
LK
LA
M
p
B
S
SQK
SQKA
η
α
β
γ
λ
ε
τ
E
B
S
s
SPPO
SQKA
η
256
32
2
20
0.5
SHARED HYPERPARAMETERS
Max number of tokens in question (including choices).
Max number of tokens in knowledge.
Max number of tokens in answer.
GETTING SILVER KNOWLEDGE FROM FEW-SHOT GPT-3
Number of knowledge statements to sample from GPT-3, per question.
Parameter for nucleus sampling from GPT-3.
STAGE I: IMITATION LEARNING
64
50,000
500
500
1 × 10−5
Batch size for training.
Total number of training iterations.
Number of iterations for knowledge introspection in each interleaving cycle.
Number of iterations for knowledge-grounded reasoning in each interleaving cycle.
Learning rate of Adam optimizer.
STAGE II: REINFORCEMENT LEARNING
1.0
0.2
1.0
0.95
0.2
0.7
2M
64
31,250
4
500
500
1 × 10−5
1 × 10−6
Weight of value model loss in PPO.
Weight of entropy bonus term in reward.
Discount factor for rewards.
Parameter for advantage estimation.
Clipping range for the clipped surrogate objective.
Temperature for knowledge sampling in PPO training.
Total number of training episodes.
Batch size for training.
Total number of training iterations.
Number of PPO update steps in each iteration for knowledge introspection.
Number of iterations for knowledge introspection in each interleaving cycle.
Number of iterations for knowledge-grounded reasoning in each interleaving cycle.
Learning rate of Adam optimizer (for CRYSTAL-large).
(for CRYSTAL-3b and -11b).
M
p
10
0.5
Number of knowledge statements to sample from CRYSTAL, per question.
Parameter for nucleus sampling from CRYSTAL.
INFERENCE
Table 10: Hyperparameter settings.
Label
Description
Example
Support
The knowledge can be part
of a non-trivial reasoning
chain that supports the pre-
dicted answer.
Question: Who watches a play in an auditorium? \n (A)
building (B) crowd (C) city (D) group (E) high school
Knowledge: Audiences watch plays in auditoriums.
Prediction: (B)
Trivial
The knowledge is a trivial
paraphrase of the question
and the predicted answer.
Repeat
The knowledge is a mere
repetition of known informa-
tion given in the question.
Related
The knowledge is
topi-
cally related to the question
and/or the choices, but can-
not be part of a reasoning
chain to support or refute
any of the choices.
Question: An alpha particle, which is emitted during
alpha decay, consists of two protons and what else? \n
(A) two neutrons (B) two nuclei (C) two positrons (D)
two electrons
Knowledge: Alpha particles are composed of two pro-
tons and two neutrons.
Prediction: (A)
Question: The movement of crustal plates results from
circulating currents in material beneath the crust of Earth.
Which best describes the material which moves the
crustal plates? \n (A) hot water (B) molten rock (C)
liquid metal (D) solid iron
Knowledge: The movement of crustal plates is caused
by circulating currents in material beneath the crust of
Earth.
Prediction: (B)
Question: How are the particles in a block of iron af-
fected when the block is melted? \n (A) The particles
gain mass. (B) The particles contain less energy. (C) The
particles move more rapidly. (D) The particles increase
in volume.
Knowledge: Iron particles are affected by heat.
Prediction: (C)
Unrelated
The knowledge is unrelated
to the question.
–
Contradict
The knowledge can be part
of a reasoning chain that
refutes the predicted an-
swer, or supports a different
choice.
Question: I need what to calculate the length from my
big toe to my little toe? \n (A) Calculator (B) Tape
Measure (C) A Graph (D) A Microscope
Knowledge: A calculator is used to calculate lengths.
Prediction: (B)
Table 11: Instruction for the human evaluation.
Method
Citation
Unified model KG => KR KR => KG
Bosselut et al. (2021)
Rajani et al. (2019)
Latcinnik and Berant (2020)
Shwartz et al. (2020)
DynaGen
CAGE
ST-GS
Self-talk
Contrastive Expl. Paranjape et al. (2021)
GKP
DREAM
Rainier
ALEAP
PINTO
GenRead
DSP
CoT
Liu et al. (2022b)
Gu et al. (2022)
Liu et al. (2022a)
Wang et al. (2022b)
Wang et al. (2022a)
Yu et al. (2022)
Li et al. (2023b)
Wei et al. (2022)
CRYSTAL
ours
✓
✗
✗
✓/ ✗
✗
✓/ ✗
✗
✗
✗
✗
✓
✗
✓
✓
✗
✓
✓
✗
✓
✗
✗
✗
✓
✓
✗
✗
✗
✓
✗
✗
✓
✗
✗
✗
✗
✓
✓
✗
✗
✓
✗
✓
Table 12: Comparison of existing knowledge-augmented reasoning methods. Unified model: if the method employs
a unified model (rather than separate) for knowledge generation and knowledge-grounded reasoning. KG => KR:
if the knowledge-grounded reasoning is trained to adapt to knowledge generation. KR => KG: if the knowledge
generation is trained to adapt to knowledge-grounded reasoning.
|
|
http://arxiv.org/abs/2310.04919v1 | "2023-10-07T21:16:09" | "2023-10-07T21:16:09" | The Conditional Prediction Function: A Novel Technique to Control False
Discovery Rate for Complex Models | In modern scientific research, the objective is often to identify which
variables are associated with an outcome among a large class of potential
predictors. This goal can be achieved by selecting variables in a manner that
controls the the false discovery rate (FDR), the proportion of irrelevant
predictors among the selections. Knockoff filtering is a cutting-edge approach
to variable selection that provides FDR control. Existing knockoff statistics
frequently employ linear models to assess relationships between features and
the response, but the linearity assumption is often violated in real world
applications. This may result in poor power to detect truly prognostic
variables. We introduce a knockoff statistic based on the conditional
prediction function (CPF), which can pair with state-of-art machine learning
predictive models, such as deep neural networks. The CPF statistics can capture
the nonlinear relationships between predictors and outcomes while also
accounting for correlation between features. We illustrate the capability of
the CPF statistics to provide superior power over common knockoff statistics
with continuous, categorical, and survival outcomes using repeated simulations.
Knockoff filtering with the CPF statistics is demonstrated using (1) a
residential building dataset to select predictors for the actual sales prices
and (2) the TCGA dataset to select genes that are correlated with disease
staging in lung cancer patients. | [
"Yushu Shi",
"Michael Martens"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04919v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04919v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "stat.ME",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"stat.ME",
"cs.LG",
"stat.ML"
] | 3
2
0
2
t
c
O
7
]
E
M
.
t
a
t
s
[
1
v
9
1
9
4
0
.
0
1
3
2
:
v
i
X
r
a
The Conditional Prediction Function: A Novel Technique to
Control False Discovery Rate for Complex Models
Yushu Shi, Michael Martens
October 10, 2023
Abstract
In modern scientific research, the objective is often to identify which variables are associated with an
outcome among a large class of potential predictors. This goal can be achieved by selecting variables in a
manner that controls the the false discovery rate (FDR), the proportion of irrelevant predictors among the
selections. Knockoff filtering is a cutting-edge approach to variable selection that provides FDR control.
Existing knockoff statistics frequently employ linear models to assess relationships between features and
the response, but the linearity assumption is often violated in real world applications. This may result in
poor power to detect truly prognostic variables. We introduce a knockoff statistic based on the conditional
prediction function (CPF), which can pair with state-of-art machine learning predictive models, such as
deep neural networks. The CPF statistics can capture the nonlinear relationships between predictors and
outcomes while also accounting for correlation between features. We illustrate the capability of the CPF
statistics to provide superior power over common knockoff statistics with continuous, categorical, and
survival outcomes using repeated simulations. Knockoff filtering with the CPF statistics is demonstrated
using (1) a residential building dataset to select predictors for the actual sales prices and (2) the TCGA
dataset to select genes that are correlated with disease staging in lung cancer patients.
1 BACKGROUND
The frequency and sizes of high dimensional datasets have increased greatly in recent years, accompanied both
by new opportunities to find determinants of outcomes of interest and by formidable challenges to identify
truly prognostic variables among this myriad of candidates. Usually, many of them are not expected to affect
the outcome and so interest lies in choosing only the variables that are most likely to be associated with
the response. An appropriate way to formalize this objective is to focus on controlling the FDR (Benjamini
and Hochberg, 1995). Knockoff filtering (Barber and Cand`es, 2015) is a popular device for FDR controlled
variable selection, particularly since this control is guaranteed for finite sample sizes rather than appealing to
asymptotic properties for its validity, as other frequently used approaches do. The general problem involved
is to determine, within a vector X of p features, which ones are associated with the outcome Y of interest.
The commonly used Model-X knockoff approach (Cand`es et al., 2018) conducts this evaluation as follows:
• First, construct knockoff copies (cid:101)X satisfying the following two conditions:
1. Pairwise exchangeability: for any subset S ⊂ {1, . . . , p}, (X, (cid:101)X)swap(S)
d= (X, (cid:101)X), i.e. swapping any
subset of variables with their knockoffs leaves the joint distribution invariant;
2. Conditional independence: (cid:101)X ⊥⊥ Y |X.
• Second, a model is fitted using all original and knockoff features, and the influences of the original and
knockoff features are evaluated using importance statistics, such as the lasso (Tibshirani, 1996) penalty
parameter at which a feature enters the model. The knockoff statistic built on it is the lasso signed
max (LSM) statistic. Because the knockoff features are independent of the outcome, their importance
statistics represent noise variables that can be contrasted against the original features' to assess which
original features correlate with the response. From the importance statistics of the original feature and
its knockoff, Zj and (cid:101)Zj, j = 1, . . . , p, we can compute knockoff statistics Wj = fj(Zj, (cid:101)Zj), where fj is
an anti-symmetric function. A large positive Wj provides evidence that the distribution of Y depends on
Xj, whereas under the null Wj is equally likely to take on positive and negative values (the "coin-flip"
property).
• Third, features are selected based on the knockoff statistics in a manner that controls the FDR at the
specified level, q. Specifically, if we find a threshold τ > 0 by setting
(cid:26)
τ = min
t > 0 :
#{j : Wj ≤ −t}
#{j : Wj ≥ t}
(cid:27)
≤ q
.
Then the procedure selecting the set
ˆS = {j : Wj ≥ τ }
controls the modified FDR as
mF DR = E
(cid:34)
|{j ∈ ˆS ∩ H0}|
(| ˆS| + 1/q)
(cid:35)
≤ q.
A more conservative procedure, knockoffs+, with threshold
τ + = min
(cid:26)
t > 0 :
1 + #{j : Wj ≤ −t}
{#j : Wj ≥ t}
(cid:27)
≤ q
controls the ordinary FDR at level q by selecting
ˆS+ = {j : Wj ≥ τ +}.
Previous work has explored various ways to improve knockoff feature generation with a guarantee of pair-
wise exchangeability. Notably, Bates et al. (2021) introduced a Metropolized knockoff sampler, which handles
situations where the covariates are continuous, heavy-tailed, and follow an Ising model. Furthermore, other
methods took advantage of generative machine learning models, including Deep Knockoffs (Romano et al.,
2019), KnockoffGAN (Jordon et al., 2019), and variational autoencoder related methods (Liu and Zheng,
2019; Duarte and Feng, 2020). Compared with the abundance of choices for generating knockoff counter-
parts, few studies have attempted to improve knockoff statistics. Common choices of knockoff statistics are
based on a linear regression based model, such as lasso (Barber and Cand`es, 2015; Cand`es et al., 2018); a
common choice is the lasso coefficient difference (LCD) statistic, which is defined as
W LCD
j
= |βj| − | ̃βj|,
where βj and ̃βj are the regression coefficients for Xj and its knockoff ̃Xj. The lasso-based statistics can
yield good power if the true relationship is linear (Weinstein et al., 2017). But, if the linearity assumption
is violated, these approaches may have poor power to detect prognostic variables. This paper investigates
methods for constructing knockoff statistics that can yield higher power to resolve features with linear or
nonlinear relationships with the outcomes while maintaining the FDR control. We propose the conditional
prediction function (CPF) as a basis for building the knockoff importance statistic. The proposed CPF
knockoff statistic is able to capture nonlinear relationships, and will empower researchers to explore more
flexible prediction models for knockoff filtering, such as deep neural networks (DNNs).
In Section 2, we explain the rationale and summarize the algorithm for calculating CPF knockoff statistics.
The CPF statistic's ability to capture non-linear relationship for different types of outcomes is demonstrated
through repeated simulations in Section 3. Section 4 applies the proposed method to a residential building
dataset to select predictors for the actual sales prices and to the TCGA LUAD cancer dataset to identify
genes that are associated with or more advanced stage of lung cancer. Section 5 concludes the paper with a
short discussion.
2 THE CPF STATISTIC
In this section, we introduce the conditional prediction function (CPF), which can measure a feature's
importance by changing its value by a small magnitude while conditioning on all other covariates and
computing the prediction difference before and after the change. The concept of the CPF knockoff statistic
originates from multivariable linear models, where the regression coefficient signifies how much the mean
of the dependent variable changes given a one-unit shift in the independent variable while holding other
variables in the model constant. The CPF can be paired with many complicated predictive models, however.
In the following text, we assume that we have already generated high-quality knockoff features ̃X from p
original predictors X. Calculation of the CPF knockoff statistics proceeds per the following:
1. Combine both the original and the knockoff predictors X∗
[N ×2p] = [X, ̃X] in one matrix. Center and
scale continuous predictors.
2. Train the prediction model M for the outcome Y with both the original and knockoff features.
3. Set Ui = 0,
i = 1, . . . , 2p. Choose the number of percentiles at which we want to evaluate the CPF,
J , and the δ value for numerical calculation. Then,
for each predictor X ∗
i , i ← 1 to 2p do
Sample a subset with n observations.
for k ← 1 to n do
if X ∗
i is a continuous covariate then
for j ← 1 to J do
Denote the value of X ∗
values of all other predictors X∗
and X ∗
ij + δ/2.
(⋆) Ui = Ui + ∥M(X ∗
ij + δ/2|X∗
i at the 100j/(J + 1) percentile as X ∗
ij. Conditioning on the
k,−i, evaluate the predictive difference for X ∗
ij − δ/2
k,−i) − M(X ∗
ij − δ/2|X∗
k,−i))∥2
2/(δ2J)
end
end
else
(⋆) Ui = Ui + ||M(X ∗
ij = 1|X∗
k,−i) − M(X ∗
ij = 0|X∗
k,−i)||2
2
end
end
end
for each pair of the original predictor Xm and the corresponding knockoff ̃Xm, m ← 1 to p do
CP Fm = Um − Um+p
end
After computing knockoff statistics for each pair of the original and knockoff covariates, we implement
the last step of knockoff filtering. Given the pre-specified FDR level q, we find the threshold value T such
that
(cid:26)
T = min
t > 0 :
#{r : CP Fr ≤ −t}
#{r : CP Fr ≥ t}
(cid:27)
≤ q
,
and return the selected feature set ˆS = {r : CP Fr ≥ T }.
To illustrate the benefit of CPF, consider the univariate case where the predictor and the outcome have
a relationship y = x2. As shown in Figure 1, the predictor has a negative slope when less than 0, and a
positive slope when greater than 0. If one uses a linear model or a linear model based method (such as lasso,
elastic net), this variable will likely be declared null, as the positive effect when x > 0 and negative effect
when x < 0 cancel out. But if one employs CPF as knockoff importance statistics, this nonlinear relationship
will be well captured, since CPF measures the cumulative squared effect over the space of x.
When features are independent and the relationship to the outcome is genuinely linear, the CPF reduces
to n times the squared regression coefficient of a linear model. However, when the relationship is more
complicated, by evaluating the conditional prediction differences at J percentiles and averaging over n
possible combinations of other predictors, the CPF can overcome the rigidity of linear models.
When the outcome of interest is continuous, the predicted outcome M(*) is a real number. When the
outcome of interest is categorical, M(*) is a vector of probabilities belonging to each category, and the
increment in each iteration is the squared Euclidean distance of two probability vectors. When the outcome
Figure 1: CPF can quantify nonlinear covariate effect. Here the red curve is the true effect of the covariate.
If we fit a linear model, the slope of the line will be 0, as indicated by the blue line. The black lines indicate
the prediction difference that can be captured by CPF statistics.
of interest is a survival time in the single failure cause setting, the CPF can be calculated over all the distinct
time points in the dataset and M(*|t) is the predicted survival function indexed by time t. When multiple
failure types, i.e. competing risks, are present, M(*|t) is the predicted cumulative incidence function (CIF)
for the event type of interest. When the number of distinct event times Nt is large, we can select a subset of
nt time points (say, quintiles of the observed survival times), {tl; l = 1, . . . , nt}. For survival outcomes, the
⋆ step in the algorithm becomes
for l ← 1 to nt do
Ui = Ui + ||M(X ∗
ij + δ/2|tl, X∗
k,−i) − M(X ∗
ij − δ/2|tl, X∗
k,−i)||2
2/δ2J
end
if X∗i is continuous, and
for l ← 1 to nt do
Ui = Ui + ||M(X ∗
ij = 1|tl, X∗
k,−i) − M(X ∗
ij = 0|tl, X∗
k,−i)||2
2
end
otherwise.
The CPF resembles the squared gradient of a multivariate function. To approximate the gradient well, δ
needs to be small relative to the range of X. Large J, n and nt can yield a more accurate estimation of the
predictive ability of the features; yet, the choice of these parameters may be constrained by the computing
resources available.
3 SIMULATION STUDY
To illustrate the ability of the CPF statistics to detect both linear and nonlinear effects of predictors, we
evaluated their performance in conjunction with DNNs for various outcome types, including continuous,
categorical, survival, and competing risks data. In all simulated datasets, the number of original features
was set at 250, while the sample size was 20000. Among the 250 predictors, ten were genuinely predictive.
During the training of DNNs, early stopping callback was implemented to mitigate overfitting, with the
patience parameter set at 50 for continuous, categorical, and survival outcomes and at 200 for competing
−2−10120123456PredictorOutcomeReal relationshipCPFLinear modelLinear Relationship
Nonlinear Relationship
Log-linear Hazard Relationship
Non Log-linear Hazard Relationship
s
u
o
u
n
i
t
n
o
C
y
r
a
n
i
B
l
a
v
i
v
r
u
S
s
k
s
i
r
g
n
i
t
e
p
m
o
C
Figure 2: Comparison of the FDR and power for CPF and LCD statistics. LCD and CPF denote standard
knockoff filtering using the LCD and CPF statistics; LCD+ and CPF+ denote knockoff+ filtering for these
techniques. The left columns show the results when the relationship between covariates and the outcome is
linear/log-linear, while the right two columns show the results when the relationship is not.
risks data. For continuous and categorical outcomes, a batch size of 20 was employed, and the validation
proportion in each epoch was designated at 10%. For survival and competing risks outcomes, a batch size of
50 was used, and the validation proportion in each epoch was set at 20%. The parameters J = 5, n = 100,
and δ = 0.1 were specified for the calculation of the CPF statistics from fitted DNNs.
0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)LCDLCD+CPFCPF+0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0FDR LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)0.00.20.40.60.81.0Power LCDLCD+CPFCPF+LCD AR(0.2)LCD+ AR(0.2)CPF AR(0.2)CPF+ AR(0.2)The LCD statistics were selected as the benchmark for comparison, as it has demonstrated higher power
than the LSM statistics in most instances (Cand`es et al., 2018). For both continuous and categorical
outcomes, the LCD statistics were derived from lasso results; for survival outcomes, they were based on Cox
lasso results, and for competing risks outcomes, they were obtained from the Fine-Gray regression model
(Fine and Gray, 1999).
The target false discovery rate was set to be 0.2. Original features were generated using either a standard
normal distribution or an autoregressive model with a mean of 0 and a covariance matrix with 0.2|i−j| entries,
where i and j denote column and row indicators, respectively. The covariance matrix of the autoregressive
model contains 1 along the diagonal, with entry values diminishing to zero as they move further from
this diagonal. The second-order approximate Gaussian knockoffs, provided by the R package "knockoff"
(Patterson and Sesia, 2020), were employed as the knockoff generator. Each simulation configuration was
repeated 200 times, and the results were summarized using box plots. Subsequent subsections will present
the simulation setup for each type of outcome.
3.1 Continuous Outcome
i + 100 + εi, i = 1, 2, . . . , n, where X∗
For continuous outcomes, the true distribution of the response variable was assumed to follow a linear model
with predictors that are either linear or quadratic functions of X. In the linear setting, the predictors and
the outcome are related as follows: yi = βT X∗
i represents the vector
that includes only true predictors, and β is a vector with all entries equal to 3. In the nonlinear setting, the
relationship between each predictor and the outcome is quadratic, given by: yi = (cid:80)10
ij , i = 1, 2, . . . , n.
In the linear setting, a three-layer DNN was employed, where the internal layer consisted of 8 nodes. For
the nonlinear setting, a five-layer DNN was used, with the numbers of nodes in internal layers specified as
(64, 32, 16). The activation function for both models was chosen to be the Rectified Linear Unit (ReLU),
and for each layer, an L1 regularization term was imposed with a parameter value of 0.001. The optimizer
was configured to be Adam, with a learning rate set at 0.01, and the loss function was defined as the mean
squared error in the validation data.
j=1 X∗2
3.2 Categorical Outcome
The data simulation for categorical outcome is similar to the simulation for continuous outcomes. In the
linear relationship setting, the predictors and the expected value of the outcome follow a linear relationship
on the logit-transformed scale according to yi ∼ binom(logistic(βT X∗
is the vector
including only true predictors and β is a vector of 1′s. In the nonlinear setting, we first computed the
sum of squares of the true predictors Zi = (cid:80)10
ij , then standardized Zi and generated the outcome
yi ∼ binom(Zi).
i )), i = 1, 2, . . . , n. X∗
i
j=1 X∗2
To decrease the training time, we started with the model trained for continuous outcomes and sim-
ply changed the last layer to a sigmoid activation function. The loss function was chosen to be binary-
crossentropy in the validation data. The learning optimizer was chosen to be Adam, and the learning rate
was 0.01.
3.3 Survival Outcome
We also applied our method on data with survival outcomes. We used DeepSurv model (Katzman et al.,
2018), which adopts the framework of the Cox proportional hazards model, for computing the predicted
survival based CPF. In the DeepSurv model, the hazard ratio of an individual is parameterized by the
weights of the network, and the optimization goal is to maximize the log partial likelihood with some
regularization. Again, we use X ∗
j = 1, . . . , 10, to denote the jth true predictor and specify that the
j ,
hazard for each individual follows hi(t|X) = exp((cid:80)10
i = 1, . . . , n. This satisfies the underlying
assumption for the Cox model as the covariate imposes a time-invariant multiplicative effect on the hazard.
We refer to the scenario in which the covariate affects the hazard through a log-linear relationship as the
log-linear setting. The censoring times were generated independently from an exp(0.05) distribution and
this resulted in a 5% censoring rate. In simulation scenarios where the covariate effects are not log-linear,
the hazard for the ith individual was hi(t|X) = exp((cid:80)10
ij ), and the censoring times were generated
independently from an exp(0.1) distribution.
j=1 0.5X ∗2
j=1 0.5X ∗
ij),
For the scenarios under the log-linear setting, the numbers of nodes were set to be (64, 32, 16, 8, 1), for the
non log-linear scenarios, the numbers of nodes were (128, 64, 32, 16, 1). Batch normalization and a dropout
rate 0.5 were employed. We used Adam optimizer with learning rate 0.0001 and the weight decay was set
to be 0.01.
3.4 Competing Risks Outcome
To further assess the capabilities of the CPF statistics, we explored the application with competing risks
data. In competing risks data, there are several types of potential events and the occurrence of one type of
outcome prevents us from observing other types of events. Suppose that type 1 events are the main interest.
Fine and Gray (1999) mimicked the Cox proportional hazards model by transforming the CIF F1(t) for type
1 into a subdistribution hazard η1(t),
η1(t) = −
∂
∂t
log(1 − F1(t)),
(1)
and assumed the covariates have multiplicative, time-constant effects on the subdistribution hazard through
the form
η1(t|x) = η01(t) exp (f (X)) .
(2)
Recently, Lee et al. (2018) leveraged DNN for modeling competing risks data and proposed the DeepHit
model, which was employed in computing the predicted CIF used in CPF statistics in our simulation.
Our simulations assumed that 2 event types exist and that type 1 is the primary interest. In both log-linear
and non log-linear hazards scenarios, we assumed the baseline probability of experiencing event type 1 was
q = 0.5. The influence of covariates on outcomes was encapsulated by the variable Z = f (X). Specifically, in
the log-linear scenario, Zi = (cid:80)10
ij − 10.
For both scenarios, Zi is connected to the subdistribution hazard function through equation 2. By virtue of
(1)-(2), the relationship between the baseline and individual CIFs is
i = 1, . . . , n. For the non log-linear scenario, Zi = (cid:80)10
j=1 X ∗
ij,
j=1 X ∗2
F1(t|Xi) = 1 − (1 − F01(t))exp(Zi).
(3)
Generating event times involved a two-step process: first, we generated probabilities of experiencing
a type 1 event for each subject by randomly sampling from a binomial distribution with a probability of
F1(∞|Xi) = 1 − (1 − q)exp(Zi); subsequently, for those subjects experiencing type 1 events, we modeled the
baseline CIF for event type 1 as F01(t) = q(1 − exp(−t)) and generated their event time from the cumulative
distribution function F1(t|Xi)/F1(∞|Xi), where the numerator follows (3). For type 2 events, we generated
event times from an exponential distribution with a rate parameter of 1. Censoring times were independently
generated from an exp(1) distribution.
Within the architecture of the DeepHit, for both the log-linear and non lig-linear scenarios, the number
of internal nodes was configured as (128, 64, 32, 16). To enhance training performance, we applied batch
normalization and utilized a dropout rate of 0.5. In fitting the DeepHit model, the number of cutpoints for
evaluating the likelihood was set to be 20. To mitigate overfitting, an L2 penalty with a parameter of 0.1
was incorporated.
3.5 Summary of Simulation Results
As shown in Figure 2, the simulation results are consistent across different outcome types. When the linear
assumption or the log-linear assumption is satisfied, the performance of the CPF is similar to the performance
of the linear model-based LCD. However, when this assumption does not hold, for example, the relationship
between the predictors and outcome is quadratic, the LCD fails to capture the true relationship and exhibits
significant power loss, while the CPF controls the FDR while offering high power to detect signals.
Table 1: Genes identified by the CPF method. Genes that corroborate with the selection from LCD statistics
results are shown in bold.
RELEVANT LITERATURE
Puzone et al. (2013); Liu et al. (2017)
GENE
GAPDH
RPLP0P6 Xie et al. (2023); Wang et al. (2018)
RNASE1
SFTPC
IGKV4-1
IGHJ3
Travaglini et al. (2020); Li et al. (2019b); Mironova and Vlassov (2019)
Li et al. (2007); Wang et al. (2009); Li et al. (2019a)
Wang et al. (2020); Qin et al. (2020); Xia et al. (2022); Pedersen et al. (2022)
Isaeva et al. (2019); Feng et al. (2009); Jiang et al. (2022)
4 REAL DATA APPLICATION
4.1
Identifying predictors of real estate sale price
We analyzed a dataset (Rafiei and Adeli, 2018) consisting of 108 covariates, aiming to identify predictors
of the sale prices of single-family residential apartments in Tehran, Iran. The dataset encompasses various
factors, including temporal economic covariates as well as diverse project-related physical and financial
attributes. Furthermore, the dataset includes economic indicators and indices across five periods prior to
the start of construction, such as stock market index and city population.
We divided the 372 observations into training (70%) and testing (30%) sets. We first fit the lasso model
with cross-validation, yielding a mean squared error of 27767.39 on the testing dataset. Then, we employed
the LCD knockoff statistics with a target false discovery rate of 0.2. The knockoff+ method led to no feature
selection, while the standard knockoff procedure resulted in the selection of a single feature: the unit price
at project initiation.
To compute CPF knockoff statistics, we started by constructing a DNN with four layers. The internal
layers contained 256 and 128 nodes respectively, utilizing the leakyReLU activation function with an alpha
parameter of 0.3. The final layer adopted the ReLU activation function. Across all layers, batch normalization
was implemented. We opted for the Adam optimizer with a learning rate of 0.01 and chose batch size
to be 50. To prevent overfitting, early stopping with a patience parameter of 200 was employed. The
DNN can achieve a mean squared error of 20787.06 on the test dataset, which outperforms lasso in model
fitting. When adopting the more conservative knockoff+ approach, similar to the result from LCD statistics,
no features were selected. Meanwhile, with the standard knockoff method, three features were chosen:
equivalent preliminary estimated construction cost based on prices at the project's outset, unit price at
project initiation, and actual construction expenses.
4.2 Determinants of lung adenocarcinoma stage from TCGA dataset
We applied CPF statistics on lung adenocarcinoma gene expression data from The Cancer Genome Atlas
(TCGA). Our primary focus was on determining genes that express differently for stage I and stages II/III/IV
cancer. In this dataset, there were 330 patients with stage I cancer and 271 patients with stages II/III/IV
cancer. From the original 31,294 features, considering the constrained sample size, we selected 100 features
with the highest variance. The target FDR here is 0.2. Before fitting the model, the predictors were
standardized. We allocated 70% of the data for training and utilized the remainder for testing the model.
Given the limited sample size, we employed a three layer neural network, with an internal layer with 100
nodes. The activation functions were chosen to be ReLU and sigmoid. Training DNN involved using dropout
(dropout rate = 0.2) and L1 regularization with penalty parameter of 0.1 for kernel and 0.01 for bias in the
last layer. The batch size was chosen to be 100. The Adam optimizer with a learning rate of 0.001 was used,
and early stopping call with patience parameter 200 was employed to prevent overfitting.
Using cross-validation, the lasso model yielded a c-index of 0.60088 for the test data, while the DNN
achieved a c-index of 0.6774, demonstrating a superior model fitting than the lasso model. The knockoff+
method did not select any features for either LCD or CPF knockoff statistics. However, with the regular
knockoff method, 6 features were chosen using the CPF approach, and LCD selection corroborated two of
these (LCD with lasso chose 3 features in total). Table 1 lists all the genes selected by CPF and recent
biomedical publications that have identified the correlations between the same gene and lung cancer.
In both examples, the CPF statistics selected more features than LCD statistics. This behavior can
be explained by its capacity in capturing nonlinear relationship between covariates and outcomes. The real
data application is consistent with simulation study outcomes, demonstrating that CPF statistics have better
power than a widely used existing method.
5 DISCUSSION
Applying the CPF statistics successfully relies on pairing them with a well-selected and trained machine
learning model. This paper is not aimed at providing a one-size-fits-all solution for variable selection and
the flexibility of the CPF does not eliminate the need for tuning complicated machine learning models, in
particular DNNs. We encourage users to first check the model fitting metrics of the trained model, including
mean squared error, prediction accuracy, and concordance index and comparing them to the performance
of traditional methods, such as linear model, lasso, and the Cox model. After verifying that the machine
learning model attains better model fitting, then CPF can be used with it to identify key features that are
predictive of the outcomes.
Complex machine learning models such as DNNs have long been perceived as "black boxes," such that
the relationships between features and response variables are hard to discern from the fitted model and which
variables are truly associated with the outcome is unclear. The CPF knockoff statistic offers improved model
interpretability by capturing the nonlinear relationships between the covariates and outcomes and enabling
these correlations to be identified through knockoff filtering. When applied in biomedical studies, CPF
statistics offer an improved resolution of prognostic features for health outcomes. This improvement in feature
identification will promote the understanding of the determinants of patient health and, subsequently, can
lead to advances in the prevention, treatment, and management of disease, thereby improving public health.
Also, The proposed technique will be helpful more broadly in other scientific contexts such as information
technology (IT), engineering, sociology, economics, psychology, and environmental science, where a large set
of candidate variables are being evaluated for association with an outcome of interest.
ACKNOWLEDGMENT
This project is partly supported by NSF DMS 2310955. We would like to thank Dr. Hao Feng of Case
Western Reserve University for his help in TCGA data application.
References
Barber, R. F. and Cand`es, E. J. (2015). Controlling the false discovery rate via knockoffs. The Annals of
Statistics, 43(5):2055–2085.
Bates, S., Cand`es, E., Janson, L., and Wang, W. (2021). Metropolized knockoff sampling. Journal of the
American Statistical Association, 116(535):1413–1427.
Benjamini, Y. and Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful
approach to multiple testing. Journal of the Royal Statistical Society. Series B, 57(1):289–300.
Cand`es, E. J., Fan, Y., Janson, L., and Lv, J. (2018). Panning for gold:
'Model-X' knockoffs for high
dimensional controlled variable selection. Journal of the Royal Statistical Society: Series B, 80(3):551–
577.
Duarte, M. F. and Feng, S. (2020). Knockoff-inspired feature selection via generative models. preprint.
Feng, Y., Xiao, X., Zhu, Z., Streaker, E., Ho, M., Pastan, I., and Dimitrov, D. S. (2009). A novel hu-
man monoclonal antibody that binds with high affinity to mesothelin-expressing cells and kills them by
antibody-dependent cell-mediated cytotoxicity. Molecular Cancer Therapeutics, 8(5):1113–1118.
Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing
risk. Journal of the American Statistical Association, 94(446):496–509.
Isaeva, O. I., Sharonov, G. V., Serebrovskaya, E. O., Turchaninova, M. A., Zaretsky, A. R., Shugay, M., and
Chudakov, D. M. (2019). Intratumoral immunoglobulin isotypes predict survival in lung adenocarcinoma
subtypes. Journal for ImmunoTherapy of Cancer, 7(1).
Jiang, W., Zhou, S., Li, J., Zhu, G., Gao, M., Zhao, K., Zhang, L., Xie, X., Zhao, N., Tian, C., Zhang, Z.,
Zhao, Y., Guo, Y., Cui, Y., and Liu, P. (2022). B cell receptor (BCR) diversity and differential cdr3s
usage as potential immune indictors of diffuse large B cell lymphoma (DLBCL). preprint.
Jordon, J., Yoon, J., and van der Schaar, M. (2019). KnockoffGAN: Generating knockoffs for feature selection
using generative adversarial networks. In International Conference on Learning Representations.
Katzman, J. L., Shaham, U., Cloninger, A., Bates, J., Jiang, T., and Kluger, Y. (2018). DeepSurv: per-
sonalized treatment recommender system using a Cox proportional hazards deep neural network. BMC
Medical Research Methodology, 18(1):24.
Lee, C., Zame, W., Yoon, J., and van der Schaar, M. (2018). DeepHit: A deep learning approach to survival
analysis with competing risks. Proceedings of the AAAI Conference on Artificial Intelligence, 32(1).
Li, B., Meng, Y.-Q., Li, Z., Yin, C., Lin, J.-P., Zhu, D.-J., and Zhang, S.-B. (2019a). MiR-629-3p-induced
downregulation of SFTPC promotes cell proliferation and predicts poor survival in lung adenocarcinoma.
Artificial Cells, Nanomedicine, and Biotechnology, 47(1):3286–3296. PMID: 31379200.
Li, R., Todd, N. W., Qiu, Q., Fan, T., Zhao, R. Y., Rodgers, W. H., Fang, H.-B., Katz, R. L., Stass, S. A.,
and Jiang, F. (2007). Genetic deletions in sputum as diagnostic markers for early detection of stage I
non–small cell lung cancer. Clinical Cancer Research, 13(2):482–487.
Li, Y., Yang, Y., Gan, T., Zhou, J., Hu, F., Hao, N., Yuan, B., Chen, Y., and Zhang, M. (2019b). Ex-
tracellular rnas from lung cancer cells activate epithelial cells and induce neutrophil extracellular traps.
International Journal of Oncology, 55(1):69–80.
Liu, K., Tang, Z., Huang, A., Chen, P., Liu, P., Yang, J., Lu, W., Liao, J., Sun, Y., Wen, S., Hu, Y., and
Huang, P. (2017). Glyceraldehyde-3-phosphate dehydrogenase promotes cancer growth and metastasis
through upregulation of snail expression. International Journal of Oncology, 50(1):252–262.
Liu, Y. and Zheng, C. (2019). Deep latent variable models for generating knockoffs. Stat, 8(1):e260. e260
sta4.260.
Mironova, N. and Vlassov, V. (2019). Surveillance of tumour development: The relationship between tumour-
associated RNAs and ribonucleases. Frontiers in Pharmacology, 10.
Patterson, E. and Sesia, M. (2020). knockoff: The Knockoff Filter for Controlled Variable Selection. R
package version 0.3.3.
Pedersen, S., Jensen, K. P., Honor ́e, B., Kristensen, S. R., Pedersen, C. H., Szejniuk, W. M., Maltesen, R. G.,
and Falkmer, U. (2022). Circulating microvesicles and exosomes in small cell lung cancer by quantitative
proteomics. Clinical Proteomics, 19(1):2.
Puzone, R., Savarino, G., Salvi, S., Dal Bello, M. G., Barletta, G., Genova, C., Rijavec, E., Sini, C.,
Esposito, A. I., Ratto, G. B., Truini, M., Grossi, F., and Pfeffer, U. (2013). Glyceraldehyde-3-phosphate
dehydrogenase gene over expression correlates with poor prognosis in non small cell lung cancer patients.
Molecular Cancer, 12(1):97.
Qin, F.-l., Xu, Z.-y., Yuan, L.-q., Chen, W.-j., Wei, J.-b., Sun, Y., and Li, S.-k. (2020). Novel immune
subtypes of lung adenocarcinoma identified through bioinformatic analysis. FEBS Open Bio, 10(9):1921–
1933.
Rafiei, M. H. and Adeli, H. (2018). Novel machine-learning model for estimating construction costs
considering economic variables and indexes. Journal of Construction Engineering and Management,
144(12):04018106.
Romano, Y., Sesia, M., and Cand`es, E. (2019). Deep knockoffs. Journal of the American Statistical Associ-
ation, pages 1–12.
Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical
Society: Series B, 58(1):267–288.
Travaglini, K. J., Nabhan, A. N., Penland, L., Sinha, R., Gillich, A., Sit, R. V., Chang, S., Conley, S. D.,
Mori, Y., Seita, J., Berry, G. J., Shrager, J. B., Metzger, R. J., Kuo, C. S., Neff, N., Weissman, I. L.,
Quake, S. R., and Krasnow, M. A. (2020). A molecular cell atlas of the human lung from single-cell RNA
sequencing. Nature, 587(7835):619–625.
Wang, H., Wang, M.-S., Wang, Y., Huang, Y.-Q., Shi, J.-P., Ding, Z.-L., and Wang, W.-J. (2020). Prognostic
value of immune related genes in lung adenocarcinoma. Oncology Letters, 20(5):259.
Wang, Y., Kuan, P. J., Xing, C., Cronkhite, J. T., Torres, F., Rosenblatt, R. L., DiMaio, J. M., Kinch,
L. N., Grishin, N. V., and Garcia, C. K. (2009). Genetic defects in surfactant protein a2 are associated
with pulmonary fibrosis and lung cancer. The American Journal of Human Genetics, 84(1):52–59.
Wang, Y., Qian, W., and Yuan, B. (2018). A graphical model of smoking-induced global instability in lung
cancer. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 15(1):1–14.
Weinstein, A., Barber, R., and Cand`es, E. J. (2017). A power and prediction analysis for knockoffs with
lasso statistics. preprint arXiv:1712.06465.
Xia, M., Wu, L., Sun, X., Han, X., Yan, H., Huang, J., Zhang, Y., Hu, Z., Zu, Y., Yin, C. C., and Qiu, X.
(2022). Next-generation sequencing revealed a distinct immunoglobulin repertoire with specific mutation
hotspots in acute myeloid leukemia. Biology, 11(2).
Xie, J., Lin, Y., Li, Y., Fang, A., Li, X., Wang, S., and Li, W. (2023).
lncrna trhde-as1 correlated with
genomic landscape and clinical outcome in glioma. Genes, 14(5).
|
|
http://arxiv.org/abs/2310.04916v1 | "2023-10-07T21:07:45" | "2023-10-07T21:07:45" | Tight Certified Robustness via Min-Max Representations of ReLU Neural
Networks | The reliable deployment of neural networks in control systems requires
rigorous robustness guarantees. In this paper, we obtain tight robustness
certificates over convex attack sets for min-max representations of ReLU neural
networks by developing a convex reformulation of the nonconvex certification
problem. This is done by "lifting" the problem to an infinite-dimensional
optimization over probability measures, leveraging recent results in
distributionally robust optimization to solve for an optimal discrete
distribution, and proving that solutions of the original nonconvex problem are
generated by the discrete distribution under mild boundedness, nonredundancy,
and Slater conditions. As a consequence, optimal (worst-case) attacks against
the model may be solved for exactly. This contrasts prior state-of-the-art that
either requires expensive branch-and-bound schemes or loose relaxation
techniques. Experiments on robust control and MNIST image classification
examples highlight the benefits of our approach. | [
"Brendon G. Anderson",
"Samuel Pfrommer",
"Somayeh Sojoudi"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04916v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04916v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "math.OC",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"math.OC",
"cs.LG"
] | Tight Certified Robustness via Min-Max Representations
of ReLU Neural Networks
Brendon G. Anderson
Samuel Pfrommer
Somayeh Sojoudi
3
2
0
2
t
c
O
7
]
C
O
.
h
t
a
m
[
1
v
6
1
9
4
0
.
0
1
3
2
:
v
i
X
r
a
Abstract- The reliable deployment of neural networks in
control systems requires rigorous robustness guarantees. In
this paper, we obtain tight robustness certificates over convex
attack sets for min-max representations of ReLU neural net-
works by developing a convex reformulation of the nonconvex
certification problem. This is done by "lifting" the problem to
an infinite-dimensional optimization over probability measures,
leveraging recent results in distributionally robust optimization
to solve for an optimal discrete distribution, and proving that
solutions of the original nonconvex problem are generated by
the discrete distribution under mild boundedness, nonredun-
dancy, and Slater conditions. As a consequence, optimal (worst-
case) attacks against the model may be solved for exactly. This
contrasts prior state-of-the-art that either requires expensive
branch-and-bound schemes or loose relaxation techniques.
Experiments on robust control and MNIST image classification
examples highlight the benefits of our approach.
I. INTRODUCTION
Neural networks are rapidly being deployed in control
systems as a means to efficiently model nonlinear systems
[1], controllers [2], and reinforcement learning policies [3].
However, the performance of neural networks can be ex-
tremely sensitive to small fluctuations in their input data
[4]. For example, [5], [6] show that image classification
models can be fooled into misclassifying vehicle traffic signs
when subject to digital or physical adversarial attacks, i.e.,
human-imperceptible data perturbations designed to cause
failure. This unreliable behavior is directly at odds with
the robustness guarantees required in safety-critical control
settings such as autonomous driving [7].
In light of these sensitivities, much effort has been placed
on developing methods to rigorously certify the robustness
of neural networks, with a large emphasis on models using
the popular ReLU activation function. However, certifying a
neural network's robustness generally amounts to solving an
intractable nonconvex optimization problem [8]. Three major
lines of work have focused on overcoming this intractability:
convex relaxations, Lipschitz bounding, and branch-and-
bound methods (all discussed further in Section I-A).
In this paper, we utilize an alternative representation of
ReLU neural networks as a means to efficiently compute
tight robustness certificates using convex optimization (and
hence in polynomial time). As a consequence, we are able
to exactly compute optimal (worst-case) attacks, which is
generally not possible using the popular local search-based
attack methods such as projected gradient descent [9] and
the Carlini-Wagner attack [10].
The authors are with the University of California, Berkeley. Emails:
{bganderson,sam.pfrommer,sojoudi}@berkeley.edu.
This work was supported by grants from ONR and NSF.
A. Related Works
1) Robustness Certification: Certifying the robustness of
a model amounts to solving the nonconvex optimization
inf x∈X g(x), where X is a set of possible inputs or attacks
(i.e., the "threat model"), and g(x) is either the model output
at an input x, or some linear transformation of the model
output (e.g., a classifier's margin between two classes).
Convex relaxations work by optimizing over a convex
outer-approximation of the set g(X) of possible outputs.
Popular relaxations involve linear bounding and program-
ming [11], [12], and semidefinite programming [13], [14],
which constitutes a line of increasingly accurate yet com-
putationally complex relaxations. Convex relaxation-based
certificates remain loose in general, and their looseness has
been shown to increase with model size [15].
The Lipschitz constant of a model provides a certified
bound on how much the model output may change given
some change in its input. Thus, bounds on the Lipschitz
constant can yield efficient robustness certificates [16]. A
number of works are devoted to computing Lipschitz bounds,
but it has proven difficult to obtain tight enough bounds to
grant meaningful certificates [16], [17], [18], [19].
Mixed-integer programming and branch-and-bound have
also been applied to robustness certification for ReLU neural
networks [20], [21], [22]. In contrast to convex relaxations
and Lipschitz bounding, these methods are capable of ob-
taining tight certificates if they are run to convergence, but
this incurs exponential computational complexity, preventing
them from scaling to practically-sized models [22]. Some
methods allow for early termination of their optimizations to
yield more efficient, yet loose certificates [22].
2) Representations of ReLU Neural Networks: ReLU
neural networks are defined by compositions g = AL ◦
σ ◦ * * * ◦ σ ◦ A1 with affine functions Al and elementwise
activation functions σ = ReLU : x (cid:55)→ max{0, x}. The most
prevalent alternative representation of such a model is as a
piecewise linear function, i.e., a finite polyhedral partition of
Rd with associated affine functions that agree with g on each
polyhedron [23], [24]. Another representation is as a rational
function when working with tropical algebra, where addition
⊕ and multiplication ⊗ are defined by x ⊕ y = max{x, y}
and x ⊕ y = x + y [25]. Finally, min-max representations-
discussed in Section II-have recently been introduced,
where g is expressed as the pointwise minimum of pointwise
maxima of affine functions. These works restrict their focus
to showcasing the impressive approximation capabilities of
ReLU models and their alternative representations.
B. Contributions
1) We show that ReLU neural networks admit min-max
representations and hence such representations are
universal function approximators.
2) By lifting the certification to an infinite-dimensional
problem over probability measures, we prove that,
under mild boundedness, nonredundancy, and Slater
conditions, exact solutions to the original nonconvex
problem are efficiently obtained for min-max represen-
tations via reduction to a tractable finite-dimensional
convex optimization problem.
3) Experiments on robust control and MNIST image
classification examples demonstrate the effectiveness
of our approach.
To the best of our knowledge, our work is the first to
grant tight robustness certificates in polynomial time amongst
those considering general ReLU neural networks and their
alternative representations.1
C. Organization
In Section II, we introduce and analyze the min-max rep-
resentation of ReLU neural networks. We develop our tight
robustness certificates in Section III. Experiments illustrating
the effectiveness of our approach are given in Section IV, and
concluding remarks are made in Section V.
D. Notations
The sets of natural, real, nonnegative real, and extended
real numbers are denoted by N, R, R+, and R = R ∪
{−∞, ∞} respectively. Throughout, we let I, J , K ⊆ N
denote index sets {1, . . . , m}, {1, . . . , n}, and {1, . . . , p},
respectively. The cardinality, convex hull, conic hull, and
relative interior of a subset X of Rd are denoted by |X|,
conv(X), cone(X), and ri(X), respectively. Furthermore,
we define B(X) to be the Borel σ-algebra on X. We denote
the set of probability measures on the measurable space
(X, B(X)) by P(X). For x ∈ Rd,
the Dirac measure
centered at x is denoted by δx, which we recall
is the
probability measure defined by δx(A) = 0 if x /∈ A
and δx(A) = 1 if x ∈ A for all A ∈ B(X). The set
of all Dirac measures with center in X is defined to be
D(X) = {μ ∈ P(X) : μ = δx for some x ∈ X}. The
set of continuous functions from Rd into R is denoted by
C(Rd, R). The effective domain of a function f : Rd → R
is defined to be the set dom(f ) = {x ∈ Rd : f (x) < ∞}.
If f is Borel measurable and μ is a probability measure
on (X, B(X)), then we denote the expected value of f
with respect to μ by Ex∼μf (x) = (cid:82)
X f (x)dμ(x). If f is
convex, the subdifferential of f at x is denoted by ∂f (x).
Throughout, we let ∥ * ∥ denote an arbitrary norm on Rd, and
we denote its dual norm by ∥ * ∥∗.
1See [26] for a polynomial time solution to the special case of 2-layer
ReLU models.
II. MIN-MAX AFFINE FUNCTIONS
In this section, we formally define min-max affine func-
tions, discuss works related to these functions, and show that
every ReLU neural network admits such a representation.
Definition 1. A function g : Rd → R is a min-max affine
function if there exist I, J1, . . . , J|I| ⊆ N and associated
aij ∈ Rd, bij ∈ R such that g(x) = mini∈I maxj∈Ji(a⊤
ijx+
bij) for all x ∈ Rd. In this case,
the function x (cid:55)→
mini∈I maxj∈Ji(a⊤
ijx + bij) is called the min-max repre-
sentation of g.
The class of all min-max affine functions on Rd is denoted
by G. Notice that g ∈ G is the pointwise minimum of m =
|I| convex functions gi : x (cid:55)→ maxj∈Ji(a⊤
ijx + bij), and is
therefore nonconvex in general. Without loss of generality,
we henceforth assume that, for every g ∈ G, there exists some
J ⊆ N with n = |J | such that the min-max representation
of g satisfies Ji = J for all i ∈ I.2
Related Works on Min-Max Affine Functions. In the
mathematics literature, min-max affine functions are also
termed lattice polynomials [28]. The work [29] shows that
piecewise linear activation functions can be written in min-
max affine form, and that neural networks learned with such
representations perform highly in image classification tasks.
The works [30], [31] study the theoretical and algorithmic
aspects of training min-max affine functions to separate
data, and show that separating {x1, . . . , xp} ⊆ Rd from
{y1, . . . , yq} ⊆ Rd requires no more that pq affine com-
ponents. The authors of [32] use min-max representations
of neural networks to characterize the training optimization
landscape. The conversion of ReLU neural networks into
min-max affine form is characterized in [33, Theorem 4.15].
An algorithm for nonlinear system identification using min-
max affine functions is developed in [34]. Finally, min-
max affine functions have been used as consistent statistical
estimators, termed "Riesz estimators," in the mathematical
economics literature [35]. To the best of our knowledge,
our work is the first to exploit min-max representations for
purposes of robustness certification.
We now proceed with analyzing the representation power
min-max affine functions. Let F be the class of all ReLU
neural networks on Rd. The following theorem shows that
every ReLU neural network can be represented as a min-max
affine function, and therefore min-max affine functions are
universal function approximators.
Theorem 1. For every f ∈ F, there exist I, J ⊆ N and
(aij, bij) ∈ Rd × R for i ∈ I, j ∈ J such that
f (x) = min
i∈I
max
j∈J
(a⊤
ijx + bij) for all x ∈ Rd.
(1)
2This is without
loss of generality, since the value g(x) does not
change upon appending affine global underestimators of the convex function
gi : x (cid:55)→ maxj∈Ji (a⊤
ij x + bij ) to the set of affine components x (cid:55)→
a⊤
ij x + bij of g. In other words, mini∈I maxj∈Ji (a⊤
ij x + bij ) =
mini∈I maxj∈J (a⊤
ij x + bij ) if one defines J = {1, . . . , n} with
n = maxi∈I |Ji| and aij = vi, bij = gi(0) for j ∈ J \ Ji, for
all i ∈ I, where vi ∈ Rd is a subgradient of gi at 0 (which exists by [27,
Theorem 23.4]).
Hence, the class G of min-max affine functions is dense in
C(Rd, R) with respect to the topology of uniform conver-
gence on compact sets.
Proof. Every f ∈ F is piecewise affine, i.e., there is a
finite collection Q of closed subsets of Rd such that Rd =
(cid:83)
Q∈Q Q and f is affine on every Q ∈ Q. Hence, by [36,
Theorem 4.1], there exist I, J ⊆ N and (aij, bij) ∈ Rd × R
for i ∈ I, j ∈ J such that (1) holds. Thus, since F ⊆ G
and F is dense in C(Rd, R) with respect to the topology of
uniform convergence on compact sets [37, Theorem 3.1], it
holds that G is dense in C(Rd, R) in the same sense.
III. THEORETICAL ROBUSTNESS CERTIFICATES
In this section, we develop our theoretical robustness
certificates. Consider a model g : Rd → R, which may, for
example, represent the output of a scalar-valued controller
or the confidence of a binary classifier f : Rd → {1, 2}
defined by f (x) = 1 if g(x) ≥ 0 and f (x) = 2 if
g(x) < 0. We consider the asymmetric robustness setting
introduced in [38], where nonnegative outputs g(x) ≥ 0
are "sensitive" and we seek to certify that no input within
some convex uncertainty set X ⊆ Rd causes the output
to leave the sensitive operating regime. This asymmetric
setting accurately models realistic adversarial situations. For
example, an adversary may seek some imperceptible attack
x ∈ X = {x′ ∈ Rd : ∥x′ − x∥ ≤ ε} to cause a vehicle's
image classifier to predict "no pedestrian" (g(x) < 0) when
the nominal image x has a pedestrian in view (the sensitive
regime; g(x) ≥ 0), but not the other way around. We leave
as future work the extension to vector-valued models.
Formally, the certification problem we seek to solve in this
work is written
p⋆ := inf
x∈X
The model g is robust if and only if p⋆ ≥ 0. On the other
hand, if x⋆ solves p⋆, then x⋆ is an optimal (worst-case)
attack in X, and it is successful if p⋆ < 0.
g(x).
The problem p⋆ is nonconvex due to the nonconvexity of g.
When g is a min-max affine function, a naive reformulation
of p⋆ yields that
p⋆ =
inf
(x,i,t)∈X×I×R
{t : a⊤
ijx + bij ≤ t for all j ∈ J },
which removes the nonconvexity in x but is inefficient to
solve in general due to the integer variable i. Alternatively,
one may attempt to directly reformulate the problem into
a convex one by minimizing the convex envelope of g.
Although the resulting problem coincides with our convex
reformulation c (introduced in Section III-A) on the relative
interior of the direct reformulation's feasible set, it is diffi-
cult to obtain regularity conditions under which the direct
reformulation holds with respect to its entire feasible set.
We propose an alternative approach to solving p⋆ that
consists of three steps: 1) lift the problem to an optimization
over probability measures, 2) leverage results and regularity
conditions in distributionally robust optimization to make a
finite-dimensional reduction of the problem, and 3) reformu-
late and solve the finite-dimensional reduction.
A. Lifting the Problem
We lift the problem to an optimization over probabil-
X g(x′)dδx(x′) =
ity measures by noting that g(x) = (cid:82)
Ex′∼δx g(x′) whenever x ∈ X:
p⋆ = inf
δx∈D(X)
Ex′∼δx g(x′).
With this reformulation, the optimization objective is linear
in the variable δx, but the feasible set D(X) is nonconvex,
making the problem intractable as written. Therefore, we
consider relaxing the problem to an optimization over all
probability measures:
p′ := inf
μ∈P(X)
Ex′∼μg(x′).
The problem p′ is convex, but infinite-dimensional. We start
by showing that the relaxation is exact:
Proposition 1. It holds that p′ = p⋆.
Proof. Since D(X) ⊆ P(X), it holds that p′ ≤ p⋆. Now, let
μ ∈ P(X). Then, since p⋆ ≤ g(x′) for all x′ ∈ X, it holds
that
p⋆ =
(cid:90)
X
p⋆dμ(x′) ≤
(cid:90)
X
g(x′)dμ(x′) = Ex′∼μg(x′).
Since μ ∈ P(X) is arbitrary, we conclude that p⋆ ≤
inf μ∈P(X) Ex′∼μg(x′) = p′. Hence, p′ = p⋆.
Next, we show that solutions of the nonconvex problem
p⋆ are generated by discrete solutions of the relaxation p′.
Proposition 2. If μ⋆ = (cid:80)
i∈I λiδxi is a discrete probability
measure that solves p′, then x⋆ := xi solves p⋆ for all i ∈ I
such that λi > 0.
Proof. Let i⋆ ∈ arg mini∈I g(xi). Since λi ≥ 0 for all i,
(cid:80)
i∈I λi = 1, and g(xi⋆ ) ≤ g(xi) for all i, it holds that
p⋆ ≤ g(xi⋆ ) =
(cid:88)
i∈I
λig(xi⋆ )
≤
(cid:88)
i∈I
λig(xi) = Ex′∼μ⋆ g(x′) = p′,
so xi⋆ solves p⋆ by Proposition 1. If xi′ does not solve p⋆ for
some i′ ∈ I such that λi′ > 0, then p⋆ = g(xi⋆ ) < g(xi′),
implying that (cid:80)
i∈I λig(xi) and hence
that p⋆ < p′, which contradicts Proposition 1.
i∈I λig(xi⋆ ) < (cid:80)
The above results show that we may solve the problem p⋆
of interest by solving p′ for a discrete optimal distribution.
The remainder of this section is dedicated to this approach.
B. Finite-Dimensional Reduction
To make our finite-dimensional reduction, we recall the
definitions of conjugate and perspective functions.
Definition 2. The conjugate of a function f : Rd → R is the
function f ∗ : Rd → R defined by
f ∗(y) = sup
(y⊤x − f (x)).
x∈dom(f )
We write f ∗∗ to denote the biconjugate (f ∗)∗.
Definition 3. The perspective of a proper, closed, and convex
function f : Rd → R is the function Pf : Rd × R+ → R
defined by
(cid:40)
Pf (x, t) =
tf (x/t)
if t > 0,
supy∈dom(f ∗) y⊤x if t = 0.
Recall that the perspective Pf of a convex function f is
also convex, and that the conjugate f ∗ is convex even when
f is nonconvex [39].
Throughout the remainder of the paper, we fix g and X to
be min-max affine and convex, respectively, via the following
structural assumptions:
Assumption 1. It holds that g ∈ G, taking the form g(x) =
mini∈I gi(x) with gi(x) = maxj∈J (a⊤
Assumption 2. The set X takes the form X = {x ∈ Rd :
ck(x) ≤ 0, k ∈ K} with ck : Rd → R a proper, closed, and
convex function for all k ∈ K.
ijx + bij).
may be verified by simply solving c with a small number
ε > 0 added to all of the nonlinear inequality constraints;
replace fi(x) ≤ 0 with fi(x) + ε ≤ 0 for all nonlinear
constraint functions fi.
Theorem 2. If Assumption 3 holds, then c = p′ = c, and the
discrete probability distribution (cid:80)
solves
p′ for all solutions (η⋆, λ⋆, x⋆) to c.
i ̸=0 λ⋆
i δx⋆
i∈I:λ⋆
i /λ⋆
i
Proof. Since X is defined by a finite intersection of 0-
sublevel sets of proper, closed, and convex functions (As-
sumption 2), and since every gi : x (cid:55)→ maxj∈J (a⊤
ijx + bij)
is a proper, closed, and convex function, the result follows
from [40, Theorem 12(ii)].
Theorem 2 together with our Propositions 1 and 2 show
that we are able to exactly compute an optimal attack
solving the nonconvex problem p⋆ by solving the convex
optimizations c, c.
We now make the reduction by introducing two finite-
C. Reformulating and Solving the Finite Reduction
dimensional convex optimization problems:
c := minimize
λi,ηi∈R
xi∈Rd
(cid:88)
i∈I
ηi
subject to Pck (xi, λi) ≤ 0, i ∈ I, k ∈ K,
Pgi(xi, λi) ≤ ηi, i ∈ I,
(cid:88)
λi = 1, λ ≥ 0.
i∈I
− α
c := maximize
α,βik∈R
yi,zik∈Rd
subject to g∗
i (yi) +
(cid:88)
k∈K
Pc∗
k
(zik, βik) ≤ α, i ∈ I,
yi +
(cid:88)
k∈K
zik = 0, i ∈ I,
βik ≥ 0, i ∈ I, k ∈ K.
Intuitively, c is minimizing a sort of "average" of the
components gi at a finite number of points xi with weights
given by the probability vector λ, and c is its dual. We now
leverage recent results in distributionally robust optimization
to show that the finite reductions c, c allow us to solve the
infinite-dimensional problem p′ under mild assumptions.
Definition 4. Let f0, f1, . . . , fm and h1, . . . , hn be extended
real-valued functions defined on Rd. The optimization prob-
lem p = inf{f0(x) : f1(x) ≤ 0, . . . , fm(x) ≤ 0, h1(x) =
0, . . . , hn(x) = 0, x ∈ Rd} admits a Slater point if there
exists x ∈ (cid:84)m
j=1 ri(dom(hj)) such that
fi(x) ≤ 0 and hj(x) = 0 for all i and all j, and such that
fi(x) < 0 for all i ̸= 0 such that fi is nonlinear.
i=0 ri(dom(fi)) ∩ (cid:84)n
Assumption 3. The set X is bounded and the optimization
problem c admits a Slater point.
The above boundedness assumption on X is standard in
the adversarial robustness literature. The Slater condition
In order to solve c, c, we must derive the appropriate
conjugates and perspectives. In this subsection, we do so for
the common cases where X is defined in terms of norm
balls or polyhedra. We will also see that computing the
conjugate g∗
is highly nontrivial, and as a result we turn
i
to tractably reformulating the constraint involving g∗
i using
duality theory.
Proposition 3. The perspective of gi : x (cid:55)→ maxj∈J (a⊤
bij) is given by Pgi(x, t) = maxj∈J (a⊤
(x, t) ∈ Rd × R+.
Proof. Let x ∈ Rd. If t > 0, then
ijx +
ijx + bijt) for all
Pgi(x, t) = tgi(x/t)
= t max
j∈J
(a⊤
ijx/t + bij) = max
j∈J
(a⊤
ijx + bijt).
If t = 0, then
Pgi(x, t) = lim inf
(x′,t′)→(x,0)
Pgi(x′, t′)
max
j∈J
= lim inf
(x′,t′)→(x,0)
a⊤
ijx = max
j∈J
= max
j∈J
(a⊤
ijx′ + bijt′)
(a⊤
ijx + bijt),
where the first equality comes from Theorem 13.3 and
Corollary 8.5.2 in [27] and the third equality comes from
the continuity of (x, t) (cid:55)→ maxj∈J (a⊤
ijx + bijt).
Proposition 4. The perspective of ck : x (cid:55)→ ∥x − x∥ − ε is
given by Pck (x, t) = ∥x − tx∥ − εt for all (x, t) ∈ Rd × R+.
Proof. Following the same reasoning as in the proof of
Proposition 3, we find that Pck (x, t) = t(∥x/t − x∥ −
ε) = ∥x − tx∥ − εt for t > 0 and Pck (x, t) =
lim inf (x′,t′)→(x,0)(∥x′ − t′x∥ − εt′) = ∥x∥ = ∥x − tx∥ − εt
for t = 0.
Proposition 5. The conjugate of ck : x (cid:55)→ ∥x − x∥ − ε is
given for all z ∈ Rd by
(cid:40)
c∗
k(z) =
z⊤x + ε
∞
if ∥z∥∗ ≤ 1,
if ∥z∥∗ > 1.
Proof. Let z ∈ Rd be such that ∥z∥∗ ≤ 1. Then
sup
x∈Rd:x̸=x
z⊤(x − x)
∥x − x∥
=
sup
x′∈Rd:∥x′∥≤1
z⊤x′ = ∥z∥∗ ≤ 1,
so z⊤(x − x) − ∥x − x∥ ≤ 0 for all x ̸= x. Also, z⊤(x −
x) − ∥x − x∥ = 0 for x = x, and therefore supx∈Rd (z⊤(x −
x) − ∥x − x∥) = 0, indicating that
c∗
k(z) = sup
x∈Rd
(z⊤(x − x) − ∥x − x∥) + z⊤x + ε = z⊤x + ε.
On the other hand, let z ∈ Rd be such that ∥z∥∗ > 1. Then
∥x′∥ > 1, implying that
there exists x′ ∈ Rd \ {0} such that z⊤x′
z⊤x′ − ∥x′∥ > 0, and hence
k(z) ≥ z⊤(x + αx′) − ∥αx′∥ + ε
c∗
= α(z⊤x′ − ∥x′∥) + z⊤x + ε → ∞
The conjugate g∗
i is all that remains to compute. However,
although computing g∗
i in closed form for the univariate (d =
1) function gi : x (cid:55)→ maxj∈J (aijx + bij) can be straightfor-
ward, generalizing the formula to higher-dimensional settings
is nontrivial. In theory, it is possible to express g∗
i for d > 1
in closed form via [27, Theorem 19.2]. However, this requires
solving a vertex enumeration problem, i.e., determining finite
sets V, R ⊆ Rd × R such that the polyhedron epi(g∗
i ) :=
{(x, t) ∈ Rd × R : a⊤
ijx + bij ≤ t for all j ∈ J } equals
conv(P ) + cone(R). The vertex enumeration problem is
NP-hard in general [41]. See the Minkowski-Weyl theorem
[27, Theorem 19.1] for the theory on such representations
of polyhedra. In Theorem 3 that follows, we instead take a
duality-based robust optimization approach to tractably deal
with the conjugate g∗
i in a direct manner.
i ) = conv{aij : j ∈ J }.
Lemma 1. It holds that dom(g∗
Proof. Let y ∈ conv{aij : j ∈ J }. Then y = (cid:80)
for some θ ∈ Rn such that θ ≥ 0 and (cid:80)
for all x ∈ Rd, we find that
(a⊤
y⊤x − max
j∈J
ijx − max
j∈J
ijx + bij) =
θja⊤
(a⊤
(cid:88)
j∈J θjaij
j∈J θj = 1. Hence,
ijx + bij)
j∈J
(cid:88)
θj(a⊤
ijx + bij)
as α → ∞. Thus, c∗
k(z) = ∞.
=
Proposition 6. The perspective of the conjugate of ck : x (cid:55)→
∥x − x∥ − ε is given for all (z, t) ∈ Rd × R+ by
(cid:40)
Pc∗
k
(z, t) =
z⊤x + εt
∞
if ∥z∥∗ ≤ t,
if ∥z∥∗ > t.
Proof. Let t > 0. If z ∈ Rd is such that ∥z∥∗ ≤ t, then
∥z/t∥∗ ≤ 1, so Pc∗
k(z/t) = t((z/t)⊤x + ε) =
(z, t) = tc∗
z⊤x + εt. If ∥z∥∗ > t, then ∥z/t∥∗ > 1, so Pc∗
(z, t) =
tc∗
k(z/t) = ∞.
On the other hand, let t = 0. Then
k
k
Pc∗
k
(z, t) =
sup
x∈dom(c∗∗
k )
z⊤x = sup
x∈Rd
z⊤x =
(cid:40)
if z = 0,
0
∞ if z ̸= 0,
k = ck which has domain Rd, as ck is proper, closed,
since c∗∗
and convex [27, Theorem 12.2]. Since, when t = 0, the
condition z = 0 is equivalent to ∥z∥∗ ≤ t and the condition
z ̸= 0 is equivalent to ∥z∥∗ > t, the proof is complete.
We also provide the conjugates and perspectives for poly-
hedral X:
Proposition 7. Let ck : x (cid:55)→ ψ⊤
and some ωk ∈ R. Then the following all hold:
k x + ωk for some ψk ∈ Rd
(cid:40)
k x + ωkt,
1) Pck (x, t) = ψ⊤
if z = ψk,
−ωk
∞ if z ̸= ψk,
(cid:40)
k(z) =
2) c∗
3) and Pc∗
k
(z, t) =
−ωkt
∞
if z = tψk,
if z ̸= tψk.
The proof of Proposition 7 follows from a straightforward
application of the definitions of conjugate and perspective,
and is hence omitted for brevity.
j∈J
− max
j∈J
(a⊤
ijx + bij) −
(cid:88)
j∈J
θjbij
≤
(cid:88)
j∈J
θj max
l∈J
(a⊤
il x + bil)
− max
j∈J
(a⊤
ijx + bij) −
(cid:88)
j∈J
θjbij
= −
(cid:88)
j∈J
θjbij,
i (y) ≤ − (cid:80)
and thus g∗
i (y) = supx∈Rd (y⊤x − maxj∈J (a⊤
j∈J θjbij < ∞, so y ∈ dom(g∗
i ), so that g∗
i ).
On the other hand, let y ∈ dom(g∗
i (y) <
∞. An epigraphic reformulation of g∗
i (y) yields that
∞ > g∗
ijx + bij)) =
sup(x,t)∈Rd×R{y⊤x−t : a⊤
ijx + bij ≤ t for all j ∈ J }. This
reformulation is a linear program with a finite optimal value,
and hence by [42, Proposition 3.1.3], the reformulation is
attained by some (x, t) ∈ Rd × R, and since it must be the
case that t = a⊤
ijx+bij for some j ∈ J at this point (x, t), we
conclude that this x solves the supremum defining g∗
i (y) in
its original form (i.e., pre-epigraphic reformulation). There-
fore, by the first-order optimality condition for unconstrained
convex optimization [27, Theorem 23.2], it holds that 0 ∈
∂hi(x), where hi : Rd → R is the convex function defined
by hi(x) = maxj∈J (a⊤
ijx + bij) − y⊤x. Using the rules
for subdifferentials of pointwise maxima and sums of proper
convex functions [42, Proposition B.22],[27, Theorem 23.8],
(cid:16)(cid:83)
+{−y}, where
we have that ∂hi(x) = conv
A(x) denotes the set of active indices at x: A(x) = {j ∈ J :
ijx + bij = maxl∈J (a⊤
a⊤
il x + bil)}. Since 0 ∈ ∂hi(x), this
(cid:17)
yields that y ∈ conv
⊆ conv{aij : j ∈ J }.
j∈A(x){aij}
This completes the proof.
(cid:17)
j∈A(x){aij}
(cid:16)(cid:83)
1) y = (cid:80)
and (cid:80)
2) νij ≥ 0,
3) y − aij + (cid:80)
4) and −bij + (cid:80)
Assumption 4. The functions gi are nonredundant in the
sense that for all j ∈ J there exists x ∈ Rd such that
gi(x) = a⊤
ijx + bij.
It is easy to see that nonredundancy of gi is efficiently
verified by solving the linear (feasibility) programs inf{0 :
(ail − aij)⊤x + (bil − bij) ≤ 0 for all l ∈ J , x ∈ Rd}
for all j ∈ J . Removing the affine components of gi with
infeasible programs ensures that Assumption 4 holds and
does not change the model's predictions.
Theorem 3. Suppose that Assumption 4 holds, and let
h : Γ → R be an arbitrary real-valued function defined on
some nonempty set Γ. Then, for all y ∈ Rd and all γ ∈ Γ, it
holds that g∗
i (y) ≤ h(γ) if and only if, for all j ∈ J , there
exists νij ∈ Rn such that the following all hold:
j∈J θjaij for some θ ∈ Rn such that θ ≥ 0
j∈J θj = 1,
l∈J (νij)l(aij − ail) = 0,
l∈J (νij)l(bij − bil) ≤ h(γ).
Proof. Let y ∈ Rd and γ ∈ Γ. If y ̸= (cid:80)
j∈J θjaij for
all θ ∈ Rn such that θ ≥ 0 and (cid:80)
j∈J θj = 1, then y /∈
conv{aij : j ∈ J } and hence y /∈ dom(g∗
i ) by Lemma 1.
In this case, g∗
i (y) = ∞ > h(γ) since h is real-valued.
Therefore, the first condition enumerated in the theorem is
necessary for g∗
i (y) ≤ h(γ).
Going forward, assume that y = (cid:80)
j∈J θjaij for some
θ ∈ Rn such that θ ≥ 0 and (cid:80)
i (y) <
∞. Breaking up the conjugate's supremum into n suprema
over the affine components of gi yields
j∈J θj = 1. Hence, g∗
(a⊤
ijx + bij))
(y⊤x − max
j∈J
g∗
i (y) = sup
x∈Rd
= max
j∈J
(ail − aij)⊤x + (bil − bij) ≤ 0 for all l ∈ J }.
{(y − aij)⊤x − bij :
sup
x∈Rd
il x + bil) = gi(x) = a⊤
ijx + bij ≥ a⊤
Denote the inner suprema by pij := supx∈Rd {(y − aij)⊤x −
bij : (ail − aij)⊤x + (bil − bij) ≤ 0 for all l ∈ J }. Since,
by Assumption 4, for all j ∈ J there exists x ∈ Rd such
that maxl∈J (a⊤
ijx + bij, it holds that
{x ∈ Rd : a⊤
il x + bil for all l ∈ J } ̸= ∅ for
all j ∈ J , implying that every pij is feasible, i.e., pij >
−∞. Furthermore, since g∗
i (y) < ∞, it must be the case
that pij < ∞ for all j ∈ J . Thus, every optimal value
pij is finite. Therefore, by [42, Proposition 3.1.3], every pij
is attained, and therefore by [42, Proposition 4.4.2] strong
duality holds between pij and its dual problem, which we
denote by dij, and it also holds that dij is attained. A routine
derivation via Lagrangian duality therefore yields that
pij = dij
= inf
νij ∈Rn
(cid:26) (cid:88)
(νij)l(bij − bil) − bij :
y − aij +
l∈J
(cid:88)
l∈J
(νij)l(aij − ail) = 0, νij ≥ 0
.
(cid:27)
Hence, g∗
i (y) ≤ h(γ) if and only if maxj∈J pij ≤ h(γ) if
and only if pij ≤ h(γ) for all j ∈ J . Thus, since dij is
attained, it holds that g∗
i (y) ≤ h(γ) if and only if, for all
j ∈ J , there exists νij ∈ Rn such that νij ≥ 0, y − aij +
(cid:80)
l∈J (νij)l(bij −
bil) ≤ h(γ). This completes the proof.
l∈J (νij)l(aij − ail) = 0, and −bij + (cid:80)
With the above conjugate and perspective derivations, our
reformulations of c, c are complete; they may now be directly
solved using off-the-shelf convex optimization solvers.
Remark 1. Our developments can be generalized, so long
as one can compute the appropriate conjugates and perspec-
tives. In particular, the mathematical machinery yielding a
discrete distribution solution to p′ from a solution to an
associated finite-dimensional convex optimization problem
may be applied to general convex functions gi and other
(non-norm-based and non-polyhedral) convex attack sets X
[40]. In fact, moment constraints on μ ∈ P(X) may even
be added to the semi-infinite program p′, which may allow
for modeling alternative "distributional attacks" beyond the
standard "Dirac attack" at a single point considered here.
IV. EXPERIMENTS
In this section, we illustrate the utility of our method in
both robust control and image classification settings.3
A. Robust Control Certification
We take an illustrative robust control example adapted
from the well-known autonomous vehicle collision avoidance
problem [43], [44]. Consider two planar vehicles approach-
ing an intersection located at the origin (0, 0) ∈ R2. One
vehicle travels east with state x(t) = (x(t), ̇x(t)) ∈ R2 at
time t. The other vehicle, which we control and hence term
the "ego vehicle," travels north with state y(t) = (y(t), ̇y(t)).
The eastbound uncontrolled vehicle has a fixed velocity
( ̈x(t) = 0 for all t). The full state (x(t), ̇x(t), y(t), ̇y(t)) is
randomly initialized at t = 0 within [−3, −2] × [1/2, 5/2] ×
[−3, −2] × [0, 2]. The vehicles are each 1 unit long and 1/2
unit wide, matching the width of the road. Thus, a vehicle
is considered to be in the intersection if the absolute value
of its position is less than 3/4. If the vehicles collide, the
simulation is stopped. We simulate standard double integrator
dynamics with a time step ∆t = 0.05 for 100 steps.
We control the northbound vehicle using a learned pol-
icy u(t) = −πθ (x(t), y(t)) that enters the dynamics as
̈y(t) = Π[−1,1] (u(t)), where πθ : R4 → R is a min-max
affine function with m = n = 10 and Π[−1,1]
is the
natural projection mapping of R onto [−1, 1]. Our robustness
certificates apply for all training schemes, e.g., reinforcement
learning and imitation learning. We train πθ using imitation
learning on 500 trajectories generated by a hand-programmed
expert policy π⋆. We use the mean squared error loss function
and train for 20 epochs using the Adam optimizer at a
learning rate of 0.01. The expert policy π⋆ is designed to stop
the ego vehicle δ = 0.1 units before the intersection with a
3All experiments are conducted on a Ubuntu 22.04 instance with an Intel
i7-9700K CPU and NVIDIA RTX A6000 GPU.
y
t
i
c
o
l
e
v
o
g
E
1.75
1.50
1.25
1.00
0.75
0.50
0.25
Worst-case acceleration
0
Min-max
α, β-CROWN
[97.8% clean]
[98.0% clean]
1.0
0.8
0.6
0.4
0.2
y
c
a
r
u
c
c
a
d
e
fi
i
t
r
e
C
−2.5 −2.0 −1.5 −1.0
Ego position
−1
0.0
0.00
0.05
0.10
0.15
0.20
l∞-radius
Fig. 1. Largest possible acceleration over all uncontrolled vehicle states
for particular values of the ego vehicle state. The output is always negative,
ensuring some level of braking.
constant acceleration, then apply no acceleration until the tail
of the uncontrolled vehicle is δ units past the intersection,
and then accelerate with the maximum input of 1.
We now consider certifying the safety of our control
system. Our goal is to guarantee that the ego vehicle always
brakes when the uncontrolled vehicle is approaching or
inside the intersection. This enforcement of braking corre-
sponds to ensuring that the largest acceleration signal u(t)
is less than zero, which amounts to minimizing the output of
πθ over the set of states for which we desire braking. This
is formalized by requiring braking for all states in the set
X = [−3 + δ, 3
4 ] × [ 1
2 + δ, 5
2 − δ] × [−3 + δ, − 3
4 ] × [δ, 2 − δ],
which consists of states where the uncontrolled vehicle is
approaching or in the intersection and the ego vehicle is
approaching the intersection. The small positive constant δ =
0.1 accounts for boundary states where expert trajectories
may not have been sampled.
Utilizing our robustness certificates from Section III, we
verify that indeed u(t) = −πθ (x(t), y(t)) < 0 for all states
(x(t), y(t)) ∈ X. For visual purposes, we also consider
fixing a particular y(t) and computing the largest possible
acceleration u(t) amongst all uncontrolled vehicle states x(t)
captured by X. The solutions to this problem over a range
of y(t) are plotted in Figure 1. As expected, for all y(t), the
ego vehicle is braking. As the ego vehicle approaches the
intersection (large y(t)) or becomes faster (large ̇y(t)), we
certify that the controller brakes more heavily.
B. Image Classification
We demonstrate the tightness and efficiency of our method
on an image classification example adapted from [38]. The
task is to distinguish between two visually similar MNIST
classes: the digits 3 and 8 [45]. As we consider the asymmet-
ric setting, we aim to certify predictions for one particular
Fig. 2. Certified accuracies of our min-max representation and of α, β-
CROWN on the MNIST 3-versus-8 dataset.
class, which we take to be the class of 3's, while maintaining
high clean accuracy for both classes. We consider the attack
set X = {x ∈ Rd : ∥x − x∥∞ ≤ ε} over a range of radii
ε > 0 around test images x. In this setting, certificates ensure
that pixelwise adversarial alterations of an image x of a 3
cannot fool the classifier into predicting an 8.
We compare two approaches: 1) directly learning our min-
max representation with n = m = 15 and certifying via
our convex optimization-based certificates, and 2) learning
a standard composition-based ReLU model and certifying
via the state-of-the-art verifier α, β-CROWN [22]. Since
α, β-CROWN's worst-case runtime scales exponentially with
model size, we instantiate the standard ReLU model with
one hidden layer and 100 hidden units, which is the smallest
hidden layer size that yields comparable clean accuracy to
our min-max representation. We use adversarial training (see
[9]) with l∞-attacks starting at a radius of 0.001 and linearly
interpolate to a radius of εtrain over the first 20 epochs,
where εtrain = 0.05 for our model and εtrain = 0.3 for the
standard ReLU model. Both models are trained using the
Adam optimizer with a learning rate of 0.001 for 60 epochs.
Figure 2 compares the certified accuracy (averaged over
the test inputs) of our method against that of α, β-CROWN.
As certifying at a particular ε using our method is fast, for
each test input, the largest certifiable l∞-radius is found us-
ing binary search in order to yield a smooth certified accuracy
curve. On the other hand, due to the expensive runtime of
α, β-CROWN, we only certify at the select radii shown. Our
min-max representation exceeds the state-of-the-art baseline
certified radii at far faster runtimes: certifying a single input-
radius pair (x, ε) takes on average 3.67 seconds with α, β-
CROWN versus only 0.48 seconds with our method. We note
that our runtime comparisons are solely based off of models
with equivalent clean accuracy. Due to space constraints, we
leave more thorough analyses of relative expressivity and
computational complexity for future work.
V. CONCLUSIONS
In this work, we exactly solve the nonconvex robustness
certification problem over convex attack sets for min-max
representations of ReLU neural networks by developing
a tractable convex reformulation. An interesting line of
future work may include developing more efficient min-
max representations or estimations for arbitrary ReLU neural
networks, so that the advantageous optimization properties
derived in this paper may be easily applied. Other interest
lies in comparing the number of affine regions of a general
min-max affine function versus that of a general ReLU neural
network.
REFERENCES
[1] S. Chen, S. A. Billings, and P. Grant, "Non-linear system identification
using neural networks," International Journal of Control, 1990.
[2] S. S. Ge, C. C. Hang, T. H. Lee, and T. Zhang, Stable Adaptive Neural
Network Control, 2013.
[3] S. Levine, C. Finn, T. Darrell, and P. Abbeel, "End-to-end training
of deep visuomotor policies," Journal of Machine Learning Research,
2016.
[4] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Good-
fellow, and R. Fergus, "Intriguing properties of neural networks," in
International Conference on Learning Representations, 2014.
[5] K. Eykholt, I. Evtimov, E. Fernandes, B. Li, A. Rahmati, C. Xiao,
A. Prakash, T. Kohno, and D. Song, "Robust physical-world attacks on
deep learning visual classification," in IEEE Conference on Computer
Vision and Pattern Recognition, 2018.
[6] A. Liu, X. Liu, J. Fan, Y. Ma, A. Zhang, H. Xie, and D. Tao,
"Perceptual-sensitive GAN for generating adversarial patches," in
AAAI Conference on Artificial Intelligence, 2019.
[7] M. Bojarski, D. Del Testa, D. Dworakowski, B. Firner, B. Flepp,
P. Goyal, L. D. Jackel, M. Monfort, U. Muller, J. Zhang et al., "End to
end learning for self-driving cars," arXiv preprint arXiv:1604.07316,
2016.
[8] G. Katz, C. Barrett, D. L. Dill, K. Julian, and M. J. Kochenderfer, "Re-
luplex: An efficient SMT solver for verifying deep neural networks,"
in Computer Aided Verification: 29th International Conference, 2017.
[9] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu,
"Towards deep learning models resistant to adversarial attacks," in
International Conference on Learning Representations, 2018.
[10] N. Carlini and D. Wagner, "Towards evaluating the robustness of
neural networks," in IEEE Symposium on Security and Privacy, 2017.
[11] E. Wong and Z. Kolter, "Provable defenses against adversarial ex-
amples via the convex outer adversarial polytope," in International
Conference on Machine Learning, 2018.
[12] H. Zhang, T.-W. Weng, P.-Y. Chen, C.-J. Hsieh, and L. Daniel, "Ef-
ficient neural network robustness certification with general activation
functions," in Advances in Neural Information Processing Systems,
2018.
[13] A. Raghunathan, J. Steinhardt, and P. S. Liang, "Semidefinite relax-
ations for certifying robustness to adversarial examples," in Advances
in Neural Information Processing Systems, 2018.
[14] M. Fazlyab, M. Morari, and G. J. Pappas, "Safety verification and
robustness analysis of neural networks via quadratic constraints and
semidefinite programming," IEEE Transactions on Automatic Control,
2020.
[15] B. G. Anderson, Z. Ma, J. Li, and S. Sojoudi, "Towards optimal
branching of linear and semidefinite relaxations for neural network
robustness certification," arXiv preprint arXiv:2101.09306, 2023.
[16] M. Fazlyab, A. Robey, H. Hassani, M. Morari, and G. Pappas, "Ef-
ficient and accurate estimation of Lipschitz constants for deep neural
networks," in Advances in Neural Information Processing Systems,
2019.
[17] L. Weng, H. Zhang, H. Chen, Z. Song, C.-J. Hsieh, L. Daniel,
D. Boning, and I. Dhillon, "Towards fast computation of certified ro-
bustness for ReLU networks," in International Conference on Machine
Learning, 2018.
[18] A. Virmaux and K. Scaman, "Lipschitz regularity of deep neural
networks: Analysis and efficient estimation," in Advances in Neural
Information Processing Systems, 2018.
[19] M. Jordan and A. G. Dimakis, "Exactly computing the local Lipschitz
constant of ReLU networks," in Advances in Neural Information
Processing Systems, 2020.
[20] V. Tjeng, K. Xiao, and R. Tedrake, "Evaluating robustness of neural
networks with mixed integer programming," in International Confer-
ence on Learning Representations, 2019.
[21] B. G. Anderson, Z. Ma, J. Li, and S. Sojoudi, "Tightened convex
relaxations for neural network robustness certification," in IEEE Con-
ference on Decision and Control, 2020.
[22] S. Wang, H. Zhang, K. Xu, X. Lin, S. Jana, C.-J. Hsieh, and
J. Z. Kolter, "Beta-CROWN: Efficient bound propagation with per-
neuron split constraints for neural network robustness verification," in
Advances in Neural Information Processing Systems, 2021.
[23] G. F. Montufar, R. Pascanu, K. Cho, and Y. Bengio, "On the number
of linear regions of deep neural networks," in Advances in Neural
Information Processing Systems, 2014.
[24] R. Arora, A. Basu, P. Mianjy, and A. Mukherjee, "Understanding
deep neural networks with rectified linear units," in International
Conference on Learning Representations, 2018.
[25] L. Zhang, G. Naitzat, and L.-H. Lim, "Tropical geometry of deep
neural networks," in International Conference on Machine Learning,
2018.
[26] P. Awasthi, A. Dutta, and A. Vijayaraghavan, "On robustness to
adversarial examples and polynomial optimization," in Advances in
Neural Information Processing Systems, 2019.
[27] R. T. Rockafellar, Convex Analysis. Princeton University Press, 1970.
[28] J.-L. Marichal, "Weighted lattice polynomials," Discrete Mathematics,
2009.
[29] S. Velasco-Forero and J. Angulo, "MorphoActivation: Generalizing
ReLU activation function by mathematical morphology," in Discrete
Geometry and Mathematical Morphology, 2022.
[30] A. M. Bagirov, "Max-min separability," Optimization Methods and
Software, 2005.
[31] A. M. Bagirov and J. Ugon, "Supervised data classification via
max-min separability," Continuous Optimization: Current Trends and
Modern Applications, 2005.
[32] B. Rister and D. L. Rubin, "Piecewise convexity of artificial neural
networks," Neural Networks, 2017.
[33] S. Chen, A. R. Klivans, and R. Meka, "Learning deep ReLU networks
is fixed-parameter tractable," arXiv preprint arXiv:2009.13512, 2020.
[34] S. Wang and K. S. Narendra, "Nonlinear system identification with
lattice piecewise-linear functions," in American Control Conference,
2002.
[35] C. D. Aliprantis, D. Harris, and R. Tourky, "Riesz estimators," Journal
of Econometrics, 2007.
[36] S. Ovchinnikov, "Max-min representation of piecewise linear func-
tions," Contributions to Algebra and Geometry, 2002.
[37] A. Pinkus, "Approximation theory of the MLP model
in neural
networks," Acta Numerica, 1999.
[38] S. Pfrommer, B. G. Anderson, J. Piet, and S. Sojoudi, "Asymmet-
ric certified robustness via feature-convex neural networks," arXiv
preprint arXiv:2302.01961, 2023.
[39] S. Boyd and L. Vandenberghe, Convex Optimization.
Cambridge
University Press, 2004.
[40] J. Zhen, D. Kuhn, and W. Wiesemann, "Mathematical foundations
of robust and distributionally robust optimization," arXiv preprint
arXiv:2105.00760, 2021.
[41] L. Khachiyan, E. Boros, K. Borys, V. Gurvich, and K. Elbassioni,
"Generating all vertices of a polyhedron is hard," Discrete & Compu-
tational Geometry, 2009.
[42] D. P. Bertsekas, Nonlinear Programming, 3rd ed. Athena Scientific,
2016.
[43] K. Ren, H. Ahn, and M. Kamgarpour, "Chance-constrained trajectory
planning with multimodal environmental uncertainty," IEEE Control
Systems Letters, 2022.
[44] A. Wang, A. Jasour, and B. C. Williams, "Non-Gaussian chance-
constrained trajectory planning for autonomous vehicles under agent
uncertainty," IEEE Robotics and Automation Letters, 2020.
[45] Y. LeCun, "The MNIST database of handwritten digits," http://
yann.lecun.com/exdb/mnist/, 1998.
|
|
http://arxiv.org/abs/2310.04915v1 | "2023-10-07T21:00:14" | "2023-10-07T21:00:14" | On Accelerating Diffusion-based Molecular Conformation Generation in
SE(3)-invariant Space | Diffusion-based generative models in SE(3)-invariant space have demonstrated
promising performance in molecular conformation generation, but typically
require solving stochastic differential equations (SDEs) with thousands of
update steps. Till now, it remains unclear how to effectively accelerate this
procedure explicitly in SE(3)-invariant space, which greatly hinders its wide
application in the real world. In this paper, we systematically study the
diffusion mechanism in SE(3)-invariant space via the lens of approximate errors
induced by existing methods. Thereby, we develop more precise approximate in
SE(3) in the context of projected differential equations. Theoretical analysis
is further provided as well as empirical proof relating hyper-parameters with
such errors. Altogether, we propose a novel acceleration scheme for generating
molecular conformations in SE(3)-invariant space. Experimentally, our scheme
can generate high-quality conformations with 50x--100x speedup compared to
existing methods. | [
"Zihan Zhou",
"Ruiying Liu",
"Tianshu Yu"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04915v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04915v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "physics.comp-ph",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"physics.comp-ph",
"cs.AI",
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
h
p
-
p
m
o
c
.
s
c
i
s
y
h
p
[
1
v
5
1
9
4
0
.
0
1
3
2
:
v
i
X
r
a
Preprint
ON ACCELERATING DIFFUSION-BASED MOLECULAR
CONFORMATION GENERATION IN SE(3)-INVARIANT
SPACE
Zihan Zhou∗, Ruiying Liu* & Tianshu Yu
The Chinese University of Hong Kong, Shenzhen
{zihanzhou1,ruiyingliu}@link.cuhk.edu.cn
yutianshu@cuhk.edu.cn
ABSTRACT
Diffusion-based generative models in SE(3)-invariant space have demonstrated
promising performance in molecular conformation generation, but typically require
solving stochastic differential equations (SDEs) with thousands of update steps.
Till now, it remains unclear how to effectively accelerate this procedure explicitly
in SE(3)-invariant space, which greatly hinders its wide application in the real
world. In this paper, we systematically study the diffusion mechanism in SE(3)-
invariant space via the lens of approximate errors induced by existing methods.
Thereby, we develop more precise approximate in SE(3) in the context of projected
differential equations. Theoretical analysis is further provided as well as empirical
proof relating hyper-parameters with such errors. Altogether, we propose a novel
acceleration scheme for generating molecular conformations in SE(3)-invariant
space. Experimentally, our scheme can generate high-quality conformations with
50x–100x speedup compared to existing methods.
1
INTRODUCTION
Given an atom-bond molecular graph, conformation generation asks for sampling viable 3-
dimensional coordinate configurations of atoms following the Boltzmann distribution of its com-
positional free energy (Strodel, 2021). As the 3-dimensional conformation generally determines a
molecule's macroscopic properties, conformation generation is a basic yet essential task in chemin-
formatics, drug discovery, and material engineering. Traditional solutions rely on optimizing over
potential energy surface (e.g., force field (Riniker & Landrum, 2015) and density functional theory
(Castro et al., 2004)), which suffer from a variety of drawbacks separately, such as low coverage,
high computational complexity, and heavy demand for prior knowledge.
Recently, there has been an increasing interest in applying diffusion-based generative models to
sample molecular conformations (Shi et al., 2021; Zhang et al., 2023; Luo et al., 2021; Xu et al.,
2022; Jing et al., 2022; Zhou et al., 2023; Fan et al., 2023a;b), as this line of work demonstrates
strong modeling ability to capture the wide conformation distribution, analogous to their counterparts
in computer vision area (Ho et al., 2020b; Dhariwal & Nichol, 2021). A central factor of such
success lies in incorporating the roto-translational property of SE(3)-invariant space (De Bortoli
et al., 2022), which is intrinsically equipped in 3-dimensional geometry. Unfortunately, unlike
counterparts in computer vision, diffusion-based conformation generators that explicitly incorporate
SE(3) property typically cost up to several thousand sampling steps. Till now it is vague how
to directly accelerate them with standard solvers (e.g., DPM solver and high-order solvers (Song
et al., 2020b; Dormand & Prince, 1980; Lu et al., 2022a)), while enforcing such solvers may result
in unmeaningful conformations, and the reason causing this failure remains unclear. Although
some other methods may be easily accelerated via bypassing this SE(3) riddle with much prior
knowledge (Ganea et al., 2021; Jing et al., 2022), we believe that getting to the bottom of SE(3) can
provide insightful perspectives to the future research.
∗indicates equal contribution.
1
Preprint
In this paper, we systematically investigate how to effectively accelerate diffusion-based generation
in SE(3)-invariant space for molecule generation tasks. To this end, we analyze current modeling
methods in SE(3) (Shi et al., 2021; Xu et al., 2022; Zhou et al., 2023) and theoretically pose crucial
mistakes shared in these methods, which inevitably bring about the failure of acceleration. From the
perspective of differential geometry and projected differential equations, we correct these mistakes
and propose more accurate approximations of score functions with a provably tight bound. This
approximation is designed to mimic a projection into SE(3)-invariant space. As such, we propose
a plausible scheme to accelerate diffusion-based generation on top of the corrected modeling with
a hyper-parameter. We further empirically demonstrate the relationship between hyper-parameter
and the model's prediction error, which we believe can provide useful suggestions for future solver
design. Extensive experiments are conducted on QM9 and Drugs datasets (Axelrod & Gomez-
Bombarelli, 2022). Our acceleration scheme can sample high-quality molecular conformations by
slightly modifying GeoDiff (Xu et al., 2022) and SDDiff (Zhou et al., 2023), but with 50–100x
speedup. In summary, our contributions are:
• We analyze the modeling mistakes occurring in the current SE(3)-based methods and present
effective approximation to correct them therein.
• We give a theoretically tight bound of our approximation, which also empirically performs
well.
• We for the first time propose a plausible scheme for accelerating diffusion-based molecular
conformation generation in SE(3)-invariant space, achieving remarkable speedup without
sacrificing sampling quality.
2 RELATED WORKS
Molecular conformation generation. Various methods have been proposed to generate molecular
conformers. Some notable approaches include GeoMol (Ganea et al., 2021), which utilizes Graph
Neural Networks (GNNs) to predict local structures and connectivity information for subsequential
manual assembly of conformers. In contrast, DMCG (Zhu et al., 2022) offers an end-to-end solution
by directly predicting atom coordinates while maintaining roto-translational invariance through
an SE(3)-invariant loss function. Recently, a growing interest has emerged in diffusion-based
methodologies (see Appendix A). To simplify the analysis of SE(3)-invariance, some methods shift
the modeling from atom coordinates to pairwise distances. A subset of them (Shi et al., 2021; Zhang
et al., 2023; Luo et al., 2021) introduce perturbations to inter-atomic distances and subsequently
estimate the corresponding coordinate scores. On the other hand, two most closely related works to the
present study, GeoDiff (Xu et al., 2022) and SDDiff (Zhou et al., 2023) both choose to perturb atomic
coordinates, but their distance distribution modelings are distinct. Other models focuse on molecular
local structure designs. FrameDiff (Yim et al., 2023) parameterizes the diffusion of the frame
translation and torsion angles by considering diffusion on SE(3)-manifold. Torsional diffusion (Jing
et al., 2022) further eases the problem by applying RDkit to first generate local structures so that the
lengths of atom bounds and then apply the diffusion process on torsion angles. Another different
method, EC-Conf (Fan et al., 2023b), is a consistency model which can transform the conformation
distribution into a noise distribution with a tractable trajectory satisfied SE(3)-equivariance.
Sampling acceleration of diffusion-based models. The reverse diffusion process typically takes
thousands of steps. To accelerate the diffusion process, some new diffusion models such as consistency
models (Song et al., 2023) are proposed. Consistency models directly map noise to data, enabling the
generation of images in only a few steps. EC-Conf (Fan et al., 2023b) represents an application of
consistency models in substantial reduced number of steps for molecular conformation generation. A
more naive approach is simply reducing the number of sampling iterations. DDIM (Song et al., 2020a)
uses a hyper-parameter to control the sampling stochastical level and finds that the decrease of the
reverse iteration number results improved sample quality due to less stochasticity. This phenomenon
can be attributed to the existence of a probability ODE flow associated with the stochastic Markov
chain of the reverse diffusion process (Song et al., 2020b). This implies that several numerical ODE
solver methods can be applied to solve the reverse diffusion. DPM-solver (Lu et al., 2022a) leverages
the semi-linear structure of probability flow ODE to develop customized ODE solvers, and also
provides high-order solvers for the probability ODE flow which can generate high-quality samples in
only 10 to 20 iterations. Then DPM is extended as DPM-solver++ (Lu et al., 2022b) for sampling
2
Preprint
with classifier-free guidance. However, such a dedicated solver can only be applied in Euclidean
space. To our best knowledge, there is no diffusion solver for SE(3)-invariant space or on the pairwise
distance manifold. Hence, accelerating SE(3)-diffusion process remains a challenge.
3 PRELIMINARY
3.1 MOLECULAR CONFORMATION GENERATION
Given a specific molecular graph G, the molecular conformation generation task aims to generate
a series of independent and identically distributed sample conformations
from the conditional
probability distribution denoted as p(
G). In this context, the distribution function p adheres to the
underlying Boltzmann distribution (Noé et al., 2019).
C|
C
Each molecule is represented as an undirected graph, denoted as G = (V, E), where the set V
represents the ensemble of atoms within the molecule, while E signifies the collection of inter-atomic
chemical bonds. Additionally, the graph incorporates node features hv ∈
V and
E. These features encapsulate information
for all edge connections (u, v)
edge features euv ∈
about atom types, formal charges, and bond types, among other characteristics.
Rf for all nodes v
Rf ′
∈
∈
To streamline the notation, the set of atoms in three-dimensional Euclidean space is represented as
.
xv∥
Rn×3, and the distance between nodes u and v is expressed as duv =
xu −
∥
G).
C
To model the generative process effectively, the generative model is denoted as pθ(
= [x1, . . . , xn]
∈
C|
3.2 EQUIVARIANCE WITHIN MOLECULAR CONFORMATION ANALYSIS
Equivariance with respect to translation and rotation operations, defined by the SE(3) groups, holds
significant interdisciplinary relevance across various physical systems. Therefore, it assumes a pivotal
role in the modeling and analysis of three-dimensional geometric structures, as highlighted in prior
research (Thomas et al., 2018; Weiler et al., 2018; Chmiela et al., 2019; Fuchs et al., 2020; Miller
et al., 2020; Simm et al., 2020; Batzner et al., 2022). In mathematical terms, a model sθ is considered
equivariant concerning the SE(3) group if it satisfies the condition sθ(Tf (x)) = Tg(sθ(x)) for any
arbitrary transformations f and g belonging to the SE(3) group. An effective strategy is to employ
inter-atomic distances, which naturally exhibit equivariance with respect to the SE(3) groups (Shi
et al., 2021; Xu et al., 2022; Gasteiger et al., 2020).
3.3 PAIRWISE-DISTANCE MANIFOLD
∈
∀
Rn×n
+
+ . Directly applying the diffusion process, i.e., ̃d = d + z for some z
Pairwise-distance matrices (adjacent matrices) lie in a sub-manifold of Rn×n
+ . A pairwise-distance
matrix d = [dij]
is said to be valid if there is a set of coordinates
= [x1, . . . , xn] s.t.
i, j = 1, . . . , n. The manifold of valid distance matrices is a proper sub-manifold
dij =
,
xj∥
xi −
∥
of Rn×n
(0n×n, I) would
result in an invalid pairwise-distance ̃d. Meanwhile, in the reverse process of diffusion, enforcing the
model to generate a feasible distance matrix is non-trivial. Some previous works (Hoffmann & Noé,
2019) utilize the spectral theorem to generate valid pairwise distance but such a method involves
matrices decomposition, which would cause huge computational cost. In some other works, authors
implicitly assume that the manifold of pairwise distance is surjective to Rn×n
+ , resulting in inaccurate
computation of the score function (Shi et al., 2021; Xu et al., 2022; Zhou et al., 2023).
∼ N
C
4 METHOD
In this work, we aim to explicitly accelerate the sampling of SE(3)-invariant diffusion models.
Surprisingly, our scheme only requires two slight modifications on top of existing models, i.e.,
GeoDiff (Xu et al., 2022) and SDDiff (Zhou et al., 2023), to enable efficient sampling in much fewer
steps: 1) replacing "summation" with "mean" term in estimating the score (Eq. 5) and 2) multiplying
a factor "scale" to correlate the error shift (Eq. 14).
We consider SE(3)-invariant diffusion models that model inter-atomic distances. Specifically, given
3 matrix, i.e.,
a molecular conformation
Rn×3/ SE(3) and let
0 be embedded by a n
C
×
0
C
∈
3
Preprint
0 = [x1, . . . , xn]
C
(we consider
∈
C
Rn×3, they define a forward diffusion process of the conformation embedding
0 as a vector to simplify our notations) (Song et al., 2020b)
q0t (
Ct | C
0) =
(cid:0)
N
0, σ2
t I(cid:1)
Ct | C
⇔
∂
Ct =
(cid:114)
dσ2
t
dt
∂wt
(1)
where
the corresponding ODE reverse flow is
q0(
∼
C
C
0
0) and q0 is the distribution of the dataset, σt = σ(t) is an increasing function, and
∂
Ct
∂t
=
1
2
dσ2
t
dt ∇
−
Ct log q0t (
0) ,
Ct | C
CT ∼
q0T (
CT | C
0)
qT (
CT ) ,
≈
(2)
To define an equivariant reverse process, we need to compute an equivariant score function
0). By assuming that the manifold dimension of the pairwise distance is n2, existing
∇
methods use the chain rule to compute (Shi et al., 2021; Xu et al., 2022; Zhou et al., 2023)
Ct log q0t(
Ct|C
Ct log q0t(
∇
log q0t(dt|
d0)
(3)
≈
0)
i=1
(cid:88)
n
(cid:88)
Ct|C
∂d(t)
ij
Ct ∇d(t)
∂
]. They train the model sθ = sθ(
Ct|C
j∈N (i)
ij
G
G
G
where d = [dij] = [
xj∥
xi −
∥
0) and
sθ(dt, t,
Ct log q0t(
σt∇
notation simplification, we omit the input
) =
−
G
) satisfying
Ct, t,
G
represents the molecular graph. In the following, for
).
and sθ(dt, t) = sθ(dt, t,
) = sθ(dt, t,
G
We find that applying the usual discretilization (Lu et al., 2022a) (see Appendix B)
−
cannot produce substantial conformations. To enable efficient sampling, we apply two core modifica-
tions. The first modification is to replace Eq. 3 with
Ct ≈ Cs + [σ(t)
σ(s)] sθ(ds, s)
(4)
Ct log qσ(
0) =
Ct|C
∇
n
(cid:88)
i=1
1
degreei
(cid:88)
j∈N (i)
∂d(t)
ij
Ct ∇d(t)
∂
ij
log q0t(dt|
d0)
(5)
where degreei is the degree of node i. The second modification is to add a multiplier "scale", ksθ to
Eq. 4:
Ct ≈ Cs + ksθ (ds, s, t) [σ(t)
−
σ(s)] sθ(ds, s)
(6)
The reason for the first and second modifications is detailed in Sec. 4.1 and Sec. 4.2. In our empirical
investigation, we substantiate that our solver is capable of producing high-quality samples when
contrasted with the approach of sampling through thousands of iterations of Langevin dynamics.
4.1 DIFFERENTIAL FORM OF CONFORMATION SCORE
We examine the relationship existing between the manifold of pair-
wise distances and conformation. We define the manifold of pairwise
distance matrices or adjacent matrices to be M and the manifold
of the SE(3)-invariant conformation coordinates to be N . Consider
mappings defined in Fig 1. By definition, we have
Ct log q0t(
Ct|C
0) = dφdt(
∇dt log q0t(dt|
d0))
∇
(7)
Computation of dφ. For fixed t, we rewrite ̃d := dt, d := d0 and
pσ( ̃d
N .
d) := q0t(dt |
→
We can write f = πN ◦
3 matrix
×
N . In such an embedding, we can choose πN to be
to embed
C ∈
πM, ̃d. The mapping
an identical mapping and we have dφ ̃d = φ
d0). Consider the mapping f : T ̃dM
dφ = φ
πM . Since we use a n
◦
|
◦
4
Figure 1: Mappings between
the manifolds of pairwise dis-
tances M and SE(3)-invariant
conformations N . A more
detailed introduction can be
found in Appendix C.
Preprint
∂ ̃dij
∂ ̃
C
ˆxi −
(cid:16)
∥
→
φ : M
to be a generalized multidimensional scaling (GMD), i.e. given ˆd = ̃d + (cid:80)
define πM, ̃d( ˆd)ij =
N is a function that maps the adjacent matrix to a conformation and πM can be chosen
T ̃dM , we
. Then,
(cid:80)
i<j
(cid:16)
ˆxj∥
, where ˆx1, . . . , ˆxn = argmin
ˆx1,...,ˆxn
ˆxi −
∥
ˆxi −
∥
i,j αijeij ∈
(cid:17)2
ˆdij
ˆxj∥ −
(cid:17)2
ˆdij
.
dφ ̃d( ˆd) = φ
πM, ̃d( ˆd) = argmin
ˆx1,...,ˆxM
◦
(cid:88)
(cid:16)
i<j
ˆxi −
∥
ˆxj∥ −
We approximate the solution of the above optimization problem as
dφ ̃d( ˆd) = dφ ̃d( ̃d +
(cid:88)
i,j
αijeij)
+
̃
C
≈
(cid:88)
αij
i,j
2(n
1)
−
(8)
(9)
Theorem 1. Consider the optimization problem f ( ˆd) := min
ˆd = ̃d + δeuv. The optimal value f ( ˆd) approximated by ˆx = dφ ̃d( ˆd) from Eq. 9 is bounded by
2n2+n−1
2(n−1)2 δ2 (See Appendix D.2 for the formal proof). Hence, approximation error does not explode
with the increase of node numbers.
ˆxj∥ −
, where
ˆx1,...,ˆxM
ˆdij
i<j
(cid:80)
(cid:17)2
Then, by Eq. 9 and the linearity of dφ ̃d, we have
̃C log pσ( ̃
C|C
∇
) = dφ ̃d(
̃d log pσ( ̃d
d))
|
∇
≈
(cid:88)
∇
i,j
̃dij
log pσ( ̃d
|
1)
2(n
−
d)
∂ ̃dij
∂ ̃
C
(10)
Detailed intermediate steps and the reason for such an approximation, as well as approximation error
bound and tangent space assumptions, are detailed in Appendix D. Since we usually consider partially
connected conformations, the pairwise distance matrix is sparse. We thus modify Eq. 10 to
Ct log q0t(
Ct|C
0)
≈
∇
n
(cid:88)
i=1
1
degreei
(cid:88)
j∈N (i)
∂d(t)
ij
Ct ∇d(t)
∂
ij
log q0t(dt|
d0),
(11)
where degreei denotes the degree of node i. By completing the sparse conformation into a fully
connected conformation, Eq. 11 is reduced to Eq. 10. Various methods have been proposed to
compute
d0) and details can be seen in Appendix E. Using these methods, we can
∇dt log q0t(dt|
train the model sθ(dt, t)
Ct log q0t(
0).
σt∇
≈ −
Ct|C
4.2 MODELING OF REVERSED FLOW
As stated in Eq. 2, the reverse flow of conformations is
∂
Ct
∂t
=
1
2
dσ2
t
dt ∇
−
Ct log q0t (
0) =
Ct | C
1
2
dσ2
t
dt
−
dφdt(
∇dt log q0t(dt|
d0))
(12)
where we assume
TdtM . We can
discretize the above ODE (Lu et al., 2022a) (see Appendix B) and suppose that we have a model
sθ(dt, t) =
0) + ε(dt, t), where ε(dt, t) is the prediction error, then we have
Ct +
Ct log q0t(
∇dt log q0t (dt |
TCtN, dt +
Ct log q0t (
Ct | C
d0)
0)
∇
∈
∈
σt∇
−
Ct|C
σsσ′(s)dφ (
Ct ≈ Cs −
≈ Cs + [σ(t)
:=
Cs + [σ(t)
−
−
∇ds log q0s (ds))
[σ(t)
σ(s)] sθ(ds, s)
σ(s)] sθ(ds, s) + ̄ε(ds, s, t)
−
−
σ(s)] ε(ds, s)
(13a)
(13b)
(13c)
5
Preprint
and intermediate time steps are uniformly distribution between T and 0. The term ̄ε(ds, s, t) can be
seen as an addtional noise injected to
Cs. Hence, after one iteration of the denoising process, the
obtained ̃Ct should be ̃Ct+λ(s−t) for some λ
(0, 1). This motivates us to choose a larger drift of
the conformation score. Hence, we introduce a multiplier "scale" ksθ (ds, s, t) > 1 as an addition
term to remedy the model's prediction errors, and the iteration rule becomes
∈
Ct ≈ Cs + ksθ (ds, s, t) [σ(t)
−
σ(s)] sθ(ds, s)
(14)
ksθ (pdata), i.e., for each dataset, we can find a
To find scale ksθ , we further assume ksθ (ds, s, t)
q0t(dt). From the experimental results, we
hyper-parameter to approximate ksθ (ds, s, t) for all dt ∼
find that the magnitude of ksθ increases along with the increase of the model's prediction error, while
other factors such as node number and node degree do not have a significant influence on the choice
of ksθ . Details of the experiments and the results can be seen in Sec. 5.1.
≈
5 EXPERIMENTS
We first examine the influential factors associated with the newly introduced hyper-parameter "scale"
ksθ in Sec. 5.1. Then we evaluate our proposed accelerated sampling method through a comparative
analysis with the baseline sampling method in Sec. 5.3 and conduct the hyper-parameter analysis for
these two sampling method in Sec. 5.4. Finally, we assess our method's efficacy when the number
of iterations in the sampling process is further reduced in Sec. 5.5. Appendix G provides additional
experiments, and visualization of sampling process of our method can be found in Appendix H.
5.1 MODEL ERROR ̄ε AND SCALE ksθ
{
Ct | C
n
i=1 to investigate the relation-
We develop toy datasets
Qi}
ship between the prediction error ̄ε and scale ksθ and each
(i)
dataset only contains a single sample,
.
i.e., Qi =
0 }
{C
T
For each dataset, we denote the sigma scheduler as
σt}
t=1
{
and set the forward diffusion process to be q0t(
0) =
Ct
| C
t I) and suppose we have a model sQi
θ (dt, δ) =
(
N
dt + d0) + εd(δ, t)(cid:1)(cid:1), where dt is the pairwise
Normstd
distance of the conformation coordinates at time t and εd(δ, t)
is the noise level term controlled by a hyper-parameter δ. We
assume sQi
0) when δ is small. De-
Ct log q0t(
tailed reasons for such a definition and corresponding settings
can be found in Appendix F.1. To generate samples, we sample
random noise ̃
0, σ2
(cid:0)dφ (cid:0)(
θ (dt, δ)
σt∇
Ct|C
(0, σ2
T I) and apply
≈ −
−
CT ∼ N
−
(15)
̃
Ct ≈
0. If
σ(s)]sθ (ds, s, δ)
̃
Cs + ksθ [σ(t)
̃dt −
to generate ̃
∞ < h for some predefined threshold
d0
∥
∥
C
h > 0, we say that the reverse process converges at t and define
the minimal 1
t/T to be the convergent time. We aim to find the convergent time under different
noise levels δ and scale ksθ . We grid-search the above two parameters and visualize the convergence
of the model. The results can be seen in Fig. 2 and the color of each grid represents the convergent
time. Grids with no color imply that under such noise level δ and model error ksθ , the model
diverges. We can see a positive correlation between the model's error and the scale, which matches
the hypothesis in Eq. 13. Other ablation studies show that other factors including node number and
node degree do not have a strong impact on the choice of ksθ . Detailed analysis is in Appendix F.2.
Figure 2: Relations between the
prediction error δ and scale ksθ .
Grid color indicates the conver-
gent time.
−
5.2 EXPERIMENT SETUP
We firstly retrain SDDiff and GeoDiff models after the modifying their conformation score as
introduced in Equation 5. Comprehensive training specifications can be found in Appendix G.1. It's
important to note that the results presented here are derived from the modified models.
6
0.5 0.6 0.7 0.8 0.9 1.0 1.0 1.1 1.2 1.3 4.4 4.1 3.9 3.7 3.4 3.2 2.9 2.7 2.4 2.2 2.0 1.7 1.5 1.2 1.0ks0.8250.8500.8750.9000.9250.9500.975Preprint
Table 1: Comparison results between LD sampling and our fast sampling method. Note that GeoDiff
and SDDiff here refer to the revised ones with modified score estimation in Eq. 5. Higher values for
COV indicate better results, while lower values for MAT are preferable. The reported time represents
the average run time for sampling a single conformer.
Dataset Model
Sampling
method
Recall
Precision
COV-R(%) ↑ MAT-R(Å) ↓ COV-P(%) ↑ MAT-P(Å) ↓
Mean Median Mean Median Mean Median Mean Median
Time
(s)
Drugs
QM9
GeoDiff
SDDiff
GeoDiff
SDDiff
LD
Ours
LD
Ours
LD
Ours
LD
Ours
78.83 89.37 1.0422 1.0346 51.13 50.00 1.3143 1.2638 4.4506
84.06 94.39 0.9693 0.9608 49.09 49.04 1.3746 1.3303 0.0868
56.88 55.85 1.3318 1.2448 60.25 65.86 1.2619 1.1446 4.2392
70.69 76.68 1.0946 1.0801 48.83 48.01 1.6397 1.4478 0.0802
88.79 93.00 0.3285 0.3249 50.84 48.30 0.6986 0.5027 2.4608
90.62 95.09 0.2427 0.2368 52.30 50.61 0.4714 0.4588 0.0471
90.56 95.58 0.2740 0.2693 52.74 50.26 0.6210 0.4660 2.2428
88.46 92.66 0.2920 0.2905 46.94 45.07 0.8293 0.6726 0.0459
Dataset. We employ two datasets, namely GEOM-Drugs and GEOM-QM9 (Axelrod & Gomez-
Bombarelli, 2022) to validate the efficiency of our fast sampling method. The dataset split is from
GeoDiff (Xu et al., 2020). In the GEOM-Drugs dataset's test set, we encounter a total of 14,324
conformers from 200 molecules, with an average of approximately 47 atoms per molecule. The
GEOM-QM9 test set contains 24,143 conformers originating from 200 molecules, and each molecule
has an average of around 20. In line with the previous work (Xu et al., 2020), we expand the
generation of ground truth conformers to double their original quantity, resulting in more than 20k+
and 40k+ conformers being generated. Please refer to GeoDiff (Xu et al., 2022) for more information.
Evaluation. We adopt established evaluation metrics, namely COV (Coverage) and MAT (Match-
ing), incorporating Recall (R) and Precision (P) aspects to assess the performance of sampling
methods (Xu et al., 2020; Ganea et al., 2021). COV quantifies the proportion of ground truth conform-
ers effectively matched by generated conformers, gauging diversity in the generated set. On the other
hand, MAT measures the disparity between ground truth and generated conformers, complementing
quality assessment. Furthermore, refined metrics COV-R and MAT-R place added emphasis on the
comprehensiveness of the ground truth coverage, while COV-P and MAT-P are employed to gauge
the precision and accuracy of the generated conformers. Detailed calculations are in Appendix G.1.
Baseline sampling method. To the best of our knowledge, no other fast conformation generation
methods exist. Therefore, we compare our fast sampling approach with the conventional sampling
method via Langevin dynamics (LD sampling) (Song & Ermon, 2019):
Ct−1 =
Ct + αt∇
(0, I) and αt = hσ2
Ct log pσ(
Ct) + √2αtzt−1,
t . h is the hyper-parameter referring to step size and σt is the
where zt ∼ N
noise schedule in the forward diffusion process. We employ T = 5000 in the diffusion process,
necessitating 5000 iterations in LD sampling.
t = T, T
1, . . . , 2, 1
(16)
−
5.3 COMPARISON WITH BASELINE SAMPLING METHOD
The LD sampling method needs thousands of steps to align with the diffusion process, whereas
our fast sampling achieves the same goal with significantly fewer iterations. We compare our fast
sampling method using 100 steps with LD sampling, and the results are shown in Tab. 1. Our
evaluation criteria consist of eight metrics, and the results displayed in the table are obtained under
hyper-parameter settings that ensure a well-balanced comparison among these evaluation criteria.
Tab. 1 shows that our fast sampling method can generate conformers of comparable quality to LD
sampling while achieving a roughly 50-fold speed improvement. Overall, metrics related to Recall
are satisfying, indicating that good diversity in conformers generated by our methods. However, there
7
Preprint
Figure 3: Impacts of scale ksθ and step size h in our fast sampling and LD sampling. Note that in the
figures in the upper row, higher COV values signify superior performance, while in the figures below,
the opposite holds for MAT. Metrics failing to meet the predefined thresholds (COV values lower than
0.2, MAT values higher than 2.5) have been intentionally omitted from the graphical representation
for clarity and precision.
are more low-quality conformers generated, resulting in lower performance in terms of metrics under
Precision.
5.4 HYPER-PARAMETER ANALYSIS
We introduce a hyper-parameter scale, denoted as ksθ in Eq 14, to enable acceleration. In LD
sampling, the hyper-parameter is step size h in our setting. We illustrate the influence of these
hyper-parameters on Drugs dataset in Fig. 3. Notably, certain data points revealed a significant
underperformance are not depicted in the figure. A counterpart analysis on QM9 dataset is provided
in Appendix G.2.
Fig. 3 shows that our method can obtain satisfactory metrics for Recall across most hyper-parameter
values. However, metrics related to Precision consistently exhibit poorer results. Particularly, when
higher scales are employed, resulting in significantly higher values for MAT-P. This is due to the
deteriorating output of the network. We observe that part of the output occasionally start exploding
from a certain sampling iteration especially under higher scale values, leading to some generated
conformers becoming unstructured. This significantly impacts the P-series metrics but not the R-series
metrics, as P-series metrics include all generated samples but the latter only considers conformers
closely matching the ground truth. A similar phenomenon is also observed for LD sampling. When
8
12345678scale0.650.700.750.800.85COV-R mean12345678scale0.70.80.9COV-R median12345678scale0.30.40.50.6COV-P mean12345678scale0.20.30.40.50.60.7COV-P median12345678scale1.01.21.41.61.8MAT-R mean12345678scale1.01.21.41.61.8MAT-R median12345678scale1.41.61.82.0MAT-P mean12345678scale1.21.41.61.8MAT-P median0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step sizeHyper-parameter analysis of sampling methods on Drugs datasetFast sampling for GeoDiffLD samping for GeoDiff12345678scale0.20.30.40.50.60.7COV-R mean12345678scale0.20.40.60.8COV-R median12345678scale0.20.30.40.50.6COV-P mean12345678scale0.30.40.50.6COV-P median12345678scale1.21.41.61.82.0MAT-R mean12345678scale1.21.41.61.82.0MAT-R median12345678scale1.41.61.82.02.2MAT-P mean12345678scale1.251.501.752.002.252.50MAT-P median0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step sizeHyper-parameter analysis of sampling methods on Drugs datasetFast sampling for SDDiffLD samping for SDDiffPreprint
Figure 4: Results of our accelerated sampling technique applied to GeoDiff with a reduced number
of steps. The dashed horizontal lines represent the results obtained through LD sampling. Data points
with MAT metrics exceeding 2.5 have been omitted from the figure for clarity and precision.
the step size h exceeds a certain range, P-series metrics quickly deteriorate. Addressing this issue
may require improved network design in future research.
In the comparison between GeoDiff and SDDiff, we observe that when applied to SDDiff, our
method demands a higher and more stringent scale ksθ . In a previous demonstration in Sec. 5.1, we
demonstrate that scale is linked to modeling error. Despite SDDiff's more accurate distance score
distribution approximation (Zhou et al., 2023), it leads to a significantly more complex learning
objective compared to GeoDiff's Gaussian assumption. The presence of the random variable ̃d, which
can approach zero in the denominator (see Appendix E), poses a significant challenge to training.
Consequently, the error in the trained models of SDDiff is more likely to be higher, thus requiring a
higher value of scale within a narrower range.
5.5 SAMPLING IN FEWER STEPS
We evaluate the efficacy of our accelerated sampling method at further reduced steps. The results for
the GeoDiff model on Drugs dataset are shown in Fig. 4, and more complementary experiments are
detailed in Appendix G.3. As depicted in Fig. 4, our method exhibits noteworthy robustness when
subjected to fewer steps. While performance gradually diminishes with decreasing step counts, it
consistently maintains a commendable level of accuracy even under the constraint of only 30 steps.
This adaptability to reduced step conditions underscores that our approach offers a compelling solution
that strikes a commendable balance between speed and performance, indicating its considerable
potential for real-world applications.
6 CONCLUSION
This study focuses on effective acceleration of diffusion-based generation in SE(3)-invariant space
for molecular conformation generation. To this end, we first investigate the correlation between two
manifolds regarding distances and coordinates utilizing an approximated differential operator, as well
as rigorously validating this approximation through mathematical proofs and empirical experiments.
Then, we alleviate the accumulation of approximation errors in the reverse diffusion process by
introducing an additional hyper-parameter, scale. Empirical results support the validity of this
remedial strategy, and detailed analysis provided insights into hyper-parameter selection. Building
upon these findings, comparative investigations substantiate the effectiveness of our acceleration
scheme. We posit that this study has the potential to expedite the sampling procedure in real-world
applications, facilitating the practical deployment of diffusion models.
9
2345678scale0.760.780.800.820.84COV-R mean2345678scale0.880.900.920.940.96COV-R median2345678scale0.400.450.500.55COV-P mean2345678scale0.350.400.450.500.55COV-P median2345678scale0.960.981.001.021.041.06MAT-R mean2345678scale0.960.981.001.021.04MAT-R median2345678scale1.41.61.82.0MAT-P mean2345678scale1.41.61.82.02.22.4MAT-P medianFewer steps of fast sampling for GeoDiff on Drugs datasetOur method in 80 stepsOur method in 50 stepsOur method in 30 stepsLD sampling with 5000 stpesPreprint
REFERENCES
Simon Axelrod and Rafael Gomez-Bombarelli. Geom, energy-annotated molecular conformations
for property prediction and molecular generation. Scientific Data, 9(1):185, 2022.
Simon Batzner, Albert Musaelian, Lixin Sun, Mario Geiger, Jonathan P Mailoa, Mordechai Kornbluth,
Nicola Molinari, Tess E Smidt, and Boris Kozinsky. E (3)-equivariant graph neural networks for
data-efficient and accurate interatomic potentials. Nature communications, 13(1):2453, 2022.
Alberto Castro, Miguel AL Marques, Julio A Alonso, George F Bertsch, and Angel Rubio. Excited
states dynamics in time-dependent density functional theory: high-field molecular dissociation and
harmonic generation. The European Physical Journal D-Atomic, Molecular, Optical and Plasma
Physics, 28:211–218, 2004.
Stefan Chmiela, Huziel E Sauceda, Igor Poltavsky, Klaus-Robert Müller, and Alexandre Tkatchenko.
sgdml: Constructing accurate and data efficient molecular force fields using machine learning.
Computer Physics Communications, 240:38–45, 2019.
Valentin De Bortoli, Emile Mathieu, Michael Hutchinson, James Thornton, Yee Whye Teh, and
Arnaud Doucet. Riemannian score-based generative modelling. Advances in Neural Information
Processing Systems, 35:2406–2422, 2022.
Jan De Leeuw. Applications of convex analysis to multidimensional scaling. 2005.
Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances
in neural information processing systems, 2021.
John R Dormand and Peter J Prince. A family of embedded runge-kutta formulae. Journal of
computational and applied mathematics, 6(1):19–26, 1980.
Wenqi Fan, Chengyi Liu, Yunqing Liu, Jiatong Li, Hang Li, Hui Liu, Jiliang Tang, and Qing Li. Gen-
erative diffusion models on graphs: Methods and applications. arXiv preprint arXiv:2302.02591,
2023a.
Zhiguang Fan, Yuedong Yang, Mingyuan Xu, and Hongming Chen. Ec-conf: A ultra-fast diffu-
sion model for molecular conformation generation with equivariant consistency. arXiv preprint
arXiv:2308.00237, 2023b.
Fabian Fuchs, Daniel Worrall, Volker Fischer, and Max Welling. Se (3)-transformers: 3d roto-
translation equivariant attention networks. Advances in Neural Information Processing Systems,
2020.
Octavian Ganea, Lagnajit Pattanaik, Connor Coley, Regina Barzilay, Klavs Jensen, William Green,
and Tommi Jaakkola. Geomol: Torsional geometric generation of molecular 3d conformer
ensembles. Advances in Neural Information Processing Systems, 2021.
Johannes Gasteiger, Janek Gross, and Stephan Günnemann. Directional message passing for molecular
graphs. arXiv preprint arXiv:2003.03123, 2020.
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in
Neural Information Processing Systems, 2020a.
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in
neural information processing systems, 2020b.
Moritz Hoffmann and Frank Noé. Generating valid euclidean distance matrices. arXiv preprint
arXiv:1910.03131, 2019.
Bowen Jing, Gabriele Corso, Jeffrey Chang, Regina Barzilay, and Tommi Jaakkola. Torsional
diffusion for molecular conformer generation. Advances in Neural Information Processing Systems,
2022.
Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Dpm-solver: A fast
ode solver for diffusion probabilistic model sampling in around 10 steps. Advances in Neural
Information Processing Systems, 2022a.
10
Preprint
Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Dpm-solver++: Fast
solver for guided sampling of diffusion probabilistic models. arXiv preprint arXiv:2211.01095,
2022b.
Shitong Luo, Chence Shi, Minkai Xu, and Jian Tang. Predicting molecular conformation via dynamic
graph score matching. Advances in Neural Information Processing Systems, 34:19784–19795,
2021.
Benjamin Kurt Miller, Mario Geiger, Tess E Smidt, and Frank Noé. Relevance of rotationally
equivariant convolutions for predicting molecular properties. arXiv preprint arXiv:2008.08461,
2020.
Frank Noé, Simon Olsson, Jonas Köhler, and Hao Wu. Boltzmann generators: Sampling equilibrium
states of many-body systems with deep learning. Science, 365(6457):eaaw1147, 2019.
Sereina Riniker and Gregory A Landrum. Better informed distance geometry: using what we know
to improve conformation generation. Journal of chemical information and modeling, 55(12):
2562–2574, 2015.
Kristof Schütt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Stefan Chmiela, Alexandre
Tkatchenko, and Klaus-Robert Müller. Schnet: A continuous-filter convolutional neural network
for modeling quantum interactions. Advances in neural information processing systems, 30, 2017.
Chence Shi, Shitong Luo, Minkai Xu, and Jian Tang. Learning gradient fields for molecular
conformation generation. In International Conference on Machine Learning, 2021.
Gregor NC Simm, Robert Pinsler, Gábor Csányi, and José Miguel Hernández-Lobato. Symmetry-
aware actor-critic for 3d molecular design. arXiv preprint arXiv:2011.12747, 2020.
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv
preprint arXiv:2010.02502, 2020a.
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution.
Advances in neural information processing systems, 2019.
Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben
Poole. Score-based generative modeling through stochastic differential equations. arXiv preprint
arXiv:2011.13456, 2020b.
Yang Song, Prafulla Dhariwal, Mark Chen, and Ilya Sutskever. Consistency models. arXiv preprint
arXiv:2303.01469, 2023.
Birgit Strodel. Energy landscapes of protein aggregation and conformation switching in intrinsically
disordered proteins. Journal of molecular biology, 433(20):167182, 2021.
Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley.
Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds.
arXiv preprint arXiv:1802.08219, 2018.
Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco S Cohen. 3d steerable cnns:
Learning rotationally equivariant features in volumetric data. Advances in Neural Information
Processing Systems, 2018.
Florian Wickelmaier. An introduction to mds. Sound Quality Research Unit, Aalborg University,
Denmark, 46(5):1–26, 2003.
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural
networks? In International Conference on Learning Representations, 2018.
Minkai Xu, Shitong Luo, Yoshua Bengio, Jian Peng, and Jian Tang. Learning neural generative
In International Conference on Learning
dynamics for molecular conformation generation.
Representations, 2020.
Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, and Jian Tang. Geodiff: A geometric
diffusion model for molecular conformation generation. arXiv preprint arXiv:2203.02923, 2022.
11
Preprint
Jason Yim, Brian L Trippe, Valentin De Bortoli, Emile Mathieu, Arnaud Doucet, Regina Barzilay,
and Tommi Jaakkola. Se (3) diffusion model with application to protein backbone generation.
arXiv preprint arXiv:2302.02277, 2023.
Haotian Zhang, Shengming Li, Jintu Zhang, Zhe Wang, Jike Wang, Dejun Jiang, Zhiwen Bian, Yixue
Zhang, Yafeng Deng, Jianfei Song, et al. Sdegen: learning to evolve molecular conformations from
thermodynamic noise for conformation generation. Chemical Science, 14(6):1557–1568, 2023.
Zihan Zhou and Tianshu Yu. Learning to decouple complex systems. In ICML, 2023.
Zihan Zhou, Ruiying Liu, Chaolong Ying, Ruimao Zhang, and Tianshu Yu. Molecular conformation
generation via shifting scores. arXiv preprint arXiv:2309.09985, 2023.
Jinhua Zhu, Yingce Xia, Chang Liu, Lijun Wu, Shufang Xie, Yusong Wang, Tong Wang, Tao Qin,
Wengang Zhou, Houqiang Li, et al. Direct molecular conformation generation. arXiv preprint
arXiv:2202.01356, 2022.
12
Preprint
A DIFFUSION SDES AND SCORE MATCHING OBJECTIVE
Rn following an unknown distribution q0, diffusion probabilistic
Given a random variable x0
∈
models (Song & Ermon, 2019; Ho et al., 2020a; Song et al., 2020b) define a forward process
xt}t∈[0,T ] following a stochastic differential equation (SDE)
{
dxt = f (t)xtdt + g(t)dwt, x0
q0,
∼
(17)
where wt ∈
process starting from time T to 0:
Rn is the standard Brownian motion. Such a forward process has an equivalent reverse
dxt = (cid:2)f (t)xt −
g2(t)
∇
x log qt(xt)(cid:3) dt + g(t)d ̄wt, xT ∼
q0T (xT |
x0),
(18)
and the marginal probability densities
probability flow ODE (Song et al., 2020b):
T
t=0 of the above SDE is the same as the following
q0t(xt)
}
{
dxt
dt
g2(t)
1
2
= f (t)xt −
q0T (xT |
This implies that if we can sample from q0T (xT )
x0) and solve Eq. 19, then the
obtained x0 follows the distribution of q0(x0). The only unknown terms in Eq. 19 are q0T (xT ) and
x0) converges to
x log qt(xt). By choosing some specific f (t) and g(t), the distribution q0T (xT |
∇
and qT is an easy distribution for sampling like Gaussian distribution. To model
qT (xT) as T
x log qt(xt), we can train a score-based model sθ∗ (xt, t) s.t.
x log qt(xt), xT ∼
q0T (xT |
→ ∞
x0).
∇
≈
(19)
∇
θ∗ = arg min
θ
(cid:110)
λtEx0∼q0(x0)Ext|x0
Et
(cid:104)
sθ(xt, t)
∥
x log q0t(xt |
x0)
∥
− ∇
(cid:105)(cid:111)
2
2
,
(20)
where λt = λ(t) : [0, T ]
equals
→
xt log qt(xt) for almost all xt and t (Song et al., 2020b).
∼
R++ is a weighting function, t
[0, T ], . The obtained model sθ∗ (xt, t)
∇
B DIFFUSION REVERSE ODE AND ACCELERATION
DPM solver (Lu et al., 2022a) is a high-order solver for the reverse diffusion ODE. Given a reverse
process
dxt
dt
= f (t)xt +
g2(t)
2σt
sθ (xt, t) , xT ∼ N
(cid:0)0, σ2
T I(cid:1)
where
f (t) =
d log αt
dt
,
g2(t) =
dσ2
t
dt −
2
d log αt
dt
σ2
t .
The exact solution of diffusion ODEs is
xt =
αt
αs
xs −
αt
(cid:90) λt
λs
e−λˆsθ (ˆxλ, λ) dλ,
(21)
(22)
(23)
(cid:0)xtλ(λ), tλ(λ)(cid:1) and tλ(
where λt = log (αt/σt) , ˆsθ (ˆxλ, λ) = sθ
) is the inverse function of λ(t) =
*
λt and satisfy t = tλ(λ(t)). If we apply a first-order Taylor expansion of ˆsθ (ˆxλ, λ) w.r.t. λ at λs,
we have
xt =
αt
αs
xs −
αtsθ (xs, s)
(cid:90) λt
λs
13
e−λdλ +
(cid:0)(λt −
O
λs)2(cid:1)
(24a)
Preprint
=
αt
αs
xs −
σt
(cid:0)eλt−λs
−
1(cid:1) sθ (xs, s) +
(cid:0)(λt −
O
λs)2(cid:1) .
In our case, we take α = 1 and Eq. 24 becomes
xt ≈
xs −
= xs −
σt
(σt −
(cid:16)
elog σs
σt
(cid:17)
1
−
σs) sθ (xs, s)
sθ (xs, s)
C INTRODUCTION OF DIFFERENTIAL GEOMETRY
(24b)
(25a)
(25b)
→
In differential geometry, we consider mappings between two man-
ifolds. Suppose that φ : M
N is a smooth map between smooth
manifolds. In our case, M denotes the manifold of pairwise dis-
tances and N denotes the manifold of SE(3)-invariant coordinates.
Then, φ maps a pairwise distances ̃d to a set of coordinates ̃
, i.e.
C
φ( ̃d) = ̃
.
C
The differential of φ at a point ̃d, denoted as dφ ̃d is the best linear
approximation of φ near ̃d. The differential is analogous to the total
derivative in calculus. Mathematically speaking, the differential dφ
is a linear mapping from the tangent space of M at ̃d to the tangent
space of N at φ( ̃d), which is dφ ̃d : T ̃dM
Tφ( ̃d)N .
If tangent vectors are defined as equivalence classes of the curves γ for which γ(0) = ̃d and
we consider γ(t) as the flow of the reversed diffusion process, then the differential is given by
γ)′(0), which means that dφ ̃d maps the reversed flow of pairwise distance to
dφ ̃d (γ′(0)) = (φ
the flow of the SE(3)-invariant coordinates. Hence, we write dφ ̃d
+
Figure 5: Mappings between
the manifolds of pairwise dis-
tances M and SE(3)-invariant
conformations N .
→
d)
(cid:17)
◦
(cid:16) ̃d +
∇
T M and ̃
+
d)
∇
C
∈
(cid:17)
̃C log pσ( ̃
=
d)
∇
C | C
̃d log pσ( ̃d
|
̃C log pσ( ̃
= ̃
C
T N .
)
C | C
) by linearity. Since
∈
̃d log pσ( ̃d
∇
̃d log pσ( ̃d
∇
|
|
Rn×3/ SE(3). We can choose πN as an identical mapping.
̃C log pσ( ̃
), where we assume that ̃d+
(cid:16)
C | C
∇
The above equation also implies that dφ ̃d
we use an n
3 matrix to embed
C ∈
D APPROXIMATION OF dφ( ˆd)
×
D.1 APPROXIMATION FORMULA
∇
̃d log pσ( ̃d
Mathematically speaking, the dimension of the tangent space at every point of a connected manifold
is the same as the dimension of the manifold itself. However, since there is no constraint on model's
d), we still consider the tangent space of pairwise distance manifold has the
output
|
dimension of n2 and we assume ̃d + δeuv ∈
dφ( ˆd) = dφ( ˆd) =
T ̃dM for all δ > 0. We consider πN ◦
ˆxi −
argmin
∥
ˆx1,...,ˆxM
̃
= [ ̃x1, . . . , ̃xn]⊤
C
πN ◦
ˆxj∥ −
Rn×3, we first consider ̃d + δeuv ∈
dφ( ̃d + δeuv) = [ˆx1, . . . , ˆxn]⊤ to be
T ̃dM and approximate the solution of
. Given a pairwise distance ̃d
M and associated coordinate
ˆdij
(cid:80)
(cid:17)2
i<j
∈
∈
(cid:16)
ˆxu = ̃xu +
ˆxv = ̃xv −
ˆxk = ̃xk,
2(n
δ
−
δ
λuv,
1)
λuv,
2(n
k
1)
−
= u, v.
where λuv = ̃xu− ̃xv
∥ ̃xu− ̃xv∥ .
14
̸
Preprint
Figure 6: The illustration of approximating the solution of dφ( ̃d + δeuv)
Note that we can also write the solution of above as πN ◦
dφ( ̃d + δeuv) = ̃
C
+ δ
2(n−1)
∂ ̃duv
∂ ̃C
, since
(
(
(
∂ ̃duv
∂ ̃
C
∂ ̃duv
∂ ̃
C
∂ ̃duv
∂ ̃
C
)u = (
)v = (
)k = (
∂
∥
∂
∥
∂
∥
̃xu −
∂ ̃
C
̃xu −
∂ ̃
C
̃xu −
∂ ̃
C
̃xv∥
)u =
̃xv∥
)v =
̃xv∥
)k =
∂
∂
∂
̃xu −
∥
∂ ̃xu
̃xu −
∥
∂ ̃xv
̃xu −
∂ ̃xk
∥
Since dφ( ˆd) is linear,
̃xv∥
=
̃xv∥
=
̃xu −
̃xu −
∥
̃xu −
̃xu −
∥
̃xv
̃xv∥
̃xv
̃xv∥
−
= λuv
=
λuv
−
(26a)
(26b)
= 0,
k
= u, v
(26c)
̃xv∥
πN ◦
dφ( ˆd) = dφ( ̃d +
(cid:88)
αijeij)
i,j
n2)dφ( ̃d) +
(cid:88)
i,j
= (1
−
dφ( ̃d + αijeij)
(cid:88)
αij
2(n
1)
−
= (1
n2) ̃
C
+ n2 ̃
C
−
= ̃
C
+
(cid:88)
αij
i,j
2(n
1)
−
+
i,j
∂ ̃dij
∂ ̃
C
,
∂ ̃dij
∂ ̃
C
and
̃C log pσ( ̃
C|C
∇
) = dφ ̃d(
∇
= dφ ̃d( ̃d +
(cid:88)
= ̃
C
+
̃d log pσ( ̃d
d))
|
̃d log pσ( ̃d
d))
|
log pσ( ̃d
d)
̃dij
|
1)
2(n
∇
∇
i,j
̃dij
(cid:88)
∇
=
i,j
−
log pσ( ̃d
|
1)
2(n
−
d)
∂ ̃dij
∂ ̃
C
dφ ̃d( ̃d)
̃
C
−
−
∂ ̃dij
∂ ̃
C
15
(27a)
(27b)
(27c)
(27d)
(28a)
(28b)
(28c)
(28d)
̃xu ̃xvˆxuˆxvδ2λuv−δ2λuv ̃xu ̃xu−δ2degreeuλuvδ2degreevλuv̸
Preprint
Finally, we have
Ct log q0t(
Ct) =
∇
(cid:88)
∇d(t)
ij
i,j
log q0t(dt |
1)
2(n
−
d0)
∂d(t)
ij
∂
Ct
(29)
D.2 ERROR BOUND ANALYSIS
We compute the maximum objective function value of (cid:80)
mation in the case of ˆd = ̃d+δeuv. Let
∼
denotes the neighbors of node i, S∅(i, j) =
that are nonadjacent to i and j, and degreei denote the degree of node i. We use ˆ
C
denote our approximated optimal solution, i.e. ˆ
C
denote the adjacent relation and SN (i) =
(i, j), q
(p, q)
{
ˆxj∥ −
δ
2(n−1)
= ̃
C
ˆxi −
+ (cid:80)
∂ ̃dij
∂ ̃C
(i, j)
ˆdij
i<j
̸∈
̸∈
i,j
p
}
∥
|
(cid:16)
(cid:17)2
under our approxi-
xj}
xi ∼
|
denote the set of nodes
= [ˆx1, . . . , ˆxn] to
(i, j)
{
. Formally, we have
ˆxi −
∥
ˆxj∥ −
(cid:17)2
ˆdij
min
x1,...,xn
(cid:16)
≤
ˆxu −
∥
ˆxv∥ −
ˆduv
+
(cid:88)
(i,j)∈SN (u)\{(u,v)}
(cid:88)
(cid:16)
i<j
(cid:17)2
+
xi −
∥
xj∥ −
(cid:16)
(cid:88)
(i,j)∈S∅(u,v)
(cid:16)
∥
ˆxi −
ˆxj∥ −
ˆdij
(cid:17)2
ˆdij
∥
ˆxi −
(cid:17)2
+
(cid:17)2
ˆdij
ˆxj∥ −
(cid:88)
(cid:16)
(cid:18)(cid:13)
(cid:13)
(cid:13)
(cid:13)
( ̃xu +
≤
2(n
δ
λuv)
1)
−
−
(cid:16)
(cid:88)
(i,j)∈S∅(u,v)
(cid:88)
̃xj∥ −
̃xi −
∥
(cid:18)(cid:13)
(cid:13)
(cid:13)
(cid:13)
( ̃xu +
(i,j)∈SN (u)\{(u,v)}
(cid:88)
(i,j)∈SN (v)\{(u,v)}
(cid:18)(cid:13)
(cid:13)
( ̃xv −
(cid:13)
(cid:13)
+
+
+
(cid:18)
(i,j)∈SN (v)\{(u,v)}
λuv)
(cid:13)
(cid:13)
(cid:13)
(cid:13) −
̃duv −
δ
(cid:19)2
δ
1)
−
2(n
( ̃xv −
(cid:17)2
̃dij
λuv)
̃xj
−
1)
(cid:19)2
̃duj
(cid:13)
(cid:13)
(cid:13)
(cid:13) −
λuv)
̃xj
−
1)
(cid:19)2
̃dvj
(cid:13)
(cid:13)
(cid:13)
(cid:13) −
δ
2(n
−
δ
2(n
−
(cid:19)2
δ
+ 0
̃xu −
∥
≤
̃xv∥ −
̃duv −
(cid:88)
δ
n
1 −
−
(cid:18)
+ max
±(i,j)
+ max
±(i,j)
̃xu −
∥
̃xj∥ ±
(cid:18)
̃xv −
∥
̃xj∥ ±
(cid:18)
(i,j)∈SN (u)\{(u,v)}
(cid:88)
(i,j)∈SN (v)\{(u,v)}
(cid:19)2
(cid:88)
δ2 +
=
=
≤
=
(cid:18) n
n
1
−
(cid:32)(cid:18) n
n
−
(cid:32)(cid:18) n
n
−
2n2 + n
2(n
−
1
(cid:19)2
(cid:19)2
1
+
+
1
1)2 δ2
−
(i,j)∈SN (u)\{(u,v)}
1)
(cid:33)
δ2
2(n
−
1
degreev −
1)2
4(n
−
(cid:33)
1
1)2
−
−
n
4(n
δ2
1
degreeu −
1)2 +
4(n
−
1
1)2 +
n
4(n
−
−
16
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
δ
δ
2(n
−
δ
2(n
−
(cid:19)2
(cid:19)2
̃duj
(cid:13)
(cid:13)
(cid:13)
(cid:13) −
λuv
1)
(cid:19)2
̃dvj
(cid:13)
(cid:13)
(cid:13)
(cid:13) −
λuv
1)
+
(cid:88)
(cid:18)
δ
(cid:19)2
(i,j)∈SN (v)\{(u,v)}
2(n
1)
−
(30a)
(30b)
(30c)
(30d)
(30e)
(30f)
(30g)
(30h)
(30i)
(30j)
(30k)
(30l)
(30m)
(30n)
Preprint
Hence, the approximated optimal value is bounded above by 2n2+n−1
2(n−1)2 δ2.
D.3 EXPERIMENTS OF APPROXIMATED OPTIMAL VALUE
Experiment settings. We randomly generate
∼
Uniform([10, 19]). We compute the adjacent matrix d of the obtained coordinates and randomly
perturb the adjacent matrix to obtain ˆd = d + δeuv. We aim to compare the magnitude of the optimal
values computed under different algorithms or approximations. The optimal value is defined as the
solution of the optimization problem f ( ˆd) = min
ˆx1,...,ˆxn
(0n×3, I) with n nodes, where n
Ci ∼ N
ˆdij
(cid:80)
(cid:17)2
i<j
(cid:16)
ˆxj∥ −
ˆxi −
∥
.
Algorithms. To our best knowledge, there is no simple algorithm for solving the metric MDS
ˆxj∥ −
problem ˆx1, . . . , ˆxn = argmin
ˆx1,...,ˆxn
inapplicable in such case since
is not differentiable at x = 0. Usual convergence theorems for
gradient methods are invalid under such cases and local minimum points do not need to satisfy the
stationary equations (De Leeuw, 2005). Hence, we slightly modify the gradient descent process to
. The usual gradient descent algorithm is
ˆxi −
∥
x
∥
ˆdij
(cid:80)
(cid:17)2
i<j
(cid:16)
∥
ˆC (t+1) = ˆC (t) +
ˆC(t)
∇
(cid:16)(cid:13)
(cid:13)ˆx(t)
(cid:13)
i −
(cid:88)
i<j
ˆx(t)
j + ε
(cid:17)2
,
ˆdij
(cid:13)
(cid:13)
(cid:13) −
(31)
for some sufficiently small ε > 0. Then, we set ˆC (0) = ̃C = [ ̃x1, . . . , ̃xn] as the initialized value and
apply the gradient descent algorithm. We visualize the magnitude of the MDS objective function
obtained at ˆ
G, ˆ
c-MDS, computed from the proposed approximation (Eq. 9), gradient descent
C
C
(Eq. 31) and the algorithm for the classic MDS problem, respectively. We also visualize the error
bound proved in Eq. 30. The results can be seen in Fig 7. The algorithm for the classic MDS problem
(c-MDS) is stated below (Wickelmaier, 2003):
approx, ˆ
C
• 1. Set up the squared proximity matrix D = (cid:2)d2
ij
(cid:3)
• 2. Apply double centering: B =
n is the number of objects, I is the n
ones.
−
1
2 P DP using the centering matrix P = I
n identity matrix, and Jn is an n
×
×
1
n Jn, where
−
n matrix of all
• 3. Determine the 3 largest eigenvalues λ1, λ2, λ3 and corresponding eigenvectors e1, e2, e3
of B.
• 4. Now,
= E3Λ1/2
3
matrix of 3 eigenvalues of B.
C
, where E3 is the matrix of 3 eigenvectors and Λ3 is the diagonal
Metric MDS and c-MDS seek to find
solution of c-MDS generally differs from the metric MDS.
= [x1, . . . , xn] such that
C
xi −
∥
xj∥ ≈
dij but the optimal
Experimental results. We see that our approximation leads to a much smaller loss than the c-
MDS's, and compared with the optimal value, the gap is acceptable. As there is still improvement
for optimal values, this further suggests that applying a more refined projection operator can yield
additional improvements in the model's performance (Zhou & Yu, 2023).
17
Preprint
Figure 7: Optimization loss of MDS w.r.t. different optimization algorithm. f ( ˆd) is the objective
function of the optimization problem.
E COMPUTATION OF
dt log q0t(dt
d0).
|
∇
∇dt log q0t(dt|
We consider the score of
when i.i.d. Gaussian noise is
d0) where dij =
injected to conformation coordinates. GeoDiff (Xu et al., 2022) naively assumes that the perturbed
distances follow a Gaussian distribution. In SDDiff (Zhou et al., 2023), authors proposed a shifting
d0). In this work, we consider both of
probability density to approximate the distribution of q0t(dt|
the above two modeling methods and train two separate models with their own loss function:
xi −
xj∥
∥
(cid:16)
L
θ; {σi}T
t=1
(cid:17)
≜ 1
T
T
(cid:88)
t=1
1
2
Epdata(d0)Eq0t(dt|d0) ∥sθ(dt, t) + σtdφdt (∇dt log q0t(dt|d0))∥2
2
(32)
GeoDiff: ∇dt log q0t(dt|d0) := −
dt − d0
σ2
t
SDDiff: ∇dt log q0t(dt|d0) :=
1 − e−σt/d0 (cid:17) 8
(cid:16)
dt
− 2
dt − d0
σ2
t
(33)
(34)
If a model sθ(dt, t) minimizes the above loss, then sθ(dt, t)
σt∇
≈ −
Ct log q0t(
Ct|C
0).
F FACTORS RELATED TO SCALE ksθ
In this section, we study factors that may influence the choice of scale ksθ . We mainly study factors
including prediction error, node number, and node degree.
F.1 SUPPLEMENTARY FOR POSITIVE CORRELATION BETWEEN PREDICTION ERROR AND
SCALE ksθ
(i)
Dataset settings. We develop datasets Qi =
that only contain one conformation of 20 nodes.
0 }
Each conformation is a 4-regular graph (so that SE(3)-invariant conformation and pairwise distance
(i)
i = 1, . . . , n. Thus, the ground truth of the denoising
manifolds are surjective) and
(0, I),
0 ∼ N
T
t=1 is chosen to be the same as that in the GeoDiff and we
process is fixed. The sigma scheduler
σt}
{
try to sample conformations in 100 steps.
{C
∀
C
Model settings. During the denoising process, our model has the access to the ground truth
d0 and following GeoDiff's assumption of the distance distribution, we want to develop a model
18
0.00.20.40.60.81.00.000.250.500.751.001.251.501.752.00f(d)/2G losscMDS lossapprox lossapprox loss upper boundPreprint
(cid:17)
(cid:16) dt−d0
σt
d0)) = dφ
∇dt log p0t(dt |
Normstd (dφ (dt −
. As discussed in Eq. 13, we cannot access
sθ(dt, t) = σtdφ (
the accurate information about the denoising timestamp during the denoising process, hence, we
d0)). Such assumption comes from the fact that the
assume that sθ(dt, t)
d0)) approximately
standard deviation of the score matching ground truth σtdφ (
∇dt log p0t(dt |
equals 1. Thus, the obtained model trends to output a score whose std equals 1. So, we force the
output std of our model to be 1. Also, we use a hyperparameter δ to add prediction errors by letting
d0) + εd(δ, t)(cid:1). But note that when δ = 0, there are still prediction
sθ(dt, t, δ) = Normstd
errors due to the approximated projection operator and the inaccurate distance distribution hypothesis.
Finally, we define εd(δ, t) = 2(sigmoid(σt
(cid:0)dφ (dt −
δ)-0. 5)δz, where z
(0, I).
≈
*
∼ N
Detailed settings of convergence. We find that even with access to the ground truth of d0, our
model cannot always converge to the ground truth at the end of the reverse process. Hence, we
only consider the convergence for most samples (90% samples). Given a noise level δ and ksθ , we
repeatedly apply the denoising process. If at time t0, at least 90% samples have converged, then we
say that under δ, ksθ , the model converges at time t0.
F.2 REVERSE FLOW ANALYSIS
d0
∥ * ∥
In the context of our investigation, we employ
∞ as a reduced-dimensional representation
dt −
∥
∥
of the reversed flow phenomenon, where dt denotes the edge lengths of the graph at time t, d0 denotes
the ground truth edge lengths and
∞ denotes the maximum difference. It is well-established that
the selection of the scale ksθ exerts a notable influence on the characteristics of the flow. Our primary
objective is to systematically investigate whether while maintaining a constant scale parameter ksθ ,
other variables such as the number of nodes and node degrees exhibit substantial alterations in the
reverse flow patterns. Should our findings indicate minimal variation in the reverse flow with respect
to these aforementioned factors, it would enable us to posit that the choice of scale ksθ is relatively
independent of their influence. We use the same settings of the sigma scheduler and the model, as
discussed in the Appendix. F.1 but develop different toy datasets that contain graphs of distinct node
numbers and distinct node degrees.
Dataset settings. We develop two datasets with one containing a fixed node number of [10, 20, 50,
100], and each graph is a 4-regular graph and the other contains conformations of 20 nodes, and each
graph is a k-regular graph, where k = 4, 5, 6.
Experimental results. We visualize the flow (represented by
∞) under different node
∥
numbers and node degrees and find that these two factors have a limited effect on the flow when
the scale ksθ is fixed. Results can be seen in Fig. 8a and 8b. We also visualize the reverse flow
of 4-regular graphs with 20 nodes under different prediction errors. Results are shown in Fig. 8c.
Compared with Fig. 8a and 8b, we can see that the flow under different settings of the model's error
shows great difference and we conclude that prediction error is the main factor that affects the choice
of scale ksθ .
dt −
d0
∥
G EXPERIMENT EXTENSION
G.1
SETTINGS
Evaluation. We use the COV and MAT metrics for Recall (R) and Precision (P) to evaluate the
diversity and quality of generated conformers. These metrics are built on the root-mean-square-
deviation (RMSD) of heavy atoms. COV can reflect the converge status of ground truth conformers,
and MAT denotes the average minimum RMSD. The calculation for COV-R and MAT-R is:
COV-R =
1
Sr|
|
{C ∈
Sr|
RMSD(
C
,
C
′) < τ,
′
∃C
∈
Sg}
, MAT-R =
1
Sr|
|
(cid:88)
C′∈Sg
RMSD(
C
′)
,
C
where Sg and Sr denote generated and ground truth conformations. Sweeping Sg and Sr, we obtain
the COV-P and MAT-P. The MAT is calculated under RMSD threshold τ . Following previous work,
we set τ = 0.5Å for GEOM-QM9 and τ = 1.25Å for GEOM-Drugs.
19
Preprint
(a) node number v.s. scale
(b) node degree v.s. scale
(c) model error v.s. scale
Figure 8: Ablation study of factors that may affect the scale ksθ . The y-axis denotes the flow
represented by
∞ and the x-axis denotes the denoising steps t. We can clearly see that the
d0
∥
prediction error greatly affects the reverse flow.
dt −
∥
Training details We adopt the same backbone network from GeoDiff. The backbone consists of
local and global parts. The local part is GIN (Xu et al., 2018) and the global part is SchNet (Schütt
et al., 2017). We trained the model on a single NVIDIA GeForce RTX 3090 GPU and Intel(R)
Xeon(R) Silver 4210R CPU @ 2.40GHz CPU. We use the Adam optimizer for training, with a
maximum of 1000 epochs. We set the learning rate to 0.001, and it decreases by a factor of 0.6
every 2 epochs. The batch size is 64. For SDDiff, the parameter only updates when loss satisfies
two conditions: loss of the global part is lower than 0.75 on QM9 dataset or 2 on Drugs dataset, and
total loss is lower than 10. We set the steps of the diffusion process to 5000, the noise scheduler to
βi) and βt = sigmoid(t). t is uniformly selected in [1e-7, 2e-3],
σt =
and the magnitude of σt is in the range of 0 to around 12.
where ̄αt = (cid:81)t
(cid:113) ̄αt
1− ̄αt
i(1
−
G.2 MORE HYPER-PARAMETER ANALYSIS
In Sec. 5.4 we have investigated the influence of the hyper-parameter in LD sampling and our fast
sampling. We conduct the same hyper-parameter analysis on QM9 dataset here. As shown in Fig. 9,
we can draw a similar conclusion, that when ksθ and h are over a certain value, the P-series metrics
20
1008060402000246810scale = 1.51008060402000246810scale = 21008060402000246810scale = 2.5Number of atoms1020501001008060402000246810scale = 1.51008060402000246810scale = 21008060402000246810scale = 2.5k-regular4561008060402000246810scale = 1.51008060402000246810scale = 21008060402000246810scale = 2.5Noise level1246Preprint
Figure 9: The influence of hyper-parameter, namely scale ksθ and step size h. Note that higher
values of COV in the row above are preferable, whereas in the row below, higher MAT values are
undesirable. Values falling below the defined thresholds (COV lower than 0.2 or MAT higher than
2.5) are disregarded and indicated as missing points in the figure.
become very poor. We think the reason is due to the low robustness of the network we use, details
have been introduced in Sec. 5.4.
G.3 MORE EXPERIMENTS IN FEWER STEPS
We have shown results on fewer steps for GeoDiff on Drugs dataset in Sec. 5.5 to illustrate that our
methods have a certain level of robustness. Here we report the more experiments in fewer steps in
Fig. 10.
21
12345scale0.8000.8250.8500.8750.900COV-R mean12345scale0.860.880.900.920.940.96COV-R median12345scale0.400.450.500.55COV-P mean12345scale0.350.400.450.50COV-P median12345scale0.30.40.50.6MAT-R mean12345scale0.30.40.50.6MAT-R median12345scale246MAT-P mean12345scale0.500.751.001.251.50MAT-P median0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step sizeHyper-parameter analysis of sampling methods on QM9 datasetFast sampling for GeoDiffLD samping for GeoDiff12345scale0.40.60.8COV-R mean12345scale0.850.900.95COV-R median12345scale0.300.350.400.450.500.55COV-P mean12345scale0.250.300.350.400.450.50COV-P median12345scale0.30.40.50.6MAT-R mean12345scale0.30.40.50.6MAT-R median12345scale0.751.001.251.501.75MAT-P mean12345scale0.500.751.001.251.501.75MAT-P median0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step size0.070.090.10.30.50.7step sizeHyper-parameter analysis of sampling methods on QM9 datasetFast sampling for SDDiffLD samping for SDDiffPreprint
Figure 10: Results of our fast sampling method in fewer steps. The results of LD sampling in 5000
steps are shown as dashed horizontal lines. Points with poor MAT metric (higher than 2.5) are
dropped in the figure.
22
2345scale0.840.860.880.90COV-R mean2345scale0.880.900.920.940.96COV-R median2345scale0.420.440.460.480.500.52COV-P mean2345scale0.3750.4000.4250.4500.4750.500COV-P median2345scale0.260.280.300.320.34MAT-R mean2345scale0.260.280.300.320.34MAT-R median2345scale0.500.751.001.251.501.752.00MAT-P mean2345scale0.60.81.01.2MAT-P medianFewer steps of fast sampling for GeoDiff on QM9 datasetOur method in 80 stepsOur method in 50 stepsOur method in 30 stepsLD sampling with 5000 stpes2345678scale0.00.20.40.6COV-R mean2345678scale0.00.20.40.60.8COV-R median2345678scale0.00.10.20.30.40.50.6COV-P mean2345678scale0.00.20.40.6COV-P median2345678scale1.21.41.61.82.0MAT-R mean2345678scale1.21.41.61.82.02.2MAT-R median2345678scale1.41.61.82.0MAT-P mean2345678scale1.21.41.61.82.02.2MAT-P medianFewer steps of fast sampling for SDDiff on Drugs datasetOur method in 80 stepsOur method in 50 stepsOur method in 30 stepsLD sampling with 5000 stpes2345scale0.20.40.60.8COV-R mean2345scale0.20.40.60.81.0COV-R median2345scale0.00.10.20.30.40.5COV-P mean2345scale0.00.10.20.30.40.5COV-P median2345scale0.30.40.50.60.7MAT-R mean2345scale0.30.40.50.60.7MAT-R median2345scale1.01.52.02.5MAT-P mean2345scale0.51.01.52.0MAT-P medianFewer steps of fast sampling for SDDiff on QM9 datasetOur method in 80 stepsOur method in 50 stepsOur method in 30 stepsLD sampling with 5000 stpesPreprint
H VISUALIZATION OF SAMPLING PROCESS
We visualize the generation process of an example conformer via our fast sampling process. As shown
in Fig. 11, the conformer will determine the basic structure in very early steps, and the structure will
undergo only minor adjustments in the subsequent majority of steps. This indicates that it is possible
to obtain a faster sampling method.
(a) Sampling process in 100 steps
23
Preprint
(b) Sampling process in 80 steps
(c) Sampling process in 50 steps
(d) Sampling process in 30 steps
Figure 11: Visualization of sampling process in different steps for GeoDiff on Drugs
24
|
|
http://arxiv.org/abs/2310.05988v1 | "2023-10-07T19:35:07" | "2023-10-07T19:35:07" | A Dual Latent State Learning Approach: Exploiting Regional Network
Similarities for QoS Prediction | Individual objects, whether users or services, within a specific region often
exhibit similar network states due to their shared origin from the same city or
autonomous system (AS). Despite this regional network similarity, many existing
techniques overlook its potential, resulting in subpar performance arising from
challenges such as data sparsity and label imbalance. In this paper, we
introduce the regional-based dual latent state learning network(R2SL), a novel
deep learning framework designed to overcome the pitfalls of traditional
individual object-based prediction techniques in Quality of Service (QoS)
prediction. Unlike its predecessors, R2SL captures the nuances of regional
network behavior by deriving two distinct regional network latent states: the
city-network latent state and the AS-network latent state. These states are
constructed utilizing aggregated data from common regions rather than
individual object data. Furthermore, R2SL adopts an enhanced Huber loss
function that adjusts its linear loss component, providing a remedy for
prevalent label imbalance issues. To cap off the prediction process, a
multi-scale perception network is leveraged to interpret the integrated feature
map, a fusion of regional network latent features and other pertinent
information, ultimately accomplishing the QoS prediction. Through rigorous
testing on real-world QoS datasets, R2SL demonstrates superior performance
compared to prevailing state-of-the-art methods. Our R2SL approach ushers in an
innovative avenue for precise QoS predictions by fully harnessing the regional
network similarities inherent in objects. | [
"Ziliang Wang",
"Xiaohong Zhang",
"Meng Yan"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.05988v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.05988v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | A Dual Latent State Learning Approach: Exploiting Regional
Network Similarities for QoS Prediction
Xiaohong Zhang*
Chongqing University
China, Chongqing
xhongz@cqu.edu.cn
Meng Yan
Chongqing University
China, Chongqing
mengy@cqu.edu.cn
Ziliang Wang
Chongqing University
Peking University
China, Chongqing
wangziliang@pku.edu.com
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
8
8
9
5
0
.
0
1
3
2
:
v
i
X
r
a
ABSTRACT
Individual objects, whether users or services, within a specific region
often exhibit similar network states due to their shared origin from
the same city or autonomous system (AS). Despite this regional
network similarity, many existing techniques overlook its potential,
resulting in subpar performance arising from challenges such as
data sparsity and label imbalance. In this paper, we introduce the
regional-based dual latent state learning network(R2SL), a novel
deep learning framework designed to overcome the pitfalls of tradi-
tional individual object-based prediction techniques in Quality of
Service (QoS) prediction. Unlike its predecessors, R2SL captures
the nuances of regional network behavior by deriving two distinct
regional network latent states: the city-network latent state and the
AS-network latent state. These states are constructed utilizing aggre-
gated data from common regions rather than individual object data.
Furthermore, R2SL adopts an enhanced Huber loss function that
adjusts its linear loss component, providing a remedy for prevalent
label imbalance issues. To cap off the prediction process, a multi-
scale perception network is leveraged to interpret the integrated
feature map, a fusion of regional network latent features and other
pertinent information, ultimately accomplishing the QoS prediction.
Through rigorous testing on real-world QoS datasets, R2SL demon-
strates superior performance compared to prevailing state-of-the-art
methods. Our R2SL approach ushers in an innovative avenue for
precise QoS predictions by fully harnessing the regional network
similarities inherent in objects.
CCS CONCEPTS
• Do Not Use This Code → Generate the Correct Terms for Your
Paper; Generate the Correct Terms for Your Paper; Generate the
Correct Terms for Your Paper; Generate the Correct Terms for Your
Paper.
KEYWORDS
Service recommendation, QoS prediction, Probabilistic network,
Deep supervision
ACM Reference Format:
Ziliang Wang, Xiaohong Zhang, and Meng Yan. 2018. A Dual Latent State
Learning Approach: Exploiting Regional Network Similarities for QoS Pre-
diction. In Proceedings of Make sure to enter the correct conference title
from your rights confirmation emai (Conference acronym 'XX). ACM, New
York, NY, USA, 9 pages. https://doi.org/XXXXXXX.XXXXXXX
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
2018. ACM ISBN 978-1-4503-XXXX-X/18/06. . . $15.00
https://doi.org/XXXXXXX.XXXXXXX
INTRODUCTION
1
In the modern era where "everything is a service," discerning how
to recommend optimal Web services to distinct users becomes
paramount[18, 33]. Concurrently, certain microservice optimiza-
tion methods necessitate precise predictive QoS modules[9, 19]. The
network states undeniably play a pivotal role in QoS prediction for
service recommendations. Yet, predicting QoS remains intricate,
primarily due to challenges in capturing most object network states
caused by financial and privacy constraints. Further compounding
the problem, QoS data is frequently characterized by sparsity and im-
balance, thus complicating predictions. Addressing these challenges,
our work introduces an innovative approach that models latent net-
work states regionally, deviating from conventional strategies that
emphasize known network state features or individual object-based
latent states.
Significant challenges like data sparsity and label imbalance sig-
nificantly impair QoS prediction accuracy. Data sparsity emerges
from the reality that despite the myriad of web services within the
recommendation system, users typically access only a subset, re-
sulting in sparse usage logs. Capturing network state details about
users or service providers becomes arduous due to privacy stip-
ulations and the associated high acquisition costs. Collaborative
filtering (CF) serves as a prevalent solution to tackle this issue in
QoS prediction[34]. While CF attempts to alleviate data sparsity
effects by identifying similar objects using available data, it tends
to disproportionately rely on location-based information, neglecting
substantial network state data. To delve deeper into network state
insights, several QoS prediction strategies emphasizing latent factors
(LF) have been proposed[15, 25]. Wang et al., for instance, utilized
a latent state learning model to discern the network latent states of
individual users and services[25]. However, these LF-centric strate-
gies grapple with challenges like the cold start issue, data sparsity,
and the intricate task of discerning latent user states, undermining
their efficacy.
The label imbalance dilemma originates from the disproportion-
ate QoS data representation: the majority stemming from standard
access procedures and only a fractional portion from abnormal ac-
cesses. For instance, the WS-Dream dataset's response time (RT)[32]
spans from 0s to 20s. A predominant portion of this data – over
98% – is concentrated in the 0s to 5s range, with merely 2% ex-
tending beyond 5s. Various remedies such as data augmentation,
re-sampling, and enhanced robustness loss functions have been
proposed to counter this issue[2, 13]. Techniques like leveraging
anomaly detection algorithms to eliminate outliers have also been
explored[2, 30]. Nonetheless, these methods often don't holistically
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Trovato and Tobin, et al.
c) Comprehensive experimentation evaluating the R2SL ap-
proach's effectiveness on real-world QoS datasets. Experi-
mental outcomes highlight R2SL's superior performance over
existing state-of-the-art QoS prediction methodologies. 1.
2 RELATED WORK
The existing body of work primarily hinges on two pivotal ap-
proaches for QoS prediction: Collaborative Filtering (CF) and Deep
Learning (DL) methods.
2.1 CF-Based Approaches
Collaborative Filtering (CF) remains a predominant strategy for QoS
prediction, where models draw insights from analogous objects to
forecast the QoS [3–5, 12, 32]. Broadly, CF methodologies bifurcate
into: memory-based and model-based methods.
Memory-based methods lean on QoS metrics (e.g., response time,
network throughput) or attributes (like distance) as differentiation
indices among objects. The cornerstone of these techniques lies in
computing similarities with the object in focus. Foundational CF
strategies encompass user-based (e.g., UPCC)[23], service-based
(e.g., IPCC)[22], and their hybrids, such as UIPCC [17]. Notably, ini-
tiatives like GroupLens and Bellcore harnessed similar user reviews
to prognosticate other users' service sentiments [10].
Conversely, model-based methods, especially matrix factorization
(MF), have gained traction. These entail factorizing a request matrix
into a product of two state matrices for QoS prediction. Illustratively,
Luo et al. innovated a non-negative matrix decomposition for swift
user-service matrix training [14]. Others, like He et al., advanced
hierarchical matrix factorization for clustered QoS matrices [7]. Also
noteworthy is the Factorization Machine (FM), a pervasive method
that discerns object feature interactions [20]. Variations of FM, such
as those proffered by Tang et al., married CF with FM to optimize
mobile service QoS predictions [24]. However, a recurring challenge
with these methods is their limited capacity to effectively harness
available information.
Recent advancements are gravitating towards exploiting con-
textual object information (like IP or location) to amplify predic-
tion accuracy. Yang et al.'s FM-based model, which utilized neigh-
boring user information, is a case in point [29]. Similarly, latent
factor-focused QoS prediction methods are gaining popularity for
their precision and scalability [6, 11, 21]. Luo et al.'s non-negative
constrained latent factor learning model (NLF) exemplifies this
shift [15].
2.2 Deep Learning-Based Approaches
The allure of Deep Learning (DL) for QoS prediction has surged
recently, given its capacity to directly infer the intricate relationships
between latent object features and QoS via deep neural networks.
Our R2SL method aligns with this paradigm, aspiring for utmost
predictive accuracy.
A plethora of research has been centered on harnessing extant
information for optimizing prediction precision. For instance, Zhou
et al.'s spatio-temporal model leveraged varying time segments to
refine QoS prediction accuracy [35]. Wu et al. tapped into contextual
1Our replication package: The code base address will be updated after the paper is
publicly available
Figure 1: Objects typically exhibit network-state similarity
within a region, especially if the regional network operates under
the same autonomous system (AS).
address the QoS imbalance, potentially hindering prediction perfor-
mance. Summarizing, the two principal challenges are:
(1) Data Sparsity: encompassing both feature sparsity of objects
and their QoS record sparsity.
(2) Label Imbalance: extreme QoS record imbalances that detri-
mentally impact prediction model performance.
To surmount these challenges, we introduce the regional net-
work latent state learning (R2SL) approach, which adeptly harnesses
regional network latent states to achieve precise QoS predictions.
R2SL encompasses two regional network latent state varieties: city-
network and AS-network. The city-network latent state derives in-
sights from QoS data corresponding to objects from a specific city,
while the AS-network latent state analyzes data from objects sharing
an autonomous system. Initially, R2SL employs latent probability
learning algorithms to frame regional network latent states, coun-
teracting data sparsity effects in QoS prediction. Subsequently, an
enhanced Huber loss function is deployed, modulating the linear
loss component to tackle label imbalances. Lastly, a multi-scale
convolution network extracts insights from the fused feature maps,
which consolidate known features and regional network latent states,
ensuring high-accuracy QoS predictions.
Our R2SL model offers two groundbreaking advances in QoS
prediction. Firstly, we introduce the innovative concept of modeling
regional latent network states as opposed to individual ones. This
strategy capitalizes on regional QoS data to counter data sparsity, as
illustrated in Fig. 1. Secondly, we present an optimized Huber loss
function to elevate QoS prediction accuracy. Through meticulous
analysis of QoS data label distributions, we fine-tuned the loss func-
tion to strike an optimal balance in the model's learning capability
for unbalanced labels, bolstering prediction performance.
In summary, this paper's primary contributions are:
a) Introduction of the R2SL approach, designed to harness re-
gional network latent states, addressing data sparsity and cold
start challenges in QoS prediction. By gleaning latent states
from diverse regional networks, R2SL promises enhanced
recommendation precision.
b) Analysis of QoS data distribution characteristics, pinpointing
label imbalance as a significant impediment. We introduce
an enhanced Huber loss function, aiming to combat label
imbalance and optimize prediction accuracy.
Regional A1UserServiceRegional A2Regional A3ASASASRegional-NetworkIndividual objects:A Dual Latent State Learning Approach: Exploiting Regional Network Similarities for QoS Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
information with their Deep Neural Model (DNM) for multi-metric
QoS forecasting [27]. Typically, DL necessitates an abundance of
valid information to decipher the nonlinear relationships between
features and anticipated labels. Novel endeavors, such as Xiong
et al.'s deep hybrid model, further excavate additional information
through a multi-layer perceptron (MLP)[28]. Others, like Wang et
al., elevate predictive accuracy by discerning users' and services'
varied latent states using an LDA-based pre-training mechanism[25].
Predominantly, current DL-based QoS methodologies orbit around
individual objects.
Our R2SL proposition draws inspiration from object-centric la-
tent state learning approaches [16, 25]. The distinguishing facet of
R2SL, in contrast to its peers, is its proficiency in discerning distinct
network states per region. This granularity allows R2SL to learn
latent states more effectively by capitalizing on a broader data swath.
3 APPROACH
The architecture of R2SL, depicted in Fig.2, comprises two primary
modules: regional network latent state learning and QoS prediction.
3.1 Regional Network Latent State Learning
3.1.1 Latent Regional State Variable.
Define L = (U , S,T , Las, Los, Cs, Ass, Lau, Lou, Cu, Asu ), where U
and S represent the user and service IDs, respectively. C and As
denote city code and AS code, respectively. T signifies the response
time for user Ui requesting Si , constrained to 0s < T < 20s. Ge-
ographical and network metadata for services are represented by
Las, Los, Cs, Ass , and by Lau, Lou, Cu, Asu for users. The latent states
set B = {bk } (where 1 < k < m) encompasses m latent state vari-
ables needed by the services' regional network and provided by the
users' regional network to conduct activities.
To determine the latent distribution of regional states, we employ
a latent state learning algorithm. This approach aids in discerning
the latent network states across diverse cities and AS. We initiate by
defining two distributions, Θs and Θu , symbolizing the AS-network
state frequencies for users and services respectively. Analogously,
for the city-network latent distribution, we have δs and δu . Their
mathematical representation is:
Θs, Θu, δu, δs ∼ Dirichlet (α)
(1)
To refine these frequency variables, we introduce the Dirichlet
Distribution characterized by parameter α. α acts as the starting
value of the potential state and, by default, is set to 5.
In essence, the prior distribution for the latent service-AS network
state is given by Q = (cid:206)m (Θsi )α −1÷B(α) and that for city-as states
is Q (Θu ; α). The procedure mirrors for δu and δs .
3.1.2 Assignment Probability on Latent Regional State.
The city network latent state for each user and service. Given
L and B, the probability of assigning latent city network state bi to
user network Cu j is defined by (cid:205)j=i
| bi ) = 1. Similarly, the
probability of assigning latent city network states bi to service city
Cs j is defined by P (s j | bi ).
n P (u j
The AS network potential state for each user and service. The
probability of assigning latent AS network states bi to user AS Asu j
is Pa (u j
| bi ) and the probability of assigning latent AS network
states bi to the service' Ass j is Pa (s j | bi ).
(2)
(3)
For presentation brevity, we denote P (u j
| bi ) by βs {i,j } and
P (u j | bi ) by βu {i,j } . As the figure shows, for AS latent states, there
are also βas and βau .
The matrix βs = βs {i,j } to denote the probability for assigning all
m latent city network states to all Cui and βu = βu {i,j } to denote the
probability for assigning all m latent service network states to all
Csi .Similarly, we have βau for ASu and βas for ASs .
3.1.3 Latent Parameters for RT.
To model the nuanced influence of various regional state fre-
quencies and assignments on QoS, we identify primary contributing
factors that are the statistical properties of RT; these are termed as
the Latent Parameters for RT.
Central to various QoS metrics is the step of sampling QoS value
Ti given the i-th QoS record L. In our discussion, Ti represents the
response time, although other metrics can be substituted. The obser-
vation value T is susceptible to changes in the network states. Let Φ
represent the probability density function based on the exponential
distribution:
Φ(Ti, λi,j,k ) = λi,j,ke (−Ti ∗λi,j,k )
where
λ−1
i,j,k =
(cid:40)W uiW s j
W uiW s jw else
if Ti < η
Here, i stands for the user's city code (or AS code) and j for the
service's city (or AS code) in the i-th record. Both Wu and Ws
represent the complexity coefficients related to the QoS for users
and services, respectively. They are initialized to a value of 10. The
constant η defaults to 5, while w, a trainable penalty coefficient,
starts with an initial value of 50.
3.1.4 State Sampling.
City network state sampling: City network state sampling:
Our analysis follows this sampling methodology: the latent state
originates from a state set of magnitude m, drawn in accordance
with the frequency Θu . Explicitly, the probability of latent states
associated with ui is denoted as Zu :
Zu |Θu ∼ Discrete (Θu )
(4)
In a similar vein, the probability of the latent state associated with si
is expressed as Zs :
Zs |Θs ∼ Discrete (Θs )
AS network state sampling: Analogous computations yield:
Ts |δs ∼ Dirichlet (δs )
For the user's AS-network Asui , we have:
Tu |δu ∼ Dirichlet (δu )
(5)
(6)
(7)
3.1.5 City/AS latent state Assignment.
Then we assign the probability of the network state Zu to user's
city-network state and assigning service's city-network Zs for each
QoS record. To model the relation between the states Zu and Zs ,
we use the assignment probability βs as the parameter. The service's
city Cs j with network states Zs {i } is sampled from the following
distribution:
Cs |Zs, βs ∼ Discrete (βs {Zs } )
(8)
It means that the conditional probability of Cs given the network
state zsi is exactly βs {Zs } .
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Trovato and Tobin, et al.
Figure 2: The R2SL architecture: regional network latent state learning (highlighted in orange) and the multi-scale convolutional
prediction network. c○ indicates concatenation operations.
Similarly, we introduce the user's city-network latent state assign-
where
ment probability βu to get the conditional probability
Cu |Zu, βu ∼ Discrete (βu {Zu } )
(9)
βs and βu have size nu x m and ns x m respectively with m indepen-
dent mixture ability components. nu and ns are the number of cities
where the user is located and the number of cities where the service
is located Similarly, for AS-Network, we have Aau , Aas .
3.1.6 Quality of Service Sampling.
The most important step is sampling response time Ti given the i
QoS record L. Ti as the object of observation is affected by differ-
ent factors of users and services. For each record, the conditional
probability is used to represent its distribution:
Ti |Zu, Zs, Aau , Aas ,Wu,Ws, w ∼ Φ(Ti ; λi,j,k )
(10)
where f is the exponential distribution whose expectation is Φ as
defined in eq 2.
3.1.7 Parameter estimation.
City-network Latent State. The Λ(βu, βs, Θu, Θs, w,Wu,Ws ) is
the set of parameters for city-network latent state. To complete the
parameter estimation process, R2SL uses the maximum a posteriori
(MAP) algorithm. The distribution P (Λ|L) is learned by the true
label L. The calculation process is as follows:
τi,j,k = βu{ j,Cui }βs { j,Csi }Θu{ j }Θs {k }
1
B (M )
m
(cid:214)
i=1
(Θs {i }Θs {i } )M −1
(12)
Where Cui and Csi represent the city code or AS code of the i-th
QoS recorded In order to estimate the parameter set {Θu, Θs, Cu, Cs },
the expectation-maximization (EM) algorithm is used, At the same
time, the set {Wu,Ws, w } are estimated with the gradient descent
(GD) algorithm.
AS-network Latent State. Γ(δu, δs, βau, βas, wa,Wua ,Wsa ) is a set
of parameters for AS-network latent state. The specific calculation
process is as follows:
Pa (φ |L) =
n
(cid:214)
m
∑︁
m
∑︁
i=1
j=1
k=1
Φ(Ti ; λi,j,k )τi,j,k
(13)
where
τi,j,k = βau { j,Asui } βas { j,Assi }δu{ j }δs {k }
1
B (M )
m
(cid:214)
(δs {i }δs {i } )M −1
i=1
(14)
In Algorithm 1, we update the probability distribution of latent
network state:
F t
i,j,k = P (Cui, tk |Cui, Csi, ti, Γ)
= τi,j,k Φ(Ti j ; λi,j,k )
(15)
P (Λ|L) =
n
(cid:214)
m
∑︁
m
∑︁
i=1
j=1
k=1
Φ(Ti ; λi,j,k )τi,j,k
(11)
We use maximizing the condition expectation to update parameters
Γ.
Θt +1
s
, Θt +1
u , βt +1
s
, βt +1
u = maxT (Γ|Γt )
(16)
Linear layerKnow FeaturesFusion Feature MapAAAAuuAAAAssRRRRCCssRRRRββAAnnββAA2ββAA1...ββummnnmmββssCRegional Network Latent State Learningββnnββuu2ββuu1...ββaassnnββaass2ββaass1...ββauunnββauu2ββauu1...CCuuLinear layerθθuuθθAAδδssδδuuZZAAiiZZuuiiTAAiiTuuiiOutputAS-network latent stateCity-network latent stateIDLongitudeLatitudeIDLongitudeLatitudeCityASCityASService:Cov 5x1Cov 5x3Cov 5x5User:ββaassββauuCMulti-scale Convolutional Prediction NetworkFlattenFlattenFlattenA Dual Latent State Learning Approach: Exploiting Regional Network Similarities for QoS Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Algorithm 1 Network Latent State Learning Algorithm
Require: L
Ensure: (βau, βas , βu, βs )
for H = 1 to 2 do
while τt +1/τt > γ do
for i = 1 to n do
for j = 1 to m do
for k = 1 to m do
Gt
i,j,k = τi,j,k Φ(Ti ; λi,j,k )
end for
end for
end for
for i = 1 to m do
Θt +1
u =
Θt +1
=
s
if H==1 then
(cid:205)m
(m−1)n+(cid:205)n
i′
k=1
=1
n (m (m−1)+1)
(cid:205)m
(m−1)n+(cid:205)n
i′
j =1
=1
n (m (m−1)+1)
Gt
i′ ,i,k
Gt
i′ ,j,i
(cid:205)m
k=1
Gt
i′ ,i,k
I (Cui = q)
(cid:205)m
j=1
Gt
i′ ,j,i
I (Csi = p)
(cid:205)m
k=1
Gt
i′ ,i,k
I (Asui = q)
(cid:205)m
j=1
Gt
i′ ,j,i
I (Assi = p)
for q = 1 to ncu do
u {i,q } = (cid:205)n
βt +1
i′ =1
end for
for p = 1 to ncs do
s {i,q } = (cid:205)n
βt +1
i′ =1
end for
end if
if H==2 then
for q = 1 to nau do
au {i,q } = (cid:205)n
βt +1
i′ =1
end for
for p = 1 to nas do
as {i,q } = (cid:205)n
βt +1
i′ =1
end for
end if
end for
if H==1 then
for q = 1 to ncu do
i + ρ ∗
= W ut
W ut +1
i
end for
for q = 1 to ncs do
W st +1
i
= W st
i + ρ ∗
∂P (Γ |L)t
∂W ut
i
∂P (Γ |L)t
∂W st
i
end for
t = t + 1
wt +1 = wt + ρ ∗
τt +1 = P (Γ|L)
∂P (Γ |L)t
∂wt
end if
if H==2 then
for q = 1 to ncu do
i + ρ ∗
= W ut
W ut +1
i
end for
for q = 1 to ncs do
ai = W st
W st +1
ai + ρ ∗
∂P (Γ |L)t
∂W ut
i
∂P (Γ |L)t
∂W st
ai
end for
t = t + 1
wt +1
a = wt + ρ ∗
τt +1 = P (Γ|L)
∂P (Γ |L)t
∂wt
a
end if
end while
end for
return (βau, βas ,βu, βs )
T (Γ |Γt ) =
=
n
∑︁
m
∑︁
m
∑︁
i=1
n
∑︁
j =1
m
∑︁
k=1
m
∑︁
i=1
j =1
k=1
log (P (Γ |Q ) )F t
i,j,k
log (τi,j,k Φ(Ti j ; λi,j,k ) )F t
i,j,k
Then we have:
Θt +1
s
= argΘumaxT (Γ|Γt )
(cid:205)m
(cid:205)n
i′ =1
=
+ (m − 1)n
k=1
F t
i′ ,i,k
n(m(m − 1) + 1)
(17)
(18)
Similarly, by the derivative calculation, we update Θt +1
consider βu , with the constraint (cid:205)nu
solving:
u . Next, we
j βu{ j,q } = 1. We update βu by
βt +1
u j,p =argβu
n
∑︁
maxT (Γ|Γt )
m
∑︁
=
F t
i,j,k I (Cui = q)
Similarly, for βs :
i=1
k=1
maxT (Γ|Λt )
βt +1
sk,q =argβs
n
∑︁
=
m
∑︁
i=1
j=1
F t
i,j,k I (Csi = p)
(19)
(20)
where I (Cui = q) means that the final value of the function is
1 when user's city code is equal to q and 0 otherwise; I (Csi = q)
means that the value of the function is 1 when service's city code is
equal to p and 0 otherwise. Finally, we obtain the user city-network
latent state distribution βu and the service city-network latent state
distribution βs through Algorithm 1. For AS-network latent state
learning, we replace the city information in Algorithm 1 with the
AS information and obtain βau , βas by the same calculation process.
3.2 QoS Prediction
Feature Embedding. For deep neural networks to effectively learn
prominent features, we input identifiers such as the user ID, user's
city code, AS code, service ID, service's city code, and AS code
into the embedding layer provided by TensorFlow. Conceptually, the
embedding layer can be regarded as a linear layer where the bias is 0
[12]. Using this approach, the distinguishable features (i.e., ID, city
code, and AS code) are mapped into distinct vectors.
Known Feature. We create the integrated known feature map by
embedding the known features as discussed in L(Sec.3.1.1). The
dimensions of this known feature map are defined as:
KF =
(cid:20)Ik
u , Lak
s , Lak
Ik
u, Lok
s , Lok
u, U k
s , U k
u , Ask
u
s , Ask
s
(cid:21)
(21)
Regional Network Latent States Feature. To construct the latent
states map, we employ city-network latent features combined with
AS-network latent states. By default in the R2SL framework, the
model extracts m latent states for each region, with m defaulting to
5. The impacts of varying m and related parameters are elaborated
upon in Sec.5.4. Thus, the dimensions of the latent states map are
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Trovato and Tobin, et al.
4 × m:
LF =
βk
,
u,1
βk
,
s,1
βk
,
au,1
βk
,
as,1
βk
,
u,2
βk
,
s,2
βk
,
au,2
βk
,
as,2
Fuse Feature Map. By integrating latent state features with known
features, we derive the fused feature map. The resulting dimensions
of this map are 6 × m.
βk
u,m
βk
s,m
βk
au,m
βk
as,m
* * *
* * *
* * *
* * *
(22)
O =
(cid:21)
(cid:20)KF
LF
(23)
Adjustable Multi-scale Convolutional Network. Our approach
extracts features via a Adjustable multi-scale convolutional network,
which enables extraction from varying perspectives of the fused
features. The kernel size will change adaptively according to the
number of latent network state you set.
Xi = f (O; wi ), i = 1, 2, 3.
(24)
Here, wi denotes a 2-dimensional convolutional kernel. The kernels
for the three convolutional networks are defined as mx1, mx3, and
mx5, respectively.
Subsequently, we integrate the fusion features with sampling
features and channel them through a convolutional layer. The final
QoS prediction is achieved via a fully connected network:
x = F (X1) ⊕ F (X2) ⊕ F (X3).
ˆy = f [2v,2v−1,2v−2,1] (x; Wx ).
(26)
where Φ is represents the mergence operation. F is represents the
flatten operation by Flatten of Keras. f [2v,2v−1,2v−2,1] denotes the
fully connected layer, V is the count of neurons in this layer, and ˆy
the prediction value.
(25)
3.3 E-Huber Loss Function
For QoS prediction, the Mean Absolute Error (MAE) loss function
is prevalently employed. The MAE loss function directs the model
to concentrate on normal values, while being minimally affected
by outliers. Some research has adopted the Huber loss to enhance
the model's attention to outliers. Broadly speaking, the Huber loss
demonstrates higher sensitivity to outliers compared to the MAE
loss and exhibits greater robustness than the Root Mean Square Error
(RMSE) loss.
In our exploration of QoS data distribution detailed in Sec. 4,
we discerned that the linear component of the Huber loss remains
significantly large, causing the model to still not adequately focus on
outliers. R2SL addresses this by re-weighting the linear component
of the Huber loss function in accordance with the intrinsic character-
istics of the QoS data distribution. The novel loss function, termed
the E-Huber loss, is adept at capturing the extended tail of QoS data.
The E-Huber loss function between y and ˆy is given by:
E − Huberloss (y, ˆy) =
1
2 (y − ˆy)2
(cid:26)
ψ (ς |y − ˆy|abs − 1
2
i f |y − ˆy|abs < ς,
otherwise.
ς 2)
(27)
Here, y represents the actual label, ˆy is the predicted value, and ς
is the Huber loss hyperparameter, defaulting to 0.5.
Motivation and Improvement. The Huber loss function boasts
enhanced resilience to outliers as opposed to both MAE and MSE
Table 1: Division of all designed dataset cases.
No.
D1.1
D1.2
D1.3
D1.4
D1.5
Density
0.02
0.04
0.06
0.08
0.10
Train:Test:Valid
2%:78%:20%
4%:76%:20%
6%:74% :20%
8%:72% :20%
10%:70% :20%
Train
37,375
74,969
112,016
150,071
186,059
Test
1,310,535
1,572,292
1,206,517
1,172,461
1,140,269
Validation
369,638
369,638
369,638
369,638
369,638
(a) QoS data distribution
(b) Data distribution of five user
(c) A user accesses service 0-1000
(d) User 0-350 accesses the service A
Figure 3: QoS distribution of datasets
loss functions. As per its definition, Huber loss equates to RMSE
when the error is smaller than ς. Conversely, for errors surpassing ς,
the loss corresponds to MAE. Nonetheless, extreme values in QoS
data render the Huber loss suboptimal for directing model training.
For instance, a long-tail label (e.g., 20s) might yield a linear loss
exceeding 15, while a standard label (e.g., 1.5s) might result in
an MSE loss approaching 0.25. This pronounced disparity causes
the model to be disproportionately swayed by long-tail labels. To
mitigate this, we introduced a weighting factor to the linear loss
segment. Manipulating this coefficient's value permits the model
to more proficiently characterize the long-tail labels. Therefore,
diverging from the traditional Huber loss function, ψ acts as the
weight for the linear loss component, and is set at 0.05 in this paper.
4 STUDY SETUP
4.1 Datasets
We conducted validation experiments on publicly available bench-
mark datasets. The QoS dataset, termed WS-Dream, contains service
data harvested from real-world web systems as detailed by [32]. As
depicted in Tab. 2, this dataset, concerning response time, encom-
passes over 1,900,000 web service request records.
Of significance, the dataset utilized in this research is derived
from the most recent investigation by [30], which refines the WS-
Dream data by removing outliers. Adhering to their methodology,
we employed the iForest (isolation forest) approach for outlier detec-
tion, maintaining the detection parameters consistent with [30]. The
threshold for outlier scoring is in alignment with [30], set at 0.1.
For a comprehensive analysis, the dataset was segmented into
five divisions, as presented in Tab. 3. These divisions were made
5 H F R U G 5 7A Dual Latent State Learning Approach: Exploiting Regional Network Similarities for QoS Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
to emulate data sparsity scenarios in real-world production envi-
ronments and to ensure robust comparative experimentation. The
data distribution for the WS-Dream dataset is depicted in Fig.3. A
conspicuous observation from this figure is the pronounced label
imbalance within the QoS dataset.
Fig.3(a) delineates the QoS records of 50 users, chosen randomly
from the WS-Dream dataset, constituting 277,615 QoS record values.
The data exhibits a mean of 0.770 and a variance of 3.454. Delving
deeper, 95.10% of the labels register values below 5, while the
remaining 4.90% exceed this value. Fig.3(b) catalogues the request
records of 5825 services sourced from five users. It's evident that
the response time for a preponderant number of requests is under 5s.
Fig.3(c) showcases the response time for user A when accessing
services ranging from 0 to 1000. Predominantly, user A achieves ac-
cess within 4s, yet there are certain services where the response time
overshoots 10s. Conversely, Fig.3(d) demonstrates that for Service
S, while the majority of user response times hover below 2.5s, some
instances report times exceeding 10s. This underscores the influence
of both user and service network states on the resultant quality of
web requests.
4.2 Evaluation Metrics
The accuracy of the QoS prediction is an important criterion for
evaluating the performance of the model. Two metrics (i.e. MAE
and RMSE) are commonly used to measure accuracy in most QoS
prediction studies [30]. The mean absolute error function (MAE) is
defined as follows:
MAE =
(cid:16)(cid:205)
i,j
(cid:17)
(cid:12)
(cid:12)ri,j − ˆri,j (cid:12)
N
(cid:12)abs
(28)
where ri,j is the real QoS value (e.g., RT or TP) and ˆri,j is the
predicted value from predictive models. The root mean squared error
(RMSE) is defined as follows
RMSE =
√︂ (cid:16)(cid:205)i,j (ri,j − ˆri,j ) 2(cid:17)
N
(29)
where N is the count of records. For either the MAE indicator or the
RMSE indicator, a lower value means higher predictive accuracy.
4.3 Baseline Methods
We compare our R2SL approach with the following these meth-
ods:IPCC [1],UPCC [22], UIPCC [32], HMF [8], LDCF [31], CMF [30],
HSA-Net [25],D2E-LF[26],NCRL [36].
In all experimental results, each method will be run five times and
the results will be averaged for a fair comparison and other settings
remain the same as CMF [30]. We benchmark R2SL against six
baselines, encompassing both traditional CF-based algorithms and
cutting-edge deep learning approaches. Specifically, LDCF repre-
sents the latest in QoS prediction, leveraging collaborative filtering
of location data. For our experiments, LDCF is configured as de-
scribed in its source paper. CMF, another contemporary method
focusing on outlier-based QoS prediction, provided the experimental
dataset. It, too, is set with its default parameters as specified in its
original publication. HSA-Net, a state-of-the-art latent state-based
QoS prediction model, is trained using parameters initially proposed
to discern user and service latent states.
4.4 Research Questions
Through rigorous experiments, this section intends to unveil the
relative merits of our model, while elucidating the underlying rea-
sons for its exemplary performance. We are particularly focused on
addressing the ensuing research queries:
RQ1: How does R2SL approach compare to the current state of the
art baselines in terms of QoS prediction?
RQ2: What is the effect of different latent region states on the
prediction performance?
RQ3: What is the impact of this E-huber loss on the prediction
performance?
5 EXPERIMENTS
In this section, we conduct thorough experiments to evaluate the
prediction performance of R2SL against state-of-the-art baselines.
We also delve into the influence of various modules and parameters
on R2SL's performance through ablation studies.
5.1 RQ1: Prediction Performance Comparison
As shown in Table 4, in machine learning-based models, most of
the collaborative prediction algorithm models exhibit similar pre-
dictive capabilities. When considering CMF, it outperforms HMF
in terms of RMSE and MAE metrics, owing to CMF's ability to
concurrently utilize contextual data rather than relying solely on
QoS-based collaborative filtering. D2E-LF is the latest collaborative
filtering algorithm with impressive training and prediction speeds,
but it is limited by the extreme sparsity of the data, resulting in lower
predictive accuracy on this dataset.
NCRL is the latest QoS prediction method based on deep learn-
ing, which maximizes the use of known features to achieve high
prediction accuracy. CMF, innovating with its outlier optimization
approach, and HSA-Net, capitalizing on deep learning with latent
states, both present impressive results. CMF not only excels in
predictive performance among non-deep models but also boasts a
streamlined computational process. When juxtaposed with HSA-Net,
the top performer among our baselines, R2SL achieves reductions
of 14.17%, 17.03%, 11.32%, 11.56%, and 14.86% in MAE, and
13.06%, 11.76%, 9.62%, 20.91%, and 18.86% in RMSE. On the
QoS dataset, R2SL's proficiency in discerning high-dimensional la-
tent distributions is evident, outpacing HSA-Net, which employs a
latent state learning approach for accuracy enhancement.
Result
Table 4 underscores that R2SL consistently yields lower
MAE and RMSE metrics compared to other methodologies
across all evaluated scenarios.
5.2 RQ2: The Effect of Network Latent States
To discern the influence of network latent states on prediction per-
formance, we instituted four comparative experiments:
a) R2SL: Employs the default state fusion map encompassing all
known features and latent states.
b) R2SL w/o C: Excludes city-network latent states from the
R2SL's feature fusion map.
c) R2SL w/o A: Omits AS-network latent states from the R2SL's
feature fusion map.
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Trovato and Tobin, et al.
Table 2: Experimental Results
Method
UPCC
IPCC
UIPCC
D2E-LF
HMF
LDCF
CMF
NCRL
HSA-Net
R2SL
D1.1
RMSE
1.022
1.121
1.075
1.638
0.674
0.987
0.657
0.953
0.558
0.440
MAE
0.542
0.520
0.506
0.653
0.349
0.349
0.327
0.312
0.182
0.151
D1.2
RMSE
0.820
0.900
0.878
1.577
0.579
0.794
0.605
0.772
0.495
0.393
MAE
0.466
0.473
0.462
0.633
0.277
0.279
0.294
0.252
0.159
0.124
D1.3
RMSE
0.787
0.838
0.820
1.564
0.551
0.751
0.536
0.722
0.470
0.359
MAE
0.428
0.437
0.427
0.607
0.261
0.247
0.250
0.221
0.128
0.114
D1.4
RMSE
0.754
0.829
0.808
1.563
0.532
0.711
0.496
0.662
0.448
0.342
MAE
0.389
0.427
0.415
0.600
0.256
0.240
0.231
0.201
0.128
0.109
D1.5
RMSE
1.317
1.342
1.329
1.556
0.526
0.692
0.461
0.660
0.442
0.335
MAE
0.555
0.596
0.584
0.590
0.256
0.213
0.205
0.182
0.126
0.104
5.3 RQ3: Loss Function for Data Imbalance
To ascertain the efficacy of our introduced E-Huber loss function, we
employed diverse loss functions on the standard R2SL network with
the D1.1 dataset. Throughout the evaluation, all parameters remained
consistent, defaulting to their standard values. The hyperparameter δ
for the Huber loss was calibrated identically to that of the E-Huber
loss, set at δ = 0.5. We conducted experiments using MAE, MSE,
Huber loss and E-Huber loss, respectively.
The MAE and MSE loss functions were derived from the standard
formulations provided in TensorFlow.
Employing the D1.1 dataset, we gauged the merit of the proposed
E-Huber loss function vis-à-vis the standard R2SL network. Our find-
ings indicated that the MSE loss trailed in effectiveness. Both MAE
and Huber loss exhibited akin trajectories. E-Huber loss excelled, a
consequence of the dataset predominantly featuring brief response
durations, interspersed with rare, extended exceptions. While the
Huber loss manifested a diminished sensitivity to outliers compared
to the MSE loss and showcased greater resilience than the MAE loss,
the E-Huber loss adeptly amalgamated the strengths of both, leading
in both MAE and RMSE performance metrics.
(a) MAE
(b) RMSE
Figure 4: The results for different regional network states
(a) MAE
(b) RMSE
Figure 5: The results of R2SL with different loss function
Result
d) R2SL w/o H: Removes all latent states from the R2SL's feature
fusion map.
As illustrated in Fig. 4, R2SL demonstrates a prediction perfor-
mance that outstrips the rest. Specifically, experiments a), b), and
c) exhibit analogous results. Experiment d), by virtue of including
all the network latent states found in a), b), and c), can harness
a richer set of network state data for refined prediction accuracy.
Additionally, d) proves especially potent in scenarios characterized
by sparser training data. Contrastingly, a) which relies solely on
known data points, underperforms in both MAE and RMSE metrics
when set against its latent state-utilizing counterparts. These findings
underscore the pivotal role latent states play as bolstering features
for QoS prediction.
Result
Network latent states, especially at the regional level, sig-
nificantly enhance QoS prediction accuracy. R2SL, by in-
tegrating both city-network and AS latent states, achieves
unmatched predictive precision.
In synthesis, the E-Huber loss function eclipses its counter-
parts. Consequently, we adopt the E-Huber loss function
throughout this paper.
6 CONCLUSION
This paper has elucidated challenges inherent in QoS prediction,
pinpointing two predominant issues: data sparsity and label imbal-
ance. Specifically, the dearth of user data has curtailed the efficacy
of prior latent factor-based prediction techniques. Concurrently, la-
bel imbalance can compromise the precision of deep models when
discerning the interplay between features and QoS. In response to
these impediments, we postulate a region-centric network similarity
hypothesis and put forth the Regional Network Latent State Learning
Network (R2SL) model. And it deploys an enhanced loss function
to redress label imbalance. Our empirical analyses attest to R2SL's
superior performance over contemporary QoS prediction methods,
registering an average decrement in MAE error of 13.78% when
benchmarked against prevailing datasets. Looking ahead, we intend
to devise even more potent prediction algorithms to bolster accuracy
and accommodate expansive datasets. We are also poised to weave
' H Q V L W \ 0 $ (R2SLW/O AR2SLW/O HR2SLR2SLW/O C ' H Q V L W \ 5 0 6 (R2SLR2SL W/O CR2SL W/O AR2SL W/O H ' H Q V L W \ 0 $ ( 0 $ ( 0 6 ( + X E ( + X E ' H Q V L W \ 5 0 6 ( 0 $ ( 0 6 ( + X E ( + X EA Dual Latent State Learning Approach: Exploiting Regional Network Similarities for QoS Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
IEEE Transactions on Services Computing (2018).
[22] Badrul Sarwar, George Karypis, Joseph Konstan, and John Riedl. 2001. Item-
based collaborative filtering recommendation algorithms. In Proceedings of the
10th international conference on World Wide Web. 285–295.
[23] Zhenhua Tan and Liangliang He. 2017. An efficient similarity measure for user-
based collaborative filtering recommender systems inspired by the physical reso-
nance principle. IEEE Access 5 (2017), 27211–27228.
[24] M. Tang, W. Liang, Y. Yang, and J. Xie. 2019. A Factorization Machine-based
QoS Prediction Approach for Mobile Service Selection. IEEE Access (2019),
1–1.
[25] Ziliang Wang, Xiaohong Zhang, Meng Yan, Ling Xu, and Dan Yang. 2021. HSA-
Net: Hidden-State-Aware Networks for High-Precision QoS Prediction. IEEE
Transactions on Parallel and Distributed Systems 33, 6 (2021), 1421–1435.
[26] Di Wu, Peng Zhang, Yi He, and Xin Luo. 2022. A double-space and double-norm
ensembled latent factor model for highly accurate web service QoS prediction.
IEEE Transactions on Services Computing 16, 2 (2022), 802–814.
[27] Hao Wu, Zhengxin Zhang, Jiacheng Luo, Kun Yue, and Ching-Hsien Hsu. 2021.
Multiple Attributes QoS Prediction via Deep Neural Model with Contexts*. IEEE
Transactions on Services Computing 14, 4 (2021), 1084–1096. https://doi.org/10.
1109/TSC.2018.2859986
[28] Ruibin Xiong, Jian Wang, Neng Zhang, and Yutao Ma. 2018. Deep hybrid
collaborative filtering for web service recommendation. Expert systems with
Applications 110 (2018), 191–205.
[29] Yatao Yang, Zibin Zheng, Xiangdong Niu, Mingdong Tang, Yutong Lu, and
Xiangke Liao. 2021. A Location-Based Factorization Machine Model for Web
Service QoS Prediction. IEEE Transactions on Services Computing 14, 5 (2021),
1264–1277. https://doi.org/10.1109/TSC.2018.2876532
[30] Fanghua Ye, Zhiwei Lin, Chuan Chen, Zibin Zheng, and Hong Huang. 2021.
Outlier-Resilient Web Service QoS Prediction. In Proceedings of the Web Confer-
ence 2021. 3099–3110.
[31] Yiwen Zhang, Chunhui Yin, Qilin Wu, Qiang He, and Haibin Zhu. 2019. Location-
aware deep collaborative filtering for service recommendation. IEEE Transactions
on Systems, Man, and Cybernetics: Systems (2019).
[32] Zibin Zheng, Hao Ma, Michael R Lyu, and Irwin King. 2010. Qos-aware web
service recommendation by collaborative filtering. IEEE Transactions on services
computing 4, 2 (2010), 140–152.
[33] Zibin Zheng, Li Xiaoli, Mingdong Tang, Fenfang Xie, and Michael R Lyu. 2020.
Web service QoS prediction via collaborative filtering: A survey. IEEE Transac-
tions on Services Computing (2020).
[34] Zibin Zheng, Li Xiaoli, Mingdong Tang, Fenfang Xie, and Michael R Lyu. 2020.
Web service QoS prediction via collaborative filtering: A survey. IEEE Transac-
tions on Services Computing (2020).
[35] Qimin Zhou, Hao Wu, Kun Yue, and Ching-Hsien Hsu. 2019. Spatio-temporal
context-aware collaborative QoS prediction. Future Generation Computer Systems
100 (2019), 46–57.
[36] Guobing Zou, Shaogang Wu, Shengxiang Hu, Chenhong Cao, Yanglan Gan,
Bofeng Zhang, and Yixin Chen. 2022. NCRL: Neighborhood-Based Collaborative
Residual Learning for Adaptive QoS Prediction. IEEE Transactions on Services
Computing (2022).
Received 20 February 2007; revised 12 March 2009; accepted 5 June 2009
in auxiliary contextual data to probe the influence of similarity on
service caliber across geographical locales.
ACKNOWLEDGMENTS
To Robert, for the bagels and explaining CMYK and color spaces.
REFERENCES
[1] JohnS Breese DavidHeckerman CarlKadie. 1998. Empirical analysis of predictive
algorithms for collaborative filtering. Microsoft Research Microsoft Corporation
One Microsoft Way Redmond, WA 98052 (1998).
[2] Soumi Chattopadhyay, Richik Chanda, Suraj Kumar, and Chandranath Adak. 2022.
OffDQ: An Offline Deep Learning Framework for QoS Prediction. In Proceedings
of the ACM Web Conference 2022. 1987–1996.
[3] Xi Chen, Xudong Liu, Zicheng Huang, and Hailong Sun. 2010. Regionknn: A
scalable hybrid collaborative filtering algorithm for personalized web service
recommendation. In 2010 IEEE international conference on web services. IEEE,
9–16.
[4] Zhen Chen, Limin Shen, Feng Li, and Dianlong You. 2017. Your neighbors
alleviate cold-start: On geographical neighborhood influence to collaborative web
service QoS prediction. Knowledge-Based Systems 138 (2017), 188–201.
[5] Ranjana Roy Chowdhury, Soumi Chattopadhyay, and Chandranath Adak. 2020.
Cahphf: context-aware hierarchical QoS prediction with hybrid filtering. IEEE
Transactions on Services Computing (2020).
[6] Yu Feng and Biqing Huang. 2018. Cloud manufacturing service QoS prediction
based on neighbourhood enhanced matrix factorization. Journal of Intelligent
Manufacturing (2018), 1–12.
[7] Pinjia He, Jieming Zhu, Zibin Zheng, Jianlong Xu, and Michael R. Lyu. 2014.
Location-Based Hierarchical Matrix Factorization for Web Service Recommen-
dation. In 2014 IEEE International Conference on Web Services. 297–304.
https://doi.org/10.1109/ICWS.2014.51
[8] Pinjia He, Jieming Zhu, Zibin Zheng, Jianlong Xu, and Michael R Lyu. 2014.
Location-based hierarchical matrix factorization for web service recommendation.
In 2014 IEEE international conference on web services. IEEE, 297–304.
[9] Walayat Hussain, José M Merigó, Muhammad Raheel Raza, and Honghao Gao.
2022. A new QoS prediction model using hybrid IOWA-ANFIS with fuzzy C-
means, subtractive clustering and grid partitioning. Information Sciences 584
(2022), 280–300.
[10] Joseph A Konstan, Bradley N Miller, David Maltz, Jonathan L Herlocker, Lee R
Gordon, and John Riedl. 1997. Grouplens: Applying collaborative filtering to
usenet news. Commun. ACM 40, 3 (1997), 77–87.
[11] Yehuda Koren, Robert Bell, and Chris Volinsky. 2009. Matrix factorization
techniques for recommender systems. Computer 42, 8 (2009), 30–37.
[12] Kwangkyu Lee, Jinhee Park, and Jongmoon Baik. 2015. Location-based web ser-
vice QoS prediction via preference propagation for improving cold start problem.
In 2015 IEEE International Conference on Web Services. IEEE, 177–184.
[13] Jianxun Liu, Mingdong Tang, Zibin Zheng, Xiaoqing Liu, and Saixia Lyu. 2015.
Location-aware and personalized collaborative filtering for web service recom-
mendation. IEEE Transactions on Services Computing 9, 5 (2015), 686–699.
[14] Xin Luo, MengChu Zhou, Zidong Wang, Yunni Xia, and Qingsheng Zhu. 2019.
An Effective Scheme for QoS Estimation via Alternating Direction Method-Based
Matrix Factorization. IEEE Transactions on Services Computing 12, 4 (2019),
503–518. https://doi.org/10.1109/TSC.2016.2597829
[15] Xin Luo, MengChu Zhou, Yunni Xia, Qingsheng Zhu, Ahmed Chiheb Ammari,
and Ahmed Alabdulwahab. 2016. Generating highly accurate predictions for miss-
ing QoS data via aggregating nonnegative latent factor models. IEEE transactions
on neural networks and learning systems 27, 3 (2016), 524–537.
[16] Zhiling Luo, Ling Liu, Jianwei Yin, Ying Li, and Zhaohui Wu. 2018. Latent
Ability Model: A Generative Probabilistic Learning Framework for Workforce
Analytics. IEEE Transactions on Knowledge and Data Engineering 31, 5 (2018),
923–937.
[17] Hao Ma, Irwin King, and Michael R Lyu. 2007. Effective missing data prediction
for collaborative filtering. In Proceedings of the 30th annual international ACM
SIGIR conference on Research and development in information retrieval. 39–46.
[18] Hafiz Syed Muhammad Muslim, Saddaf Rubab, Malik M Khan, Naima Iltaf,
Ali Kashif Bashir, and Kashif Javed. 2022. S-RAP: relevance-aware QoS predic-
tion in web-services and user contexts. Knowledge and Information Systems 64, 7
(2022), 1997–2022.
[19] Jinwoo Park, Byungkwon Choi, Chunghan Lee, and Dongsu Han. 2021. GRAF:
a graph neural network based proactive resource allocation framework for SLO-
oriented microservices. In Proceedings of the 17th International Conference on
emerging Networking EXperiments and Technologies. 154–167.
[20] Steffen Rendle. 2012. Factorization Machines with LibFM. ACM Trans. Intell.
Syst. Technol. 3, 3, Article 57 (may 2012), 22 pages.
[21] Duksan Ryu, Kwangkyu Lee, and Jongmoon Baik. 2018. Location-based web
service QoS prediction via preference propagation to address cold start problem.
|
|
http://arxiv.org/abs/2310.04895v2 | "2023-10-11T05:59:53" | "2023-10-07T18:47:17" | Cell Tracking-by-detection using Elliptical Bounding Boxes | Cell detection and tracking are paramount for bio-analysis. Recent approaches
rely on the tracking-by-model evolution paradigm, which usually consists of
training end-to-end deep learning models to detect and track the cells on the
frames with promising results. However, such methods require extensive amounts
of annotated data, which is time-consuming to obtain and often requires
specialized annotators. This work proposes a new approach based on the
classical tracking-by-detection paradigm that alleviates the requirement of
annotated data. More precisely, it approximates the cell shapes as oriented
ellipses and then uses generic-purpose oriented object detectors to identify
the cells in each frame. We then rely on a global data association algorithm
that explores temporal cell similarity using probability distance metrics,
considering that the ellipses relate to two-dimensional Gaussian distributions.
Our results show that our method can achieve detection and tracking results
competitively with state-of-the-art techniques that require considerably more
extensive data annotation. Our code is available at:
https://github.com/LucasKirsten/Deep-Cell-Tracking-EBB. | [
"Lucas N. Kirsten",
"Cláudio R. Jung"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04895v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04895v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.AI",
"cs.LG"
] | 3
2
0
2
t
c
O
1
1
]
V
C
.
s
c
[
2
v
5
9
8
4
0
.
0
1
3
2
:
v
i
X
r
a
CELL TRACKING-BY-DETECTION USING ELLIPTICAL BOUNDING
BOXES
A PREPRINT
Lucas N. Kirsten
Institute of Informatics
Universidade Federal do Rio Grande do Sul
Porto Alegre, RS (Brazil)
lnkirsten@inf.ufrgs.br
Cláudio R. Jung
Institute of Informatics
Universidade Federal do Rio Grande do Sul
Porto Alegre, RS (Brazil)
crjung@inf.ufrgs.bru
October 12, 2023
ABSTRACT
Cell detection and tracking are paramount for bio-analysis. Recent approaches rely on the tracking-
by-model evolution paradigm, which usually consists of training end-to-end deep learning models
to detect and track the cells on the frames with promising results. However, such methods require
extensive amounts of annotated data, which is time-consuming to obtain and often requires specialized
annotators. This work proposes a new approach based on the classical tracking-by-detection paradigm
that alleviates the requirement of annotated data. More precisely, it approximates the cell shapes as
oriented ellipses and then uses generic-purpose oriented object detectors to identify the cells in each
frame. We then rely on a global data association algorithm that explores temporal cell similarity using
probability distance metrics, considering that the ellipses relate to two-dimensional Gaussian distri-
butions. Our results show that our method can achieve detection and tracking results competitively
with state-of-the-art techniques that require considerably more extensive data annotation. Our code is
available at: https://github.com/LucasKirsten/Deep-Cell-Tracking-EBB.
Keywords Cell tracking * Cell detection * Oriented object detection
1
Introduction
Detection and tracking of living cells in microscopy images is a crucial task required in many biomedical applications,
such as cell growth, migration, invasion, morphological changes, and changes in the localization of molecules within
cells [1–4]. The sheer amount of data produced by high-throughput microscopy imaging imposes an analytical challenge
for science researchers, which can only be overcome with the appropriate computational tools.
As with several other computer vision tasks, the state-of-the-art (SOTA) for cell detection and tracking is based on
deep learning approaches [5, 6]. These techniques typically require manual cell annotations for training and evaluating
the models, and the annotation format has a significant impact on both the time devoted to image labeling and the
complexity of the network itself. The most traditional object representation refers to using horizontal bounding boxes
(HBBs, a.k.a. BBs) to detect objects in a scene. Despite being very simple to annotate, this representation is not
adequate when dealing with oriented elongated objects, since the HBB may contain large portions of the background or
other objects in clutter scenarios. On the other hand, segmenting each object provides a fine-grained representation
of the shape, but it is a tedious and time-consuming task. Moreover, applications that use multiple cell lineages from
different sources (e.g., microscope, cell type) may require several rounds of labeling data and retraining the models [7].
In these cases, a fast and efficient method for quickly labeling the data is crucial for the application continuity, since it
is usually the most time-consuming step.
In the context of cell detection and tracking, knowing the complete shape representation might not be needed, while it
can impose a real challenge in cases where the cell contour is highly uncertain (e.g., when there is low contrast between
the cells and the background). Furthermore, methods used for individually segmenting the cell masks usually require
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Figure 1: Comparison of different types of annotations. In green are the full segmentation mask, in yellow the HBB
representation, in red the OBB representation, and in blue the EBB representation.
more complex and computationally expensive algorithms, since they are typically developed in a two-step manner
(either detecting and then segmenting [8, 9], or segmenting and then splitting the masks [10–14]). Oriented bounding
boxes (OBBs, a.k.a. rotated bounding boxes) are an intermediate representation between segmentation masks and HBBs
with a good compromise between simplicity and completeness. However, the presence of roughly circular cells imposes
angular ambiguity on its representation, since its OBB representation will be a square rotated at any angle (see the left
cell on Figure 1).
In this work, we advocate using elliptical bounding boxes (EBBs), which can be directly derived from OBBs and
can capture oriented cells while mitigating the angular ambiguity for circular objects. Fig. 1 shows a comparison of
HBBs, OBBs, segmentation masks, and EBBs for two different cells: the left one is roughly circular, and right one is
oriented. The EBB representation, shown in blue, presents a good fit in both examples. As an additional advantage,
the orientation/shape of detected cells represented as EBBs can be explored in tracking-by-detection approaches to
provide a better spatio-temporal association when time-lapse sequences are used, while weakly-supervised segmentation
methods such as [15] can be coupled to the detected OBBs/EBBs to obtain a more detailed representation of the cell
shape.
We propose a cell tracking-by-detection method that uses a deep learning model to detect the cells as OBBs, then
convert them to EBBs to fit the cell shapes better. For the tracking part, we based our solution on the work of Bise
et al. [10], which describes an unsupervised (i.e., no tracking label is necessary) long-term global data association
algorithm. We adapted their algorithm to rely only on the detection information provided by the object detector model
(e.g., position, confidence score). It is important to note that our method only requires OBB cell annotations for isolated
frames, and no tracking annotation involving temporal sequences is needed.
2 Related work
2.1 Cell detection and segmentation
There are several approaches for cell counting, detection, and segmentation, and the best results have been achieved by
deep learning methods [16, 17]. These methods vary considerably regarding the underlying structure of the network and
also on the degree of supervision required to label training data. For example, detecting just the cell nucleus requires one
pixel-per-cell as supervision; detecting the cell boundaries as an HBB requires two points (top-left and bottom-right),
while OBBs require an additional parameter related to the orientation; finally, segmentation requires the identification
of all pixels belonging to a cell, which is very time-consuming. There are also some intermediate shape representations
such as the star-convex polygons [18].
The U-Net presented in [11] has become a popular segmentation approach in biomedical applications when segmentation-
level information is required. It is based on an encoder-decoder U-shaped architecture with skip connections, and
focuses mostly on semantic segmentation tasks (i.e., segmenting all objects for each class altogether). Although the
connected components produced by U-Net can also be used for instance segmentation, dense scenarios or situations
with strongly overlapping cells are challenging. For instance segmentation, most approaches produce an embedding
vector for each image pixel in such a way that similar vectors should relate to the same instance (object) [19], and have
been explored in the context of cell segmentation by Payer and colleagues [20, 21] by using a cosine loss for estimating
local embedding distances. To mitigate the cost of clustering pixels embedding (that is required to obtain the final
instance segmentation), Zhao and colleagues [22] proposed a fast Mean-Shift algorithm that works on GPUs. The
2
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
panoptic segmentation task combines both category- and instance-level information into a single framework, and has
been applied to biomedical imaging by Liu and colleagues [23].
Although solutions that can return the full segmentation mask of cells have the clear advantage of providing a
complete shape representation, most segmentation approaches are fully supervised, requiring time-consuming per-cell
annotations. In order to overcome this problem, weakly supervised approaches explore partial annotations such as
bounding boxes [24], center-points [25] or user-defined scribbles [26] for the segmentation task. Nevertheless, many
applications (e.g., tissue engineering [27]) do not require the full description of the cell shape, but rather a position, size,
and orientation descriptor are enough. This alleviates the annotation process, making it faster, less tedious, and more
scalable.
As noted in [18], a popular approach for cell detection in microscopy images is to use generic-purpose object detectors
based on HBBs, such as SSD [28] or YOLO [29]. Despite the constant evolution of object detectors [30–33], the
representation of cells as HBBs presents limitations in denser scenarios, particularly when oriented and elongated cells
are present as aforementioned. Intermediate representations between HBBs and full segmentation masks have also been
explored for cell detection. For example, Schmidt et al. [18] presented a polygonal shape representation based on radial
sweeps with equidistant angles. A similar approach using splines instead of polygonal representations was presented
in [34], obtaining smoother cell boundaries.
In this work, we advocate using EBB representations for cell detection, which is a natural extension of the OBB
representation, but usually provides a better fit to the cell shape. In particular, roughly circular shapes induce a naturally
ambiguous angular representation when OBBs are used since any rotated square fits equally to a circle. For these
cases, the EBB would reduce to a circle, mitigating the angular problem. Finally, it is worth mentioning that the output
of any OBB detector can be mapped to an EBB, and OBB detectors have demonstrated exciting results in the past
years [35–38]. An OBB annotation is almost as simple as an HBB, with a considerable gain in shape representation,
particularly regarding applications that involve elongated cells.
2.2 Cell tracking
Firstly, it is important to emphasize that "cell tracking" presents a broad spectrum of challenges, since each cell type and
application might require a tailored solution. As noted in [7], "there is no simple way to point out the right algorithm
for a given dataset", hinting that finding an algorithm capable of working for a broad spectrum of cell lineages is a huge
challenge. Nevertheless, the ISBI Challenge [39] has provided several different datasets for benchmarking cell tracking
algorithms, which usually are elaborated to work on more than one cell type and lineage.
Recent cell tracking algorithms can be broadly divided into two categories [14, 40, 41]: (i) tracking by model evolution
and (ii) tracking-by-detection. In tracking by model evolution methods (a.k.a. end-to-end tracking systems), detection
and tracking are solved simultaneously. In this context, Payer et al. [20, 21] introduced temporal information for
spatio-temporal learning of the embeddings. They explored a cosine loss for estimating local embedding distances,
and used a convolutional Gated Recursive Unit (ConvGRU) to learn temporal relationships. Nishimura et al. [42]
presented a cell tracking approach that works with weak annotation (cell centers in successive frames) by exploring a
co-detection CNN. More recently, Hayashida et al. [5] proposed a complete pipeline that uses spatial-temporal context
in multiple frames and long-term motion estimation with an objective level warping loss that addresses the problem of
detecting and tracking highly dense cell images. Although these methods are capable of achieving high performance, it
is important to emphasize that they all require full annotations for both the detection/segmentation and tracking steps,
which might be a strong limitation.
The tracking-by-detection paradigm consists of two stages: cell detection and cell association. When segmentation
masks are required, the detection stage can either aid a segmentation step to extract the masks of each detected cell [8],
or it can directly infer the segmentation masks and then split those wrongly joined cells using some algorithm such as
the watershed [11, 12, 40, 41, 43, 44]. The methods for connecting the cells in subsequent frames usually rely on graphs
and linear integer programming [8, 40, 41, 43, 44] by defining the costs of the cell events (e.g., movement, mitoses, and
apoptosis). Other strategies include the use of multi-Bernoulli random finite sets [45] or joint particle filters based on
Markov random field to model the dependency of the target movements [46]. Akram et al. [8] uses a deep learning
model that first detects the cells using the HBB representation and then feeds these detections to a segmentation model
to further retrieve the segmentation masks of individual cells. For associating the detection, they use random forests to
estimate the costs of the event graph. More recently, Wang et al. [14] proposed a method that first segments the images
using a U-Net [11] deep learning model, and then uses deep reinforcement learning to associate the detected targets
between frames.
This work proposes a tracking-by-detection approach that solely uses spatial information and the detection scores from
an object detector to determine the associations between cells. It alleviates the annotation requirements to use only
3
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Figure 2: Overview of the proposed pipeline for cell-tracking-by-detection. First, we detect the cells as OBBs and
then convert them to the EBB representation. Next, we join the cells with high overlap between two adjecent frames.
Finally, a global data association algorithm is used to identify all the cell events (i.e., movement, mitoses and apoptosis),
while filling gaps generated by false negative detections and removing false positives ones, in order to produce the final
tracklets.
annotated cells as OBBs, and also eliminates the necessity of using other features from the detections (e.g., image
histograms) to compute the associations.
3 The proposed tracking-by-detection method
Our approach follows the typical pipeline of a tracking-by-detection method. First, an object detector is used to identify
the cells in each frame using OBB representations, which are then converted to elliptical representations (EBBs). For
tracking, we initially generate short tracklets by joining cells in subsequent frames with an objective function that
jointly explores the shape and distance of cells. More precisely, we map the EBB representation to a two-dimensional
Gaussian distribution and explore the Helinger distance, which directly correlates to the IoU metric [47]. Finally, a
global data association method based on the work of [10] associates the tracklets to obtain the final cell trajectories and
lineage trees. Figure 2 shows an overview of our complete pipeline for cell tracking-by-detection, and the steps are
detailed next.
3.1 Cell detection
The first step of our method relies on identifying the cells for each frame individually. We propose to use off-the-shelf
OBB object detectors trained with cell images and then convert the output to elliptical bounding boxes (EBBs). For
an OBB with center (x, y), width W , height H, and orientation θ, we generate an ellipse with the same center and
orientation, with semi-axes a = W/2 and b = H/2. If the OBB is clearly oriented (i.e., W >> H or W << H), the
EBB will preserve the orientation of the OBB. On the other hand, if the OBB is roughly square (i.e., H ≈ W ), the
produced EBB will be roughly circular. In the case of a perfect square, the EBB simplifies to a single circle regardless
of the orientation of the OBB, which mitigates the orientation ambiguity (recall the example shown in Fig. 1).
3.2 Detection filtering and suppression
In a typical deep object detector, only candidate detections with scores larger than a pre-defined threshold τs are retrieved.
Still, we usually have several overlapping candidates related to the same object, and Non-Maximum Suppression (NMS)
is then used to retrieve only the candidate with the highest score. In this step, it is crucial to define a geometrical
similarity measure between the detections for quantifying their "overlap" degree.
The Intersection-over-Union (IoU) is the de facto standard metric for computing the overlap in HBB or OBB detectors.
However, computing the IoU for OBBs is not trivial due to the several possibilities for two intersecting OBBs [48].
Furthermore, the IoU is unreliable for OBB detections related to circular cells, since angular discrepancies might
artificially degrade the IoU [49]. Using the IoU with EBBs mitigates the latter problem, because the ellipse reduces to a
circle. However, computing the intersection using EBBs is even more complex than using OBBs since it involves the
overlap of two ellipses. In this work, we propose an alternative similarity metric based on fuzzy object representations.
In [38, 50] and [47], the core idea is to use 2D Gaussian distributions (denoted as GBBs – Gaussian Bounding Boxes)
as intermediate representations for oriented objects, and train OBB detectors using loss functions based on similarity
metrics between distributions. Here, we explore their developed fuzzy representation to compute the distance/similarity,
as explained next. Following [47], an OBB with center μ = (xc, yc)T , width W , height H and angle θ is mapped to a
4
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
(a) Frame with detections before filtering and sup-
pression.
(b) Frame with detections after filtering and suppres-
sion.
Figure 3: Illustration of detection filtering and NMS using the Hellinger Distance on a frame. Observe that in (a) we
have many duplicates and false positives detection, while in (b) they are suppressed and eliminated, resulting in only
one detection per cell.
GBB described by the mean vector μ (which is the OBB center) and a covariance matrix
W 2
12 cos2 θ + H2
12 sin2 θ
(cid:17)
(cid:16) W 2
12 − H2
sin 2θ
12 − H2
1
2
12 sin2 θ + H2
W 2
sin 2θ
12 cos2 θ
(cid:20)a
c
(cid:16) W 2
Σ =
c
b
=
(cid:17)
1
2
12
12
(cid:21)
.
(1)
Note that square OBBs, for which H = W , generate a diagonal covariance matrix that does not involve the angular
parameter θ. Hence, squares that differ only by angle are mapped to the exact same GBB.
In [38, 50] and [47], the Gaussian distributions are used to train OBB object detectors as their loss function. However,
the metrics proposed by [38, 50] do not hold the mathematical properties of a similarity measure, which is the goal for
comparing two detection. Therefore, we define a similarity metric based on the Hellinger Distance, as done by [47]. Let
us consider that p ∼ N (μ1, Σ1) and q ∼ N (μ2, Σ2) are Gaussian distributions with
(cid:20)a2
c2
(cid:18)x1
y1
(cid:18)x2
y2
(cid:20)a1
c1
, Σ1 =
, Σ2 =
, μ2 =
μ1 =
c2
b2
c1
b1
(2)
(cid:19)
(cid:19)
(cid:21)
(cid:21)
.
The Bhattacharyya Distance [51] between distributions p and q is given by
BD(p, q) =
1
8
μT
12Σ−1μ12 +
μ12 = μ1 − μ2, Σ12 =
(cid:18)
ln
√
det Σ12
det Σ1 det Σ2
(cid:19)
,
(Σ1 + Σ2) ,
1
2
1
2
and the Hellinger distance [52] between p and q is then
HD(p, q) =
(cid:112)
1 − e−BD(p,q).
(3)
(4)
Although both BD and HD are named "distances", only HD satisfies the mathematical properties for a metric [53].
Moreover, we can see that 0 ≤ HD(p, q) ≤ 1 (with 0 being the maximum similarity), meaning that HD provides
a normalized distance metric. In this work, we explore HD to find overlapping EBBs to suppress non-maximum
detections. Finally, given a detection p with the highest confidence score, we suppress all detections q ̸= p for which
HD(p, q) < τh. We illustrate this procedure in Figure 3.
3.3 Tracklet generation
As stated by [10], long trajectories obtained via frame-by-frame association may include more failures (such as drift
and occlusions) than short trajectories. Hence, it is better to first reliably associate cell detections in adjacent frames,
and then use some global data association algorithm to obtain the final long-term tracklets.
5
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Figure 4: Illustration of using the Hellinger Distance for associating detections in subsequent frames. The dashed ellipse
(black) represents a detection in frame i, while the two solid ellipses (red and blue) represent two possible associations
in frame i+1 (the stars mark the respective centers of the detections). The Hellinger distance eliminates the imprecision
of joining the black and blue detections due to only relating their centroid distances, while the red and black share more
shape similarity.
In this work, "reliable tracklets" are obtained by computing the overlap between all detections of subsequent frames
with the Hellinger distance (Eq. (4)), and the optimal association between detections is obtained by solving a linear sum
assignment problem with the Hungarian Algorithm [54]. Note that HD jointly considers the centroid distance (typically
used for tracklet generation) and shape information – encoded in the covariance matrix. Hence, nearby cells with
distinct shape/orientations that generate strong ambiguity when using only the centroid distance can be disambiguated
through the Hellinger distance (see Figure 4).
In order to avoid bad associations caused by false positive detections, we only associate pairs of cells p and q for which
HD(p, q) < τo, where τo is a similarity threshold. Note that we implicitly assume a low cell displacement and shape
change in adjacent frames, which is typically the case for time-lapse microscopy imagery [10].
3.4 Global data association
In an ideal scenario, the combination of the associations in adjacent frames would lead to the long-term track of each
cell. However, there may be errors either in cell detection or the association process itself. Furthermore, we also have to
consider cell division and death. Hence, we explore a global data association step to fill the gaps between disjointed
tracklets, remove false positives and identify the mitoses events.
We based our method on the work by [10], who formulated a maximum-a-posteriori problem (MAP) solved by linear
programming that addresses the tree structure association problem. We proceed to briefly describe their method and then
introduce our modifications. The MAP problem is solved by defining a set of hypotheses associated with a likelihood
score for combinations of the NT tracklets (i.e., each tracklet will respond to a set of possible hypotheses with their
likelihood). More precisely, they assume the following five possible types of hypotheses that can be made for each
tracklet: initiation, termination, translation, mitoses, and false positive.
Mathematically, let CM ×2NT be a binary matrix containing the constraints for all possible hypotheses. Each row of
C relates to a single hypothesis, and it presents 2NT columns that indicate the possible tracklet associations, where
the first NT columns indicate the index of the source tracklet index and the following NT columns relate to the target
tracklet index (or indices). For example, the translation hypothesis presents one source tracklet and one target tracklet.
Meanwhile, the mitosis hypothesis relates one source tracklet to a pair of target tracklets (its children), and the false
positive hypothesis relates one tracklet to itself (i.e., the source index is the same as the target). There is also a likelihood
value for each hypothesis (i.e., for each row of C), stored in a vector ρ with M elements (the number of generated
hypotheses).
The solution of the global optimization problem is a subset of all non-conflicting hypotheses (a subset of rows of C)
that maximizes the sum of the corresponding likelihoods. This can be formulated as the following ILP optimization
problem:
x∗ = argmax
ρT x, s.t. , CT x ≤ 1,
x
(5)
where xM ×1 is a binary vector, and an entry xk = 1 means the k-th hypothesis is selected in the global optimal solution.
The constraint CT x ≤ 1 guarantees that each tracklet ID appears in only one associated tree or false positive tracklet.
6
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
The work developed by [10] allows a simple but efficient method for long-term data association. Yet, their approach
still presents some limitations that we propose to address with the following modifications:
1. In [10], they propose to use a specific algorithm [55] to identify the mitotic cells (i.e., the cells that are more
likely to suffer mitoses). This algorithm, however, is specifically designed to work with images captured
under phase-contrast microscopy, which narrows its usage to other types of images (e.g., fluorescence). We
decided not to differentiate between mitotic and non-mitotic cells, and consider all cells as potentially mitotic.
Furthermore, to address this choice, we employ two free parameters to adjust the likelihood distribution of the
translation and mitoses hypothesis;
2. We removed the initiation and termination hypotheses and replaced them with a completeness one. In theory,
these two hypotheses are essential to define the tree structure of the MAP problem. However, we noted in
our experiments that they tend to generate a more complex MAP problem and do not provide better tree
structures (i.e., closer to the ground-truth one), as we demonstrate in Section 5. In the original formulation,
these hypotheses are defined regarding the cell position towards the borders and their first (or last) appearance,
assuming that cells appear or disappear when they enter or leave the area captured by the microscope. Although
these assumptions work well for an ideal detector, real detectors can fail to capture some cells (e.g., due to the
absence of contrast between cell and background). As a consequence, the tracklets can start to be recognized
only after some frames and/or with the cells already located farther away from the image boundaries, and
imposing these boundary-related conditions can increase the number of false negatives;
3. We re-defined all the likelihood computations to use only information regarding the detected cells (e.g.,
position, time-frame distance, and confidence score returned by the object detector). In particular, we explore
the confidence score to discriminate between the true and false positive hypotheses. For the translation and
mitoses hypotheses, we used only the center and time distance between detections, whereas generic feature
matching (e.g., based on histogram matching) was proposed by [10]. Our motivation is that finding an
adequate feature to individually discriminate cells in long-term matching is challenging (no specific feature
was mentioned in [10]), and appearance-based features might change depending on the method used to capture
the images. Moreover, using only positional information and confidence score allow using any cell detector.
We also removed the true positive likelihood that was originally proposed by [10] since our pre-processing
step can remove low-scored detections.
The proposed alternate hypotheses and corresponding likelihoods are explained next.
• Translation hypothesis:
If the time and center distances between the last detection of tracklet Xk1 and the first detection of Xk2 are
smaller than a pair of thresholds, Xk1 → Xk2 is a candidate of a tracklet translation. Considering that h
denotes the index of a new hypothesis, we append a new row to C and a corresponding likelihood to ρ as:
(cid:26)1,
if i = k1 or i = NT + k2
C(h, i) =
0, otherwise
ρ(h) = Plink(Xk2|Xk1).
,
• Mitosis hypothesis:
If the time and center distances between the last detection of tracklets Xp and the first detection of Xc1 and
Xc2 are smaller than a threshold for the detection center and time, Xp → {Xc1, Xc2} is a candidate of a
tracklet mitosis. We define new entries for C and ρ as:
C(h, i) =
(cid:26)1,
if i = p or i = NT + c1 or i = NT + c2
0, otherwise
,
• False positive and Completeness hypothesis:
ρ(h) = Pmit(Xc1, Xc2|Xp).
If the score of tracklet Xk (i.e., the mean score of all its detections) is smaller than threshold τF P , Xk is a
candidate for both false positive and completeness. We define two new entries for C (h and h + 1) and ρ
given by
C(h, i) = C(h + 1, i) =
(cid:26)1,
if i = k or i = NT + k
0, otherwise
,
and for the ρ entries as:
ρ(h) = PF P (Xk),
ρ(h + 1) = Pcplt(Xk).
7
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
The completeness hypothesis aims to cover the cases in which a tracklet does not translate or suffer from
mitoses, i.e., the tracklet is, in fact, a full long-term cell track. Hence, assuming only the false positive
hypothesis would wrongly eliminate those tracklets.
Now, we formalize the likelihoods for each hypothesis provided above. For the link and mitosis hypotheses, we would
like to maximize the likelihood (i.e., values closer to 1) when the time and space distance between two cell tracklets are
small, and minimize it (i.e., values closer to 0) when their distance increase. For this purpose, we based the formulation
of the link and mitoses likelihoods on an exponential mapping that penalizes the time-space distance between tracklets.
More precisely, we propose to use
Plink(Xj|Xi) = exp
−
(cid:18)
(ci,j + 1) tj,i
∆t λlink
(cid:19)
,
(6)
where ∆t is the dataset capture time step in frames
hour , ci,j is the Euclidean center distance between the last and the first
detection of tracklets Xi and Xj, respectively, ti,j is their time distance in frames, and λlink is a parameter that controls
the decay of the exponential.
The mitosis likelihood is defined in a similar way, but jointly considering the space-time distance between the parent
cell p and the two candidate children c1, c2. Formally, it is given by
Pmit(Xc1, Xc2|Xp) = exp
−
(cid:18)
(cp,c1 + cp,c2 + 1)(tp,c1 + tp,c2)
4∆t λmit
(cid:19)
,
(7)
where λmit controls the decay of the exponential. We do not use the Helinger distance in these formulations because
cell shapes can change considerably in longer-term translations or during mitosis.
For the false positive likelihood, we also explore the precision α of the object detector computed for a given dataset
(e.g., the training or validation set) and the tracklet score si, defined as the mean confidence score of all its detection.
We want low-confidence tracklets (w.r.t. to the detector precision) to have an increased false positive likelihood, but
longer tracklets must have a smaller value since they tend to be related to actual tracklets. Based on these assumptions,
the false positive likelihood is computed as
PF P (Xi) = (1 − α)(1 − si + τs)|Xi|,
(8)
where |Xi| is the number of total detection responses in the tracklet, and τs is the threshold detection score defined in
Section 3.2. Note that detectors with low precision (α << 1) are prone to produce false positives, and PF P should be
increased in this case. On the other hand, detectors with high precision (α ≈ 1) are less prone to produce false positives,
and the likelihood PF P is decreased.
A similar rationale is used to define the completeness tracklet likelihood, given by
Pcplt(Xi) = α(si − τs).
(9)
Note that the likelihood of a tracklet being complete (i.e., it does not fit any other hypotheses) is not directly related to
the tracklet size, since a cell can emerge and die very soon or appear in the visible field only in the last frames, which
might lead to very small tracklets. Hence, we chose to define the likelihood based only on how precise the predictions
of the object detector are, so that the tracklet generation step can do most of the correct associations between adjacent
frames.
Figure 5 shows an example of the proposed hypotheses generation. From left to right, it shows a set of tracklets; the
possible hypotheses connecting the tracklets; the likelihood vector ρ; the matrix C indicating the possible tracklet
connections; and the vector x returned by the MAP problem solution. The final tracks are then obtained by solving
Eq. (5).
4 Experiments
4.1 Datasets
We evaluated the proposed method on three publicly available cell microscopy datasets provided from the ISBI 2015
Cell Tracking Challenge [39]: Fluo-N2DH-GOWT1, PhC-C2DH-U373, and Fluo-N2DL-HeLa, illustrated in Fig. 6.
Each dataset contains two sequences in the training set (with ground truth annotations) and two challenge sequences
(without ground truth annotation), named with suffices -01 and -02. The results for the challenge sequences are obtained
by submitting the results to the ISBI challenge server. We proceed to provide details regarding each of the chosen
datasets.
8
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Figure 5: Example of hypotheses generation for a given set of tracklets. Given a set of initial tracklets, we generate
hypothesis for each of them, which are associated with a likelihood value stored in vector ρ, and the constraints stored
in the binary matrix C. Solving the MAP problem returns the binary vector x which selects a subset of rows in C that
defines the optimal solution of the MAP problem. For example, the first line defines a translation hypothesis of tracklet
1 to 2 with a likelihood of 0.5. The matrix C stores the ID values of the considered tracklets (in each of its halves), and
the value 0 in the vector x indicates that this hypothesis was not chosen during the optimization solving.
(a) Fluo-N2DH-GOWT1
(b) Fluo-N2DH-HeLa
(c) PhC-C2DH-U373
Figure 6: Example of cell images for each of the datasets used for evaluation.
Fluo-N2DH-GOWT1 contains GFP-transfected GOWT1 mouse embryonic stem cells captured on fluorescence
microscopy. Challenges with this dataset include low contrast of some cells and few cells entering and exiting the
imaged region from the axial direction. The capture time step is ∆t = 12 frames
hour .
PhC-C2DH-U373 contains glioblastoma-astrocytoma U373 cells captured under phase contrast microscopy. This
dataset is challenging due to cells having highly deformable shapes and parts of cell bodies having a similar appearance
to the background. The capture time step is ∆t = 4 frames
hour .
Fluo-N2DH-HeLa contains fluorescently labeled HeLa nuclei captured on fluorescence microscopy. Challenges with
this dataset include high cell density, low contrast, a few irregularly shaped cells, various mitoses events, and cells
entering and exiting the imaged region. The capture time step is ∆t = 2 frames
hour .
All these datasets only contain ground truth (GT) annotations for cells within a field of interest, which excludes a few
pixels for cells close to the image boundaries. There are two types of GT annotations: cell masks for the segmentation
evaluation, and cell markers for the detection and tracking evaluation. For the cell masks, the annotations are provided
as silver and gold standards. The silver standard annotations refer to computer-origin reference annotations, while the
gold standard refers to human-origin ones. Since only a few cells are annotated in the gold standard, we used only the
silver ones for both training and evaluation. The cell marks are "similar" to the segmentation masks, but they have
9
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
(a) GOWT1-01
(b) HeLa-01
(c) U373-01
(d) GOWT1-02
(e) HeLa-02
(f) U373-02
Figure 7: Illustration showing the difference between the two CTC [39] annotations types: cell masks (green) and cell
markers (red).
reduced size and serve solely as a position descriptor of the cells. Moreover, they do not follow a standard regarding
their size or placement on the cell image. We illustrate these annotation discrepancies in Fig. 7.
4.2 Data pre-processing
We use the same data pre-processing procedure for all datasets, except for some specific adjustments in the HeLa, as
described next. Since the HeLa dataset contains cells with very different sizes compared to the other CTC datasets [39],
we followed a similar strategy to the one employed by [8] and magnified all images by a factor of 2. This procedure
allows us to use the same network architecture without needing any adjustment in its head parameters regressor (e.g.,
the anchors) to better fit the cell sizes in this dataset.
For training the object detector, we extracted patches of full images in the datasets using a 512×512px sliding window
with 100px stride. The patches are extracted starting the window at the top-left corner of the image and sliding it across
the image horizontally and vertically according to the specified stride. At each position, we extract a patch within the
window boundaries. This process resulted in, for each sequence of the CTC dataset, 4,508 for the GOWT1 dataset,
690 for U373, and 16,314 for HeLa. During inference, we used the full-sized images, except for the HeLa dataset, for
which we used the patches with a 256 stride (to provide some overlap in the borders) and then divided the parameters of
the detection by a factor of 2 to retrieve them with the expected original image sizes. We used a similar strategy as
in other works [8, 14, 40, 41, 43]: with dataset sequences that contain GT annotations (i.e., not the one related to the
challenge), we trained the models with one sequence and used the other for evaluation. To generate the OBBs (and then
the EBBs) from the CTC cell masks, which are required to train the object detectors, we employed the minimum-area
rectangle fitting algorithm available in the OpenCV [56] framework.
4.3
Implementation details
As the object detector, we chose to use the R2CNN [35] provided by the AlphaRotate benchmark 1, because it has
shown to have the best compromise between precision and recall compared to other OBB detectors in our preliminary
1https://github.com/yangxue0827/RotationDetection
10
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Table 1: Object detection precision α for each dataset.
Dataset GOWT1-01 GOWT1-02 U373-01 U373-02 HeLa-01 HeLa-02
0.7899
0.8993
0.8644
0.7673
0.6867
0.7930
α
investigations using a private cell dataset. Furthermore, as presented in [57], general-purpose two-stage detectors
usually provide better results when compared with one-stage ones. R2CNN is a two-stage object detector (i.e. it has a
region proposed module (RPN) before the detection module) that was first proposed in text detection problems. The
model parameters used for all experiments are the same as in the AlphaRotate default architecture. The trained model
uses a ResNet50 [58] backbone with pre-trained weights on the ImageNet dataset [59]. Both classification modules
(RPN and head) use the categorical cross-entropy loss, and both box regression modules use the smooth-l1 loss. Weight
decay and momentum are set to 10−4 and 0.9, respectively. We employ Momentum Optimizer over 1 GPU and eight
images per mini-batch. All models are trained for 100 epochs with a 0.1 reduction factor of the learning rate at epochs
12, 16, and 20, using random rotation and flips as data augmentation primitives. The initial learning rate was 10−3 for
all datasets except HeLa, for which the model showed overfitting. In this dataset, we used 10−4 as the initial learning
rate and trained for 24 epochs only.
The hyper-parameters for the tracking system are the same for all datasets (except the object detection precision α and
capture time ∆t), and were chosen empirically to produce good results for all the evaluated datasets (i.e., we used the
training datasets in order to define the hyper-parameters of the final tracking system that was evaluated on the CTC [39]
server with hidden GT). Nevertheless, we provide a sensitivity analysis of the parameters in Section 5.3, and conclude
that changing them has a small impact on the results. For the inference of the detector, we used a score threshold
τs = 0.5, and an overlap threshold of τh = 0.5 for the filtering and aggregation step. For the tracklet generation, we
employed an overlap threshold of τo = 0.5, which are classical thresholds for IoU-like metrics.
For the parameters of the global data association algorithm, we used a time threshold tth = 3 frames, and a false positive
(cid:113)
threshold τF P = 0.9. The space threshold was set to 0.1
f , where Wf and Hf are the width and height of
the dataset frames, respectively. The α value was computed using the precision value for each dataset considering an
overlap threshold of τh = 0.5 between the predicted and ground-truth detections of the training images with no score
threshold (i.e., considering any detection with a confidence score above zero), and are available in Table 1. The free
parameters for likelihood adjustment are set to λlink = 25 and λmit = 50 for all datasets. The MAP problem was
solved using the Cbc [60] mixed ILP solver provided in the CVXPY2 Python 3 [61] library.
f + H 2
W 2
4.4 Evaluation Metrics
We evaluated our method using the metrics proposed by the ISBI 2015 Cell Tracking Challenge [39] and standard
literature metrics used for evaluating general-purpose detection and tracking systems. The ISBI Challenge provides
the DET, SEG and TRA metrics 3. Both DET and TRA metrics are designed to mirror the manual effort required to
correct the errors of a given detection and tracking algorithm, respectively, using Acyclic Oriented Graph Matching;
SEG measures the Jaccard similarity index (a.k.a. IoU) between predicted and ground-truth segmentation masks. All
ISBI metrics return values from 0 to 1 (1 being the highest score).
Since our method provides only an approximation of the segmentation masks through EBBs, we would also like to
estimate how close both the GT EBBs and the predicted EBBs are to the GT segmentation masks. The former can be
answered by evaluating the EBBs generated from the ground truth cell masks with the SEG metric, obtaining the EBB
SEG metric. The latter is obtained by simply evaluating our method with the SEG metric.
For the detection and tracking evaluation, the algorithm provided by the ISBI challenge disregards detections that do
not entirely overlap with the provided ground-truth cell marks. As mentioned before, they do not follow a standard
for size and displacement, which might affect the quantitative metrics. For the U373-02 dataset, in particular, Ulah
and colleagues [8] propose simply enlarging the predicted masks to avoid missing the cell marks. In our approach,
however, the variability of cell mark annotations can significantly impact all the tested datasets, since the EBBs are
only approximations of the segmentation mask and might not completely overlap with a ground-truth mark – they
are not bounding representations as well. In order to overcome this issue, we also evaluated our method enlarging
the predicted cell masks with a simple watershed algorithm, using the EBBs as guiding markers. An example of
EBB-guided watershed is shown in Fig. 8.
2Available at: https://www.cvxpy.org/index.html
3A full
the metrics
can
be
of
evaluation-methodology/
description
found
at
http://celltrackingchallenge.net/
11
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Figure 8: Visual comparison of the cell masks using EBBs (left) and post-processed with watershed (right). Note that
the watershed fills the voids between the different detections allowing some degree of error when evaluating with the
DET and TRA metrics.
For the standard literature metrics, we evaluated our object detector using the Average Precision (AP) metric, which
relates the precision and recall for a given threshold score and detection overlap (e.g., using IoU or the Hellinger
distance) between detections. For the tracking evaluation, we used the CLEAR-MOT [62, 63] and ID-MEASURE [64]
metrics4. Both metrics attempt to find a minimum-cost assignment between ground truth objects and predictions.
However, while CLEAR-MOT solves the assignment problem on a local per-frame basis, ID-MEASURE solves the
bipartite graph matching by finding the minimum cost of objects and predictions over all frames. For evaluating the
object detector, we used the Hellinger distance to compute the overlap between predicted and ground-truth detections,
and set the score and overlap thresholds to 0.5.
5 Results and Discussions
In this section, we present the results for evaluating our tracking-by-detection method in the CTC [39] datasets. We
evaluated our results in two manners: one by using only the training datasets with GT and comparing with other works
directly (see Section 4.2 for more details), and the other by submitting our codes to the CTC server5 in order to retrieve
the metrics scores and rank compared to other submitted works. We begin this section by briefly describing the baseline
methods used in the first evaluation methodology. Then, we present the results for both methodologies and discuss
them.
5.1 Baseline methods
We proceed to briefly describe the methods used as baseline for comparison with our proposal, highlighting the nature
of required training data.
KTH [43] segments cells using a bandpass filter followed by thresholding, and then uses the watershed algorithm to
split joined cells. The tracking graph is created by connecting cell segmentations in adjacent frames, and then solved by
iteratively finding the lowest cost path in the graph using Viterbi algorithm. It does not require any annotation.
EPFL [40] detects cells by fitting ellipses to binary segmented regions. It joins the detection on subsequent frames
using a tracking graph solved using integer linear programming (ILP). It requires annotation for segmentation, detection
and tracking.
HEID [40] detects cells by merging super-pixels clustering segmentation, which are obtained using watersheds.
Then, the tracking is retrieved by finding the global optimum of a graph model that represents cellular events using ILP.
It requires annotation for segmentation, detection, and tracking.
BLOB [41] detect cells using multiple elliptical filter banks, and performs tracking by iteratively finding the shortest
path in a model graph. It requires only tracking annotation, i.e., temporal cell associations.
CPN [8] first generates cell region proposals using an HBB object detector, and then finds the segmentation masks of
these regions using a deep learning segmentation network similar to the U-Net [11]. It performs tracking using ILP to
4We used a Python [61] implementation of these metrics available at: https://github.com/cheind/py-motmetrics
5Available at: http://celltrackingchallenge.net/
12
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
solve a graph for which the weights are set by training a random forest classifier with several histogram features. It
requires full annotation for detection, segmentation, and tracking.
DRL [14] uses the U-Net [11] model to produce the cell segmentation masks. Then, it uses deep reinforcement
learning to build the cost matrix that joins the cells of subsequent frames. It requires full annotation for detection,
segmentation, and tracking.
ST-TCV [44] detects cells using a joint spatio-temporal diffusion and region-based level-set optimization ap-
proach [65]. Then, it uses motion prediction and minimization of a global probabilistic function to join the cells of
subsequent frames. It does not require any annotation.
We did not include results for the methods U-Net [11], GC-ME [12], and U-Net S [13] because they do not follow the
same data split methodology (i.e., they employ images from both sequences in the training phase), and hence it would
define an unfair baseline for comparison.
5.2 Results for the CTC datasets
The results for comparing our method with SOTA approaches on the ISBI evaluation using separate sets are provided in
Table 2. We include in this table results for both using or not using the watershed algorithm for enlarging the detection
results.
Regarding the approximation of the cell masks using EBBs, we can observe from the EBB SEG column that it provides
a good fit for the GOWT1 and HeLa datasets. On the other hand, the EBB approximation is not very good for the
U373 dataset since there is strong variability in the cell shapes, as mentioned before. Finally, our method did not
achieve SOTA scores on the SEG metric, which is expected since we only approximate the cell masks through EBBs.
Nevertheless, it could reach close values to those on both the GOWT1 and HeLa datasets, and even get the second best
for the GOWT1-01.
For the DET and TRA metrics, we note that our approach achieves a considerable boost using the watershed post-
processing algorithm, particularly for the U373-02 dataset. We believe that this behavior is mostly due to the GT
annotation of the cell markers in the dataset, which is sometimes located at the boundary of the cells and might not
overlap completely with the EBB. Nevertheless, our method (without watershed) could reach SOTA results in both
GOWT1 datasets, while having the second-best result in U373-01. When applying the watershed mask augmentation,
our method reached SOTA scores on three datasets, and second best on other two. Regarding the degree of annotation
required for each technique, our method was capable of outperforming fully supervised methods (HEID [40], EPFL [40],
CPN [8] and DRL [14]) in most of the evaluated datasets. It also presented better results than the tracking-supervised
approach BLOB [41] and the unsupervised trackers KTH [43] and ST-TCV [44] in all datasets, except for HeLa-02
compared to the KTH method.
Table 3 report the results for evaluating our method on the CTC server 6 on the DET and TRA metrics with and without
the watershed method7. In this evaluation, our method was capable of achieving the TOP 3 rank on the DET metric for
the GOWT1 dataset using the watershed algorithm. Although it could not overcome the SOTA in any dataset, we can
observe a small difference between the scores of our method with those ranked as the top one. Furthermore, most of
the top-ranked algorithms are end-to-end trackers or use elaborated techniques to improve the predicted segmentation
masks from deep learning models (e.g., using model assemble or multiple refinement stages). In contrast, our proposed
method intends to provide a simple yet efficient method for tracking-by-detection that requires only per-frame OBB cell
annotations.
The results using standard detection and quality metrics are provided in Table 4. The detection results refer only to the
detector performance itself, i.e., it does not use the global data association to further eliminate false positive detections
and/or add false negative ones. This table evaluates different aspects of our method, enabling us to identify its strengths
and weakness better. Regarding the recall metric, we can observe that it could achieve high values on all datasets for
detection and tracking. However, it is noticeable that our method fails to eliminate false positive detections, which
impact the precision in both detection and tracking, as noted for dataset U373-01. On the other hand, the detector
precision in the GOWT1-02 dataset was also relatively low, but our global data association algorithm was capable of
eliminating most of the false positive detections and hence obtaining a higher precision value on the tracking metrics.
6Submitted implementation available at: http://celltrackingchallenge.net/participants/UFRGS-BR/
7Due to environment problems related to CUDA instructions on the CTC server computers, we could not reproduce the exact
same code used on our side. This ended up slightly harming the predicted EBB shapes and hence under-estimating the SEG metric,
and the DET and TRA metrics when the detections' shapes are not augmented with the watershed algorithm.
13
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Table 2: Results for the CTC [39] training datasets using separate sequences. Our results with the watershed method are
reported as Ours-W. Bold values mark the best results, while underline values mark the second best. We also report the
annotation requirements (Ann. Req. column) of each technique related to the detection (Det) and tracking (Tra)
.
Ann. Req.
Det. Tra.
Dataset
U373-01
GOWT1-02
GOWT1-01
Method
ST-TCV ✗
✗
KTH
✗
BLOB
✓
CPN
✓
DRL
✓
Ours
Ours-W ✓
ST-TCV ✗
✓
HEID
✓
EPFL
✗
KTH
✗
BLOB
✓
CPN
✓
DRL
✓
Ours
Ours-W ✓
✓
CPN
✓
DRL
✓
Ours
Ours-W ✓
✓
CPN
✓
DRL
✓
Ours
Ours-W ✓
ST-TCV ✗
✓
HEID
✓
EPFL
✗
KTH
✓
CPN
✗
BLOB
✓
Ours
Ours-W ✓
ST-TCV ✗
✓
HEID
✓
EPFL
✗
KTH
✓
CPN
✗
BLOB
✓
Ours
Ours-W ✓
* denotes augmentation on the segmentation masks.
U373-02
HeLa-02
HeLa-01
✗
✗
✓
✓
✓
✗
✗
✗
✓
✓
✗
✓
✓
✓
✗
✗
✓
✓
✗
✗
✓
✓
✗
✗
✗
✓
✓
✗
✓
✓
✗
✗
✗
✓
✓
✗
✓
✓
✗
✗
DET
SEG
EBB SEG
TRA
N/A
N/A
N/A
N/A
N/A
0.9916
0.9940
N/A
N/A
N/A
N/A
N/A
N/A
N/A
0.9812
0.9868
N/A
N/A
0.9647
0.9748
N/A
N/A
0.8822
0.9634
N/A
N/A
N/A
N/A
N/A
N/A
0.9779
0.9863
N/A
N/A
N/A
N/A
N/A
N/A
0.9707
0.9796
N/A
0.6849
0.7415
0.8506
0.8585
0.8568
-
N/A
N/A
N/A
0.8942
0.9046
0.8725
0.9181
0.8509
-
0.7336
0.8527
0.6307
-
0.7376
0.7735
0.5626
-
N/A
N/A
N/A
0.8018
0.8313
0.7951
0.7264
-
N/A
N/A
N/A
0.8366
0.8445
0.8390
0.7618
-
-
-
-
-
-
0.9268
-
-
-
-
-
-
-
-
0.9167
-
-
-
0.7791
-
-
-
0.7029
-
-
-
-
-
-
-
0.8871
-
-
-
-
-
-
-
0.8897
-
0.913
0.9462
0.9733
0.9864
0.9875
0.9914
0.9930
0.914
0.95
0.95
0.9452
0.9628
0.9719
0.9575
0.9817
0.9853
0.9594
0.9919
0.9671
0.9774
0.9346*
0.9318
0.8737
0.9525
0.816
0.80
0.98
0.9775
0.9869
0.9803
0.9758
0.9820
0.845
0.85
0.97
0.9747
0.9826
0.9771
0.9664
0.9740
14
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Table 3: Results from the CTC [39] challenge evaluation server. We report the results for our technique both using and
not the watershed mask augmentation (W column), the rank position over all submissions, and the relative difference to
the first rank method (To TOP1 column). Evaluation date: October 10, 2022.
DET
GOWT1
Dataset W
Score Rank
✗
26/49
0.925
✓ 0.970
3/49
✗
33/38
0.914
✓ 0.979
17/38
✗
15/48
0.986
✓ 0.989
10/48
U373
HeLa
To TOP1
5.61%
1.02%
7.68%
1.11%
0.80%
0.50%
TRA
Score Rank
19/40
0.922
4/40
0.959
26/31
0.909
12/31
0.976
11/39
0.984
8/39
0.988
To TOP1
5.82%
2.04%
7.72%
0.91%
0.91%
0.50%
Table 4: Results using standard detection and tracking quality metrics (in %), as described in Section 4.4.
Dataset
GOWT1-01
GOWT1-02
U373-01
U373-02
HeLa-01
HeLa-02
Tracking
Detection
ID-F1
97.9
95.2
88.9
81.5
94.6
93.1
ID-P
96.7
91.3
79.9
79.6
92.4
89.0
ID-R
99.0
99.6
100.0
83.6
96.8
97.6
R
99.9
100.0
100.0
96.0
100.0
100.0
P
97.5
91.7
79.9
91.4
95.4
91.2
MOTA R50
99.4
97.0
99.9
90.7
99.9
74.8
93.6
86.3
90.8
94.0
95.0
89.1
P50
97.0
83.7
79.0
90.1
96.5
93.5
F150 AP50
90.9
98.2
90.5
91.1
90.8
88.2
89.5
91.8
90.4
93.6
90.1
94.2
For U373-02, we can observe an inconsistency between the detection and tracking precision, which might be explained
by the inconsistency of the cell mark annotations mentioned in Section 4.4.
Table 5 shows a comparison of our tracking pipeline using our data association algorithm and a modified version using
the approach by [10] for computing the final tracks. We note that the proposed modifications only slightly improve the
DET and TRA metrics for most datasets, but they provide a significant reduction in the number of generated hypotheses.
As a consequence, it allows faster solution computation and fewer hardware requirements.
Finally, we provide visual detection results on the CTC [39] datasets on Figure 9. We can observe that EBBs provide a
good description of the cell shapes for the GOWT1 and HeLa datasets, but not so much for the U373 datasets. We can
also note the high recall rate of the object detector, since almost all cells are retrieved. Figure 10 presents the generated
tracking trees8. Analyzing the results for the GOWT1 and U373 datasets, which are less cluttered, we can observe that
our method could produce clear paths for most of the initial cells. These datasets have almost no mitosis or apoptosis
events, so the paths that seem to emerge in later frames can be false positives or cells emerging from the image borders.
8We also provide animated images in our GitHub repository at:
https://github.com/LucasKirsten/
Deep-Cell-Tracking-EBB/
Table 5: Results comparing our complete method and a modified version of [10] (Baseline).
Dataset
GOWT1-01
GOWT1-02
U373-01
U373-02
HeLa-01
HeLa-02
Method
Baseline
Ours
Baseline
Ours
Baseline
Ours
Baseline
Ours
Baseline
Ours
Baseline
Ours
DET
0.9914
0.9916
0.9803
0.9812
0.9655
0.9647
0.8818
0.8822
0.9772
0.9779
0.9699
0.9707
TRA
0.9913
0.9914
0.9805
0.9817
0.9677
0.9671
0.8733
0.8737
0.9741
0.9758
0.9652
0.9664
Hypothesis Time (s)
133
47
312
161
78
53
83
24
7989
7061
25525
22649
0.1234
0.0998
0.2280
0.2082
0.0891
0.0763
0.0918
0.0509
30.681
25.337
259.18
235.06
15
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
(a) GOWT1-01
(b) GOWT1-02
(c) HeLa-01
(d) HeLa-02
Figure 9: Visual results of our method in the CTC [39] training datasets. In green are the ground-truth segmentation
masks, and in red are the predicted EBBs.
(e) U373-01
(f) U373-02
16
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
(a) GOWT1-01
(b) GOWT1-02
(c) HeLa-01
(d) HeLa-02
(e) U373-01
(f) U373-02
Figure 10: Visualization of the generated tracking trees in the CTC [39] training datasets.
17
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
Figure 11: Impacts on the individual datasets evaluation from randomly sampling the hyper-parameters. The zero value
refers to an output metric value equal to the one reported in Table 2.
(a) DET metric
(b) TRA metric
Figure 12: Individual impacts of the hyper-parameters on the method performance using the SHAP values [66, 67]
regarding the DET and TRA metrics.
5.3 Sensitivity analysis
In this section, we analyze the sensitivity of our tracking-by-detection method regarding its hyper-parameters. We
randomly sampled the parameter values within an interval and evaluated the results on the CTC [39] tested training
datasets (i.e., with provided GT). The parameters were randomly sampled in the following scheme: λlink and λmit ∈ R+
linearly spaced between 5 and 1000 with step 25, tth ∈ N linearly ranging from 1 to 8 with step 1, τs ∈ R+ linearly
ranging from 0.4 to 0.9 with 0.05 step, and τF P ∈ R+ linearly ranging from 0.5 to 0.9 with 0.05 step. For consistently
evaluating the impact of the parameters on the different datasets, we subtracted the metrics values from the ones reported
in Table 2 when using the watershed method to show the relative gain or loss when changing the hyper-parameters.
Figure 11 shows a boxplot with the relative changes of the DET and TRA metrics for a set of ∼ 400 random combinations
of the hyper-parameters in each individual dataset. We can observe that the impact of changing the parameters is small
for most of the datasets. The worst-case scenario occurs on the U373-2 dataset, with a negative impact of ∼ 3.5% on the
TRA metric. On the other hand, we note that some combination of hyper-parameters can actually improve the results
obtained with the default parameters.
In order to access the impact of the individual hyper-parameters on the method, we used the Shapley Additive
Explanations (SHAP values) [66, 67] using the DET and TRA evaluation metrics as the targets and averaging the results
among all the CTC tested datasets. SHAP values provide insights into feature contributions, distributing credit among
features to explain machine learning predictions. They measure the impact of each feature compared to its absence or
average value, allowing a nuanced understanding of feature importance. Positive values increase predictions, negative
values decrease predictions, and zero values have no impact. Examining SHAP values helps identify influential features,
aiding feature selection, model debugging, and understanding model decisions. In our case, we adapted the method to
work with the hyper-parameters instead of the features. Figure 12 presents the violin plots, where the color indicates the
parameter value and the horizontal axis denotes the corresponding SHAP value. The small range of the horizontal axis
and concentration at small SHAP values indicate that the method is robust to the parameter choice. Furthermore, we
note that most random combinations of individual parameters lead to a positive impact on the metric scores.
18
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
6 Conclusions
We proposed a tracking-by-detection method that explores an OBB detector to identify cells, represent them as ellipses,
and then uses the detection information in an unsupervised tracking algorithm based on tracklet association. Our method
alleviates the annotation efforts by representing the cells as a 5-parameter oriented ellipses (that can be either annotated
as an OBB or EBB), and by defining an unsupervised tracking system oriented solely on the detection information
retrieved by the trained object detector. Our results demonstrate that the cell elliptical representation presents a good
approximation for the full segmentation mask, particularly for lineages with a regular shape. Furthermore, our tracking-
by-detection method can achieve results competitive to other state-of-the-art methods that require considerably more
annotated data. Moreover, our method reduces the hardware requirements for training and predicting when compared to
the current trend of end-to-end trackers, since it requires training only one object detector and does not rely on training a
complete detection and association deep learning architecture that needs both batches of frame images and their objects
associations. We believe that our method can be broadly used in applications where there are limited resources or short
deadlines for retrieving the full annotations.
References
[1] T. Q. Syed, V. Vigneron, S. Lelandais, G. Barlovatz-Meimon, M. Malo, C. Charrière-Bertrand, and C. Montagne,
"Detection and counting of" in vivo" cells to predict cell migratory potential," in 2008 First Workshops on Image
Processing Theory, Tools and Applications, pp. 1–8, IEEE, 2008.
[2] M. R. C. Leite, I. A. Cestari, and I. N. Cestari, "Computational tool for morphological analysis of cultured neonatal
rat cardiomyocytes," in 2015 37th Annual International Conference of the IEEE Engineering in Medicine and
Biology Society (EMBC), pp. 3517–3520, IEEE, 2015.
[3] D. Di Giuseppe, F. Corsi, A. Mencattini, M. C. Comes, P. Casti, C. Di Natale, L. Ghibelli, and E. Martinelli,
"Learning cancer-related drug efficacy exploiting consensus in coordinated motility within cell clusters," IEEE
Transactions on Biomedical Engineering, vol. 66, no. 10, pp. 2882–2888, 2019.
[4] D. Gradeci, A. Bove, G. Charras, A. R. Lowe, and S. Banerjee, "Single-cell approaches to cell competition:
high-throughput imaging, machine learning and simulations," in Seminars in cancer biology, vol. 63, pp. 60–68,
Elsevier, 2020.
[5] J. Hayashida, K. Nishimura, and R. Bise, "Consistent cell tracking in multi-frames with spatio-temporal context
by object-level warping loss," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer
Vision, pp. 1727–1736, 2022.
[6] N. Emami, Z. Sedaei, and R. Ferdousi, "Computerized cell tracking: Current methods, tools and challenges,"
Visual Informatics, vol. 5, no. 1, pp. 1–13, 2021.
[7] V. Ulman, M. Maška, K. E. Magnusson, O. Ronneberger, C. Haubold, N. Harder, P. Matula, P. Matula, D. Svoboda,
M. Radojevic, et al., "An objective comparison of cell-tracking algorithms," Nature methods, vol. 14, no. 12,
pp. 1141–1152, 2017.
[8] S. U. Akram, J. Kannala, L. Eklund, and J. Heikkilä, "Cell tracking via proposal generation and selection," arXiv
preprint arXiv:1705.03386, 2017.
[9] K. He, G. Gkioxari, P. Dollár, and R. Girshick, "Mask r-cnn," in Proceedings of the IEEE international conference
on computer vision, pp. 2961–2969, 2017.
[10] R. Bise, Z. Yin, and T. Kanade, "Reliable cell tracking by global data association," in 2011 IEEE International
Symposium on Biomedical Imaging: From Nano to Macro, pp. 1004–1010, IEEE, 2011.
[11] O. Ronneberger, P. Fischer, and T. Brox, "U-net: Convolutional networks for biomedical image segmentation," in
International Conference on Medical image computing and computer-assisted intervention, pp. 234–241, Springer,
2015.
[12] R. Bensch and O. Ronneberger, "Cell segmentation and tracking in phase contrast images using graph cut
with asymmetric boundary costs," in 2015 IEEE 12th International Symposium on Biomedical Imaging (ISBI),
pp. 1220–1223, IEEE, 2015.
[13] D. K. Gupta, N. de Bruijn, A. Panteli, and E. Gavves, "Tracking-assisted segmentation of biological cells," arXiv
preprint arXiv:1910.08735, 2019.
[14] J. Wang, X. Su, L. Zhao, and J. Zhang, "Deep reinforcement learning for data association in cell tracking,"
Frontiers in Bioengineering and Biotechnology, vol. 8, p. 298, 2020.
19
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
[15] V. Kulharia, S. Chandra, A. Agrawal, P. Torr, and A. Tyagi, "Box2seg: Attention weighted loss and discriminative
feature learning for weakly supervised segmentation," in European Conference on Computer Vision, pp. 290–308,
Springer, 2020.
[16] F. Xing, Y. Xie, H. Su, F. Liu, and L. Yang, "Deep learning in microscopy image analysis: A survey," IEEE
Transactions on Neural Networks and Learning Systems, vol. 29, no. 10, pp. 4550–4568, 2017.
[17] E. Moen, D. Bannon, T. Kudo, W. Graf, M. Covert, and D. Van Valen, "Deep learning for cellular image analysis,"
Nature methods, vol. 16, no. 12, pp. 1233–1246, 2019.
[18] U. Schmidt, M. Weigert, C. Broaddus, and G. Myers, "Cell detection with star-convex polygons," in International
Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 265–273, Springer, 2018.
[19] A. Newell, Z. Huang, and J. Deng, "Associative embedding: End-to-end learning for joint detection and grouping,"
in Advances in neural information processing systems, pp. 2277–2287, 2017.
[20] C. Payer, D. Štern, T. Neff, H. Bischof, and M. Urschler, "Instance segmentation and tracking with cosine
embeddings and recurrent hourglass networks," in International Conference on Medical Image Computing and
Computer-Assisted Intervention, pp. 3–11, Springer, 2018.
[21] C. Payer, D. Štern, M. Feiner, H. Bischof, and M. Urschler, "Segmenting and tracking cell instances with cosine
embeddings and recurrent hourglass networks," Medical image analysis, vol. 57, pp. 106–119, 2019.
[22] M. Zhao, A. Jha, Q. Liu, B. A. Millis, A. Mahadevan-Jansen, L. Lu, B. A. Landman, M. J. Tyska, and Y. Huo,
"Faster mean-shift: Gpu-accelerated clustering for cosine embedding-based cell segmentation and tracking,"
Medical Image Analysis, vol. 71, p. 102048, 2021.
[23] D. Liu, D. Zhang, Y. Song, H. Huang, and W. Cai, "Panoptic feature fusion net: a novel instance segmentation
paradigm for biomedical and biological images," IEEE Transactions on Image Processing, vol. 30, pp. 2045–2059,
2021.
[24] Z. Zhao, L. Yang, H. Zheng, I. H. Guldner, S. Zhang, and D. Z. Chen, "Deep learning based instance segmentation
in 3d biomedical images using weak annotation," in International Conference on Medical Image Computing and
Computer-Assisted Intervention, pp. 352–360, Springer, 2018.
[25] T. Zhao and Z. Yin, "Weakly supervised cell segmentation by point annotation," IEEE Transactions on Medical
Imaging, vol. 40, no. 10, pp. 2736–2747, 2020.
[26] H.-J. Oh, K. Lee, and W.-K. Jeong, "Scribble-supervised cell segmentation using multiscale contrastive regulariza-
tion," in 2022 IEEE 19th International Symposium on Biomedical Imaging (ISBI), pp. 1–5, IEEE, 2022.
[27] K. Lu, Y. Qian, J. Gong, Z. Zhu, J. Yin, L. Ma, M. Yu, and H. Wang, "Biofabrication of aligned structures
that guide cell orientation and applications in tissue engineering," Bio-Design and Manufacturing, vol. 4, no. 2,
pp. 258–277, 2021.
[28] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg, "Ssd: Single shot multibox
detector," in European conference on computer vision, pp. 21–37, Springer, 2016.
[29] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, "You only look once: Unified, real-time object detection," in
Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 779–788, 2016.
[30] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, "End-to-end object detection with
transformers," in European conference on computer vision, pp. 213–229, Springer, 2020.
[31] M. Tan, R. Pang, and Q. V. Le, "Efficientdet: Scalable and efficient object detection," in Proceedings of the
IEEE/CVF conference on computer vision and pattern recognition, pp. 10781–10790, 2020.
[32] C.-Y. Wang, A. Bochkovskiy, and H.-Y. M. Liao, "Scaled-yolov4: Scaling cross stage partial network," in
Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 13029–
13038, June 2021.
[33] J. Yang, C. Li, and J. Gao, "Focal modulation networks," arXiv preprint arXiv:2203.11926, 2022.
[34] S. Mandal and V. Uhlmann, "Splinedist: Automated cell segmentation with spline curves," in 2021 IEEE 18th
International Symposium on Biomedical Imaging (ISBI), pp. 1082–1086, IEEE, 2021.
[35] Y. Jiang, X. Zhu, X. Wang, S. Yang, W. Li, H. Wang, P. Fu, and Z. Luo, "R2cnn: Rotational region cnn for
orientation robust scene text detection," arXiv preprint arXiv:1706.09579, 2017.
[36] X. Yang, J. Yan, Z. Feng, and T. He, "R3det: Refined single-stage detector with feature refinement for rotating
object," in AAAI, 2021.
20
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
[37] G.-S. Xia, X. Bai, J. Ding, Z. Zhu, S. Belongie, J. Luo, M. Datcu, M. Pelillo, and L. Zhang, "Dota: A large-scale
dataset for object detection in aerial images," in The IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), June 2018.
[38] X. Yang, X. Yang, J. Yang, Q. Ming, W. Wang, Q. Tian, and J. Yan, "Learning high-precision bounding box for
rotated object detection via kullback-leibler divergence," in Advances in Neural Information Processing Systems
(M. Ranzato, A. Beygelzimer, Y. Dauphin, P. Liang, and J. W. Vaughan, eds.), vol. 34, pp. 18381–18394, Curran
Associates, Inc., 2021.
[39] M. Maška, V. Ulman, D. Svoboda, P. Matula, P. Matula, C. Ederra, A. Urbiola, T. España, S. Venkatesan,
D. M. Balak, et al., "A benchmark for comparison of cell tracking algorithms," Bioinformatics, vol. 30, no. 11,
pp. 1609–1617, 2014.
[40] E. Türetken, X. Wang, C. Becker, C. Haubold, and P. Fua, "Globally optimal cell tracking using integer program-
ming," arXiv preprint arXiv:1501.05499, 2015.
[41] S. U. Akram, J. Kannala, L. Eklund, and J. Heikkilä, "Joint cell segmentation and tracking using cell proposals,"
in 2016 IEEE 13th International Symposium on Biomedical Imaging (ISBI), pp. 920–924, IEEE, 2016.
[42] K. Nishimura, J. Hayashida, C. Wang, D. F. E. Ker, and R. Bise, "Weakly-supervised cell tracking via backward-
and-forward propagation," in European Conference on Computer Vision, pp. 104–121, Springer, 2020.
[43] K. E. Magnusson and J. Jaldén, "A batch algorithm using iterative application of the viterbi algorithm to track
cells and construct cell lineages," in 2012 9th IEEE International Symposium on Biomedical Imaging (ISBI),
pp. 382–385, IEEE, 2012.
[44] F. Boukari and S. Makrogiannis, "Automated cell tracking using motion prediction-based matching and event
handling," IEEE/ACM transactions on computational biology and bioinformatics, vol. 17, no. 3, pp. 959–971,
2018.
[45] B. Xu, J. Shi, M. Lu, J. Cong, L. Wang, and B. Nener, "An automated cell tracking approach with multi-bernoulli
filtering and ant colony labor division," IEEE/ACM transactions on computational biology and bioinformatics,
vol. 18, no. 5, pp. 1850–1863, 2019.
[46] O. Hirose, S. Kawaguchi, T. Tokunaga, Y. Toyoshima, T. Teramoto, S. Kuge, T. Ishihara, Y. Iino, and R. Yoshida,
"Spf-celltracker: Tracking multiple cells with strongly-correlated moves using a spatial particle filter," IEEE/ACM
transactions on computational biology and bioinformatics, vol. 15, no. 6, pp. 1822–1831, 2017.
[47] J. M. Llerena, L. F. Zeni, L. N. Kristen, and C. Jung, "Gaussian bounding boxes and probabilistic intersection-
over-union for object detection," arXiv preprint arXiv:2106.06072, 2021.
[48] Z. Chen, K. Chen, W. Lin, J. See, H. Yu, Y. Ke, and C. Yang, "Piou loss: Towards accurate oriented object
detection in complex environments," in European conference on computer vision, pp. 195–211, Springer, 2020.
[49] J. Murrugarra-Llerena, L. N. Kirsten, and C. R. Jung, "Can we trust bounding box annotations for object detection?,"
in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops,
pp. 4813–4822, June 2022.
[50] X. Yang, J. Yan, M. Qi, W. Wang, Z. Xiaopeng, and T. Qi, "Rethinking rotated object detection with gaussian
wasserstein distance loss," in International Conference on Machine Learning (ICML), 2021.
[51] A. Bhattacharyya, "On a measure of divergence between two multinomial populations," Sankhy ̄a: the indian
journal of statistics, pp. 401–406, 1946.
[52] E. Hellinger, "Neue begründung der theorie quadratischer formen von unendlichvielen veränderlichen.," Journal
für die reine und angewandte Mathematik, vol. 1909, no. 136, pp. 210–271, 1909.
[53] T. Kailath, "The divergence and bhattacharyya distance measures in signal selection," IEEE transactions on
communication technology, vol. 15, no. 1, pp. 52–60, 1967.
[54] H. W. Kuhn, "The hungarian method for the assignment problem," Naval research logistics quarterly, vol. 2,
no. 1-2, pp. 83–97, 1955.
[55] S. Huh, R. Bise, M. Chen, T. Kanade, et al., "Automated mitosis detection of stem cell populations in phase-contrast
microscopy images," IEEE transactions on medical imaging, vol. 30, no. 3, pp. 586–596, 2010.
[56] G. Bradski, "The OpenCV Library," Dr. Dobb's Journal of Software Tools, 2000.
[57] L. Liu, W. Ouyang, X. Wang, P. Fieguth, J. Chen, X. Liu, and M. Pietikäinen, "Deep learning for generic object
detection: A survey," International journal of computer vision, vol. 128, no. 2, pp. 261–318, 2020.
[58] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE
conference on computer vision and pattern recognition, pp. 770–778, 2016.
21
Cell Tracking-by-detection using Elliptical Bounding Boxes
A PREPRINT
[59] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, "Imagenet: A large-scale hierarchical image database,"
in 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255, Ieee, 2009.
[60] J. Forrest, T. Ralphs, H. G. Santos, S. Vigerske, J. Forrest, L. Hafer, B. Kristjansson, jpfasano, EdwinStraver,
M. Lubin, rlougee, jpgoncal1, Jan-Willem, h-i gassmann, S. Brito, Cristina, M. Saltzman, tosttost, B. Pitrus,
F. MATSUSHIMA, and to st, "coin-or/cbc: Release releases/2.10.8," May 2022.
[61] G. Van Rossum and F. L. Drake Jr, Python reference manual. Centrum voor Wiskunde en Informatica Amsterdam,
1995.
[62] K. Bernardin and R. Stiefelhagen, "Evaluating multiple object tracking performance: the clear mot metrics,"
EURASIP Journal on Image and Video Processing, vol. 2008, pp. 1–10, 2008.
[63] A. Milan, L. Leal-Taixé, I. Reid, S. Roth, and K. Schindler, "Mot16: A benchmark for multi-object tracking,"
arXiv preprint arXiv:1603.00831, 2016.
[64] E. Ristani, F. Solera, R. Zou, R. Cucchiara, and C. Tomasi, "Performance measures and a data set for multi-target,
multi-camera tracking," in European conference on computer vision, pp. 17–35, Springer, 2016.
[65] F. Boukari and S. Makrogiannis, "Joint level-set and spatio-temporal motion detection for cell segmentation,"
BMC Medical Genomics, vol. 9, no. 2, pp. 179–194, 2016.
[66] S. M. Lundberg and S.-I. Lee, "A unified approach to interpreting model predictions," in Advances in Neural
Information Processing Systems 30 (I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan,
and R. Garnett, eds.), pp. 4765–4774, Curran Associates, Inc., 2017.
[67] S. M. Lundberg, B. Nair, M. S. Vavilala, M. Horibe, M. J. Eisses, T. Adams, D. E. Liston, D. K.-W. Low, S.-F.
Newman, J. Kim, et al., "Explainable machine-learning predictions for the prevention of hypoxaemia during
surgery," Nature Biomedical Engineering, vol. 2, no. 10, p. 749, 2018.
22
|
|
http://arxiv.org/abs/2310.04889v1 | "2023-10-07T18:21:35" | "2023-10-07T18:21:35" | GradXKG: A Universal Explain-per-use Temporal Knowledge Graph Explainer | Temporal knowledge graphs (TKGs) have shown promise for reasoning tasks by
incorporating a temporal dimension to represent how facts evolve over time.
However, existing TKG reasoning (TKGR) models lack explainability due to their
black-box nature. Recent work has attempted to address this through customized
model architectures that generate reasoning paths, but these recent approaches
have limited generalizability and provide sparse explanatory output. To enable
interpretability for most TKGR models, we propose GradXKG, a novel two-stage
gradient-based approach for explaining Relational Graph Convolution Network
(RGCN)-based TKGR models. First, a Grad-CAM-inspired RGCN explainer tracks
gradients to quantify each node's contribution across timesteps in an efficient
"explain-per-use" fashion. Second, an integrated gradients explainer
consolidates importance scores for RGCN outputs, extending compatibility across
diverse TKGR architectures based on RGCN. Together, the two explainers
highlight the most critical nodes at each timestep for a given prediction. Our
extensive experiments demonstrated that, by leveraging gradient information,
GradXKG provides insightful explanations grounded in the model's logic in a
timely manner for most RGCN-based TKGR models. This helps address the lack of
interpretability in existing TKGR models and provides a universal explanation
approach applicable across various models. | [
"Chenhan Yuan",
"Hoda Eldardiry"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04889v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04889v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CL"
] | GradXKG: A Universal Explain-per-use Temporal Knowledge
Graph Explainer
Chenhan Yuan
The University of Manchester
Manchester, UK
chenhan.yuan@manchester.ac.uk
Hoda Eldardiry
Virginia Tech
Blacksburg, U.S.
hdardiry@vt.edu
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
9
8
8
4
0
.
0
1
3
2
:
v
i
X
r
a
ABSTRACT
Temporal knowledge graphs (TKGs) have shown promise for reason-
ing tasks by incorporating a temporal dimension to represent how
facts evolve over time. However, existing TKG reasoning (TKGR)
models lack explainability due to their black-box nature. Recent
work has attempted to address this through customized model archi-
tectures that generate reasoning paths, but these recent approaches
have limited generalizability and provide sparse explanatory out-
put. To enable interpretability for most TKGR models, we propose
GradXKG, a novel two-stage gradient-based approach for explain-
ing Relational Graph Convolution Network (RGCN)-based TKGR
models. First, a Grad-CAM-inspired RGCN explainer tracks gra-
dients to quantify each node's contribution across timesteps in
an efficient "explain-per-use" fashion. Second, an integrated gradi-
ents explainer consolidates importance scores for RGCN outputs,
extending compatibility across diverse TKGR architectures based
on RGCN. Together, the two explainers highlight the most critical
nodes at each timestep for a given prediction. Our extensive ex-
periments demonstrated that, by leveraging gradient information,
GradXKG provides insightful explanations grounded in the model's
logic in a timely manner for most RGCN-based TKGR models. This
helps address the lack of interpretability in existing TKGR models
and provides a universal explanation approach applicable across
various models.
CCS CONCEPTS
• Computing methodologies → Temporal reasoning.
KEYWORDS
Temporal knowledge graph, explainable AI, temporal knowledge
graph reasoning, event forecasting, gradients-based explanation
ACM Reference Format:
Chenhan Yuan and Hoda Eldardiry. 2018. GradXKG: A Universal Explain-
per-use Temporal Knowledge Graph Explainer. In Proceedings of Make
sure to enter the correct conference title from your rights confirmation emai
(Conference acronym 'XX). ACM, New York, NY, USA, 10 pages. https:
//doi.org/XXXXXXX.XXXXXXX
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation
on the first page. Copyrights for components of this work owned by others than ACM
must be honored. Abstracting with credit is permitted. To copy otherwise, or republish,
to post on servers or to redistribute to lists, requires prior specific permission and/or a
fee. Request permissions from permissions@acm.org.
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
© 2018 Association for Computing Machinery.
ACM ISBN 978-1-4503-XXXX-X/18/06. . . $15.00
https://doi.org/XXXXXXX.XXXXXXX
1 INTRODUCTION
Since knowledge graphs are dynamic in nature, i.e., evolve over
time, Temporal Knowledge Graphs (TKG) have a promising po-
tential in the fields of question answering [10, 21], event fore-
casting [2, 15], and information retrieval [6]. Unlike conventional
static knowledge graphs, which represent each fact with a triplet
(sub ject, relation, ob ject), temporal knowledge graphs incorporate
a temporal dimension to represent how facts and relations evolve
over time. In general, a temporal knowledge graph represents each
fact using a quadruple (sub ject, relation, ob ject, timestamp). Con-
ventionally, a temporal knowledge graph is represented by decom-
posing it into a sequence of static knowledge graphs, each of which
contains all facts at the corresponding timestamp.
TKGs provide new perspectives and insights for many down-
stream applications, e.g., disease diagnosis aid[4] and stock pre-
diction [3]. The unique promise of TKGs has sparked a growing
interest in reasoning over TKG. TKG reasoning (TKGR) is a task
to validate whether a query relationship between two entities is
true, given the context provided by the TKG. With the rise of graph
neural networks (GNN), most existing TKGR methods first leverage
Relational Graph Convolutional Networks (RGCNs) [22], a type of
GNN well-suited for multi-relational graphs like TKGs, to encode
the local graph structure into dense vector representations. Various
neural architectures are then applied on top of the RGCN encodings
to score the validity of the query relationship. For instance, cur-
riculum learning and neural ordinary differential equations have
been used to enhance TKGR performance [8, 13]. While RGCN-
based TKGR models have achieved significant improvements over
general neural network models, RGCN-based TKGR models still
lack explainability due to their end-to-end black-box nature. The
reasoning process behind their predictions is opaque. This lack of
explainability is a critical limitation because explainability is crucial
for trustworthy AI systems.
Recent work has attempted to address this limitation by de-
signing customized model architectures that can generate reason-
ing paths along with the prediction results. For example, Time-
Traveler [25] proposed a reinforcement learning-based explainable
TKGR model that works as follows. Given a query: (Governor (Cote
d'Ivoire), Make an appeal or request, ?, 2018/10/14), it generates the
reasoning path: (Governor (Cote d'Ivoire), Praise or endorse, Party
Member, 2018/10/12)→(Party Member, Make an appeal or request,
Citizen, 2018/9/29). However, existing explainable TKGR models
have two critical problems: 1) They are constrained by requiring
custom-designed model architectures to enable reasoning path gen-
eration. This leads to a lack of generalizability, which is a major
drawback, as it prevents easy application to the myriad of most
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Chenhan Yuan and Hoda Eldardiry
Figure 1: Comparison between the proposed GradXKG and
conventional explainable TKGR models (xTKGR). Node color
shade represents node importance; darker yellow is more
important than lighter yellow. Dashed arrows denote the
same entities in different timestamps. e? is the query entity.
non-explainable TKGR models, i.e., RGCN-based models. 2) As il-
lustrated in Fig 1, current explainable TKGR models only provide
reasoning paths with very few nodes per static knowledge graph.
This sparse explanatory output fails to capture the complex in-
terdependencies within the broader knowledge graph context. In
particular, it is difficult to fully trust or evaluate the faithfulness of
explanations without the ability to account for the potential impact
of other entities.
To address these challenges, it is necessary to design a universal
explainer that can work for most RGCN-based TKGR models. A sim-
ple and intuitive possible approach is to follow the GNNExplainer
method, by masking a node/edge in the TKG, and observing its
impact on the TKGR model prediction performance. [31]. However,
to obtain the importance of all nodes across all timestamps, the
GNNExplainer-based method requires repeating the test at least
O (n ∗ m) times; where n is the number of nodes and m is the num-
ber of timestamps for various inputs; as shown in Fig 2. This is
an exhaustive process that scales poorly as the knowledge graph
grows. We propose a more efficient approach to design a universal
explainer. More specifically, we propose a universal TKGR model
explainer that works by analyzing the model's gradients. In doing
so, it provides real-time rationales for each individual prediction,
elucidating the model's logic in an accessible "explain-per-use" fash-
ion.
In this paper, we propose GradXKG: a novel two-stage approach
for generating explanations of RGCN-based temporal knowledge
graph reasoning (TKGR) models. Our proposed GradXKG approach
bridges a critical gap in universal explainable temporal knowledge
graph reasoning. Our method leverages gradient information to
highlight the most influential nodes across timesteps. First, a Grad-
CAM-inspired RGCN explainer tracks gradients flowing into each
node at each timestep, quantifying the contribution of that node
to the RGCN output tensors in each run. Secondly, to extend the
compatibility of our proposed approach to TKGR architectures that
utilize RGCN, we propose an integrated gradients-based top-layer
Figure 2: Comparison between the proposed GradXKG and
perturbation-based methods. g(*) denotes TKGR models.
Perturbation-based methods require at least n times running
to determine node importance in TKG.
explainer. This proposed explainer layer tracks the contribution of
RGCN output tensors toward the final prediction in the top layer of
these TKGR models. Moreover, the top-layer explainer associates
RGCN output tensors with prediction scores regardless of the model
specifics. This allows our approach to be applicable to any neural
network-based RGCN TKGR model. Together, the two explainers
produce a heat map spotlighting the most critical nodes at each
timestep for a given prediction. Going beyond perturbation-based
approaches, our proposed "explain-per-use" mechanism provides
explanations that are tailored to each individual prediction in a time-
efficient manner. Furthermore, GradXKG enables interpretability
within most RGCN-based TKGR models. This is achieved by gener-
ating explanations that are informed by gradient information.
Our main contributions can be summarized as follows:
• We proposed the first novel gradient-based two-stage RGCN-
based TKGR explanation approach (GradXKG) that can ex-
plain all RGCN-based TKGR models. To the best of our knowl-
edge, this is the first effort in this research area.
• We proposed a Grad-CAM-based RGCN-explainer in an
"explain-per-use" fashion, which significantly reduces time
complexity compared to perturbation methods.
• We proved that our proposed explainer can be approximated
to the Grad-CAM GCN model if both are unsigned.
• Our extensive experiments demonstrate that the proposed
GradXKG can outperform other explanation methods in
terms of explanation sufficiency and accuracy.
2 RELATED WORK
2.1 Temporal Knowledge Graph Reasoning
Models
Temporal knowledge graph reasoning is an emerging field that aims
to model the evolution of real-world events and their relationships
over time. This task involves two key settings: interpolation, which
focuses on completing knowledge graphs over a given time span,
and extrapolation, which forecasts future facts based on histori-
cal data [13, 15]. Early work on extrapolation like Know-Evolve
utilized temporal point processes to capture continuous-time dy-
namics [27]. However, graph neural networks (GNNs) have since
become the dominant modeling approach due to their ability to
GradXKGxTKGRGradXKGgradientstrackingremove node(s)selectionrepeat n timesPerturbationGradXKG: A Universal Explain-per-use Temporal Knowledge Graph Explainer
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
encode both structural and temporal dependencies. In particular,
relational GCNs (RGCNs) have emerged as a powerful tool for
temporal knowledge graph reasoning [22]. RE-NET pioneered the
use of RGCNs with an autoregressive encoder to model long-term
temporal patterns [11]. RE-GCN further improved modeling by
emphasizing graph dependency learning [15]. Later, Zhang et al.
proposed a hierarchical RGCN to learn both long global and short
local representations of temporal knowledge graphs [34]. Han et al.
adapted neural ordinary differential equations on RGCN so that they
can be applied in continuous space as temporal knowledge graphs
vary continuously over time [8]. To better forecast unseen entities
and relations, MTKGE utilized meta-learning to sample from exist-
ing temporal knowledge graphs to simulate future scenarios [29].
CENET learned both historical and non-historical dependency and
distinguished the dependency type of predicted events using con-
trastive learning [30]. Li et al.consider the length, diversity, and
time-variability of evolutional patterns by introducing curriculum
learning and online learning [13]. Overall, the ubiquity of RGCNs
in TGKR models demonstrates their importance for encoding local
graph structures, on top of which more complex temporal reasoning
techniques can be developed.
Several other approaches generate predictions along with vali-
dated reasons. These explainable techniques can be categorized into
three main types: logic rule-based, reinforcement learning-based,
and attention-based. Logic rule mining is a popular technique for
explainable forecasting on temporal knowledge graphs. TLogic
extracts logic rules from the graph via temporal walk estimation
and then applies the rules to make predictions [17]. Lin et al. train
encoders to incorporate both graph structures and logic rules[16].
Reinforcement learning has also been leveraged for explainable
reasoning. Sun et al. developed an RL agent that travels optimal
paths on the knowledge graph to predict future events [25]. The
agent's trajectory explains its decision-making. Similarly, Li et al.
first find relevant event clusters and then use RL search to forecast
those subgroups [14]. Attention mechanisms are another way to en-
able explainability. Some methods learn to expand an initial query
by attending to important neighboring nodes [7]. The attended
subgraphs indicate the influential regions for prediction. Jung et
al. also apply graph attention to iteratively propagate attention
weights towards target nodes and use these weights to provide
model interpretability [12].
2.2 Graph Neural Networks Explanation
GNN explainers can be broadly classified into two distinct cate-
gories: perturbation-based methods and gradient-based methods [32].
Perturbation-based explainers identify important graph compo-
nents (nodes, edges, or features) by removing or masking compo-
nents and measuring the resulting impact on model predictions.
A significant change in predictions when a component is masked
indicates high relevance. For example, GNNExplainer identifies
compact subgraph structures that are important for a prediction by
using mutual information to quantify the difference between predic-
tions on the original versus perturbed graph [31]. SubgraphX also
masks substructures but uses Shapley values to measure subgraph
importance based on contribution to the model output [33]. Another
Figure 3: General architecture of an RGCN-based TKGR
model. We propose to explain an RGCN-based TKGR model
by decomposing it into two sub-modules: RGCN explainer
and Top-layer explainer.
perturbation-based method called PGM-Explainer illustrates depen-
dencies between important features and provides interpretations
of a model's reasoning using Bayesian network concepts [28].
In contrast, gradient-based explainers focus directly on analyzing
gradient information flow through the neural network model itself.
The key idea is that components with high gradient magnitude
likely have high relevance or impact on predictions. For example,
GNN-LRP utilizes layer-wise relevance propagation, a technique
that redistributes relevance scores based on neural network acti-
vations, to generate detailed explanations of predictions [1, 23].
GraphLIME adapts a popular local explanation method called LIME,
which stands for Local Interpretable Model-Agnostic Explanations,
to graph domains using nonlinear feature selection [9, 20]. Some
methods extend gradient visualization techniques like Grad-CAM,
originally designed for convolutional neural networks, to graph
neural networks to improve explainability [18, 19, 24].
3 PROPOSED GRADXKG METHOD
Conventionally, as shown in Fig. 3, an RGCN-based temporal knowl-
edge graph reasoning model utilizes the Relational Graph Convolu-
tional Network (RGCN) as the base model to encode graph informa-
tion in each individual timestamp. On top of RGCN outputs, various
reasoning methods are deployed, such as curriculum learning [13],
and autoregressive encoder [11], to yield a score ranging from 0-
1 that indicates if the query triplet will happen in the future or
not. The process can be formally defined as follows: Suppose a set
G = {G1, G2, * * * .GT } represents the individual static knowledge
graph in each timestamp t, a regular temporal knowledge graph
reasoning model can be defined as:
s = f (H1, H2, * * * , Ht )
Hi = RGCN (Gi )
(1)
where RGCN (*) is the RGCN model that takes each static knowl-
edge graph as input. f (*) represents the complex temporal knowl-
edge graph reasoning model that outputs a scalar score s. As shown
RGCNRGCNRGCNRGCN explainerTop-layerexplainerGradXKGConference acronym 'XX, June 03–05, 2018, Woodstock, NY
Chenhan Yuan and Hoda Eldardiry
in the Eq. 1, our explanation method can also be decomposed into
two parts: Grad-CAM-based RGCN explanation, i.e., RGCN (*) ex-
plainer, and a universal top-layer explanation, i.e., f (*) explainer.
3.1 Gradient-based RGCN Explainer
We start deriving our method from a simple setting: Assume that
only the RGCN model itself is used in the temporal knowledge
graph reasoning model. Then we have s = RGCN (Gi ) following
Eq. 1. That is, the output of RGCN is a scalar that indicates the
prediction of the whole model. We propose to design a gradient-
based RGCN explainer method to explain this simple architecture.
Currently, the most popular gradient-based convolutional neural
network (CNN) explanation method, Grad-CAM, has been success-
fully extended to graph convolutional networks (GCN) as GCN
shares the similar convolutional layer as CNN [19, 24]. The key
idea of GCN Grad-CAM is to use the gradients of the target classifi-
cation flowing into the final convolutional layer to produce a coarse
localization map highlighting the important nodes for predicting
the classification result. Formally, the first step of GCN-based Grad-
CAM is to determine the k'th graph convolutional feature map at
layer l:
k (X, A) = σ ( ̃D − 1
Ml
2 ̃A ̃D − 1
2 Ml −1 (X, A)W l
k )
(2)
where X ∈ RN ×dx is the representation of the nodes, N is the
number of nodes in the graph, and A ∈ Rdx ×dx is the adjacency
matrix. ̃A = A + IN is the adjacency matrix of the undirected graph
̃Ai j ,
with added self-connections. IN is the identity matrix, ̃Dii = (cid:205)j
and W l
is the k-th column of matrix Wk . Then the importance score
k
In can be used to generate a heat map for a node n defined as follows:
αl
k =
IGCN
n
=
1
N
1
L
N
∑︁
n=1
L
∑︁
l=1
∂y
k,n (X, A)
∂Ml
(3)
ReLU (
k Ml
αl
k,n (X, A))
∑︁
k
where Ml
k,n (X, A)) denotes the k'th feature at the l'th layer of node
n. That is, the importance score of each node is a weighted sum over
all feature columns associated with each node. However, despite
the success of this simple yet effective gradient-based approach,
it cannot be directly applied to the RGCN model. This is because
the RGCN model binds different relational edges with different
matrices so no W l
can be defined for the RGCN model. This can be
k
formally observed in the following definition of the RGCN model:
h (l+1)
i
∑︁
= σ (cid:169)
(cid:173)
r ∈ R
(cid:171)
∑︁
j ∈ Nr
i
1
ci,r
W (l )
r h (l )
j + W (l )
0 h (l )
i (cid:170)
(cid:174)
(cid:172)
,
(4)
where Nr
i denotes the set of neighbor indices of node i under
relation r ∈ R and h (
i l) is the hidden state of node i in layer l.
ci,r is a normalization constant. As shown in the Eq. 4, the hidden
representation of node i in layer l + 1 is contributed by a set of
relation matrices W l
r instead of one W l . Therefore, Eq. 3 cannot be
directly applied to the RGCN model.
To extend the compatibility of GCN Grad-CAM to RGCN, we
first convert Eq. 4 into matrix graph representation form:
H (l+1) = σ
(cid:32)
∑︁
r ∈R
Ar H (l )W (l )
r
+ IN H (l )W (l )
0
(cid:33)
(5)
where Ar is a relation-specific adjacency matrix as shown in the
following equation.
Ar,i,j =
(cid:26) 1
0
E (i, j) ∈ r
else
(6)
where E (i, j) ∈ ∇ means the edge between nodes i and j represents
relation type r . In this way, we can define the k-th RGCN feature
map at layer l under each relation individually. Formally, combining
Eq. 5 and Eq. 3, the k-th RGCN feature map under relation r can be
derived as follows:
H (l+1)
k,r
r,k + IN H (l )W (l )
(cid:16)
Ar H (l )W (l )
= σ
0,k
(7)
(cid:17)
Then the relation-dependent gradient-based weight αl
for k-th
feature in l-th layer under r -th relation can be derived as follows:
k,r
αl
k,r =
1
N
N
∑︁
n=1
N
∑︁
∂Hl
∂s
k,n,r (X, A)
∂y
∂σ (*)
(8)
=
1
N
∂σ (*)
k,n,r (X, A)
where s is the final score. In this way, the weights derived here are
always associated with one specific relation.
r,k + INW (l )
(cid:16)
ArW (l ) )
∂Hl −1
n=1
0,k
(cid:17)
Following a similar procedure as in Eq. 3, the importance score
In,r,l for node n from layer l under relation r is defined as follows:
∑︁
I RGCN
n,r,l
= ReLU (
k,r Hl
αl
k,n,r (X, A))
(9)
We use the average In,r,l as the final importance score:
k
I RGCN
n,r
=
1
L
L
∑︁
l=1
I RGCN
n,r,l
(10)
Note that the implementation complexity of Eq. 9 increases as the
number of relations increases. Therefore, we propose the following
approximation that averages over the relation r dimension:
I RGCN
n
≈
1
R
R
∑︁
r =1
1
L
L
∑︁
l=1
I RGCN
n,r,l
(11)
3.2 Theoretical Analysis of RGCN Grad-CAM
We provide a theoretical analysis of the proposed Grad-CAM-based
RGCN explainer in this section. First, note that the derived RGCN
explainer is equivalent to the original GCN Grad-CAM if the output
is unsigned. Formally, we define the equivalence theorem as follows:
Theorem 1. I RGCN
n
≈ IGCN
n
iff. both I RGCN
n
and IGCN
n
are
unsigned.
Proof. To prove the equivalence theorem, we first convert Eq. 3
into unsigned format by removing the ReLU (*) function:
L
∑︁
∑︁
k Ml
αl
k,n (X, A)
IGCN
n
=
1
L
l=1
k
(12)
GradXKG: A Universal Explain-per-use Temporal Knowledge Graph Explainer
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
k,n (X, A)
Then the I RGCN
n
can be derived as follows:
I RGCN
n
=
=
1
R
1
R
R
∑︁
r =1
R
∑︁
r =1
L
∑︁
1
L
1
L
L
∑︁
l=1
L
∑︁
l=1
In,r,l
ReLU (
∑︁
k
αl
k,r Hl
k,n,r (X, A))
1
R
R
∑︁
r =1
∑︁
k
αl
k,r Hl
k,n,r (X, A) (unsigned)
⇒
1
L
1
L
=
l=1
L
∑︁
∑︁
βl
k,n (X, A)
k
n
with IGCN
n
, the only difference is between βl
l=1
Comparing I RGCN
and αl
k,n (X, A). However, we consider that βl
Ml
k,n (X, A) represents
k
the averaged k-th feature along r dimension, which is equivalent
αl
□
k
k,n (X, A). Therefore, we have I RGCN
Ml
Directly applying Eq. 4 to relational graphs in practice can lead to
over-fitting on rare relations as the number of relations can rapidly
grow. Therefore, the original RGCN provides a linear combination
of basis transformations to represent relation matrices Wr . It is
defined as follows:
≈ IGCN
n
n
.
W (l )
r
=
B
∑︁
b=1
a (l )
rb
V (l )
b
(14)
b ∈ Rdr ×do is the b-th basis in layer l. Note that this de-
where V l
composition method is consistent with Theorem 1.
Theorem 2. THEOREM 1 holds when W (l )
Proof. To prove Theorem 2, we first convert the decomposition
b=1 a (l )
V (l )
b
= (cid:205)B
rb
r
equation into a matrix form:
= U l
r B (l )
W (l )
(15)
r
r ∈ R1×B
where Bl ∈ RB×dr ×do is the stack of the set of all basis. U l
is a linear combination of all coefficients a (l )
. We can therefore
rb
derive the hidden layer of RGCN under basis decomposition as
follows:
H (l+1) = σ
(cid:32)
∑︁
r ∈R
Ar H (l ) [U l
r B (l ) ] + IN H (l )W (l )
0
(cid:33)
(16)
r B (l ) ] is equivalent to the original W l
Note that [U l
matrix shape. Therefore, the computation of αl
(Eq. 8∼11)remains unchanged. As the final I RGCN
same format, Theorem 1 still holds.
r in terms of
k,n,r (X, A)
preserves the
□
and Hl
k,r
n
3.3 Top-Layer Integration
3.3.1 Top-Layer Explanation Method. We proposed a top-layer ex-
planation method that is model-agnostic so it can work with any
model type in the layers above the RGCN. In particular, we utilize
the integrated gradients method to quantify the contribution of
each tensor to the model prediction for the layers above the RGCN.
Integrated gradients is an explanation method by attributing a pre-
diction to individual features [26]. The integrated gradients method
then calculates the contribution of each feature by integrating the
gradients of the model's output with respect to that feature. This
calculation is carried out along a path from a baseline input to the ac-
tual input. Formally, the integrated gradients for a one-dimensional
tensor x can be defined as follows:
IG (x) ::= (x − x ′)
∫ 1
α=0
∂f (x ′ + α (x − x ′))
∂x
dα
(17)
(13)
where f (*) denotes the general neural network function and x ′ is
the base input. In practice, x ′ is set to random or zeros.
Note that the integral part of Eq. 17 is not applicable in neural
networks. Therefore, we approximate the Eq. 17 by summing over
small intervals. Then we have:
p
∑︁
∂f (x ′ +
IG (x) ≈ (x − x ′)
(18)
p
α (x − x ′))
∂x
1
p
where p is the sampling times.
α=1
3.3.2 Explanation Integration. Our proposed RGCN explainer pro-
vides node-level explanations by quantifying each node's contribu-
tion to the final predicted scalar score s, as shown in Eq. 8. However,
this formulation assumes that the RGCN model outputs s directly,
which is not always true, since many models integrate RGCN as
an intermediate component. In this case, additional processing is
applied to the RGCN outputs before producing the final predic-
tion. Our proposed RGCN explainer further considers cases when
models include intermediate RGCN components by propagating
explanations through intermediate components to subsequent lay-
ers. For example, given an intermediate tensor t generated by the
RGCN, we compute explanations in two steps. First, we compute
the importance of each node to generate t. Second, we compute the
importance of t to generate the final prediction. Finally, each node's
final explanation is the sum of the nodes contribution to t combined
with t's contribution to the final prediction. More formally, for a
model defined as in Eq. 1, the derivation of the final predicted score
for any node n can be expressed as:
In =
=
∂s
∂n
∂s
∂f
∂f
∂RGCN (Gt )
∂f
∂RGCN (Gt )
= f ′ (Ht )
(19)
= IG (Ht ) * I RGCN
n
4 EXPERIMENTS
In this section, we conduct extensive experiments to evaluate our
proposed GradXKG's performance on RGCN-based TKGR models.
Specifically, we investigate four research questions:
• Does GradXKG provide more sufficient explanations than model-
specific approaches for all evaluated RGCN-based TKGR mod-
els?
• Compared to perturbation-based methods, does GradXKG offer
comparable or superior explanation quality with lower time
costs?
• Does the proposed RGCN explainer in GradXKG contribute to
explanation quality?
• Can GradXKG provide relevant, validated explanations?
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Chenhan Yuan and Hoda Eldardiry
Models
ICEWS14
N=5
ICEWS0515
ICEWS18
Fidelity
Stability
Time Cost
Fidelity
Stability
Time Cost
Fidelity
Stability
Time Cost
TLogic
TimeTraveler
per-RE-NET
per-CEM
IG-RE-NET
IG-CEM
0.50
0.59
0.77
0.81
0.48
0.57
0.67
0.69
0.85
0.95
0.55
0.53
1.0
1.6
76.6
97.8
2.5
1.3
0.58
0.57
0.76
0.88
0.47
0.44
0.55
0.54
0.87
0.94
0.57
0.46
1.1
1.5
70.9
92.2
3.2
1.5
0.55
0.55
0.86
0.83
0.41
0.50
0.58
0.68
0.82
0.89
0.45
0.45
1.3
1.7
78.0
98.5
2.4
1.9
0.61
0.70
xRE-NET
xCEM
Table 1: Automatic evaluation scores of each explainable TKGR model under three datasets. N denotes the number of nodes
output by the models as an explanation.
0.77
0.78
0.73
0.76
0.79
0.82
0.73
0.71
0.65
0.74
1.3
1.0
1.2
1.0
1.1
1.0
4.1 Experimental Settings
4.1.1 Datasets. Currently, there are no TKGR datasets designed
specifically for explainable TKGR model evaluation that contain ex-
planations associated with each quadruple (fact). Therefore, we first
utilize the standard ICEWS14 [5], ICEWS18 [11], and ICEWS0515 [5]
datasets from the Integrated Crisis Early Warning System to evalu-
ate our proposed GradXKG method implemented on TKGR models,
following previous work. We then designed an automatic evalu-
ation approach that is based on faithfulness and trustworthiness
criteria and does not require a golden standard testing set with
explanations. Additionally, we conducted a human evaluation to
further assess the performance of the generated explanations.
4.1.2 Baselines. We implemented our approach on two state-of-
the-art RGCN-based TKGR models: CEM [13] and RE-NET [11].
Since there are currently no universal or gradient-based expla-
nation methods for TKGR models to compare against, we imple-
mented two model-specific explainable TKGR methods as baselines:
TimeTraveler [25] and TLogic [17]. We also implemented a simple
perturbation-based explanation method on both CEM and RE-NET
as additional baselines to benchmark GradXKG. To analyze the
effectiveness of the proposed RGCN explainer, we conducted an ab-
lation study by replacing RGCN explainer with integrated gradients.
In total, we compared eight methods: xCEM: A curriculum learning-
based RGCN TKGR model. xCEM denotes that GradXKG is imple-
mented on CEM. xRE-NET: A autoregressive RGCN TKGR model.
xRE-NET means GradXKG implemented version. per-CEM: CEM
model with perturbation-based method-generated explanations.
per-RE-NET: RE-NET model with perturbation-based method-
generated explanations IG-CEM: The whole CEM model is ex-
plained by integrated gradients. IG-RE-NET: The whole RE-NET
model is explained by integrated gradients. TimeTraveler: A RL-
based explainable TKGR model. This model does not contain RGCN
architecture. TLogic: A temporal random walk-based explainable
TKGR model that does not use RGCN.
4.1.3 Evaluation Metrics. Given the lack of explainable TKGR model
evaluation datasets, we assessed the quality of generated explana-
tions through both automatic and human evaluation. We utilized
three automatic evaluation metrics, namely fidelity, stability, and
time complexity. We also used three human evaluation criteria,
namely validity, relevance, and sufficiency.
Following previous work on GNN explanation [32], we con-
sidered the following two automatic criteria. 1) Fidelity, which
measures whether the explanations are faithfully important to the
model's predictions. Formally, fidelity can be defined by measuring
the prediction gap between the original graph input and graph
input that lacks important nodes:
Fidelity =
1
N
N
∑︁
i=1
mi
(f (Gi ) − f (G
i
))
(20)
mi
where f (*) denotes the TKGR model, Gi is the input graph, and G
i
is the graph with important node mi removed. 2) Stability, which
measures the ability of the explainable TKGR model to produce a
consistent explanation when the input graph is slightly altered or
perturbed. We measure stability as follows:
Stability =
|Np ∩ No |
|No |
(21)
where Np is the set of important nodes generated when the input
graph is altered and No is the set of important nodes generated
when the input graph is the original one. In addition to fidelity and
stability, we also report the time complexity of each explanation
method.
In addition to the automatic evaluation, we also included three
human evaluation metrics as follows. Two annotators evaluated
explanations based on three metrics: validity, relevance, and suffi-
ciency criteria using a 3-point scale (1=low, 3=high). Validity mea-
sures whether the explanation is logically valid based on the an-
notator's knowledge, indicating if the model learned the expected
features. Relevance measures whether selected nodes are connected
meaningfully to the target node. Sufficiency measures if the explana-
tion contains enough nodes to sufficiently understand the reasoning
behind the prediction, since explanations with too few nodes may
lack context. Note that there may be a trade-off between relevance
and sufficiency, since more nodes may increase sufficiency but de-
crease relevance. The detailed evaluation guideline is provided in
Appendix A.
GradXKG: A Universal Explain-per-use Temporal Knowledge Graph Explainer
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Models
ICEWS14
N=9
ICEWS0515
ICEWS18
Fidelity
Stability
Time Cost
Fidelity
Stability
Time Cost
Fidelity
Stability
Time Cost
TLogic
TimeTraveler
per-RE-NET
per-CEM
IG-RE-NET
IG-CEM
0.44
0.50
0.78
0.83
0.41
0.47
0.53
0.49
0.87
0.93
0.53
0.52
1.3
3.0
76.5
97.6
2.4
1.5
0.47
0.51
0.88
0.75
0.43
0.46
0.51
0.52
0.83
0.95
0.55
0.40
1.7
2.7
70.9
92.3
3.1
1.3
0.40
0.40
0.71
0.80
0.44
0.36
0.54
0.56
0.90
0.94
0.54
0.42
2.1
3.2
78.1
98.5
2.5
1.9
0.63
0.74
xRE-NET
xCEM
Table 2: Fidelity and stability scores of each explainable TKGR model under three datasets. N denotes the number of nodes
output by the models as an explanation.
0.78
0.74
0.75
0.78
0.77
0.85
0.71
0.70
0.70
0.72
1.8
1.0
1.4
1.0
1.3
1.0
4.2 Automatic Evaluation Results
We conduct two experiments where the number of nodes output in
the explanation is constrained to 5 and 9, representing reasoning
paths of lengths 3 and 4, respectively. This allows us to evaluate the
performance of GradXKG compared to TimeTravler and TLogic,
which have constraints on the length of the reasoning path they
can output. The results in Table 1 demonstrate that with 5 node
explanations, GradXKG achieves higher fidelity and stability scores
than TimeTravler and TLogic on all datasets. Specifically, on the
ICEWS05015 dataset, the xCEM and xRE-NET variants of GradXKG
obtain fidelity scores of 0.73 and 0.71, and stability scores of 0.77
and 0.78; compared to 0.58 and 0.57 fidelity, and 0.55 and 0.54 sta-
bility for TimeTravler and TLogic, respectively. This shows that
despite being a universal explainer without special architectural
constraints, GradXKG can generate more trustworthy explanations
than previous constrained models.
We also compare GradXKG to perturbation-based methods, which
intrinsically optimize explanation fidelity and stability. As expected,
these methods slightly outperform GradXKG but at a drastically
higher computational cost. For instance, per-CEM takes 97.8 times
longer than xCEM on the ICEWS14 dataset, demonstrating the
efficiency of GradXKG's "explain-per-use" approach.
Note that TLogic is not theoretically runnable when the reason-
ing path length is longer than 5. Therefore, we also set the generated
number of nodes requirement to be 9 and show the results in Ta-
ble. 2. Compared to the 5-node experiment, the 9-node experiment
shows that most perturbation and gradient-based methods maintain
a similar performance across all three automatic criteria. This is
because they score all nodes and select the top ones. However, Time-
Travler and TLogic slow down considerably and have lower fidelity
and stability as they are constrained by needing to traverse explana-
tion trajectories. Overall, the experiments demonstrate GradXKG's
ability to generate trustworthy explanations efficiently despite its
model-agnostic nature.
4.3 Human Evaluation and Qualitative Analysis
Human Evaluation To further evaluate the quality of the gener-
ated explanations, we randomly selected 50 generated explanations
from each compared method and asked two experienced annotators
to rate the quality of the explanations based on the aforementioned
criteria. As shown in Fig. 5, the saliency map explanations gener-
ated by GradXKG achieved higher sufficiency scores compared to
the other methods. This demonstrates that compared to reasoning
path explanations, like those from TLogic and TimeTraveler, the
proposed GradXKG method can provide more contextual infor-
mation by assigning importance scores to all nodes in the TKG.
Furthermore, the relevance scores of xCEM are comparable to those
of TLogic, indicating that the importance scores of each node are
aligned with its contribution to the prediction. We also observed
differences in the evaluation results between xRE-NET and xCEM
even when using the same GradXKG method. This discrepancy
can be attributed to the fact that the explainer's performance also
heavily depends on the capabilities of the original model.
Qualitative Analysis We include two saliency maps generated
by xCEM, the best variant of GradXKG, when the following query
is submitted to the model: (National Council for Peace and Order of
Thailand, Make Statement, ?, 2014-07-24) and (John Kerry, Engage
in negotiation, ?, 2014-07-24). The correct answers to these two
queries are Thailand and Benjamin Netanyahu, respectively. As
shown in Fig. 4, GradXKG revealed that the CEM model relied
on nodes/entities that are highly related to the queries in order to
make the correct predictions. For instance, for the query (John Kerry,
Engage in negotiation, ?, 2014-07-24), CEM attended to other U.S.
government officials like Barack Obama and international political
organizations such as "UN Security Council" as well as politicians
in the Middle East region. This demonstrates that with the proposed
GradXKG method, RGCN-based TKGR models' predictions can be
accurately interpreted and explained.
4.4 Ablation Study
To evaluate the effectiveness of the proposed RGCN explainer, we
also conducted an ablation study by replacing the RGCN explainer
with integrated gradients (IG). The node importance score is calcu-
lated by averaging the IG scores across the whole vector representa-
tion of that node. As shown in Tables 1 and 2, the IG-based RE-NET
and CEM methods perform much worse in terms of fidelity and
stability. This demonstrates the effectiveness and trustworthiness
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Chenhan Yuan and Hoda Eldardiry
Figure 4: The saliency maps generated by xCEM, where big nodes are the selected important nodes by GradXKG. We omit the
rest of the TKGs and timestamps for better illustration.
Figure 5: The box plots of human evaluation for each criterion of each baseline method. The dashed line denotes the mean
value and the bold line indicates the median value.
of the proposed RGCN explainer. Furthermore, as illustrated in
Fig. 5, the human evaluation also suggests that IG-only RE-NET or
CEM methods cannot provide a saliency map with high validity,
relevance, and sufficiency. Together, this shows the necessity and
effectiveness of the proposed RGCN explainer.
5 CONCLUSION
In this paper, we propose GradXKG, a universal explain-per-use
temporal knowledge graph explainer. The proposed approach can
be applied to most RGCN-based TKGR models to generate saliency
maps that indicate node importance (contribution) towards the
prediction as the explanation. Our proposed explainer model tracks
the gradient flow in the whole model by introducing, and com-
bining, two explainers: a Grad-CAM-based RGCN explainer and
an integrated gradient-based top-layer explainer. Our extensive
experiments demonstrate that with GradXKG, most state-of-the-art
TKGR models can be explained with high fidelity and stability in a
time-efficient manner.
REFERENCES
[1] Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen,
Klaus-Robert Müller, and Wojciech Samek. 2015. On pixel-wise explanations for
non-linear classifier decisions by layer-wise relevance propagation. PloS one 10,
(John Kerry, Engage in negotiation, ?, 2014-07-24)(National Council for Peace and Order of Thailand, Make statement, ?, 2014-07-24)GradXKG: A Universal Explain-per-use Temporal Knowledge Graph Explainer
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
7 (2015), e0130140.
[2] Songgaojun Deng, Huzefa Rangwala, and Yue Ning. 2020. Dynamic knowledge
graph based multi-event forecasting. In Proceedings of the 26th ACM SIGKDD
International Conference on Knowledge Discovery & Data Mining. 1585–1595.
[3] Shumin Deng, Ningyu Zhang, Wen Zhang, Jiaoyan Chen, Jeff Z Pan, and Huajun
Chen. 2019. Knowledge-driven stock trend prediction and explanation via tem-
poral convolutional network. In Companion Proceedings of The 2019 World Wide
Web Conference. 678–685.
[4] Lijuan Diao, Wei Yang, Penghua Zhu, Gaofang Cao, Shoujun Song, and Yang
Kong. 2021. The research of clinical temporal knowledge graph based on deep
learning. Journal of Intelligent & Fuzzy Systems 41, 3 (2021), 4265–4274.
[5] Alberto Garcia-Duran, Sebastijan Dumančić, and Mathias Niepert. 2018. Learning
Sequence Encoders for Temporal Knowledge Graph Completion. In Proceedings
of the 2018 Conference on Empirical Methods in Natural Language Processing.
4816–4821.
[6] Simon Gottschalk and Elena Demidova. 2018. Eventkg: A multilingual event-
centric temporal knowledge graph. In The Semantic Web: 15th International Confer-
ence, ESWC 2018, Heraklion, Crete, Greece, June 3–7, 2018, Proceedings 15. Springer,
272–287.
[7] Zhen Han, Peng Chen, Yunpu Ma, and Volker Tresp. 2021. Explainable Sub-
graph Reasoning for Forecasting on Temporal Knowledge Graphs. In Interna-
tional Conference on Learning Representations. https://openreview.net/forum?id=
pGIHq1m7PU
[8] Zhen Han, Zifeng Ding, Yunpu Ma, Yujia Gu, and Volker Tresp. 2021. Learning
neural ordinary equations for forecasting future links on temporal knowledge
graphs. In Proceedings of the 2021 conference on empirical methods in natural
language processing. 8352–8364.
[9] Qiang Huang, Makoto Yamada, Yuan Tian, Dinesh Singh, and Yi Chang. 2022.
Graphlime: Local interpretable model explanations for graph neural networks.
IEEE Transactions on Knowledge and Data Engineering (2022).
[10] Zhen Jia, Soumajit Pramanik, Rishiraj Saha Roy, and Gerhard Weikum. 2021.
Complex temporal question answering on knowledge graphs. In Proceedings of
the 30th ACM international conference on information & knowledge management.
792–802.
[11] Woojeong Jin, Meng Qu, Xisen Jin, and Xiang Ren. 2020. Recurrent Event
Network: Autoregressive Structure Inferenceover Temporal Knowledge Graphs.
In Proceedings of the 2020 Conference on Empirical Methods in Natural Language
Processing (EMNLP). 6669–6683.
[12] Jaehun Jung, Jinhong Jung, and U Kang. 2021. Learning to walk across time for
interpretable temporal knowledge graph completion. In Proceedings of the 27th
ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 786–795.
[13] Zixuan Li, Saiping Guan, Xiaolong Jin, Weihua Peng, Yajuan Lyu, Yong Zhu,
Long Bai, Wei Li, Jiafeng Guo, and Xueqi Cheng. 2022. Complex Evolutional
Pattern Learning for Temporal Knowledge Graph Reasoning. In Proceedings of
the 60th Annual Meeting of the Association for Computational Linguistics (Volume
2: Short Papers). 290–296.
[14] Zixuan Li, Xiaolong Jin, Saiping Guan, Wei Li, Jiafeng Guo, Yuanzhuo Wang,
and Xueqi Cheng. 2021. Search from History and Reason for Future: Two-stage
Reasoning on Temporal Knowledge Graphs. In Proceedings of the 59th Annual
Meeting of the Association for Computational Linguistics and the 11th International
Joint Conference on Natural Language Processing (Volume 1: Long Papers). 4732–
4743.
[21] A Saxena, S Chakrabarti, and P Talukdar. 2021. Question answering over temporal
knowledge graphs. In ACL-IJCNLP 2021-59th Annual Meeting of the Association for
Computational Linguistics and the 11th International Joint Conference on Natural
Language Processing, Proceedings of the Conference. Association for Computational
Linguistics (ACL), 6663–6676.
[22] Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne Van Den Berg, Ivan
Titov, and Max Welling. 2018. Modeling relational data with graph convolu-
tional networks. In The Semantic Web: 15th International Conference, ESWC 2018,
Heraklion, Crete, Greece, June 3–7, 2018, Proceedings 15. Springer, 593–607.
[23] Thomas Schnake, Oliver Eberle, Jonas Lederer, Shinichi Nakajima, Kristof T
Schütt, Klaus-Robert Müller, and Grégoire Montavon. 2021. Higher-order expla-
nations of graph neural networks via relevant walks. IEEE transactions on pattern
analysis and machine intelligence 44, 11 (2021), 7581–7596.
[24] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedan-
tam, Devi Parikh, and Dhruv Batra. 2017. Grad-cam: Visual explanations from
deep networks via gradient-based localization. In Proceedings of the IEEE interna-
tional conference on computer vision. 618–626.
[25] Haohai Sun, Jialun Zhong, Yunpu Ma, Zhen Han, and Kun He. 2021. TimeTrav-
eler: Reinforcement Learning for Temporal Knowledge Graph Forecasting. In
Proceedings of the 2021 Conference on Empirical Methods in Natural Language
Processing. 8306–8319.
[26] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution
for deep networks. In International conference on machine learning. PMLR, 3319–
3328.
[27] Rakshit Trivedi, Hanjun Dai, Yichen Wang, and Le Song. 2017. Know-evolve: Deep
temporal reasoning for dynamic knowledge graphs. In international conference
on machine learning. PMLR, 3462–3471.
[28] Minh Vu and My T Thai. 2020. Pgm-explainer: Probabilistic graphical model
explanations for graph neural networks. Advances in neural information processing
systems 33 (2020), 12225–12235.
[29] Yuwei Xia, Mengqi Zhang, Qiang Liu, Shu Wu, and Xiao-Yu Zhang. 2022.
MetaTKG: Learning Evolutionary Meta-Knowledge for Temporal Knowledge
Graph Reasoning. In Proceedings of the 2022 Conference on Empirical Methods in
Natural Language Processing. 7230–7240.
[30] Yi Xu, Junjie Ou, Hui Xu, and Luoyi Fu. 2023. Temporal knowledge graph reason-
ing with historical contrastive learning. In Proceedings of the AAAI Conference on
Artificial Intelligence, Vol. 37. 4765–4773.
[31] Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec.
2019. Gnnexplainer: Generating explanations for graph neural networks. Ad-
vances in neural information processing systems 32 (2019).
[32] Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. 2022. Explainability in
graph neural networks: A taxonomic survey. IEEE transactions on pattern analysis
and machine intelligence 45, 5 (2022), 5782–5799.
[33] Hao Yuan, Haiyang Yu, Jie Wang, Kang Li, and Shuiwang Ji. 2021. On explain-
ability of graph neural networks via subgraph explorations. In International
conference on machine learning. PMLR, 12241–12252.
[34] Zhao Zhang, Fuzhen Zhuang, Hengshu Zhu, Zhiping Shi, Hui Xiong, and Qing He.
2020. Relational graph neural network with hierarchical attention for knowledge
graph completion. In Proceedings of the AAAI conference on artificial intelligence,
Vol. 34. 9612–9619.
[15] Zixuan Li, Xiaolong Jin, Wei Li, Saiping Guan, Jiafeng Guo, Huawei Shen,
Yuanzhuo Wang, and Xueqi Cheng. 2021. Temporal knowledge graph reasoning
based on evolutional representation learning. In Proceedings of the 44th interna-
tional ACM SIGIR conference on research and development in information retrieval.
408–417.
[16] Qika Lin, Jun Liu, Rui Mao, Fangzhi Xu, and Erik Cambria. 2023. TECHS: Temporal
Logical Graph Networks for Explainable Extrapolation Reasoning. In Proceedings
of the 61st Annual Meeting of the Association for Computational Linguistics (Volume
1: Long Papers). 1281–1293.
[17] Yushan Liu, Yunpu Ma, Marcel Hildebrandt, Mitchell Joblin, and Volker Tresp.
2022. Tlogic: Temporal logical rules for explainable link forecasting on temporal
knowledge graphs. In Proceedings of the AAAI conference on artificial intelligence,
Vol. 36. 4120–4127.
[18] Maxime Oquab, Léon Bottou, Ivan Laptev, and Josef Sivic. 2015. Is object localiza-
tion for free?-weakly-supervised learning with convolutional neural networks.
In Proceedings of the IEEE conference on computer vision and pattern recognition.
685–694.
[19] Phillip E Pope, Soheil Kolouri, Mohammad Rostami, Charles E Martin, and Heiko
Hoffmann. 2019. Explainability methods for graph convolutional neural net-
works. In Proceedings of the IEEE/CVF conference on computer vision and pattern
recognition. 10772–10781.
[20] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2016. " Why should i
trust you?" Explaining the predictions of any classifier. In Proceedings of the 22nd
ACM SIGKDD international conference on knowledge discovery and data mining.
1135–1144.
A ANNOTATION GUIDELINE
We provide detailed evaluation guidelines for human evaluations
in this section. Overview
You will be shown explanations generated by a model for tem-
poral knowledge graph reasoning tasks. Your task is to evaluate
the quality of the explanation based on 3 criteria using a 1-3 rating
scale:
• Validity (1=low, 3=high) - Does the explanation seem logi-
cally valid based on your own knowledge? Note that invalid
explanations indicate the model may not have learned ex-
pected features.
• Relevance (1=low, 3=high) - Do the nodes selected seem
relevant for explaining the model's prediction? Relevant
nodes should meaningfully connect to the target node being
explained.
Conference acronym 'XX, June 03–05, 2018, Woodstock, NY
Chenhan Yuan and Hoda Eldardiry
• Sufficiency (1=low, 3=high) - Does the explanation contain
enough nodes to sufficiently understand the reasoning be-
hind the prediction? Too few nodes may lack the needed
context.
The detailed criteria for each score is described below: Note there is
a tradeoff between sufficiency and relevance - more nodes increase
sufficiency but may reduce relevance.
Validity
• Assign a score of 1 if the nodes seem unrelated to explaining
the prediction.
• Assign a score of 2 if some nodes are relevant while others
are not.
• Assign a score of 3 if all nodes clearly help explain the pre-
diction through their connections.
Sufficiency
• Assign a score of 1 if the explanation does not provide enough
• Assign a score of 1 if the explanation is illogical or contains
context to understand the reasoning.
factual errors based on your knowledge.
• Assign a score of 2 if the explanation provides some context
• Assign a score of 2 if you are uncertain of the validity or
but is still lacking.
logic of the explanation.
• Assign a score of 3 if the explanation provides ample context
• Assign a score of 3 if the explanation seems factually and
to understand the reasoning.
logically valid.
Relevance
Received 20 February 2007; revised 12 March 2009; accepted 5 June 2009
|
|
http://arxiv.org/abs/2310.04884v2 | "2023-10-10T01:57:56" | "2023-10-07T17:54:36" | Regret Analysis of Repeated Delegated Choice | We present a study on a repeated delegated choice problem, which is the first
to consider an online learning variant of Kleinberg and Kleinberg, EC'18. In
this model, a principal interacts repeatedly with an agent who possesses an
exogenous set of solutions to search for efficient ones. Each solution can
yield varying utility for both the principal and the agent, and the agent may
propose a solution to maximize its own utility in a selfish manner. To mitigate
this behavior, the principal announces an eligible set which screens out a
certain set of solutions. The principal, however, does not have any information
on the distribution of solutions in advance. Therefore, the principal
dynamically announces various eligible sets to efficiently learn the
distribution. The principal's objective is to minimize cumulative regret
compared to the optimal eligible set in hindsight. We explore two dimensions of
the problem setup, whether the agent behaves myopically or strategizes across
the rounds, and whether the solutions yield deterministic or stochastic
utility. Our analysis mainly characterizes some regimes under which the
principal can recover the sublinear regret, thereby shedding light on the rise
and fall of the repeated delegation procedure in various regimes. | [
"MohammadTaghi Hajiaghayi",
"Mohammad Mahdavi",
"Keivan Rezaei",
"Suho Shin"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04884v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04884v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.GT",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.GT",
"cs.LG"
] | 3
2
0
2
t
c
O
0
1
]
T
G
.
s
c
[
2
v
4
8
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Regret Analysis of Repeated Delegated Choice
MohammadTaghi Hajiaghayi ∗
Mohammad Mahdavi∗
Suho Shin∗
Keivan Rezaei∗
October 11, 2023
Abstract
We present a study on a repeated delegated choice problem, which is the first to consider an
online learning variant of Kleinberg and Kleinberg, EC'18. In this model, a principal interacts
repeatedly with an agent who possesses an exogenous set of solutions to search for efficient ones.
Each solution can yield varying utility for both the principal and the agent, and the agent may
propose a solution to maximize its own utility in a selfish manner. To mitigate this behavior, the
principal announces an eligible set which screens out a certain set of solutions. The principal,
however, does not have any information on the distribution of solutions in advance. Therefore,
the principal dynamically announces various eligible sets to efficiently learn the distribution.
The principal's objective is to minimize cumulative regret compared to the optimal eligible set
in hindsight. We explore two dimensions of the problem setup, whether the agent behaves
myopically or strategizes across the rounds, and whether the solutions yield deterministic or
stochastic utility. Our analysis mainly characterizes some regimes under which the principal
can recover the sublinear regret, thereby shedding light on the rise and fall of the repeated
delegation procedure in various regimes.
1
Introduction
Delegation is perhaps one of the most frequent economic interactions one may see around in real life
(Holmstrom, 1980; Bendor et al., 2001; Amador and Bagwell, 2013). Abstractly speaking, consider
a principal with less information tries to find an optimal solution from an agent with expertise, but
there's an information asymmetry such that she1 cannot directly access the solutions that the agent
possesses (Alonso and Matouschek, 2008; Kleinberg and Kleinberg, 2018; Kleiner, 2022; Hajiaghayi
et al., 2023). Instead, she requires the agent to propose a set of solutions and then commits to the
final one among them. The principal and the agent, however, may have misaligned utility for the
solution selected, and thus the agent may propose a solution in a selfish manner. To cope with it,
the principal announces a set of eligible solutions before the agent proposes, and only accepts the
eligible solution.
To provide a concrete example, consider (online) labor market or crowdsourcing platform such
as Upwork. We have a task requester (principal) who regularly visits the platform (agent) and tries
to solve a series of tasks. The platform has a pool of workers (solutions). At each time the requester
visits, the platform recommends some set of workers, and the requester selects a single worker to
commit to the task. Obviously, the task requester wants to hire a qualified worker. The platform, on
the other hand, aims to maximize its long-term revenue by recommending workers who solve tasks
∗
University of Maryland College Park, MD USA. Email: {hajiagha,mahdavi,krezaei,suhoshin}@umd.edu
1Feminine pronouns (masculine) hereafter denote the principal (agent).
1
Behavior
Myopic
Strategic
Utility
Deterministic
Stochastic
Theorem 4.3
Table 1: Summary of our results under different settings.
Theorem 3.1 Theorem 3.4,3.8
Theorem 4.1
quickly, even if their quality is not high, allowing them to be assigned to other tasks promptly. This
misalignment of utility may lead to the platform strategically recommending unqualified workers.
To mitigate this, the requester sets restrictions, such as requiring certificates in specific areas like
a foreign language or web development, when requesting worker recommendations. We refer to
Appendix A for more examples on motivations.
If the task requester is fully aware of the set of workers that the platform has, then she can
directly impose a strong restriction to make the platform recommend the specific workers she wants.
In practice, however, such information is not feasible priorly, instead, the requester needs to learn
the distribution of existing workers in the repeated interaction. The fundamental question here is,
how the requester should dynamically determine which sort of restriction to impart at each round,
in order to maximize cumulative utility over the set of tasks. Furthermore, one may ask what
happens if the platform also tries to strategize across the rounds to deceive the requester, and what
if the quality of each worker is not fixed in advance, but rather is given from a latent distribution.
This work introduces the repeated delegated choice problem, which focuses on how the principal
can design an efficient delegation mechanism. To the best of our knowledge, this is the first study
to explore an online learning extension of the delegated choice problem presented by Armstrong
and Vickers (2010); Kleinberg and Kleinberg (2018); Hajiaghayi et al. (2023). In our model, the
principal lacks initial information about the solutions' distribution.
Instead, through repeated
announcements of eligible sets that may screen out some solutions, the principal aims to learn the
solutions' distributions in a sample-efficient manner. The principal aims to minimize cumulative
regret compared to the optimal eligible set in hindsight.
We distill the problem into two dimensions of whether the utility of each solution is deterministic
or stochastic, and whether the agent strategizes across the rounds or not, and provide a comprehen-
sive regret analysis for each setting. In the myopic agent setting, the agent plays a best-response
to the eligible set at each round, i.e., a strategy which maximizes myopic utility without regard
to the future utility and resulting behavior of the mechanism.2 Hence, the principal's objective
boils down to efficiently learn the distribution of utilities by selecting proper eligible sets at each
round, while only observing the partial feedback from the choice of eligible set, i.e., which solution
the agent submits (or possibly declines to submit any). This challenge intensifies with a strategic
agent, as the agent may intentionally hide solutions or deviate from their best response for greater
utility in later rounds. Consequently, the feedback is not guaranteed to be stochastic across rounds,
making the analysis more complex.
Our contributions. We here provide a summary of our contributions and techniques. The
results are summarized in Table 1. First, we observe a revelation-principle-style-of-result such
that it suffices to focus on a class of so-called single-proposal mechanism, formally defined in
Definition 2.1. Interestingly, we show that the myopic deterministic setting can be reduced to the
repeated posted price mechanism (RPPM) with myopic buyer. 3 Denoting the principal's utility
2This model of myopic agent accommodates a perspective of "multiple agents" setting in which at each round an
agent having the same type of solutions arrive and interacts with the principal. In this viewpoint, the agents are
bound to be myopic due to the single round interaction per agent.
3Overall, we observe an intimate connection between the RPPM and our problem under certain settings.
In
2
for each solution by Xi, one can effectively construct an instance of RPPM by converting Xi to
the buyer's value v = maxi Xi in RPPM. In both problems, the optimal benchmark is to obtain
maxi Xi, and the reduction follows. Combined further with an iterative algorithm, we obtain a
regret upper bound of O(min(K, log log T )), where K denotes the number of solutions and T is the
time horizon.
With stochastic valuation, however, this does not work since the benchmark in RPPM is to
put an ex-ante best fixed price, which does not coincide maxi Xi.
Indeed, we observe that the
optimal benchmarks cannot be reduced from one to another in general. Instead, we mainly reduce
our problem to a stochastic multi-armed bandit problem via proper discretization over the space
of eligible sets equipped with a variant of analysis by Kleinberg and Leighton (2003), and obtain a
regret of O(√T log T ) under the same assumption imposed in Kleinberg and Leighton (2003)
For the strategic agent with deterministic utility, we first observe that it is necessary to impose
a certain assumption on the agent's utility sequence to obtain positive results. Precisely, the agent
with non-discounting utility can strategize so that no algorithm can obtain sublinear regret, where
the formal proof is presented in Appendix K. In this context, to capture both of the practicality
and theoretical tractability, we consider γ-discounting strategic agent whose utility is discounted by
a multiplicative factor of γ at each round. We also note that this is common in the literature Amin
et al. (2013); Haghtalab et al. (2022).
−
) where Tγ = 1/(1
Given that, for the γ-discounting agent with deterministic utility, we first consider a case in
which the agent's utility is uniformly bounded below by ymin and the principal is aware of it. In this
setting, by exploiting the delay technique of Haghtalab et al. (2022), we obtain a regret bound of
O(KTγ log Tγ
γ). The dependence on K can be replaced by log T by shrinking
ymin
the eligible set more in an aggressive manner, thereby obtaining a regret of O(Tγ log Tγ
+ log T ).
ymin
Note that these bounds yield sublinear regret only if ymin = e−o(T ). We complement these results
by showing that any algorithm suffers regret of Ω(T ) if ymin ≤
On the other hand, if the agent's minimum utility is not known or unbounded, there's no
guarantee that the agent behaves myopically for any delay that is imposed in the algorithm. Instead,
under minor assumptions that the solutions are densely spread with respect to parameter d and
Lipschitzness between the principal's and agent's utilities, we obtain an efficient algorithm that
achieves a regret upper bound of O(Tγ log Tγ
α + log 1
d + dT ), where α is a function of the Lipschitz
parameters. The linear dependence of O(dT ) regret may look a lot at first glance, we observe this
is inevitable for any algorithm, thereby justifying our assumption.
e−T .
In the stochastic setting with γ-discounting strategic agent, we reuse the machinery by Hagh-
talab et al. (2022); Lancewicki et al. (2021), and obtain a regret of O(√T log T ). More specifically,
we can view the proposed solution as a perturbed output of a stochastic bandit, where the per-
turbation comes from the agent's strategic behavior. The technical subtlety lies on how we should
upper/lower bound such perturbed output to properly apply Lancewicki et al. (2021), i.e., how we
should construct a random perturbation interval.
1.1 Related works
Delegation.
Dating back to the seminal work of Holmstrom (1980), a number of literature
from the economics community study the theory of delegation, mostly within the extent of char-
acterizing the regimes under which some simple mechanisms reach the optimal solution Alonso
and Matouschek (2008); Armstrong and Vickers (2010); Kleiner (2022). Recently, Kleinberg and
general, however, our problem spawns additional challenges of having multiple latent random variables and the
principal is even unaware of the number of potential solutions. We provide more detailed discussion in Appendix B.
3
Kleinberg (2018) study a problem of delegated choice 4 with a lens of computer science, and show
that there exists a mechanism with 2-approximation compared to the case in which the principal
can fully access all the solutions in advance, based on a novel connection to prophet inequality
problem (Samuel-Cahn, 1984). Their result, however, depends on the assumption that the prin-
cipal knows the distribution from which the utility of each solution is drawn, i.e., they study the
efficiency of Bayesian mechanism.
Interestingly, if the principal has no such information at all,
i.e., prior-independent mechanism, the result becomes largely pessimistic, i.e., there exists a prob-
lem instance in which the principal's approximation becomes arbitrarily bad. Hajiaghayi et al.
(2023) reveal that prior-independent mechanisms can be made efficient with multiple agents, but
this does not hold with a single agent.
Repeated delegation.
Lipnowski and Ramos (2020) study a problem of infinitely repeated
delegation, however, their model of delegated choice is largely different from ours. Mainly, their
model considers aligned utility but when the principal bears the cost of adopting a project. Their
objective is to persuade the agent to adopt the project when it is truly good, whereas the agent tries
to always adopt the project. Several lines of work Li et al. (2017); Guo and H ̈orner (2021) study
a repeated game of project choice, but we do not discuss it in details due to significant differences
from our model. A line of work Lewis (2012); Xiao et al. (2022) study a delegated search problem,
especially a dynamic version by Rahmani and Ramachandran (2016), but the players bear the cost
of search for solutions in their model, whereas the solutions are exogenous to the mechanism in our
model.
Stackelberg games.
Our problem can be viewed as an online learning version of repeated
Stackelberg game Von Stackelberg (2010); Marecki et al. (2012); Bai et al. (2021); Lauffer et al.
(2022); Zhao et al. (2023). A common objective in this area of work is to minimize a Stackelberg
regret, i.e., difference to the optimal policy that knows the leader's optimal action in hindsight, and
the above works aim to minimize the cumulative Stackelberg regret of a leader, assuming that a
follower best responds at each round. Especially, our model of strategic agent belongs to the growing
area of learning in games with strategic agent Birmpas et al. (2020); Haghtalab et al. (2022); Zhao
et al. (2023). More precisely, Birmpas et al. (2020) study how the follower can efficiently deceive the
leader by misreporting his valuation. Haghtalab et al. (2022) proposes a generic delaying technique
to deal with a strategic agent, and proposes several applications to strategic classification, repeated
posted price mechanism (henceforth RPPM), and Stackelberg security game. Indeed, our model
resembles RPPM of Kleinberg and Leighton (2003); Amin et al. (2013); Babaioff et al. (2017).
However, RPPM restricts the buyer and the seller's utility to be linearly negatively correlated, but
our model accommodates any kind of correlation. In addition, our agent has multiple solutions to
choose from compared to only accept/reject of RPPM, and thus is technically more challenging to
predict/analyze the agent's strategic behavior.
2 Problem setup
In a repeated delegated choice problem, there is a principal and an agent. The agent is equipped
where K denotes the cardinality of the set of possible
a0, a1, . . . , aK }
with a set of solutions A =
{
solutions5, and a0 denotes the null solution
which means that the agent submits nothing. At
[T ], solution a incurs a nonnegative random utility for the principal and the agents.
each round t
⊥
∈
4They consider two types of problem settings, one of which is delegated search with sampling costs, and the other
is delegated choice, referring back to Armstrong and Vickers (2010). Since we also assume that the solutions of the
agent are exogenous to mechanisms, we frame our model as a delegated choice problem.
5We do not restrict the number of solutions to be finite, or constant with respect to T.
4
∈
∈
for t
a , Y (t)
a ) is independent and identically distributed (i.i.d.)
Denote by X (t)
the utility random variable (r.v.) of the principal selecting the solution a and
a
Y (t)
the random utility of the agent given solution a, both of which has support in Ω := [0, 1].
a
The random vector (X (t)
[T ].
A at each round, but the
Importantly, the agent can access the ex-post utility of the solutions a
∈
principal cannot. The agent is equipped with a discounting factor γ
(0, 1), i.e., he discounts the
utility at round t by a factor of γt−1. That is, the agent's true utility for solution a at round t is
γt−1Y (t)
a . This assumption on agent regret is common in studies concerning strategic agents Amin
et al. (2013); Haghtalab et al. (2022). It is shown in Amin et al. (2013) that in the repeated posted-
price mechanism problem, a sublinear regret can not be achieved for a non-discounting strategic
agent. This is also the case in our problem, as a non-discounting agent might have the incentive
to hide a solution that is worse than another solution in terms of agent utility but better for the
γ). Given a mechanism M ,
principal. We further explore this in Appendix K. Define Tγ = 1/(1
at each round t
A, and
submits them to the principal. We write 2X to denote the power set of a set X, and ∆(X) for a
simplex over X. Thus, the agent's action belongs to S(t)
History, mechanism, and agent's policy. At each round t
[T ], the mechanism determines
which solutions to commit given the agent's action S(t). This choice is based on the history available
t−1
l=1(S(l), a(l)), where a(l) denotes the solution selected at
up to round t, formally defined by Ht :=
∪t≥1(2A, A) to be the set of all possible histories of the game, i.e., each
round l. We define
H
Ht is a subset of
A specifies which solutions to select
. Formally, the mechanism M :
7→
and the agent's submission. Importantly, the mechanism
at each round t given the history Ht ∈ H
is only able to choose an action among the actually submitted solutions by the agent. Also, the
principal commits to a mechanism before the game starts.
[T ], the agent chooses a (possibly random) subset of solutions S(t)
∆(2A).
H ×
2A
:=
H
−
⊂
∈
∈
∈
∪
M
Let
be the set of all possible mechanisms. Correspondingly, the agent's policy P :
H × M 7→
∆(2A) is a function that takes the mechanism announced by the principal and the history sequence
be the set of all possible agent policies. We
Ht and decides an (possibly randomized) action. Let
write st to denote the solution eventually selected at round t by the mechanism. Note that st can
, if the principal declines to accept any proposed solution. In this case, both the
be null, i.e., st =
M,P and Y (t)
agent's and the principal's utilities are zero. We write X (t)
M,P to denote the principal's
M,P ] and ΨM,P = E[Y (t)
and agent's utility at round t under M and P . Define ΦM,P = E[X (t)
M,P ] to
denote the expected utility of the principal and the agent, respectively.
Mechanism description. Overall, the interaction between the principal and the agent proceeds
as follows:
⊥
P
i The principal commits to a mechanism.
ii At each round, agent observes the realized solutions and their utility.
iii Agent (possibly strategically) proposes solutions.
iv Principal determines the final outcome with respect to the committed mechanism.
v Steps ii-iv are repeated.
Single-proposal mechanism. We mainly deal with the following specific type of mechanism,
inspired by Kleinberg and Kleinberg (2018).
Definition 2.1 (Single-proposal mechanism). In a single proposal mechanism M , at each round t,
the principal announces an eligible set E(t)
Ω2, and the agent submits only a single solution a.
If (X (t)
E(t), then the principal accepts the solution, otherwise, she selects nothing.
a , Y (t)
a )
⊂
∈
5
We further say that a mechanism is threshold-based, if its eligible set only puts a (possibly
strict) lower bound on the principal's utility. We define Eτ =
}
to represent threshold-based eligible sets for a threshold τ . Given a single proposal mechanism, we
write x(t)
to denote the eventual utility of the principal and the agent at round t when the
agent proposes solution a, i.e., which reflects the principal's decision.
a : Xa > τ
{
a : Xa ≥
{
a and y(t)
a
τ =
}
τ
and E>
Notably, we provide a revelation principle style of result which states that any mechanism can
be reduced to a single-proposal mechanism.
Theorem 2.2. Given any mechanism M and any agent's policy P , there exists a single-proposal
mechanism M ′ and corresponding deterministic agent's policy P ′ such that ΦM,P ≤
ΦM ′,P ′ and
ΨM,P ≤
ΨM ′,P ′.
Thanks to the reduction above, we can essentially focus on the single-proposal mechanism,
and the agent only needs to determine which solution to submit at each round. Thus, unless
specified explicitly, we now focus on the single-proposal mechanism. Note that the reduction from
any deterministic mechanism with deterministic policy follows from a variant of the proof of the
standard revelation principle (Nisan et al., 2007). For randomized policy, we can reduce it to
a deterministic policy by sequentially derandomizing each round's random events in a backward
manner.
Approximately best response and Stackelberg regret. Our construction of a mechanism
against a strategic agent requires a notion of approximate best response of the agent, defined as
follows.
Definition 2.3 (ε-best response). Given a mechanism M and history Ht, let AE be a union of the
set of eligible solutions given eligible set E and the null outcome
. Then, the ε-best response at
round t for eligible set E is defined by
⊥
If ε = 0, we simply say best response and denote by Br(t).
Br(t)
ε (E) =
a
{
∈
AE : y(t)
a ≥
y(t)
a′
ε,
a′
∀
−
.
A
}
∈
Whenever there are multiple solutions as best response, we assume that a myopic agent plays
in favor of the principal, i.e., submits the solution that maximizes the principal's utility.
Fundamentally, the dynamics of the single-proposal mechanism belongs to a repeated Stack-
elberg game in which the principal moves first by announcing an eligible set, and then the agent
follows by proposing solutions, at each round. In repeated Stackelberg games (possibly with strate-
gic agent), typical objective is to minimize a cumulative regret compared to the case when the
mechanism knows the optimal eligible set in hindsight, and the agent myopically responds to the
principal's move. In our setting, this benchmark boils down to the case under which the mechanism
knows the distribution of X (t)
in hindsight, while the agent best responds to the principal's
eligible set at each round. In this case, the optimal principal's utility can be written as,
a and Y (t)
a
Opt = max
E⊂Ω2
E
x(t)
Br(t)(E) i
.
h
(2.1)
Thus, Stackelberg is defined as follows.
Definition 2.4 (Stackelberg regret). Given a mechanism M and agent's policy P , suppose that
the agent submits solution at at each round t. Then, Stackelberg regret is defined by
RegM,P (T ) = T
T
Opt
*
−
Xt=1
x(t)
at .
6
Furthermore, we define a worst-case Stackelberg by maximizing over the agent's policy, WRegM (T ) =
maxP ∈P RegM,P (T ). Let
sponse. Then, we define WRegM (T, ε) = maxP ∈Pε
RegM (T ) = WRegM (T, 0) to denote its worst-case Stackelberg regret.
Pε be a family of policy under which the agent always plays ε-best re-
RegM,P (T ). If the agent is myopic, we abuse
3 Deterministic Setting
We start with a simplistic setting in which the agent is myopic and the utility is deterministic.
In this case, the principal needs to learn the optimal eligible set, without regard to the agent's
strategy. In this case, for notational simplicity, we drop the superscript (t) since the utility remains
the same across the rounds. Our main result with myopic agent is presented as follows.
Theorem 3.1. There exists a mechanism with Reg(T ) = O(min(K, log log T )) against myopic
agent.
The proof is based on two algorithms, one of which relies on a novel connection between our
problem and the repeated posted-price mechanism problem (henceforth RPPM) by Kleinberg and
Leighton (2003), and the other is a simple algorithm that iteratively finds a (slightly) better solution.
In the former, we mainly construct a reduction from our problem to RPPM, and thus recovers the
regret bound log log T of Kleinberg and Leighton (2003).6 In the latter algorithm with regret bound
O(K), the algorithm iteratively updates the eligible set so that it excludes at least one suboptimal
solution at each round, until there's no eligible solution. Formal definition of RPPM, pseudocode
of the algorithms, and the proof can be found in Appendix D.
This result implies an intimate connection between our problem and RPPM, however, we observe
that this does not hold beyond this simplistic setting.
In fact, the utilities are always linearly
negatively correlated in RPPM, on the other hand, in our setting they can be arbitrarily correlated.
Moreover, agent has multiple actions to choose beyond accept and reject compared to only two
actions of accept or reject in RPPM.
3.1 Strategic agent
Next, we consider a more challenging scenario in which the agent tries to strategize over the
rounds. Since we cannot assume that the agent will truthfully best respond to the mechanism at
each iteration, instead, he possibly tries to deceive the mechanism by untruthfully submitting a
solution. Thus, we need to design a mechanism that is more robust to the strategic behavior. This
may indeed be plausible in practice, for instance in our online labor market example, the platform
may try to deceive the task requester to not strain highly qualified workers. Intuitively, this will
especially true when the platform does not have a large number of workers.
Mainly, we characterize the regret upper bound with respect to two types of assumptions. The
first version of the results relies on a relatively simple assumption such that the agent's utility is
uniformly bounded below by some constant. The latter depends on the Lipschitz continuity of
the utility across the solutions and the density of solutions in the utility space. For each setting,
we provide regret upper bounds and matching lower bounds. This justifies the necessity of the
assumptions we impose, thereby providing insightful implications on the regimes in which the
principal can attain large utility.
Before presenting the results, we introduce a notion of delayed mechanism, which will be useful
in dealing with strategic agent. Formally, we say that mechanism M is D-delayed, if at each round
6Note that any state-of-the-art result can be carried over to our problem's regret bound, due to our reduction.
7
t, it uses Hmax(1,t−D) to decide its eligible set Et. Delayed mechanism effectively restricts the
strategic agent's behavior, as follows.
Lemma 3.2 (Haghtalab et al. (2022)). Given γ
D-delayed mechanism M satisfies WRegM (T )
∈
WRegM (T, ε).
(0, 1), if we set D =
≤
, then
Tγ log(Tγ/ε)
⌉
⌈
Intuitively, if D gets larger enough, the agent with discounted utility is less incentivized to
deviate from the best response at each round since the discounted utility after D rounds may not
be enough to make up for the loss of ε utility in the current turn.
Uniformly bounded agent utility. Formally, we first assume that Ya > ymin for any a
A and
the principal is also aware of this lower bound. Our regret bound will accordingly be parameterized
with respect to ymin. This assumption is plausible since in our online labor market example, the task
requester and the worker are typically contracted to pay an intermediary fee to the platform and thus
constitute a reasonable amount of minimum payoff to the agent. The existence of such a minimum
utility effectively allows us to compute the necessary delay to make the agent approximately myopic,
thanks to Theorem 3.2.
∈
Leveraging the minimum utility of the agent, we consider a variant of the algorithm used in the
myopic deterministic setting, by introducing a delay in reacting to the agent's feedback. Then, we
can further obtain the following regret bound.
Theorem 3.3. There exists an algorithm with WReg(T ) = O(KTγ log Tγ
ymin
strategic agent.
) against γ-discounting
The proof can be found in Appendix E. Essentially, the delay introduced in the algorithm
induces the agent to behave restrictively strategic, and we can effectively bound the regret to be
constant, assuming the other parameters are constants. Note, however, that the regret bound
linearly depends on the number of agent's solutions K. Obviously, if K tends to be large in some
cases, our regret guarantee here is doomed to be pessimistic. This is indeed plausible in practice,
since the agent may have growing number of solutions with respect to T , especially for online
platforms.
This limitation can be handled by shrinking the eligible sets more in an aggressive manner,
instead of sequentially seeking the next-best solutions. Then, the linear dependency on K can
further be wiped out as follows.
Theorem 3.4. There exists an algorithm with WReg(T ) = O(Tγ log Tγ
ymin
discounting strategic agent.
+ log T ) against γ-
The proof and its algorithm are deferred to Appendix F. Note that the regret no longer depends
on the number of solutions K, but instead on log T . Our algorithm keeps shrinking the eligible
set until it concludes that the truly optimal solution lies within at most 1/T to the currently best
solution. Afterward, the regret is at most 1/T
T , thus does not affect the overall regret upper
*
bound. Intuitively, to remove the dependence on the number of solutions, such a logarithmic burden
on T is essential to guarantee that our eventual solution is correct up to O(1/T ) distance.
We further note that both the regret bounds of Theorem 3.3 and 3.4 have a logarithmic de-
pendency on 1/ymin. Assuming that Tγ = 1/(1
γ) = O(1), this regret bound yields a sublinear
−
regret upper bound if ymin = e−o(T ), but becomes detrimental the other way around. Interestingly,
however, we show that this dependency is necessary to obtain sublinear regret for any algorithm, by
e−T against the strategic
formally proving that no algorithm can achieve sublinear regret if ymin ≤
agent. The proof is presented in Appendix G.
8
Theorem 3.5. if ymin ≤
strategic agent.
e−T , then any algorithm has WReg(T ) = Ω(T ) against γ-discounting
Thus, the principal would suffer a large amount of regret by delegating to the agent whose
utility tends to be severely small.
Lipschitz utility with dense solutions. Next, we consider the case where the principal is not
aware of any lower bound on ymin, or such a lower bound does not exist. To cope with this lack of
information on ymin, we assume that there is no significant disparity in the utility between two close
solutions for both the principal and the agent, and the solutions are densely spread in the utility
space. Under these two assumptions, we provide an algorithm to find a semi-optimal solution.
These assumptions are formally presented as follows.
Assumption 3.6 (d-dense). Let dX(a, b) =
d > 0 if for any two solutions a, b
dX (a, b) > d and there exists another solution c such that dX(a, c)
Xa −
|
A, either of the following is satisfied: (i) dX (a, b)
. A problem instance is d-dense for some
d or (ii)
≤
dX (a, b).
Xb|
∈
d and dX (b, c)
≤
≤
Assumption 3.7 (L1, L2-Lipschitz continuity). There exists absolute constants L1, L2 > 0 such
that for any a, b
Xb|
dY (a, b)
and dY (a, b) =
dX (a, b), where dX (a, b) =
A, we have L1 *
Xa −
|
dX (a, b)
L2 *
≤
≤
∈
Ya −
|
.
Yb|
Our assumption of densely spread solutions is innocuous since the solutions will be packed more
in a compact manner as the number of solutions grow. Otherwise, if the number of solutions is
relatively small, then our results on the bounded agent's utility would kick-in, and thus one may
recover the sublinear regret. The Lipschitz continuity assumption is often valid, as it is observed
that when the agent's utility for two solutions is similar, the principal's utility follows suit, and
vice versa. For instance, if all the solutions lie in y = 1
x, then the Lipschitz condition holds with
(L1, L2) being (1, 1 + ε) or (1
−
ε, 1) for any choice of ε
0.
Further, we assume that Lipschitz parameters L1 and L2 tend to be close to each other, precisely,
4 L2. Indeed, if there exists a significant difference between L1 and L2, the Lipschitz
L2 ≥
assumption fails to effectively impose any restrictions.
L1 > 3
≥
−
Leveraging these assumptions, we propose a new algorithm. Since we lack precise information
on the required delay to ensure the submission of a solution, we cannot compel the agent to
be approximately myopic. We propose a modified version of the algorithm used above which
effectively leverages the assumptions above to explore superior solutions. The proof can be found
in Appendix H.
ALGORITHM 1: DelayedProgeressiveSearch
while any solution has not been received do
Announce E0.
{
−
←
←
←
←
L1
min
Ya0 , r
Xa0, y
Let a0 be the proposed solution.
3
4 L2, l
α
Announce E0 for D rounds.
l > 4d do
while r
−
l+r
2 ;
τ
Announce E>
τ .
if solution a is proposed by the agent then l
Announce El for D rounds.
r, l + y
r
Announce El for remaining rounds.
min
{
L1 }
←
←
;
1, l + y
, ε
←
4αd, D
←
Tγ log Tγ
ε ;
L1 }
Xa, y
←
←
Ya else r
τ ;
←
9
Theorem 3.8. If α := L1 −
against γ-discounting strategic agent.
3
4 L2 > 0, then Algorithm 1 has WReg(T ) = O(Tγ log Tγ
α + log 1
d + dT )
In Algorithm 1, we maintain an interval, denoted as [l, r], which encompasses the optimal
solution. It is guaranteed that at every round, a solution a exists such that Xa0 = l. According to
the Lipschitz continuity assumption, we can place an upper bound on r, signifying that the optimal
solution a∗ cannot be significantly distant from a. This is because when the difference between Xa∗
and Xa becomes large, it is expected that Ya∗
Ya will also be substantial. This is not possible
−
since Ya∗ is non-negative, and cannot be significantly greater than Ya, otherwise, it would have
been proposed by the agent in earlier rounds.
to d + l+r
With the bounded value of r, our objective is to determine if there exists a solution within the
right half of the interval. By considering the line x = l+r
2 , the d-dense assumption implies that if a
solution exists in the right half, there must be a solution with the principal's utility ranging from
l+r
2 . Utilizing the Lipschitz continuity along with the condition on its parameters, we
2
can find a lower bound on the agent's utility within that interval. Consequently, we can introduce
an appropriate delay to compel the agent to propose a solution from the right half if it exists. As
a result, the algorithm can determine the presence or absence of a solution in the right half and
subsequently shrink the interval accordingly. By continuing this procedure, the interval gradually
converges toward the optimal solution.
Furthermore, our regret upper bound essentially decomposes Tγ from T , and thus the effect of
discount factor is decoupled from the linear dependency of dT . The linear dependency on dT may
look pessimistic at first glance, but we reveal that this dependency is indeed optimal, as formally
presented as follows. The proof is in Appendix G.
Theorem 3.9. There exists a d-dense problem instance such that any algorithm suffers WReg(T ) =
Ω(dT ) against γ-discounting strategic agent.
Its proof easily follows from the proof of Theorem 3.5. Thus, this demonstrates the fundamental
inevitability of the term dT . It's worth noting that whenever d is subconstant, e.g., d = T −c for
c > 0, then our regret upper bound in Theorem 3.8 implies a sublinear regret.
In our online labor market example, since the number of workers in a platform usually grows
with respect to the time horizon, their intrinsic qualities might lie more compactly in the utility
space as time flows. For instance, if there are T ε workers having uniformly distributed utility in a
(0, 1), their utility will be O(T −ε)-densely spread, which would
compact utility space for some ε
yield dT = T 1−ε = o(T ) regret bound. In words, the requester needs to delegate to a platform with
a large number of solutions, i.e., delegating to big business matter. Conversely, the platform should
maintain more workers to attract requesters, i.e., economy of scale works, however, a trade-off
arises since the platform's gains from strategizing would be limited then.
∈
4 Stochastic Setting
For the stochastic setting, previous algorithms no longer work as the ex-post optimal solution varies
across the rounds. Thus, the objective of the principal here will not be to find the largest threshold
τ to exclude any ex-post suboptimal solutions, but to balance two quantities of probability that
the agent possesses a solution that belongs to the eligible set, and incentivizes the agent to submit
a good solution. Recall that this phenomenon is already well-captured in our benchmark (2.1)
and the corresponding notion of Stackelberg regret. Given the differences, the principal faces an
additional challenge of handling the random noise in the reward, where she needs to find the best
solution to balance the trade-off presented above.
10
To cope with it, we reduce our problem to a stochastic bandit problem which is standard in
the literature (Kleinberg and Leighton, 2003; Amin et al., 2013; Haghtalab et al., 2022). In the
stochastic multi-armed bandit problem, a principal has a set of Q arms, indexed by i
[Q], and
needs to decide which arm to pull at each round given the time horizon T . Each arm i is equipped
with a reward distribution Di with support [0, 1]. Given μi = Er∼Di [r], the principal's objective
E [ rt ], where rt
Er∼Di [r]
is to minimize expected regret defined by Reg(T ) = T
−
denotes the random reward of the arm selected at round t by the principal.
We first discretize the space of principal's utility into the set of i/Q for i
P
[Q] for some carefully
chosen parameter Q. Each element i/Q corresponds to a single arm, which represents the threshold
τ that the principal can commit to at each round. By pulling the arm i, the principal is essentially
announcing an eligible set of Eτi = 1
a
. Namely, the principal aims to find the best
i/Q
[Q]. If the discretization is dense enough with respect to the
eligible set among the set of Eτi for i
problem parameters, the regret bound here would imply a reasonable regret bound for our original
problem. We define f (τ ) = E
as the expected principal utility for using threshold τ .
Note that if the agent best responds, the expected utility from pulling arm i becomes f (i/Q).
x(t)
Br(t)(Eτ ) i
maxi∈[Q]
Xa ≥
{
∈
T
t=1
∈
∈
}
h
*
|
We assume that f (τ ) achieves its maximum for a unique τ ∗
(0, 1) with f ′′(τ ∗) < 0, which
is common in the literature (Kleinberg and Leighton, 2003; Amin et al., 2013; Haghtalab et al.,
2022). Now, we can simply use the well-known UCB upon the discretization, and obtain the
following results against the myopic agent.
∈
Theorem 4.1. If the agent is myopic, running UCB1 with discretization by Q = ( T
Reg(T ) = O(√T log T ).
log T )1/4 has
Its analysis is a simple variant of Kleinberg and Leighton (2003), but we provide the entire
proof to make paper self-contained. The proof can be found in Appendix I.
Next, to deal with the strategic behavior of the agent, we again exploit the concept of delay
to restrict the agent to be approximately best responding with a suitable choice of parameters. In
addition, however, we cannot simply expect that the outcome of pulling a single arm, i.e., a specific
eligible set, follows some stochastic distributions since the agent may strategically deviate from the
best response at hand. To cope with this additional challenge, we use the foundation of perturbed
bandit instance by Haghtalab et al. (2022).
Since the stochastic setting is a generalization of the deterministic setting, it is obvious that
we need a reasonable set of assumptions to obtain positive results. Similar to the deterministic
setting, we first assume that there exists a value ymin > 0 such that for any realization of the
agent's solutions, his utility for each solution is strictly greater than ymin. Secondly, we assume that
the problem instance satisfies the following assumption, which is a stochastic version of Lipschitz
continuity in the deterministic setting.
Definition 4.2 (Stochastic Lipschitz continuity). Under the stochastic setting, we say that the
problem instance is stochastically Lipschitz-continuous with parameter L1 > 0 if the ex-post utilities
dY (a, b).
of the solutions are correlated in a sense that for any a, b
dX (a, b)
A
a0}
, we have L1*
−{
∈
≤
Finally, our main result can be presented as follows.
Theorem 4.3. Under the two assumptions presented above, there exists an algorithm that has
WReg(T ) of
T log T + Tγ log
O
(cid:18)
p
Tγ max
(cid:18)
T
L1
,
(cid:18)
1
ymin (cid:19)(cid:19)
log T
,
(cid:19)
with γ-discouting strategic agent.
11
The algorithm and the proof can be found in Appendix J. Our proof essentially relies on a
construction of proper random perturbation interval, followed by the regret analysis of delayed
version of successive elimination algorithm by Haghtalab et al. (2022) and Lancewicki et al. (2021).
The technical subtlety lies on introducing a proper random perturbation interval to convert it to
the perturbed bandit instance. The latter term including Tγ, L1 and ymin incurs due to the strategic
behavior of the agent. Still, this only contributes log T amount of regret once all these parameters
are constants, which is dominated by the former term of √T log T .
5 Conclusion
We study a novel repeated delegated choice problem. This is the first to study the online learning
variant of delegated choice problem by Armstrong and Vickers (2010); Kleinberg and Kleinberg
(2018); Hajiaghayi et al. (2023). We thoroughly investigate two problem dimensions regarding
whether the agent strategizes over the rounds or not, and whether the utility is stochastic or deter-
ministic. We obtain several regret upper bounds for each problem setting, along with corresponding
lower bounds that complement the hardness of the problems and some assumptions therein. Our
analysis mainly characterizes the conditions of problem instances on which the principal can effi-
ciently learn to delegate compared to the case when she knows the optimal delegation mechanism
in hindsight, thereby providing fruitful insights in the principal's decision-making in delegation
process.
References
Ricardo Alonso and Niko Matouschek. 2008. Optimal delegation. The Review of Economic Studies
75, 1 (2008), 259–293.
Manuel Amador and Kyle Bagwell. 2013. The theory of optimal delegation with an application to
tariff caps. Econometrica 81, 4 (2013), 1541–1599.
Kareem Amin, Afshin Rostamizadeh, and Umar Syed. 2013. Learning prices for repeated auctions
with strategic buyers. Advances in Neural Information Processing Systems 26 (2013).
Mark Armstrong and John Vickers. 2010. A model of delegated project choice. Econometrica 78,
1 (2010), 213–244.
Peter Auer, Nicol`o Cesa-Bianchi,
and Paul Fischer. 2002.
the Multiarmed Bandit Problem.
https://doi.org/10.1023/A:1013689704352
Mach. Learn. 47,
Finite-Time Analysis of
235–256.
2–3 (may 2002),
Moshe Babaioff, Liad Blumrosen, Shaddin Dughmi, and Yaron Singer. 2017. Posting prices with
unknown distributions. ACM Transactions on Economics and Computation (TEAC) 5, 2 (2017),
1–20.
Yu Bai, Chi Jin, Huan Wang, and Caiming Xiong. 2021. Sample-efficient learning of stackelberg
equilibria in general-sum games. Advances in Neural Information Processing Systems 34 (2021),
25799–25811.
Jonathan Bendor, Amihai Glazer, and Thomas Hammond. 2001. Theories of delegation. Annual
review of political science 4, 1 (2001), 235–269.
12
Georgios Birmpas, Jiarui Gan, Alexandros Hollender, Francisco Marmolejo, Ninad Rajgopal, and
Alexandros Voudouris. 2020. Optimally deceiving a learning leader in stackelberg games. Ad-
vances in Neural Information Processing Systems 33 (2020), 20624–20635.
Yingni Guo and Johannes H ̈orner. 2021. Dynamic allocation without money. (2021).
Nika Haghtalab, Thodoris Lykouris, Sloan Nietert, and Alexander Wei. 2022. Learning in Stackel-
berg Games with Non-myopic Agents. In Proceedings of the 23rd ACM Conference on Economics
and Computation. 917–918.
MohammadTaghi Hajiaghayi, Keivan Rezaei, and Suho Shin. 2023. Multi-agent Delegated Search.
arXiv preprint arXiv:2305.03203 (2023).
Bengt Holmstrom. 1980. On the theory of delegation. Technical Report. Discussion Paper.
Jon Kleinberg and Robert Kleinberg. 2018. Delegated search approximates efficient search. In
Proceedings of the 2018 ACM Conference on Economics and Computation. 287–302.
R. Kleinberg and T. Leighton. 2003. The value of knowing a demand curve: bounds on regret
for online posted-price auctions. In 44th Annual IEEE Symposium on Foundations of Computer
Science, 2003. Proceedings. 594–605. https://doi.org/10.1109/SFCS.2003.1238232
Andreas Kleiner. 2022. Optimal Delegation in a Multidimensional World.
arXiv preprint
arXiv:2208.11835 (2022).
Tal Lancewicki, Shahar Segal, Tomer Koren, and Yishay Mansour. 2021. Stochastic multi-armed
bandits with unrestricted delay distributions. In International Conference on Machine Learning.
PMLR, 5969–5978.
Niklas Lauffer, Mahsa Ghasemi, Abolfazl Hashemi, Yagiz Savas, and Ufuk Topcu. 2022. No-Regret
Learning in Dynamic Stackelberg Games. arXiv preprint arXiv:2202.04786 (2022).
Tracy R Lewis. 2012. A theory of delegated search for the best alternative. The RAND Journal of
Economics 43, 3 (2012), 391–416.
Jin Li, Niko Matouschek, and Michael Powell. 2017. Power dynamics in organizations. American
Economic Journal: Microeconomics 9, 1 (2017), 217–241.
Elliot Lipnowski and Joao Ramos. 2020. Repeated delegation. Journal of Economic Theory 188
(2020), 105040.
Janusz Marecki, Gerry Tesauro, and Richard Segal. 2012. Playing repeated stackelberg games with
unknown opponents. In Proceedings of the 11th International Conference on Autonomous Agents
and Multiagent Systems-Volume 2. 821–828.
Noam Nisan, Tim Roughgarden, Eva Tardos, and Vijay V Vazirani. 2007. Algorithmic game theory.
Cambridge university press.
Morvarid Rahmani and Karthik Ramachandran. 2016. Dynamics of delegated search. Technical
Report. Working paper, Scheller College of Business, Georgia Institute of Technology . . . .
Ester Samuel-Cahn. 1984. Comparison of threshold stop rules and maximum for independent
nonnegative random variables. the Annals of Probability (1984), 1213–1216.
13
Heinrich Von Stackelberg. 2010. Market structure and equilibrium. Springer Science & Business
Media.
Yangge Xiao, Zhenyu Hu, and Shouqiang Wang. 2022. Information Design of a Delegated Search.
Available at SSRN 4249165 (2022).
Geng Zhao, Banghua Zhu, Jiantao Jiao, and Michael I Jordan. 2023. Online Learning in Stackelberg
Games with an Omniscient Follower. arXiv preprint arXiv:2301.11518 (2023).
14
A More discussions on motivation
As shown by the online labor market exampled presented in the introduction, repeated delegation
between two parties with misaligned utility and information asymmetry happens in many real-world
scenarios. For example, consider a university (principal) bears the cost of hiring faculty members
while delegating the role of selection to the department (agent). The university and the department
may have different goals in hiring faculty members, while the university may constrain feasible
candidates of faculties in advance. In addition, a content platform like Youtube (principal) decides
which contents to recommend to incoming users while requiring Youtubers (agent) to register
contents. This can essentially be viewed as a process of delegation, since although Youtube may
have registered the contents by itself, it delegates the role of registering contents to Youtubers due
to a lack of time, money, or expertise. Finally, one may consider an e-commerce (principal) decides
which items to recommend to incoming buyers. Typically, there exists a number of sellers (agent)
who contract with the e-commerce, and register their items in the platform. Thus, e-commerce
delegates the role of actually creating items and deciding which ones to sell. Note that in the
examples above, different from the online labor market example we provided in the introduction,
the platforms typically act as a principal and the individuals can be viewed as an agent.
B Connection to repeated posted pricing problem
We found an intimate connection between the repeated posted price mechanism (RPPM) and our
problem. For example, offering a price in RPPM can be viewed as announcing a thresholded
eligible set in our problem. The acceptance can be regarded as a submission of eligible solution,
and rejection as the agent declined to submit any solution. However, the correspondence is not
exact, since in RPPM there is only one value for the buyer w.r.t. to the item, but in our problem
there are multiple values w.r.t. multiple solutions that the agent might possess. Therefore, while
the only latent value that the principal needs to learn is the buyer's value for the item in RPPM,
in our setup, the principal needs to learn the value of multiple solutions. Finally, the principal
does not know how many solutions the agent possesses in advance. Besides, different from the fact
that the principal's utility (revenue = price) is exactly negatively correlated to the agent's utility
(valuation - price), in our setting, it can be arbitrarily correlated.
To provide a simple example of our analysis, given two solutions that yields principal's (x) and
agent's (y) utility of: (x, y) =(i) (0.5, 0.5) and (ii) (0.75, 0.75), there is no guarantee that the agent
would pick (ii), although it strictly dominate (ii). This is because the agent may think suggesting
(ii) would increase the principal's expectation on the further solutions, so that it prevents possibly
inferior solutions to be eligible in the future. This becomes more complicated when there are multi-
ple Pareto-optimal solutions w.r.t. the principal's and agent's utility. Despite these complications,
our analysis, however, reveals that one can construct efficient algorithms by incorporating existing
techniques and some new ideas on how to deal with agent (especially in strategic case).
C Proof of Theorem 2.2
Proof. To begin with, suppose first that M is a deterministic mechanism. Then, there exists a
)T representing the (possibly null) arms selected at each
deterministic sequence (at)t∈[T ] ∈
round. Since the agent is fully capable of computing the exact payoff, Denote the corresponding
agent's actions sequence by S(t)
t∈[T ]. Without loss of generality, suppose that the realization of the
X (t)
for the problem instances with M and M ′ remains the same. Given Ht, let M ′ be a single-
a
∪ {⊥}
(A
15
proposal mechanism that announces an eligible set which consists of the selected solution (possibly
null) by mechanism M at round t. Consider the agent's policy P ′ such that for each t
[T ], given
Ht and X (t)
, and otherwise he submits nothing. Then, it follows
=
a
⊥
∈
M,P = X (t)
M ′,P ′ and Y (t)
from the above construction that X (t)
M ′,P ′, and thus we essentially have
ΦM,P = ΦM ′,P ′ and ΨM,P = ΨM ′,P ′.
A, he submits at if at 6
M,P = Y (t)
for a
∈
Suppose that rewards of solutions realized to be ω(t) = (ω1(t), . . . , ωK(t)) for each t
[T ].
Now consider a randomized policy of agent P and (possibly) randomized mechanism M , where P
maximizes the agent's expected payoff. Let ΣP be the set of all possible random bits if P , and
similarly define ΣM for M . For each σ = (σP , σM )
ΣM , we can essentially compute
the agent's expected payoff yM,P (σ)(ω). Let σ∗(ω) = argmaxσ∈Σ yM (σM ),P (σP )(ω(t)). Let P ′ be the
agent's deterministic policy which plays P (σ∗(ω(t))) against M for each realization ω(t). Then,
due to our construction, P ′ yields a larger (or equal) agent's utility than P . If this yields a strictly
larger utility, then the agent should have played P ′, which is a contradiction. Thus, the agent's
policy can be made deterministic, and by the argument presented above, we finish the proof.
Σ = ΣP ×
∈
∈
D Proof of Theorem 3.1
Proof. As we discussed in the main paper, the proof is essentially based on two observations (i)
reduction to RPPM, and (ii) iterative algorithm. To this end, we first present the formal definition
of RPPM.
Definition D.1 (Repeated Posted Price Mechanism). In a repeated posted price mechanism prob-
lem, given T rounds, a buyer with an i.i.d. valuation vt from an unknown distribution supported
on [0, 1] arrives at each round, and decides whether to buy an item. The seller posts a price pt on
pt, and leaves otherwise. The seller's regret is defined
the item, and the buyer takes the item if vt ≥
E
by Reg(T ) = T
maxp∈[0,1] p
, i.e., the difference compared
−
to the optimal revenue in hindsight with a fixed price.
t=1 pt1
vt} i
pt ≤
h P
Pr [ v
p ]
≥
{
T
*
*
Now we prove the following claim.
Claim D.2. Suppose that the agent is myopic. Given a mechanism for the RPPM problem that
achieves regret of at most R(T ) on any instance with T rounds, we can construct a mechanism
M for the repeated delegated choice achieving the same regret bound R(T ) for all instances with T
rounds.
Proof of the claim. Let M be a mechanism for the RPPM problem. We construct a threshold-
based mechanism M ′ for the repeated delegated choice problem that simulates M . At each round,
the mechanism M chooses a price based on the history of the buyer's responses. In the RPPM
problem, this history consists of the prices used at each round and whether the buyer bought the
item or not. For M ′, we consider the history to be the threshold τ used in each round which defines
the eligible set Eτ and whether the agent proposes an eligible solution or not. Now, at each round,
we can consider the history for M ′ to be a history for M . If M would propose price p with the
given history, M ′ announces a threshold τ = p.
Now, consider an instance I ′ of the repeated delegated choice problem with T rounds.
In
the deterministic case, each random variable X (t)
takes only a single value, and so we abuse this
a
notation to refer to the value rather than the random variable. Let X (t) = maxa∈A X (t)
a denote the
maximum value of the principal's utility among the agent's solutions. We define instance I of the
RPPM problem, where the buyer's value is X (t) and there are T rounds. We show that the regret
16
of M ′ on I ′ is at most that of M on I. We prove inductively that at each round, the price M
proposes given I is the same as the threshold announced by M ′ for I ′, the agent and the buyer's
responses are the same which leads to the same history, and the principal utility achieved by M ′
is at least as high as the seller utility in M . In the first round, there is no history and in the other
rounds, the history will be the same by induction. So by definition, M ′ uses the price τ used in M
as the threshold. In I, the buyer buys if and only if X (t) is at least τ . Similarly, in I ′ the agent
proposes an eligible solution with principal utility at least τ if and only if such a solution exists
as this would result in a positive utility for the agent as opposed to the zero utility for submitting
an ineligible solution or no solution. So, the agent and buyer responses are the same. In addition,
if X (t)
τ the seller's utility is the price τ , and the principal's utility is at least τ as an eligible
solution is submitted. If X (t)
τ , the buyer does not buy and the agent can not propose an eligible
solution, so both the seller and the principal's utility will be 0. So, the principal's utility when
using mechanism M ′ in each round is at least as high as the seller's using M .
≥
≤
The regret in both cases is defined as the difference between the utility achieved and the optimal
X (t) in both cases. Therefore, the regret of M ′ on I ′ is at most the regret of M
utility, which is T
on I. So, if M has regret at most R(T ) on instances with T rounds, M ′ will also achieve the same
regret bound.
*
Now, the regret upper bound of log log(T ) can directly be obtained from the following theorem.
Theorem D.3 (Kleinberg and Leighton (2003)). There exists an algorithm achieving regret O(log log T )
for the RPPM problem in the deterministic myopic setting.
ALGORITHM 2: IterativeSearch
τ = 0, f = 0
while f
= 1 do
Announce E>
if arm a is proposed by the agent then τ
τ for a single round.
Announce Eτ for remaining rounds.
Xa else break;
←
|
|
a
{
a
{
Xa > τ
τ
Xa ≥
improves the solution. Note that E>
than τ , i.e., E>
τ :=
least τ , i.e., Eτ :=
In order to obtain the regret upper bound of K, we present Algorithm 2 which iteratively
τ denotes the set of eligible arms with principal's utility greater
, and Eτ denotes the set of eligible arms with principal's utility at
}
.
}
Due to the myopic and deterministic nature of the agent, it is obvious that Algorithm 2 first
finds the best arm in terms of the agent. Then, the eligible set is set to preclude that arm, and thus
the agent will submit another arm which yields larger principal's utility. This process terminates
at most after K rounds since it excludes at least 1 arm at each round. Thus, its regret is at
most O(K). Combining the above observations, we can essentially compare K and log log T , and
determine which algorithms to exploit, and it completes the proof.
E Proof of Theorem 3.3
Proof of Theorem 3.3. The proof relies on the following lemma.
Lemma E.1. In a D-delayed mechanism where D = Tγ log Tγ
ymin
E>
τ , the agent submits a solution if and only if solution a exists such that Xa > τ .
, when the principal announces
17
6
ALGORITHM 3: DelayedIterativeSearch
τ
←
while f
Tγ log Tγ
←
= 1 do
ymin , f
0, D
←
0;
Announce E>
τ for a single round.
if solution a is proposed by the agent then τ ′
Announce E>
if f
τ for D rounds.
τ ′;
= 1 then τ
Announce Eτ for remaining rounds.
←
Xa else f
1;
←
←
Proof. When the mechanism is D-delayed, then the agent plays his ε best response. Given E>
τ , if
the agent proposes an eligible solution, then he obtains the utility of more than ymin. On the other
hand, if the agent does not propose any solutions, he gets the utility of 0. As ε = ymin, the ε-best
responding agent proposes a solution if he has at least one eligible solution.
The above lemma indicates that by announcing E>
τ , the principal can check whether there
exists solution a such that Xa > τ or not. We consider algorithm 3. In this algorithm, when the
principal observes solution a, she announces E>
Xa and due to Lemma E.1, checks whether there
exists a better solution or not. By observing a better solution, the principal does the same thing
and keeps observing better solutions. This process continues until the principal observes the best
solutions. As a result, after at most K iteration of the algorithm, the principal observes the best
solution. Each iteration of the above algorithm, takes D rounds, hence, total regret is bounded by
KD where D = Tγ log Tγ
ymin
.
F Proof of Theorem 3.4
1
←
←
T do
ALGORITHM 4: DelayedBinarySearch
Tγ log Tγ
ymin , l
0, r
D
←
l > 1
while r
−
l+r
2 ;
τ
Announce E>
τ for a single round.
if solution a is proposed by the agent then l
Announce El for D rounds.
Announce El for remaining rounds.
←
τ else r
τ ;
←
←
Proof of Theorem 3.4. The proof is based on Algorithm 4. We claim that the optimal Xa∗ always
lies in the interval [l, r]. When l = 0 and r = 1, it is obvious that the optimal solution lies in
this interval. Then on each iteration, principal puts τ = l+r
τ . According to
Lemma E.1, if the agent has solution a such that Xa > τ , the principal observes that solution
and should find the optimal solution in the interval [τ, r]. On the other hand, there do not exist
any solutions in the interval [τ, r] and the algorithm continues searching for the optimal solution
in [l, τ ]. In this type of rounds, regret is at most 1.
2 and announces E>
The algorithm stops shrinking the interval until its length gets smaller than 1
T . After that
the principal announces El and as the optimal solution lies in the interval [l, r], regret is at most
r
l = 1
T .
This algorithm needs O(log T ) iterations and on each iteration announces O(D) eligible sets.
l is shrunk by a multiplicative factor of 2, total
On those rounds, regret is at most r
l. as r
−
−
−
18
6
6
regret in these rounds will be at most
D +
D
2
+
D
4
+
D
8
+ ...
2D
≤
After log T iterations, regret is at most 1
T . Hence, total regret is O(Tγ log Tγ
ymin
+ log T ).
G Proof of Theorems 3.5 and 3.9
After establishing the proof for Theorem 3.5, it becomes straightforward to infer Theorem 3.9.
Thus, we start with Theorem 3.5.
∈
Proof of Theorem 3.5. We consider two problem instances and claim that in at least one of them,
the principal obtains a linear regret. We use P1 and P2 to refer to those instances. We assume
that in P1, there are two deterministic solutions a1 and a2 with utility of (Xa1 , Ya1) = (d, 1) and
(Xa2 , Ya2) = (2d, y). In P2 the only solution is a1. We assume that in both instances, the principal
has already observed a1. In problem P1, the principal has to find a2 as her regret is d for each
round of not receiving a2. However, in problem P2, a1 is the optimal solution and the principal
wastes her time by looking for better solutions.
We show that under the setting where y
c1, c2, ..., cK }
{
e−T , the principal's regret in at least one of P1 and
≤
P2 will be Ω(T d). Let C =
be the rounds in instance P2 such that the principal
looks for a better solution, i.e., a2. In those rounds, she announces an eligible set such that a1 is
no longer eligible, thus, in P2 she receives no solutions and has the regret of d. Thus, her regret
in P2 is Ω(Kd) because, in K rounds, she receives no solutions. This implies that in order to get
sublinear regret, K
o(T ).
We note that in problem P1, the principal needs to find a2 in sublinear rounds. Indeed, if the
principal observes a2 after l rounds, then her regret for previous rounds is at least d, hence, her
total regret is Ω(ld), which implies that for sublinear regret l should be sublinear, i.e., l
o(T ).
Now we consider the agent's response in P1. We note that as long as the agent does not reveal
a2, the principal cannot distinguish between P1 and P2. So, her strategy is the same in both
problem instances. In the case that the agent decides not to hide a2, denote by j the first round
that the agent's behavior is different in P1 and P2. In fact, in round j of instance P1, the agent
proposes a2. We note that according to the argument we mentioned above, j
O(l). This implies
that j
o(T ). After that round, as the principal has already observed a2, she never announces an
eligible set such that a1 is accepted. Thus, agent's utility starting from round j will be at most
γjy
γj y
∈
∈
T −1
t=j γt
1−γ .
If the agent decides to hide a2, then he does not propose it in round j and the principal's
P
strategy will be the same as her strategy for P2. As the principal does not accept a1 only for K
rounds, then in at least one of the rounds j, j + 1, ..., j + K, principal accepts a1 and the agent gets
the utility of at least γj+K. We note that as both j, K
o(T ), then all rounds j, j + 1, ..., j + K
exist.
∈
≤
∈
Since the agent wants to maximize his utility, if he decides to propose a2 in round j, then
his maximum possible utility should be at least his minimum utility in the scenario he hides that
solution. Formally,
γj
1
y
−
γj+K.
γ ≥
19
This implies that
y
1−γ ≥
γK. By assuming the fact that y
e−T , then we have
≤
e−T
1
−
γ ≥
γK .
By taking log of both sides, we get
K log γ
T
−
≤ −
log (1
γ).
−
Ω(T ). This implies that the principal needs to spend
Finally, K
Ω(T ) rounds to check whether a better solution exists or not, which is a contradiction with the
previous argument that K
. Hence, K
o(T ).
≥ −
∈
T
log γ −
log (1−γ)
γ
∈
Proof of Theorem 3.9. We note that the above instances P1 and P2 satisfy d-dense assumption.
e−T , then there the
This implies that we showed even under d-dense assumption when ymin ≤
principal suffers from Ω(T d) regret.
H Proof of Theorem 3.8
Proof. We obtain an upper bound on the regret for a more generalized version of the algorithm 5.
In this algorithm, we assume that there exists β
2 such that L1
≥
β+2
2β L2 > 0.
−
ALGORITHM 5: DelayedProgeressiveSearch
while any solution has not been received do
Announce E0.
←
Ya0 ;
L1 }
Xa0 , y
Let a0 be the proposed solution.
β+2
2β L2, l
α
L1
←
←
−
1, l + y
min
r
;
{
←
l > βd do
while r
−
l+r
τ
α(r
2 , ε
←
Announce E>
τ .
if solution a is proposed by the agent then l
Announce El for D rounds.
r, l + y
r
Announce El for remaining rounds.
l), D = Tγ log Tγ
ε ;
min
{
L1 }
←
←
−
;
Xa, y
←
←
Ya else r
τ ;
←
At first, the algorithm keeps accepting all solutions until the agent proposes any of them. it is
obvious that there is no merit for the agent to not propose any solution at all. In fact, even after
a single round of accepting all solutions, the agent proposes a0 and we can initialize corresponding
variables in our algorithm.
We claim that the optimal Xa∗ always lies in the interval [l, r]. At first, as l = 0 and r = 1, this
interval contains all solutions. On each iteration, we assume that there exists solution a0 such that
β
l > βd, the algorithm shrinks the interval. let p to be r−l
2 d.
l = Xa0 . As long as r
it picks τ = l+r
τ or not. if it
2 and aims to check whether there exists solution a such that Xa ≥
can guarantee there exists a solution in the interval [τ, r], the principal continues searching in that
interval, otherwise, she continues searching in the interval [l, τ ].
2 , thus, p
−
≥
exists a solution a′ such that τ
According to d-dense assumption, if there exists a solution a such that Xa ≥
≥
τ + d. We note that τ + d
r since β
Xa′
≤
≤
≤
τ , then there also
τ + d,
2. As Xa′
≤
20
according to Lipschitz continuity dY (a′, a0)
≤
(Xa′
Xa0), i.e.,
−
Ya0 −
Ya′
L2 *
L2 *
L2 *
L2 *
L2 * (cid:18)
≤
≤
≤
≤
(Xa′
−
(τ + d
Xa0 )
l)
−
(p + d)
2 + β
β
p
(cid:19)
This implies that
Ya′
Ya0 −
L2 *
(
≥
2 + β
β
p).
(H.1)
Furthermore, we can always assume that r
r, then according to Lipschitz continuity, dY (a′′, a0)
l is bounded. This is due to the fact that if there
Xa0),
(Xa′′
−
L1 *
≥
−
is a solution a′′ with Xa′′
i.e.,
≥
Ya0 −
|
Ya′′
| ≥
≥
≥
Xa0 )
−
l)
(Xa′′
(r
L1.
−
L1 *
L1 *
2p
*
2pL1 or Ya′′
Ya0 −
This implies that either Ya′′
≤
Ya + 2pL1 is not possible. As we will later show, we always put
We first show that Ya′′
≥
β+2
β L2. Thus, the agent always plays αβd best response. In this case,
ǫ = αβd where α = L1 −
L1βd > αβd. This implies that αβd best-responding agent
2pL1 ≥
Ya0 ≥
Xa′′ > Xa0 and Ya′′
should not propose a0 as a′′ gives him at least αβd more utility and whenever solution a0 is eligible,
so does a′′.
Ya0 + 2pL1.
≥
−
Therefore, we focus on case where Ya′′
2pL1. if Ya0 −
r, thus, we can shorten the interval, i.e., we can decrease r. In fact,
2pL1 < 0, then there cannot be
Ya0 −
≤
any solution with Xa′′
≥
indicating that r should not exceed l +
than l + Ya0
L1
Ya0
L1
. If it surpasses this value, we simply update it to l + Ya0
L1
.
Now, we use this lower bound on Ya0 to find a lower bound on Ya′. We define α > 0 to be
0,
2pL1 ≥
Ya0 −
. Consequently, in each iteration, we verify if r is smaller
(H.2)
α := L1 −
β+2
β L2.
Ya′
Ya0 −
≥
β + 2
β
p
L2
*
β + 2
β
β + 2
2β
p
L2
*
L2(cid:19)
2p
L1 −
*
≥
L1 −
2p
(cid:18)
αβd.
≥
≥
(H.1)
(H.2)
(definition of α)
The above lower bound shows that if there exists a solution in the interval [τ, r], then there
exists solution a′ such that the agent's utility for that is at least αβd. We put ε to be αβd and D
21
−
≤
to be Tγ log Tγ
by announcing E>
ε , Then the D-delayed mechanism makes the agent play his ε best response. Hence,
τ , the agent will propose a solution if there exists a solution in interval [τ, r].
After observing his proposal, the algorithm updates the interval correspondingly. If a is proposed
τ ), then it keeps searching for better solutions in the interval [Xa, r]. We note
by the agent (Xa ≥
that for the next iteration, we maintain the property l = Xa. On the other hand, if the agent
does not propose any solutions, the principal has to search for better solutions in the interval [l, τ ].
Similarly, note that l = Xa0 in the next iteration. in this type of rounds, regret is at most 1.
We keep shrinking this interval until its length gets smaller than βd (β
2). At this point, we
keep announcing El and solution a0 is eligible, so the principal gets the utility of at least l and the
regret is at most r
βd.
≥
l
As in each iteration, the length of the interval becomes at most half of the previous interval,
number of iterations is O(log 1
βd ). On each iteration, we run O(D) rounds where
D = Tγ log
Tγ
αβd
.
The regret of the algorithm on those rounds is at most r
−
multiplicative factor 2, then the total regret in these rounds as at most
l. As r
−
l is shrunk by at least a
D +
D
2
+
D
4
+ ...
2D.
≤
Also, after stopping exploration, the regret is at most βd. So the total regret is O(Tγ log Tγ
log 1
βd + βdT ). By plugging β = 4, we get the bound provided in the Theorem 3.8.
αβd +
I Proof of Theorem 4.1
Proof. Our proof is essentially based on the following series of lemmas.
Lemma I.1. There exist constants C1, C2 such that C1(τ ∗
τ )2 < f (τ ∗)
−
f (τ ) < C2(τ ∗
τ )2.
−
−
ε, τ ∗ +ε) such that for some constants A1, A2 we have A1(τ ∗
Nε(τ ∗). Now consider the complement of Nε(τ ) defined by X =
Proof. Since f ′′(τ ∗) exists and has a strictly negative value, there exists a neighbor Nε(τ ∗) =
(τ ∗
τ )2
−
−
for τ
.
ε
τ
}
| ≥
Due to the compactness of X and since f (τ ∗)
X, there
are constants B1, B2 such that B1(τ ∗
X. Then,
C1 = min(A1, B1) and C2 = max(A2, B2) finishes the proof.
f (τ ) < A2(τ ∗
τ ∗
|
f (τ ) is strictly positive for all x
τ )2 for x
f (τ ) < B2(τ ∗
τ )2 < f (τ ∗)
τ )2 < f (τ ∗)
−
[0, 1] :
τ
{
−
−
−
−
−
−
∈
∈
∈
∈
Lemma I.2. The discretization error f (τ ∗)
maxi f (i/K)
−
C2/K 2.
≤
Proof. Note that there exists an element in the set of arms
denote this arm by j. Then we have
1/K, . . . , K/K
{
}
satisfy i/K
x∗
−
≤
1/K,
f (τ ∗)
max
i
−
f (i/K)
f (j/K)
j/K)
f (τ ∗)
−
C2(τ ∗
−
C2/K 2,
≤
≤
≤
where the second inequality follows from Lemma I.1, and the last holds due to our construction of
j.
22
Lemma I.3. Let ∆i = max1≤j≤K f (j/K)
f (i/K). Then, The sum of inverse gaps satisfies
−
∆i>0 1/∆i ≤
7K 2/C1.
P
C1(τ ∗
Proof. Due to Lemma I.1, we have ∆i ≥
̃∆K−1 be an ordered sequence of the set A =
j/2K, we have ̃∆j ≥
satisfy i/K
x∗
−
≤
[K]. Define 0 = ̃∆0 ≤
i/K)2 for i
−
≤
∆i}i∈[K]. Since at most j elements of the set A
{
̃∆1 ≤
. . .
∈
C1(j/2K)2. Hence we obtain
1/∆i <
Xi:∆i6=0
K
Xi=1
C −1
1 (i/2K)−2 <
4K 2
C1
K
i2
Xi=1
π2
6
4K 2
C1 *
7K 2
C1
,
<
≤
and it completes the proof of the lemma.
We can now use the following regret bounds for the UCB1 algorithm to complete the proof.
Lemma I.4. Auer et al. (2002) In a multi-armed bandit instance with K > 1 arms, the UCB1
algorithm achieves an expected regret of at most
O([
X∆i>0
log T
∆i
K
] +
∆i)
Xi=1
after T rounds, where ∆i = max1≤j≤K f (j/K)
of arm i and the optimal arm.
−
f (i/K) is the difference between the expected utility
Lemma I.5. Let DiscreteReg be the regret of the UCB1 algorithm compared to the utility of always
using τ = [arg max1≤i≤K f (i/K)]/K as the threshold. Then DiscreteReg = O( K 2
C1
log T + K)
Proof. Using Lemma I.4, we have
DiscreteReg = O([
X∆i>0
log T
∆i
K
] +
∆i)
Xi=1
K
log T +
∆i)
Xi=1
log T + K).
= O(
= O(
K 2
C1
K 2
C1
(LemmaI.4)
(Lemma I.3)
(∆i ≤
1)
The regret of UCB1 compared to the optimal benchmark, which achieves a utility of T max τ f (τ ),
can be calculated by summing up DiscreteReg and the discretization error. Therefore, the total
regret of the algorithm is
REG = DiscreteReg + DiscretizationError
= O(
K 2
C1
log T + K +
T
K 2 ),
(I.1)
(I.2)
23
where we use Lemma I.2 and Lemma I.5. Plugging in K = ( T
the regret
log T )
1
4 , we get the desired bound on
log T + K +
T
K 2 )
REG = O(
= O(
= O(
K 2
C1
√T log T
C1
T log T ).
+ (
1
4
)
T
log T
+
T log T )
p
p
J Proof of Theorem 4.3
ALGORITHM 6: SuccessiveEliminationDelayed [Haghtalab et al. (2022)]
K arms, delay D, perturbation δ,
[K]
while t < D do
do
A ←
for i
∈ A
Pull arm i and observe feedback (principal's utility) rt;
t
for i
1 then
t−D
1
τ =1
1
t + 1;
←
do
∈ A
if t
D
−
≥
max(
n
←
t−D
1
P
ˆμi
τ =1
n
←
P
ˆμi
LCBi
−
←
UCBi
ˆμi +
←
else continue;
p
p
: UCBi
, 1);
iτ = 1
}
{
rτ ;
iτ = i
{
}
2 log(T )/n
δ;
2 log(T )/n + δ;
−
A ← {
i
∈ A
LCBj,
j
∀
.
∈ A}
≥
Before we proceed, we present the formal definition of the perturbed bandit problem.
Definition J.1 (Bandits with perturbed rewards). Let
problem. We say that the ex-post sequence of rewards r1, r2, . . . , rT are δ-perturbed from the
for any arm sequence a1, . . . , aT that happens with positive probability in
}t∈[T ] such that rt ∈
random intervals
μat + δ.
be an instance of the multi-armed bandit
if
, there exist independent
[lt, ut] almost surely and μat −
I
E [ ut ]
[lt, rt]
{
E [ lt ]
≤
≤
≤
I
I
δ
Proof. We mainly analyze the regret upper bound of Algorithm 6. We first present the following
lemma, which characterizes the regret upper bound of Algorithm 6 for a bandit problem with
delayed feedback and perturbed rewards.
Lemma J.2 (Haghtalab et al. (2022)). For a multi-armed bandit problem with K arms, δ-perturbed
rewards, and D-delayed feedback, Algorithm 6 has regret upper bound of O(
+ δT +
D log K), where ∆i denotes the difference of the mean rewards between the optimal arm and arm i.
log T
∆i
∆i>0
P
To apply Lemma J.2, we essentially need to construct the proper random interval to guarantee
some bounded perturbation of our reduced bandit problem. We write Eτ to denote the eligible set
a : Xa ≥
{
. Our construction of perturbation proceeds as follows.
}
τ
24
Lemma J.3. Fix an ex-post realization of all the arms. Let xτ = XBr(Eτ )
define l = (xτ −
addition, we have E [ xτ ]
L−1
1 ε) and u = (xτ + L−1
L−1
1 ε
Brε(Eτ ), then l
1 ε.
1 ε). If a
E [ u ]
∈
E [ xτ ] + L−1
E [ l ]
≤
1
XBr(Eτ ) ≥
Xa1
(cid:8)
τ
Xa ≥
} ≤
{
τ
and
(cid:9)
u. In
−
≤
≤
≤
Proof. The latter condition directly follows from the definition of l and u. To check the former
inequality, we use our assumptions on ymin and Lipschitz continuity.
Brε(Eτ ) be an ε-best response arm. If arm a is not in the eligible set, then the agent
must not have any eligible arms. Otherwise, proposing that arm would achieve a utility of at least
ymin > ε, which contradicts a being an ε-best response. Therefore in this case, Xa1
and
xτ are both equal to 0 and so the first condition stands.
Xa ≥
{
Let a
∈
}
τ
Now, we can assume that a is an eligible arm. We have
Xa −
|
XBr(Eτ )| ≤
≤
L−1
Ya −
1 |
εL−1
1 ,
YBr(Eτ )|
where the first inequality follows from Lipschitz continuity, and the second holds by ε-best-responseness
of the action a. Thus, we obtain
If arm a is eligible, then it implies that the best response is also eligible. Therefore, we have
XBr(Eτ ) −
ε/L1 ≤
Xa ≤
XBr(Eτ ) + ε/L1.
Xa1
Xa ≥
{
τ
}
= Xa
XBr(Eτ ) + ε/L1
≤
= (XBr(Eτ )
= u,
1
Br(Eτ )
{
τ
}
≥
+ ε/L1)
where the first equation follows from a's eligibility and second equation follows since Br(Eτ ) is
eligible. Further we similarly obtain Xa ≥
Br(Eτ )
{
ε/L1) = l.
(XBr(Eτ )
} −
≥
1
τ
Now observe that
Similarly,
and it completes the proof.
E [ l ] = E
E [ u ] = E
(cid:2)
(cid:2)
(xτ −
L−1
1 ε)
= E [ xτ ]
(cid:3)
L−1
1 ε.
−
(xτ + L−1
1 ε)
= E [ xτ ] + L−1
1 ε.
(cid:3)
Together with Lemma J.2, our bandit problem is L−1
1 ε-perturbed from the stochastic setting
with a myopic agent, assuming that the agent is ε-best responding. Hence, similar to (I.2) in the
proof of Theorem 4.1, running Algorithm 6 with δ = L−1
1 ε yields
RegT = O(T log T
7K 2
C1
*
+ L−1
1 εT + D log K +
T C2
K 2 ).
Plugging in ε = min(L1/T, ymin), D = Tγ log(Tγ/ε), and K = (T / log T )1/4, we obtain
RegT = O
(C1 + C −1
(cid:16)
2 )(T log T )1/2
+ Tγ log(Tγ max(T /L1, 1/ymin) log T
,
(cid:17)
and it completes the proof.
25
K Necessity of Discount Factor
We note that with modest assumptions about the difference in the agent's utility for different
solutions, we can show that it is not possible for the principal to achieve a sublinear regret. To
show the inevitability of linear regret, we can consider two simple cases with a strategic agent with
deterministic utility. In the first case, the agent only has a single solution with utility 1/2 for the
principal and utility 1 for the agent. To achieve sublinear regret compared to the optimal, the
principal needs to accept this solution in all but a sublinear number of rounds. For a large enough
T , we can assume that this solution needs to be accepted in at least 2T /3 rounds.
In the other case, the agent again has the same solution with utilities 1 and 1/2, in addition
to a solution with a utility of 1 for the principal and utility ǫ for the agent. For the principal to
achieve a sublinear regret, she needs to get the solution with utility 1 in all but a sublinear number
of rounds. So, we can assume that for large enough T , any mechanism achieving sublinear regret
gets the agent to submit this solution in at least 2T /3 rounds. This results in a utility of at most
2T /3
ε + T /3 for the agent. However, if the agent pretends to only have the first solution and
acts the same as the agent in the other case, he can achieve a utility of at least 2T /3, since the
principal wants to have sublinear regret in the previous case. For ε < 1/2, this results in a better
utility for the agent. Therefore, it is impossible for the principal to achieve a sublinear regret for
both of these cases for large T .
*
26
|
|
http://arxiv.org/abs/2310.04880v1 | "2023-10-07T17:37:48" | "2023-10-07T17:37:48" | Question-focused Summarization by Decomposing Articles into Facts and
Opinions and Retrieving Entities | This research focuses on utilizing natural language processing techniques to
predict stock price fluctuations, with a specific interest in early detection
of economic, political, social, and technological changes that can be leveraged
for capturing market opportunities. The proposed approach includes the
identification of salient facts and events from news articles, then use these
facts to form tuples with entities which can be used to get summaries of market
changes for particular entity and then finally combining all the summaries to
form a final abstract summary of the whole article. The research aims to
establish relationships between companies and entities through the analysis of
Wikipedia data and articles from the Economist. Large Language Model GPT 3.5 is
used for getting the summaries and also forming the final summary. The ultimate
goal of this research is to develop a comprehensive system that can provide
financial analysts and investors with more informed decision-making tools by
enabling early detection of market trends and events. | [
"Krutika Sarode",
"Shashidhar Reddy Javaji",
"Vishal Kalakonnavar"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04880v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04880v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.AI",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.AI",
"cs.LG"
] | Question-focused Summarization by Decomposing Articles into Facts and
Opinions and Retrieving Entities
Krutika Sarode, Shashidhar Reddy Javaji, and Vishal Kalakonnavar
College of Information and Computer Sciences
University of Massachusetts Amherst
Abstract
This research focuses on utilizing natural lan-
guage processing techniques to predict stock
price fluctuations, with a specific interest in
early detection of economic, political, social,
and technological changes that can be lever-
aged for capturing market opportunities. The
proposed approach includes the identification
of salient facts and events from news articles,
then use these facts to form tuples with enti-
ties which can be used to get summaries of
market changes for particular entity and then
finally combining all the summaries to form
a final abstract summary of the whole article.
The research aims to establish relationships be-
tween companies and entities through the anal-
ysis of Wikipedia data and articles from the
Economist. Large Language Model GPT 3.5 is
used for getting the summaries and also form-
ing the final summary. The ultimate goal of this
research is to develop a comprehensive system
that can provide financial analysts and investors
with more informed decision-making tools by
enabling early detection of market trends and
events.
1
Introduction
1.1 Task Description
We propose the development of a system that caters
to financial analysts and investors by extracting
relevant information from news articles and gen-
erating summaries on the potential impact on a
particular company. This system comprises four
key tasks. Firstly, it involves the extraction of sen-
tences from news articles, which will be labeled as
either factual or opinionated (F v O), with the focus
on utilizing factual sentences. Since the news data
(coming from the Economist) is generally accurate
in its reporting, we constructed our baseline of F
v O on linguistic structures. We classify subjec-
tive/opinionated sentences as containing subjective
words/phrases ("I think", "believe", "hope", etc)
and factual sentences as containing words/phrases
like "according to", "studies show", and "research
indicates". Secondly, the system will match each
fact with the top-K most relevant entities. This is
done using Pyserini to retrieve and match compa-
nies/their descriptions to an extracted fact. Thirdly,
for each (fact, company) pair, the system will gener-
ate a summary outlining how the news will impact
the particular company using a LLM/summarizer
like GPT. We have currently found success using
GPT 3/3.5 turbo. Finally, the system will aggregate
the summaries across the entire article to extract
the most significant information for each article,
also using a LLM/summarize. GPT 3.5 turbo is
currently being used for this task. By performing
these tasks, the proposed system aims to provide
financial analysts and investors with a comprehen-
sive understanding of the potential effects of news
articles on specific companies, allowing for more
informed decision-making.
1.2 Motivation and Limitations of Existing
Work
There exist works that exhibit proximity to our
own work, although their approaches are distinct.
Our work, however, leverages the potency of Large
Language Models in tandem with facts and events
extracted from news articles to yield outputs that
are more efficacious. Prior works have been con-
strained by the utilization of knowledge graphs and
other custom algorithms to establish relationships
between given events or facts and the relevant news
articles, thereby presenting certain limitations or
inadequacies
1.3 Proposed Approach
The proposed methodology integrates a rule-based
model and Large Language Models (LLM) for the
extraction of facts and events from news articles.
Using the extracted facts, a retrieval model is em-
Figure 1: WorkFlow
ployed to identify the top-K companies related to
each fact. A tuple of (fact, company) is then gen-
erated for each relevant company. The impact of
each fact on its respective company is determined
by employing a language model. These individual
summaries for each company are then aggregated
to provide a concise overview of the potential im-
pact of the news. This comprehensive summary
can be utilized by financial analysts and investors
to make informed decisions. By utilizing this ap-
proach, we aim to improve the accuracy and effi-
ciency of analyzing news articles to better inform
financial decision-making.
1. Factual news generation: In order to utilize
verified data that is based on evidence and
avoid personal judgments and beliefs, it is
necessary to separate factual sentences from
news articles. This can be achieved by an-
alyzing sentence structures and identifying
subjectivity markers, such as words like "be-
lieve," "think," "feel," and "hope," to filter
out opinionated sentences. Additionally, sen-
timent analysis and negation detection can be
used to further refine the extraction of factual
statements. This process involves using the
NLTK and Spacy libraries in Python to cre-
ate a rule-based model. By applying various
vocabulary-based filters, we can identify and
extract all factual statements, which can be
used in subsequent steps.
2. Generation of fact, entity pair: After ex-
tracting facts from the news articles, the next
step is to identify the three most relevant en-
tities for each fact. In this context, relevance
refers to the entities that are most likely to be
impacted by the fact. To perform this step,
we gather relevant information about the enti-
ties, such as their descriptions from Wikipedia
pages, and use the Hugging Face sentence
transformer to create embeddings for each en-
tity. These embeddings are used to create an
entity corpus. Next, we create an embedding
for each fact and use Dense Passage Retrieval
(DPR) techniques to map the fact embedding
to the three most relevant entities in the cor-
pus. DPR uses a bi-encoder to rank the entities
based on their relevance to the fact. This pro-
cess results in fact-entity pairs that provide a
clear understanding of which entities are most
likely to be impacted by each fact.
Example:
Fact:
"The legendary auto executive has spent the
last two months in jail since his arrest in
Tokyo on November 19. He has been charged
by Japanese prosecutors with financial mis-
conduct while head of automaker Nissan
(NSANF). Ghosn, 64, denies the charges, but
prosecutors have argued successfully that he
should be kept in jail awaiting trial".
Entity Description:
Halliburton Company: "Halliburton Com-
pany is an American multinational corpora-
tion responsible for most of the world's hy-
draulic fracturing operations.[6] In 2009, it
was the world's second largest oil field service
company. It has operations in more than 70
countries.[7] It owns hundreds of subsidiaries,
affiliates, branches, brands, and divisions
worldwide and employs approximately 55,000
people.[8] The company has dual headquar-
ters located in Houston and in Dubai and re-
mains incorporated in the United States."
3. Generating impact of the fact on entity: To
determine the impact of each fact on the rel-
evant entities, we utilize Language Learning
(LL) models such as the chat feature of the
GPT-3.5 Turbo model. By inputting the fac-
tual statements and relevant entities, we can
generate a brief description of how each entity
is impacted by the fact. We use chat-based
prompts to provide context for the LL models,
such as: "Imagine that you are an expert finan-
cial analyst and you are analyzing the impact
of a certain news article on different stocks
and companies." To input the relevant entity,
we use prompts like: "Consider the company
" + entityname + ", which is described as "
+ entitydescription + "." Finally, we provide
the factual statement to the LLM as part of
the prompt and ask it to provide a brief sum-
mary of the potential impact of the news on
the entity. This step helps us to gain a better
understanding of how each fact is likely to
affect the entities that are relevant to it.
Example:
Fact-Entity Summary:
"The charge of financial misconduct against
the former head of Nissan, who is also a for-
mer executive of Halliburton, may potentially
affect the reputation of Halliburton negatively.
As the company has been involved in contro-
versies before, this news may lead investors
and stakeholders to question the company's re-
sponsible management and ethical practices.
This could potentially lead to a decrease in the
company's stock price and investment, dam-
aging its financial performance. However, the
extent of the impact would depend on how the
company and its current management address
the issue and respond to the situation.".
Article summary:
"The news regarding Carlos Ghosn being re-
placed as chairman and CEO of Renault is
not expected to have a direct impact on Al-
phabet Inc, General Motors Company (GM),
Tesla Inc., Howmet Aerospace Inc., A garter,
or Garman as they are not directly related to
the automotive industry or the companies in-
volved. However, there may be indirect effects
on these companies and the broader technol-
ogy and automotive sectors. For Alphabet
Inc, any changes in the global automotive
industry resulting from Ghosn's replacement
could indirectly affect their self-driving car
project, Waymo, and the overall market senti-
ment due to their global presence. Similarly,
GM and Tesla Inc. may experience ripple
effects within the automotive industry if the
alliance between Renault and Nissan faces
disruptions or changes, potentially impacting
investor sentiment and the overall industry.
Howmet Aerospace Inc. may be indirectly im-
pacted if they have any partnerships or busi-
ness agreements with Renault, Nissan, or Mit-
subishi Motors, as mentioned in the news arti-
cle. The extent of the impact would depend on
the nature and scale of those collaborations.
A garter and Garman are not directly associ-
ated with the automotive industry, so the news
about Carlos Ghosn's arrest and detention is
unlikely to have a significant impact on these
companies. It is important for these compa-
nies to monitor the situation and potential
ripple effects to determine any indirect impact
on their operations and financial performance.
However, without further information or de-
velopments, it is difficult to predict the exact
impact on these companies"
4. Summary aggregation: After generating in-
dividual summaries for each fact and entity,
the next step is to combine them to create a
comprehensive summary of the news article.
To achieve this, we also make use of LL mod-
els and chat prompts to generate a final brief
summary that covers all major points and ar-
guments presented in the article. We provide
a prompt that instructs the LL model to pro-
vide a concise summary that captures the most
important information from the article. The
summary should include key details such as
the main topic, the impact on every relevant
company, relevant facts and figures, and any
important conclusions or recommendations
presented in the text. We also ask the model to
list every company that has been impacted by
the news. By combining the individual sum-
maries and generating a final comprehensive
summary, we can provide a clear and concise
overview of the news article, including its im-
pact on relevant entities. This can be useful
for decision-making and analysis purposes in
various industries.
1.4 Likely Challenges and Mitigations
This task and methodology presented various chal-
lenges, such as obtaining outputs as expected from
the language models, utilizing appropriate prompts
for the outputs, finetuning models when necessary,
and identifying the top-K companies related to a
given fact. Should any of these challenges have
arisen, a systematic approach was adopted to re-
vise the plans. This involved a comprehensive re-
view of the relevant literature to identify alternative
methods and approaches. In case of unmitigated
challenges, the problem statement was considered
for revision to achieve feasibility with the existing
approaches. Such an adaptive approach ensured
the continued progress of the research while main-
taining high standards of scientific rigor.
2 Related Work
[1] introduces example-based summarization tech-
niques that circumvent the widely used query-
based techniques that allow for more subjective and
'better'/desired results (in terms of the prompter's
summarization goals). This improves drastically
over query-based techniques by 1) providing more
information to the system, 2) allowing the user
to define their subjective prompt, 3) preventing
the 'frustrating' process of iteratively improving
a query to get the desired summary. The summa-
rization step in our project aligns closely with this
example based summarization technique in order
to get a desirable summary of the aggregated facts
from a news article by appending examples to input
prompts.
[2] aims to tackle the challenges that appear in
long form summarization: processing very long
documents, nontrivial causal and temporal depen-
dencies, and rich discourse structures[2]. Many
widely used summarization techniques are used ei-
ther for short form writing or long form writing
in the form of scientific journals or patents: the
latter of which does not contain a large possibil-
ity for openly interpretational summaries. Book-
Sum tackles the long-form, creative-writing scene
by creating an aggregate of summaries of creative
works at a paragraph/chapters and full work level,
it fine tunes baseline models to generate summaries
at a paragraph level, ranks them using top-k, and
combines the highly ranked summaries. This ap-
proach will differ from our approach as our data is
based on financial news articles (short form text)
and SEC data (long form straightforward data), so
it would be better to rely on other summarization
methodologies from other sources.
[3] aims to show how 'chain of thought' prompt-
ing can help improve a large language model's abil-
ity to perform complex tasks. By introducing an
example QA pair, in which the answer contains an
explanation the process/rationale (chain in thought)
of solving the task, the LLM is able to imitate the
process for a subsequent question to a higher de-
gree of performance and accuracy than without the
chain in thought addition. The idea of chain of
thought prompting can be very helpful in our tasks
in which we prompt a model to decide whether
or not an event/entity has a positive or negative
affect on another entity. By using this prompting
technique, we can more easily see the effects that
entities will have on each other, especially when
looking at financial data.
[5] builds an idea known as 'self consistency',
which builds off the success of a chain of thought
prompting in order to replace the legacy decoding
methodology of 'greedy decoding'. Self consis-
tency is a self supervised approach of using multi-
ple reasoning paths to come to an aggregated con-
clusive answer, like a group of humans would. This
has shown to have a significant increase in com-
monsense reasoning/arithmetic benchmarks, to a
rate as high as 17.9 percent (GSM8K). This pro-
cess would be very useful again for prompting in
both the effect of an event/entity on another entity
(ex. 'chain-in-thought' QA pair appended to Q:
"Does chatGPT have a negative/positive affect on
Google") and 'summarization' tasks (the aggrega-
tion of facts from news sources) of our paper, as it
would combine the success of chain in thought with
the self-consistency route aggregation. Having mul-
tiple routes of thinking will be very helpful when
considering financial effects of events/entities.
[6] aims to tackle the problem of fact verification
in order to prevent misinformation by using a struc-
tured based approach of organizing text in tables
as opposed to that of commonly used unstructured
text. Each row on the table is structured with a
verified claim, annotated evidence from wikipedia,
and a label indicating whether or not the informa-
tion is enough to reach a verdict/what the verdict
is (support or refute the claim). Feverous' data
structure can be a good way to model the factual or
opinionated sentences from news text input. Also,
its dataset could be used to finetune a LLM for fact
extraction. One change we may have to make is to
rely on more than wikipedia as a source of infor-
mation, as it would be limited in terms of financial
data but would be good for general company/entity
descriptions.
[7] aims to label whether or not an article is a
news story (unbiased reporting) or an opinion ar-
ticle (persuasive reporting) in order to aid in fact
checking. To create the dataset, the paper describes
an approach of tagging sentences as either a 'claim'
or a 'premise', with more 'premises' indicating a
'news story' and more 'claims' indicating an 'opin-
ionated article'. After fine tuning various models
with the data (BERT, SVM, RNN), they found that,
during analysis, linguistic features that were high-
lighted in the dataset (negation, negation-suffix,
digits and interjection, etc) did not affect the re-
sults, so it is a path to avoid taking when thinking
of fact extraction. The paper also shows how we
can fine tune the model to indicate whether text
is opinionated or not, which can help in produc-
ing accurate results; however, the big difference
between our task and the paper's is that we will be
extracting factual and opinionated structures from
text at a sentence level, while this paper focuses on
an article level.
3 Experiments
3.1 Datasets
For our project, we have utilized a variety of news
articles from the Economist dataset spanning from
2017 to 2019, along with additional data for later
years through web scraping for news articles re-
lated to finance, business, world and economy. To
create event encodings for companies, individuals,
stocks, and commodities, we have obtained con-
textualized embeddings using data from Wikipedia.
Furthermore, we are utilizing 10K sec filing data
for creating company embeddings to incorporate
business, risk and other key information of stake-
holders.
3.2 Software
In the first step of extracting facts from a news
article, we employ a rule-based technique using
NLTK and Spacy libraries. These libraries assist
in tokenization, Part-of-Speech tagging, as well as
detecting negation and subjective markers. This
aids in the extraction of factual sentences from
the article. Subsequently, we utilize the Pyserini li-
brary for document retrieval and indexing. To incor-
porate dense vector representations (embeddings)
for each predefined entity, we employ Dense Pas-
sage Retrieval techniques using Pyserini. For fact-
summary creation, we utilize a chat-based model
of LLM, such as gpt-3.5-turbo, along with vari-
ous prompting techniques. The same approach is
employed for abstract summary creation as well.
3.3 Challenges
One potential challenge we faced was with LLMs
and creating good enough prompts to perform
question-focused summarization using facts, zero-
shot, and few-shot prompting. Prompting perfor-
mance was a crucial step for the success of the
project. Additionally, we lacked a standard metric
for evaluating the abstract summaries. We found
a lack of evaluation techniques that could deter-
mine the factual accuracy and usefulness of the
generated summaries. An appropriate evaluation
approach would involve comparing the generated
summaries against factual truth, making the pres-
ence of domain experts with relevant knowledge
crucial.
3.4 Contingency Plan
We aimed to attain zero-shot prompting for
question-based summarization of the impact of
news on different entities. If that did not work,
we planned to use few-shot learning and feed more
context to the prompt in order to generate better
results. We experimented with different models to
find the ones which gave the best possible response.
While our prompt was able to generate results for
the news impact on different companies, we aimed
to generate better prompting techniques to generate
better results and get more insights so that financial
analysts can use this software in real-time in the
future. In addition to that, we are devising plans to
discover more effective evaluation techniques. This
problem is highly open-ended and requires exten-
sive experimentation to identify ways of assessing
the quality of generated summaries. One approach
is to create control and experiment sets and invite
domain experts to evaluate the summaries based
on their insightfulness. We can also investigate
the impact of changing prompts on the evaluation
scores. Additionally, we intend to employ ranking-
based methods by treating human rankings as a
baseline for relevance and calculating NDCG or
Precision@n scores for the rankings generated by
the language models. Currently, we are conducting
this evaluation on a limited set of articles, but we
aim to explore its effectiveness on a larger scale as
well.
4 Results and Evaluation
4.2 Proposed Evaluation Method
4.1 Results
News article:
Some of the biggest names in tech are calling for
artificial intelligence labs to stop the training of the
most powerful AI systems for at least six months,
citing "profound risks to society and humanity."
Elon Musk was among the dozens of tech leaders,
professors and researchers who signed the letter,
which was published by the Future of Life Institute.
The wave of attention around ChatGPT late last
year helped renew an arms race among tech compa-
nies to develop and deploy similar AI tools in their
products. OpenAI, Microsoft and Google are at the
forefront of this trend, but IBM, Amazon, Baidu
and Tencent are working on similar technologies.
Companies impacted:
• Akamai Technologies, Inc.
• American International Group, Inc. (AIG)
• Bio-Rad Laboratories, Inc.
• Intuitive Surgical, Inc.
• Netflix, Inc.
• Tesla, Inc. (TESS-l or TEZ-l)
Factual Summary: The companies that may
be impacted include OpenAI, Microsoft, Google,
Leidos, AIG, Tesla, and Netflix. For example, if
AI tools have biased responses or spread misinfor-
mation, it could lead to increased insurance claims
for AIG. The news of calls to stop the training
of the most powerful AI systems for at least six
months could have some impact on Tesla, Inc. as
the company heavily relies on artificial intelligence
in the development of their electric vehicles and
related products. Netflix may need to reconsider
its current business model and future strategies if
AI tools are found to have biases or spread mis-
information. Intuitive Surgical, which develops
and markets robotic products designed to improve
clinical outcomes of patients through minimally
invasive surgery, might face questions about the
safety and reliability of the da Vinci Surgical Sys-
tem due to potential risks and concerns associated
with AI technologies. Bio-Rad Laboratories, which
uses advanced technology in its products, may not
be directly impacted as it is not involved in the
development and deployment of AI tools.
Since we only had unlabelled data at our disposal,
we lacked ground truth summaries for comparison
purposes. The generated summaries needed to be
evaluated on their factual accuracy regarding the
impact of the news on relevant entities. Unfortu-
nately, there was no predefined evaluation metric
available for this specific criterion. We attempted
to examine the stock movements over a certain pe-
riod after the news was released, but this approach
proved unreliable due to the multitude of factors
influencing stock prices. Therefore, we opted for
a contextual approach to assess the quality of the
summaries, focusing on their conciseness, factual-
ness, and usefulness for financial analysts in mak-
ing decisions and conducting analysis.
The proposed evaluation method entails the use
of ChatGPT, a language model, to evaluate the
performance of summary generation. The method
involves feeding the final summary along with a
prompt, which outlines the metrics used to assess
model performance, to ChatGPT. As there are no
labeled data to evaluate summary coherence, the
method is inspired by ChatEval, a tool that uses
a human-level intervention to evaluate summary
coherence. ChatGPT simulates this intervention,
generating scores for coherence based on the align-
ment of the summary with the given information.
To determine the final scores for model perfor-
mance, the process involves using multiple inputs
and outputs, computing an average score for each
metric of interest. Currently, the metrics being
used for this evaluation are accuracy, conciseness,
fluency, and engagement, with the possibility of
more metrics being experimented on based on the
outcomes of these.
To provide ChatGPT with the input required
for generating summary coherence scores, two ap-
proaches are used: few-shot learning and the in-
structive method using prompts. The model is be-
ing evaluated using both approaches.
For the evaluation process, a single summary
will be provided for a news article, and the task will
be to rate the summary on the coherence metric,
with a score range of 1 to 5. Coherence refers
to the quality of all sentences collectively and is
aligned with the DUC quality question of structure
and coherence. A high-quality summary should be
well-structured, well-organized, and build logically
from sentence to sentence to provide a coherent
body of information about a topic.
The evaluation process involves three steps.
Firstly, the news article is carefully read to identify
the main topic and key points. Secondly, the sum-
mary is compared to the news article to determine
if it covers the main topic and key points and if it
presents them in a clear and logical order. Lastly, a
score for coherence is assigned based on the Eval-
uation Criteria, using a scale of 1 to 5, where 1
represents the lowest score, and 5 represents the
highest.
Table 1: G-Eval Evaluation
Example Prompt:
You will be given one summary written for a news
article. Your task is to rate the summary on one
metric. Please make sure you read and understand
these instructions carefully. Please keep this
document open while reviewing, and refer to it as
needed.
Evaluation Criteria:
• Coherence (1-5) - the collective quality of all
sentences. We align this dimension with the
DUC quality question of structure and
coherence whereby "the summary should be
well-structured and well-organized. The
summary should not just be a heap of related
information, but should build from sentence
to sentence to a coherent body of information
about a topic."
Evaluation Steps:
• Read the news article carefully and identify
the main topic and key points.
• Read the summary and compare it to the
news article. Check if the summary covers
the main topic and key points of the news
article and if it presents them in a clear and
logical order.
• Assign a score for coherence on a scale of 1
to 5, where 1 is the lowest and 5 is the highest
based on the Evaluation Criteria.
Few Shot Prompt
Input:
The quick brown fox jumps over the lazy dog.
Output:
The fox jumps over the dog.
Evaluation:
Accuracy: 100% Conciseness: 100% Fluency:
100% Engagement: 100%
Input:
The quick brown fox jumps over the lazy dog.
The dog barks at the fox. The fox runs away.
Output:
The fox jumps over the dog, which barks at it.
The fox runs away.
Evaluation:
Accuracy: 100% Conciseness: 80% Fluency:
100% Engagement: 100%
Input:
The quick brown fox jumps over the lazy dog.
The dog barks at the fox. The fox runs away. The
dog chases the fox. The fox hides in a hole. The
dog looks for the fox, but cannot find it. The dog
gives up and goes home.
Output:
The fox jumps over the dog, which barks at it.
The fox runs away, but the dog chases it. The fox
hides in a hole, and the dog looks for it, but cannot
find it. The dog gives up and goes home.
Evaluation: Accuracy: 100%
Conciseness: 70%
Fluency: 100%
Engagement: 100%
Input:
The news about the battle between the world's
biggest economies over semiconductor resources
could potentially impact Microchip Technology
Inc. (......................................................) restric-
tions imposed by these economies could impact
their accessibility and affordability, ultimately af-
fecting A semiconductor's revenue and profits.
Output:
To manage the impact of the conflict, such as di-
versifying its supply chain or investing in research
and development to produce more innovative prod-
ucts (.......................................................) hospital-
ity brands such as Marriott and Hilton, retailers like
Macy's and J.C. Penney, and manufacturers such
as Ford and General Motors.
Evaluation:
Generated response:
Accuracy: 90%
Conciseness: 60%
Fluency: 90%
Engagement: 80%
While the output captures the main points from
the input text and provides some valuable insights
and recommendations, it also includes some irrel-
evant information about the COVID-19 pandemic
and companies unrelated to the semiconductor in-
dustry. The text is also less concise and engaging,
with longer and more complex sentences. However,
it maintains good fluency, with a clear and coherent
writing style.
Human Evaluations
We evaluated 20 articles using human evaluation
and were asked to give a rating of 0-5 for the useful-
ness of the article aspect from the financial analyst
perspective. The results we have received are de-
cent and all of the article's summaries came out
to be relevant with all of the articles being scored
above 3. In addition to evaluating the summaries
using ChatGPT, we also employed a ranking-based
evaluation approach to assess Chat-eval's reliabil-
ity. Since we needed to verify the accuracy of
the results generated by ChatGPT, we devised a
method involving rankings provided by a Com-
puter Science PhD student for a small set of 5-10
articles. These rankings were based on the per-
ceived usefulness of the summaries. This served
as our baseline for comparison. We then obtained
rankings from ChatGPT for the same articles and
calculated NDCG and Precision@n scores to com-
pare the two rankings. However, due to the limited
number of articles used in this evaluation and the
need for further scalability, we acknowledge that
more extensive testing is necessary to validate the
approach. This is an aspect we plan to explore in
future research.
Table 2: Human evaluation vs G-Eval
5 Future Steps
results. To address this, we will explore sequen-
tial prompting techniques using Langchain to avoid
repetition. Our plan involves expanding the en-
tities included in our document store. Currently,
we only have S&P 500 companies, but we intend
to incorporate commodities such as gold and oil.
Additionally, we aim to enhance the process of
creating embeddings for these entities by utilizing
their SEC filing data instead of relying solely on
Wikipedia data. This shift is expected to provide
more relevant information about the company and
cover a broader range of aspects, ultimately improv-
ing the fact-entity mapping process and influencing
subsequent steps in a positive manner. Our next
step entails running the pipeline on a larger dataset
to generate more robust evaluations. Furthermore,
we will dedicate more effort to researching and
identifying better evaluation techniques, with a par-
ticular focus on incorporating human evaluation
methods. This approach will help in producing
more insightful results.
References
[1] Yadav, Nishant, Matteo Brucato, Anna Far-
iha, Oscar Youngquist, Julian Killingback, Alexan-
dra Meliou, and Peter Haas.
"SUBSUME: A
Dataset for Subjective Summary Extraction from
Wikipedia Documents." In New Frontiers in Sum-
marization workshop (at EMNLP 2021). 2021.
[2] Kry ́sci ́nski, Wojciech, Nazneen Rajani, Di-
vyansh Agarwal, Caiming Xiong, and Dragomir
Radev. "Booksum: A collection of datasets for
long-form narrative summarization." arXiv preprint
arXiv:2105.08209 (2021).
[3] Wei, Jason, Xuezhi Wang, Dale Schuurmans,
Maarten Bosma, Ed Chi, Quoc Le, and Denny
Zhou. "Chain of thought prompting elicits rea-
soning in large language models." arXiv preprint
arXiv:2201.11903 (2022).
[4] Diao, Shizhe, Pengcheng Wang, Yong Lin,
and Tong Zhang. "Active Prompting with Chain-
of-Thought for Large Language Models." arXiv
preprint arXiv:2302.12246 (2023).
[5] Wang, Xuezhi, Jason Wei, Dale Schu-
urmans, Quoc Le, Ed Chi, and Denny Zhou.
"Self-consistency improves chain of thought rea-
soning in language models." arXiv preprint
arXiv:2203.11171 (2022).
We aim to experiment with improved prompting
techniques to produce more concise and precise
[6] Aly, Rami, Zhijiang Guo, Michael
Schlichtkrull, James Thorne, Andreas Vlachos,
Christos Christodoulopoulos, Oana Cocarascu, and
Arpit Mittal. "Feverous: Fact extraction and veri-
fication over unstructured and structured informa-
tion." arXiv preprint arXiv:2106.05707 (2021).
[7] Alhindi, Tariq, Smaranda Muresan, and
Daniel Preot ̧iuc-Pietro. "fact vs. opinion: The role
of argumentation features in news classification."
In Proceedings of the 28th international conference
on computational linguistics, pp. 6139-6149. 2020.
Appendix
Experiments and Outputs
News article: WASHINGTON, DC AND
MOSCOW P ATRIOT PARK in Kubinka, 60km
south-west of Moscow, is a military Disneyland.
Families can picnic among rows of Soviet-era
aircraft. Children can frolic over tanks. Those
doing so on January 23rd might have noticed a
long green tube, studded with ridges and dials,
roped off and watched by stern guards. This was
not an exhibit. It was, supposedly, the canister for
the 9M729 missile. Its launcher, an imposing truck,
stood nearby, as Lieutenant- General Mikhail
Matveyevsky, Russia's missile chief, pointed to
a diagram of the missile's innards. "All tests of
surface-to-surface missiles," he declared, "were
conducted to a range that is less than the INF
[Intermediate- Range Nuclear Forces] treaty limit."
The show-and-tell did not impress America, whose
diplomats had turned down an invitation to the
theme park. On February 1st America declared
itwould pull out of the INF treaty. It is exasperated
not only with ten years of Russian cheating but
also with the rapid growth in China's unshackled
arsenal of over 2,000 missiles, 95% of which are
of the range forbidden to America. "If Russia's
doing it and if China's doing it, and we're adhering
to the agreement," complained Donald Trump in
October, "that's unacceptable". The pact will die
once America's six months' notice expires in the
summer. "The likelihood of compromise is zero,"
says Adam Thomson, Britain's envoy to NATO
until 2016. That brings over 30 years of arms
control to a close. The INF treaty was forged in
1987 to defuse a missile race between America and
the Soviet Union. Intermediate-range nukes were
appealing because they could hit key targets while
remaining a safe distance away from the front
line, without resorting to intercontinental ballistic
missiles ( ICBM s). Appealing, but dangerous:
ICBM s took 30 minutes to reach their targets;
mid-range missiles got there in under ten. "It was
like holding a gun to our head," remarked Mikhail
Gorbachev. He and Ronald Reagan agreed to scrap
all such land- based missiles, conventional and
nuclear. By the 2000s the treaty began to chafe
Russia. Its decrepit armed forces could not afford
modern warships, submarines and warplanes to
carry plentiful missiles, whose utility America
had demonstrated with bombing campaigns in the
Middle East and the Balkans. To Russia's south
and east, countries like Israel, Iran, China and
Pakistan were accumulating land-based missiles.
In 2005 Russia's defence minister proposed that
the treaty should be junked. Not long after came
Russia's first test of the 9M729 . Since 2016
four battalions, roughly 100 missiles, have been
deployed to two bases east of the Ural mountains
and near the Caspian sea. "The 9M729 is core to
Russian military thinking in terms of what they
need to fight a regional war," says Pranay Vaddi,
who worked on the issue for the State Department
until October. American officials may decry
the cheating. But they surely sympathise with
In recent years Pentagon officials
the impulse.
have fretted over a widening missile gap in the
Pacific.
"China has a massive advantage over
us," says a former American army official. "It
cannot be overstated how important it is that we
can field precision-guided missiles, unlimited by
range."The INF treaty does not prohibit putting
intermediate-range missiles on ships, submarines
and aircraft. But these are expensive (a modern
destroyer costs $1.8bn), demand manpower and
have other things to do. Hence the appeal of
"A mobile TEL requires
land-based missiles.
a couple of drivers and operators," says the
former official, referring to the transporter-erector-
is
launcher trucks used to fire missiles.
virtually impossible for the enemy to find." In a
review of American nuclear posture last year, the
Trump administration said it would respond to
Russia's violation of the INF treaty by building a
nuclear-tipped sea-launched cruise missile (which
would be INF -compliant) and reviewing "concepts
and options" for a conventional land-based one
(which would not be). But a deployable weapon is
some way off. The US Army is already working
on a Precision Strike Missile ( P r SM ) due in
2023. Its range could easily be extended beyond
the current INF ceiling of 499km. But even twice
that would not get from Warsaw to Moscow.
A longer-legged option would be to tweak the
sea-based Tomahawk to fire from land; that is what
America did during the INF crisis in the 1980s
to produce the 2,500km-range Gryphon. Let's
do launch But Pacific geography is forbidding.
Guam, the likeliest host for American missiles
in Asia if Japan demurs, is over 3,000km away
from Shanghai. An entirely new missile would be
required. Hypersonic boost-glide missiles, which
"It
skip off the atmosphere at great speed, might fit
the bill. But ground- launched ones are years
away. Democrats, who took control of the House
in January, have taken a dim view of the swelling
defence budget. They may query why the Pentagon
cannot make do with air- and sea-launched systems
already in the pipeline. Nor is it obvious where
new missiles would be put in Europe. Though
NATO strongly backed America on February 1st,
declaring that "Russia will bear sole responsibility
for the end of the treaty," its members will be less
keen on welcoming missiles, even non-nuclear
ones. A few allies, like Poland, which is trying
to seduce Mr Trump into setting upa new tank
base, would probably embrace American arms
on their soil. But a deal with Poland struck over
NATO 's head would compound anxiety over
America's commitment to the alliance. It might
also be seen as destabilising. "Missiles deployed
on the territory of newer NATO members could
reach Russia's main command points in less than
five minutes," notes Pavel Zolotarev of the Russian
Academy of Sciences. That, he warns, would allow
the "destruction of its critical infrastructure without
the use of nuclear warheads." In a crisis, a jittery
Russia would not necessarily make wise choices.
Another option for NATO would be to rejig the
American-led missile-defence shield in Poland and
Romania so that it could cope with Russian cruise
missiles like the 9M729 , rather than just Iranian
and North Korean ballistic ones. Yet that might
provoke an even bigger fight in NATO . The death
of the INF treaty marks "the end of the post-cold
war era," says Bruno Tertrais of the Foundation for
Strategic Research, a French think-tank. What is
clear is that the Trump administration has pulled
the plug without a clear sense of how to navigate
the era to come. This article was downloaded by
calibre from https://www.economist.com/united-
states/2019/02/09/america-calls-time-on-the-
inf-treaty-ushering-in-a-new-age-of- missiles
-**************************************
.
Facts: Patriot Park in Kubinka, Russia is a
military-themed park with Soviet-era aircraft and
tanks. Lieutenant-General Mikhail Matveyevsky,
Russia's missile chief, displayed a diagram of the
9M729 missile's innards at Patriot Park. America
declared on February 1st that it would pull out of
the INF treaty. The INF treaty was created in 1987
to defuse a missile race between America and the
Soviet Union. The treaty prohibited intermediate-
range nukes, which could hit key targets while re-
maining a safe distance away from the front line.
Russia began to chafe under the treaty in the 2000s,
as it could not afford modern warships, submarines,
and warplanes to carry plentiful missiles. Since
2016, Russia has deployed roughly 100 9M729
missiles to two bases east of the Ural mountains
and near the Caspian sea. America is exasperated
with ten years of Russian cheating and the rapid
growth in China's unshackled arsenal of over 2,000
missiles, 95The Trump administration plans to re-
spond to Russia's violation of the INF treaty by
building a nuclear-tipped sea-launched cruise mis-
sile and reviewing "concepts and options" for a
conventional land-based one.. Democrats, who
took control of the House in January, may query
why the Pentagon cannot make do with air- and sea-
launched systems already in the pipeline. . NATO
strongly backed America on February 1st, declar-
ing that "Russia will bear sole responsibility for the
end of the treaty.". Pavel Zolotarev of the Russian
Academy of Sciences warns that missiles deployed
on the territory of newer NATO members could
reach Russia's main command points in less than
five minutes, allowing the "destruction of its critical
infrastructure without the use of nuclear warheads."
. The death of the INF treaty marks "the end of the
post-cold war era," according to Bruno Tertrais of
the Foundation for Strategic Research.
Companies impacted:
['Intercontinental Ex-
change, Inc. (ICE) ', 'F5, Inc. ', 'American In-
ternational Group, Inc. (AIG) ', 'Leidos, formerly
known as Science Applications International Cor-
poration (SAIC), ', 'Trimble Inc. ', 'Vulcan Mate-
rials Company (NYSE: VMC) ', 'The Interpublic
(IPG) ', 'The Lock-
Group of Companies, Inc.
heed Martin Corporation ', 'IQVIA, formerly Quin-
tiles and IMS Health, Inc., ', 'Howmet Aerospace
Inc. (formerly Arconic Inc.) ', 'American Airlines
Group Inc. ', 'The Union Pacific Corporation ',
'L3Harr', 'Align Technology ', 'Gen Digital Inc.
(formerly Symantec Corporation and NortonLife-
Lock) ', 'Raytheon Technologies Corporation ',
'Halliburton Company ', 'Broadcom Inc. ', 'In-
vesco Ltd. ', 'Northrop Grumman Corporation '].
-
Overall summary: The news of America with-
drawing from the INF treaty and the subsequent
increase in arms race may have a positive impact
on Northrop Grumman Corporation. As a major
defense technology provider, the increased demand
for advanced missile systems and defense equip-
ment could lead to an increase in revenue and
growth opportunities for the company. However,
the potential negative impact of political tensions
and instability in the global arms race should also
be considered. The news about the end of the INF
treaty, which prohibited land-based intermediate-
range missiles, could potentially impact Howmet
Aerospace Inc. due to its manufacturing of com-
ponents for jet engines and titanium structures for
aerospace applications. The increase in missile pro-
duction and development could lead to a potential
increase in defense spending and a rise in demand
for Howmet's products. The US decision to pull out
of the INF treaty could potentially have a positive
impact on The Lockheed Martin Corporation. As
one of the largest defense contractors in the world,
it may receive further contracts and revenue from
the US government to build and develop land-based
missiles to compete with Russia and China's grow-
ing missile arsenal. The article discusses the end of
the INF treaty and the potential for a new arms race,
particularly in the development and deployment of
intermediate-range missiles. As Leidos provides
technical services to the United States Department
of Defense and other government agencies, partic-
ularly in the fields of defense and aviation, it may
benefit from increased demand for its expertise and
services as the US seeks to modernize and expand
its missile capabilities. However, there may also
be increased competition and pressure on Leidos
to provide cutting-edge solutions in this area. The
news about America's withdrawal from the INF
treaty and the possibility of an arms race may im-
pact the construction industry as a whole, but it
is unlikely to have a significant direct impact on
Vulcan Materials Company (NYSE: VMC) as they
primarily produce and distribute construction mate-
rials. However, the potential escalation of tensions
may impact the construction industry's demand for
their products, depending on how the situation de-
velops. The news about the US pulling out of the
INF treaty and the potential for a new arms race be-
tween America, Russia, and China is not expected
to have a significant impact on American Interna-
tional Group, Inc. (AIG), as the company operates
primarily in the insurance and financial sectors.
However, any geopolitical instability or conflict re-
sulting from this situation could affect the global
markets and potentially impact AIG's investments
and operations. The news about the INF treaty and
Russia's missile program is unlikely to have a di-
rect impact on Align Technology. The company
does not manufacture any military equipment or
have any significant operations in Russia. However,
the broader geopolitical implications of this news
could impact the global economy and potentially
affect the demand for Align's products in certain
regions. The news article does not have a direct
impact on The Union Pacific Corporation since it is
a railroad holding company. However, it may indi-
rectly impact the transportation industry as tensions
rise between the United States and Russia, and po-
tentially China. Any increase in military spend-
ing or conflict may divert resources away from
infrastructure and transportation projects, affecting
Union Pacific's business. The news about America
pulling out of the INF treaty, which led to discus-
sions about the missile race and the development
of new weapons, is unlikely to have a significant
impact on Invesco Ltd, an investment management
company based in the US. The US government's
decision to pull out of the INF treaty, which could
lead to a new arms race, may result in increased
demand for Raytheon's missile defense systems, as
well as opportunities for the company's missile divi-
sion to develop and supply new land-based missiles.
However, there may also be increasing competition
from other defense manufacturers in the industry.
The news about America pulling out of the INF
treaty and the potential increase in missile race
could lead to increased demand for semiconduc-
tor and infrastructure software products produced
by Broadcom Inc. as countries like America and
China may escalate their military capabilities in
this area. The news article about America pulling
out of the INF treaty and the potential growth in
missile technology could indirectly impact Trim-
ble Inc, as they are involved in the development
of satellite navigation systems and other hardware
technologies that could be used in defense and mili-
tary applications. The potential increase in demand
for precision-guided missiles could lead to an in-
crease in demand for Trimble's technology. The
news article does not directly relate to Gen Digital
Inc. or the cybersecurity industry, so it is unlikely
to have a significant impact on the company's stock
or operations. However, any potential global in-
stability resulting from the end of the INF treaty
and the escalation of military tension between the
US and Russia could potentially affect the overall
market and investor sentiment, including towards
Gen Digital Inc. The news about America pulling
out of the INF treaty and the potential for a mis-
sile race could have a positive impact on L3Harr,
as the company specializes in defense and surveil-
lance solutions. The company may see increased
demand for their products and services due to the
growing concern over missile capabilities of the
US and its rivals. The news article about Amer-
ica's withdrawal from the INF treaty and the po-
tential development of new missiles could have an
indirect impact on Halliburton Company, as it is a
major player in the energy services sector, which
includes the production and transportation of oil
and gas. Any increased tensions or conflicts re-
sulting from the development and deployment of
new missiles could potentially disrupt the industry,
leading to changes in demand for Halliburton's ser-
vices and products. The news about the potential
global arms race and increasing military tension
between the US, Russia, and China is unlikely to
have a direct impact on F5, Inc. as a technology
company. However, if the situation escalates into a
full-blown conflict, it could have a negative impact
on the overall global economy, which in turn may
lead to a decrease in demand for F5's products and
services. The news about the US pulling out of
the INF treaty and the potential for a new missile
race could potentially impact American Airlines
Group Inc. due to the increased geopolitical ten-
sions and potential for military action, leading to
a decrease in air travel demand and revenue for
the company. The news about the US pulling out
of the INF treaty and the potential rise of missile
development could potentially lead to an increase
in military spending and a shift in focus for the
US government. However, it is unlikely to have a
direct impact on The Interpublic Group of Compa-
nies, Inc. (IPG), which operates in the advertising
industry. The news article about America pulling
out of the INF treaty and the potential missile race
to come would not have a direct impact on Inter-
continental Exchange, Inc. (ICE), which mainly
operates global financial exchanges and clearing
houses. However, it may indirectly impact the
financial markets and commodities that ICE ex-
changes deal with due to the geopolitical tensions
that may arise from such developments. Based on
the news article, it is unlikely that the INF treaty
withdrawal will directly impact IQVIA. IQVIA pri-
marily operates within the biopharmaceutical in-
dustry and is not directly involved in military or
defense matters. However, any potential escalation
of tensions between the US and Russia or China
could lead to broader economic and geopolitical im-
pacts that may indirectly affect IQVIA's business..
-************************************
Final abstract instruction based 1:
The US withdrawal from the INF treaty and the
potential for an arms race may have a positive
impact on defense technology providers such as
Northrop Grumman and Lockheed Martin, as well
as Howmet Aerospace due to increased demand for
missile systems and defense equipment. Leidos,
which provides technical services to the US Depart-
ment of Defense, may also benefit from increased
demand for its expertise. The news is unlikely to
have a significant direct impact on Vulcan Materials
Company and American International Group, but
any geopolitical instability resulting from the sit-
uation could affect global markets and potentially
impact AIG's investments and operations. Align
Technology is not expected to be directly impacted
by the news.
The news of America pulling out of the INF
treaty could impact the global economy and po-
tentially affect the demand for Align's products in
certain regions. The transportation industry, includ-
ing Union Pacific Corporation, may be indirectly
impacted as tensions rise between the US and Rus-
sia. Raytheon's missile defense systems may see
increased demand due to the potential increase in
the missile race, while Broadcom Inc. and Trimble
Inc. may also see increased demand for their prod-
ucts. Gen Digital Inc. may not be directly impacted,
but any potential global instability resulting from
the end of the INF treaty could affect the overall
market and investor sentiment. L3Harr, specializ-
ing in defense and surveillance solutions, may see
increased demand for their products and services.
Halliburton Company, a major player in the energy
services sector, may also be indirectly impacted by
any increased tensions or conflicts resulting from
the development.
The potential global arms race and increasing
military tension between the US, Russia, and China
could impact Halliburton's services and products.
F5, Inc. may be indirectly impacted if the situation
escalates into a full-blown conflict, leading to a
decrease in demand for its products and services.
American Airlines Group Inc. may be impacted
due to the increased geopolitical tensions and po-
tential for military action, leading to a decrease
in air travel demand and revenue. The Interpublic
Group of Companies, Inc. (IPG) and Interconti-
(ICE) are unlikely to be
nental Exchange, Inc.
directly impacted, but may be indirectly impacted
by the geopolitical tensions that may arise from
such developments. IQVIA is not directly involved
in military or defense matters, but any potential es-
calation of tensions between the US and Russia or
China could lead to broader economic and geopolit-
ical impacts that may indirectly affect its business..
-*************************************
Final abstract instruction and one shot 2:
The news of America withdrawing from the
INF treaty and the potential increase in the arms
race may have a positive impact on defense con-
tractors such as Northrop Grumman Corporation,
The Lockheed Martin Corporation, and Leidos.
Howmet Aerospace Inc. may also benefit from
increased demand for its products due to the poten-
tial increase in missile production and development.
The news is unlikely to have a significant impact
on Vulcan Materials Company and American In-
ternational Group, Inc. However, any geopolitical
instability resulting from this situation could affect
the global markets and potentially impact AIG's in-
vestments and operations. The news is not expected
to have a direct impact on Align Technology.
The news of America pulling out of the INF
treaty and the potential for a missile race could
have a positive impact on defense contractors, such
as Raytheon and L3Harris, as well as companies
involved in semiconductor and infrastructure soft-
ware products, such as Broadcom. Trimble, which
develops satellite navigation systems, may also see
increased demand for their technology. The news
may indirectly impact transportation companies,
such as Union Pacific, and energy services compa-
nies, such as Halliburton, due to potential resource
diversion and global instability. The news is un-
likely to have a significant impact on Invesco or
Gen Digital.
The potential global arms race and increasing
military tension between the US, Russia, and China
could impact defense contractors such as Hallibur-
ton, but is unlikely to have a direct impact on
technology companies like F5, Inc. However, if
the situation escalates into a full-blown conflict, it
could negatively impact the overall global econ-
omy, leading to a decrease in demand for F5's
products and services. The news about the US
pulling out of the INF treaty and the potential
for a new missile race could potentially impact
American Airlines Group Inc. due to the increased
geopolitical tensions and potential for military ac-
tion, leading to a decrease in air travel demand
and revenue for the company. The news may indi-
rectly impact the financial markets and commodi-
(ICE)
ties that Intercontinental Exchange, Inc.
exchanges deal with due to the geopolitical ten-
sions that may arise from such developments. The
INF treaty withdrawal is unlikely to directly im-
pact IQVIA, but any potential escalation of ten-
sions between the US and Russia or China could
lead to broader economic and geopolitical impacts
that may indirectly affect IQVIA's business..
-
***************************************
Instruction based abstract eval scores 1:
Factfulness: 5
Conciseness: 3
Usefulness: 4
The summary provides relevant and accurate in-
formation on the impact of America's withdrawal
It specifically highlights
from the INF treaty.
companies that could benefit from increased de-
mand for defense-related products and services,
such as Northrop Grumman, Lockheed Martin,
and Leidos. However, the summary also notes
that the situation may indirectly impact other
companies in the global market due to potential
geopolitical instability. The summary could be
more concise in its discussion of how the news
may impact other companies, but overall it pro-
vides helpful information to a financial analyst..
-*************************************
Instruction based abstract eval scores 2:
News 1:
Factfulness: 5 The summary provides accurate
and relevant information about the impact of the
news article on the listed companies. The writer
discusses specific ways in which the INF treaty
withdrawal may impact various companies.
Conciseness: 4 The summary provides essential
information in a concise manner, but some state-
ments could be more straightforward and less repet-
itive.
Usefulness: 4 The summary provides useful data
to a financial analyst to analyze the market and
identify potential impacts on specific companies.
However, the potential impact on other industries
or markets is not discussed, which limits the overall
usefulness of the summary.
Overall, the summary accurately and concisely
be improved for clarity and to better connect to the
main topic.
Accuracy: 3 The summary mentions some po-
tential impacts on defense contractors, such as
Northrop Grumman Corporation and The Lock-
heed Martin Corporation, but does not provide a
clear explanation of why they would be affected.
The potential impact on transportation companies
and energy services companies, as well as the in-
direct impact on financial markets and commodi-
ties, is mentioned, but not fully explained. The
summary does not address the specific companies
listed in the prompt or provide a clear explanation
of how the news article may impact them. Over-
all, the summary includes some important points
about potential economic impacts of the INF treaty
withdrawal, but could benefit from more specific
examples and explanations..
summarizes the impact of the news article on the
listed companies, but could provide more compre-
hensive analysis of potential impacts on other in-
dustries or markets.
News 2:
Factfulness: 5 The summary provides accurate
and relevant information about the potential im-
pact of the news article on the listed companies.
The writer discusses specific ways in which the in-
creased global arms race may impact various com-
panies.
Conciseness: 4 The summary provides essential
information in a concise manner, but some state-
ments could be more straightforward and less repet-
itive.
Usefulness: 4 The summary provides useful data
to a financial analyst to analyze the market and
identify potential impacts on specific companies.
However, the potential impact on other industries
or markets is not discussed, which limits the overall
usefulness of the summary.
Overall,
the summary accurately and con-
cisely summarizes the potential impact of the
news article on the listed companies, but could
provide more comprehensive analysis of poten-
tial impacts on other industries or markets..
-
**************************************
Instruction and one shot based abstract eval desc
1:
Coherence: 5 - The summary is well-structured
and each sentence logically follows the previous
one, providing a clear flow of information.
Accuracy: 4 - The summary accurately ex-
plains how the US withdrawal from the INF treaty
could impact defense technology providers such
as Northrop Grumman and Lockheed Martin, al-
though the impact on other companies listed is
more uncertain and indirect. The summary also
correctly identifies the potential for geopolitical
instability and its impact on global markets, and
the potential demand for Raytheon's missile de-
fence systems. However, the summary's assess-
ment of the impact on other companies, such as F5,
Inc. and American Airlines Group Inc., is more
speculative and may not necessarily come true..
-************************************
Instruction and one shot based abstract eval desc
2:
Coherence: 4 The summary is mostly well-
structured and organized, with clear transitions be-
tween sentences. However, some sentences could
|
|
http://arxiv.org/abs/2310.04878v1 | "2023-10-07T17:24:41" | "2023-10-07T17:24:41" | Hybrid Recommendation System using Graph Neural Network and BERT
Embeddings | Recommender systems have emerged as a crucial component of the modern web
ecosystem. The effectiveness and accuracy of such systems are critical for
providing users with personalized recommendations that meet their specific
interests and needs. In this paper, we introduce a novel model that utilizes a
Graph Neural Network (GNN) in conjunction with sentence transformer embeddings
to predict anime recommendations for different users. Our model employs the
task of link prediction to create a recommendation system that considers both
the features of anime and user interactions with different anime. The
hybridization of the GNN and transformer embeddings enables us to capture both
inter-level and intra-level features of anime data.Our model not only
recommends anime to users but also predicts the rating a specific user would
give to an anime. We utilize the GraphSAGE network for model building and
weighted root mean square error (RMSE) to evaluate the performance of the
model. Our approach has the potential to significantly enhance the accuracy and
effectiveness of anime recommendation systems and can be extended to other
domains that require personalized recommendations. | [
"Shashidhar Reddy Javaji",
"Krutika Sarode"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04878v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04878v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.IR",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.IR",
"cs.AI",
"cs.LG"
] | Hybrid Recommendation System using Graph Neural
Network and BERT Embeddings
Shashidhar Reddy Javaji
Krutika Sarode
University of Massachusetts Amherst University of Massachusetts Amherst
Amherst, MA
sjavaji@umass.edu
Amherst, MA
ksarode@umass.edu
Abstract
Recommender systems have emerged as a crucial component of the modern web
ecosystem. The effectiveness and accuracy of such systems are critical for pro-
viding users with personalized recommendations that meet their specific interests
and needs. In this paper, we introduce a novel model that utilizes a Graph Neural
Network (GNN) in conjunction with sentence transformer embeddings to predict
anime recommendations for different users. Our model employs the task of link
prediction to create a recommendation system that considers both the features of
anime and user interactions with different anime. The hybridization of the GNN
and transformer embeddings enables us to capture both inter-level and intra-level
features of anime data.Our model not only recommends anime to users but also
predicts the rating a specific user would give to an anime. We utilize the Graph-
SAGE network for model building and weighted root mean square error (RMSE)
to evaluate the performance of the model. Our approach has the potential to signifi-
cantly enhance the accuracy and effectiveness of anime recommendation systems
and can be extended to other domains that require personalized recommendations.
1
Introduction
Recommendation systems are algorithms that suggest items to users based on their past behavior.
They are used in a variety of applications, such as online shopping, music streaming, and social media.
There are two main types of recommendation systems: collaborative filtering and content-based
filtering. Collaborative filtering systems recommend items to users based on the ratings or preferences
of other users. For example, if you have rated a number of movies on Netflix, the collaborative
filtering system will recommend other movies that other users with similar ratings have also enjoyed.
Content-based filtering systems recommend items to users based on the content of the items them-
selves. For example, if you have listened to a number of songs by a particular artist, the content-based
filtering system will recommend other songs by the same artist. In recent years, there has been a trend
towards using hybrid recommendation systems that combine the strengths of collaborative filtering
and content-based filtering. These systems can provide more accurate recommendations than either
type of system on its own.
There are a number of different ways to build recommendation systems. One common approach is to
use machine learning algorithms. Machine learning algorithms can be trained on large datasets of
user ratings or preferences to learn how to predict which items a user will like. Another approach
to building recommendation systems is to use artificial intelligence (AI) techniques. AI techniques,
such as deep learning, can be used to create more complex and powerful recommendation systems.
Recommendation systems have become an integral part of our daily lives, aiding us in making
informed decisions about the products and services we use. The success of these systems can be
attributed to their ability to filter and personalize vast amounts of information, making it easier for
Submitted to 37th Conference on Neural Information Processing Systems (NeurIPS 2023). Do not distribute.
users to find relevant and useful items. However, the increasing complexity and heterogeneity of data
have made it challenging to develop accurate and efficient recommendation systems.
In recent years, graph neural networks (GNNs) have emerged as a promising solution to this problem,
allowing us to incorporate relational data into our recommendation models. GNNs can effectively
capture the inherent structure and dependencies in the data, enabling us to make more accurate
and personalized recommendations. Graph Neural Networks (GNNs) have emerged as a powerful
approach to solving problems in the domain of recommendation systems. Recommendation systems
aim to recommend items to users that are relevant and useful to them, based on their past behavior
and preferences. GNNs can help in creating better recommendations by modeling the complex
relationships between users and items in a graph-based representation. One of the key challenges in
recommendation systems is the sparsity of the data. In many cases, users may have only interacted
with a small subset of items, and the available data may not be sufficient to learn accurate models.
GNNs can help address this challenge by leveraging the graph structure of the data to propagate
information from observed to unobserved nodes.
GNNs can be used in both content-based and collaborative filtering approaches to the recommendation.
In a content-based approach, GNNs can be used to model the features of the items and users and
create recommendations based on the similarity between their embeddings. In a collaborative filtering
approach, GNNs can be used to model the interactions between users and items in a graph, and create
recommendations based on the relationships between the nodes.
One of the popular approaches for GNN-based recommendation is GraphSAGE. GraphSAGE is a
variant of GNN that aggregates information from neighboring nodes to generate node embeddings.
In GraphSAGE, each node is assigned an initial feature vector, and these features are updated
iteratively by aggregating information from the node's neighbors. The aggregated features are
then passed through a neural network layer to generate a new embedding for the node. In the
context of recommendation, GraphSAGE can be used to generate embeddings for both users and
items. The model can be trained to predict the likelihood of a user interacting with an item, based
on the embeddings of the user and item. The learned embeddings can then be used to generate
recommendations for users.
To improve the performance of the recommendation system, additional features can be incorporated
into the model. For example, in the case of movie recommendations, features such as the genre and
the synopsis of the movie can be used to augment the embeddings of the movies. Similarly, features
such as the age and gender of the user can be used to augment the embeddings of the users. Overall,
GNNs have shown great promise in the domain of recommendation systems and can help in creating
more accurate and personalized recommendations for users. With the availability of large amounts of
data and the increasing interest in personalized recommendations
The rest of the paper is organized as follows: Section 2 provides a brief overview of related work.
Section 3 describes the dataset and the pre-processing steps used to prepare the data. Section 4
presents the proposed model in detail. Section 5 presents the experimental setup and results. Finally,
Section 6 concludes the paper with a summary of the contributions and directions for future work
2 Related Work
Recommender systems have been widely used to provide personalized recommendations to users.
Collaborative filtering (CF) is a popular technique that utilizes users' past behavior to make recom-
mendations. Matrix factorization, a type of CF algorithm, decomposes the user-item interaction
matrix into two lower-dimensional matrices to represent users and items. The regularization weights
of the latent factors can be assigned based on items' popularity and users' activeness, which can
improve the prediction results of the matrix factorization technique. [4]
The paper on graph neural networks in recommender systems provides a survey of various graph-
based techniques for recommender systems, including GCNs, GATs, and GAEs. The paper discusses
how these techniques can be used to handle cold-start problems, incorporate side information, and
enhance recommendation accuracy. [5] Graph-based models have become increasingly popular in
recent years for their ability to handle complex interactions between users and items. The linear
residual graph convolutional network approach for CF-based recommender systems revisits GCNs in
CF models and shows that removing non-linearities can enhance recommendation performance. The
2
proposed model uses a residual network structure that is specifically designed for CF with user-item
interaction modeling, which alleviates the over-smoothing problem in graph convolution aggregation
operation with sparse data. [3]
The graph-based hybrid recommendation system (GHRS) combines content-based and collaborative
filtering approaches to extract new features based on users' ratings, demographic, and location
information. These features are then used for clustering users, which improves recommendation
accuracy and dominates other methods' performance in the cold-start problem. The experimental
results on the MovieLens dataset show that the proposed algorithm outperforms many existing
recommendation algorithms on recommendation accuracy. [1]
Inductive matrix completion is another popular approach to building recommender systems that can
handle the cold-start problem. The paper on learning to transfer graph embeddings for inductive
graph-based recommendation proposes a transfer learning framework for personalized video highlight
recommendation. The proposed framework is composed of two parts: a graph neural network that
exploits the higher-order proximity between users and segments to alleviate the user cold-start
problem and an item embedding transfer network that approximates the learned item embeddings
from graph neural networks. [2]
Matrix factorization, specifically, is a widely used technique in recommender systems that utilizes
users' past behavior, such as ratings or purchases, to make recommendations. One of the most popular
CF algorithms is matrix factorization, which decomposes the user-item interaction matrix into the
product of two lower dimensionality rectangular matrices, user and item embeddings, that represent
users and items in a lower-dimensional space. The regularization weights of the latent factors can be
assigned based on items' popularity and users' activeness, which can improve the prediction results
of the matrix factorization technique. The paper on matrix factorization techniques for recommender
systems provides a foundational understanding of collaborative filtering and matrix factorization for
building recommender systems. [4]
In summary, the related papers cover various techniques for building recommender systems, including
matrix factorization, graph-based models, inductive matrix completion, and transfer learning. These
papers provide further insights into the use of these techniques in recommender systems and how they
can be used to handle cold-start problems, incorporate side information, and enhance recommendation
accuracy.
3 Dataset
The Anime Recommendation Database 2020 is a dataset available on Kaggle, containing information
about anime and user interactions from the website MyAnimeList. The dataset was created by
scraping the website and contains recommendation data from 320,000 users and 16,000 animes.
The dataset is comprised of two main tables: the anime table and the rating table. The anime table
contains information about each anime, including its ID, name, genre, type, episodes, and synopsis.
The genre field is a list of genres associated with anime, such as "Action", "Comedy", "Drama", and
"Fantasy". The type field indicates whether the anime is a TV series, movie, OVA, or other formats.
The episodes field indicates the number of episodes in the series. The synopsis field provides a brief
description of the anime's plot.
The rating table contains information about user interactions with the animes, including the user ID,
the anime ID, and the user's rating for the anime on a scale of 1 to 10. The dataset also includes a
timestamp field indicating the time when the user rated the anime.
The dataset contains a total of 78,460,895 user-anime interactions, with an average of 4.9 ratings per
user. The most popular anime in the dataset is "Death Note", with over 150,000 ratings. The dataset
is useful for building recommendation systems for anime, as it contains information about both the
animes and user preferences.
3.1 Preprocessing
The dataset used in this research consists of two primary data sources: the "anime with synopsis" and
"rating complete" files, which were merged to obtain relevant columns for the model. Specifically,
the dataset includes anime id, user id, synopsis, genres, and rating. Prior to analysis, the dataset
3
Figure 1: Bar graph of ratings given by each users
underwent a preprocessing step which involved data cleaning to remove rows with null values in any
column. One hot encoding was also applied to the genres column in order to transform the categorical
variable into a numerical format suitable for analysis.
Furthermore, two dictionaries were created to map the user id's and anime id's in the dataset. These
dictionaries were used to facilitate the analysis and interpretation of the data. Overall, the resulting
dataset is suitable for use in conducting research on anime recommendation systems, and provides a
robust foundation for the development and evaluation of machine learning algorithms for this purpose.
We created three classes: SequenceEncoder, IdentityEncoder, and GenresEncoder, which encode
different types of data into PyTorch tensors. These classes are used to load and process node and
edge data for a graph-based recommendation system. The SequenceEncoder class encodes text data
using the SentenceTransformer model. The input data is a Pandas dataframe, and the output is a
PyTorch tensor that represents the sentence embeddings. The IdentityEncoder class converts raw
column values to PyTorch tensors, and the GenresEncoder class encodes genre information from the
raw data. The load node csv function uses these encoders to process the node data, concatenating the
resulting tensors into a single tensor.
The load edge csv function loads edge data and generates labels for each edge. It takes two arguments,
ratings user id and ratings movie id, which are the user and movie IDs for each rating. It then
generates edge labels by looking up the corresponding ratings from a dictionary user anime rating
and returns a PyTorch tensor containing the edge labels. Overall, the code shows how the dataset is
preprocessed before being fed into the graph-based recommendation system. The SequenceEncoder,
IdentityEncoder, and GenresEncoder classes are used to encode different types of data into PyTorch
tensors, which are then concatenated into a single tensor using the load node csv function. The
load edge csv function loads edge data and generates labels for each edge, completing the dataset
preprocessing pipeline.
4 Proposed Methodology
In an anime recommendation system, the features used for node creation can have a significant impact
on the performance of the system. One common approach is to use genres as the features for each
anime. Genres are categorical variables that can be one-hot encoded and used to represent the anime's
content. This approach is straightforward and easy to implement, but it has some limitations.
4
Figure 2: Architecture of the model
One limitation is that genres alone may not capture the complexity and nuances of the anime. For
example, two anime could have the same genres, but one could be a comedy with a light-hearted tone
while the other could be a dark psychological thriller. In this case, relying solely on genres may not
differentiate between the two anime and could lead to poor recommendations.
To overcome this limitation, we can combine the genres with the sentence embeddings of the synopsis.
The synopsis is a brief summary of the anime's plot, and it can provide additional information about
the anime's content and style. By using sentence embeddings, we can capture the meaning and
context of the synopsis, which can help to differentiate between anime with similar genres.
To do this, we first preprocess the synopsis by removing stop words, punctuation, and other irrelevant
information. We then use a pre-trained sentence embedding model such as BERT or GloVe to generate
embeddings for each sentence in the synopsis. We can then average these embeddings to obtain a
single embedding for the entire synopsis. We can then concatenate the one-hot encoded genres with
the synopsis embedding to create a feature vector for each anime. This feature vector captures both
the categorical information about the anime's genres and the semantic information about the anime's
content and style. Once we have the feature vectors for each anime, we can use them to create nodes
in the graph. We can then use graph neural networks (GNNs) to learn the representations of these
nodes and generate recommendations based on the learned representations. Compared to using genres
alone, combining genres with the synopsis embeddings can lead to more accurate and personalized
recommendations. This approach can capture the complex and nuanced content of the anime and
provide better differentiation between anime with similar genres. Additionally, this approach can be
extended to incorporate other textual features such as reviews or user feedback, which can further
improve the recommendations.
The Model class inherits from the PyTorch Module class, which provides a convenient way to define a
neural network model. The __init__ method defines the components of the model and initializes their
parameters. The forward method defines the computation that will be performed by the model when
it is run on input data. The GNNEncoder class is a custom implementation of a GNN encoder that
takes as input a set of node features and edge connections and outputs a set of node embeddings. The
hidden_channels argument specifies the dimensionality of the node embeddings. The GNNEncoder
class is defined in a separate file and is not shown in the code snippet provided.
HeteroData(
user={ x=[100, 100] },
anime={ x=[3534, 427] },
(user, rates, anime)={
edge_index=[2, 16143],
edge_label=[16143]
},
(anime, rev_rates, user)={ edge_index=[2, 16143] }
)
: HeteroData Structure
5
The encoder attribute of the Model class is an instance of the GNNEncoder class. It takes the
hidden_channels argument as input and is initialized with the same dimensionality for both the input
and output features.
The to_hetero function is a utility function that converts the GNNEncoder object to a heterogeneous
GNN. The data.metadata() argument specifies the schema of the heterogeneous graph, which includes
information about the node types, edge types, and features of the graph. The aggr argument specifies
the type of aggregation to be used when combining information from different node types. The
EdgeDecoder class is a custom implementation of an edge decoder that takes as input a set of node
embeddings and a set of edge connections and outputs a set of edge predictions. The hidden_channels
argument specifies the dimensionality of the node embeddings. In the GNNEncoder class, the Graph-
SAGE implementation is achieved by using the SAGEConv module from PyTorch Geometric library.
The SAGEConv module implements the GraphSAGE convolutional operator, which aggregates the
feature vectors of a node and its neighbors using a graph convolutional operation.
The decoder attribute of the Model class is an instance of the EdgeDecoder class. It takes the
hidden_channels argument as input and is initialized with the same dimensionality for both the input
and output features. The forward method takes as input a dictionary of node features, a dictionary of
edge connections, and a set of edge labels. The x_dict argument is a dictionary of PyTorch tensors
representing the node features for each node type. The edge_index_dict argument is a dictionary
of PyTorch tensors representing the edge connections for each edge type. The edge_label_index
argument is a PyTorch tensor representing the edge labels.The forward method of the GNNEncoder
class first applies a GraphSAGE layer to the input node features using the SAGEConv module. This
layer aggregates the feature vectors of each node and its neighbors using a graph convolutional
operation. The resulting feature vectors are then normalized and passed through a ReLU activation
function.
The forward method first passes the input data through the encoder to obtain a set of node embeddings,
represented as a dictionary of PyTorch tensors. It then passes these node embeddings and the edge
labels through the decoder to obtain a set of predicted edge labels. In summary, the model architecture
consists of a GNN encoder that takes as input node features and edge connections, a heterophily
operator that converts the GNN encoder to a heterogeneous GNN, and an edge decoder that takes as
input node embeddings and edge connections and outputs a set of predicted edge labels. The model
is designed for semi-supervised learning on heterogeneous graphs and can handle multiple node and
edge types with different feature representations.
In the context of graph neural networks (GNNs), the heterophily operator is a mechanism used to
combine information from nodes of different types in a heterogeneous graph. In a heterogeneous
graph, nodes can have different types, which correspond to different features or attributes. For
example, in a citation network, nodes can represent papers, authors, or conferences, and each node
type can have different attributes such as publication year, paper topic, or author affiliation. To capture
such heterogeneity, GNNs use different weight matrices for each node type, allowing the model to
learn different representations for nodes of different types.
In the GNNEncoder class, the GraphSAGE implementation is achieved by using the SAGEConv
module from the PyTorch Geometric library. The SAGEConv module implements the GraphSAGE
convolutional operator, which aggregates the feature vectors of a node and its neighbors using a graph
convolutional operation. The GNNEncoder class takes two arguments: the number of input feature
dimensions and the number of output feature dimensions. The forward method of this class applies
two GraphSAGE layers to the input node features to generate the output node features. The forward
method of the GNNEncoder class first applies a GraphSAGE layer to the input node features using
the SAGEConv module. This layer aggregates the feature vectors of each node and its neighbors
using a graph convolutional operation. The resulting feature vectors are then normalized and passed
through a ReLU activation function. The output of the first GraphSAGE layer is then passed through
a second GraphSAGE layer in a similar fashion. Finally, the resulting output features are returned
as the output of the forward method of the GNNEncoder class. Overall, the GNNEncoder class
implements a GraphSAGE-based neural network architecture for learning node representations in a
graph by aggregating neighborhood information of each node in the graph
6
5 Evaluation and Results
The process of evaluation is as follows; this model is evaluated using Root Mean square Error(RMSE),
the model is used to get the ratings between a given user and certain anime which the user haven't
watched before, all such links are predicted with certain weight, so given a user we get the ratings for
different anime in the list which they haven't watched yet, after this the predicted ratings along with
the anime are taken for particular user and then the list is sorted according to the rating predicted,
we get the list of anime with highest to lowest rated for the anime that would be given by the user if
watched as predicted by the model, top 10 anime of this list are taken and are recommended to that
user as the anime recommendation that the user can watch. The evaluation is done by using the test
set where we have the ratings that are given by the user for different anime, these are not shown at
the training time, trained model is used to predict the rating and then evaluate it with the ground truth
labels, using RMSE we check how close the model is able to predict the values for the given graph.
(a) Loss vs Epochs
(b) Accuracy vs Epochs
Figure 3: Results
Recomendation for user: 415 ['Pokemon Movie 14 White: Victini to Kuroki Eiyuu Zekrom', 'Tsuki
no Sango', 'Charlotte', 'Tanaka-kun wa Kyou mo Kedaruge', 'Iblard Jikan', 'Teekyuu', 'Tenshi
Nanka ja Nai', 'No Game No Life: Zero', 'Puchitto Gargantia', 'Pokemon: Senritsu no Mirage
Pokemon']
Recomendation for user: 30 ['Jormungand', 'Hanayamata', 'BlackRock Shooter (OVA)', 'Mahou
Shoujo Ore', 'Selector Infected WIXOSS', 'Kara no Kyoukai 6: Boukyaku Rokuon', 'Claymore',
'Kamigami no Asobi', 'Zettai Bouei Leviathan', 'Kakegurui']
Recomendation for user: 189 ['Zero no Tsukaima F', 'Mahouka Koukou no Rettousei Movie: Hoshi
wo Yobu Shoujo', 'Kami-tachi ni Hirowareta Otoko', 'Sunohara-sou no Kanrinin-san', 'Dragon Ball
GT', 'Seishun Buta Yarou wa Bunny Girl Senpai no Yume wo Minai', 'Tamako Market', 'School
Days', 'Kono Bijutsubu ni wa Mondai ga Aru!', 'Re:Zero kara Hajimeru Isekai Seikatsu 2nd Season']
Recomendation for user: 298 ['Mobile Suit Gundam 00', 'Bannou Bunka Neko-Musume DASH!',
'Fullmetal Alchemist: Premium Collection', 'Naruto Movie 2: Dai Gekitotsu! Maboroshi no
Chiteiiseki Dattebayo!', 'Issho ni Training: Training with Hinako', 'Doraemon', 'School Rumble',
'Golden Boy', 'Rurouni Kenshin: Meiji Kenkaku Romantan - Tsuioku-hen', 'Death Note: Rewrite']
The results of our experiment are presented in this section. The model was trained and tested on a
dataset consisting of 800 users. The following are the results of our experiment:
Train loss: 0.659
Test Loss: 0.667
Train Accuracy: 0.52
Test Accuracy: 0.37
7
6 Conclusion and Future Work
The results show that the model achieved a higher accuracy on the training data (52%) compared
to the testing data (37%). The loss values for both the training and testing data are relatively high,
indicating that the model may not be performing optimally. Though the accuracy is not that high, but
the model is working and giving good results with very less amount of data, the compute resource
required to run for large amount of data is very high The future plans of the model would be to try
with more nodes which can be made into features and then make edges between the user and their
features as well as the anime and the features of the animes. Also the other side of future work would
to try on more data which would be possible with more compute resources. There is also possibility
of trying more types of GNN's other than Graph SAGE network for the training process of the GNN.
References
[1] Zahra Zamanzadeh Darban and Mohammad Hadi Valipour, GHRS: Graph-based hybrid recommendation
system with application to movie recommendation, Expert Systems with Applications. https://doi.
org/10.48550/arXiv.2111.11293
[2] Wu, Le & Yang, Yonghui & Chen, Lei & Lian, Defu & Hong, Richang & Wang, Meng. (2020).
Learning to Transfer Graph Embeddings for Inductive Graph based Recommendation.
[3] Chen, Lei et al. "Revisiting Graph based Collaborative Filtering: A Linear Residual Graph
Convolutional Network Approach." ArXiv abs/2001.10167 (2020): n. pag.
[4] Y. Koren, R. Bell and C. Volinsky, "Matrix Factorization Techniques for Recommender Systems,"
in Computer, vol. 42, no. 8, pp. 30-37, Aug. 2009, doi: 10.1109/MC.2009.263.
[5] Wu, Shiwen, et al. "Graph neural networks in recommender systems: a survey." ACM Computing
Surveys 55.5 (2022): 1-37.
8
|
|
http://arxiv.org/abs/2310.04875v1 | "2023-10-07T17:16:34" | "2023-10-07T17:16:34" | Prompt-to-OS (P2OS): Revolutionizing Operating Systems and
Human-Computer Interaction with Integrated AI Generative Models | In this paper, we present a groundbreaking paradigm for human-computer
interaction that revolutionizes the traditional notion of an operating system.
Within this innovative framework, user requests issued to the machine are
handled by an interconnected ecosystem of generative AI models that seamlessly
integrate with or even replace traditional software applications. At the core
of this paradigm shift are large generative models, such as language and
diffusion models, which serve as the central interface between users and
computers. This pioneering approach leverages the abilities of advanced
language models, empowering users to engage in natural language conversations
with their computing devices. Users can articulate their intentions, tasks, and
inquiries directly to the system, eliminating the need for explicit commands or
complex navigation. The language model comprehends and interprets the user's
prompts, generating and displaying contextual and meaningful responses that
facilitate seamless and intuitive interactions.
This paradigm shift not only streamlines user interactions but also opens up
new possibilities for personalized experiences. Generative models can adapt to
individual preferences, learning from user input and continuously improving
their understanding and response generation. Furthermore, it enables enhanced
accessibility, as users can interact with the system using speech or text,
accommodating diverse communication preferences.
However, this visionary concept raises significant challenges, including
privacy, security, trustability, and the ethical use of generative models.
Robust safeguards must be in place to protect user data and prevent potential
misuse or manipulation of the language model.
While the full realization of this paradigm is still far from being achieved,
this paper serves as a starting point for envisioning this transformative
potential. | [
"Gabriele Tolomei",
"Cesare Campagnano",
"Fabrizio Silvestri",
"Giovanni Trappolini"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04875v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04875v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CL",
"cs.CY",
"cs.HC",
"cs.OS"
] | Prompt-to-OS (P2OS): Revolutionizing Operating
Systems and Human-Computer Interaction with
Integrated AI Generative Models
Gabriele Tolomei,§ Cesare Campagnano,§
Department of Computer Science
Sapienza University of Rome, Italy
{tolomei, campagnano}@di.uniroma1.it
Fabrizio Silvestri, Giovanni Trappolini
Department of Computer Engineering
Sapienza University of Rome, Italy
{fsilvestri, trappolini}@diag.uniroma1.it
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
5
7
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Abstract-In this ambitious paper, we present a groundbreak-
ing paradigm for human-computer interaction that revolutionizes
the traditional notion of an operating system. Within this innova-
tive framework, user requests issued to the machine are handled
by an interconnected ecosystem of generative AI models that
seamlessly integrate with or even replace traditional software ap-
plications. At the core of this paradigm shift are large generative
models, such as language and diffusion models, which serve as the
central interface between users and computers. This pioneering
approach leverages the abilities of advanced language models,
empowering users to engage in natural language conversations
with their computing devices.
By capitalizing on the power of language models, users can
articulate their intentions, tasks, and inquiries directly to the
system, eliminating the need for explicit commands or complex
navigation. The language model comprehends and interprets the
user's prompts, generating and displaying contextual and mean-
ingful responses that facilitate seamless and intuitive interactions.
This paradigm shift not only streamlines user interactions
but also opens up new possibilities for personalized experiences.
Generative models can adapt to individual preferences, learning
from user input and continuously improving their understanding
and response generation. Furthermore,
it enables enhanced
accessibility, as users can interact with the system using speech
or text, accommodating diverse communication preferences.
However, this visionary concept also raises significant chal-
lenges, including privacy, security, trustability, and the ethical
use of generative models. Robust safeguards must be in place to
protect user data and prevent potential misuse or manipulation
of the language model.
While the full realization of this paradigm is still far from being
achieved, this paper serves as a starting point for envisioning
the transformative potential of a human-computer interaction
intelligence. We discuss
paradigm centered around artificial
the envisioned benefits, challenges, and implications, paving the
way for future research and development in this exciting and
promising direction.
Index Terms-AI generative models for operating systems, AI
generative models for human-computer interaction, AI generative
models as universal applications
I. INTRODUCTION
The evolution of human-computer interaction (HCI) has
undergone several transformations over the decades, with tech-
§Equal contribution.
nology continuously striving to make computers more user-
friendly and accessible. From the command-line interfaces of
the 1960s to the graphical user interfaces (GUI) of the 1980s
and, more recently, the touch interfaces on mobile devices,
each shift has represented a significant leap towards more
intuitive, efficient, and seamless user experiences. Today, as
we find ourselves at the precipice of another paradigm shift,
the question is not whether, but how, we continue to shape this
ongoing evolution to ensure a future where technology serves
us in increasingly human-centric ways.
In the current technological landscape, artificial intelligence
(AI) stands as a powerhouse of potential, particularly for
augmenting and redefining current operating systems and user
interfaces. The abilities of large generative models (LGMs),
such as large language models (LLMs) and diffusion models
(DMs), have given us a glimpse into a future where our inter-
actions with technology transcend the traditional boundaries.
LLMs, built upon vast data sets and sophisticated architec-
tures, are capable of completing complex tasks, demonstrating
chain-of-thought reasoning akin to human capabilities, and
displaying impressive generalization skills. Their proficiency
in comprehending and generating language makes them ideal
base-reasoners, capable of orchestrating diverse system com-
ponents to create a seamless, intuitive, and responsive user
interface.
Moreover, with advances in generative computer vision
models, especially DMs, our toolbox for enhancing human-
computer interaction has expanded. These models can generate
incredibly realistic outputs, setting the stage for them to serve
as the foundation for user interface generation: the ability to
generate personalized interfaces on-the-fly, that cater and adapt
to individual user preferences, their character, and mood marks
a shift toward highly customized and user-centric design, a
shift that promises to enrich user experiences significantly.
This new paradigm of human-computer interaction presents
exciting opportunities, such as enabling communication be-
tween systems that otherwise do not integrate the same API.
By utilizing natural language, a universal medium, we can
bridge the gap between disparate systems, fostering a more
unified, coherent, and efficient interaction landscape.
However, this shift in paradigm also brings its share of chal-
lenges. A prime example is the need to ensure data persistence
within these models. One key question when implementing
this new approach is how we can keep a consistent and ongo-
ing dialogue over time, especially when the system is working
on complicated or multi-stage tasks. This steady interaction is
crucial for a smooth user experience and for building trust in
the system's ability to assist the user effectively. To make this
possible, we may need to step away from the methods we're
used to and start thinking about new ways to improve the
performance of these generative models. For instance, current
methods of data management, such as storing files explicitly in
computers or data centers, may provide some benefits, but they
may not fully meet the unique needs of generative models,
which store their knowledge implicitly, compressed within
their parameters.
While the capabilities of LLMs in understanding and gen-
erating language are remarkable, they are not without their
limitations. These issues primarily originate from the data
employed for their pre-training, which is frequently obtained
from web crawls. This data can often contain biased, toxic,
or harmful content, consequently impairing models' reliabil-
ity. Another limitation is the tendency to hallucinate, i.e.,
despite not having any explicit misinformation, LLMs may
generate outputs that are not entirely accurate or faithful.
This propensity to deviate from the input can occasionally
lead to responses that, while contextually plausible, might
misrepresent the user's intent or the factual information at
hand.
Moreover, the promise of seamless interaction and com-
munication must balance with considerations of trustability,
privacy, security, and ethics. For this reason, developing new
protocols for information exchange becomes a necessity in
this envisioned future. These protocols must meet and surpass
current standards, protecting user data while simultaneously
ensuring private and secure interactions. The design of such
protocols also must anticipate and be resilient against potential
misuse of AI systems, providing robust safeguards to exploita-
tion and unethical practices.
These represent just a few of the challenges in harnessing
the full potential of LLMs in revolutionizing human-computer
interaction. As we venture into this exciting new territory, it is
essential to confront these challenges head-on, ensuring that
the solutions we develop are not just technologically advanced,
but also reliable, ethical, and user-centric.
The road ahead in this new paradigm is both promising
and challenging. This paper serves as an exploration into the
future of human-computer interaction – a future where our
interactions with technology become akin to a natural con-
versation. We delve deeper into the benefits, challenges, and
implications of this envisioned future in the following sections,
charting a course for continued research and development
in this transformative and exciting direction. In particular,
Section II reviews current work in this area, and provides
an idea of the current technological landscape; Sections III
and IV describe our vision and propose a possible architecture,
respectively. Section V questions the main challenges that may
arise; finally, Section VI concludes our discussion.
II. RELATED WORK
Recent years have seen the rise of Transformers as the
leading architecture for (deep) learning systems. Initially in-
troduced as a technique for machine translation [1], they have
soon been recognized as valuable for text-related downstream
tasks. Works such as [2, 3, 4, 5] pre-train a transformer on a
self-supervised task and finetune it on a specific downstream
task, usually using a small amount of data and achieving super-
human performance [6]. Others [7, 8, 9] have focused on using
transformers as generative LLMs. These models effectively
train to predict the next token sequence given a particular
context/input. This latter strategy has reached wide popularity,
even among the general public, thanks to recent successes
like [10]. These LLMs have fully exploited the transformer's
capacity to scale to a huge number of parameters, allowing
them to have exceptional capabilities on many downstream
tasks, even in a zero-shot setting, i.e., without requiring further
supervision on the specific task. Even more surprisingly,
the models can improve these tasks using prompting [11].
Prompting consists in providing specific input to the LLM,
inducing a more accurate response by the model. We find other
techniques inside this paradigm, like that of in-context learning
[12], that is, to provide the LLM with a few examples of the
task in its input, sometimes greatly enhancing its performance.
We would like the reader to notice that these techniques do
not require any additional training and can be performed at
inference time. While these LLMs have shown impressive
capabilities, they also have several shortcomings. Above all,
the inability to deal with a large context/input [13] and the
tendency to hallucinate [14] has led researchers to look for
ways of augmenting them [15, 16, 17]. Among these, we find
most interesting for this work the line of researchers that aims
at augmenting LLMs with the use of tools [18, 19]. Under
this paradigm, the LLM can call for help in the form of APIs.
For instance, the model could call a calculator to perform a
mathematical operation.
In this paper, we want to move beyond this paradigm. While
the LLM can call for tools, they are imagined as strictly
rigid and static APIs. What we envision, instead, is to have
generative models that can communicate both with the user
and among each other in a natural manner; in other words, we
foresee the the end of programming [20] as we know it for
the average computer user.
This new proposed paradigm opens up a realm of possibility.
For example, thanks to recent advances in text-to-image gener-
ation [21], authors from [22] have proposed a GUI generated
at runtime and explicitly personalized for a particular user-
task-experience triplet. Even further, deep learning models are
now reaching multimodal capabilities beyond just images, with
methods proficient on audio [23, 24, 25], video [26, 27], and
3D [28, 29, 30]. In the following sections, we develop more
thoroughly this vision that promises to revolutionize system
design and human-computer interactions.
III. VISION
Let us consider a hypothetical scenario as an exemplification
to introduce this section. In the following, we will use the
term "agent" to indicate any generative AI model within our
ecosystem. We denote by Ac a client agent, which is a user's
personal assistant, while As designates a set of server agents,
which provide specific services or resources.
We illustrate this through the following dialogue sequence,
where files and actions are represented by square brackets:
1) User to Ac: "Please find me a flight to Paris on the 16th
or 17th of July in the evening for less than 120 USD.
Don't show me all the options; propose the cheapest one
directly"
2) Ac to [As1, As2, As3]: "My user would like a flight to
Paris, between the 16th and 17th of July, preferably in
the evening, at a cost not exceeding 120 USD. Who can
provide options?"
3) As1 to Ac: "No options available."
As2 to Ac: "There are two flights, the first is on July
16th at 4 PM for 118 USD, the other on July 17th at 6
PM for 95 USD."
As3 to Ac: "There is a flight on July 17th at 4 PM for
110 USD."
4) Ac to As2: "Please send a quote for the second option
(the one on July 17th at 6 PM for 95 USD)."
5) As2 to Ac: [PDF][Secure payment link]
6) Ac to User: "Here is the quote for a 95 USD flight
[Display PDF]. Do you want to book?"
7) User to Ac: "Yes, and then print the ticket."
8) Ac to As2: [Payment]
9) As2 to Ac: [Ticket PDF]
10) Ac
to User: "Here is
PDF][Print ticket PDF]"
the ticket.
[Display ticket
This hypothetical scenario above is just one example of a
broader vision that is mappable to this framework. This system
could have enormous flexibility, for example, "find me a flight
to go to Thailand, Indonesia, Vietnam, or Cambodia around
mid-August for 14-16 days. When you find something less
than 700 USD, book it without asking for my confirmation,
and print me the ticket".
In this scenario, Ac serves as the orchestrator, coordinating
with the server agents As to achieve the user's goal. Ac,
empowered by LLMs and DMs, is capable of understanding
the user's instructions, delegating tasks, and managing the
dialogue's flow. Meanwhile, the server agents As, powered by
various specialized components/models, handle specific tasks
such as finding flights, handling payments, and generating
PDFs.
To further delineate our vision, let us delve deeper into
the integration of state-of-the-art computer vision systems and
their potential role in on-the-fly GUI rendering. Diffusion
models, which have demonstrated remarkable capabilities in
generating high-quality, realistic outputs, could serve as a
cornerstone for this task.
One of the exciting prospects that the adoption of such
models brings is the ability to customize and personalize the
interface in response to the user's preferences, character, and
even mood. Given that these models can be trained to generate
a wide range of visual outputs, they could be directed to design
interfaces that echo a user's aesthetic preferences or adapt to
their current mood. For instance, the system could switch from
a minimalist design with soft colors to a vibrant, dynamic
design as it detects a change in the user's emotional state.
Such a degree of customization would revolutionize the con-
cept of user-centric design, moving away from static designs
to more fluid and responsive ones. This ability to generate
personalized interfaces on-the-fly represents a significant shift
towards a future where technology can deeply integrate into
our lives, responding to our needs and moods in real time.
Additionally,
the integration of speech-to-text and text-
to-speech models can further enhance this future vision of
human-computer interaction. The coupling of these models
with a powerful language understanding system allows for
interactions that are more in line with natural, human conver-
sation. Users could convey their needs verbally, and the system
could respond in kind, further blurring the lines between
human-computer interaction and human-human conversation.
For instance, in the previously discussed scenario, the user
could verbalize their request for a flight booking, and the client
agent (Ac) could acknowledge, confirm, and execute these
instructions using spoken language. This seamless integration
of speech-to-text and text-to-speech models would provide
an interaction experience that is not just intuitive but also
highly efficient, especially for users with visual impairments or
those who are occupied with other tasks and prefer to interact
verbally with their devices.
Furthermore, these systems could extend beyond serving
individual users and facilitate interactions between groups of
users. For instance, they could be deployed in conference
calls or group meetings, transcribing the conversation, sum-
marizing the key points, and even responding to queries in
real time. This transition to more natural and fluid forms of
communication holds immense promise for both personal and
professional contexts, signaling a future where our interaction
with technology is as natural and intuitive as speaking with a
friend or colleague.
This concept of personalized, responsive, and accessible
interfaces could even extend to other sensory modalities, such
as haptics, further broadening the scope of HCI. With advance-
ments in AI and ML, the future of HCI could encompass an
array of sensory interactions, each tailored to individual user
needs and preferences, creating an immersive and inclusive
technological environment.
Despite these potential advancements, it is important to
keep in mind that such a high level of customization and
personalization carries with it a host of challenges related
to privacy, security, and ethics. Addressing these challenges
is essential to ensure the successful implementation of this
vision. These challenges and potential solutions are discussed
in greater detail in Sections V and IV.
IV. PROPOSED ARCHITECTURE
C. Integrated Components
As the trajectory of human-computer interaction continues
to evolve, we propose a novel architecture that shifts the
paradigm of traditional system design. This architecture is
visualized in Figure 1, highlighting the integration of an LLM
directly above the system call layer of the operating system,
fundamentally altering how users (and current standalone
applications) interface with low-level computing resources.
Fig. 1. A representation of the proposed architecture highlighting the
operating system, system calls, LLM, and its integration with a multi-modal
neural database and other integrated components.
A. High-Level to Direct LLM Interface
Referring to Figure 1, traditionally, user requests, translated
by standalone applications, would interface with the operating
system through system calls. Our proposed architecture envi-
sions an LLM layer sitting atop the system call layer. This
LLM would harness the power of system calls to communi-
cate with the operating system directly. By introducing this
intermediary LLM layer, we can achieve several advantages:
• Reduction in Redundancy: Redundancies inherent in
maintaining multiple application layers, especially those
with overlapping backend processes, can be significantly
reduced.
• Simplified Communication: LLMs, acting as universal
mediators, can execute user commands across various
platforms, obviating the need for shared APIs.
• Natural Interaction: Users can employ natural language,
moving away from domain-specific commands, promot-
ing a more human-centric design.
B. Transitioning Away from Standalone Applications
While the LLM becomes the primary interface, standalone
applications will not vanish but transform. They could serve
as specialized plug-ins or tools for the LLM. For complex
tasks, such as advanced graphic design, specialized applica-
tions might still be employed. However, initiation and basic
interactions can be handled in natural language, seamlessly
integrating these applications with the LLM.
In addition to the LLM, our architecture encompasses:
• Graphical Processor based on Diffusion Models: This
caters to visual tasks, allowing for the generation and in-
terpretation of personalized user interfaces and graphical
content, ensuring a multi-modal interaction platform.
• Multi-modal Neural Database: Integral to our proposed
architecture, as visualized in Figure 1, is the connection of
the LLM to a multi-modal neural database. This database
serves as persistent memory storage for the LLM, ensur-
ing consistent user experiences across sessions. Unlike
traditional databases that store explicit data, this neural
database retains information in a format amenable to di-
rect neural processing, facilitating immediate and efficient
data retrieval and modification by the LLM.
• Text-to-Speech and Speech-to-Text Systems: These
components allow for auditory interactions, where users
can speak to and receive vocal feedback from the system.
The outlined architecture supports adaptability and user-
centricity, with components continuously refining their oper-
ations based on feedback. Data security, consistency, and the
reliability of LLM-mediated interactions remain pivotal, and
will be discussed in more detail in the next section.
V. CHALLENGES
Developing an operating system that integrates generative
AI models like the one sketched in Figure 1 promises to
reshape system design dramatically. Therefore, realizing this
vision is not without its challenges, which span technological,
security, privacy, and ethical domains. In this section, we
delve deeper into these obstacles, highlighting the complex
and multifaceted work required to bring this vision to fruition.
A. Trustability and Safety
LLMs have shown remarkable capabilities in understanding
and generating human-like text. This remarkable prowess
stems from their training on enormous, diverse web data,
which allows them to assimilate an impressive understanding
of language structure, context, and information.
However, this training approach can also present substantial
risks [31, 32, 33]. Uncontrolled web data, which is often part
of large pre-training corpora, can introduce the possibility of
biased, harmful, or toxic behavior. For instance, if the training
data includes prejudiced viewpoints or false information, the
LLM might inadvertently absorb these biases and misinfor-
mation, potentially affecting the quality and trustworthiness
of the content it generates.
Moreover, LLMs can sometimes generate plausible yet
inaccurate content, a phenomenon often referred to as hallu-
cination. Users may overlook minor inaccuracies in the short
term, but persistent or significant misrepresentations can erode
trust in the system. This challenge becomes even more acute
when the system handles sensitive or critical tasks, where
accuracy and reliability are paramount.
Developing methods to reduce these hallucinations,
in-
crease the trustworthiness of generated content, and provide
Operating SystemServicesProgramexecutionI/OoperationsErrordetectionResourceallocation. . .System callsLLMMulti-modalNeural DatabaseText-to-speechSpeech-to-textGraphical processor(Diffusion-based model)LegacyDatabaseHardwaretransparency into the system's decision-making process is a
significant, non-trivial challenge in realizing this vision.
be challenging to anticipate or prevent, given the diverse and
unpredictable nature of human interaction.
B. Technological Challenges
1) Data Persistence: Current LLMs are stateless, meaning
they do not maintain a memory of past interactions. While this
is not an issue for single, isolated tasks, it poses a substantial
challenge for complex, multi-stage tasks that require an on-
going dialogue with the user. In these scenarios, maintaining
a consistent "conversation thread" is crucial for the system
to function effectively and provide a smooth, seamless user
experience.
More generally, LGMs encode their knowledge implicitly
within their model parameters, effectively compressing vast
amounts of information into a highly condensed form. While
this approach allows the model to generate rich, contextually-
aware content,
it also presents a significant challenge in
retrieving and using this information effectively.
Innovative solutions for data persistence and memory man-
agement are essential for achieving smooth, natural human-
computer interactions. These solutions could involve novel
data storage and retrieval mechanisms, new ways of repre-
senting and tracking dialogue states, or creative uses of meta-
learning to adapt and personalize the system over time.
2) Hardware Considerations: The integration of LGMs
into operating systems entails careful consideration of both
low-level and high-level hardware aspects. At the low level,
the system's design must efficiently manage the available
hardware resources. Running LGMs in real-time could demand
substantial computational resources, potentially stretching the
limits of current systems. Innovative technologies to build
small and specialized models for this new kind of operating
system should be devised, as we cannot make any use of an
LGM that will exhaust the system resources available.
At a high level, the envisioned system would necessitate a
radical shift in software-hardware interaction. The generated
user interfaces must work seamlessly across diverse hardware
configurations, demanding extensive adaptability and compat-
ibility. Ensuring the system's efficacy and efficiency across a
wide range of hardware poses a significant technical challenge.
C. Security and Privacy
1) Communication Security: As we move towards a new
paradigm of human-computer interaction, secure communi-
cation becomes even more critical. Current communication
protocols, like certificate-based authentication, provide robust
mechanisms for ensuring that an agent is legitimate before
starting communication. However, as we transition to a sys-
tem centered around LLMs, these protocols will need to be
augmented or replaced with new techniques tailored to the
unique challenges and opportunities of this paradigm.
2) AI-Social Engineering: The sophistication of LGMs can
potentially be exploited in AI-social engineering attacks. In
such scenarios, a malicious user might attempt to deceive
the AI system into revealing sensitive information or execute
harmful actions. These attacks can take many forms and can
Preventing these attacks will require careful system design,
including setting strict parameters on the system's behavior,
determining which data can be shared and under what condi-
tions, and designing mechanisms for user consent and control
over the system's actions.
D. Ethics
The integration of LGMs into operating systems also raises
numerous ethical concerns. One significant concern is their po-
tential to displace human workers in specific professions. Such
displacement could lead to widespread job losses, contributing
to economic inequalities and causing societal disruption on a
potentially large scale.
Moreover, the power of these technologies to synthesize and
manipulate data poses unique risks. For example, LGMs can
be harnessed to create deepfakes and fake news, which can
then be used for nefarious purposes, including disinformation
campaigns or identity theft. These models can generate ma-
licious content, such as automated phishing emails or hate
speech, exacerbating existing social and ethical dilemmas.
These ethical issues highlight the importance of establish-
ing robust safeguards, regulations, and guidelines to prevent
misuse and manage the societal impact of these technologies.
VI. CONCLUSION
The evolution of human-computer interaction, enhanced
by the capabilities of LGMs such as LLMs and DMs, has
the potential to reshape system design and the dynamics of
communication, interaction, and collaboration between users
and machines. Through the integration of AI into operating
systems, we envision a future where interfaces are not only
intuitive but also deeply personalized, adapting to individual
needs and preferences, allowing for seamless and coherent in-
teractions. This paper offers a glimpse of such a transformative
future, emphasizing both its unprecedented benefits and its
multifaceted challenges.
Yet, the roadmap to such a future is not without its intri-
cacies. Harnessing the full potential of AI-enhanced human-
computer interaction requires navigating a landscape replete
with challenges, ranging from data persistence, model reliabil-
ity, bias, to the paramount concerns of trust, privacy, and eth-
ical considerations. Addressing these challenges is not merely
a technical exercise but a broader call for interdisciplinary
collaboration. The complexity of these issues suggests that our
current understanding and strategies may only be scratching
the surface, necessitating a paradigm shift in our approach.
Despite these hurdles, this journey is of primary importance.
The convergence of AI and HCI within system design can
lead to a profound enhancement in the quality of our digital
experiences, shifting from transactional commands to natural,
conversation-like engagements. We envision a world where
technology is a responsive collaborator, attuned to human
needs and preferences. While this paper has just scratched
the surface of this promising frontier, we hope that it serves
as a catalyst, inspiring and guiding future research endeavors.
ACKNOWLEDGMENT
This work was partially supported by:
• DRONES AS A SERVICE for FIRST EMERGENCY
RESPONSE Project (Ateneo 2021);
• projects FAIR (PE0000013), SERICS (PE00000014), and
IR0000013-SoBigData.it under the MUR National Re-
covery and Resilience Plan funded by the European
Union NextGenerationEU.
REFERENCES
[1] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit,
L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin,
"Attention is all you need," Advances in neural informa-
tion processing systems, vol. 30, 2017.
[2] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova,
transformers
preprint
"Bert: Pre-training of deep bidirectional
for
language
arXiv:1810.04805, 2018.
understanding,"
arXiv
[3] K. Clark, M.-T. Luong, Q. V. Le, and C. D. Manning,
"Electra: Pre-training text encoders as discriminators
rather than generators," arXiv preprint arXiv:2003.10555,
2020.
[4] Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen,
O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov,
"Roberta: A robustly optimized bert pretraining ap-
proach," arXiv preprint arXiv:1907.11692, 2019.
[5] C. Campagnano, S. Conia, and R. Navigli, "SRL4E – Se-
mantic Role Labeling for Emotions: A unified evaluation
framework," in Proceedings of the 60th Annual Meeting
of the Association for Computational Linguistics (Volume
1: Long Papers), pp. 4586–4601, 2022.
[6] A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and
S. R. Bowman, "Glue: A multi-task benchmark and
analysis platform for natural language understanding,"
arXiv preprint arXiv:1804.07461, 2018.
[7] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Ka-
plan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry,
A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger,
T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu,
C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin,
S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish,
A. Radford, I. Sutskever, and D. Amodei, "Language
models are few-shot learners," 2020.
[8] A. Radford, K. Narasimhan, T. Salimans,
"Improving
and
understanding
language
I. Sutskever,
by generative pretraining," 2018.
[9] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei,
and I. Sutskever, "Language models are unsupervised
multitask learners," OpenAI Blog, 2019.
[10] OpenAI, "Chatgpt by openai," 2021.
[11] Y. Lu, M. Bartolo, A. Moore, S. Riedel, and P. Stenetorp,
"Fantastically ordered prompts and where to find them:
Overcoming few-shot prompt order sensitivity," arXiv
preprint arXiv:2104.08786, 2021.
[12] Q. Dong, L. Li, D. Dai, C. Zheng, Z. Wu, B. Chang,
X. Sun, J. Xu, L. Li, and Z. Sui, "A survey on in-context
learning," 2023.
[13] N. F. Liu, K. Lin, J. Hewitt, A. Paranjape, M. Bevilac-
qua, F. Petroni, and P. Liang, "Lost
in the middle:
How language models use long contexts," arXiv preprint
arXiv:2307.03172, 2023.
[14] M. Zhang, O. Press, W. Merrill, A. Liu, and N. A.
Smith, "How language model hallucinations can snow-
ball," 2023.
[15] G. Mialon, R. Dess`ı, M. Lomeli, C. Nalmpantis, R. Pa-
sunuru, R. Raileanu, B. Rozi`ere, T. Schick, J. Dwivedi-
Yu, A. Celikyilmaz, et al., "Augmented language models:
a survey," arXiv preprint arXiv:2302.07842, 2023.
[16] G. Trappolini, A. Santilli, E. Rodol`a, A. Halevy, and
F. Silvestri, "Multimodal neural databases," in Proceed-
ings of the 46th International ACM SIGIR Conference
on Research and Development in Information Retrieval,
SIGIR '23, (New York, NY, USA), p. 2619–2628, Asso-
ciation for Computing Machinery, 2023.
[17] J. Thorne, M. Yazdani, M. Saeidi, F. Silvestri, S. Riedel,
and A. Halevy, "Database reasoning over text," in Pro-
ceedings of the 59th Annual Meeting of the Association
for Computational Linguistics and the 11th International
Joint Conference on Natural Language Processing (Vol-
ume 1: Long Papers), (Online), pp. 3091–3104, Associ-
ation for Computational Linguistics, Aug. 2021.
[18] T. Schick, J. Dwivedi-Yu, R. Dess`ı, R. Raileanu,
M. Lomeli, L. Zettlemoyer, N. Cancedda, and T. Scialom,
"Toolformer: Language models can teach themselves to
use tools," arXiv preprint arXiv:2302.04761, 2023.
[19] S. G. Patil, T. Zhang, X. Wang, and J. E. Gonzalez,
"Gorilla: Large language model connected with massive
apis," 2023.
[20] M. Welsh, "The end of programming," Commun. ACM,
vol. 66, p. 34–35, dec 2022.
[21] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and
B. Ommer, "High-resolution image synthesis with latent
diffusion models," 2022.
[22] J. Wei, A.-L. Courbis, T. Lambolais, B. Xu, P. L. Bernard,
and G. Dray, "Boosting gui prototyping with diffusion
models," 2023.
[23] P. Dhariwal, H. Jun, C. Payne, J. W. Kim, A. Radford,
and I. Sutskever, "Jukebox: A generative model for
music," arXiv preprint arXiv:2005.00341, 2020.
[24] Z. Borsos, R. Marinier, D. Vincent, E. Kharitonov,
O. Pietquin, M. Sharifi, D. Roblek, O. Teboul, D. Grang-
ier, M. Tagliasacchi, et al., "Audiolm: a language model-
ing approach to audio generation," IEEE/ACM Transac-
tions on Audio, Speech, and Language Processing, 2023.
[25] G. Barnab`o, G. Trappolini, L. Lastilla, C. Campagnano,
A. Fan, F. Petroni, and F. Silvestri, "Cycledrums: auto-
matic drum arrangement for bass lines using cyclegan,"
Discover Artificial Intelligence, vol. 3, no. 1, p. 4, 2023.
[26] Z. Luo, D. Chen, Y. Zhang, Y. Huang, L. Wang, Y. Shen,
D. Zhao, J. Zhou, and T. Tan, "Videofusion: Decomposed
diffusion models for high-quality video generation," in
Proceedings of the IEEE/CVF Conference on Computer
Vision and Pattern Recognition (CVPR), June 2023.
[27] Y. Li, C.-Y. Wu, H. Fan, K. Mangalam, B. Xiong,
J. Malik, and C. Feichtenhofer, "Mvitv2: Improved multi-
scale vision transformers for classification and detection,"
2022.
[28] Z. Chen, G. Wang, and Z. Liu, "Scenedreamer: Un-
bounded 3d scene generation from 2d image collections,"
2023.
[29] G. Trappolini, L. Cosmo, L. Moschella, R. Marin,
S. Melzi, and E. Rodol`a, "Shape registration in the
time of transformers," Advances in Neural Information
Processing Systems, vol. 34, pp. 5731–5744, 2021.
[30] O. Halimi,
I.
Imanuel, O. Litany, G. Trappolini,
E. Rodol`a, L. Guibas, and R. Kimmel, "Towards pre-
cise completion of deformable shapes," in Computer
Vision–ECCV 2020: 16th European Conference, Glas-
gow, UK, August 23–28, 2020, Proceedings, Part XXIV
16, pp. 359–377, Springer, 2020.
[31] D. Z ̈ugner, O. Borchert, A. Akbarnejad,
and
S. G ̈unnemann, "Adversarial attacks on graph neural
and their patterns," ACM
networks: Perturbations
from Data
Transactions on Knowledge Discovery
(TKDD), vol. 14, no. 5, pp. 1–31, 2020.
[32] A. Chakraborty, M. Alam, V. Dey, A. Chattopadhyay, and
D. Mukhopadhyay, "Adversarial attacks and defences: A
survey," arXiv preprint arXiv:1810.00069, 2018.
[33] G. Trappolini, V. Maiorca, S. Severino, E. Rodol`a, F. Sil-
vestri, and G. Tolomei, "Sparse vicious attacks on graph
neural networks," arXiv preprint arXiv:2209.09688,
2022.
|
|
http://arxiv.org/abs/2310.04871v1 | "2023-10-07T16:48:24" | "2023-10-07T16:48:24" | Machine Learning for Automated Mitral Regurgitation Detection from
Cardiac Imaging | Mitral regurgitation (MR) is a heart valve disease with potentially fatal
consequences that can only be forestalled through timely diagnosis and
treatment. Traditional diagnosis methods are expensive, labor-intensive and
require clinical expertise, posing a barrier to screening for MR. To overcome
this impediment, we propose a new semi-supervised model for MR classification
called CUSSP. CUSSP operates on cardiac imaging slices of the 4-chamber view of
the heart. It uses standard computer vision techniques and contrastive models
to learn from large amounts of unlabeled data, in conjunction with specialized
classifiers to establish the first ever automated MR classification system.
Evaluated on a test set of 179 labeled -- 154 non-MR and 25 MR -- sequences,
CUSSP attains an F1 score of 0.69 and a ROC-AUC score of 0.88, setting the
first benchmark result for this new task. | [
"Ke Xiao",
"Erik Learned-Miller",
"Evangelos Kalogerakis",
"James Priest",
"Madalina Fiterau"
] | 10.1007/978-3-031-43990-2_23 | [
{
"@title": "doi",
"@href": "http://dx.doi.org/10.1007/978-3-031-43990-2_23",
"@rel": "related",
"@type": null
},
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04871v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04871v1",
"@rel": "related",
"@type": "application/pdf"
}
] | [
"In: Medical Image Computing and Computer Assisted Intervention -\n MICCAI 2023. pp. 236-246 (2023)"
] | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "eess.IV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"eess.IV",
"cs.CV",
"cs.LG",
"I.4.0; I.2.10"
] | 3
2
0
2
t
c
O
7
]
V
I
.
s
s
e
e
[
1
v
1
7
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Machine Learning for Automated Mitral
Regurgitation Detection from Cardiac Imaging
Ke Xiao1, Erik Learned-Miller1, Evangelos Kalogerakis1, James Priest2, and
Madalina Fiterau1
1 University of Massachusetts Amherst, Amherst MA 01003, USA
{kexiao,elm,kalo,mfiterau}@cs.umass.edu
2 Stanford University, Stanford CA 94305, USA
jpriest@stanford.edu
Abstract. Mitral regurgitation (MR) is a heart valve disease with po-
tentially fatal consequences that can only be forestalled through timely
diagnosis and treatment. Traditional diagnosis methods are expensive,
labor-intensive and require clinical expertise, posing a barrier to screen-
ing for MR. To overcome this impediment, we propose a new semi-
supervised model for MR classification called CUSSP. CUSSP operates
on cardiac imaging slices of the 4-chamber view of the heart. It uses
standard computer vision techniques and contrastive models to learn
from large amounts of unlabeled data, in conjunction with specialized
classifiers to establish the first ever automated MR classification system.
Evaluated on a test set of 179 labeled – 154 non-MR and 25 MR – se-
quences, CUSSP attains an F1 score of 0.69 and a ROC-AUC score of
0.88, setting the first benchmark result for this new task.
1
Introduction
Mitral regurgitation. Mitral regurgitation (MR) [7] is a valvular heart disease in
which the mitral valve does not close completely during systole when the left
ventricle contracts, causing regurgitation – leaking of blood backwards – from the
left ventricle (LV), through the mitral valve, into the left atrium (LA) – Figure 1.
MR can be caused by either organic or functional mechanisms [6], with organic
MR leading to atrial and annular enlargement and functional MR increasing
atrial pressure. As MR progresses, it may cause arrhythmia, shortness of breath,
heart palpitations and pulmonary hypertension [14]. Left undiagnosed and un-
treated, MR may cause significant hemodynamic instability and congestive heart
failure which can lead to death [17], while acute MR usually necessitates imme-
diate medical intervention [22]. Thus, early detection and assessment of MR are
crucial for optimal treatment outcomes, with the best short-term and long-term
results obtained in asymptomatic patients operated on in advanced repair centers
with low operative mortality (< 1%) and high repair rates (≥ 80 − 90%) [7].
MR diagnosis. MR is often only detected following symptom onset. Among pa-
tients with asymptomatic MR, quantitative grading of mitral regurgitation is a
2
K. Xiao et al.
Fig. 1. Three cardiovascular magnetic resonance (CMR) images showing the long-axis
four-chamber view of the heart. Left: a heart with normal mitral valve. Middle: a heart
with normal mitral valve when the valve leaflets are open. Right: a heart with mitral
regurgitation. The red dotted line denotes the mitral valve.
powerful indicator for clinical treatment such as immediate cardiac surgery [8].
Clinically, MR is usually diagnosed with doppler echocardiography, with car-
diovascular magnetic resonance (CMR) subsequently used to assess the MR
severity and to accurately quantify the regurgitant volume, one of the indicators
of severity [20]. Most studies that have evaluated CMR for assessing the mi-
tral regurgitant volume use the difference between left ventricular stroke volume
(LVSV) and forward stroke volume (FSV). LVSV is usually estimated with the
short-axis (SA) view CMR – a 4-D tensor – while FSV is most commonly de-
termined by aortic phase-contrast velocity-encoding images [20]. This diagnosis
and assessment process requires continuous involvement from expert clinicians
along with specific order and post-processing for the phase-contrast images of
the proximal aorta or main pulmonary artery during the acquisition of the CMR
data. The associated expense with this standard diagnostic procedure thus poses
an obstacle to the large-scale screening for MR in the general population.
Toward machine learning for MR diagnosis. Although quantitatively assessing
mitral regurgitant volume requires specific CMR imaging sequences and expert
analysis, four-chamber (4CH) CMR images provide a comprehensive view of all
four heart chambers, including the mitral valve as it opens and closes, as shown
in Figure 1. Thus, we propose to train a model that uses 4CH CMR to automati-
cally diagnose MR, making wide screening possible. As training data, we use the
long axis 4CH CMR imaging data from the UK Biobank [1], from over 30,000
subjects, out of which N=704 were labeled by an expert cardiologist. While the
4CH view has the potential to identify MR when the regurgitant jet is visible,
the imaging is not accompanied by comprehensive annotations or diagnoses of
diseases/conditions for individual patients. To overcome this difficulty, we rely on
weakly supervised and unsupervised methods. Weakly supervised deep learning
has proved successful in detecting other heart pathologies. Specifically, Fries et
al. [9] proposed a weakly supervised deep learning method (CNN-LSTM) to clas-
sify aortic valve malformation from the aortic valve cross section CMR present in
the UK Biobank, wherein the critical feature of the aortic valve opening shape
was easily extracted from the aortic valve cross section CMR imaging data.
Automated MR Detection from Cardiac Imaging
3
Meanwhile, Vimalesvaran et al. [21] proposed a deep learning based pipeline for
detecting aortic valve pathology using 3CH CMR imaging from three hospitals.
The data set was fully annotated with landmarks, stenotic jets and regurgitant
jets. Unlike these prior two studies, we faced the challenge of extracting complex
mitral valve regurgitant features from 4CH CMR images with no annotations
for landmarks, regurgitant jets or easily extractable features, and only a small
amount of binary MR labels. To the best of our knowledge, this is the first study
on identifying MR using the 4CH CMR imaging data in an automated pipeline.
Our approach. We propose an automated five stage pipeline named Cardio-
vascular magnetic resonance U-Net localized Self-Supervised Predictor (CUSSP).
Our approach incorporates several different preexisting neural network architec-
tures in the pipeline, discussed in Section 2.2.3, to address the challenges inherent
to the MR classification task. Specifically, we use a U-Net [18] to perform seg-
mentation of the heart chambers, which we then use to localize the area around
the mitral valve. We apply histogram equalization to enhance the appearance
of the valve. We then use a Barlow Twins [26] network to learn, without su-
pervision, representations of the blood flow around the valve, and a Siamese
network [25] to learn differences between instances of MR and non-MR. During
training, CUSSP leverages a large amount of unlabeled CMR images, and mini-
mal supervision, in the form of a comparatively small set of MR labels manually
annotated by cardiologist. However, at test time CUSSP is fully automated.
Contribution. Our work is the first study on automated detection of mitral re-
gurgitation (MR), providing a benchmark for the classification of MR in an
automated pipeline from long axis 4CH CMR images. Used as a screening tool,
it has the potential to support hospital diagnostics and improve patient care.
2 Methods
2.1 Segmentation of the cardiac magnetic resonance images
The CMR imaging data from the UK Biobank that is relevant to MR detection
includes long-axis 2-chamber (2CH) view and long-axis 4-chamber (4CH) view,
which are all shown in Figure 2. In addition, the short-axis view CMR provides
accurate description of the left ventricle. Both long-axis views and short-axis
view are used to estimate heart measurements relevant to the MR detection
task, while only the long-axis 4CH view is used for the deep learning models.
As a pre-processing step, we performed semantic segmentation on the CMR
imaging data, using masks (Figure 2) generated by a U-Net [18] segmentation
model to highlight regions of interest to MR classification. U-Net is currently
the leading model architecture for medical imaging segmentation, with various
U-Net variants developed for different applications. TernausNet [12] is a U-Net
variant that reshapes the U-Net encoder to match the VGG11 architecture, al-
lowing it to use pre-trained VGG11 [19] model weights for faster convergence
and improved segmentation results. While most medical imaging segmentation
4
K. Xiao et al.
models are trained using supervised learning, weakly supervised segmentation
methods such as VoxelMorph augmented segmentation [27], ACNN [16], CCNN
[13], graph-based unsupervised segmentation [15], and GAN-based unsupervised
segmentation [23,24] also produce comparable segmentation results. For the seg-
mentation of the 4CH, 2CH, SA, and aorta view CMR imaging dataset from the
UK Biobank, Bai et al. [2] offer a supervised segmentation model.
Fig. 2. Example of the segmentation outputs of the long axis 4CH (left), 2CH (middle)
CMR view imaging data and the short axis (right) CMR imaging data.
We manually labeled 100 CMR images for each view and trained a supervised
segmentation model with the TernausNet [12] architecture. Then, segmentation
outputs, shown in Figure 2, are used to compute measurements of cardiac struc-
ture and function for the four chambers of the heart, as summarized in Table 1.
The short-axis view CMR segmentation output is used to estimate the left ven-
tricle and right ventricle measurements, while the long-axis 4CH view and 2CH
view outputs are used to estimate the left atrium and right atrium measure-
ments. Specifically, the left atrial volume is estimated using the biplane method
with segmentation of both the 2CH and 4CH view, while the right atrial volume
is estimated using single plane method with segmentation of the 4CH view.
2.2 Three MR classification models
We consider two baseline models, random forests (Section 2.2.1) and a CNN-
LSTM (Section 2.2.2). We then present our CUSSP model in Section 2.2.3.
2.2.1 Random forest baseline We first considered a random forest (RF)
classifier [3] trained for MR classification on the tabular heart measurements
derived from the semantic segmentation masks, as described in Section 2.1. We
divided the 18 features by body surface area (BSA) prior to training the RF.
Left Atrium
Vol Max (mL)
Volume Min (mL)
Stroke Vol (mL)
Ejection Fraction (%) Ejection Fraction (%) Ejection Fraction (%)
Right Atrium
Vol Max (mL)
Vol Min (mL)
Stroke Vol (mL)
Left Ventricle
End-Systolic Vol (mL) End-Systolic Vol (mL)
End-Diastolic Vol (mL) End-Diastolic Vol (mL)
Stroke Vol (mL)
Stroke Vol (mL)
Ejection Fraction (%)
Right Ventricle
Table 1. Cardiac measurements derived from the semantic segmentation of the CMR.
Cardiac Output (L/min)
Mass (g)
Automated MR Detection from Cardiac Imaging
5
2.2.2 Weakly supervised CNN-LSTM baseline
Conceptualization. The first deep learning model for MR classification we devel-
oped is a weakly supervised CNN-LSTM following the principles in Fries et al. [9]
and operating on the 4CH CM imaging data. Fries et al. [9] used CMR imag-
ing sequences from the UK Biobank, however, the objective of their work was
the identification of aortic valve malformations. Their proposed deep learning
architecture – CNN-LSTM – used DenseNet [11] as the CNN of choice to encode
CMR imaging frames and the LSTM to encode embeddings of all frames within
each sequence for a final classification of aortic valves into tricuspid (normal)
and bicuspid (pathological). We point out that our MR classification problem is
considerably more challenging. We hypothesize this difficulty is due to the lack
of direct view of the mitral valve in the CMR imaging data. Moreover, the flow
information provided from the 4CH view CMR imaging data is difficult to learn
and encode in the model, an issue which we alleviated in the CUSSP framework.
Fig. 3. Overview of the CNN-LSTM method pipeline for MR classification.
Test-time pipeline. The CNN-LSTM pipeline, shown in Figure 3 includes an
image segmentation model, and an image classification model. It uses the 4CH
CMR from the UK Biobank. The CMR data is center-cropped using the center
of mass of the CMR imaging frames. The resulting sequence provided to the
CNN-LSTM, which generates probabilistic labels of MR for the sample.
Training process. In the CNN-LSTM model architecture, the CNN serves as the
frame encoder, which encodes each frame of each sequence into a representation
vector. The model uses DenseNet-121 pre-trained on ImageNet as the CNN. To
better learn the attention span of the frame encoder, we added an attention layer
to the DenseNet-121 after the first convolutional layer. After the bi-directional
LSTM, a multi-layer perceptron (MLP) performs the final classification.
Center CropProbabilistic labelsAttention-added DenseNet-LSTM model4CH ImagesMaskingSegmentationConvolutionConvolutionPoolingAttention Layerx4Encoded Frame feature vectorsLSTM6
K. Xiao et al.
2.2.3 The CUSSP framework
Conceptualization. To better encode the blood flow information relevant to MR
classification from the 4CH CMR view, we investigated self-supervised represen-
tation learning methods which can leverage all the unlabeled CMR sequences
present in the UK Biobank. Typically, self-supervised representation learning for
visual data involves maximizing the similarity between representations of various
distorted versions of a sample. Among the many self-supervised architectures,
SimCLR [5], SwAV [4], and BYOL [10], we chose Barlow Twins [26], since it does
not require large batches. With the labeled data, our siamese network compares
the representation differences between classes by sampling two inputs from dif-
ferent classes as performed in [25]. Thus, our CUSSP MR classification pipeline
takes advantage of both self-supervised and supervised representation learning.
Test-time pipeline. Our CUSSP method consists of five main steps, shown in
Figure 4, with the first two steps representing data preprocessing, and the later
three steps using network components trained for MR classification, as described
in the next section. The pre-processing of the CMR imaging sequence is shown in
Figure 8 in the Appendix. We used the segmentation model in 2.1 to locate the
mitral valve and the orientation of the left ventricle. We then cropped a square
patch with the mitral valve at its center positioned horizontally. After cropping,
we applied histogram equalization to the patch with the pixel intensity range of
the left atrium. The resulting patches are used by the downstream networks.
Fig. 4. Overview of the CUSSP pipeline for MR classification, with its 5 steps: (1)
segmentation, (2) localization, (3) cropping, (4) equalization, and (5) prediction.
Training process. The first step involves training a representation encoder in
a Barlow Twins network using over 30,000 unlabeled pre-processed sequences.
ResNet-18 with an output dimension of 512 is used as the encoder, with hidden
Segmentation ModelLocalization algorithmCroppingHistogram EqualizationembeddingEmpirical cross-corrprojectorprojectorembeddingBarlow Twins NetworkContrastive lossrepresentationrepresentationSiamese NetworkMLPResNet18predictionMLP ClassifierResNet18ResNet18ResNet18ResNet184CH CMR ImagesAutomated MR Detection from Cardiac Imaging
7
dimension and the projector output dimensions being 2048. After training the
encoder with the unlabeled dataset, it is fine-tuned in a siamese network using
a comparatively smaller labeled set, as indicated in 3.1. During training, two
sequences are sampled from the labeled dataset, with the first being non-MR
and the second being either MR or non-MR. The two sequences are passed
through the representation encoder to obtain embeddings, which are then used
to calculate the contrastive loss. The model is trained to maximize contrastive
loss when the two samples are non-MR and MR and to minimize it when both are
non-MR. Once the representation encoder is fine-tuned in the siamese network,
it is combined with a 3-layer multi-layer perceptron (MLP) network to form a
classifier, which is trained on the same labeled dataset. To improve computation
efficiency and training accuracy, we also tested the framework using a smaller
window of 25 frames, since MR occurs between diastole and systole.
3 Experiments
3.1 Experimental setup
Data splitting. 4CH CMR images were used to conduct experiments with both
the CNN-LSTM method and the CUSSP method. We used a total of 704 labeled
sequences, with 525 sequences selected for the training set, including 452 labeled
as non-MR and 73 labeled as MR. The remaining 179 sequences were used for
testing, with 154 labeled as non-MR and 25 labeled as MR.
Evaluation metrics. Considering the substantial class imbalance, we opted to use
F1 score as our primary evaluation metric, along with precision and recall.
3.2 Random Forest Classification Results
The random forest model is trained with 10-fold cross validation, with a ran-
dom search over a parameter grid of n_estimators(10 − 100), max_depth(2 −
16), max_f eatures(sqrt, log2), min_samples_leaf (2 − 8). The optimal hyper-
parameter setting found is: n_estimators = 20, max_f eatures = log2, max_depth =
8, min_samples_leaf = 2. The best results obtained are presented in Table 2.
Pos. Acc Neg. Acc Precision Recall F1 AUC
Model
0.14 0.58
0.09
RF
0.09
0.44 0.72
0.53
CNN-LSTM
0.53
0.32 0.65
0.38
CUSSP-1
0.38
0.27 0.63
0.29
CUSSP-2
0.29
0.36 0.66
0.38
CUSSP-3
0.38
0.55
CUSSP-SIAM
0.60 0.80
0.55
0.62 0.69 0.88
CUSSP-SIAM-25 0.62
0.99
0.86
0.87
0.87
0.90
0.96
0.96
0.43
0.45
0.29
0.25
0.35
0.66
0.8
Table 2. Experimental results for Random Forest (RF) baseline, CNN-LSTM and
CUSSP. CUSSP-1, CUSSP-2 and CUSSP-3 are trained with the BarlowTwins-MLP
model without fine-tuning with the Siamese network. CUSSP-SIAM and CUSSP-
SIAM-25 are trained with the BarlowTwins-Siamese-MLP model.
8
K. Xiao et al.
3.3 CNN-LSTM Classification Results
We conducted experiments on the DenseNet-LSTM classification model using
various input image sizes, attention layer configurations, and masks. The best
CNN-LSTM model attains a F1-score of 0.44, shown in Table 2, with further in-
formation on the performance under other settings summarized in the Appendix.
3.4 CUSSP Classification Results
We evaluated various configurations of the CUSSP model, to determine the
relative benefits of different components. In the first configuration, the ResNet18
model was combined with a 3-layer MLP to train a classifier using the labeled
training set after being trained in the Barlow-Twins network with the unlabeled
dataset. During the classifier training, the cross-correlation loss from the Barlow-
Twins network and the cross-entropy loss from the binary classification were
weighted using three different configurations. For CUSSP-1 the cross-correlation
loss has a weight of 0.9, while the cross-entropy loss has a weight of 0.1. For
CUSSP-2, the weights are 0.5 and 0.5, while for CUSSP-3 they are 0.1 and 0.9,
respectively. Both CUSSP-1 and CUSSP-3 outperform CUSSP-2, though the
performance is low, indicating the importance of fine-tuning, described below.
In the second scenario, we fine-tuned the encoder with a siamese network
to enhance the quality of the encoded representations after training the Barlow
Twins network. To prevent overfitting of the model and to limit its capacity,
we froze the parameters of all layers except the last block of the ResNet18 en-
coder when training the siamese network and the classifier. The resulting model,
CUSSP-SIAM, showed a significant improvement in performance. In the final
configuration CUSSP-SIAM-25, the number of frames in the training sequences
was truncated from 50 frames to the 25 frames that correspond to the interval
when mitral regurgitation occurs. The results are summarized in Table 2, while
the ROC-AUC curve for CUSSP-SIAM-25 are shown in Figure 5.
Fig. 5. The ROC AUC curve and the precision-recall curve of CUSSP. The annotated
coordinates on the precision-recall curve plot are (recall, precision, f1-score, threshold).
Automated MR Detection from Cardiac Imaging
9
4 Conclusion
We present the world's first automated mitral regurgitation classification system.
The CUSSP model we developed, trained with limited supervision, operates on
4CH CMR imaging sequences and attains an F1 score of 0.69 and an ROC AUC
of 0.88, opening up the opportunity for large-scale screening for MR.
References
1. Allen, N.E., Sudlow, C., Peakman, T., Collins, R., null null: Uk biobank data:
Come and get it. Science Translational Medicine 6(224), 224ed4–224ed4 (2014).
https://doi.org/10.1126/scitranslmed.3008601, https://www.science.org/
doi/abs/10.1126/scitranslmed.3008601
2. Bai, W., Sinclair, M., Tarroni, G., Oktay, O., Rajchl, M., Vaillant, G., Lee, A.M.,
Aung, N., Lukaschuk, E., Sanghvi, M.M., et al.: Automated cardiovascular mag-
netic resonance image analysis with fully convolutional networks. Journal of Car-
diovascular Magnetic Resonance 20(1), 1–12 (2018)
3. Breiman, L.: Random forests. Machine learning 45, 5–32 (2001)
4. Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., Joulin, A.: Unsupervised
learning of visual features by contrasting cluster assignments. Advances in neural
information processing systems 33, 9912–9924 (2020)
5. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for con-
trastive learning of visual representations. In: International conference on machine
learning. pp. 1597–1607. PMLR (2020)
6. Dziadzko, V., Dziadzko, M., Medina-Inojosa, J.R., Benfari, G., Michelena, H.I.,
Crestanello, J.A., Maalouf, J., Thapa, P., Enriquez-Sarano, M.: Causes and mech-
anisms of isolated mitral regurgitation in the community: clinical context and out-
come. European heart journal 40(27), 2194–2202 (2019)
7. Enriquez-Sarano, M., Akins, C.W., Vahanian, A.: Mitral regurgitation. The Lancet
373(9672), 1382–1394 (2009)
8. Enriquez-Sarano, M., Avierinos, J.F., Messika-Zeitoun, D., Detaint, D., Capps, M.,
Nkomo, V., Scott, C., Schaff, H.V., Tajik, A.J.: Quantitative determinants of the
outcome of asymptomatic mitral regurgitation. New England Journal of Medicine
352(9), 875–883 (2005)
9. Fries, J.A., Varma, P., Chen, V.S., Xiao, K., Tejeda, H., Saha, P., Dunnmon, J.,
Chubb, H., Maskatia, S., Fiterau, M., et al.: Weakly supervised classification of
aortic valve malformations using unlabeled cardiac mri sequences. Nature commu-
nications 10(1), 1–10 (2019)
10. Grill, J.B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Do-
ersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., et al.: Bootstrap your own
latent-a new approach to self-supervised learning. Advances in neural information
processing systems 33, 21271–21284 (2020)
11. Huang, G., Liu, Z., Van Der Maaten, L., Weinberger, K.Q.: Densely connected
convolutional networks. In: Proceedings of the IEEE conference on computer vision
and pattern recognition. pp. 4700–4708 (2017)
12. Iglovikov, V., Shvets, A.: Ternausnet: U-net with vgg11 encoder pre-trained on
imagenet for image segmentation. arXiv preprint arXiv:1801.05746 (2018)
13. Kervadec, H., Dolz, J., Tang, M., Granger, E., Boykov, Y., Ayed, I.B.: Constrained-
cnn losses for weakly supervised segmentation. Medical image analysis 54, 88–99
(2019)
10
K. Xiao et al.
14. Mirabel, M., Iung, B., Baron, G., Messika-Zeitoun, D., Détaint, D., Vanoverschelde,
J.L., Butchart, E.G., Ravaud, P., Vahanian, A.: What are the characteristics of
patients with severe, symptomatic, mitral regurgitation who are denied surgery?
European heart journal 28(11), 1358–1365 (2007)
15. Nian, Y., Li, M., Cui, H., Hu, X., Xie, B., Li, K., Xiong, X., Xiao, J., Chen, W.:
Graph-based unsupervised segmentation for lung tumor ct images. In: 2017 3rd
IEEE International Conference on Computer and Communications (ICCC). pp.
1884–1888. IEEE (2017)
16. Oktay, O., Ferrante, E., Kamnitsas, K., Heinrich, M., Bai, W., Caballero, J., Cook,
S.A., De Marvao, A., Dawes, T., O'Regan, D.P., et al.: Anatomically constrained
neural networks (acnns): application to cardiac image enhancement and segmen-
tation. IEEE transactions on medical imaging 37(2), 384–395 (2017)
17. Parcha, V., Patel, N., Kalra, R., Suri, S.S., Arora, G., Arora, P.: Mortality due to
mitral regurgitation among adults in the united states: 1999-2018. In: Mayo Clinic
Proceedings. vol. 95, pp. 2633–2643. Elsevier (2020)
18. Ronneberger, O., Fischer, P., Brox, T.: U-net: Convolutional networks for biomedi-
cal image segmentation. In: International Conference on Medical image computing
and computer-assisted intervention. pp. 234–241. Springer (2015)
19. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale
image recognition. arXiv preprint arXiv:1409.1556 (2014)
20. Uretsky, S., Argulian, E., Narula, J., Wolff, S.D.: Use of cardiac magnetic reso-
nance imaging in assessing mitral regurgitation: current evidence. Journal of the
American College of Cardiology 71(5), 547–563 (2018)
21. Vimalesvaran, K., Uslu, F., Zaman, S., Galazis, C., Howard, J., Cole, G., Bharath,
A.A.: Detecting aortic valve pathology from the 3-chamber cine cardiac mri view.
In: Medical Image Computing and Computer Assisted Intervention–MICCAI 2022:
25th International Conference, Singapore, September 18–22, 2022, Proceedings,
Part I. pp. 571–580. Springer (2022)
22. Watanabe, N.: Acute mitral regurgitation. Heart 105(9), 671–677 (2019)
23. Wu, X., Bi, L., Fulham, M., Feng, D.D., Zhou, L., Kim, J.: Unsupervised brain tu-
mor segmentation using a symmetric-driven adversarial network. Neurocomputing
455, 242–254 (2021)
24. Wu, X., Bi, L., Fulham, M., Kim, J.: Unsupervised positron emission tomography
tumor segmentation via gan based adversarial auto-encoder. In: 2020 16th Inter-
national Conference on Control, Automation, Robotics and Vision (ICARCV). pp.
448–453. IEEE (2020)
25. Xing, Z.J., Yin, F., Wu, Y.C., Liu, C.L.: Offline signature verification using convo-
lution siamese network. In: Ninth International Conference on Graphic and Image
Processing (ICGIP 2017). vol. 10615, pp. 415–423. SPIE (2018)
26. Zbontar, J., Jing, L., Misra, I., LeCun, Y., Deny, S.: Barlow twins: Self-supervised
learning via redundancy reduction. In: International Conference on Machine Learn-
ing. pp. 12310–12320. PMLR (2021)
27. Zhao, A., Balakrishnan, G., Durand, F., Guttag, J.V., Dalca, A.V.: Data augmen-
tation using learned transformations for one-shot medical image segmentation. In:
Proceedings of the ieee/cvf conference on computer vision and pattern recognition.
pp. 8543–8553 (2019)
Automated MR Detection from Cardiac Imaging
11
Appendix
Fig. 6. Overview of the dataset. Top: Example of the long axis 4CH (left), 2CH (mid-
dle) CMR view imaging data and the short axis (right) CMR imaging data. Bottom:
Example of the segmentation outputs of the long axis 4CH (left), 2CH (middle) CMR
view imaging data and the short axis (right) CMR imaging data.
Fig. 7. Detailed overview of the CNN-LSTM method pipeline for MR classification.
Center of MassInput: 4CH50x50x50xCenter CropConvolutionConvolutionPoolingAttention Layerx4Encoded Frame feature vectorsLSTM50xProbabilistic labelsAttention-added DenseNet-LSTM modelP = 0.2038329P = 0.3453742P = 0.7440756650xMasked CMRCropped Masked CMRSegmentation ModelSegmented MasksOutput12
K. Xiao et al.
Fig. 8. Detailed overview of the pre-processing steps for CUSSP. Top: Example of the
4CH CMR images in the original contrast (left), the left atrium histogram equalized
contrast (middle), and the cropped patch histogram equalized contrast (right), with
blue contours outline the left atrium, and the red square boxes outline the patch to
crop. Bottom: Example of the cropped mitral valve patch as outlined in the red square
boxes in the top row.
Fig. 9. The model training stage of the CUSSP method contains three steps: (i) the
feature encoder is trained in the Barlow-Twins network with unlabeled imaging data
set, (ii) the feature encoder is fine-tuned in a siamese network with labeled imaging
data set, and (iii) the feature encoder is assembled with a MLP, then trained with
labeled imaging data set for the classification task of MR.
ResNet18embeddingEmpirical cross-corrProjectorContrastive lossStep 1Step 2embeddingrepresentationpredictionStep 3Barlow Twins networkSiamese networkClassifierProjectorMLPResNet18ResNet18ResNet18ResNet18representation |
http://arxiv.org/abs/2310.04870v2 | "2023-10-10T03:54:36" | "2023-10-07T16:44:53" | Lemur: Integrating Large Language Models in Automated Program
Verification | The demonstrated code-understanding capability of LLMs raises the question of
whether they can be used for automated program verification, a task that often
demands high-level abstract reasoning about program properties, which is
challenging for verification tools. We propose a general methodology to combine
the power of LLMs and automated reasoners for automated program verification.
We formally describe this methodology as a set of derivation rules and prove
its soundness. We instantiate the calculus as a sound automated verification
procedure, which led to practical improvements on a set of synthetic and
competition benchmarks. | [
"Haoze Wu",
"Clark Barrett",
"Nina Narodytska"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04870v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04870v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.FL",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.FL",
"cs.AI",
"cs.LG",
"cs.LO"
] | 3
2
0
2
t
c
O
0
1
]
L
F
.
s
c
[
2
v
0
7
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Under submission
LEMUR:
IN AUTOMATED PROGRAM VERIFICATION
INTEGRATING LARGE LANGUAGE MODELS
Haoze Wu
Department of Computer Science
Stanford University
haozewu@stanford.edu
Nina Narodytska
VMware Research
n.narodytska@gmail.com
Clark Barrett
Department of Computer Science
Stanford University
barrett@cs.stanford.edu
ABSTRACT
The demonstrated code-understanding capability of LLMs raises the question of
whether they can be used for automated program verification, a task that often de-
mands high-level abstract reasoning about program properties that is challenging
for verification tools. We propose a general methodology to combine the power of
LLMs and automated reasoners for automated program verification. We formally
describe this methodology as a set of derivation rules and prove its soundness. We
instantiate the calculus as a sound automated verification procedure, which led to
practical improvements on a set of synthetic and competition benchmarks.
1
INTRODUCTION
AI-powered language models are being routinely used to help developers with their tasks. Examples
include program synthesis from natural language descriptions by GPT-4 (OpenAI, 2023) or Github
Copilot (Chen et al., 2021; GitHub, 2021), solving competitive programming problems with Alpha-
Code (Li et al., 2022), and repairing code by DeepRepair (White et al., 2019), among others. These
models have shown impressive results in generating correct code in many programming languages.
An important research question is whether modern AI models are capable of understanding the
logic behind the programs they analyze. Recently, several approaches have been proposed to com-
bine the strengths of formal verification and Large Language Models (LLMs) that demonstrate such
capabilities. For example, Pei et al. (2023) made an important step in this direction by investigat-
ing whether LLMs can generate program properties, namely, program invariants, which remains a
crucial and challenging task for automated program verification (Clarke et al., 2018). The authors
demonstrated that LLMs are effective in generating program invariants on a set of synthetic Java
programs. Another example is the recent work by Charalambous et al. (2023), who demonstrated
that LLM models can be used to repair vulnerabilities in code, given examples of incorrect behavior.
They provided compelling evidence of the complementary strengths of LLMs, which serve as a gen-
erator for code repair snippets, and formal techniques, which are used to check the correctness of the
generated code. While previous work shows promise in program analysis tasks, they do not provide
a formalization of the interaction between LLMs and formal verifiers; require manual efforts, or are
limited to the invariant generation process as a stand-alone procedure.
In this work, we propose a novel LLM-powered framework, LEMUR, for automated program verifi-
cation tasks. Our key insight is to combine LLMs' ability to perform abstract high-level reasoning
and automated reasoners' ability to perform precise low-level reasoning. Specifically, LLMs are em-
ployed to propose program invariants in the form of sub-goals, which are then checked by automated
reasoners. This transforms the program verification tasks into a series of deductive steps suggested
by LLMs and subsequently validated by automated reasoners. Our main contributions are:
• a novel framework to combine LLMs and automated reasoners for program verification;
1
Under submission
• a presentation of LEMUR as a proof system and a proof of its soundness, which to the best of our
knowledge, is the first formalization of such a hybrid approach;
• an instantiation of the LEMUR calculus that gives a sound and terminating algorithm;
• an implementation of the proposed framework (using OpenAI's GPT models) and several opti-
mizations to enhance its practical efficiency;
• an experimental evaluation of LEMUR on two sets of benchmarks that demonstrates its efficiency
compared with both existing AI-powered and conventional verification tools.
2 DEFINITIONS
Given a program P : Prog, a reachability property, or simply property, is a tuple p = ⟨φ, l⟩, where
φ : Pred is a Boolean predicate of the program state and l : N is a program line. The negation of p,
denoted ¬p, is defined as ⟨¬φ, l⟩. Next we introduce several useful definitions and their properties.
Definition 2.1. A property p = ⟨φ, l⟩ is an invariant on P, denoted Inv(P, p), iff p holds (i.e., φ
always evaluates to true at line l) for all possible executions of the program P.
Example 2.1. Consider a simple program P on Figure 2 (the first frame, top row). P instantiates
an unsigned 32-bit integer variable x to 0 and increases its value by 4 on each loop iteration. A
property p = ⟨φ, l⟩ is specified on the 4th line, so φ = (x != 30) and l = 4 for this property. It is
easy to see that p is an invariant as x is not divisible by 3, for example. ■
Next, we introduce a notion of assumption on a program P. An assumption q = ⟨φ, l⟩ is a property
that is assumed in a program by altering a program behavior.
Definition 2.2. An assumption q = ⟨φ, l⟩ is a property that modifies the program as follows
1. if φ holds at line l then the program P continues execution without changes;
2. if φ does not hold at line l then P terminates at l.
We use P ′ = Asm(P, q) to denote a modification of P with the assumption q. An assumption can
itself be an invariant. We now introduce a special notion of an implication.
Definition 2.3. Let P be a program, and p, q be properties on P. We say that q implies p with
respect to P, denoted q −→
P
p, iff p is an invariant in Asm(P, q).
Example 2.2. Consider the program P on Figure 2 and an assumption q = ⟨φ = (x%4==1), l = 3⟩
that modifies the original program P, giving P ′ = Asm(P, q). The first frame in the bottom row
of Figure 2 depicts P ′. To see a difference between P and P ′, we observe that the loop is executed
only once in P ′: x=0 when it enters the loop so (x%4)!=1, the φ is violated, and P ′ terminates.
If we consider an alternative assumption q′ = ⟨φ = (x%2==0), l = 3⟩ The second frame at the top
depicts P ′ for q′. We can see that its predicate φ holds for all executions. Hence, q′ is an invariant
for the original program P. Finally, we can see q′ −→
P
p, where p is from Example 2.1. ■
The following propositions follow from the definitions above.
Proposition 2.1. Let P be a program, and p, q be properties on P:
• The property p is an invariant on P if q is an invariant on P and q implies p with respect
to P. More formally, (Inv(P, q) ∧ q −→
P
p) ⇒ Inv(P, p).
• The property p is not an invariant on P if the property p is not an invariant on P ′ =
Asm(P, q). More formally, ¬Inv(P, q) ⇒ ¬Inv(P ′, p).
Proposition 2.2. For any property p on a program P, p −→
P
p.
Proposition 2.3. For any properties p, q, r on a program P, p −→
P
q and q −→
P
r, then p −→
P
r.
Note that it is possible that neither a property p nor its negation ¬p holds on a program.
Example 2.3. Consider again our example from Example 2.1 and two properties at line 3: p =
⟨φ = (x%8==4), l = 3⟩ and p′ = ⟨φ′ = (x%8!=4), l = 3⟩. Neither p nor p′ is an invariant in P.
On the first loop iteration, we have that x=0 before line 3 so φ′ holds and φ does not at line 3. On
the second loop iteration, we have that x=4 before line 3 so φ holds and φ′ does not. ■
2
Under submission
Definition 2.4. A property p = ⟨φ, l⟩ is stable for P, denoted S(P, p), if, for each execution of the
program, either φ always evaluates to true at line l or φ always evaluates to false at line l.
An invariant must be stable, but a property that is not an invariant might still be stable. For example,
any property on a program without loops is stable. If a p is stable, then ¬p is also stable.
Lemma 2.1. Consider a program P, two properties p, q on P, and a program P ′ = Asm(P, q).
The property p is an invariant on P, if 1) q is stable for P; 2) q implies p with respect to P; and 3)
¬q implies p with respect to P. More formally: S(P, q) ∧ (q −→
P
p) ∧ (¬q −→
P
p) ⇒ Inv(P, p).
Proof. In App. B.
Assume we have a verifier V : Prog ×P(Prop) × Prop (cid:55)→ {TRUE, FALSE, UNKNOWN}, which
takes as inputs a program P, a set of assumptions A and a property p, and checks whether A
implies p. More precisely, given set of assumption A = {q1, . . . , qn} we construct a new program
P ′ = Asm(Asm((. . . , Asm(P, q1)), qn−1), qn) and the verifier checks if p is an invariant in this
program. Hence, a statement that A implies p on P means that p is an invariant in P ′. V is sound,
meaning if V returns TRUE, then A implies p, and if V returns FALSE, then A does not imply p.
Note that A can be empty, in which case the verifier essentially checks whether p is an invariant in
general. When the verifier V returns TRUE, we say p is proven; and when V returns FALSE, we say
the property is falsified. V is incomplete, meaning that V can return UNKNOWN.
In practice, V is instantiated as automated program verifiers such as CBMC (Kroening &
Tautschnig, 2014), ESBMC (Gadelha et al., 2018), and UAUTOMIZER (Heizmann et al., 2013). We
provide an overview of the main techniques that these tools employ in Section A and note here that
a crucial challenge shared across existing verifiers is the automatic decomposition of a verification
task into smaller, more manageable sub-tasks. This decomposition requires high-level reasoning that
is difficult to automate using conventional formal methods, but plausible to be performed by LLMs,
with their documented code-understanding capability. However, we must ensure soundness when
LLMs are used to automatically perform this high-level reasoning in program verification tasks.
3
LEMUR: INTEGRATING LLMS IN PROGRAM VERIFICATION
We present a proof system LEMUR that combines LLMs and automated reasoners for proving a
property on a program. The calculus operates over a configuration, which is either one of the dis-
tinguished symbols {SUCCESS, FAIL} or a tuple ⟨P, A, M⟩, where P is a program, A is either ∅
or a singleton representing the assumption, and M is a list of properties referred to as proof goals.
M itself is referred to as a trail. The last element of M represents the current property to prove.
The rules describe the conditions under which a certain configuration can transform into another
configuration. In this calculus, verifying whether Inv(P, p) holds, boils down to finding a sequence
of valid rule applications from the starting configuration ⟨P, ∅, [p]⟩ to either SUCCESS or FAIL.
Our calculus performs oracle calls to LLMs to propose new properties and revise them. The oracle
Opropose proposes new properties for a given program and the current proof goal as inputs. Namely,
Opropose : Prog × Prop (cid:55)→ P(Prop). An important insight here is that LLMs are capable of gener-
ating new properties that are likely to 1) be invariants, and 2) imply the proof goal given a prompt.
We will discuss strategies to generate prompts in Section 4. Importantly, properties generated by an
LLM are treated as assumptions until we can prove that they are invariants of the original program.
The oracle Orepair revises previously proposed properties. e.g.
if we determine that a property q
previously produced by Opropose does not hold or does not imply the current proof goal. In this case,
we request an LLM to repair q. We have Orepair : Prog × Prop × Prop ×{FALSE, UNKNOWN} (cid:55)→
P(Prop), whose inputs comprise a program, two properties, and a solver return value. The first
property is our current proof goal, and the second property q is usually an assumption previously
proposed by oracles. The output of Orepair is a new set of properties. In practice, we implement
it with a prompt to an LLM to either correct or strengthen q (see Section 4). Finally, the calculus
performs an external call to a verifier V to check whether a property holds.
The proof rules of LEMUR are shown in Fig. 1. Each rule defines a set of preconditions that specify
the configurations where it can be applied. Note again that our preconditions permit invocations of
LLMs and/or verifiers. The rules within the calculus can be partitioned into four groups.
3
Under submission
M = M′ : : p V(P, A, p) = UNKNOWN q ∈ Opropose(P, p)
P, A, M =⇒ P, {q}, M
(Propose)
A = {q} M = M′ : : p V(P, A, p) = TRUE
P, A, M =⇒ P, ∅, M : : q
(Decide)
M = M′ : : p : : q V(P, A, q) ̸= TRUE
q′ ∈ Opropose(P, p)
P, A, M =⇒ P, {q′}, M′ : : p
(Backtrack)
A = {q} M = M′ : : p V(P, A, p) = UNKNOWN q′ ∈ Orepair(P, p, q, UNKNOWN)
P, A, M =⇒ P, {q′}, M′ : : p
(Repair 1)
A = ∅ M = M′ : : p : : q V(P, A, q) = FALSE
q′ ∈ Orepair(P, p, q, FALSE)
P, A, M =⇒ P, {q′}, M′ : : p
(Repair 2)
A = ∅ M = M′ : : p V(P, A, p) = TRUE
P, A, M =⇒ SUCCESS
(Success 1)
A = ∅ M = M′ : : p : : q S(P, q) V(P, {¬q}, p) = TRUE
P, A, M =⇒ SUCCESS
(Success 2)
M = [p] V(P, A, p) = FALSE
P, A, M =⇒ FAIL
(Fail)
Figure 1: Deductive rules of the LEMUR calculus.
The first group contains rules that are responsible for generating new proof goals given specific
configurations. These rules are Propose, Repair 1, and Repair 2. The Propose rule states that
if the verifier is unable to prove or disprove the current proof goal p, we could invoke the oracle
Opropose to obtain a property q, and update A to be {q}. It is also possible to modify the proposed
property produced by Opropose. The Repair 1 rule can be applied when the current assumption q is
not sufficient for the verifier to prove the current proof goal p. In this case, we could use the oracle
Orepair to propose ways to strengthen q and choose one of them, q', as the new assumption. On the
other hand, the Repair 2 rule can be applied when q is already in the trail but is falsified by the
verifier V. In this case, we could use Orepair to repair q and update A accordingly.
The second group specifies how LEMUR makes progress in the proof. The Decide rule specifies that
the condition under which the assumption q can be made the new proof goal (i.e., being appended
to M)-when the verifier V is able to prove that q implies the current proof goal.
The third group defines how LEMUR can recover from faulty assumptions. In particular, the Back-
track rule allows us to revert to the previous proof goal (the second to the last property in the trail
M) and pick a different assumption suggested by Opropose, if there are at least two elements in the
trail and the verifier cannot prove the current proof goal. Note that Backtrack might not be the only
applicable rule in this case. For example, Repair 1 is also applicable. In practice, we need a strategy
to decide between multiple applicable rules. This discussion is deferred to Sec. 4.
The final group specifies three termination conditions that can be either SUCCESS or FAIL. The
Success 1 rule states that whenever the assumption is empty and the verifier is able to prove the
current proof goal (i.e., the last property p in the trail M), we can transition into the SUCCESS state.
If the verifier can directly prove the original property, then the rule can be directly applied to the
starting configuration to reach SUCCESS. Otherwise, p would come from the oracles and is different
from the original property. Success 2 states that if the last two elements of the trail M are p, and q,
the current proof goal q := ⟨φ, l⟩ is stable (as defined in Sec. 2), and the verifier is also able to also
prove p under the assumption of ⟨¬φ, l⟩, then p is an invariant and we can transition to SUCCESS.
The Success 2 rule constitutes a way to utilize an incorrect sub-goal q proposed by the LLM-based
oracles to decompose the verification task: we separately reason about the cases when q holds and
when it does not hold. Finally, if the verifier V proves that the original property is not an invariant,
whether under an assumption or not, then we transition to the FAIL state using Fail.
Note that the program P remains unchanged throughout the transitions. We keep it as part of the
state for two reasons. First, P is an input to the verifiers and the oracles. Second, in the future, it
4
Under submission
V: UNKNOWN
uint32_t x=0;
while (rand()){
x+=4;
assert(x!=30);
}
Opropose
Propose
O
p
r
o
p
P
s
e
o
p
o
o
e
r
s
...
x+=4;
assert(x!=30);
...
List invariants that prove
the assertion. Your answer
should look like
assert(...) //Line number
------------------------
assert(x % 2 == 0); //Line 2
assert(x % 4 == 1); //Line 2
V: UNKNOWN
V: TRUE
uint32_t x=0;
while (rand()){
assume(x%2==0);
x+=4;
assert(x!=30);
}
Orepair
Rep. 1
uint32_t x=0;
while (rand()){
assume(x%4==0);
x+=4;
assert(x!=30);
}
Decide
V: TRUE
uint32_t x=0;
while (rand()){
assert(x%4==0);
x+=4;
}
Succ. 1
V: TRUE
uint32_t x=0;
while (rand()){
assume(x%4==1);
x+=4;
assert(x!=30);
}
Decide
V: FALSE
uint32_t x=0;
while (rand()){
assert(x%4==1);
x+=4;
}
Opropose
Backtrack
V: TRUE
uint32_t x=0;
while (rand()){
assume(x%4==0);
x+=4;
assert(x!=30);
}
...
Figure 2: A running example of executing the LEMUR calculus.
might be possible to augment the proof system to update P, by, for example, rewriting the program
using LLMs in an invariant-preserving manner.
We state the following soundness properties about LEMUR. The proof is presented in App. C.1.
Theorem 3.1 (Soundness). Given a property p and a program P, if SUCCESS is reached by a
sequence of valid rule applications starting from ⟨P, ∅, [p0]⟩, then p0 is an invariant on P.
Theorem 3.2 (Soundness 2). Given a property p and a program P, if FAIL is reached by a sequence
of valid rule applications starting from ⟨P, ∅, [p0]⟩, then p0 is not an invariant on P.
Example 3.1. To provide more intuition about the proof system and to motivate the design choices
when instantiating LEMUR, we consider again our running example. Figure 2 illustrates how
LEMUR can be used to verify properties in practice.
In Figure 2 each frame represents a state
of the program. Transitions between states are depicted by arrows, with each arrow marked with the
rule applied to execute this transition. In this example, our goal is to prove the property x!=30 in
a while loop that keeps adding 4 to an unsigned 32-bit integer variable x. We note that this partic-
ular verification task is adapted from a similar one in the SV-COMP competition.1 While seemingly
trivial, during the competition, 19 out of the 24 participating tools (including the overall winner of
the competition UAUTOMIZER) were not able to solve this benchmark.
Given such a verification problem, we create an initial configuration ⟨P, ∅, [p])⟩ where P is the
given problem and p = ⟨x!=30, 3⟩.2 Suppose the verifier V is unable to solve this problem and
returns UNKNOWN. In this case, we need to generate a new proof goal, so the only rule we could
apply is Propose. To do so, we invoke the LLM-based oracle Opropose to obtain a set of new properties
that are potentially themselves invariants and might help prove the property. An example prompt is
given on the left bottom part. This is not the exact prompt that we found the most effective in
practice and we defer the discussion of prompting strategies to Sec. 4. Suppose the oracle returns
two potential predicates at the beginning of the while loop: x%2==0 and x%4==1 at line 3. The
Propose allows us to make one of them the current assumption.
Case (x%2==0): The top row illustrates what happens when we transition into ⟨P, {q =
⟨x%2==0, 2⟩}, [p]⟩. While q is indeed an invariant, it does not help to prove the assertion and
V would return UNKNOWN. This satisfies the condition to apply the Repair 1 rule, which would
invoke the oracle Orepair to strengthen q. Suppose in this case, the oracle suggests the predicate
q′ = x%4==0, which clearly implies the original property x!=30. Suppose then V(P, {q′}, p)
returns TRUE. We could apply the Decide rule and transition to ⟨P, ∅, [p, q′]⟩, making q' the cur-
rent proof goal. Proving q' is arguably easier because x%4==0 is inductive (i.e., if it holds in one
iteration and then it will hold in the next iteration), making conventional automated reasoning tech-
niques such as k-induction applicable. Suppose V(P, ∅, q′) = TRUE, we could apply Success 1
and transition into the SUCCESS state, thus completing the proof.
1https://sv-comp.sosy-lab.org/2023/results/results-verified/META_
ReachSafety.table.html#/table?filter=id_any(value(jain_5-2))
23 is the line number (in the snippet) where the predicate is asserted.
5
Under submission
Case (x%4==1): The bottom row illustrates a different chain of rule applications when we picked the
property r = ⟨x%4==1, 2⟩ from the first proposal. While r does not hold, it does imply x!=30. Sup-
pose this implication is proven by the verifier. We could apply Decide and transition to ⟨P, ∅, [p, r]⟩.
Since r is not an invariant, V(P, ∅, r) would be either UNKNOWN or FALSE. Either way, we could
apply Backtrack and try a new assumption proposed by Opropose. In practice, we could either invoke
the stochastic Opropose again or pick an un-attempted property (e.g., ⟨x%2==0, 2⟩ proposed previ-
ously). In the illustration, we invoke Opropose again and obtain the "correct" predicate x%4==0,
which would allow us to prove the property in two more steps. ■
4
INSTANTIATING THE LEMUR CALCULUS
In this section, we present strategies to instantiate LEMUR as an automated decision procedure.
While we showed that LEMUR calculus is a sound procedure, there are no guarantees that it termi-
nates. Here, we will discuss two sources of non-termination in this calculus.
The first one corresponds to unbounded suggestions of new sub-goals to prove the current proof goal.
Concretely, when trying to prove a particular proof goal p, we could get stuck if V(P, {q}, p) =
UNKNOWN or V(P, ∅, q) = FALSE for each proposed assumption q. This could be due to limita-
tions in either the LLM or the verifier. One way to avoid this type of non-termination is by putting
an upper bound on the number of proposed assumptions to prove each proof goal. That is, for any
proof goal p, we require that V(P, {q}, p) is invoked for at most k different q's.
The second source of non-termination corresponds to an unbounded depth of the trail M. Con-
cretely, it is possible to construct an infinite sequence of Propose and Decide where 1) the verifier
returns UNKNOWN on the current proof goal; 2) the oracle proposes an assumption that is not in-
variant but implies the current proof goal; 3) the verifier proves the implication; 4) the assumption
becomes the new proof goal; and 5) repeat. This case can be avoided by adding a side condition to
the rules that the property proposed by the oracles (q = ⟨ψ, l′⟩) must be at a smaller program line
than the current proof goal (p = ⟨φ, l⟩), that is,
⟨ψ, l′⟩ ∈ O∗(P, ⟨φ, l⟩, . . .) ⇒ l′ < l
(Condition 1)
Based on the strategy described above, a terminating (by Thm. 4.1 at the end of this section) and
sound (by Thm. 3.1) algorithm for checking whether a property p is an invariant on a program P is
presented in Alg. 1. Alg. 1 is a recursive procedure lemur check. It takes a program P and a property
p as inputs. If lemur check returns SUCCESS, then the property is an invariant. If lemur check
returns FAIL, then the property is not an invariant. The function can also return UNKNOWN, if the
analysis is inconclusive. At the high level, Alg. 1 searches for a potential subgoal q that implies the
current goal p (lines 9–21). If such q is identified in line 13, we recurse to prove q (line 16). The
while loop starting at line 10 ensures that at most k attempts can be utilized to generate a new
subgoal for p. See a full description of Alg 1 in Appendix D. The comments in Alg. 1 show which
rule is applied at the lines. The algorithm is sound as it only applies the rules of the calculus. We
prove that the algorithm terminates in Appendix D.
Theorem 4.1 (Termination). Given a program P, and a property p on the program, Alg. 1 terminates
with either SUCCESS, FAIL, or UNKNOWN.
5 EXPERIMENTS
We have presented the LEMUR calculus and described a sound and terminating algorithm based on
LEMUR. In this section, we investigate the following question:
• Can we develop a practical automated verification procedure based on Alg 1? [Yes]
• Is LEMUR competitive with existing end-to-end learning-based verification approaches? [Yes]
• Can LEMUR already prove hard benchmarks that are beyond the reach of state-of-the-art conven-
tional program verifiers? [In several cases]
6
Under submission
i, Q (cid:55)→ 0, Opropose(P, p)
while i < k ∧ |Q| > 0 do
Algorithm 1 The LEMUR procedure
1: Input: A program P, a property p.
2: Output: SUCCESS only if Inv(P, p); FAIL only if ¬Inv(P, p); and UNKNOWN if inconclusive.
3: Parameters: Verifier V, oracles Opropose and Orepair (which satisfy Condition 1), number of proposals k
4: function lemur check(P, p)
d (cid:55)→ V(P, ∅, p)
5:
if d = FALSE then return FAIL
6:
else if d = TRUE then return SUCCESS
7:
else
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
f (cid:55)→ lemur check(P, q)
if f = SUCCESS then return SUCCESS
else if S(P, q) ∧ (V(P, {¬q}, p) = TRUE) then return SUCCESS
else if f = FAIL then Q (cid:55)→ join(Q, Orepair(P, p, q, FALSE))
else continue
i (cid:55)→ i + 1
q (cid:55)→ pop(Q)
e (cid:55)→ V(P, {q}, p)
if e = FALSE then return FAIL
else if e = TRUE then
else Q (cid:55)→ join(Q, Orepair(P, p, q, UNKNOWN))
return UNKNOWN
▷ Decide
▷ Success 1
▷ Success 2
▷ Repair 2
▷ Propose/Backtrack
▷ Fail
▷ Fail
▷ Success 1
▷ Repair 1
5.1 BUILDING AN LLM-BASED PROGRAM VERIFIER
We report the practical considerations when building a prototype of Alg. 1. There are two types
of external calls that Alg. 1 depends on. The first type is calls to V. We use off-the-shelf verifiers
in our framework that are extensively tested by the community (described in later paragraphs), so
we have some expectations about their performance. However, the main source of uncertainty in
building LEMUR comes from interaction with the second type of calls, calls to LLM oracles, as we
treat them as black boxes. In our framework, the oracles Opropose and Orepair automatically prompt
a GPT-family model through the OpenAI API and parse its outputs. We use GPT-4 by default. We
found that while GPT has great potential in generating sensible loop invariants, it still has practical
limitations. We report several tactics that we found useful in practice.
• Formatting the output: We initially investigated whether the popular chain-of-thought (CoT)
reasoning (Wei et al., 2022) can be useful to discover new properties given P and p. We found
that GPT's outputs were verbose and often contained irrelevant/incorrect statements, even in
cases where useful invariants were contained in the outputs. This behavior increases the cost
and makes it difficult to extract invariants from the output. To address these issues, we used in-
context learning to format the output of GPT. For example, adding Your output should
be "assert(...);// Line number" to the prompt is sufficient for GPT to consistently
generate outputs of exactly this format, without providing verbose explanations.
• Inserting markers to the program: We found that the current versions of GPT are not good at
counting program lines. In many cases, the predicate generated by GPT is "correct" but the line
number is off by a small margin. This is highly undesirable as an invariant at a wrong position
is of no use to the verifier. To mitigate this challenge, we inserted placeholder lines of the form
"// Line A", "// Line B" to the program and prompted GPT to generate invariants of
the form assert(...);// Line name (for those specific locations). As a simple practical
heuristics, we insert placeholders to right before the loop and the beginning of the loop.
• Ordering the proposal: The output of an oracle call is non-deterministic for a given prompt,
depending on the hyper-parameters of the call. Moreover, the oracles produce a set of properties
and we need good heuristics to choose the order of trying those properties. A heuristic we found
practically useful is to prompt GPT multiple times and order the properties by the frequency they
are proposed (breaking ties by preferring shorter expressions). Moreover, instead of relying on
string matching, we treat two proposals the same if their abstract syntax trees are equivalent.
7
Under submission
Configurations Solved Time # proposal
Configurations Solved Time # proposals
Code2Inv
ESBMC
LEMUR
92
68
107
–
0.34
24.9
> 20
0
4.7
UAUTOMIZER
ESBMC
LEMUR
0
0
26
–
–
140.7
0
0
9.1
(a) The Code2Inv benchmarks.
(b) The 50 SV-COMP benchmarks.
Table 1: Solved instances by ESBMC, LEMUR, and Code2Inv (1a) or UAUTOMIZER (1b) on two
benchmark sets. We also report the average time and number of proposals on solved instances.
The exact prompts are described in Appendix F. We consider two state-of-the-art C program formal
analyzers for V, ESBMC (Gadelha et al., 2018) and UAUTOMIZER (Heizmann et al., 2013). The
former is based on K-induction and the latter is based on predicate-abstraction. In particular, ESBMC
and UAUTOMIZER are the top two performing non-portfolio solvers in the reachability track of the
SV-COMP (Beyer, 2023). And UAUTOMIZER is the overall winner of the competition. By default,
we impose a 30-second time limit for each invocation of the verifier. That is, if the verifier does not
terminate within 30 seconds, then the verifier returns UNKNOWN. The total cost incurred by using
the OpenAI API services for the experiments (including testing phases) is $1000. We will release
the source code and the benchmarks for the community to make further improvements.
5.2 LOOP INVARIANT GENERATION BENCHMARKS
A prominent approach in learning-based end-to-end program verification is Code2Inv, which uses
reinforcement learning to train an invariant synthesizer to propose loop invariants. In this section,
we study how LEMUR compares with this approach. The Code2Inv (Si et al., 2020) benchmark
set contains 133 benchmarks, each containing a C program and a property expressed as an assert
statement in the program. Each program contains a single loop and each loop can have nested if-
then-else blocks (without nested loops). Programs in the benchmark may also have uninterpreted
functions (emulating external function calls) in branches or loop termination conditions. The asser-
tion to check is always after the loop. As reported in the original Code2Inv paper, these problems
can be efficiently solved using state-of-the-art invariant synthesis solvers and the goal was to eval-
uate the ability of Code2Inv to generate a real invariant that implies the property at the beginning
of the loop. To have a fair comparison, we prompt the oracles to generate invariants in the same
location as Code2Inv in Alg. 1.
We use the k-induction-based verifier, ESBMC, to check the implication (line 13 in Alg. 1) which
aligns with the verification procedure used in Code2Inv. We report the number of solved instances as
well as the number of failed suggestions (either itself cannot be verified or ESBMC times out on the
implication check). As a point of comparison, we report those statistics from the original Code2Inv
approach, which combines graph and recurrent neural networks to model the program graph and
learn from counterexamples. Code2Inv was given a one-hour timeout. In addition, we also report
ESBMC's performance on this set of benchmarks. The result is shown in Table 1a.
With a 10-minute timeout, ESBMC alone can solve 68 problems.
On the other hand, LEMUR can solve 107 problems within the same
time limit. Surprisingly, this approach solves more instances than
Code2Inv, which is specifically designed for invariant synthesis
tasks. Moreover, LEMUR is able to find the correct loop invariant
with on average 4.7 attempts, while it takes Code2Inv on average
> 20 attempts to do so. For problems unsolved by ESBMC but
solved by LEMUR, a histogram of the values of Log2 of the num-
ber of proposals is shown in Fig. 3. While in most cases, Alg. 1
can propose the correct proposals within 4 attempts, there are still
benchmarks that take LEMUR many rounds of proposal and repair
to find the desired loop invariant, e.g. one of the benchmarks took
177 proposals.
8
Figure 3: Number of pro-
posals for LEMUR to solve a
benchmark.
Under submission
5.3 SOLVING HARD SV-COMP BENCHMARKS
Next, we study LEMUR's ability to solve hard benchmarks from the Software-Verification Compe-
tition 2023 (Beyer, 2023). Due to budget limitations, we focus on benchmarks with less than 150
tokens (after removing comments, unnecessary headers, and clang-formatting). We select 50 bench-
marks that ESBMC and UAUTOMIZER are unable to solve within 20 minutes and evaluate LEMUR on
them with the same timeout. The property is expected to hold in all benchmarks. These benchmarks
are considerably more challenging than the Code2Inv programs. While the latter has one loop and
follows a strict format, the SV-COMP benchmark presents a more diverse set of benchmarks, with
multiple loops present in many programs.
The results are shown in Table 1b. Impressively, with the guidance of the proof goals suggested
by the LLM, LEMUR is able to solve 26 of the 50 SV-COMP benchmarks. While neither ESBMC
nor UAUTOMIZER can solve a single benchmark alone. Upon closer examination, 6 of the solved
instances contain 2 loops, 3 contain 3 loops, and 3 contain 4 or more loops. To our knowledge, this
is the first time a learning-based verification approach 1) can handle programs with more than
one loop; and 2) boosts the performance of state-of-the-art conventional C program verifiers.
The average number of proposals before solving a problem is higher
compared to the Code2Inv benchmarks (9.1 vs. 4.7). Fig. 4 sheds
more light on the behavior of LEMUR. In particular, 16 of the 26
solved instances require more than 6 proposals in total.
We found that the LLM-based oracles can produce surprisingly in-
sightful loop invariants that are difficult for conventional formal
methods to synthesize. While predicate-abstraction-based tech-
niques typically generate predicates that involve only the operators
and values in the program and follow a particular template, LLM is
not constrained by these limitations. For example, for the program
in Fig. 2, GPT-4 can consistently generate x%4==0 as the loop in-
variant although the modulo operator is not present in the program.
Appendix. F.1 shows an example where LLM understands the range
of unsigned char as the key to proving the given property and
suggests variable bounds as the assumption. There are also several cases where the LLM generates
disjunctive invariants that precisely characterize the behavior of the loops.
Figure 4: Number of pro-
posals for LEMUR to solve a
benchmark.
6 DISCUSSION OF LIMITATIONS AND EXTENSIONS
In this work, we proposed a novel framework, LEMUR, that combines automated reasoning and
LLMs. To the best of our knowledge, LEMUR is the first framework that provides a theoretical
foundation for such integration, i.e., a formal calculus, and practical algorithmic instantiation of
the calculus. We also implemented LEMUR as a fully automated framework and demonstrated its
efficiency on standard benchmark sets. We conclude by discussing the current limitations of LEMUR,
which point to future research directions to extend the framework.
As we mentioned above, the practical performance of LEMUR depends on two types of external
calls: the verifiers and the LLMs. Any improvements in these tools should translate into LEMUR
improvements. Currently, modern verifiers are capable of handling relatively small programs (see
SV-COMP'23 (Beyer, 2023)). Interestingly, even when provided with a strong invariant, they some-
times cannot solve the verification problem. One research direction that we envision is to customize
LEMUR to a particular backend verifier to obtain better performance and solve larger programs.
While our experience with LLMs was largely positive (see Section 5.1 for a discussion on the limi-
tations we have successfully overcome), there are more interesting challenges to tackle. First, LLMs
can take a limited number of tokens as inputs, and many practical programs exceed that limit. Sec-
ond, it is sometimes challenging for LLMs to generate more complex logical formula such as nested
if-then-else properties. We believe that to overcome this limitation we need to 1) develop a prompt-
ing language for invariant generation with LLMs, and 2) fine-tune LLMs for invariant generation
tasks using this language.
9
Under submission
Finally, due to the limitations of LLMs and automated reasoners, our hybrid framework is not yet
able to offer a significant leap in automatically verifying complex properties on real-world C li-
braries. However, a modular approach, where large parts of the program are abstracted and summa-
rized in the form of pre- and post-conditions, can benefit from frameworks like LEMUR.
10
Under submission
REFERENCES
Dirk Beyer. Competition on software verification and witness validation: Sv-comp 2023. In Sriram
Sankaranarayanan and Natasha Sharygina (eds.), Tools and Algorithms for the Construction and
Analysis of Systems, pp. 495–522, Cham, 2023. Springer Nature Switzerland. ISBN 978-3-031-
30820-8.
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhari-
wal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agar-
wal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh,
Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz
Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec
Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners.
In
H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neu-
ral Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc.,
URL https://proceedings.neurips.cc/paper_files/paper/2020/
2020.
file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf.
Yiannis Charalambous, Norbert Tihanyi, Ridhi Jain, Youcheng Sun, Mohamed Amine Ferrag, and
Lucas C. Cordeiro. A new era in software security: Towards self-healing software via large
language models and formal verification, 2023.
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Pond ́e de Oliveira Pinto, Jared
Kaplan, Harrison Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri,
Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan,
Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavar-
ian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plap-
pert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol,
Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William
Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Joshua Achiam, Vedant Misra, Evan
Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Pe-
ter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech
Zaremba. Evaluating large language models trained on code. CoRR, abs/2107.03374, 2021.
URL https://arxiv.org/abs/2107.03374.
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam
Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh,
Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam
Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James
Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Lev-
skaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin
Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret
Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick,
Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica
Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Bren-
nan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas
Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways,
2022.
Edmund M Clarke, Thomas A Henzinger, Helmut Veith, Roderick Bloem, et al. Handbook of model
checking, volume 10. Springer, 2018.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep
bidirectional transformers for language understanding.
In Jill Burstein, Christy Doran, and
Thamar Solorio (eds.), Proceedings of the 2019 Conference of the North American Chapter of
the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT
2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pp. 4171–
4186. Association for Computational Linguistics, 2019. doi: 10.18653/v1/n19-1423. URL
https://doi.org/10.18653/v1/n19-1423.
11
Under submission
Emily First, Markus N. Rabe, Talia Ringer, and Yuriy Brun. Baldur: Whole-proof generation and
repair with large language models. CoRR, abs/2303.04910, 2023. doi: 10.48550/arXiv.2303.
04910. URL https://doi.org/10.48550/arXiv.2303.04910.
Mikhail R Gadelha, Felipe R Monteiro, Jeremy Morse, Lucas C Cordeiro, Bernd Fischer, and De-
nis A Nicole. Esbmc 5.0: an industrial-strength c model checker. In Proceedings of the 33rd
ACM/IEEE International Conference on Automated Software Engineering, pp. 888–891, 2018.
Inc. GitHub. GitHub Copilot. https://copilot.github.com/, 2021. Accessed: September
2023.
Matthias Heizmann, J ̈urgen Christ, Daniel Dietsch, Evren Ermis, Jochen Hoenicke, Markus Lin-
denmann, Alexander Nutz, Christian Schilling, and Andreas Podelski. Ultimate automizer with
smtinterpol: (competition contribution). In International Conference on Tools and Algorithms for
the Construction and Analysis of Systems, pp. 641–643. Springer, 2013.
Daniel Kroening and Michael Tautschnig. Cbmc–c bounded model checker: (competition contribu-
tion). In Tools and Algorithms for the Construction and Analysis of Systems: 20th International
Conference, TACAS 2014, Held as Part of the European Joint Conferences on Theory and Prac-
tice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014. Proceedings 20, pp. 389–391.
Springer, 2014.
Aitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer, Henryk Michalewski,
Imanol Schlag, Theo Gutman-
Solv-
In NeurIPS, 2022.
http://papers.nips.cc/paper_files/paper/2022/hash/
Vinay V. Ramasesh, Ambrose Slone, Cem Anil,
Solo, Yuhuai Wu, Behnam Neyshabur, Guy Gur-Ari,
ing quantitative
URL
18abbeef8cfe9203fdf9053c9c4fe191-Abstract-Conference.html.
reasoning problems with language models.
and Vedant Misra.
Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, R ́e mi Leblond, Tom
Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, Thomas Hubert, Peter Choy, Cyprien
de Masson d'Autume, Igor Babuschkin, Xinyun Chen, Po-Sen Huang, Johannes Welbl, Sven
Gowal, Alexey Cherepanov, James Molloy, Daniel J. Mankowitz, Esme Sutherland Robson, Push-
meet Kohli, Nando de Freitas, Koray Kavukcuoglu, and Oriol Vinyals. Competition-level code
generation with AlphaCode. Science, 378(6624):1092–1097, dec 2022. doi: 10.1126/science.
abq1158. URL https://doi.org/10.1126%2Fscience.abq1158.
OpenAI. Gpt-4 technical report, 2023.
Kexin Pei, David Bieber, Kensen Shi, Charles Sutton, and Pengcheng Yin. Can large language
models reason about program invariants?
In Andreas Krause, Emma Brunskill, Kyunghyun
Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett (eds.), Proceedings of the 40th
International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning
Research, pp. 27496–27520. PMLR, 23–29 Jul 2023. URL https://proceedings.mlr.
press/v202/pei23a.html.
Xujie Si, Aaditya Naik, Hanjun Dai, Mayur Naik, and Le Song. Code2inv: A deep learning frame-
work for program verification. In Shuvendu K. Lahiri and Chao Wang (eds.), Computer Aided
Verification - 32nd International Conference, CAV 2020, Los Angeles, CA, USA, July 21-24,
2020, Proceedings, Part II, volume 12225 of Lecture Notes in Computer Science, pp. 151–164.
Springer, 2020. doi: 10.1007/978-3-030-53291-8\ 9. URL https://doi.org/10.1007/
978-3-030-53291-8_9.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny
Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in
Neural Information Processing Systems, 35:24824–24837, 2022.
Martin White, Michele Tufano, Matias Martinez, Martin Monperrus, and Denys Poshyvanyk. Sort-
ing and transforming program repair ingredients via deep learning code similarities. In 2019 IEEE
26th International Conference on Software Analysis, Evolution and Reengineering (SANER).
IEEE, feb 2019. doi: 10.1109/saner.2019.8668043. URL https://doi.org/10.1109%
2Fsaner.2019.8668043.
12
Under submission
A BACKGROUND
Automated reasoning tools. We overview several popular techniques that are used by modern
program verification solvers, like CBMC (Kroening & Tautschnig, 2014), ESBMC (Gadelha et al.,
2018), and UAUTOMIZER (Heizmann et al., 2013).
The Bounded Model Checking (BMC) approach is an iterative technique that verifies the program
for each unwind bound up to a maximum value, m, e.g.
It
either finds a counterexample within m steps or returns UNKNOWN. This approach usually employs
SMT solvers to find counterexamples very efficiently at each step. However, for non-trivial systems
unrolling can be expensive and memory-consuming. Moreover, vanilla BMC can only check finite
reachability, e.g. it cannot prove loop invariants, for example.
it can perform m loop unwinding.
Another popular technique is the k-induction method, which allows BMC-style methods to prove
properties like loop invariants. This approach is also iterative. First, we check whether a property
holds for k steps from a valid state. If it does not, we find a counterexample. Otherwise, we check
an inductive hypothesis that if the property holds for k steps from a state then the property holds
for the k + 1th step. If it does, the property holds for any number of steps. If not, k-induction
either increases k or returns UNKNOWN. As in the case of BMC, unrolling can be computationally
expensive. Moreover, k-induction is not complete; there are properties that are not k-inductive for
any k.
The last approach we consider is abstract interpretation verification methods. Such methods create
abstract representations of program states and variables. These abstract representations are simpli-
fied versions of the actual program states, focusing on relevant aspects while ignoring irrelevant
details. The choice of abstraction depends on the specific properties to verify. Moreover, if a prop-
erty holds for an abstract program, then it holds for the original program. The reverse is not true.
Hence, if a property does not hold for an abstract program, we need to refine the abstract repre-
sentation to exclude the counterexample. The main challenge here is how to come up with a good
abstraction and how to design a refinement procedure.
Large Language Models. Large Language Models belong to a class of artificial intelligence mod-
els used in natural language processing tasks. These models are designed to process and gener-
ate both human language and structured inputs, such as code in various programming languages.
Examples of large language models include Generative Pre-trained Transformer models like GPT-
3 (Brown et al., 2020) or GPT-4 (OpenAI, 2023), Bidirectional Encoder Representations from Trans-
formers, BERT (Devlin et al., 2019), and others. LLMs are getting increasingly popular as an AI-
assistance for code generation tasks, like PaLM (Chowdhery et al., 2022), GitHub Copilot (Chen
et al., 2021; GitHub, 2021), etc.
LLMs are usually trained in two steps. The main phase is training, where these models are exposed
to very large corpora of data, usually collected over the internet. The architecture of LLMs is based
on transformers and has a very large number of parameters. Therefore, it can capture relations
between different parts of the input text to produce coherent outputs. For some applications, we
need to perform fine-tuning to expose the model to application-specific inputs. During inference,
when a user provides inputs and a prompt that contains instructions to an LLM, it generates the
output with respect to these instructions.
B DEFINITIONS
Lemma 2.1. Consider a program P, two properties p, q on P, and a program P ′ = Asm(P, q).
The property p is an invariant on P, if 1) q is stable for P; 2) q implies p with respect to P; and 3)
¬q implies p with respect to P. More formally: S(P, q) ∧ (q −→
P
p) ∧ (¬q −→
P
p) ⇒ Inv(P, p).
Proof. Let q = ⟨φ, l⟩. By the definition of stability, for any execution of P, either φ always evaluates
to true at line l or ¬φ always evaluates to true at line l. In either case, the property p holds by the
definition of implication. Therefore, p holds for all executions of P, i.e., Inv(P, p).
13
Under submission
C LEMUR: INTEGRATING LLMS IN PROGRAM VERIFICATION
C.1 SOUNDNESS OF LEMUR
Lemma C.1. For any configuration ⟨P, A, M⟩ created by a sequence of valid rule applications
starting from an initial configuration ⟨P, ∅, [p0]⟩, M is not empty.
Proof. This can be proven by induction on the length of the sequence. In the base case, M is [p0].
In the inductive case, the length of M does not reduce except in the Backtrack rule which requires
M to have at least 2 elements in the pre-condition. Thus, M is not empty.
Lemma C.2. Let ⟨P, A, M⟩ be a configuration created by a sequence of valid rule applications
starting from an initial configuration ⟨P, ∅, [p0]⟩, and let p be the last element of M. We have
p −→
P
p0.
Proof. We prove a stronger property, that for each element p in M, p −→
p0. We induct on the
P
p0 by proposition 2.2. In the inductive case, we
length of the sequence. In the base case, p0 −→
P
proceed by cases. Success 1, Success 2, Fail cannot be applied. In the post conditions of Propose,
Backtrack, Repair 1, and Repair 2, M either shrinks or remains the same. Therefore, the inductive
hypothesis can be directly applied. If Decide rule is to be applied. In the pre-condition, the trail is
p. In the post condition, M becomes M : : p : : q.
M : : p, the current assumption is {q} and q −→
P
By the inductive hypothesis, p −→
P
p0. Furthermore, by Proposition 2.3, q −→
P
p0.
Lemma C.3. Let ⟨P, A, M : : p : : p′⟩ be a configuration created by a sequence of valid rule
applications starting from an initial configuration ⟨P, ∅, [p0]⟩, we have p′ −→
P
p.
Proof. This can be proven by induction on the length of the sequence.
Theorem 3.1. Given a property p and a program P, if SUCCESS is reached by a sequence of valid
rule applications starting from ⟨P, ∅, [p0]⟩, then p0 is an invariant on P.
Proof. We can transition into SUCCESS by either the Success 1 rule or the Success 2 rule. In the
pre-condition of Success 1, the trail is of the form M : : p, and the verifier V proves that Inv (P,
p0. Further by Proposition 2.1, we have Inv(P, p0). On the other hand,
p). By Lemma C.2, p −→
P
in the pre-condition of Success 2, the trail is of the form M : : p : : p′. By Lemma C.3, p′ −→
p.
P
In addition, p′ is stable and ¬p′ −→
P
also know from Lemma C.2 that p −→
P
P.
p. Therefore, by Lemma 2.1, p is an invariant of P. Since we
p0, it follows from Proposition 2.1 that p0 is an invariant of
Theorem 3.2. Given a property p and a program P, if FAIL is reached by a sequence of valid rule
applications starting from ⟨P, ∅, [p0]⟩, then p0 is not an invariant on P.
Proof. We transition into the FAIL state only when the verifier V(P, A, p0) = FALSE. Even if A is
not empty, p0 is still not an invariant by Prop. 2.1.
D INSTANTIATING THE LEMUR CALCULUS
Here, we describe Alg. 1. First, the algorithm checks whether the current p can be verified by V
or if a counterexample exists (line 5). If so, it returns either SUCCESS or FAIL to the upper level
of recursion or terminates if lemur check is at the top level. If V cannot prove p, i.e.
it returns
UNKNOWN, lemur check enters a new phase of subgoal generation, where LLM oracles are used
to propose new or repair existing properties (lines 9–21). In this phase, we start by calling Opropose
to generate a new subgoal (line 9). The while loop at line 10 ensures that at most k attempts
can be unitized to generate a new subgoal for p. In line 13, we call V to check whether q implies
14
Under submission
p. If V returns FALSE, we know that p is not an invariant and return FAIL (line 14). If V returns
UNKNOWN, then we need to repair q; for example, we might strengthen q and try again to prove
implication. Otherwise, if q does imply p, we recurse to prove q (line 16). The last logical block
of lemur check in lines 17–20 addresses the output of the recursive call. If we have successfully
proved that q is an invariant, we return SUCCESS. Otherwise, if q is stable (see Definition 2.4),
we can check whether ¬q implies p (line 18). If so, by Lemma 2.1, we can conclude that p is an
invariant and also return SUCCESS. If we prove that q is FALSE, we can repair q by informing an
LLM oracle that the property does not hold (line 19). Finally, if f is UNKNOWN then we continue
to the next iteration of the while loop and consider the next proposed sub-goal.
Second, we present a proof of Theorem 4.1.
Theorem 4.1. Given a program P, and a property p on the program, Alg. 1 terminates with either
SUCCESS, FAIL, or UNKNOWN.
Proof. Suppose p = ⟨φ, l⟩. We prove with a decreasing argument on l. When l = 0, the al-
gorithm terminates without entering the while loop, because Opropose satisfies Condition 1 and
Opropose(P, p) = ∅.
In the recursive case, the while loop is executed for at most k iterations.
In each iteration, we show that for the second input to lemur check (Line 16), q = ⟨ψ, l′⟩, we
have l′ < l. This is true because q is generated either by Opropose(P, p) or Orepair(P, p, . . .), both
satisfying Condition 1.
E RELATED WORK
There has been a lot of interest in using LLMs to augment formal reasoning. Charalambous et al.
(2023) proposed a novel framework, ESBMC-AI, that integrated LLMs reasoning and formal verifi-
cation. They also applied their framework to the analysis of C programs focusing on memory safety
properties. The main idea is to use LLMs as a code repair generator that can fix faulty code using a
carefully designed prompt, a program, and a counterexample provided by a bounded model checker.
However, ESBMC-AI assumes that program rewriting done by an LLM is valid, i.e. syntactically
and semantically correct. The latter is challenging to prove in an automatic manner as it requires pro-
gram equivalence checking. Our framework does not use LLMs to modify code and treat the outputs
of the LLM as suggestions until we prove that they are correct. Another example of an automated
framework is Baldur (First et al., 2023), which uses an LLM, Minerva (Lewkowycz et al., 2022), to
generate theorem proofs that are checked by Isabelle theorem prover. They also proposed a proof
repair procedure. In contrast, our interactive decision procedure relies on an automated reasoner to
generate proofs and only uses LLMs generated program properties.
The most related work to our framework is Code2Inv (Si et al., 2020), which proposed learning
program invariants using machine learning techniques and employed automatic reasoning to verify
the programs. The main principle of partitioning responsibilities between automated reasoners and
LLMs is similar to our framework. However, we provide a formalization for such interactive proce-
dures with formal calculus and a strategy to use it in practice. Our procedure is more general as it
allows the generation of sequences of logically related properties, and we demonstrate that it is more
efficient in practice. Finally, recent work by Pei et al. (2023) investigates the potential of invariant
generation for Java programming language. While this framework does not incorporate automated
reasoning components, it shows the potential of LLMs to uncover program properties.
F PROMPTING THE GPT
In this section, we describe how we automatically constructed the prompts in Opropose and Orepair, and
show examples of the prompts and the GPT outputs. We provided in the supplementary materials
the execution traces of LEMUR on solved benchmarks used in our experiments.
F.1 PROPOSING NEW PROPERTIES
Given a program P and a property represented as a C assert statement in P, we inserted the place-
holder lines "// Line A", "// Line B"... to dedicated program lines as described in 5.1. Our
prompt has the following structure:
15
Under submission
---------
[P1]
Print [P2] as valid C assertions at line[P3] [P4] that
help prove the assertion. Use '&&' or '||' if necessary.
Don't explain. Your answer should be 'assert(...); // line [P5]'
---------
P1 is the program with the placeholder lines and the C assertion; P2 is either facts or loop
invariants depending on whether all the placeholder lines are in loops; P3 is either empty or s
depending on the number of placeholder lines; P4 are the placeholder line names (e.g., A, B); and
P5 is either A, if there is only one placeholder line, or name, if there are multiple.
Below is an example extracted from the execution of our prototype on an SV-COMP benchmark:
int main() {
unsigned char n = (unsigned char) rand();
if (n == 0) {
return 0;
}
unsigned char v = 0;
unsigned int s = 0;
unsigned int i = 0;
while (i < n) {
// Line A
v = (unsigned char) rand();
s += v;
++i;
}
assert(s >= v);
return 1;
}
Print loop invariants as valid C assertions at line A that
help prove the assertion. Use '&&' or '||' if necessary.
Don't explain. Your answer should be 'assert(...); // line A'
Below are GPT-4's responses on multiple attempts as well as the final set of extracted properties our
prototype proceeds to prove.
GPT output 1 with penalty 1.5:
assert(i <= n); // line A
assert(s >= i); // line A
GPT output 2 with penalty 1.5:
assert(i <= n); // line A
assert(s >= 0 && v >= 0); // line A
GPT output 3 with penalty 1.5:
assert(i <= n); // line A
assert(s >= 0 && s <= i*UCHAR_MAX); // line A
GPT output 4 with penalty 1.5:
assert(i <= n); // line A
assert(s >= 0 && s <= i*UCHAR_MAX); // line A
GPT output 1 with penalty 2:
assert(i <= n); // line A
assert(s >= 0 && s <= UCHAR_MAX * i); // line A
GPT output 2 with penalty 2:
assert(i <= n); // line A
assert(s >= i*v && s <= (i*255)); // line A
GPT output 3 with penalty 2:
assert(i <= n); // line A
assert(s >= 0 && s <= i*UCHAR_MAX); // line A
GPT output 4 with penalty 2:
16
Under submission
assert(i <= n); // line A
assert(s >= 0 && s <= UCHAR_MAX * i); // line A
Found 6 potential sub-goals
Goal 1: i <= n after line 8
Goal 2: s >= 0 && s <= i*0xff after line 8
Goal 3: s >= 0 && s <= 0xff * i after line 8
Goal 4: s >= i after line 8
Goal 5: s >= 0 && v >= 0 after line 8
Goal 6: s >= i*v && s <= (i*255) after line 8
F.2 REPAIRING A PREVIOUS PROPOSAL
The oracle Orepair uses a similar prompting template:
---------
[P1]
Print [P2] as valid C assertions at line A that
help prove the assertion. Your previous answer [P3]
is [P4]. Use '&&' or '||' if necessary. Don't explain.
Your answer should be 'assert(...);'
---------
P1 is the program with the placeholder line (corresponding to the assumption p = ⟨φ, l⟩ to repair)
and the C assertion; P2 is either facts or loop invariants depending on whether p is in a
loop; P3 is p; P4 is either incorrect or too weak.
Below is an example extracted from the execution of our prototype on another SV-COMP bench-
mark:
int main() {
unsigned int n = (unsigned int) rand();
unsigned int x = n, y = 0, z;
while (x > 0) {
x--;
y++;
}
z = y;
// Line A
while (z > 0) {
x++;
z--;
}
assert(y + z == n);
return 1;
}
Print facts as valid C assertions at line A that help
prove the assertion. Your previous answer 'x + z == n'
is too weak. Use '&&' or '||' if necessary. Don't explain.
Your answer should simply be 'assert(...);'
The GPT outputs on different prompting attempts with different penalties and the extracted proper-
ties:
GPT output 1 with penalty 1.5:
assert(x + y == n); // Line A
assert(x + z == y); // Line B
GPT output 2 with penalty 1.5:
assert(x + y == n); // Line A
assert(x + z == n); // Line B
17
Under submission
GPT output 1 with penalty 2:
assert(x + y == n); // Line A
assert(x + z == n); // Line B
GPT output 2 with penalty 2:
assert(x + y == n); // Line A
assert(z + x == n); // Line B
Found 4 potential adapted sub-goals
Goal 1: x + y == n after line 7
Goal 2: x + z == n after line 7
Goal 3: x + z == y after line 7
Goal 4: z + x == n after line 7
18
|
|
http://arxiv.org/abs/2310.04867v1 | "2023-10-07T16:27:00" | "2023-10-07T16:27:00" | Randomized Sparse Neural Galerkin Schemes for Solving Evolution
Equations with Deep Networks | Training neural networks sequentially in time to approximate solution fields
of time-dependent partial differential equations can be beneficial for
preserving causality and other physics properties; however, the
sequential-in-time training is numerically challenging because training errors
quickly accumulate and amplify over time. This work introduces Neural Galerkin
schemes that update randomized sparse subsets of network parameters at each
time step. The randomization avoids overfitting locally in time and so helps
prevent the error from accumulating quickly over the sequential-in-time
training, which is motivated by dropout that addresses a similar issue of
overfitting due to neuron co-adaptation. The sparsity of the update reduces the
computational costs of training without losing expressiveness because many of
the network parameters are redundant locally at each time step. In numerical
experiments with a wide range of evolution equations, the proposed scheme with
randomized sparse updates is up to two orders of magnitude more accurate at a
fixed computational budget and up to two orders of magnitude faster at a fixed
accuracy than schemes with dense updates. | [
"Jules Berman",
"Benjamin Peherstorfer"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04867v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04867v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.NA",
"math.NA",
"stat.ML"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
7
6
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Randomized Sparse Neural Galerkin Schemes for
Solving Evolution Equations with Deep Networks
Jules Berman
Courant Institute for Mathematical Sciences
New York University
New York, NY 10012
jmb1174@nyu.edu
Benjamin Peherstorfer
Courant Institute for Mathematical Sciences
New York University
New York, NY 10012
pehersto@cims.nyu.edu
Abstract
Training neural networks sequentially in time to approximate solution fields of time-
dependent partial differential equations can be beneficial for preserving causality
and other physics properties; however, the sequential-in-time training is numerically
challenging because training errors quickly accumulate and amplify over time. This
work introduces Neural Galerkin schemes that update randomized sparse subsets
of network parameters at each time step. The randomization avoids overfitting
locally in time and so helps prevent the error from accumulating quickly over the
sequential-in-time training, which is motivated by dropout that addresses a similar
issue of overfitting due to neuron co-adaptation. The sparsity of the update reduces
the computational costs of training without losing expressiveness because many
of the network parameters are redundant locally at each time step. In numerical
experiments with a wide range of evolution equations, the proposed scheme with
randomized sparse updates is up to two orders of magnitude more accurate at a
fixed computational budget and up to two orders of magnitude faster at a fixed
accuracy than schemes with dense updates.
1
Introduction
In science and engineering, partial differential equations (PDEs) are frequently employed to model
the behavior of systems of interest. For many PDEs that model complicated processes, an analytic
solution remains elusive and so computational techniques are required to compute numerical solutions.
Global-in-time training There have been many developments in using nonlinear parameterizations
based on neural networks for numerically approximating PDE solutions. These include techniques
such as the Deep Galerkin Method [46], physics-informed neural networks (PINNs) [41], and others
[4, 21, 53, 15]; as well as early works such as [11, 42]. In most of these methods, a neural network is
used to represent the solution of a (time-dependent) PDE over the whole space-time domain. For this
reason they are termed global-in-time methods in the following. To approximate the solution, the
neural network is trained to minimize the PDE residual on collocation points sampled from the space-
time domain, which requires solving a large-scale optimization problem that can be computationally
expensive. Additionally, the solutions learned by global-in-time methods can violate causality, which
can become an issue for complex problems that rely on preserving physics [27]. We note that neural
networks have been used for approximating PDE solutions in various other ways, such as learning
specific component functions [23, 31, 43], finding closure models [2, 25, 50], de-noising [44], and
for surrogate modeling [33, 32, 18]. However, we are interested in this work in using neural networks
for directly approximating PDE solutions.
Preprint. Under review.
Sequential-in-time training with the Dirac-Frenkel variational principle
In this work, we follow
the Dirac-Frenkel variational principle, which has been used for numerical methods in the field of
quantum dynamics for a long time [10, 17, 26, 34, 28] and for dynamic-low rank and related solvers
[24, 45, 35, 39, 38, 22]. Instead of globally approximating a PDE solution in time, the Dirac-Frenkel
variational principle allows a sequential-in-time training that adapts a nonlinear parameterization,
such as a neural network, over time. In contrast to classical numerical methods in vector spaces, the
approximate solution in Dirac-Frenkel schemes is allowed to depend nonlinearly on its parameters
and so to lie on a smooth manifold. The update to the nonlinear parameterization is calculated at
each time step according to the orthogonal projection of the dynamics onto the tangent space of the
manifold induced by the nonlinear parameterization. The Dirac-Frenkel variational principle has
been adapted for the nonlinear approximation of PDEs with neural networks. In particular [14, 1, 7]
formulate a sequential-in-time method based on the Dirac-Frenkel variational principle.
The neural network represents the PDE solution at a point in time. The time-dependence then arises
by allowing the parameters-the weights and biases of the network-to vary in time. The network
parameters are then evolved forward according to the time dynamics which govern the PDE. This is
in contrast to global-in-time methods, in which time enters the network as an additional input variable.
By construction, an approximate solution obtained with a sequential-in-time method is causal, in that
the solution at future times depends only on the solution at the current time.
Although these methods have demonstrated success in solving various PDEs [34, 14, 7, 54, 16, 8, 30],
there are open challenges: First, the sequential-in-time training is prone to overfitting which can
lead to a quick accumulation of the residual over time. Second, the local training step has to be
repeated at each time step, which can be computationally costly, especially with direct solvers that
have costs increase quadratically with the number of network parameters. The work [16] proposes to
address the two issues by using iterative solvers, instead of direct ones, and by re-training the network
occasionally over the sequential-in-time training. We show with numerical experiments below that
the re-training of the network can be computationally expensive. Additionally, the performance
of iterative solvers depends on the condition of the problem, which can be poor in the context of
sequential-in-time training.
Our approach and contributions: Randomized sparse updates for schemes based on the Dirac-
Frenkel variational principle We build on the previous work in sequential-in-time methods
following a similar set up as [7] based on the Dirac-Frenkel variational principle. Where all previous
methods solve local training problems that update every parameter of the network at each time step,
we propose a modification such that only randomized sparse subsets of network parameters are
updated at each time step:
(a) The randomization avoids overfitting locally in time and so helps preventing the error
from accumulating quickly over the sequential-in-time training, which is motivated by dropout that
addresses a similar issue of overfitting due to neuron co-adaptation.
(b) The sparsity of the updates reduces the computational costs of training without losing
expressiveness because many of the network parameters are redundant locally at each time step.
Our numerical experiments indicate that the proposed scheme is up to two orders of magnitude more
accurate at a fixed computational cost and up to two orders of magnitude faster at a fixed accuracy.
We release our code implementation here: https://github.com/julesberman/RSNG
2 Sequential-in-time training for solving PDEs
2.1 Evolution equations, Dirac-Frenkel variational principle, Neural Galerkin schemes
Given a spatial domain
u :
T × X →
Rd, and a time domain
X ⊆
R so that u(t,
) :
*
∂tu(t, x) =f (x, u)
u(0, x) =u0(x)
X →
U
for (t, x)
∈ T × X
for x
∈ X
R is in a function space
T
= [0, T )
R, we consider a solution field
⊆
at each time t, with dynamics
(1)
is the initial condition and f can include partial derivatives of u to represent PDEs.
where u0 ∈ U
We focus in this work on Dirichlet and periodic boundary conditions but the following approach
2
Figure 1: We propose Neural
Galerkin schemes that update ran-
domized sparse subsets of network
parameters with the Dirac-Frenkel
variational principle. Randomization
avoids overfitting locally in time,
which leads to more accurate approxi-
mations than dense updates. Sparsity
reduces the computational costs of
training without losing expressive-
ness because many parameters are
redundant locally in time.
can be applied with, e.g., Neumann boundary conditions as well [7]. One approach for imposing
Dirichlet boundary conditions is by choosing parameterizations that satisfy the boundary conditions
by definition [48].
Sequential-in-time training methods approximate u with a nonlinear parameterization such as a
Rp depends on time t; the
neural network ˆu :
parameter θ(t) has p components and enters nonlinear in the second argument of ˆu. The residual of
(1) at time t is
R, where the parameter vector θ(t)
X ×
→
Θ
⊆
Θ
∈
r(x; θ(t), ̇θ(t)) =
(2)
f (x, ˆu(
*
∇
; θ(t)) to formally obtain ̇θ(t). Methods based on the
where we applied the chain rule to ∂t ˆu(
*
Dirac-Frenkel variational principle [10, 17, 34] seek ̇θ(t) such that the residual norm is minimized,
which leads to the least-squares problem
θ ˆu(x; θ(t))
; θ(t))) ,
−
*
̇θ(t)
̇θ(t) ∥∇θ(t) ˆu(
min
*
; θ(t)) ̇θ(t)
; ˆu(
f (
*
; θ(t)))
∥
*
−
2
L2(X ) ,
(3)
X
) norm
. The least-squares problem (3) gives a ̇θ(t) such that the
in the L2(
residual is orthogonal to the tangent space at ˆu(
Θ
∈
}
*
induced by the parameterization ˆu; see Figure 1. Schemes that solve (3) over time have also been
termed Neural Galerkin schemes [7] because (3) can be derived via Galerkin projection as well.
∥ * ∥L2(X ) over
; θ(t)) of the manifold
MΘ =
ˆu(
*
; θ)
X
θ
{
|
; θ(t)) is spanned by the spanning set
; θ(t))
∂θi ˆu(
}
*
{
; θ(t)); it is important to stress that
∇θ(t) ˆu(
*
p
i=1, which are the
The tangent space at ˆu(
*
p
component functions of the gradient
i=1
}
{
is not necessarily a basis of the tangent space because it can contain linearly dependent func-
tions and be non-minimal. The least-squares problem (3) can be realized by assembling a ma-
p points x1, . . . , xn
trix whose columns are the gradient sampled at n
resulting in
≫
Rn×p, which is a batch Jacobian ma-
∇θ(t) ˆu(xn; θ(t))]T
J(θ(t)) = [
trix to which we refer to as Jacobian for convenience in the following. Additionally, we form the
Rn and thus the least-squares
right-hand side vector f (θ(t)) = [f (x1; θ(t)), . . . , f (xn; θ(t))]T
problem
∇θ(t) ˆu(x1; θ(t)), . . . ,
∂θi ˆu(
*
; θ(t))
∈ X
∈
∈
J(θ(t)) ̇θ(t)
min
̇θ(t) ∥
f (θ(t))
∥
−
2
2 .
(4)
The choice of the points x1, . . . , xn is critical so that solutions of (4) are good approximations of
solutions of (3); however, the topic of selecting the points x1, . . . , xn goes beyond this work here and
so we just note that methods for selecting the points exist [1, 7] and that we assume in the following
that we select sufficient points with n
p to ensure that solutions of (4) are good approximations of
solutions of (3)
≫
2.2 Problem Formulation
Challenge 1: Parameters are redundant locally in time. Typically, parameterizations ˆu based on
deep neural networks lead to Jacobian matrices J(θ(t)) that are low rank in the least-squares problem
(4); see, e.g., [37] and Figure 2(a). In our case, a low-rank matrix J(θ(t)) means that components
in ̇θ(t) are redundant, because we assume that the samples x1, . . . , xn are sufficiently rich. Even
if J(θ(t)) is low rank and thus the components in ̇θ(t) are redundant, the problem (4) can still be
3
tangentspaceMΘf(θ(t))ˆu(*;θ(t))spanningsetsparsesubset(a) low-rankness of Jacobian
(b) residual growth
(c) co-adaptation of neurons
Figure 2: (a) Jacobians that have low rank locally in time imply that there are redundant parameters
in the neural network, which motivates the proposed sparse updates that lead to speedups without
losing expressiveness. (b) The residual grows quickly with sequential-in-time training (and dense
updates). This is not due to a limitation with the expressiveness of the network because directly fitting
the network to solutions indicates that there exist other parameters that can lead to lower residuals.
(c) Sequential-in-time training (with dense updates) results in co-adapted neurons as indicated by the
highly correlated columns of the J matrix. Plots for experiment with Allen-Cahn equation (Sec. 4).
solved with standard linear algebra methods such as the singular value decomposition (SVD) because
they compress the matrix J(θ(t)) and regularize for, e.g., the minimal-norm solution; however, the
(np2), and thus is quadratic in the number of
costs of performing the SVD to solve (4) scales as
parameters p. This means that a redundancy in ̇θ(t) of a factor two leads to a 4
increase in the
computational costs. Note that the problem typically is poorly conditioned because J(θ(t)) is low
rank, which makes the direct application of iterative solvers challenging.
O
×
Challenge 2: Overfitting leads to high residual over time. The residual from solving (4) can
rapidly increase over time which in turn increases the overall error. This indicates that the tangent
space along the trajectory θ(t) becomes ill suited for approximating the right-hand side vector f (θ(t))
in (4). We compare the residual of the least-squares problem (4) that is obtained along a trajectory of
θ(t) from sequential-in-time training with the schemes above to the residual of (4) from a network
that is fit to the true solution at each point in time; details in Appendix A.1. As shown in Figure 2(b),
a lower residual is achieved by the network that is fit to the true solution.
We aim to understand this phenomenon through the lens of overfitting: the sequential-in-time training
can be thought of as successive fine-tuning, in the sense that at each time step we must make a small
update to our parameters to match the solution at the next time step. However, fine-tuning is well
known to be prone to over-fitting and model degeneration [3]. In the setting considered in this work,
; θ(t)) does not generalize well to the next time step. Not
overfitting means that the representation ˆu(
*
generalizing well means that a local change to θ(t) is insufficient to move ˆu(
; θ(t)) according to the
*
desired update given by ̇θ(t) to match the right-hand side f (θ(t)), which implies that a large residual
is incurred when solving (4). A common approach to prevent overfitting is dropout [47], especially
when applied to fine-tuning tasks with dropout variants proposed in [3, 29], while other approaches
are formulated specifically around sparse updates [49, 52]. Dropout is motivated by the observation
that dense updates to parameters in neural networks can cause overfitting by leading neurons to
co-adapt. Typically, co-adaptation is characterized by layer-wise outputs with high covariance [9]. In
the case of sequential-in-time training with the schemes discussed above, co-adaptation implies the
columns of the Jacobian matrix J(θ(t)) are correlated and thus close to linearly dependent. So as
neurons co-adapt, component functions of the gradient become redundant and may be less suited
for approximating f (θ(t)) causing the high residual for the least-squares problem; see Figure 2(b).
This could also be characterized by the ill conditioning issue pointed out in [16]. We see empirical
evidence of co-adaptation in Figure 2(c), where we plot component functions of the gradient and see
that they are strongly correlated at the end time T .
4
3 Randomized Sparse Neural Galerkin (RSNG) schemes
We introduce randomized sparse Neural Galerkin (RSNG) schemes that build on the Dirac-Frenkel
variational principle to evolve network parameters θ(t) sequentially over time t but update only
sparse subsets of the components of θ(t) and randomize which components of θ(t) are updated. The
sparse updates reduce the computational costs of solving the least-squares problem (4) while taking
advantage of the low rank structure of J(θ) which indicates components of the time derivative ̇θ(t)
are redundant and can be ignored for updating θ(t) without losing expressiveness. The randomization
of which components of θ(t) are updated prevents the overfitting described above.
3.1 Randomized sketch of residual
To define the sketch matrix St, let e1, . . . , ep be the p-dimensional canonical unit vectors so that ei
has entry one at component i and zeros at all other components. We then define s independent and
identically distributed random variables ξ1(t), . . . , ξs(t) that depend on time t. The distribution of
ξi(t) is π, which is supported over the set of indices
s
is then defined as St = [eξ1(t), . . . , eξs(t)]. The corresponding sketched residual analogous to (2) is
. The random matrix St of size p
}
1, . . . , p
×
{
where now ̇θs(t)
∈
rs(x; θ(t), ̇θs(t)) =
∇
Rs is of dimension s
p.
≪
θ ˆu(x; θ(t))St ̇θs(t)
f (x, ˆu(
; θ(t)) ,
*
−
(5)
3.2 Projections onto randomized approximations of tangent spaces
∇
θ ˆu(
*
; θ(t)) a subset
∂θξi(t) ˆu(
{
*
p
Using the sketch matrix St, we obtain from the spanning set
i=1 of component func-
}
s
tions of
; θ(t)
i=1
}
*
; θ(t)) of
spans at least approximately the tangent space at ˆu(
p elements. The
*
p
i=1 contains many functions that are close to
motivation is that the full spanning set
; θ(t))
}
*
linearly dependent (Jacobian is low rank) and thus sub-sampling the component functions still gives
reasonable tangent space approximations that preserves much of the expressiveness; see Figure 1.
While the low rankness depends on the complexity of the problem and parametrization, we observe
low rankness in all our examples; see Appendix A.1 for further discussion.
; θ(t))
∂θi ˆu(
{
*
s
i=1 with s functions. The set
{
MΘ but has only s
∂θi ˆu(
{
; θ(t)
}
∂θξi(t) ˆu(
≪
s
We now introduce a least-squares problem based on the sparse spanning set
i=1 that
is analogous to the least-squares problem problem based on the full spanning set given in (4). We
seek ̇θs(t)
Rs with s components that solves
∂θξi(t) ˆu(
*
{
; θ(t)
}
∈
min
̇θs(t)∈Rs ∥∇
θ ˆu(
; θ(t))St ̇θs(t)
*
f (
*
; ˆu(
*
2
L2(X ) .
; θ(t)))
∥
−
(6)
To obtain ̇θ(t) to update θ(t), we set ̇θ(t) = St ̇θs(t). Thus, the components of ̇θ(t) that are selected
by St are set to the corresponding value of the component of ̇θs(t) and all other components are set
to zero, which means that the corresponding components of θ(t) are not updated. We can realize
(6) the same way as the full least-squares problem in (4) by using the full Jacobian matrix and St to
define the sparse Jacobian matrix as Js(θ(t)) = J(θ(t))St and the right-hand side vector f (θ(t))
analogous to Section 2 to obtain the discrete least-squares problem
Js(θ(t)) ̇θs(t)
min
̇θs(t) ∥
f (θ(t))
2
2 .
∥
−
(7)
The choice of the distribution π is critical and depends on properties of the Jacobian matrix J(θ(t)).
Distributions based on leverage scores provide tight bounds with regard to the number of columns
one needs to sample in order for the submatrix to be close to an optimal low rank approximation of
the full matrix with high probability [13]. But these distributions can be expensive to sample from.
Instead, uniform sampling provides a fast alternative.
The number of columns will not grow too quickly if the full matrix is sufficiently incoherent [19].
This means some columns do not carry a disproportionate amount of information relative to other
columns. We numerically see that in our case the Jacobian matrix J(θ(t)) is sufficiently incoherent.
Thus we can choose a uniform distribution over the set of indices
to get the benefits of
low rank approximation in a computationally efficient way.
1, . . . , p
{
}
5
Algorithm 1 Randomized Neural Galerkin scheme with sparse updates
Fit parameterization ˆu(
for k = 1, . . . , K do
; θ(0)) to initial condition u0 to obtain θ(0)
*
Draw realization of sketching matrix Sk as described in Section 3.1
Solve for sparse update ∆θ(k−1)
Lift sparse update ∆θ(k−1) = Sk∆θ(k−1)
Update θ(k) = θ(k−1) + δt∆θ(k−1)
with least-squares problem (9)
s
s
end for
3.3 Discretizing in time
We discretize the time interval
tK = T with δt = tk
condition u0. We then update
−
T
with K
N regularly spaced time steps 0 = t0 < t1 <
tk−1 for k = 1, . . . , K. At time t0, we obtain θ(0)
∈
<
Rp by fitting the initial
* * *
∈
for k = 1, . . . , K so that θ(k) is the time-discrete approximation of θ(tk) and thus ˆu(
*
imates the solution u at time tk. The sparse update ∆θ(k−1)
the time-discrete counterpart of (7), which is given by
s
(8)
; θ(k)) approx-
approximates ̇θs(tk−1) and is obtain by
θ(k) = θ(k−1) + δt∆θ(k−1)
min
∆θ(k−1)
s
Js(θ(k−1))Sk∆θ(k−1)
∥
s
f (θ(k−1))
∥
2
2 ,
−
(9)
if time is discretized with the forward Euler method. Other discretization schemes can be used as
well, which then lead to technically more involved problems (9) that remain conceptually similar
though. The sparse update is lifted to ∆θ(k−1) = Sk∆θ(k−1)
so that the update (8) can be computed.
s
3.4 Computational procedure of RSNG
We describe the proposed RSNG procedure in algorithmic form in Algorithm 1. We iterate over
the time steps k = 1, . . . , K. At each time step, we first sketch the Jacobian matrix by creating a
submatrix from randomly sampled columns. Notice that Sk need not actually be assembled as its
action on the Jacobian matrix can be accomplished by indexing. We then solve the least-squares
problem given in (9) using our sketched Jacobian to obtain ∆θ(k−1)
. A direct solve of this system
dominates the computational cost of making a time step and scales in O(ns2) time. The components
of ∆θ(k−1) corresponding to the indices that have not been selected are filled with zeros. We then
update the parameter θ(k−1) to θ(k) via ∆θ(k−1).
The whole integration process scales as O( T
s
δt ns2) in time.
4 Numerical experiments
We demonstrate RSNG on a wide range of evolution equations, where speedups of up to two orders
of magnitude are achieved compared to comparable schemes with dense updates. We also compare to
global-in-time methods, where we achieve up to two orders of magnitude higher accuracy.
4.1 Setup and equations
Examples We now describe the details of the PDEs that we use to evaluate our method. We choose
these particular setups to test our method on a diverse set of challenges including problems with global
and local dynamics and solutions with sharp gradients and fine grained details. For visualization of
the solutions of these equations see the Appendix A.4.
Reaction-diffusion problem modeled by Allen-Cahn (AC) equation: The Allen-Cahn equation models
prototypical reaction diffusion phenomena and is given as,
We choose ε = 5
×
∂tu(t, x) = ε∂xxu(t, x) + u(t, x)
10−3, with periodic boundary condition
−
X
u(t, x)3.
= [0, 2π) and initial condition,
6
1
3
u0(x) =
π
2
This initial condition results in challenging dynamics that are global over the spatial domain.
4.2)2) + exp(
tanh(2 sin(x))
)2) + exp(
23.5(x
27(x
38(x
exp(
−
−
−
−
−
−
−
5.4)2)).
Flows with sharp gradients described by Burgers' equation: The Burgers' equation is given by,
We choose ε = 1
×
∂tu(t, x) = ε∂xxu(t, x)
10−3, with periodic boundary condition
−
u(t, x)∂xu(t, x).
= [
1, 1) and initial condition,
u0(x) = (1
x2) exp(
−
−
−
X
30(x + 0.5)2).
The corresponding solution field has sharp gradients that move in the spatial domain over time, which
can be challenging to approximate.
Charged particles in electric field: The Vlasov equation describes the time evolution of collisionless
charged particles under the influence of an electric field. The equation models the distribution of such
particles in terms of their position and velocity. We consider the case of one position dimension and
one velocity dimension, making our domain
R2. The equation is given by,
X ⊆
∂tu(t, x, v) =
v∂xu(t, x, v) + ∂xφ(x)∂vu(t, x, v)
−
where x is the position, v is the velocity and φ is the electric field. We consider the case with periodic
boundary condition
6, 6) and initial condition,
= [0, 2π)
[
X
×
−
u0(x, v) =
1
√2π
v2
exp( −
2
)
with a fixed electric field φ(x) = cos(x). This particular setup evolves into a distribution with fine
grained details along a separatrix surrounding the potential well.
∈
Setup We parameterize with a feed-forward multi-layer perceptron. All our networks use linear
layers of width 25 followed by non-linear activation functions, except the last layer which has no
R. To vary the number of total parameters p, we
activation and is of width 1 so that ˆu(x, θ(t))
vary the depth of networks ranging from 3–7 layers. We use rational activation functions which in our
experiments allowed for fitting initial conditions faster and more accurately than a standard choice
such as tanh or ReLU [5]. To enforce periodic boundary conditions, we modify the first layer so
that it outputs periodic embeddings as in [7]; for details see Appendix A.5. The periodic embedding
ensures that the boundary conditions are enforced exactly. For additional details on enforcing other
types of boundary conditions (e.g. Dirichlet and Neumann) exactly in neural networks see [12, 7, 48].
We sample points from the domain on an equidistant grid. For time integration we use a RK4 scheme
with a fixed time step size. The time step sizes are 5e
3 and we integrate up to end
time 4, 4, and 3 for the Allen-Cahn, Burgers', and Vlasov equations, respectively. All error bars show
two standard errors over three random realizations which results in different sketching matrices
+/
at each time step. Relative errors are computed over the full space-time domain, unless the plot is
explicitly over time.
3, 5e
3, 1e
−
−
−
−
All gradients and spatial derivatives are computed with automatic differentiation implemented in
JAX [6]. All computations are done in single precision arithmetic which is the default in JAX. All
runtime statistics were computed on the same hardware, a Nvidia Tesla V100 w/ 32 GB memory. All
additional hyperparameters are described in Appendix A.5.
4.2 Results
RSNG achieves higher accuracy than schemes with dense updates at same computational costs
In Figure 3 we plot the relative error over time. The curves corresponding to "dense updates" use
a 3 layer network and integration is performed using dense updates. For RSNG, we use a 7 layer
network and integrate with sparse updates, setting the number of parameters we update, s, equal to
the total number of parameters in the 3 layer network and thus equal to the number of parameters that
are updated by "dense updates." Thus, the comparison is at a fixed computational cost. The error
achieved with RSNG is one to two orders of magnitude below the error obtained with dense updates,
across all examples that we consider. In Figure 4(a), we see that as we increase the network size,
7
(a) Allen-Cahn
(b) Burgers'
(c) Vlasov
Figure 3: We plot the relative error over time for RSNG versus dense updates at s = 757. We see
RSNG leads to orders of magnitude lower errors than dense updates for the same costs.
(a) fix sparsity s, vary #network parameters p
(b) fix #network parameters p, vary sparsity s
Figure 4: (a) RSNG benefits from the additional expressiveness of larger networks (larger p) while
only using a fixed number of parameters (fixed s) at each time step. (b) As we decrease the number
of parameters s in the sparse update, but keep the total number of parameters p of the network the
same, we achieve lower errors than dense updates. Thus, RSNG outperforms dense updates while
incurring lower computational costs. Error bars generated over random sketch matrices, St.
the relative error decreases as the sparse updates allow us to exploit the greater expressiveness of
larger networks while incurring no additional computational cost in computing (9). But we note that
increasing the size of the full network will make computations of J(θ) and f (θ) more expensive
because of higher costs of computing gradients. However, for the network sizes that we consider in
this work, this effect is negligible compared to the cost of solving (9).
RSNG achieves speedups of up to two orders of magnitude
In Figure 5(a), we compare the
runtime of RSNG to the runtime of a scheme with dense updates that uses a direct solver and to the
runtime of a scheme with dense updates that uses an iterative solver as proposed in [16]. The time is
computed for Burgers' equation and the sparsity s of RSNG is chosen such that all methods reach a
comparable level of error. We find that RSNG is faster than direct solves with dense updates by two
orders of magnitude and faster than the iterative solver by one order of magnitude.
The results show that while using an iterative solver as in [16] does speed up the method relative
to direct solves with dense updates, it can still be quite slow for networks with many parameters p.
Additionally, convergence of the iterative method given in [16] requires a number of hyperparameters
to be chosen correctly, which may require an expensive search or a priori knowledge about the
solution. Note that our RSNG method does not preclude the use of an iterative method to speed up
the least-squares solves further.
8
(a) runtime at 2e
−
4 relative error with s = 125
(b) error versus runtime
Figure 5: RSNG has lower computational costs than dense updates with direct and iterative least-
squares solvers. Plots for numerical experiment with Burgers' equation
To address the overfitting problem, the work [16] refits the network to the current approximate
solution from a random initialization periodically during time integration. In Figure 5(b), we show
the relative error versus the runtime for the iterative solver with various numbers of refits and for
RSNG at different sparsity s. While refitting the network can reduce the relative error, it incurs a high
computational cost. By contrast, for appropriate sparsity s, RSNG outperforms the method given in
[16] in both speed and accuracy.
Varying sparsity s at fixed number of total parameters p in network We now study the effect
of varying the sparsity s (i.e., number of parameters updated by sparse updates) for a fixed network
of total size p, in this case a 7 layer network. In Figure 4(b), we see that for a network of fixed size,
sparse updates can reduce the relative error by about 2–3
when compared to dense updates. This is
notable as the computational costs decrease quadratically with s. Thus, the combination of sparsity
and randomized updates in RSNG can deliver both improved performance and lower computational
cost. We see that at the beginning, when the number s is too small, the expressiveness suffers and
the error becomes large. This is because if s is less than the rank of the dense Jacobian then the
sparsified Jacobian will necessarily have less representational power. However, we stress that RSNG
is robust with respect to s in the sense that for a wide range of s values the error is lower than for
dense updates.
×
The high error when performing dense updates s = p in Figure 4(b) for Allen-Cahn and Burgers'
equation is due to the overfitting problem described in Section 2.2. As updates become denser, the
method is more likely to overfit to regions of the parameter space in which the Jacobian, J(θ), is
ill suited for approximating the right-hand side f at future time steps (see Section 2). We can see
this explicitly in Figure 6 where we plot the residual over time for sparse and dense updates on the
Allen-Cahn equation. Initially, the dense updates lead to a lower residual. This makes sense as they
begin at the same region of parameters space. But as the two methods navigate to different regions
of parameters space, we see RSNG begins to incur a lower residual relative to dense updates. This
indicates that RSNG ameliorates the problem of overfitting and so leads to a lower residual as shown
in Figure 6(b).
Comparison with global-in-time methods We compare our method to global-in-time methods
which aim to globally minimize the PDE residual over the entire space-time domain. We compare to
the original PINN formulation given in [41]. Additionally we compare to a variant termed Causal
PINNs, which impose a weak form of time dependence through the loss function [51]. We select
this variant as it claims to have state of the art performance among PINNs on problems such as
the Allen-Cahn equation. In Table 1, we see that our sequential-in-time RSNG method achieves
a higher accuracy by at least one order of magnitude compared to PINNs. Additionally, in terms
of computational costs, RSNG outperforms both PINN variants, as their global-in-time training is
expensive and requires many residual evaluations. We note that the training time of PINNs is directly
9
Figure 6: Plot (a) shows the
residual of dense and sparse up-
dates at early time steps.
Ini-
tially, dense updates must have
a lower residual as JSt spans a
subspace of the tangent space
given by J. But in plot (b),
we see that after a few time
steps, dense updates overfit and
the residual grows quicker than
with sparse updates.
(a) residual at early times
(b) residual over full time
PDE
Method
L2 Relative Error Time(s)
s
Allen-Cahn
PINN
6.85e
Allen-Cahn Causal PINN 3.84e
Allen-Cahn RSNG
Allen-Cahn RSNG
1.66e−5
5.34e
5
−
−
2
4
Burgers'
Burgers'
Burgers'
Burgers'
PINN
2.34e
Causal PINN 5.19e
RSNG
RSNG
6.07e−5
2.05e
−
−
3
4
4
−
−
841
3060
776
63
3451
23027
2378
188
N/A
N/A
800
150
N/A
N/A
800
125
Table 1: The sequential-in-time training with RSNG achieves about one order of magnitude higher
accuracy than global-in-time methods in our examples. Details on training in Appendix A.6.
dependent on the number of optimization iterations and thus they can be trained faster if one is willing
to tolerate even higher relative errors.
5 Conclusions, limitations, and future work
In this work, we introduced RSNG that updates randomized sparse subsets of network parameters in
sequential-in-time training with the Dirac-Frenkel variational principle to reduce computational costs
while maintaining expressiveness. The randomized sparse updates are motivated by a redundancy of
the parameters and by the problem of overfitting. The randomized sparse updates have a low barrier
of implementation in existing sequential-in-time solvers. The proposed RSNG achieves speedups
of up to two orders of magnitude compared to dense updates for computing an approximate PDE
solution with the same accuracy.
Current limitations leave several avenues for future research: first, as discussed in 3.2, uniform
sampling is only appropriate when the Jacobian matrix is of low coherence. Future work may
investigate more sophisticated sampling methods such as leverage score and pivoting elements of
rank revealing QR. Second, there are problems for which overfitting with dense updates is less of an
issue; e.g., the charged particles example in our work. Note that due to the sparsity of the updates,
RSNG still achieves a speedup compared to dense updates for the same accuracy for this example
though. However, more work is needed to better understand and mathematically characterize which
properties of the problems influence the overfitting issue.
We make a general comment about using neural networks for numerically solving PDEs: The
equations discussed in this paper are standard benchmark examples used in the machine-learning
literature; however, for these equations, carefully designed classical methods can succeed and
often have lower runtimes than methods based on nonlinear parameterizations [20, 36]. While
these equations provide an important testing ground to demonstrate methodological improvements,
future work will extend these results to domains where classical linear methods struggle, e.g.,
high-dimensional problems and problems with slowly decaying Kolmogorov n-widths [15, 7, 40].
We do not expect that this work has negative societal impacts.
10
Acknowledgements The authors were partially supported by the National Science Foundation
under Grant No. 2046521 and the Office of Naval Research under award N00014-22-1-2728. This
work was also supported in part through the NYU IT High Performance Computing resources,
services, and staff expertise.
References
[1] William Anderson and Mohammad Farazmand. Evolution of nonlinear reduced-order solutions
for PDEs with conserved quantities. SIAM Journal on Scientific Computing, 44(1):A176–A197,
2022.
[2] Yohai Bar-Sinai, Stephan Hoyer, Jason Hickey, and Michael P. Brenner. Learning data-driven
discretizations for partial differential equations. Proceedings of the National Academy of
Sciences, 116(31):15344–15349, 2019.
[3] Antonio Valerio Miceli Barone, Barry Haddow, Ulrich Germann, and Rico Sennrich. Regu-
larization techniques for fine-tuning in neural machine translation. CoRR, abs/1707.09920,
2017.
[4] Jens Berg and Kaj Nyström. A unified deep artificial neural network approach to partial
differential equations in complex geometries. Neurocomputing, 317:28–41, nov 2018.
[5] Nicolas Boulle, Yuji Nakatsukasa, and Alex Townsend. Rational neural networks.
In
H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural
Information Processing Systems, volume 33, pages 14243–14253. Curran Associates, Inc.,
2020.
[6] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal
Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao
Zhang. JAX: composable transformations of Python+NumPy programs. 2018.
[7] J. Bruna, B. Peherstorfer, and E. Vanden-Eijnden. Neural Galerkin scheme with active learning
for high-dimensional evolution equations. arXiv:2203.01360, 2022.
[8] Peter Yichen Chen, Maurizio M. Chiaramonte, Eitan Grinspun, and Kevin Carlberg. Model
reduction for the material point method via an implicit neural representation of the deformation
map. Journal of Computational Physics, 478:111908, 2023.
[9] Michael Cogswell, Faruk Ahmed, Ross B. Girshick, Larry Zitnick, and Dhruv Batra. Reducing
overfitting in deep networks by decorrelating representations. In Yoshua Bengio and Yann
LeCun, editors, 4th International Conference on Learning Representations, ICLR 2016, San
Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016.
[10] P. A. M. Dirac. Note on exchange phenomena in the thomas atom. Mathematical Proceedings
of the Cambridge Philosophical Society, 26(3):376–385, 1930.
[11] M. W. M. G. Dissanayake and N. Phan-Thien. Neural-network-based approximations for
solving partial differential equations. Communications in Numerical Methods in Engineering,
10(3):195–201, 1994.
[12] Suchuan Dong and Naxian Ni. A method for representing periodic functions and enforcing
exactly periodic boundary conditions with deep neural networks. Journal of Computational
Physics, 435:110242, jun 2021.
[13] Petros Drineas, Michael W. Mahoney, and S. Muthukrishnan. Relative-error CUR matrix
decompositions. CoRR, abs/0708.3696, 2007.
[14] Yifan Du and Tamer A. Zaki. Evolutional deep neural network. Physical Review E, 104(4), oct
2021.
[15] Weinan E, Jiequn Han, and Arnulf Jentzen. Algorithms for solving high dimensional PDEs:
from nonlinear Monte Carlo to machine learning. Nonlinearity, 35(1):278, dec 2021.
[16] Marc Anton Finzi, Andres Potapczynski, Matthew Choptuik, and Andrew Gordon Wilson. A
stable and scalable method for solving initial value PDEs with neural networks. In The Eleventh
International Conference on Learning Representations, 2023.
[17] J. Frenkel. Wave Mechanics, Advanced General Theory. Clarendon Press, Oxford, 1934.
11
[18] Stefania Fresca and Andrea Manzoni. POD-DL-ROM: Enhancing deep learning-based reduced
order models for nonlinear parametrized PDEs by proper orthogonal decomposition. Computer
Methods in Applied Mechanics and Engineering, 388:114181, 2022.
[19] Alex Gittens. The spectral norm error of the naive Nystrom extension. arXiv, 1110.5305, 2011.
[20] Tamara G. Grossmann, Urszula Julia Komorowska, Jonas Latz, and Carola-Bibiane Schönlieb.
Can physics-informed neural networks beat the finite element method? arXiv, 2302.04107,
2023.
[21] Jiequn Han, Arnulf Jentzen, and Weinan E. Solving high-dimensional partial differential
equations using deep learning. Proceedings of the National Academy of Sciences, 115(34):8505–
8510, 2018.
[22] Jan S. Hesthaven, Cecilia Pagliantini, and Gianluigi Rozza. Reduced basis methods for time-
dependent problems. Acta Numerica, 31:265–345, 2022.
[23] Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving for high-dimensional committor functions
using artificial neural networks. Research in the Mathematical Sciences, 6(1):1, Oct 2018.
[24] Othmar Koch and Christian Lubich. Dynamical low-rank approximation. SIAM Journal on
Matrix Analysis and Applications, 29(2):434–454, 2007.
[25] Dmitrii Kochkov, Jamie A. Smith, Ayya Alieva, Qing Wang, Michael P. Brenner, and Stephan
Hoyer. Machine learning–accelerated computational fluid dynamics. Proceedings of the
National Academy of Sciences, 118(21), 2021.
[26] Peter Kramer and Marcos Saraceno. Geometry of the time-dependent variational principle in
quantum mechanics. In Lecture Notes in Physics, volume 140. Springer, 1981.
[27] Aditi S. Krishnapriyan, Amir Gholami, Shandian Zhe, Robert M. Kirby, and Michael W.
Mahoney. Characterizing possible failure modes in physics-informed neural networks. CoRR,
abs/2109.01050, 2021.
[28] Caroline Lasser and Christian Lubich. Computing quantum dynamics in the semiclassical
regime. Acta Numerica, 29:229–401, 2020.
[29] Cheolhyoung Lee, Kyunghyun Cho, and Wanmo Kang. Mixout: Effective regularization to
finetune large-scale pretrained language models. CoRR, abs/1909.11299, 2019.
[30] Kookjin Lee and Kevin T. Carlberg. Model reduction of dynamical systems on nonlinear mani-
folds using deep convolutional autoencoders. Journal of Computational Physics, 404:108973,
2020.
[31] Qianxiao Li, Bo Lin, and Weiqing Ren. Computing committor functions for the study of rare
events using deep learning. The Journal of Chemical Physics, 151(5):054112, 2019.
[32] Zongyi Li, Nikola Borislavov Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhat-
tacharya, Andrew M. Stuart, and Anima Anandkumar. Fourier neural operator for parametric
partial differential equations. In 9th International Conference on Learning Representations,
ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021.
[33] Lu Lu, Pengzhan Jin, Guofei Pang, Zhongqiang Zhang, and George Em Karniadakis. Learning
nonlinear operators via DeepONet based on the universal approximation theorem of operators.
Nature Machine Intelligence, 3(3):218–229, Mar 2021.
[34] Christian Lubich. From Quantum to Classical Molecular Dynamics: Reduced Models and
Numerical Analysis. EMS Press, 2008.
[35] E. Musharbash, F. Nobile, and T. Zhou. Error analysis of the dynamically orthogonal approxima-
tion of time dependent random PDEs. SIAM Journal on Scientific Computing, 37(2):A776–A810,
2015.
[36] K. Otness, A. Gjoka, J. Bruna, D. Panozzo, B. Peherstorfer, T. Schneider, and D. Zorin. An
extensible benchmark suite for learning to simulate physical systems. In NeurIPS 2021 Track
Datasets and Benchmarks, 2021.
[37] Samet Oymak, Zalan Fabian, Mingchen Li, and Mahdi Soltanolkotabi. Generalization, adap-
tation and low-rank representation in neural networks. In 2019 53rd Asilomar Conference on
Signals, Systems, and Computers, pages 581–585, 2019.
[38] B. Peherstorfer. Model reduction for transport-dominated problems via online adaptive bases
and adaptive sampling. SIAM Journal on Scientific Computing, 42:A2803–A2836, 2020.
12
[39] B. Peherstorfer and K. Willcox. Online adaptive model reduction for nonlinear systems via
low-rank updates. SIAM Journal on Scientific Computing, 37(4):A2123–A2150, 2015.
[40] Benjamin Peherstorfer. Breaking the Kolmogorov barrier with nonlinear model reduction.
Notices of the American Mathematical Society, 69(5):725–733, May 2022.
[41] M. Raissi, P. Perdikaris, and G.E. Karniadakis. Physics-informed neural networks: A deep
learning framework for solving forward and inverse problems involving nonlinear partial
differential equations. Journal of Computational Physics, 378:686–707, 2019.
[42] R. Rico-Martinez, K. Krischer, I. G. Kevrekidis, M. C. Kube, and J. L. Hudson. Discrete- vs.
continuous-time nonlinear signal processing of cu electrodissolution data. Chemical Engineering
Communications, 118(1):25–48, 1992.
[43] Grant M. Rotskoff, Andrew R. Mitchell, and Eric Vanden-Eijnden. Active importance sam-
pling for variational objectives dominated by rare events: Consequences for optimization and
generalization. arXiv, 2008.06334, 2021.
[44] Samuel H. Rudy, J. Nathan Kutz, and Steven L. Brunton. Deep learning of dynamics and
signal-noise decomposition with time-stepping constraints. Journal of Computational Physics,
396:483–506, 2019.
[45] Themistoklis P. Sapsis and Pierre F.J. Lermusiaux. Dynamically orthogonal field equations for
continuous stochastic dynamical systems. Physica D: Nonlinear Phenomena, 238(23):2347–
2360, 2009.
[46] Justin Sirignano and Konstantinos Spiliopoulos. DGM: A deep learning algorithm for solving
partial differential equations. Journal of Computational Physics, 375:1339–1364, dec 2018.
[47] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov.
Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine
Learning Research, 15(56):1929–1958, 2014.
[48] N. Sukumar and Ankit Srivastava. Exact imposition of boundary conditions with distance
functions in physics-informed deep neural networks. Computer Methods in Applied Mechanics
and Engineering, 389:114333, 2022.
[49] Yi-Lin Sung, Varun Nair, and Colin Raffel. Training neural networks with fixed sparse masks.
arXiv, 2111.09839, 2021.
[50] Qian Wang, Nicolò Ripamonti, and Jan S. Hesthaven. Recurrent neural network closure
of parametric POD-Galerkin reduced-order models based on the Mori-Zwanzig formalism.
J. Comput. Phys., 410:109402, 2020.
[51] Sifan Wang, Shyam Sankaran, and Paris Perdikaris. Respecting causality is all you need for
training physics-informed neural networks. arXiv, 2203.07404, 2022.
[52] Elad Ben Zaken, Shauli Ravfogel, and Yoav Goldberg. BitFit: Simple parameter-efficient
fine-tuning for transformer-based masked language-models. arXiv, 2106.10199, 2022.
[53] Linfeng Zhang, Jiequn Han, Han Wang, Roberto Car, and Weinan E. Deep potential molecular
dynamics: A scalable model with the accuracy of quantum mechanics. Phys. Rev. Lett.,
120:143001, Apr 2018.
[54] Tianchen Zhao, Chuhao Sun, Asaf Cohen, James Stokes, and Shravan Veerapaneni. Quantum-
inspired variational algorithms for partial differential equations: Application to financial deriva-
tive pricing. arXiv, 2207.10838, 2022.
13
A Appendix
A.1 Details on Figure 2
For Figure 2a–b we look at quantities generated by fitting a network to the true solution at a point in
time t. This is done in the same way we fit initial conditions described in A.5, but in this context the
target function is taken to be the true solution at time t. For Figure 2(a), we compute the Jacobian of
the network fitted to the true solution at each point in time and then plot its spectrum. For Figure 2(b),
we take the network fitted to the true solution and compute the residual from the least-squares
problem 4 to give the data points in the "Direct fit" line.
In Figure 7 we provide versions of Figure 2(a) from the main text but for all the equations considered.
Vlasov is a more complex problem that exhibits a less sharp decay but is still distinctly rank deficient.
A.2 Details on Speed-Up
Here we provide additional results on the speed-up provided by RSNG for different equations. In
Figure 8 we provide versions of Figure 5(a) from the main text but for all the equations considered.
In Figure 9 we show how the runtime of Neural Galerkin schemes scales with s, thus showing the
quadratic speed-up provided by RSNG as we reduce s.
A.3 Applications to High Dimensional Problems
Neural Galerkin schemes have been shown to be a useful approach to high dimensional PDEs [7]. In
Figure 10 we demonstrate that RSNG may be applicable in these settings we well. We fit a neural
network to a numerical solution of the Fokker-Planck equation in 5 dimensions; see [7, Section 5.4.1]
for a description of the setup. The results show that for a sufficiently large network, the Jacobian has
a low-rank structure as in the examples in the paper and a steep decay in the singular values so that
random sketching strategies will likely be successful.
A.4 Ground Truth
The ground truth for the Allen-Cahn and Burgers' equations were generated using a spectral method
with a fourth order integrator implemented in the spin solver as part of the Chebfun package in
Matlab. We used a spatial grid of 10 000 points and time step size of 1e
3.
The ground truth for the Vlasov equation was generated with a 4th order finite difference scheme in
space and an RK4 time integration scheme. We sample 106 points over the full 2D space domain and
a time step size of 1e
3 was used for time integration.
−
In Figure 11,12,13 we show plots of the ground truth solutions at the beginning, middle, and end
of integration time for the equations we examine. We can see that they display the characteristics
described in Section 4.1.
−
(a) Allen-Cahn
(b) Burgers'
(c) Vlasov
Figure 7: Decay of singular values of J(θ(t))
14
(a) Allen-Cahn, error 5e
5, s = 150
−
(b) Burgers', error 2e
4, s = 125
−
(c) Vlasov, error 2e
4, s = 800
−
Figure 8: Speedups of RSNG over dense updates with direct and iterative solver.
(a) Allen-Cahn
(b) Burgers'
(c) Vlasov
Figure 9: Speedups of RSNG scale quadratic with sparsity s.
Figure 10: Singular values of the
Jacobian of the network fit to a
Fokker-Planck solution in five di-
mension decays quickly too; pro-
viding indication that our RSNG
approach is applicable in these set-
tings as well.
(a) t = 0
(b) t = 2
(c) t = 4
Figure 11: True solution u(t, x) for Allen-Cahn
15
(a) t = 0
(b) t = 2
(c) t = 4
Figure 12: True solution u(t, x) for Burgers'
(a) t = 0
(b) t = 1.5
(c) t = 3
Figure 13: True solution (top) vs RSNG solution (bottom) for Vlasov
A.5 Architecture and Hyperparameters
For an input x
∈
parameters a, φ, b
Rd as,
∈
Rd a periodic embedding layer with period P is defined with the optimization
PeriodicEmbed(x) =
d
(cid:88)
(cid:20)
a cos(x
(cid:21)
+ φ) + b
.
2π
P
i
i=1
This operation is the repeated w times for different parameters a, φ, b where w denotes the width of
the layer resulting in a output vector y
To fit the initial condition, we minimize the L2 distance between the network and the initial condition
as well as the L2 distance between the first derivative of the network and the first derivative of the
initial condition with respect to the spatial domain
. We evaluate the loss function over 10 000
equispaced points for Allen-Cahn and Burgers' equation and 200 000 points for Vlasov. We fit our
initial conditions with two nonlinear solvers. First we run L-BFGS with 1000 iterations, then we use
an Adam optimizer with the following hyperparameters,
Rw
X
∈
• iterations : 100 000
• learning rate : 1e
3
• scheduler : cosine decay
−
16
• decay steps : 500
The number of iterations and the number of points we sample are chosen to fit the initial condition to
high accuracy to avoid polluting the results in our analysis with errors of fitting the initial condition.
To assemble the Jacobian matrix J(θ(t)), the gradient of ˆu is evaluated on samples generated from
the spatial domain. If not noted otherwise, we use 10 000 equidistant points for Allen-Cahn and
Burgers' and 200 000 equidistant points for Vlasov. For the time-optimized RSNG results in Table 1
(rows 4 and 8) we use 1000 equidistant points for Allen-Cahn and Burgers'. In the dense and sparse
least-squares system we regularize the direct solver so as to avoid numerical instability. For this
4,
we set the rcond parameters in numpy implementation of lstsq. The values used are 1e
1e
5 for Allen-Cahn, Burgers', and Vlasov respectively.
4, 1e
−
−
−
A.6 Global Methods Benchmark
Here we detail the training setups for our benchmarks of the global methods given in Table 1.
For all PINN experiments we sampled data on a grid with 100 points in the time domain and 256
points in the spatial domain. All PINNs were trained with the following hyperparameters:
• optimizer : Adam then L-BFGS
• spatial samples : 256
• time samples : 100
• activation : tanh
For the plain PINN experiments our architecture is a MLP with layers sizes as follows: [2, 128, 128,
128, 128, 1]. Boundary and initial conditions were enforced through a penalty in the loss function.
For the Causal PINNs we use the architecture described in the original paper, with periodic embedding
and "modified MLP layers." The layer sizes were as follows: [periodic embedding, 128, 128,
128, 128, 1]. Our implementation uses much of the original code provided in [51]. We used only
one time-window for training as this is what was chosen in [51] for the Allen-Cahn equation. The
tolerance hyperparameter, which controls the degree to which the loss function enforces causal
training, was set to 100 and 50 for the Allen-Cahn and Burgers' equations respectively. Additionally
the λic parameter, which controls the loss functions' weighting on the initial condition, was set to
100 and 1 for the Allen-Cahn and Burgers' equations respectively. These were both chosen via a
hyperparameter search. For details on the context and meaning of these hyperparameters see the
original paper [51].
The PINNs trained for Allen-Cahn used 1000 steps of Adam followed by 30000 steps of L-BFGS.
For Burgers' equations we used 1000 steps of Adam followed by 60000 steps of L-BFGS. More steps
are needed for Burgers' equation in order to sufficiently resolve the sharp gradient in the solution
due to the low viscosity number. We similarly choose a smaller timestep for Burgers' in the Neural
Galerkin schemes. We note that fewer optimization iterations can be used for training PINNs but
this resulted in much larger errors in our experiments. In any case, widely varying the number
optimization iterations and other PINNs hyperparameters did not achieve errors in the range of what
RSNG achieves in these examples.
17
|
|
http://arxiv.org/abs/2310.04865v1 | "2023-10-07T16:21:04" | "2023-10-07T16:21:04" | ForeSeer: Product Aspect Forecasting Using Temporal Graph Embedding | Developing text mining approaches to mine aspects from customer reviews has
been well-studied due to its importance in understanding customer needs and
product attributes. In contrast, it remains unclear how to predict the future
emerging aspects of a new product that currently has little review information.
This task, which we named product aspect forecasting, is critical for
recommending new products, but also challenging because of the missing reviews.
Here, we propose ForeSeer, a novel textual mining and product embedding
approach progressively trained on temporal product graphs for this novel
product aspect forecasting task. ForeSeer transfers reviews from similar
products on a large product graph and exploits these reviews to predict aspects
that might emerge in future reviews. A key novelty of our method is to jointly
provide review, product, and aspect embeddings that are both time-sensitive and
less affected by extremely imbalanced aspect frequencies. We evaluated ForeSeer
on a real-world product review system containing 11,536,382 reviews and 11,000
products over 3 years. We observe that ForeSeer substantially outperformed
existing approaches with at least 49.1\% AUPRC improvement under the real
setting where aspect associations are not given. ForeSeer further improves
future link prediction on the product graph and the review aspect association
prediction. Collectively, Foreseer offers a novel framework for review
forecasting by effectively integrating review text, product network, and
temporal information, opening up new avenues for online shopping recommendation
and e-commerce applications. | [
"Zixuan Liu",
"Gaurush Hiranandani",
"Kun Qian",
"Eddie W. Huang",
"Yi Xu",
"Belinda Zeng",
"Karthik Subbian",
"Sheng Wang"
] | 10.1145/3583780.3614887 | [
{
"@title": "doi",
"@href": "http://dx.doi.org/10.1145/3583780.3614887",
"@rel": "related",
"@type": null
},
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04865v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04865v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.IR",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.IR",
"cs.AI",
"cs.CL",
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
R
I
.
s
c
[
1
v
5
6
8
4
0
.
0
1
3
2
:
v
i
X
r
a
ForeSeer: Product Aspect Forecasting Using Temporal Graph
Embedding
Zixuan Liu∗
zucksliu@cs.washington.edu
University of Washington
Seattle, WA, USA
Edward W. Huang
ewhuang@amazon.com
Amazon
Palo Alto, CA, USA
Gaurush Hiranadani
hgaurush@amazon.com
Amazon
Palo Alto, CA, USA
Yi Xu
yxaamzn@amazon.com
Amazon
Seattle, WA, USA
Kun Qian
qianku@amazon.com
Amazon
Palo Alto, CA, USA
Belinda Zeng
zengb@amazon.com
Amazon
Seattle, WA, USA
Karthik Subbian
ksubbian@amazon.com
Amazon
Palo Alto, CA, USA
Sheng Wang
swang@cs.washington.edu
University of Washington
Seattle, WA, USA
ABSTRACT
Developing text mining approaches to mine aspects from customer
reviews has been well-studied due to its importance in understand-
ing customer needs and product attributes. In contrast, it remains
unclear how to predict the future emerging aspects of a new prod-
uct that currently has little review information. This task, which we
named product aspect forecasting, is critical for recommending new
products, but also challenging because of the missing reviews. Here,
we propose ForeSeer, a novel textual mining and product embed-
ding approach progressively trained on temporal product graphs
for this novel product aspect forecasting task. ForeSeer transfers
reviews from similar products on a large product graph and ex-
ploits these reviews to predict aspects that might emerge in future
reviews. A key novelty of our method is to jointly provide review,
product, and aspect embeddings that are both time-sensitive and
less affected by extremely imbalanced aspect frequencies. We eval-
uated ForeSeer on a real-world product review system containing
11,536,382 reviews and 11,000 products over 3 years. We observe
that ForeSeer substantially outperformed existing approaches with
at least 49.1% AUPRC improvement under the real setting where
aspect associations are not given. ForeSeer further improves future
link prediction on the product graph and the review aspect associa-
tion prediction. Collectively, Foreseer offers a novel framework for
review forecasting by effectively integrating review text, product
network, and temporal information, opening up new avenues for
online shopping recommendation and e-commerce applications.
∗This research was conducted during the author's internship at Amazon.
This work is licensed under a Creative Commons Attribution
International 4.0 License.
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
© 2023 Copyright held by the owner/author(s).
ACM ISBN 979-8-4007-0124-5/23/10.
https://doi.org/10.1145/3583780.3614887
CCS CONCEPTS
• Information systems → Data mining; Information retrieval;
Language models; • Computing methodologies → Machine
learning; Information extraction; Semantic networks; Tem-
poral reasoning; Transfer learning.
KEYWORDS
Aspect forecasting, textual mining, temporal graph embedding,
multi-time forecasting, information extraction, contrastive learning
ACM Reference Format:
Zixuan Liu, Gaurush Hiranadani, Kun Qian, Edward W. Huang, Yi Xu, Be-
linda Zeng, Karthik Subbian, and Sheng Wang. 2023. ForeSeer: Product
Aspect Forecasting Using Temporal Graph Embedding. In Proceedings of the
32nd ACM International Conference on Information and Knowledge Manage-
ment (CIKM '23), October 21–25, 2023, Birmingham, United Kingdom. ACM,
New York, NY, USA, 11 pages. https://doi.org/10.1145/3583780.3614887
1 INTRODUCTION
Customer reviews reflect the properties of the product and the
needs of the customer on online shopping systems [24, 88]. As a
result, one widely studied task is to extract descriptive keywords
from customer reviews, such as "not greasy" and "soft inside". These
descriptive keywords, which are referred to as aspects in the liter-
ature, are later used as key features for various applications that
are beneficial to buyers making decisions and sellers improving
the market, such as customer behavior prediction [48], sentiment
analysis [42], opinion mining [26, 71], product rating [34], and mar-
keting refinement [62]. To tackle this problem, many text mining
methods have been proposed to mine such aspects from customer
reviews [4, 7, 18, 25, 53, 73, 79, 83, 84].
Despite its usefulness, however, customer reviews are also subjec-
tive and sometimes biased, therefore mining effective aspects from
reviews for a product requires adequate numbers of reviews. For a
new product with limited customer reviews, aspect mining meth-
ods will suffer from starting cold and mining inaccurate and noisy
aspects. In this paper, we aim at a novel product aspect forecasting
task, by forecasting the top aspects in the future for products with
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Zixuan Liu et al.
inadequate reviews (Fig. 1), i.e., what aspects will the customer use
to describe a new product after six months or three years? To the best
of our knowledge, product aspect forecasting has not been stud-
ied in the literature and is one step further than traditional aspect
extraction tasks. The most related task is zero-shot aspect-based
sentiment analysis [9, 17, 54], but their frameworks are restricted
to sentiment analysis or still require multilingual supervision. The
recent progress in large language models such as ChatGPT [44]
or GPT-4 [2] may also open a door for improved zero-shot aspect
extraction performance, but besides the heavy computational costs
using them, the limited availability of reviews of new products still
restricts the model from forecasting their top aspects in the future.
Figure 1: Problem setting of aspect forecasting. The product
graph is evolving because new product nodes and edges are
added to the graph. The edge weights also change over time.
In this paper, we formulate the product aspect forecasting task
as a multi-future top-K aspect retrieving problem. An intuitive solu-
tion to the problem is to find similar products with longer histories
and infer based on their received feedback, just like a customer
would search for the reviews of similar older products that have
the same functionality, brand, or same style before making the de-
cision. Motivated by this, in this paper, we propose a three-stage
framework ForeSeer to address it. ForeSeer is a flexible textual
mining and product embedding framework progressively trained
on temporal product graphs. The key idea is to find similar older
products from the temporal product graph and propagate potential
aspects mined from their reviews to the new item. This enables
forecasting currently under-estimated aspects which might be fre-
quently mentioned in the future (Fig. 2). ForeSeer has three core
steps, contrastive review-aspect association learning, progressive
temporal graph-based product embedding, and aspect-guided prod-
uct embedding refinement with temporal information. The first
step efficiently captures the static semantic relationship between
review texts and aspects, and the second step together captures the
evolving graphical product similarity information and how prod-
ucts aggregate reviews over time. In the third step, we design a
novel product-aspect temporal attention (PATA) module to help
adjust the product embeddings guided by aspect embeddings for
multi-length future times forecasting.
We evaluated ForeSeer on a real-world customer review dataset,
which contains 11,000 products, 11,536,382 reviews, and a product
similarity graph constructed using user queries and clicks. Our
dataset contains the timestamp for each review and product over
three years. We observed substantial improvement against com-
parison approaches on product aspect forecasting in both settings
with accessible estimated or ground truth association. We found
the product embeddings derived from ForeSeer show more visible
patterns when the timestamp is increasing, suggesting an accurate
incorporation of temporal information. In addition to aspect fore-
casting, ForeSeer achieved prominent performance on multi-time
future link prediction and review-aspect association prediction,
demonstrating its wide applicability in modeling temporal review
information. ForeSeer is developed as, to our knowledge, the first
approach to product aspect forecasting and can be broadly applied
to other temporal graph mining tasks.
Figure 2: The key idea of ForeSeer is to find and embed similar
products dynamically and propagate their top aspects mined
from reviews to the new item to forecast future aspects.
2 PRODUCT ASPECT FORECASTING
2.1 Problem Definition: A new task
In principle, products receive and aggregate reviews and aspects
are mined from the review text pieces, enabling the products to
extract and aggregate aspects associations. We then understand
relationships among the three core components, products, aspects,
and reviews in detail, and formally define the product aspect mining
and forecasting problem as a top-Kl aspect retrieval problem.
2.1.1 Product aspect mining from review texts. A descriptive aspect
Al , is a descriptive textual span extracted from a review text se-
quence r j that summarizes a particular attribute or feature of Pi ,
the product r j belongs to (examples and illustration in Table 1).
Given an aspect list L = {A1, A2, . . . , A|L | } and r j , we define the
review-aspect association vector vj ∈ {0, 1} |L | , where vl
j = 1 if r j
and Al are associated. The aspect list can be obtained by supervised
or unsupervised mining from reviews [77, 84]. The longer the list,
the more descriptive and diverse aspects can be included in the list.
A product network G = {P, E} is given with a set of product
nodes P and an edge set E representing the similarities between
products. Aw is the weighted adjacency matrix of E. Each product
receives reviews and maintains a review list Ri = {ri,1, . . . , ri,|Ri | }.
Let vi,k be the review-aspect association vector of ri,k and V l
i =
i,k } |Ri |
{vl
k=1 be the collected Al 's association list of Pi . The product-
aspect association vector ui ∈ R|L | can then be obtained by aggre-
gating all the review-aspect association vectors in the review list
through Agg(.), a permutation-invariant aggregation function:
)].
ui = [Agg(V 1
i ); . . . ; Agg(V |L |
i
Kl
The binarized top-Kl aspect label vector y
= yi can then be
i
constructed by ranking ui and picking up the top-Kl product-aspect
associations of Pi to be positive. Let xi ∈ RdP be the node feature
of Pi , the product aspect mining task is using xi and graphical
information in G such as Aw to predict yi . Note that the number
of positive labels can be less than Kl , resulting in the multi-label
nature of yi .
(1)
Now (0 month)6 months12 months-12 months -6 months0.4What will be the top aspects for this new prod-uct after 12 months?0.50.50.40.70.60.80.70.80.80.50.40.40.80.71.Soft inside2.Comfortable3. WarmTop aspects1. Comfortable2. Soft inside3. Looks goodNum of review:s 100Top aspectsTop aspectsRankingSoft insideComfortableWarmLooks good1.Looks good 2.Comfortable3.Soft insideNum of reviews: 1000Num of reviews: 50001.Soft inside2.Comfortable3. WarmTop aspectsNum of reviews: 7000ForeSeer: Product Aspect Forecasting Using Temporal Graph Embedding
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Table 1: Three review-aspect association examples are presented to show the different difficulty levels mining these aspects.
The mining difficulty for an aspect depends on its relationship to the related corpus (More challenging from top to bottom).
Relation with corpus
Exact match
Synonym
Summary
Product type
Table
Candle
Carpet cleaning Great carpet machine
Aspect
Very sturdy
Looks great
Related corpus
very sturdy
looks perfect
did a great job cleaner cleaning my carpet This Compact Carpet Cleaner did a great job cleaning my carpet !
Raw review texts
This table is very sturdy.
I bought this product for my wife and it looks perfect for me.
Table 2: Head and tail aspect examples with frequency infor-
mation over a three-year period.
Head aspect
Looks great
Works great
Very sturdy
3-year frequency
1,955,762
1,796,908
1,199,984
Tail aspect
Buttons are good quality
Great fit and finish
Simple plug and play
3-year frequency
145
145
145
i
i
i,k
, tstart
i
≤ tprop
i,k
2.1.2 Predicting future aspect trends for products. In practice, prod-
ucts are released at different times and start receiving reviews over
time. Consider in a discrete time period T = {0, . . . ,T }, the product
network is evolving and Gt = {Pt , Et } is the product network snap-
shot at time t ∈ T . Pi ∈ Pt >tstart
only occurs after its proposed
time tstart
in the monotonically increasing product node list Pt
i
over time. The product similarities edge set Et and its weighted
adjacency matrix Aw
t are also changing as t changes. Products begin
receiving reviews once become available to customers, therefore
the corresponding review lists Ri (t; tstart
) = Ri,t are also expand-
ing over time. Any review ri,k in Ri,t = {ri,1, . . . , ri,|Ri,t | } also has a
proposed time tprop
≤ t, For simplicity, assume Ri,t
is ordered by ascending review proposed time. Now V l
i will be V l
i,t
with reviews up to Ri,t , and the product-aspect association vector
i to V l
becomes ui,t by replacing the V l
Let the above t be the present time, and xi,t be the node feature
of Pi in Gt . Suppose at a future time t ′ = t + Δt, the product aspect
vector and the top-Kl aspect label vector is ui,t ′ and yi,t ′ . The Δt-
future product aspect forecasting problem at time t is to predict yi,t ′
using xi,t and Gt . Moreover, we are interested in forecasting top
product aspects yi,t +Δtn at multiple future with NΔT different time
NΔT
lengths ΔT ≜ {Δtn }
n=1 simultaneously using information till t. In
practice, the accessible information is till the present t (referred to as
'now'). Yet setting 't at now' to an earlier stage will therefore meet
with the old product that is earlier 'new', together with a smaller
product network that has fewer products with shorter review lists.
i,t in Eqn (1).
2.2 Motivations and challenges of the problem
2.2.1 Motivation. We illustrate the motivation of the product as-
pect forecasting problem. In a large e-commerce system, existing
products keep receiving reviews from buyers, and sellers continue
to release more and more new products (Fig. 1). The high-level tar-
get of this problem is predicting the customer feedback for products
in the long future: e.g., what will be the top aspects of a new product
six months or three years later? This problem might be easier to
answer for products with long histories - they have many customer
reviews, thus simply extracting all aspects till now and counting the
most frequent ones can already obtain statistically significantly sat-
isfying results. However, for the larger and more important group
of newly released products with limited reviews, such a strategy
will give a much less reliable aspect forecasting, as aspects that
currently have low frequency might be frequently mentioned in
future reviews. On one hand, customers cannot trust products with
less accurate aspects prediction; on the other hand, sellers worry
about long-history products monopolizing the market. Therefore,
a robust and reliable solution clearly relieves the dilemma that new
products have limited reviews to help forecast on both the seller
and customer side despite the non-trivial problem nature.
2.2.2 Challenges. Forecasting aspects for 'new' products can not
be effectively achieved by trivially aggregating mined results from
aspect mining methods, as the number of reviews is limited besides
their subjectiveness. Also, the scale of reviews can be very large
and aspect list length L can also be large in practice, leading to
high sparsity of positive associations and extremely imbalanced
aspect frequencies (Table 2). Therefore the top-K aspect retrieving
formulation also introduces association sparsity and extremely
imbalanced aspect frequencies, making it more challenging.
Another challenge is that the 'new' products are distributed
at different time points, resulting in unaligned review list series
evolving processes. It is because reviews will keep occurring for
products once they are released, and all the products will receive
different reviews at different times. Since forecasting aspect trends
for the 'new' products with limited reviews is more important and
challenging, trivially training a graph neural network from a single
product graph is also not effective. The evolving product-review
associations and product similarities need to be efficiently extracted,
aggregated, and embedded across the whole time range to avoid
over-fitting effects.
The third challenge is that the aspect evolving trends will be
quite different in shorter and longer time periods, as yi,t ′ will reflect
the genuine converged customer feedback when Δt → ∞ and
the recent popular thoughts from customers when Δt is small.
Therefore predicting top aspect trends for products at different
Δt future indicates capturing different stages of product evolving
from the entire 'new' (with limited reviews) to 'old' (with adequate
reviews) evolving process from time to time. Trivially using one
single product embedding at current time t without further future-
length aware adjustment will result in unsatisfactory performance.
3 METHODS
We propose ForeSeer, a textual mining and product embedding
framework progressively trained on temporal product graph to
predict the dynamic product embeddings at a future time point
t + Δt using all information till the current time point t. ForeSeer
then exploits the product embeddings to predict the top aspects of
that future time. ForeSeer is a three-stage framework (Fig. 3). In
the first stage, we exploit contrastive learning to co-embed reviews
and aspects, leveraging the aspect semantic information to acquire
better review embeddings. We resample review-aspect associations
to increase the presence of rare aspects so that the review em-
beddings can be less biased to frequently-appeared aspects. In the
second stage, we progressively train the product graph embedding
network on the temporal product graph. This helps ForeSeer see
more new products and the new reviews they received, as well as
evolving product similarity information, resulting in an efficient
product embedding alignment. In the third stage, we develop a
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Zixuan Liu et al.
Figure 3: ForeSeer first resamples review-aspect associations and co-embed aspects and reviews. It then progressively embeds
products leveraging temporal product graphs. Finally, it exploits temporal information to adjust product and aspect embeddings
to provide multi-time future forecasting.
novel Product-Aspect Temporal Attention (PATA) module to fur-
ther adjust product embeddings with the help of learned aspect
embeddings. PATA module helps to forecast future product-aspect
associations with explicit consideration of temporal information,
thus providing time-sensitive forecasting.
3.1 A base model
We first introduce a base model that extends aspect mining methods
for aspect forecasting and later contrast this base model with Fore-
seer to clarify the key technical ideas of ForSeer. Let R = {r j } |R|
j=1 be
the list of reviews collected from all products. The base model builds
a BERT-based textual encoder that is pretrained on all reviews with
the mask language modeling (MLM) objective [10]. The model can
then be used to embed r j as hj = BERT(r j ). At present time t
('now'), the learned review embedding hj can then be aggregated
to the product Pi they belong to as fi via an aggregator function.
Let Ri be the review list of Pi at time t and ri,k ∈ Ri be one of the
review of Pi , the aggregation process is:
fi = Agg({hi,k |ri,k ∈ Ri }).
(2)
The base model then leverages xi = [fi ; SEi ] as a node feature of
Pi and trains a graph neural network on the last observed product
graph Glast to further get a product embedding Zlast . Here, SEi is
the static product-specific embedding that encodes other product-
related information, such as seller descriptions, which will not
change over time. Let Aw
last be the weighted adjacency matrix of
Glast , and X be the product node feature matrix of all products that
make up xi , where Pi ∈ Glast . Let σ be an activation function and
H (0) = X , for H (lp ) , the output of the lp -th GNN layer we have:
last H (lp −1)W lp ]).
w
H (lp ) = σ ([A
(3)
Let Zlast = H (Lp ) be the resulting embedding matrix of all
products after the final layer, its i-th row zi is the embedding of Pi
and is used to get the prediction of top aspects in the future. Suppose
NΔT
we are interested in multiple futures ΔT ≜ {Δtn }
n=1 , we use NΔT
NΔT
n=1 to map Zlast and different Δtn to
classifier heads {CLSP→A,n }
the prediction ˆyi,t +Δtn for different future t + Δtn. They are finally
optimized with a multi-time multi-label cross-entropy objective:
ˆyi,t +Δtn = CLSP→A,n (zi, Δtn),
L (i )
P→A =
1
NΔT * |L|
NΔT
∑︁
|L |
∑︁
n=1
l=1
−yl
i,t +Δtn log ˆyl
i,t +Δtn
(4)
.
3.2 Mining aspect to enhance review embedding
The major limitation of the base model is it only pre-trains the
language model using review texts instead of clearly capturing
the review-aspect association. Because reviews are usually long
and subjective (Table 1), it is very inefficient to capture signals of
potential aspects from the embedding of the entire review text. Also,
to have more descriptive and diverse aspects, the aspect list can be
very long. Under this situation, the positive aspect association in
review texts will be very sparse, and the aspect distribution can be
really imbalanced and long-tailed. We thus propose to refine the
review embedding by fine-tuning the review encoder to mine aspect
associations. The key intuition is to embed the review focusing on
representing sparse aspect associations.
Specifically, given a review text r j , we fine-tune its embedding hj
to capture the review-aspect association vector ˆvj with a classifier
head CLSr →a (.) and a multi-label cross-entropy loss objective:
ˆvj = CLSr →a (hj ); L ( j )
cls,r →a =
1
|L|
|L|
∑︁
−vl
j log ˆvl
j .
(5)
l=1
Note that here the association between the review texts and the
resulted aspects will not change with time; it is therefore compati-
ble to combine this objective with the MLM objectives [10] in the
BERT pre-training stage. The resulting prediction of the association
of the review aspect ˆv can be viewed as part of the refined review
embeddings. For instance, the updated representation h′
j = [hj ; ˆvj ]
can be the concatenation of BERT embedding and predicted as-
sociation vectors. Having it can thus better capture sparse aspect
association information during review aggregation using Eqn. (2).
3.3 Aspect-guided review embedding matching
However, the limitation of the above refinement is that it has no
idea that some aspects might describe similar meanings. It thus
lacks the ability to efficiently capture the tail aspects that might
have a similar meaning to the top frequent aspects but are rare
and more diverse. Incorporating class names is useful when classes
have their own description [40]. Therefore, our next key improve-
ment is to jointly embed reviews and aspects through cross-domain
contrastive learning. The key intuition is that by also embedding as-
pects, tail aspects can be closer to head popular aspects if they have
similar semantic meanings. The resulting aspect embeddings can
therefore guide two review embeddings to be closer if they point
to aspects with similar meanings. Moreover, if we treat the base
FrequencyAspectFrequencyAspect1.Wearing this soft shirt is relaxing... 2. Quality is good. The inside of it is really soft...3. It's soft, comfy but not warm.... Soft inside:124Comfortable:871Good quality: 10,031Warm:2,793Aspect listAspect guided temporal adjustmentNowLooks good:5,192List of reviewsproduct6 months-12 months -6 months12 months36 months1.Soft inside2.Comfortable3. WarmTop aspects1. Comfortable2. Soft inside3. Looks goodTop aspectsTop aspects1.Looks good 2.Comfortable3.Soft insideaspectreviewForeSeer: Product Aspect Forecasting Using Temporal Graph Embedding
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
j
and ˆv(αm )
j
model as a review feature extractor, training a cascaded contrastive
learner will enable an effective way to train multiple review feature
extractors and incorporate resampling and ensemble techniques.
Specifically, we train multiple feature extractors by instantiating
M base aspect extraction replicas with different reweighting factors
α1, ..., αM in addition to the standard aspect extraction instance
(α0 = 0). We use h(αm )
to denote the trained features
output by the m-th replica follows Eqn (5). We then downsample
frequent aspects to encourage the model to focus on review-aspect
associations from infrequent aspects. For replica m, we first con-
struct a bin for each aspect by assigning reviews that have positive
associations with that aspect. Here, a review might be allocated to
multiple aspect bins. We thus apply the resampling strategy hier-
archically, which chooses the l-th aspect bin with probability pl
by reweighting and then normalizing the importance of the aspect
based on the reciprocal of the αm-reweighted aspect frequency:
pl =
w (m)
l
(cid:205)l w (m)
l
, w (m)
l
= (
1
f req(Al )
)αm , αm ≥ 0.
(6)
The reweight factor αm leads the model to focus more on the
aspects of tail (large αm) or head (small αm). αm = 0 corresponds
to the standard aspect extractor that conduct uniform sampling.
Then, a review r j is sampled from the chosen aspect bin with an
assigned importance weight based on the number of review-aspect
associations and the reweighted aspect importance.
This resampling strategy enables the possibility to ensemble
the features from all M feature extractors and perform mixture-
of-experts (MoE) learning in the contrastive learner. We can now
exploit contrastive learning to co-embed reviews and aspects so that
the embedding of reviews can pay more attention to rare aspects.
Specifically, we first build review and aspect embedding networks
ER and EA with the same output dimension d. ER encodes the
embeddings of the review r j and the predicted associations from
all replicas of the extraction of aspects simultaneously and matches
them into a calibrated embedding of the review zre
:
j
; ...; h(αM )
j
j = ER (CONCAT([hj ; ˆvj ; h(α1 )
re
(7)
z
For aspect Al , we use SpanBERT [22] to get the pre-trained
; ˆv(αM )
j
; ˆv(α1 )
j
asp
features and feed it into EA to get the aspect embedding z
l
]).
j
asp
z
l
= EA (SpanBERT(Al )).
asp
We then utilize the aspect embeddings z
l
optimization of the calibrated review embedding zre
using the inner product of zre
asp
sl
j = (z
z
l
asp
j and z
l
; Z asp = [z
:
asp
1
j )T
re
j )T Z asp = [s1
re
j ; . . . ; s |L |
j
asp
; . . . ; z
];
|L |
] ∈ R|L | .
sj = (z
of Al to guide the
j of review r j
:
(8)
(9)
We finally employ a multi-label cross-domain contrastive loss
similar to NT-Xent loss [56] to maximize positive association and
minimize negative association denoted by vj :
LCL (sj , vj ; τ) = − log
vl
j exp (sl
(cid:205)k exp (sk
j /τ)
j /τ)
.
∑︁
l
(10)
By jointly learning an informative, low-dimensional embedding
space for reviews and aspects, the resulting sj has two advantages.
First, it will efficiently ensemble learnings from multiple aspect
extraction replicas, thus more effectively capturing tail aspects.
Second, by minimizing Eqn (10), sj will encode the ranking infor-
mation of the aspects for r j . This indicates a more flexible way
to retrieve Ka positive associations. By simply tuning Ka, more
(recall-inclined) or less (precision-inclined) positive associations
can be given, resulting in a more flexible aspect extraction module.
3.4 Progressive temporal graph-based product
embedding
The major limitation of the graph-based product embedding module
of the base model is that it is only trained on the last observed
product graph snapshot with the product features at that time. In
fact, only a small ratio of products are 'new' in the last observed
graph snapshot. This leads the model to have severe overfitting
effects. We thus propose to progressively train the model on the
temporal product graph snapshot series rather than only on the last
observed graph. The key intuition is that the model can not only
see more 'new' products during training but also be aware of the
other temporal evolving information, including product similarities
and how a product becomes from 'new' to 'old' by receiving more
and more reviews.
Without loss of generality, we now let t ∈ T be a time point
we want to train our model at and let the graph be the snapshot
Gt at that time. To enable progressive training, multiple fixations
are needed. First, the feature vectors of product nodes need to be
aware of the evolving temporal information, such as the related
information of the progressive product-aspect associations until
time t. Given a review ri,k ∈ Ri,t , the review list of Pi at time t,
we aggregate the learnt embedding zi,k and the predicted review-
aspect association si,k for all reviews in Ri,t to acquire the product
feature fi,t of Pi at time t:
fi,t = Agg({CONCAT([zi,k, si,k ])|ri,k ∈ Ri,t }).
(11)
We then incorporate the related temporal information of Pi at
time t. Similar to the positional embedding [61], the 2d-dimensional
temporal embedding of a discrete-time index t0 is:
Embt0 = [sin(ω1t0), cos(ω1t0), . . . , sin(ωdt0), cos(ωdt0)].
(12)
For Pi at time t, there are three pieces of temporal information
, the training
. The
that need to be incorporated: its proposed time tstart
i
time t and the gap between these two times tgap
= t − tstart
i
resulting temporal embedding therefore has three sub-parts:
i
T emb
i,t
= CONCAT([Embtstart
, Embt , Embtgap
]).
i
We then compose the overall node feature vector xi,t for Pi at
i
(13)
training time t with three parts of features mentioned before:
xi,t = CONCAT([fi,t ;T emb
; SEi ]).
i,t
(14)
Let Aw
t be the normalized weighted adjacency matrix of Gt , to
enable progressive training, we sequentially train the graph neural
, . . . , GtQ |tq ∈ T }. We
network at a subset of graph snapshots {Gt1
further refine the GNN layer that contains an extra multi-layer
perceptron (MLP) module that focuses on learning product-specific
information. Specifically, let W l
be the weight
tq−1
matrix of l-th GNN layer and the extra MLP module after training
and W l
MLP,tq−1
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Zixuan Liu et al.
Figure 4: UMAP plots visualizing product embeddings at day 0 (a), day 30 (b), day 300 (c), and aggregation of product embeddings
at all of the three time points (d).
the network on Gtq−1 and let H (0)
process in Eqn (3) will be updated at tq as:
tq = xi,tq , the product embedding
4 EXPERIMENT
H (lp )
tq
= σ (CONCAT([A
w
tq
H (lp −1 )
tq
W
lp
tq−1
;W
lp
MLP,tq−1
H (lp −1 )
tq
])).
At present time t, we take Z P
(15)
t = H (Lp )
got on Gt as the resulting
product embedding matrix. By progressively updating the network,
ForeSeer can see more new products and how they 'grow' from
'new' to 'old', which is helpful in efficiently aligning the product
embedding.
t
3.5 PATA: Aspect-guided product embedding
adjustment for multi-future forecasting
One limitation of the base model is it uses only one product embed-
ding for all Δtn future predictions without any refinement when
capturing future product-aspect associations. We thus develop a
novel multi-head product-aspect temporal attention (PATA) module
to adjust product embedding based on learned aspect embedding
Z asp . Our intuition is to adjust product embedding with a desig-
nated attention module guided by aspect embedding. This novel
design empowers ForeSeer with the ability to predict both short
and long-future time ranges with lower computational costs.
query network EPQ
query matrix from Z P
Specifically, given NΔT target futures, for each Δtn, we set up a
Δtn to get the product
Δtn and a key network EAK
t and aspect key matrix from Z asp :
t +Δtn = EPQ
(Z P
QP
t ).
Δtn
Kasp
= EAK
(Z asp )
Δtn
t +Δtn
We then calculate cross-attention score Attnt +Δtn between prod-
(16)
uct query and aspect key for Δtn future:
(Kasp
t +Δtn
√
d
Attnt +Δtn = So f tmax (
t +Δtn
QP
)T
) ∈ R| Pt | × |L | .
(17)
We then set up a shared value network EV val that takes Z P
and outputs value matrix V alP
row of V alP
for Pi , we obtain the final product embedding for Δtn future as:
t as input
t . Let vali,t and attni,t +Δtn , the i-th
t and Attnt +Δtn , be the value and attention score vector
f inal
z
i,t +Δtn
= attni,t +Δtn ◦ vali,t .
(18)
We next exploit the final product embedding to get the final predic-
tion using Eqn (4). With the above design, we can acquire different
product embedding for different Δtn future prediction tasks. Using
a shared value network is especially efficient when NΔT is large
and d ≪ |L|. This also regularizes the model by sharing weights
for learning multiple imbalanced top-Kl aspect retrieving tasks.
In this section, we evaluated ForeSeer on a large scale e-commerce
dataset with a variety of tasks, aiming to answer the following
research questions (RQs):
• RQ1: How does ForeSeer perform on product aspect forecast-
ing without or with genuine annotated aspects for reviews?
• RQ2: Is ForeSeer sensitive to aspects with long trends?
• RQ3: How does different components contributes to the
success of ForeSeer on capturing review-aspect associations?
• RQ4: Is the PATA module in ForeSeer able to capture tem-
poral information for different lengths of future?
• RQ5: How does the product embedding captured by ForeSeer
evolve over time?
4.1 Experimental setup
4.1.1 Dataset. We evaluated our ForeSeer framework on a large-
scale e-commerce dataset that contains a dynamic product network
with 11,536,382 time-stamped review events in a three-year period.
The product network is a series of homogeneous dynamic product
similarity graphs with 1,096 daily time-stamped snapshots. The
final graph has 11,000 product nodes from 418 different product
types based on their name, high-level property, and usage, such as
"Lamp", "TABLE", and "Caddy". The unpublished product nodes will
not be added to the graph until their proposed times are reached.
The average start date of products is 77. The first snapshot has
999,614 edges and the final snapshot has 2,400,404 edges. Each edge
represents a similarity ranging from 0 and 1 between the two prod-
ucts. We calculate the similarities based on multiple factors such as
user click information. We obtained an aspect list with 10,000 pop-
ular aspects extracted via sequential extraction tools [76, 77] and
30,217,638 review-aspect associations from these reviews. We con-
structed the top-Kl (Kl = 10) aspects label for every product node at
all timesteps by aggregating all the review-aspect associations it has
and picking up the top-ranked aspects after normalization. Exam-
ple head and tail aspects with their frequency over three years are
shown in Table 2. While the top 3 aspects have more than 1,000,000
counts, the tail aspects only have 150 counts from more than 11
million review texts, demonstrating extreme aspect imbalances.
4.1.2 Tasks. We studied ForeSeer with three challenging tasks:
single review-aspect association prediction, multi-time aspect fore-
casting, and multi-time link prediction.
Single review-aspect association prediction: We model the
single review-aspect association prediction as a multi-label classifi-
cation problem. We split 80% of the reviews as the training set and
leave the remaining 20% as the test set.
Multi-time aspect forecasting: To further assess the effectiveness
of the learned review associations, we tested the multi-time aspect
ForeSeer: Product Aspect Forecasting Using Temporal Graph Embedding
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Table 3: Performance of ForeSeer and comparison approaches on aspect forecasting at three different time gaps (3 months, 6
months, 3 years) under settings of with annotated aspects and without annotated aspects.
Δt
Method
3 months
6 months
3 years
Frequency baseline
MLP
LSTM
GRU
GNN
ForeSeer (Ours)
Frequency baseline
MLP
LSTM
GRU
GNN
ForeSeer (Ours)
Frequency baseline
MLP
LSTM
GRU
OA-Mine
GNN
ForeSeer (Ours)
Without annotated aspects
With annotated aspects
AUPRC
21.0 ±5.7
13.1± 7.2
17.0 ±6.0
17.3± 6.2
19.2 ± 6.6
84.1 ±7.2
20.2± 5.6
11.1± 7.1
14.9± 5.7
15.4± 5.9
18.1 ± 6.5
81.8± 7.7
18.6 ±5.4
10.2± 4.9
11.4± 5.0
12.1 ±5.2
5.9 ± 3.9
16.1 ± 6.3
68.5 ± 8.9
AUROC
84.8±4.1
89.8± 3.2
93.7± 2.5
93.6± 2.6
95.1 ± 3.8
99.9± 0.2
84.3± 4.2
88.4± 3.5
93± 2.8
92.9 ±2.8
93.8 ± 3.5
99.8± 0.2
83.8 ±4.2
86.3 ±3.0
90.3 ±3.3
90.3 ±3.3
78.6 ± 5.9
92.1 ± 3.1
98.9± 1.1
Kappa
28.6 ±6.2
4.5 ±4.3
6.5 ±5.1
7.0 ±5.5
25.1± 8.1
75.8± 7.9
27.5± 6.2
4.3 ±4.1
6.6 ±5.2
6.7 ±5.3
23.0± 7.7
74.2± 8.1
25.4± 6.1
3.1± 3.0
5.8± 4.9
6.0 ±5.1
3.4 ± 2.7
20.9± 7.1
65.6 ± 8.5
Max F1
37.4 ±5.6
25.1± 6.5
29.6 ±6.1
30.1± 5.5
32.3± 6.8
83.9 ±5.9
36.1± 5.6
23.5± 6.7
27.5± 6.0
28.1± 6.2
29.4± 6.7
82.2 ±6.3
34.0± 5.6
21.2± 5.3
23.4± 5.7
24.4 ±5.9
6.1 ± 2.6
28.6± 6.6
73.2 ± 6.9
AUPRC
91.2 ±4.2
14.6± 7.7
17.4 ±6.1
18.2± 6.2
20.9 ± 6.5
80.2 ± 8.4
87.4 ±5.1
13.9± 7.5
15.3 ±5.8
16.2± 6.0
19.3 ± 6.4
82.3±8.6
81.0± 6.1
11.7± 5.3
12.0± 5.2
13.1± 5.4
5.9 ± 3.9
17.3 ± 6.4
83.6 ±7.9
AUROC
96.9± 2.0
91.3 ±2.9
93.8 ±2.6
94.0 ±2.6
97.2± 3.9
99.9 ±0.1
96.4 ±2.2
90.9 ±2.7
93.0 ±2.9
93.3± 5.6
95.9± 3.3
99.7 ±0.3
96.2± 2.3
89.7 ±4.2
90.3 ±3.5
90.7±6.7
78.6 ± 5.9
93.0± 2.7
99.9± 0.1
Kappa
86 ±5.4
4.9 ±4.1
7.3 ±5.5
5.9 ±5.3
24.9± 7.0
72.3 ±8.2
81.8 ±6.0
5.1 ±4.0
7.2 ±5.5
28.9 ±6.3
22.9± 6.9
73.6 ±8.5
75.8 ±6.5
5.5± 5.2
6.6± 5.3
5.9±5.1
3.4 ± 2.7
20.6± 6.9
74.7 ± 7.7
Max F1
90.0± 4.2
28.5 ±7.1
30.1 ±6.2
31.0 ±6.3
34.2 ±6.6
80.0± 7.2
86.3 ±4.9
27.6 ±6.8
27.8± 6.1
26.3 ±5.3
31.9 ±6.6
82.6±6.9
81.2± 5.3
23.3± 6.1
24.1± 6.0
25.1±6.0
6.1 ± 2.6
29.7 ±6.5
82.8± 6.4
forecasting task with two settings: (i) ground truth association
accessible, (ii) only learned approximate association accessible. For
this task, we chose to predict Δt = 3, 6 months and 3 years (always
predicting the last observed label) at every test timestep t. We use
the label at the final time if the target future time is out of range.
We aimed to test the inductive performance by randomly splitting
10% nodes out as the test set.
Multi-time link prediction: For multi-time link prediction, we
chose to predict the link at the current time, 180 days later, and at
the final time at every test time t. The positive edge ratio is 50%.
4.1.3 Comparison approaches. There is no existing framework
that directly handles the multi-time aspect forecasting problem. We
therefore designed and compared our method with four types of
baselines. Frequency baseline directly aggregates the association
learnt in section 3.2 at time t and uses it as the prediction. It can not
incorporate other information and the performance will highly de-
pend on the quality of learned aspect associations from reviews. We
aim to assess the effectiveness of the multi-time forecasting PATA
module. MLP baseline directly predicts the multi-time future with
product features without graphical information. Recurrent-based
baselines (GRU, LSTM) predict multi-time future step-by-step by
using an autoregressive network structure and also ignore graphi-
cal similarity information. We thus aim to assess the importance
of using graphical information. Graph-based baseline (GNN)
leverages only the final graphical information Glast . We aim to
assess the effectiveness of our progressive training process in mul-
tiple Δt-future. Weakly supervised baseline (OA-Mine) directly
mines candidate aspects from reviews and aggregates the candi-
dates as the final predictions. We aim to assess the effectiveness
of learned review-aspect associations and the importance of using
learning-based models as this baseline does not leverage review-
aspect association information.
For multi-time link prediction tasks for different Δt-future, we
only compare our method with graph-based baselines, since other
baselines can not handle this task. We built an extra lightweight
GNN for multi-task link prediction for our methods and a GNN
baseline with the same network structure. For our method, we
used features learned from our multi-head product aspect temporal
attention module for different futures as the input for different
future time predictions. For the graph-based baseline, we used the
same features for different future time predictions.
Implementation details. For the aggregation function Agg(.)
4.1.4
used to construct future aspect labels, we used sum(.) with per-
aspect z-score normalization operation. Specifically, for each aspect,
we got the sum of its occurred association for every product at
the end of the time period and calculated the mean and standard
deviation of them. We then performed z-score normalization on
the sum of the associations of this aspect for every product at time
t. We used mean(.) as the aggregator to get the aggregated feature
fi,t of product Pi at time t. We maintained both the predicted logits
and the binarized association prediction from si,k . We incorporated
a pre-trained product embedding obtained from a multi-modality
neural model that encodes information from the product title and
descriptions to construct the auxiliary product embedding SEi .
For simplicity, we only trained one resampling replica with α =
0.5 and match its embedding with embedding learned by standard
aspect extraction replica (α = 0). We used AdamW as the optimizer
and 10−4 as the learning rate to train the aspect-guided embedding
match model for 10 epochs on four 16GB Nvidia-V100 GPUs and
set the number of retrieved positive associations Ka = 5 for better
precision performance. We used a two-layer MLP with ReLU for
all the embedding networks and a linear projection layer for all
query and key blocks. All the embedding, query, and key vector
output dimensions are 100. To avoid the over-smoothing problem,
we used a GNN with one designed graph neural layer and two
cascaded MLP layers. We used the same network structure for the
GNN baseline. For the MLP baseline, we used a two-layer MLP with
a hidden size of 128, for GRU and LSTM baseline we set the number
of the layer as 2 with a hidden size of 128. For the lightweight GNN
for multi-task link prediction task, we used a standard GraphSAGE
layer and one cascaded MLP layer. We used Adam as the optimizer
and 10−3 as the learning rate and trained all aspect forecasting and
link prediction tasks for 200 epochs on a 16GB Nvidia-V100 GPU.
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Zixuan Liu et al.
Table 4: Case study showing the aspected we predicted for skin moisturizer. Our method identified time-sensitive phrases (red)
while the frequency baseline failed to identify them.
Product type
Count baseline prediction
with one month reviews
ForeSeer prediction with
one month reviews
Final Label (Ground truth)
Skin moisturizer
Smooth, Feels great, Product is great, Clean, Light weight, Soothing, Love this product, Dries quickly,
Works great, Great price
Smooth, Clean, Great price, Product is great, Soothing, A little goes a long way, Sensitive skin, Light
weight, Not greasy, Good quality
Smooth, Love the texture, Light weight, Product is great, Soothing, Great price, A little goes a long way,
Sensitive skin , Fragrance free, Not greasy
4.2 Experimental results
4.2.1
Improvement on aspect forecasting without annotated aspects
(RQ1). We first investigated the performance of ForeSeer on aspect
forecasting when aspects are not annotated in the review (Table
3). We found that our method achieved the best performance on all
three pieces of time gaps (3 months, 6 months, and 3 years), indicat-
ing that our temporal graph embedding framework can effectively
model the dynamics of aspects and products. For instance, ForeSeer
obtains 63.1% and 49.1% improvements on 90-day gap forecasting
and 3-year gap forecasting, respectively. We found that the fre-
quency baseline didn't perform well on this task, especially when
the time gap is larger, further confirming the importance of aligning
products temporally. We found that the GNN baseline has undesir-
able performance, demonstrating the effectiveness of progressive
training on avoiding over-fitting. We found that the MLP, GRU, and
LSTM baselines performed badly on all future forecasting, neces-
sitating the importance of graphical information. We also found
that two temporal baselines outperform the MLP baseline, suggest-
ing the importance to adjust product embedding for multi-time
forecasting. We found that OA-Mine, one of the state-of-the-art ap-
proaches in aspect mining, obtained a less prominent performance,
indicating that aspect mining methods cannot be applied to this
novel aspect forecasting task. Finally, we noticed that graph-based
approaches GNN, in general, performed better than methods that
do not consider graphs, necessitating the consideration of graph
dynamics in this task.
4.2.2
Improvement on aspect forecasting with annotated aspects
(RQ1, RQ2). We next evaluated an easier setting where aspects are
annotated in each review. In this setting, the frequency baseline
achieved very good performances since it simply counts the as-
pects in current reviews and uses it to predict future aspects. For
aspects that are not time-sensitive, the frequency baseline can be
regarded as an upper bound. Nevertheless, we found that ForeSeer
still achieved good performance in this setting, where ForeSeer
showed comparable performance with the frequency baseline on a
6-month gap and even outperformed the frequency baseline on a
3-year gap. All other comparison approaches obtained a much less
promising performance. This indicates that ForeSeer can obtain a
comparable performance with the frequency baseline on aspects
that are not time-sensitive and substantially better performance on
aspects that are time-sensitive. To further examine this (RQ2), we
illustrated one case study showing how ForeSeer can effectively rec-
ognize long-term aspects (Table 4). ForeSeer corrected forecasted
time-sensitive aspects such as "a little goes a long way" and "sensi-
tive skin", while the frequency baseline failed to identify, reassuring
ForeSeer's ability to forecast long-term future aspects.
4.2.3
Improvement on predicting review-aspect association with em-
bedding matching (RQ3). Next, we examined the importance of the
aspect-guided embedding matching strategy by performing an ab-
lation study on the review-aspect association prediction (Fig. 5).
We observed the limited precision performance of using either with
or without resampling multi-label classification instances, leading
to poor ability or focusing too much on capturing tail aspect asso-
ciations. Instead, we observed substantial improvements from our
aspect-guided embedding framework by successfully exploiting
the advantage of two multi-label classification instances. For exam-
ple, the precision of our precision-inclined embedding matching
model (Ka = 5) is 22% and 34% higher than the with or without
resampling multi-label classification instances. The superior preci-
sion performance suggests the learned review embeddings guided
by aspects concentrate less-biased features for both head and tail
aspects, which is critical to their success.
Figure 5: Bar plot showing the performance of our embed-
ding match approach and comparison approaches on review-
aspect association prediction evaluated using precision, F1
score, accuracy, and recall.
Improvement on predicting future links (RQ4). After confirm-
4.2.4
ing the superior performance of ForeSeer on aspect forecasting,
we next investigated whether ForeSeer's PATA module is able to
capture temporal information for multiple futures by letting it
predict product-product edges that might emerge in the multiple fu-
ture times (Table 5). We observed a consistent improvement of our
methods over different time gaps compared to GNN. We adopted
a multi-task prediction setting for efficient inference and training
where predictions for different time gaps are treated as different
tasks. Specifically, we found that the GNN baseline cannot gen-
eralize well on the intermediate-long future range (6 months) as
it didn't consider the dynamics when simultaneously predicting
multiple time gaps. In contrast, our model addressed this by explic-
itly modeling the temporal dynamics of products, confirming that
ForeSeer can effectively capture both product and aspect dynamics.
4.2.5 Contrasting static and temporal embeddings (RQ5). We fur-
ther visualized the dynamic product embedding space colored by
their product types at different time steps to assess how ForeSeer
captures the temporal pattern (Fig. 4). As the time step becomes
PrecisionF1scoreAccuracyRecall0.20.30.40.50.60.70.8Scorew/oresamplingw/resamplingEmbeddingmatch(Ka=3)Embeddingmatch(Ka=5)ForeSeer: Product Aspect Forecasting Using Temporal Graph Embedding
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Table 5: Comparison of ForeSeer and GNN on predicting future links at three different time points (current, 6 months, 3 years).
Δt−future Approaches
Current
(0 day)
Baseline GNN
ForeSeer (Ours)
Baseline GNN
ForeSeer (Ours)
Baseline GNN
ForeSeer (Ours)
6 months
3 years
Accuracy
88.32± 0.54
92.64 ± 0.53
18.36 ± 0.32
85.12 ± 0.51
80.28 ± 0.48
84.25 ± 0.51
Precision
85.29 ± 0.37
92.68 ± 0.35
10.93 ± 0.24
92.96 ± 0.38
77.95 ± 0.35
92.95 ± 0.44
Recall
91.28 ± 0.72
92.66 ± 0.69
89.02 ± 0.72
91.87 ± 0.78
87 ± 0.63
87.31 ± 0.88
F1 score
88.13 ± 0.61
92.65 ± 0.58
19.49 ± 0.23
92.37 ± 0.55
82.03 ± 0.77
86.39 ± 0.64
AUPRC
94.64 ± 0.88
97.54 ± 0.83
89.13 ± 0.84
92.21 ± 0.87
92.24 ± 0.88
94.08 ± 0.96
AUROC
94.73 ± 0.76
97.66 ± 0.75
44.79 ± 0.24
74.91 ± 0.49
89.34 ± 0.81
91.75 ± 1.02
larger, we observed more visible clustering patterns among prod-
ucts. This suggests that the quality of the product embeddings
becomes better as the data is accumulated by modeling the tempo-
ral dynamics. We also noticed the product embedding similarity
reflects edges in the product-product graphs ("shelf" and "caddy",
"lamp", "light fixture" and "string light"), indicating these product
embeddings successfully encode graphical information.
5 RELATED WORKS
Product aspect mining. Few work that tries to forecast aspects for
products and most previous works only aim at product aspect min-
ing tasks. Mining product aspects from large-scale commercial data
has been a well-studied problem [7, 15, 25, 53, 77]. Previous works
target the problem using rule-based [7, 25, 53], supervised learning
based extractor [4, 18] or propagation-based methods [35, 46]. These
works are less generalizable to product aspect forecasting, as they
require either domain-specific features or supervision signals from
downstream tasks such as sentiment or opinion labels. Recently,
other works similarly extract descriptive product attributes from
seller-provided product profiles by using sequential supervised
textual span labeling information [29, 64, 70, 76, 93] or distant su-
pervision [65, 83]. OA-Mine [84] leverage weakly-supervised seed
set to mine aspects from product titles. These methods need either
more costly massive sequential labeled datasets or predesigned hi-
erarchical attribute taxonomy, which is hard to obtain for customer-
centered aspects. Zero-shot aspect extraction is another recently
emerged related topic that aims to extract aspects in new domains
without annotated data by leveraging transfer learning [17], natural
language inference [54], document sentiment classification [9] and
the recent emerged super-scale ChatGPT [44] and GPT-4 [2]. How-
ever, the zero-shot indicates that no prior knowledge of the new
domain is needed instead of the number of reviews being limited for
products. They are thus not directly applicable to forecasting tasks.
In summary, all the methods above focus on text sequence level
extraction and do not efficiently aggregate learned attributes at the
product level. They are thus useful to help construct the aspect list
for product aspect forecasting tasks, but are not able to forecast fu-
ture aspect trends. Unlike these methods, our methods are the first
framework that can forecast aspects that might be mentioned in
future reviews for a new product with a limited number of reviews.
Label-guided classification. Label-guided text classification has
been studied in fields such as social recommendation and document
classification [6, 32]. It has been proven to be beneficial for classifi-
cation performance [37, 68]. While these methods focus on classifi-
cation, our method provides an efficient cross-domain contrastive
learning framework that can easily ensemble these models as ex-
pert multi-label classification instances. Compared to [63], which
also proposes to mix multiple encoder instances, our representa-
tion learning scheme allows the model to also produce informative
reviews and aspect representations to help downstream tasks.
Temporal graph learning. Temporal graph-based representation
learning has been intensively studied [14, 49, 74]. Previous works
either incline on graph structure [28, 43, 52, 87, 91] or temporal
dynamics [21, 38, 41, 59, 60, 72]. The dynamic graph structure is
extracted by graph adjacency dynamics [12, 30], skip-gram-based
modeling [11, 39, 95], leveraging clique information [16, 81, 90],
step-by-step embedding updating [3, 13, 31, 33, 47, 55, 92]. These
methods only focus on capturing implicit or short graphical dy-
namics changing and can not efficiently model large-scale review-
aspect associations and evolving product-review associations. Some
methods are designed specifically for heterogeneous networks
[19, 66, 82, 85, 86]. Temporal-dynamic focused methods leverage
recurrent-based models [1, 8, 23, 67, 94], continuous point process
modeling [5, 50] and self-supervised graph representation learn-
ing [57, 58]. These methods focus on modeling interactive events
between nodes, but are not suitable for modeling dynamic prod-
uct similarities and massive product-review associations. Some
methods leverage self-attention, hierarchical, or temporal atten-
tion [20, 36, 51, 69, 75, 78, 89], but only for temporal information
aggregation, while our PATA module leverages attention to pre-
dict multiple time range future simultaneously. Other recent works
such as EvolveGCN [45] and Roland [80] incorporate recurrent
modules and efficient graph learning. These frameworks can be
easily adapted to our progressive training framework, while we aim
to clearly show that progressive training is the key success to in
aspect forecasting with a simple yet clear formulation. JODIE [27]
is the closest work that can also predict multiple time-range futures
with a time projection module. However, it is based on interac-
tion events and is designed for heterogeneous user-item networks,
making it impractical for our use case. In summary, most of the
existing works can not be directly applied to the product aspect
forecasting task because of the training efficiency and inability to
handle large-scale reviews.
6 CONCLUSION
In this paper, we have studied a novel task of product aspect fore-
casting, which aims to predict aspects that users might mention in
future reviews. We have proposed a novel framework ForeSeer to
solve this task by dynamically embedding products, reviews, and
aspects. We have evaluated our method on a large-scale real-world
dataset and observed ForeSeer's superior performance on aspect
forecasting and link prediction. In the future, we are interested in
boosting ForeSeer with more advanced progressive training strate-
gies. We are interested in applying ForeSeer to other temporal
graph embedding frameworks, such as modeling biological signal-
ing pathways. We are further interested in exploring how ForeSeer
can assist the classic task of aspect mining, allowing us to apply
ForeSeer to advance a larger number of e-commerce applications,
such as integrating it with recommendation systems to enhance
the product suggestions based on anticipated aspect preferences.
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
Zixuan Liu et al.
REFERENCES
[1] Alex Beutel, Paul Covington, Sagar Jain, Can Xu, Jia Li, Vince Gatto, and Ed H
Chi. 2018. Latent cross: Making use of context in recurrent recommender systems.
In Proceedings of the Eleventh ACM International Conference on Web Search and
Data Mining. 46–54.
[2] Sébastien Bubeck, Varun Chandrasekaran, Ronen Eldan, Johannes Gehrke, Eric
Horvitz, Ece Kamar, Peter Lee, Yin Tat Lee, Yuanzhi Li, Scott Lundberg, et al. 2023.
Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv
preprint arXiv:2303.12712 (2023).
[3] Lei Cai, Zhengzhang Chen, Chen Luo, Jiaping Gui, Jingchao Ni, Ding Li, and
Haifeng Chen. 2021. Structural temporal graph neural networks for anomaly de-
tection in dynamic graphs. In Proceedings of the 30th ACM international conference
on Information & Knowledge Management. 3747–3756.
[4] Abir Chakraborty. 2022. Aspect Based Sentiment Analysis Using Spectral Tem-
poral Graph Neural Network. arXiv preprint arXiv:2202.06776 (2022).
[5] Xiaofu Chang, Xuqin Liu, Jianfeng Wen, Shuang Li, Yanming Fang, Le Song, and
Yuan Qi. 2020. Continuous-time dynamic graph learning via neural interaction
processes. In Proceedings of the 29th ACM International Conference on Information
& Knowledge Management. 145–154.
[6] Eli Chien, Wei-Cheng Chang, Cho-Jui Hsieh, Hsiang-Fu Yu, Jiong Zhang, Ol-
gica Milenkovic, and Inderjit S Dhillon. 2021. Node Feature Extraction by Self-
Supervised Multi-scale Neighborhood Prediction. arXiv preprint arXiv:2111.00064
(2021).
[7] Anjali Dadhich, Blessy Thankachan, and Blessy Thankachan. 2021. Social &
Juristic challenges of AI for Opinion Mining Approaches on Amazon & Flipkart
Product Reviews Using Machine Learning Algorithms. SN Computer Science 2, 3
(2021), 1–21.
[8] Hanjun Dai, Yichen Wang, Rakshit Trivedi, and Le Song. 2016. Deep coevolu-
tionary network: Embedding user and item features for recommendation. arXiv
preprint arXiv:1609.03675 (2016).
[9] Pengfei Deng, Jianhua Yuan, Yanyan Zhao, and Bing Qin. 2022. Zero-shot Aspect-
level Sentiment Classification via Explicit Utilization of Aspect-to-Document
Sentiment Composition. arXiv preprint arXiv:2209.02276 (2022).
[10] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert:
Pre-training of deep bidirectional transformers for language understanding. arXiv
preprint arXiv:1810.04805 (2018).
[11] Lun Du, Yun Wang, Guojie Song, Zhicong Lu, and Junshan Wang. 2018. Dynamic
Network Embedding: An Extended Approach for Skip-gram based Network
Embedding.. In IJCAI, Vol. 2018. 2086–2092.
[12] Palash Goyal, Sujit Rokka Chhetri, and Arquimedes Canedo. 2020. dyngraph2vec:
Capturing network dynamics using dynamic graph representation learning.
Knowledge-Based Systems 187 (2020), 104816.
[13] Palash Goyal, Nitin Kamra, Xinran He, and Yan Liu. 2018. Dyngem: Deep em-
bedding method for dynamic graphs. arXiv preprint arXiv:1805.11273 (2018).
[14] Jin Guo, Zhen Han, Zhou Su, Jiliang Li, Volker Tresp, and Yuyi Wang. 2022.
Continuous Temporal Graph Networks for Event-Based Graph Data. arXiv
preprint arXiv:2205.15924 (2022).
[15] Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews.
In Proceedings of the tenth ACM SIGKDD international conference on Knowledge
discovery and data mining. 168–177.
[16] Hong Huang, Zixuan Fang, Xiao Wang, Youshan Miao, and Hai Jin. 2020. Motif-
Preserving Temporal Network Embedding.. In IJCAI. 1237–1243.
[17] Soufian Jebbara and Philipp Cimiano. 2019. Zero-shot cross-lingual opinion
target extraction. arXiv preprint arXiv:1904.09122 (2019).
[18] A Jeyapriya and CS Kanimozhi Selvi. 2015. Extracting aspects and mining
opinions in product reviews using supervised learning algorithm. In 2015 2nd
international conference on electronics and communication systems (ICECS). IEEE,
548–552.
[19] Yugang Ji, MingYang Yin, Yuan Fang, Hongxia Yang, Xiangwei Wang, Tianrui Jia,
and Chuan Shi. 2021. Temporal heterogeneous interaction graph embedding for
next-item recommendation. In Joint European Conference on Machine Learning
and Knowledge Discovery in Databases. Springer, 314–329.
[20] Pengfei Jiao, Xuan Guo, Xin Jing, Dongxiao He, Huaming Wu, Shirui Pan, Maoguo
Gong, and Wenjun Wang. 2021. Temporal network embedding for link prediction
via vae joint attention mechanism. IEEE Transactions on Neural Networks and
Learning Systems (2021).
[21] Guangyin Jin, Min Wang, Jinlei Zhang, Hengyu Sha, and Jincai Huang. 2022.
STGNN-TTE: Travel time estimation via spatial–temporal graph neural network.
Future Generation Computer Systems 126 (2022), 70–81.
[22] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and
Omer Levy. 2020. Spanbert: Improving pre-training by representing and predict-
ing spans. Transactions of the Association for Computational Linguistics 8 (2020),
64–77.
[23] Seyed Mehran Kazemi, Rishab Goel, Sepehr Eghbali, Janahan Ramanan, Jaspreet
Sahota, Sanjay Thakur, Stella Wu, Cathal Smyth, Pascal Poupart, and Marcus
Brubaker. 2019. Time2vec: Learning a vector representation of time. arXiv
preprint arXiv:1907.05321 (2019).
[24] Sung Guen Kim and Juyoung Kang. 2018. Analyzing the discriminative attributes
of products using text mining focused on cosmetic reviews. Information Processing
& Management 54, 6 (2018), 938–957.
[25] Michael Y Kpiebaareh, Wei-Ping Wu, Brighter Agyemang, Charles R Haruna,
and Tandoh Lawrence. 2022. A Generic Graph-Based Method for Flexible Aspect-
Opinion Analysis of Complex Product Customer Feedback. Information 13, 3
(2022), 118.
[26] KL Santhosh Kumar, Jayanti Desai, and Jharna Majumdar. 2016. Opinion mining
and sentiment analysis on online customer review. In 2016 IEEE International
Conference on Computational Intelligence and Computing Research (ICCIC). IEEE,
1–4.
[27] Srijan Kumar, Xikun Zhang, and Jure Leskovec. 2019. Predicting dynamic em-
bedding trajectory in temporal interaction networks. In Proceedings of the 25th
ACM SIGKDD international conference on knowledge discovery & data mining.
1269–1278.
[28] Jundong Li, Harsh Dani, Xia Hu, Jiliang Tang, Yi Chang, and Huan Liu. 2017.
Attributed network embedding for learning in a dynamic environment. In Proceed-
ings of the 2017 ACM on Conference on Information and Knowledge Management.
387–396.
[29] Ning Li, Chi-Yin Chow, and Jia-Dong Zhang. 2020. EMOVA: A semi-supervised
end-to-end moving-window attentive framework for aspect mining. In Pacific-
Asia Conference on Knowledge Discovery and Data Mining. Springer, 811–823.
[30] Taisong Li, Jiawei Zhang, S Yu Philip, Yan Zhang, and Yonghong Yan. 2018.
IEEE Access 6 (2018),
Deep dynamic network embedding for link prediction.
29219–29230.
[31] Hao Liu, Shuwang Zhou, Changfang Chen, Tianlei Gao, Jiyong Xu, and Minglei
Shu. 2022. Dynamic knowledge graph reasoning based on deep reinforcement
learning. Knowledge-Based Systems 241 (2022), 108235.
[32] Jingzhou Liu, Wei-Cheng Chang, Yuexin Wu, and Yiming Yang. 2017. Deep
learning for extreme multi-label text classification. In Proceedings of the 40th
international ACM SIGIR conference on research and development in information
retrieval. 115–124.
[33] Xi Liu, Ping-Chun Hsieh, Nick Duffield, Rui Chen, Muhe Xie, and Xidao Wen.
2019. Real-time streaming graph embedding through local actions. In Companion
Proceedings of The 2019 World Wide Web Conference. 285–293.
[34] Yao Liu, Cuiqing Jiang, and Huimin Zhao. 2019. Assessing product competitive
advantages from the perspective of customers by mining user-generated content
on social media. Decision Support Systems 123 (2019), 113079.
[35] Guangquan Lu, Jiecheng Li, and Jian Wei. 2022. Aspect sentiment analysis with
heterogeneous graph neural networks. Information Processing & Management 59,
4 (2022), 102953.
[36] Yuanfu Lu, Xiao Wang, Chuan Shi, Philip S Yu, and Yanfang Ye. 2019. Temporal
network embedding with micro-and macro-dynamics. In Proceedings of the 28th
ACM international conference on information and knowledge management. 469–
478.
[37] Qianwen Ma, Chunyuan Yuan, Wei Zhou, and Songlin Hu. 2021. Label-specific
dual graph neural network for multi-label text classification. In Proceedings of the
59th Annual Meeting of the Association for Computational Linguistics and the 11th
International Joint Conference on Natural Language Processing (Volume 1: Long
Papers). 3855–3864.
[38] Yao Ma, Ziyi Guo, Zhaocun Ren, Jiliang Tang, and Dawei Yin. 2020. Stream-
ing graph neural networks. In Proceedings of the 43rd International ACM SIGIR
Conference on Research and Development in Information Retrieval. 719–728.
[39] Sedigheh Mahdavi, Shima Khoshraftar, and Aijun An. 2018. dynnode2vec: Scal-
able dynamic network embedding. In 2018 IEEE international conference on big
data (Big Data). IEEE, 3762–3765.
[40] Yu Meng, Yunyi Zhang, Jiaxin Huang, Chenyan Xiong, Heng Ji, Chao Zhang, and
Jiawei Han. 2020. Text classification using label names only: A language model
self-training approach. arXiv preprint arXiv:2010.07245 (2020).
[41] Shengjie Min, Zhan Gao, Jing Peng, Liang Wang, Ke Qin, and Bo Fang. 2021.
STGSN-A Spatial–Temporal Graph Neural Network framework for time-
evolving social networks. Knowledge-Based Systems 214 (2021), 106746.
[42] Divya Mittal and Shiv Ratan Agrawal. 2022. Determining banking service at-
tributes from online reviews: text mining and sentiment analysis. International
Journal of Bank Marketing (2022).
[43] Giang Hoang Nguyen, John Boaz Lee, Ryan A Rossi, Nesreen K Ahmed, Eunyee
Koh, and Sungchul Kim. 2018. Continuous-time dynamic network embeddings.
In Companion proceedings of the the web conference 2018. 969–976.
[44] Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela
Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022.
Training language models to follow instructions with human feedback. Advances
in Neural Information Processing Systems 35 (2022), 27730–27744.
[45] Aldo Pareja, Giacomo Domeniconi, Jie Chen, Tengfei Ma, Toyotaro Suzumura,
Hiroki Kanezashi, Tim Kaler, Tao Schardl, and Charles Leiserson. 2020. Evolvegcn:
Evolving graph convolutional networks for dynamic graphs. In Proceedings of
the AAAI Conference on Artificial Intelligence, Vol. 34. 5363–5370.
[46] Guang Qiu, Bing Liu, Jiajun Bu, and Chun Chen. 2011. Opinion word expansion
and target extraction through double propagation. Computational linguistics 37,
ForeSeer: Product Aspect Forecasting Using Temporal Graph Embedding
CIKM '23, October 21–25, 2023, Birmingham, United Kingdom.
1 (2011), 9–27.
[47] Mahmudur Rahman, Tanay Kumar Saha, Mohammad Al Hasan, Kevin S Xu, and
Chandan K Reddy. 2018. Dylink2vec: Effective feature representation for link
prediction in dynamic networks. arXiv preprint arXiv:1804.05755 (2018).
[48] Jyoti Rana, Loveleen Gaur, and KC Santosh. 2022. Classifying Customers' Jour-
ney from Online Reviews of Amazon Fresh via Sentiment Analysis and Topic
Modelling. In 2022 3rd International Conference on Computation, Automation and
Knowledge Management (ICCAKM). IEEE, 1–6.
[49] Emanuele Rossi, Ben Chamberlain, Fabrizio Frasca, Davide Eynard, Federico
Monti, and Michael Bronstein. 2020. Temporal graph networks for deep learning
on dynamic graphs. arXiv preprint arXiv:2006.10637 (2020).
[50] Sina Sajadmanesh, Sogol Bazargani, Jiawei Zhang, and Hamid R Rabiee. 2019.
Continuous-time relationship prediction in dynamic heterogeneous information
networks. ACM Transactions on Knowledge Discovery from Data (TKDD) 13, 4
(2019), 1–31.
[51] Aravind Sankar, Yanhong Wu, Liang Gou, Wei Zhang, and Hao Yang. 2018. Dy-
namic graph representation learning via self-attention networks. arXiv preprint
arXiv:1812.09430 (2018).
[52] Simon Schaefer, Daniel Gehrig, and Davide Scaramuzza. 2022. AEGNN: Asyn-
chronous Event-based Graph Neural Networks. In Proceedings of the IEEE/CVF
Conference on Computer Vision and Pattern Recognition. 12371–12381.
[53] Richa Sharma, Shweta Nigam, and Rekha Jain. 2014. Mining of product reviews
at aspect level. arXiv preprint arXiv:1406.3714 (2014).
[54] Lei Shu, Hu Xu, Bing Liu, and Jiahua Chen. 2022. Zero-Shot Aspect-Based
Sentiment Analysis. arXiv preprint arXiv:2202.01924 (2022).
[55] Uriel Singer, Ido Guy, and Kira Radinsky. 2019. Node embedding over temporal
graphs. arXiv preprint arXiv:1903.08889 (2019).
[56] Kihyuk Sohn. 2016. Improved deep metric learning with multi-class n-pair loss
objective. Advances in neural information processing systems 29 (2016).
[57] Li Sun, Junda Ye, Hao Peng, and Philip S Yu. 2022. A Self-supervised Riemannian
GNN with Time Varying Curvature for Temporal Graph Learning. In Proceedings
of the 31st ACM International Conference on Information & Knowledge Management.
1827–1836.
[58] Sheng Tian, Ruofan Wu, Leilei Shi, Liang Zhu, and Tao Xiong. 2021. Self-
supervised representation learning on dynamic graphs. In Proceedings of the
30th ACM International Conference on Information & Knowledge Management.
1814–1823.
[59] Rakshit Trivedi, Hanjun Dai, Yichen Wang, and Le Song. 2017. Know-evolve: Deep
temporal reasoning for dynamic knowledge graphs. In international conference
on machine learning. PMLR, 3462–3471.
[60] Rakshit Trivedi, Mehrdad Farajtabar, Prasenjeet Biswal, and Hongyuan Zha. 2019.
Dyrep: Learning representations over dynamic graphs. In International conference
on learning representations.
[61] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,
Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. Advances in neural information processing systems 30 (2017).
[62] Sanjeev Verma, Rohit Sharma, Subhamay Deb, and Debojit Maitra. 2021. Artifi-
cial intelligence in marketing: Systematic review and future research direction.
International Journal of Information Management Data Insights 1, 1 (2021), 100002.
[63] Jiyao Wang, Zijie Chen, Yang Qin, Dengbo He, and Fangzhen Lin. 2023. Multi-
Aspect co-Attentional Collaborative Filtering for extreme multi-label text classi-
fication. Knowledge-Based Systems 260 (2023), 110110.
[64] Qifan Wang, Li Yang, Bhargav Kanagal, Sumit Sanghai, D Sivakumar, Bin Shu,
Zac Yu, and Jon Elsas. 2020. Learning to extract attribute value from product
via question answering: A multi-task approach. In Proceedings of the 26th ACM
SIGKDD International Conference on Knowledge Discovery & Data Mining. 47–55.
[65] Xin Wang, Jiaxiu He, David J Curry, and Jun Hyun Ryoo. 2022. Attribute embed-
ding: Learning hierarchical representations of product attributes from consumer
reviews. Journal of Marketing 86, 6 (2022), 155–175.
[66] Xiao Wang, Yuanfu Lu, Chuan Shi, Ruijia Wang, Peng Cui, and Shuai Mou. 2020.
Dynamic heterogeneous information network embedding with meta-path based
proximity. IEEE Transactions on Knowledge and Data Engineering (2020).
[67] Chao-Yuan Wu, Amr Ahmed, Alex Beutel, Alexander J Smola, and How Jing. 2017.
Recurrent recommender networks. In Proceedings of the tenth ACM international
conference on web search and data mining. 495–503.
[68] Lin Xiao, Xin Huang, Boli Chen, and Liping Jing. 2019. Label-specific document
representation for multi-label text classification. In Proceedings of the 2019 confer-
ence on empirical methods in natural language processing and the 9th international
joint conference on natural language processing (EMNLP-IJCNLP). 466–475.
[69] Da Xu, Chuanwei Ruan, Evren Korpeoglu, Sushant Kumar, and Kannan Achan.
Inductive representation learning on temporal graphs. arXiv preprint
2020.
arXiv:2002.07962 (2020).
[70] Huimin Xu, Wenting Wang, Xinnian Mao, Xinyu Jiang, and Man Lan. 2019.
Scaling up open tagging from tens to thousands: Comprehension empowered
attribute value extraction from product title. In Proceedings of the 57th Annual
Meeting of the Association for Computational Linguistics. 5214–5223.
[71] Kaiquan Xu, Stephen Shaoyi Liao, Jiexun Li, and Yuxia Song. 2011. Mining com-
parative opinions from customer reviews for competitive intelligence. Decision
support systems 50, 4 (2011), 743–754.
[72] Mengjia Xu, Apoorva Vikram Singh, and George Em Karniadakis. 2022. DynG2G:
An Efficient Stochastic Graph Embedding Method for Temporal Graphs. IEEE
Transactions on Neural Networks and Learning Systems (2022).
[73] Xueke Xu, Xueqi Cheng, Songbo Tan, Yue Liu, and Huawei Shen. 2013. Aspect-
level opinion mining of online customer reviews. China Communications 10, 3
(2013), 25–41.
[74] Guotong Xue, Ming Zhong, Jianxin Li, Jia Chen, Chengshuai Zhai, and Ruochen
Kong. 2022. Dynamic network embedding survey. Neurocomputing 472 (2022),
212–223.
[75] Hansheng Xue, Luwei Yang, Wen Jiang, Yi Wei, Yi Hu, and Yu Lin. 2021. Modeling
dynamic heterogeneous network for link prediction using hierarchical atten-
tion with temporal rnn. In Joint European Conference on Machine Learning and
Knowledge Discovery in Databases. Springer, 282–298.
[76] Jun Yan, Nasser Zalmout, Yan Liang, Christan Grant, Xiang Ren, and Xin Luna
Dong. 2021. Adatag: Multi-attribute value extraction from product profiles with
adaptive decoding. arXiv preprint arXiv:2106.02318 (2021).
[77] Li Yang, Qifan Wang, Zac Yu, Anand Kulkarni, Sumit Sanghai, Bin Shu, Jon Elsas,
and Bhargav Kanagal. 2022. Mave: A product dataset for multi-source attribute
value extraction. In Proceedings of the Fifteenth ACM International Conference on
Web Search and Data Mining. 1256–1265.
[78] Luwei Yang, Zhibo Xiao, Wen Jiang, Yi Wei, Yi Hu, and Hao Wang. 2020. Dy-
namic heterogeneous graph embedding using hierarchical attentions. In European
Conference on Information Retrieval. Springer, 425–432.
[79] Jisu Yi and Yun Kyung Oh. 2022. The informational value of multi-attribute online
consumer reviews: a text mining approach. Journal of Retailing and Consumer
Services 65 (2022), 102519.
[80] Jiaxuan You, Tianyu Du, and Jure Leskovec. 2022. ROLAND: graph learning
framework for dynamic graphs. In Proceedings of the 28th ACM SIGKDD Confer-
ence on Knowledge Discovery and Data Mining. 2358–2366.
[81] Wenchao Yu, Wei Cheng, Charu C Aggarwal, Kai Zhang, Haifeng Chen, and Wei
Wang. 2018. Netwalk: A flexible deep embedding approach for anomaly detection
in dynamic networks. In Proceedings of the 24th ACM SIGKDD international
conference on knowledge discovery & data mining. 2672–2681.
[82] Ling Zhan and Tao Jia. 2022. Coarsas2hvec: Heterogeneous information network
embedding with balanced network sampling. Entropy 24, 2 (2022), 276.
[83] Hanlei Zhang, Hua Xu, Ting-En Lin, and Rui Lyu. 2021. Discovering new intents
with deep aligned clustering. In Proceedings of the AAAI Conference on Artificial
Intelligence, Vol. 35. 14365–14373.
[84] Xinyang Zhang, Chenwei Zhang, Xian Li, Xin Luna Dong, Jingbo Shang, Christos
Faloutsos, and Jiawei Han. 2022. OA-Mine: Open-World Attribute Mining for
E-Commerce Products with Weak Supervision. In Proceedings of the ACM Web
Conference 2022. 3153–3161.
[85] Yao Zhang, Yun Xiong, Xiangnan Kong, and Yangyong Zhu. 2017. Learning node
embeddings in interaction graphs. In Proceedings of the 2017 ACM on Conference
on Information and Knowledge Management. 397–406.
[86] Zhen Zhang, Jiajun Bu, Zhao Li, Chengwei Yao, Can Wang, and Jia Wu. 2021.
TigeCMN: On exploration of temporal interaction graph embedding via Coupled
Memory Neural Networks. Neural Networks 140 (2021), 13–26.
[87] Yifeng Zhao, Xiangwei Wang, Hongxia Yang, Le Song, and Jie Tang. 2019. Large
Scale Evolving Graphs with Burst Detection.. In IJCAI. 4412–4418.
[88] Yabing Zhao, Xun Xu, and Mingshu Wang. 2019. Predicting overall customer
satisfaction: Big data evidence from hotel online textual reviews. International
Journal of Hospitality Management 76 (2019), 111–121.
[89] Li Zheng, Zhenpeng Li, Jian Li, Zhao Li, and Jun Gao. 2019. AddGraph: Anomaly
Detection in Dynamic Graph Using Attention-based Temporal GCN.. In IJCAI.
4419–4425.
[90] Lekui Zhou, Yang Yang, Xiang Ren, Fei Wu, and Yueting Zhuang. 2018. Dynamic
network embedding by modeling triadic closure process. In Proceedings of the
AAAI conference on artificial intelligence, Vol. 32.
[91] Dingyuan Zhu, Peng Cui, Ziwei Zhang, Jian Pei, and Wenwu Zhu. 2018. High-
order proximity preserved embedding for dynamic networks. IEEE Transactions
on Knowledge and Data Engineering 30, 11 (2018), 2134–2144.
[92] Linhong Zhu, Dong Guo, Junming Yin, Greg Ver Steeg, and Aram Galstyan. 2016.
Scalable temporal latent space inference for link prediction in dynamic social
networks. IEEE Transactions on Knowledge and Data Engineering 28, 10 (2016),
2765–2777.
[93] Tiangang Zhu, Yue Wang, Haoran Li, Youzheng Wu, Xiaodong He, and Bowen
Zhou. 2020. Multimodal joint attribute prediction and value extraction for e-
commerce product. arXiv preprint arXiv:2009.07162 (2020).
[94] Yu Zhu, Hao Li, Yikang Liao, Beidou Wang, Ziyu Guan, Haifeng Liu, and Deng
Cai. 2017. What to Do Next: Modeling User Behaviors by Time-LSTM.. In IJCAI,
Vol. 17. 3602–3608.
[95] Yuan Zuo, Guannan Liu, Hao Lin, Jia Guo, Xiaoqian Hu, and Junjie Wu. 2018.
Embedding temporal network via neighborhood formation. In Proceedings of the
24th ACM SIGKDD international conference on knowledge discovery & data mining.
2857–2866.
|
http://arxiv.org/abs/2310.04861v1 | "2023-10-07T15:50:26" | "2023-10-07T15:50:26" | Uncovering hidden geometry in Transformers via disentangling position
and context | Transformers are widely used to extract complex semantic meanings from input
tokens, yet they usually operate as black-box models. In this paper, we present
a simple yet informative decomposition of hidden states (or embeddings) of
trained transformers into interpretable components. For any layer, embedding
vectors of input sequence samples are represented by a tensor $\boldsymbol{h}
\in \mathbb{R}^{C \times T \times d}$. Given embedding vector
$\boldsymbol{h}_{c,t} \in \mathbb{R}^d$ at sequence position $t \le T$ in a
sequence (or context) $c \le C$, extracting the mean effects yields the
decomposition \[ \boldsymbol{h}_{c,t} = \boldsymbol{\mu} + \mathbf{pos}_t +
\mathbf{ctx}_c + \mathbf{resid}_{c,t} \] where $\boldsymbol{\mu}$ is the global
mean vector, $\mathbf{pos}_t$ and $\mathbf{ctx}_c$ are the mean vectors across
contexts and across positions respectively, and $\mathbf{resid}_{c,t}$ is the
residual vector. For popular transformer architectures and diverse text
datasets, empirically we find pervasive mathematical structure: (1)
$(\mathbf{pos}_t)_{t}$ forms a low-dimensional, continuous, and often spiral
shape across layers, (2) $(\mathbf{ctx}_c)_c$ shows clear cluster structure
that falls into context topics, and (3) $(\mathbf{pos}_t)_{t}$ and
$(\mathbf{ctx}_c)_c$ are mutually incoherent -- namely $\mathbf{pos}_t$ is
almost orthogonal to $\mathbf{ctx}_c$ -- which is canonical in compressed
sensing and dictionary learning. This decomposition offers structural insights
about input formats in in-context learning (especially for induction heads) and
in arithmetic tasks. | [
"Jiajun Song",
"Yiqiao Zhong"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04861v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04861v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"stat.ML"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
1
6
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Uncovering hidden geometry in Transformers via disentangling
position and context
Jiajun Song*, Yiqiao Zhong†
October 10, 2023
Abstract
Transformers are widely used to extract complex semantic meanings from input tokens, yet they
usually operate as black-box models. In this paper, we present a simple yet informative decomposition
of hidden states (or embeddings) of trained transformers into interpretable components. For any layer,
embedding vectors of input sequence samples are represented by a tensor h ∈ RC×T ×d. Given embed-
ding vector hc,t ∈ Rd at sequence position t ≤ T in a sequence (or context) c ≤ C, extracting the mean
effects yields the decomposition
hc,t = μ + post + ctxc + residc,t
where μ is the global mean vector, post and ctxc are the mean vectors across contexts and across
positions respectively, and residc,t is the residual vector. For popular transformer architectures and
diverse text datasets, empirically we find pervasive mathematical structure: (1) (post)t forms a low-
dimensional, continuous, and often spiral shape across layers, (2) (ctxc)c shows clear cluster structure
that falls into context topics, and (3) (post)t and (ctxc)c are mutually incoherent-namely post is
almost orthogonal to ctxc-which is canonical in compressed sensing and dictionary learning. This de-
composition offers structural insights about input formats in in-context learning (especially for induction
heads) and in arithmetic tasks.
1 Introduction
Transformers (Vaswani et al., 2017) are practical neural network models that underlie recent successes of
large language models (Brown et al., 2020; Bubeck et al., 2023). Unfortunately, transformers are often used
as black-box models due to lack of in-depth analyses of internal mechanism, which raises concerns such as
lack of interpretability, model biases, security issues, etc., (Bommasani et al., 2021).
In particular, it is poorly understood what information embeddings from each layer capture. We identify
two desiderata: (1) internal quantitative measurements, particularly for the intermediate layers; (2) visual-
ization tools and diagnostics tailored to transformers beyond attention matrix plots.
Let us introduce basic notations. An input sequence consists of T consecutive tokens (e.g., words
or subwords), and a corpus is a collection of all input sequences. Let C be the total number of input
sequences and c ≤ C denote a generic sequence, which may be represented by xc,1, . . . , xc,T where each
*National Key Laboratory of General Artificial Intelligence, Beijing Institute for General Artificial Intelligence (BIGAI), Beijing
100080, China, songjiajun@bigai.ai
†Department of Statistics, University of Wisconsin–Madison, WI, 53706, USA, yiqiao.zhong@wisc.edu
1
Figure 1: PCA visualization of positional basis (blue) and cvecs (red) from GPT-2 on OpenWebText. For
every layer l, each pos(l)
c,t are projected using top-2 principal directions of
t
(pos(l)
t )t≤T . Darker blue/red colors correspond to larger t. Principal components have different scales
across layers, but for aesthetic purposes we rescaled all plots.
and randomly selected cvec(l)
xc,t corresponds to a token. We start from the initial static (and positional) embeddings (h(0)
calculate the intermediate-layer embeddings (h(l)
c,t )t≤T :
c,t )t≤T and then
h(0)
c,1, . . . , h(0)
c,1, . . . , h(l)
h(l)
c,T = Embed(xc,1, . . . , xc,T )
c,T = TFLayerl(h(l−1)
c,1
, . . . , h(l−1)
c,T
)
for l = 1, . . . , L.
where Embed and TFLayerl are general mappings. This general definition encompasses many transformer
models, which depend on attention heads defined as follows. Given dhead ≤ d and input matrix X ∈ RT ×d,
for trainable weights W q, W k, W v ∈ Rd×dhead, define
AttnHead(X) = softmax
(cid:18) XW q(W k)⊤X ⊤
√
dhead
(cid:19)
XW v ∈ RT ×dhead .
(1)
Multi-head attention heads, denoted by MHA, are essentially the concatenation of many attention heads.
Denote a generic fully-connected layer by FFN(x) = W2 max{0, W1x + b1} + b2 given any x ∈ Rd for
trainable weights W1 ∈ Rd′×d, W2 ∈ Rd×d′, b1 ∈ Rd′, b2 ∈ Rd (often d′ = 4d), and let LN be a generic
layer normalization layer. The standard transformer is expressed as
h(l+0.5)
c
= h(l)
c + MHA(l)(LN(l,1)(h(l)
c )), h(l+1)
c,t = h(l+0.5)
c,t
+ FFN(l)(LN(l,2)((h(l+0.5)
c,t
)))
where h(l+0.5)
c
= (h(l+0.5)
c,1
, . . . , h(l+0.5)
c,T
1.1 A mean-based decomposition
) and h(l)
c = (h(l)
c,1, . . . , h(l)
c,T ).
For each embedding vector h(l)
c,t ∈ Rd from any trained transformer, consider the decomposition
μ(l) :=
1
CT
(cid:88)
c,t
h(l)
c + resid(l)
c,t = μ(l) + pos(l)
t + ctx(l)
c,t ,
1
(cid:88)
h(l)
c,t , pos(l)
h(l)
c,t − μ(l),
C
:=
t
ctx(l)
c
c
where
1
T
:=
(cid:88)
t
h(l)
c,t − μ(l) .
(2)
(3)
Each of the four components has the following interpretations. For any given layer l,
2
Table 1: Averaged (and std of) measurements across layers. Measurements based on 6.4K samples. All
values are in [0, 1] except 'rank estimate': 'relative norm' means magnitude of positional basis relative to
centered embeddings; 'similarity' and 'incoh' are averaged cosine similarity (inner products of normalized
vectors) between ctx, and between ctx and pos, respectively.
Positional basis
rank
estimate
7.86(1.96)
relative
norm
0.66(0.28)
Context basis
inter-cluster
similarity
--–
intra-cluster
similarity
--–
Incoh
--–
NanoGPT
Shakespeare
GPT-2
BERT
BLOOM
OpenWebText
11.38(1.86)
0.31(0.19)
WikiText
11.69(1.64)
0.31(0.19)
OpenWebText
12.54(2.73)
0.24(0.07)
WikiText
12.62(2.70)
0.24(0.06)
OpenWebText
10.23(1.31)
0.16(0.09)
WikiText
10.00(1.47)
0.16(0.08)
OpenWebText
9.38(1.15)
0.14(0.03)
Llama 2
WikiText
8.69(0.91)
0.14(0.03)
GitHub
8.69(1.67)
0.20(0.05)
0.10(0.01)
0.11(0.01)
0.13(0.04)
0.17(0.03)
0.21(0.12)
0.15(0.14)
0.12(0.13)
0.33(0.20)
0.22(0.08)
0.44(0.04)
0.051(0.05)
0.41(0.03)
0.039(0.04)
0.26(0.04)
0.046(0.05)
0.31(0.04)
0.043(0.04)
0.48(0.06)
0.158(0.23)
0.32(0.09)
0.148(0.23)
1.00(0.01)
0.190(0.24)
1.00(0.01)
0.316(0.27)
1.00(0.01)
0.189(0.20)
• we call μ(l) the global mean vector, which differentiates neither contexts nor positions;
• we call (pos(l)
t )t≤T the positional basis, as they quantify average positional effects;
• we call (ctx(l)
c )c≤C the context basis, as they quantify average sequence/context effects;
• we call (resid(l)
c,t )t≤T,c≤C the residual vectors, which capture higher-order effects;
• In addition, we define cvec(l)
c,t = ctx(l)
c + resid(l)
c,t .
A priori, we do not know how much position information is retained in each layer, since many trans-
formers only have explicit positional encodings in the 0-th layer. Are positional basis and context basis play
the role as the names suggest? We will provide affirmative answers.
Sampling input sequences. A corpus can be extremely large, containing billions of tokens. For practical
use, in this paper C is much smaller: we subsample input sequences from the corpus; for example, C =
6.4K in Figure 1. Thus, our empirical-mean-based decomposition can be regarded as an estimate of the
population means, using much less computation.
(i) We use context to refer to a sequence since its tokens collectively encode context
On terminology.
information. (ii) We call positional/context basis for convenience. A more accurate term is frame or over-
complete basis, since (pos(l)
t )c≤C are often linearly dependent.
t )t≤T and (ctx(l)
Connections to Analysis-of-Variance (ANOVA). Our embedding decomposition is similar to two-way
ANOVA in form. Borrowing standard terminology from ANOVA, positions and contexts can be regarded
as two treatments, so viewing the embedding hc,t as the response variable, then positional/context bases
represent mean effects.
3
Figure 2: Normalized Gram matrix [ ̄P , ̄C]⊤[ ̄P , ̄C] where ̄P = [ pos1
∥posT ∥ ] and ̄C =
∥ctx1∥ , . . . , ctxC
[ ctx1
∥ctxC ∥ ] based on GPT-2. Here, T = 128, and ctxc is sampled from 4 documents with sam-
ple size 32 in OpenWebText. We find (i) Smoothness, pos-pos part (top left) of Gram matrix is smooth;
(ii) Incoherence, pos-ctx part (top right/bottom left) has values close to 0; (iii) Clustering, ctx-ctx part
(bottom right) shows strong cluster patterns.
∥pos1∥ , . . . , posT
1.2 Pervasive geometrical structure
We consider a variety of transformers and datasets; see Section A for details. Our main results are summa-
rized below. Further, Section 5 explores randomization experiments and arithmetic tasks.
1. Positional basis is a significant and approximately low-rank component, forming a continuous and
curving shape, which is linked to smoothness.
2. Context basis has strong cluster patterns corresponding to documents/topics.
3. Positional basis and context basis are nearly orthogonal (or incoherent), which allows self-attention
heads to capture the interaction of the two bases easily.
What does residc,t represent? As with regression models, residual components may be non-negligible
and contain idiosyncratic information. For example, they can be used to track previously seen tokens (Sec-
tion 4.1) or special symbols in arithmetic tasks (Section 5.2).
1.3 Accessible reproducibility
We provide a fast implementation via Google Colab that reproduces most of the figures and analysis for
GPT-2 (under several minutes with the GPU option):
https://colab.research.google.com/drive/1ubsJQvLkOSQtiU8LoBA_79t1bd5-5ihi?usp=sharing .
The complete implementation, as well as additional plots and measurements, can be found on the following
GitHub page.
https://github.com/JiajunSong629/uncover-hidden-geometry
4
2 Geometry of positional basis
2.1 Low-dimensional structure as a significant component
We find that the positional basis concentrates around a low-dimensional subspace. In Table 1, we report
the rank estimate of positional basis averaged across all layers using the method of Donoho et al. (2023).
In Section B.2, we report detailed rank estimates and an additional measurement: stable rank (Rudelson
& Vershynin, 2007). Table 2 shows that the low-rank structure is robustness to out-of-distribution data,
suggesting positional basis is indeed agnostic to contexts.
We also find that usually, the positional basis ac-
counts for a significant proportion of embeddings.
In Table 1, we report the relative norm (averaged
across layers) ∥P ∥op/∥M ∥op, where M contains
centered embedding vectors hc,t − μ and columns
of P are corresponding post. We also consider
̄P = [ pos1
∥posT ∥ ],
normalized vectors:
etc.
In Figure 3 (left), we plot the top singu-
lar values (adjusted for dimensional difference)
in descending order of P = [pos1, . . . , posT ],
Cvec = [cvec1,1, . . . , cvecc,T ], and R =
[resid1,1, . . . , residc,T ]. Visibly, positional basis
is a considerable component in magnitude and con-
tributes to the spikedness of embeddings.
Figure 3: Spectral and Fourier analysis based on
GPT-2 model and OpenWebText. Left: Top-60 (ad-
justed) singular values of P , Cvec, R. Right: Ap-
plying 2D discrete cosine transform to ̄P ⊤ ̄P , we
show first 10 frequency coefficients.
We notice that there are two exceptions: (i) 0-th
layer of Llama 2 and BLOOM (due to no positional
encoding), (ii) last one/few layers of a transformer.
Likely, last layers do not need position information as contextualization is completed; an investigation is left
as future work.
∥pos1∥ , . . . , posT
2.2 Spiral shape via a Fourier perspective
A priori, a common geometric structure of positional basis
is unexpected: after all, different models/datasets may use
position information differently. Nevertheless, on text-based
datasets, we observe a common continuous shape that is often
spiral, parabolic, or U-shaped.
In Figure 3 (right), we apply the 2D discrete cosine trans-
form to the normalized Gram matrix ̄P ⊤ ̄P and discover that
energies are concentrated mostly in the low-frequency compo-
nents, which reinforces the smooth and curving structure we
identified. Other models show similar low-frequency patterns
except for BERT (possibly due to the different loss function).
2.3 Theoretical insight: connection to smoothness
Table 2: Robustness of positional ba-
sis. Similar geometric structures found on
out-of-distribution samples: NanoGPT on
WikiText, others on GitHub.
rank
estimate
7.86(1.96) 0.66(0.28)
relative
norm
NanoGPT
GPT-2
BERT
11.54(1.55) 0.31(0.16)
12.46(2.47) 0.23(0.04)
BLOOM
9.54(0.84) 0.14(0.05)
It is well known that the smoothness of a function is connected to fast decay or sparsity in the frequency
domain (Pinsky, 2008, Sect. 1.2.3). In Figure 2, the Gram matrix of positional basis exhibits smooth patterns,
allowing attention to neighboring tokens more easily. Does smoothness of the Gram matrix shed light on
the geometrical structure of the positional basis? We provide an affirmative answer.
5
Smoothness of pos-pos Gram matrix induces the low-dimensional and spiral shape.
Let G = P ⊤P ∈ RT ×T be the Gram matrix of the positional basis (no normalization for simplicity).
By definition in Equation 3, positional basis has zero means, so pos1 + . . . + posT = 0. To characterize
smoothness, below we introduce the definition of finite difference. As with the discrete cosine transform in
1D, we need to extend and reflect the Gram matrix to avoid boundary effects.
Let G(1) = G and G(2), G(3), G(4) ∈ RT ×T be defined by G(2)
t,t′ = GT +1−t,T +1−t′ for any t, t′ = 1, 2, . . . T . We extend and reflect G by
t,t′ = Gt,T +1−t′, G(3)
t,t′ = GT +1−t,t′,
G(4)
̃G :=
(cid:18) G(1) G(2)
G(3) G(4)
(cid:19)
.
(4)
We define the first-order finite difference by (using periodic extension ̃Gt±2T,t′±2T = ̃Gt,t′)
[∆(1,1) ̃G]t,t′ = T 2(cid:0) ̃Gt,t′ − ̃Gt−1,t′ − ̃Gt,t′−1 + ̃Gt−1,t′−1
(cid:1),
for all integers t, t′
(5)
Higher-order finite differences are defined recursively by ∆(m,m) ̃G = ∆(1,1)(cid:0)∆(m−1,m−1) ̃G(cid:1).
Note that ∆(m,m) ̃G measures higher-order smoothness of ̃G. Indeed, if Gt,t′ = f (t/T, t′/T ) for certain
smooth function f (x, y) defined on [0, 1]2, then [∆(m,m) ̃G]t,t′ ≈ ∂m
x ∂m
y f (t/T, t′/T ).
Theorem 1. Fix positive integers k ≤ T and m. Define the low-frequency vector fs = (1, cos((s −
0.5)π/T ), . . . , cos((s − 0.5)(T − 1)π/T ))⊤ ∈ RT where s = 1, . . . , k, and denote F≤k = [f1, . . . , fk] ∈
RT ×k. Then there exists B ∈ Rk×k such that (denoting ∥A∥max = maxij |Aij|)
1
T
(cid:13)
(cid:13)G − (F≤kB)⊤F≤kB
(cid:13)
(cid:13)
(cid:13)
(cid:13)op
≤
6
(8k)m ∥∆(m,m) ̃G∥max .
(6)
This theorem implies that if the extended Gram matrix has higher-order smoothness, namely ∥∆(m,m) ̃G∥max
is bounded by a constant, then even for moderate k and m, we have approximation G ≈ (F≤kB)⊤F≤kB.
Note that F≤kB consists of linear combinations of low-frequency vectors. This explains why G has a
dominant low-rank and low-frequency component.
Why smoothness? One possible explanation is that smoothness allows attention to neighboring tokens
easily (crucial for natural languages/codes), because often short-ranged token pairs tend to receive higher
QK values and thus higher attention weights.
3 Context basis: salient cluster structure
Figure 2 shows that the context basis computed from 4 different documents can be visually clustered into 4
groups. Measuring cluster compactness, we find that using context basis or even cvecs has at least a slight
advantage over raw embeddings (without removing positional effects) as in Thompson & Mimno (2020).
See Section C for detailed analysis.
On contextualization. We observe from Table 1 and Section C: (i) except for Llama 2 and BLOOM,
the increase in cluster compactness seems to be moderate and only occurs in early layers, likely because
our measurements are global rather than based on fine-grained conditional probabilities; (ii) Llama 2 and
BLOOM show progressive changes in cluster compactness across layers, as shown by the numbers in the
paratheses. This is likely due to heterogeneous data during pretraining.
6
Figure 4: Dissecting QK/attention: GPT-2 on a repeated sequence of random tokens. (a)(b)(c): we visu-
alize pos-pos, pos-cvec, cvec-pos, cvec-cvec QK components (first four columns of heatmaps), QK
matrix (5-th column), and attention matrix (6-th column). (d): We visualize the same three attention heads
simultaneously, highlighting 'anger' token and its associated attention.
4 An investigation of incoherent bases
Table 1 (last column) shows the mutual incoherence maxt,c |⟨ post
∥ctxc∥ ⟩|, as a measure of alignment
between the positional basis and the context basis. The low incoherence in Table 1 (zero is impossible
due to noise) means that the two bases are nearly orthogonal to each other. This weak alignment is a key
structural requirement for sparse learning and is often associated with restricted isometry (Candes & Tao,
2005), irrepresentable conditions (Zhao & Yu, 2006), etc.
∥post∥ , ctxc
4.1 QK matrix decomposition: a study on induction heads
Induction heads (Elhage et al., 2021) are components in transformers that complete a sequence pattern based
on observed past tokens, namely, predicting the next token [B] based on observed sequence [A], [B], . . . , [A].
They are recently identified to explain in-context learning abilities of large language models. Surprisingly,
induction heads even generalize on out-of-distribution data.
To dissect the self-attention mechanism, we decompose the QK matrices into components: assuming
μ = 0, then for embedding vectors h, h′ ∈ Rd we have
h⊤W q(W k)⊤h = pos⊤W q(W k)⊤pos + pos⊤W q(W k)⊤cvec
+ cvec⊤W q(W k)⊤pos + cvec⊤W q(W k)⊤cvec .
(7)
Each of the four components shows how much an attention head captures information from cross-pairs
pos/cvec-pos/cvec of an embedding. Although the global mean μ ̸= 0 in reality, we find that it has
little effect on interpretations.
Attention attribution for induction heads. Motivated by Equation 7, we decompose QK matrices into
interpretable components that illuminate the mechanism of induction heads. We generate a sequence of 8
random tokens, repeat it twice, and then concatenate them into an input sequence for the pretrained GPT-2
model. For each layer/head, we calculate four QK matrix components; for example, for pos-pos matrix,
each entry is given by pos⊤
i W q(W k)⊤posj where i, j ≤ T .
7
Figure 5: Structure of attention weight matrices. For any of the 12 attention heads (for layer L = 6 shown
dhead ∈ Rd×d. Red: we show the diagonal entries
here) in GPT-2, we study the matrix W = W q(W k)⊤/
diagg(W ). Blue: we take off-diagonal matrix W − diagg(W ) and rotate it by the right singular vectors of
positional basis, then show the large absolute values.
√
Generally, we find that pos-pos is smoothly dependent on positions, while cvec-cvec exposes non-
global effects of individual tokens. Depending on the magnitude of the four components, the "winning"
component will determine the pattern of the attention matrix.
As shown in Figure 4, we identify three types of attention heads that are vital for induction heads.
• Attention to self-tokens (Layer 0, Head 1). The dominant component is cvec-cvec (4-th heatmap in
(a)), where visible diagonal lines indicate strong association between identical tokens, which translates
to attention to previous identical tokens (blue lines in (d)).
• Attention to neighboring tokens (Layer 2, Head 2). The dominant component is pos-pos (1-th
heatmap in (b)), where upper right entries have higher values, resulting in attention to the previous
few tokens (red lines in (d)), thanks to softmax and causal masking.
• Attention to token being copied (Layer 5, Head 1). The combination of the first two types gives rise
to a new QK/attention pattern, where visible diagonal lines are shifted (yellow arrow) by one token;
compare 6-th heatmaps in (a) & (c). Given token 'anger', as shown in grey in (d), attention heads look
back for the next adjacent token, as shown in green.
Each type contains many representative heads including our handpicked ones; see Section D.1.
4.2 Dissecting attention weight matrices
So far, we have observed that positional information is passed from earlier layers to later layers, yielding
clear geometric structures. How does transformer layer TFLayerl enable this information flow? A natural
hypothesis is that the weight matrix W := W q(W k)⊤/
dhead has a component that is aligned with the
low-dimensional subspace where the positional basis lies. We empirically examine whether the following
low-rank plus noise structure holds for certain heads.
√
W = V LV ⊤ + D + Noise
(8)
where columns of V ∈ Rd×K are the top-K right singular vectors of positional basis matrix P , L ∈ RK×K,
and D ∈ Rd×d is a diagonal matrix.
In Figure 5, we take D = diagg(W ) (shown in red), rotate the off-diagonal part of W by the right
singular vectors of P and apply denoising, namely zeroing entries whose absolute values are smaller than a
8
threshold. For many heads, the surviving large absolute values are concentrated in the top left (K ≈ 20)-
which suggests that indeed a significant component of W is aligned with the positional basis, supporting
Equation 8.
4.3 Theoretical insight: kernel factorization
What are the desirable properties that incoherence structure induces in many trained transformers? It is well
known in sparse coding and compressed sensing that incoherent basis facilitates recovery of sparse signals
(Donoho & Stark, 1989; Donoho & Elad, 2003; Donoho, 2006; Cand`es et al., 2006).
Here we focus on the self-attention mechanism of transformers. By adopting the kernel perspective, we
provide preliminary analysis for our following heuristics:
Incoherence enables a kernel to factorize into smaller components, each operating independently.
Given query/key matrices W q, W k ∈ Rd×dhead, we define the (asymmetric) kernel by
KW (z, z′) := exp
(cid:16)
z⊤W z′(cid:17)
= exp
(cid:18) ⟨W qz, W kz′⟩
√
dhead
(cid:19)
,
recall W = W q(W k)⊤/
(cid:112)
dhead.
Using KW , the attention can be expressed as kernel smoothing: for embeddings (xt)t≤T ⊂ Rd,
AttnHead(xt; KW ) =
(cid:88)
k≤t
KW (xk, xt)
k′≤t KW (xk′, xt)
(cid:80)
v(xk)
(9)
where v : Rd → R is a generic value function. This kernel perspective is explored in Tsai et al. (2019),
where it is argued that the efficacy of self-attention largely depends on the form of the kernel.
Suppose that there are two overcomplete bases B0
1 or B0
2. The mutual incoherence is incoh := max (cid:8)|⟨c, t⟩ : c ∈ B0
if u ∈ B0
(extended) overcomplete basis Bα := {λu : u ∈ B0
vectors xq, xk ∈ Rd, suppose that we can decompose them according to the two bases.
where cq, ck ∈ B1; tq, tk ∈ B2.
xq = cq + tq, xk = ck + tk,
1, B0
2 ⊂ Rd. For simplicity, assume that ∥u∥2 ≤ 1
(cid:9). Consider the
α, λ ∈ [−1, 1]} where α ∈ {1, 2}. Given query/key
1, t ∈ B0
2
(10)
We can generically decompose the kernel into a product of four components
KW (xq, xk) = KW (cq, ck)KW (cq, tk)KW (tq, ck)KW (tq, tk) .
Each kernel component measures cross similarity of pairs between cq, tq and ck, tk, which then translates
into a weight for the attention. Unfortunately, this general decomposition requires the individual kernels to
share the same weight W , which hinders capturing cross interactions flexibly.
It turns out that if the weight matrix is sparsely represented by the bases, then kernel flexibility can be
achieved. To be precise, we will say that W ∈ Rd×d is s-sparsely represented by bases B, B′ if there exist
(ak)k≤s ⊂ [−1, 1], (uk)k≤s ⊂ B, (vk)k≤s ⊂ B′ such that
(cid:88)
W =
akukv⊤
k .
(11)
k≤s
Theorem 2. Let W11, W12, W21, W22 ∈ Rd×d be any matrices with the following properties: for α, β ∈
{1, 2}, Wαβ ∈ Rd×d is O(1)-sparsely represented by bases Bα, Bβ. Then for all xq, xk ∈ Rd satisfying
Equation 10, W = W11 + W12 + W21 + W22 satisfies
KW (xq, xk) = (cid:0)1 + O(incoh)(cid:1) * KW11(cq, ck)KW12(cq, tk)KW21(tq, ck)KW22(tq, tk)
(12)
2|) exp(−incoh2 * d) if each Wαβ is
Moreover, Equation 12 holds with probability at least 1 − O((|B0
replaced by Wαβ + Zαβ√
d
where (Zαβ)kk′ is an independent subgaussian1 random variable.
1| * |B0
1We say that a random variable ξ is subgaussian if E[ξ] = 0 and E[exp(λξ)] ≤ exp(λ2/2) for all λ ∈ R.
9
Figure 6: (a)(b)(c): Token randomization experiments (first row). Positional basis of transformers trained
on unmodified text sequences, sequences with the latter half replaced by random tokens, purely random
tokens, respectively. (d)(e): Addition experiment (second/third row). Fractured/discontinuous patterns
likely cause length generalization to fail.
The factorization 12 says that each kernel component has a separate weight matrix, and all components
contribute multiplicatively to KW . The "moreover" part generalizes the sparse representation notion by
allowing additive noise, which matches the empirical structure in Equation 8. The additive construction of
W is connected to task arithmetic recently studied in the literature (Ilharco et al., 2022; Ortiz-Jimenez et al.,
2023).
Remark 1. If we suppose incoh ≍ d−γ with 1/2 > γ > 0, then the high probability statement is nontrivial
if |B0
2| = o(exp(d1−2γ)). This dictionary size limit is generally reasonable.
1| * |B0
5 Why training format matters: smoothness perspective
5.1 Training with token randomization
We train transformers on three different training data: (i) baseline-sequences of length T = 512 sam-
pled from the first 10K samples of OpenWebText, (ii) partial randomization-sequences of the same data
source but the latter half is replaced by random tokens uniformly sampled in the vocabulary, (iii) full
randomization-input sequences are fully random tokens.
Figure 6 (a)–(c) show the positional bases of two selected layers (L1 & L5) from the three settings. As
darker colors represent later positions, we find that randomization destroys geometric structures of positional
basis at exact positions where randomization takes place.
5.2 Simple experiments on addition tasks
We explore a simple arithmetic task-Addition, where inputs are formatted as a string "a + b = c" with
a, b, c represented by digits of a certain length. We sample the length of each addition component uniformly
from {L/2, . . . , L} where L = 10 and then (i) in the "carry" setting, sample digits independently, and (ii) in
10
the "no-carry" setting, examples involving carry are removed. For both settings, the output order is reversed
(Lee et al., 2023). Training transformers on datasets under the two settings, we discover similar phenomena,
so we only present results for (i).
In Figure 6 (d)–(e), we visualize two exemplary attention heads in a way similar to Figure 4. We find
many fractured or discontinuous QK matrices and their pos-pos components. Likely associated with this
discontinuity pattern, we find the transformer has difficulty generalizing to longer or shorter sequences
(failure of length generalization). See Section E for details.
6 Related work
Analyses of transformers have attracted research interest since Vaswani et al. (2017). Many studies on
GPT-2 (Radford et al., 2019) and BERT (Devlin et al., 2018) show that last-layer contextualized embed-
dings capture linguistic structure and exhibit excellent downstream performance (Hewitt & Manning, 2019;
Chi et al., 2020; Thompson & Mimno, 2020). Fewer papers focus on the geometry or intermediate-layer
embeddings: in Ethayarajh (2019), it is found that later-layer embeddings are increasingly anisotropic and
context-specific; Cai et al. (2020); Reif et al. (2019); Hernandez & Andreas (2021); Gao et al. (2019) ob-
served interesting geometric structures and artifacts without thorough analysis; Yeh et al. (2023) provide
visualization tools for embeddings. Some very recent papers provide empirical/theoretical evidence about
either low-rank or diagonal structure in attention weight matrices (Boix-Adsera et al., 2023; Trockman &
Kolter, 2023). Our decomposition unifies scattered empirical phenomena, reveals consistent geometry and
explains observed artifacts (anisotropic, spiral shape, etc.).
Many variants of positional embedding are proposed (Shaw et al., 2018; Dai et al., 2019; Su et al., 2021;
Scao et al., 2022; Press et al., 2021) since Vaswani et al. (2017). Since GPT-4, many papers focus on length
generalization for arithmetic tasks (Kazemnejad et al., 2023; Lee et al., 2023). Prior analyses on positional
embeddings focus only on static (0-th layer) embeddings for selected transformers (Wang et al., 2020; Ke
et al., 2020; Wang & Chen, 2020; Tsai et al., 2019), whereas we provide a complete picture.
Prior work on LSTMs finds decomposition-based methods can enhance interpretability (Murdoch et al.,
2018). Understanding the inner workings of transformers is usually done through visualizing the attention
heads (Clark et al., 2019; Wang et al., 2022). The emergence of induction heads (Elhage et al., 2021; Olsson
et al., 2022) is supported by attention visualization, which is further reinforced by our analysis.
7 Limitations
In this paper, we mostly focus on pretrained transformers due to limited computational resources. It would
be interesting to investigate the impact of input/prompt formats on the geometry of embeddings over the
course of training, especially for different linguistic tasks and arithmetic tasks.
Also, we mostly focus on the mean vectors post and ctxc but not study residc,t thoroughly. It would
be interesting to study the higher-order interaction in residc,t and propose a nonlinear decomposition of
embeddings, which is left to future work.
8 Acknowledgement
We thank Junjie Hu, Tim Ossowski, Harmon Bhasin, Wei Wang for helpful discussions.
Support for this research was provided by the Office of the Vice Chancellor for Research and Graduate
Education at the University of Wisconsin–Madison with funding from the Wisconsin Alumni Research
Foundation.
11
References
Enric Boix-Adsera, Etai Littwin, Emmanuel Abbe, Samy Bengio, and Joshua Susskind. Transformers learn
through gradual rank increase. arXiv preprint arXiv:2306.07042, 2023.
Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S
Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of
foundation models. arXiv preprint arXiv:2108.07258, 2021.
S Allen Broughton and Kurt Bryan. Discrete Fourier analysis and wavelets: applications to signal and
image processing. John Wiley & Sons, 2018.
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind
Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners.
Advances in neural information processing systems, 33:1877–1901, 2020.
S ́ebastien Bubeck, Varun Chandrasekaran, Ronen Eldan, Johannes Gehrke, Eric Horvitz, Ece Kamar, Peter
Lee, Yin Tat Lee, Yuanzhi Li, Scott Lundberg, et al. Sparks of artificial general intelligence: Early
experiments with gpt-4. arXiv preprint arXiv:2303.12712, 2023.
Xingyu Cai, Jiaji Huang, Yuchen Bian, and Kenneth Church. Isotropy in the contextual embedding space:
Clusters and manifolds. In International Conference on Learning Representations, 2020.
Emmanuel J Candes and Terence Tao. Decoding by linear programming. IEEE transactions on information
theory, 51(12):4203–4215, 2005.
Emmanuel J Cand`es, Justin Romberg, and Terence Tao. Robust uncertainty principles: Exact signal recon-
struction from highly incomplete frequency information. IEEE Transactions on information theory, 52
(2):489–509, 2006.
Ethan A Chi, John Hewitt, and Christopher D Manning. Finding universal grammatical relations in multi-
lingual bert. arXiv preprint arXiv:2005.04511, 2020.
Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D Manning. What does bert look at? an
analysis of bert's attention. arXiv preprint arXiv:1906.04341, 2019.
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdi-
arXiv preprint
nov. Transformer-xl: Attentive language models beyond a fixed-length context.
arXiv:1901.02860, 2019.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirec-
tional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
David Donoho, Matan Gavish, and Elad Romanov. Screenot: Exact mse-optimal singular value thresholding
in correlated noise. The Annals of Statistics, 51(1):122–148, 2023.
David L Donoho. Compressed sensing. IEEE Transactions on information theory, 52(4):1289–1306, 2006.
David L Donoho and Michael Elad. Optimally sparse representation in general (nonorthogonal) dictionaries
via l1 minimization. Proceedings of the National Academy of Sciences, 100(5):2197–2202, 2003.
David L Donoho and Philip B Stark. Uncertainty principles and signal recovery. SIAM Journal on Applied
Mathematics, 49(3):906–931, 1989.
12
Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda
Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac
Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario
Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathemat-
https://transformer-
ical framework for transformer circuits.
circuits.pub/2021/framework/index.html.
Transformer Circuits Thread, 2021.
Kawin Ethayarajh. How contextual are contextualized word representations? comparing the geometry of
bert, elmo, and gpt-2 embeddings. arXiv preprint arXiv:1909.00512, 2019.
Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Representation degeneration problem in
training natural language generation models. arXiv preprint arXiv:1907.12009, 2019.
Evan Hernandez and Jacob Andreas. The low-dimensional linear geometry of contextualized word repre-
sentations. arXiv preprint arXiv:2105.07109, 2021.
John Hewitt and Christopher D Manning. A structural probe for finding syntax in word representations. In
Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational
Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4129–4138, 2019.
Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh
Hajishirzi, and Ali Farhadi. Editing models with task arithmetic. arXiv preprint arXiv:2212.04089, 2022.
Amirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das, and Siva Reddy. The
impact of positional encoding on length generalization in transformers. arXiv preprint arXiv:2305.19466,
2023.
Guolin Ke, Di He, and Tie-Yan Liu. Rethinking positional encoding in language pre-training. arXiv preprint
arXiv:2006.15595, 2020.
Nayoung Lee, Kartik Sreenivasan, Jason D Lee, Kangwook Lee, and Dimitris Papailiopoulos. Teaching
arithmetic to small transformers. arXiv preprint arXiv:2307.03381, 2023.
W James Murdoch, Peter J Liu, and Bin Yu. Beyond word importance: Contextual decomposition to extract
interactions from lstms. arXiv preprint arXiv:1801.05453, 2018.
Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben
Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac
Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Ka-
mal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris
Olah. In-context learning and induction heads. Transformer Circuits Thread, 2022. https://transformer-
circuits.pub/2022/in-context-learning-and-induction-heads/index.html.
Guillermo Ortiz-Jimenez, Alessandro Favero, and Pascal Frossard. Task arithmetic in the tangent space:
Improved editing of pre-trained models. arXiv preprint arXiv:2305.12827, 2023.
Mark A Pinsky. Introduction to Fourier analysis and wavelets, volume 102. American Mathematical Soc.,
2008.
Ofir Press, Noah A Smith, and Mike Lewis. Train short, test long: Attention with linear biases enables input
length extrapolation. arXiv preprint arXiv:2108.12409, 2021.
13
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models
are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
Emily Reif, Ann Yuan, Martin Wattenberg, Fernanda B Viegas, Andy Coenen, Adam Pearce, and Been Kim.
Visualizing and measuring the geometry of bert. Advances in Neural Information Processing Systems,
32, 2019.
Mark Rudelson and Roman Vershynin. Sampling from large matrices: An approach through geometric
functional analysis. Journal of the ACM (JACM), 54(4):21–es, 2007.
Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ili ́c, Daniel Hesslow, Roman Castagn ́e,
Alexandra Sasha Luccioni, Franc ̧ois Yvon, Matthias Gall ́e, et al. Bloom: A 176b-parameter open-access
multilingual language model. arXiv preprint arXiv:2211.05100, 2022.
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations.
arXiv preprint arXiv:1803.02155, 2018.
Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. Roformer: Enhanced
transformer with rotary position embedding. arXiv preprint arXiv:2104.09864, 2021.
Laure Thompson and David Mimno. Topic modeling with contextualized word representation clusters.
arXiv preprint arXiv:2010.12626, 2020.
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bash-
lykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned
chat models. arXiv preprint arXiv:2307.09288, 2023.
Asher Trockman and J Zico Kolter. Mimetic initialization of self-attention layers.
arXiv preprint
arXiv:2305.09828, 2023.
Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov.
Transformer dissection: a unified understanding of transformer's attention via the lens of kernel. arXiv
preprint arXiv:1908.11775, 2019.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz
Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing
systems, 30, 2017.
Roman Vershynin. High-dimensional probability: An introduction with applications in data science, vol-
ume 47. Cambridge university press, 2018.
Jesse Vig and Yonatan Belinkov. Analyzing the structure of attention in a transformer language model.
arXiv preprint arXiv:1906.04284, 2019.
Benyou Wang, Lifeng Shang, Christina Lioma, Xin Jiang, Hao Yang, Qun Liu, and Jakob Grue Simonsen.
On position embeddings in bert. In International Conference on Learning Representations, 2020.
Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt. Interpretability
in the wild: a circuit for indirect object identification in gpt-2 small. arXiv preprint arXiv:2211.00593,
2022.
Yu-An Wang and Yun-Nung Chen. What do position embeddings learn? an empirical study of pre-trained
language model positional encoding. arXiv preprint arXiv:2010.04903, 2020.
14
Catherine Yeh, Yida Chen, Aoyu Wu, Cynthia Chen, Fernanda Vi ́egas, and Martin Wattenberg. Attentionviz:
A global view of transformer attention. arXiv preprint arXiv:2305.03210, 2023.
Peng Zhao and Bin Yu. On model selection consistency of lasso. The Journal of Machine Learning Research,
7:2541–2563, 2006.
15
Appendix
Table of Contents
A Models, datasets, and implementations
16
A.1 Pretrained models .
.
.
.
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
A.2 Training small transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
A.3 Removing artifacts
.
.
.
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
A.4 Positional basis calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
B Additional empirical results for Section 2
18
B.1 PCA visualization .
.
.
.
B.2 Low rank measurements
B.3 Fourier analysis .
.
.
.
.
.
.
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
C Additional empirical results for Section 3
D Additional empirical results for Section 4
21
21
D.1 On QK matrix decomposition and induction heads . . . . . . . . . . . . . . . . . . . . . . 21
D.2 On attention weight matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
E Additional empirical results for Section 5
F Proofs for theoretical results
30
30
F.1 Proof of Theorem 1 .
F.2 Proof of Theorem 2 .
.
.
.
.
.
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A Models, datasets, and implementations
We present the details of our experiments and measurements.
A.1 Pretrained models
Except for NanoGPT and models in Section 5, we download and use pretrained models from Huggingface.
• GPT-2 (Radford et al., 2019): 12-layer, 12-head, 768-dim, 124M parameters, autoregressive, absolute
positional encoding at 0th-layer, pretrained on OpenWebText;
• BERT (Devlin et al., 2018): 12-layer, 12-head, 768-dim, 124M parameters, masked prediction, abso-
lute positional encoding at 0th-layer, pretrained on BooksCorpus and English Wikipedia;
• BLOOM (Scao et al., 2022): 24-layer, 16-head, 1024-dim, 560M parameters, ALiBI positional en-
codings (Press et al., 2021) at each layer, pretrained on 45 natural languages and 12 programming
languages;
16
• Llama2-7B (Touvron et al., 2023): 32-layer, 32-head, 4096-dim, 7B parameters, autoregressive, Ro-
tary positional embedding (Su et al., 2021) at every layer, pretrained on a variety of data.
Note that (i) the training objective for pretraining BERT is different from the other models, and (ii)
Llama 2 uses rotary positional encoding for each layer and BLOOM uses ALiBI positional encoding-
which is different from absolute positional encoding that is added at the 0-th layer (Vaswani et al., 2017).
A.2 Training small transformers
We train a few smaller transformers in this paper. Models are based on the GPT-2 architecture with adjusted
parameters, and we adopt the implementation of the GitHub Project by Andrej Karpathy. The hardware we
use is mainly RTX3090ti. The following experiments take 2 hours, 3 hours, and 3 hours to train respectively.
• NanoGPT in Table 1 and 2: The model is a Transformer with 6 layers, 6 heads, 384 dimensional
embeddings, residual/embedding/attention dropout set to 0.1, weight decay set to 0.1, and a context
window of 128. The dataset is Shakespeare with character-level tokenization. We train 100K iterations
using the AdamW optimizer, with a batch size of 64 and a cosine scheduler (1000 step warmup) up to
a learning rate of 5e-5;
• Randomization: Similarly, we use a Transformer with 8 layers, 8 heads, 512 dimensional embed-
dings, residual/embedding/attention dropout set to 0.1, weight decay set to 0.1, and a context window
of 256. We train the model on the first 10K samples of OpenWebText dataset, which is tokenized
using the same tokenizer as in GPT2. We train 100K iterations using the AdamW optimizer, with a
batch size 64 and a cosine scheduler (1000 step warmup) up to a learning rate of 5e-5;
• Addition: Similarly, we use a Transformer with 8 layers, 8 heads, 512 dimensional embeddings,
residual/embedding/attention dropout set to 0.1m and weight decay set to 0.1. The context window
is set as the length of the longest sequence, i.e., 32 for the 10-digit addition task here. We train
100K iterations using the AdamW optimizer, with a batch size 64 and a cosine scheduler (1000 step
warmup) up to a learning rate of 5e-5.
A.3 Removing artifacts
There are two likely artifacts in the measurements and visualization that we removed in the paper.
1. First token in a sequence. We find that a large proportion of attention is focused on the first token,
which usually distorts visualization significantly. It has been known that the first token functions as a
"null token", which is removed in analysis (Vig & Belinkov, 2019). We also adopt removing the first
token in our measurements and visualization.
2. Final-layer embeddings. We find that the embeddings of the final layer typically do not have a sig-
nificant positional basis component. It is likely that positional information is no longer needed since
last-layer embeddings are directly connected to the loss function.
A.4 Positional basis calculation
We calculate positional bases based on sampled sequences of length T from a subset of the corpus, which
includes OpenWebText, WikiText, and GitHub. The implementation and weights of the pretrained models
are obtained from HuggingFace.
For the curated corpus subset, we utilize the streaming version of the HuggingFace datasets and extract
the first 10K samples from the train split. Then we tokenize the dataset using the same tokenizer employed
17
Table 3: ScreeNOT Rank Estimate for models, datasets and at each layer.
Layer 0 Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Layer 7 Layer 8 Layer 9 Layer 10 Layer 11 Layer 12
BERT
BLOOM
GPT2
Llama2
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
15
15
15
8
6
6
15
15
15
6
7
8
16
16
16
9
10
8
14
13
14
10
10
10
16
18
18
9
10
9
13
14
14
9
10
10
16
16
16
8
11
10
12
12
12
8
11
10
14
11
12
9
11
10
12
13
11
10
11
9
11
11
11
10
10
11
11
11
11
8
10
8
11
9
9
10
11
11
11
10
11
8
9
8
9
9
9
11
11
11
10
10
11
9
10
8
10
11
11
10
11
11
10
10
11
9
9
8
10
11
11
10
11
11
10
10
11
9
8
8
11
11
11
10
10
11
11
9
9
9
9
8
11
11
12
10
10
10
11
9
10
8
8
8
12
13
12
10
11
11
10
12
12
10
10
10
Table 4: Stable rank for models, datasets and at each layer.
Layer 0 Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Layer 7 Layer 8 Layer 9 Layer 10 Layer 11 Layer 12
BERT
BLOOM
GPT2
Llama2
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
9.19
9.19
9.19
8.39
8.33
8.42
2.05
2.05
2.05
24.87
52.23
24.70
7.79
7.63
7.78
1.25
1.27
1.27
1.92
1.92
1.92
1.00
1.00
1.00
5.26
5.25
5.03
1.20
1.30
1.28
1.91
1.91
1.91
1.00
1.00
1.00
4.73
4.73
4.58
1.21
1.24
1.30
1.89
1.89
1.89
1.00
1.00
1.01
4.34
4.10
3.99
1.21
1.24
1.31
1.90
1.88
1.88
1.00
1.00
1.01
3.84
3.53
3.48
1.23
1.27
1.34
1.90
1.88
1.88
1.00
1.00
1.02
3.48
3.16
3.14
1.29
1.32
1.41
1.92
1.88
1.88
1.00
1.01
1.03
3.20
2.84
2.82
1.29
1.34
1.43
1.94
1.90
1.90
1.01
1.01
1.05
2.70
2.46
2.42
1.28
1.33
1.41
1.98
1.91
1.91
1.01
1.02
1.09
2.45
2.30
2.27
1.25
1.26
1.32
2.03
1.96
1.97
1.01
1.02
1.16
2.04
2.18
2.13
1.21
1.16
1.22
2.05
2.02
2.03
1.02
1.03
1.20
1.84
2.22
2.16
1.02
1.01
1.01
1.70
2.24
2.19
1.03
1.05
1.26
1.91
2.15
2.12
1.00
1.00
1.00
1.11
1.49
1.56
1.17
1.44
1.30
by the pretrained model. The size of the final datasets vary across tasks and datasets, and we ensure that
there are at least 1M tokens in each case to prevent the occurrence of overlapping sequences.
We set the context window T = 512 for BERT, BLOOM, and GPT-2, as this maintains the maximum
context window utilized during pretraining. For Llama2, we set T = 512 instead of the maximum context
sequence due to computational resource limitations.
B Additional empirical results for Section 2
B.1 PCA visualization
See Figure 7-Figure 11. Note: BERT displays a more complex circular shape, likely because its training
objective is different from the others.
B.2 Low rank measurements
Rank estimate. We report the rank estimate for all pretrained models and datasets in Table 3. Additionally,
we include the Stable rank estimate in Table 4.
Relative norm. We report the relative norm for all pretrained models and datasets in Table 5.
Spectral analysis. Recall that in Figure 3 (left), we showed the singular values plot for P = [pos1, . . . , posT ],
Cvec = [cvec1,1, . . . , cvecc,T ], R = [resid1,1, . . . , residc,T ]. Note that P has T columns while Cvec
and R has CT columns. In Figure 3 (left), we downsampled Cvec and R to match the number of columns
of P . Alternatively, we also tried multiplied P by
C and got similar results.
√
18
Figure 7: Top-2 principal components of positional basis; GitHub, GPT2
Figure 8: Top-2 principal components of positional basis; WikiText, GPT2
Figure 9: Top-2 principal components of positional basis; OpenWebText, BLOOM
19
Layer: 0Layer: 1Layer: 2Layer: 3Layer: 4Layer: 5Layer: 6Layer: 7Layer: 8Layer: 9Layer: 10Layer: 11Layer: 0Layer: 1Layer: 2Layer: 3Layer: 4Layer: 5Layer: 6Layer: 7Layer: 8Layer: 9Layer: 10Layer: 11Layer: 0Layer: 2Layer: 4Layer: 6Layer: 8Layer: 10Layer: 12Layer: 14Layer: 16Layer: 18Layer: 20Layer: 23Figure 10: Top-2 principal components of positional basis; OpenWebText, BERT
Figure 11: Top-2 principal components of positional basis; OpenWebText, Llama2
Figure 12: Top-2 principal components of positional basis; GitHub, Llama2
20
Layer: 0Layer: 1Layer: 2Layer: 3Layer: 4Layer: 5Layer: 6Layer: 7Layer: 8Layer: 9Layer: 10Layer: 11Layer: 0Layer: 2Layer: 5Layer: 8Layer: 11Layer: 14Layer: 16Layer: 19Layer: 22Layer: 25Layer: 28Layer: 31Layer: 0Layer: 2Layer: 5Layer: 8Layer: 11Layer: 14Layer: 16Layer: 19Layer: 22Layer: 25Layer: 28Layer: 31Table 5: Relative norm for models, datasets and at each layer.
Layer 0 Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Layer 7 Layer 8 Layer 9 Layer 10 Layer 11 Layer 12
BERT
BLOOM
GPT2
Llama2
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
GitHub
OpenWebText
WikiText
0.325
0.361
0.356
0.009
0.008
0.009
0.758
0.807
0.815
0.025
0.031
0.035
0.267
0.302
0.293
0.079
0.092
0.098
0.447
0.463
0.470
0.221
0.146
0.067
0.246
0.265
0.267
0.123
0.108
0.123
0.396
0.411
0.416
0.221
0.146
0.067
0.242
0.265
0.265
0.147
0.143
0.152
0.359
0.371
0.375
0.221
0.146
0.067
0.234
0.263
0.263
0.170
0.164
0.166
0.338
0.344
0.345
0.222
0.146
0.067
0.229
0.249
0.250
0.181
0.173
0.174
0.316
0.324
0.325
0.222
0.147
0.068
0.232
0.245
0.246
0.173
0.158
0.159
0.287
0.301
0.299
0.222
0.147
0.068
0.248
0.266
0.269
0.158
0.143
0.143
0.266
0.271
0.270
0.223
0.148
0.069
0.248
0.273
0.278
0.145
0.131
0.133
0.237
0.232
0.229
0.224
0.150
0.071
0.215
0.215
0.217
0.138
0.135
0.134
0.207
0.196
0.197
0.225
0.152
0.073
0.211
0.170
0.172
0.137
0.153
0.147
0.172
0.150
0.152
0.226
0.153
0.077
0.173
0.117
0.118
0.182
0.278
0.250
0.140
0.095
0.098
0.226
0.154
0.080
0.162
0.122
0.122
0.140
0.385
0.358
0.100
0.030
0.030
0.158
0.118
0.146
B.3 Fourier analysis
See Figure 13-Figure 18. Compared with Figure 3 (right), for completeness we also include in the plots
0-th coefficients (often not informative).
We find that BERT contains considerable higher-frequency components, likely due to its non-autoregressive
training; see also Wang & Chen (2020).
C Additional empirical results for Section 3
See Figure 19-Figure 23. Note that there are progressive cluster compactness changes across layers in
It is likely that pretraining on heterogeneous datasets creates multiscale cluster
BLOOM and Llama 2.
structure. An investigation of this phenomenon is left as future work.
Measuring cluster compactness. We define ΣW and ΣB as the within-cluster and between-cluster co-
variance matrix respectively, and we use Tr(ΣBΣ−1
W ) to measure how well the samples are separated into
clusters (bigger value is better). To compare the performance of cvec and raw embeddings in the down-
stream clustering tasks, we calculate them based on four documents of OpenWebText. In Figure 24, Figure
25, and Figure 26, we show the first two principal components for the cvec (left) and raw embeddings
(right), with samples from documents shown in different colors. Based on the metric of Tr(ΣBΣ−1
W ) in the
title and the PCA plot, we can see that cvec-s are better separated than the raw embeddings, indicating that
the removal of positional basis is good for clustering tasks.
D Additional empirical results for Section 4
D.1 On QK matrix decomposition and induction heads
On global mean vector. We show the QK matrix decomposition with global mean (Figure 28), and with-
out global mean (Figure 27). Note that adding a constant to all entries of the QK matrix will not change the
attention matrix, because softmax computes the ratio. We conclude that the global mean vector μ has little
effects on interpretations.
See Figure 29-Figure 35 for more QK plots at various layers and heads on GPT-2 and BLOOM model.
D.2 On attention weight matrix
See Figure 36-Figure 41 for more plots on rotated W = W q(W k)⊤/
for BERT and GPT-2 model.
√
dhead at various layers and heads
21
Figure 13: Fourier transformed positional basis; Openwebtext, GPT2
Figure 14: Fourier transformed positional basis; Openwebtext, BERT
Figure 15: Fourier transformed positional basis; Openwebtext, BLOOM
22
123456789123456789Layer: 0123456789123456789Layer: 1123456789123456789Layer: 2123456789123456789Layer: 3123456789123456789Layer: 4123456789123456789Layer: 5123456789123456789Layer: 6123456789123456789Layer: 7123456789123456789Layer: 8123456789123456789Layer: 9123456789123456789Layer: 10123456789123456789Layer: 11150100500501001502001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200123456789123456789Layer: 0123456789123456789Layer: 1123456789123456789Layer: 2123456789123456789Layer: 3123456789123456789Layer: 4123456789123456789Layer: 5123456789123456789Layer: 6123456789123456789Layer: 7123456789123456789Layer: 8123456789123456789Layer: 9123456789123456789Layer: 10123456789123456789Layer: 1115105051015302010010203060402002040607550250255075100755025025507510010050050100100500501001005005010010050050100150100500501001501501005005010015015010050050100150123456789123456789Layer: 0123456789123456789Layer: 2123456789123456789Layer: 4123456789123456789Layer: 6123456789123456789Layer: 8123456789123456789Layer: 10123456789123456789Layer: 12123456789123456789Layer: 14123456789123456789Layer: 16123456789123456789Layer: 18123456789123456789Layer: 20123456789123456789Layer: 231.00.50.00.51.01501005005010015030020010001002003003002001000100200300300200100010020030030020010001002003003002001000100200300300200100010020030020010001002002001000100200300200100010020030015010050050100150Figure 16: Fourier transformed positional basis; Openwebtext, Llama2
Figure 17: Fourier transformed positional basis; GitHub, GPT2
Figure 18: Fourier transformed positional basis; WikiText, GPT2
23
123456789123456789Layer: 0123456789123456789Layer: 2123456789123456789Layer: 5123456789123456789Layer: 8123456789123456789Layer: 11123456789123456789Layer: 14123456789123456789Layer: 16123456789123456789Layer: 19123456789123456789Layer: 22123456789123456789Layer: 25123456789123456789Layer: 28123456789123456789Layer: 311.51.00.50.00.51.01.520010001002002001000100200200100010020020010001002002001000100200200100010020020010001002002001000100200200150100500501001502001501005005010015010050050100123456789123456789Layer: 0123456789123456789Layer: 1123456789123456789Layer: 2123456789123456789Layer: 3123456789123456789Layer: 4123456789123456789Layer: 5123456789123456789Layer: 6123456789123456789Layer: 7123456789123456789Layer: 8123456789123456789Layer: 9123456789123456789Layer: 10123456789123456789Layer: 111501005005010015020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020010001002002001000100200123456789123456789Layer: 0123456789123456789Layer: 1123456789123456789Layer: 2123456789123456789Layer: 3123456789123456789Layer: 4123456789123456789Layer: 5123456789123456789Layer: 6123456789123456789Layer: 7123456789123456789Layer: 8123456789123456789Layer: 9123456789123456789Layer: 10123456789123456789Layer: 11150100500501001502001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200200150100500501001502002001501005005010015020020015010050050100150200Figure 19: Gram matrix of positional basis and context basis; Openwebtext, GPT2
Figure 20: Gram matrix of positional basis and context basis; Openwebtext, BLOOM
Figure 21: Gram matrix of positional basis and context basis; Openwebtext, Llama2
24
Figure 22: Gram matrix of positional basis and context basis; GitHub, Llama
Figure 23: Gram matrix of positional basis and context basis; Wikitext, GPT2
Figure 24: Top-2 principal components; GPT2, OpenWebText, L7. Left shows cvecs and right shows raw
embeddings.
25
20020406080100604020020406080Layer 7; Tr(Sb/Sw):5.492202102001901801708060402002040Layer 7; Tr(Sb/Sw):3.30Figure 25: Top-2 principal components; GPT2, OpenWebText, L9. Left shows cvecs and right shows raw
embeddings.
Figure 26: Top-2 principal components; GPT2, OpenWebText, L11. Left shows cvecs and right shows raw
embeddings.
Figure 27: GPT2 L10H7 QK Decomposition; Global mean removed
26
12510075502502550050100150Layer 9; Tr(Sb/Sw):5.5932030028026024022050250255075100Layer 9; Tr(Sb/Sw):3.80100010020015010050050100150200250Layer 11; Tr(Sb/Sw):8.1165060055050020015010050050100150Layer 11; Tr(Sb/Sw):3.39Figure 28: GPT2 L10H7 QK Decomposition; Global mean not removed
Figure 29: QK Decomposition; BLOOM L10H1
Figure 30: QK Decomposition; BLOOM L6H12
Figure 31: QK Decomposition; BLOOM L7H10
Figure 32: QK Decomposition; BLOOM L0H5
Figure 33: QK Decomposition; GPT2 L0H1
Figure 34: QK Decomposition; GPT2 L10H1
27
Figure 35: QK Decomposition; GPT2 L4H11
Figure 36: Dissecting attention weights, GPT2 L0
Figure 37: Dissecting attention weights, GPT2 L6
Figure 38: Dissecting attention weights, GPT2 L10
28
Figure 39: Dissecting attention weights, BERT L0
Figure 40: Dissecting attention weights, BERT L6
Figure 41: Dissecting attention weights, BERT L10
29
E Additional empirical results for Section 5
Full results on the Randomization experiment. We apply three noise levels (regular, partially random,
fully random) in both of the training and inference process. We give the 3 × 3 = 9 results in Figure
42-Figure 50.
Addition experiment. We have manually generated the addition dataset for the carry and no-carry tasks,
with training set and validation set containing 100K and 10K additions of length ranging from 5 to 10
respectively. The models achieve 100% and 72% accuracy on the validation set in the no-carry and carry
experiments, respectively. However, the model does not generalize: they get 5.02% and 0.00% accuracy
on 1K samples of additions with length from 1 to 4. See Figure 51-Figure 56 for the QK plots at various
layers and heads under carry and no-carry addition tasks. Notice the unsmoothness in the positional basis
gram matrix that is pervasive across different layers, heads, and tasks.
F Proofs for theoretical results
We introduce some additional notations. Denote the indicator function by 1. We denote by 1N the vector
(1, 1, . . . , 1)⊤ ∈ RN . For a complex matrix A, we denote the conjugate transpose by A∗. For convenience,
for a matrix A, we will write ∆A instead of ∆(1,1)A. For a vector x ∈ CN , we also write ∆x to denote
the finite difference vector N * (x1 − x0, x2 − x1, . . . , xN − xN −1)⊤ (where xN = x0). We will say that a
Hermitian matrix A ∈ CN ×N is positive semidefinite (PSD) if and only if x∗Ax ≥ 0 for every x ∈ CN .
Denote by R(x) the real part of a complex number x ∈ C.
F.1 Proof of Theorem 1
In this subsection, we denote a generic dimension by N and ω = exp(−2πi/N ). We need some standard
definitions and properties; see Broughton & Bryan (2018) for example.
The discrete Fourier transform (DFT) matrix F ∈ CN ×N is given by Ftt′ = ω(t−1)(t′−1) for 1 ≤ t, t′ ≤
N . The inverse discrete Fourier transform (IDFT) matrix is N −1F ∗. Both the DFT matrix and the IDFT
matrix are symmetric (not Hermitian). Sometimes we prefer to write F ⊤ instead of F simply for formality.
For a generic matrix A ∈ RN ×N , we denote by ˆA ∈ CN ×N the matrix after its 2-d DFT. It satisfies
ˆA = F AF ⊤,
A = N −2F ∗ ˆA(F ∗)⊤.
(13)
The following simple lemma is a consequence of integration-by-parts for the discrete version. For
completeness we include a proof.
Lemma 1. Let x ∈ RN be a vector, and ˆx = F x be its DFT. Then for t = 1, . . . , N ,
ˆxt = γt(F ∆x)t + 1{t = 1} *
N
(cid:88)
t′=1
xt′,
where
γt := N −1
(cid:18)
1 − exp
(cid:16) −2πi(t − 1)
N
(cid:17)(cid:19)−1
for t > 1 and γ1 := 1.
(14)
(15)
30
Figure 42: Training: regular; Inference: regular
Figure 43: Training: regular; Inference: partially random
31
Figure 44: Training: regular; Inference: fully random
Figure 45: Training: partially random; Inference: regular
32
Figure 46: Training: partially random; Inference: partially random
Figure 47: Training: partially random; Inference: fully random
33
Figure 48: Training: fully random; Inference: regular
Figure 49: Training: fully random; Inference: partially random
34
Figure 50: Training: fully random; Inference: fully random
Figure 51: Addition without carry, L2H3
Figure 52: Addition without carry, L3H0
Figure 53: Addition without carry, L3H1
Figure 54: Addition with carry, L1H0
35
Proof. If t = 1, then (F x)t = (cid:80)N
t′=1 xt′, and (F ∆x)t = N (cid:80)N
t′=1(xt′ − xt′−1) = 0. For t ̸= 1,
(F ∆x)t = N
N
(cid:88)
t′=1
ω(t−1)(t′−1)(xt′ − xt′−1) = N
N
(cid:88)
t′=1
(cid:0)ω(t−1)(t′−1) − ω(t−1)t′(cid:1)xt′
= N (cid:0)1 − ω(t−1)(cid:1)
N
(cid:88)
t′=1
ω(t−1)(t′−1)xt′ = γ−1
t
(F x)t.
This shows ˆxt = γt(F ∆x)t for t ̸= 1 and completes the proof.
A simple bound on the modulus |γt| is given by the following lemma.
Lemma 2. Let γt be defined by Equation 15. For positive integer 1 < t ≤ N/2, we have
|γN −t+2| = |γt| ≤
1
8(t − 1)
.
Proof. The equality part is obvious. For any θ ∈ (−π, π), we have
|1 − exp(iθ)|2 = (1 − cos θ)2 + sin2 θ = 4 sin2(θ/2) = 4 sin2(|θ|/2)
Since sin θ/θ is monotone decreasing in (0, π/2), we have sin(|θ|/2) ≥ sin(π/2)|θ|/(π/2), Thus,
|1 − exp(iθ)| ≥ 4|θ|/π .
Setting θ = −2π(t − 1)/N , we obtain the desired upper bound on |γt|.
Denote Γ = diag{γ1, . . . , γN }. By Lemma 1, for any vector x ∈ RN ,
F x = ΓF ∆x +
x⊤1N
0
...
0
.
Below we will assume that the generic matrix A ∈ RN ×N is symmetric and satisfies A1N = 0. Observe
that
F A = [F A:,1, . . . , F A:,N ] = ΓF [∆A:,1, . . . , ∆A:,N ],
F AF ⊤ = ΓF (∆A)F ⊤Γ
where we used A1N = 0 and (∆A)1N = 0. Repeating the second equality m times, we obtain
ˆA = F AF ⊤ = ΓmF (∆(m,m)A)F ⊤Γm.
Now fix a generic nonempty index sets I ⊂ {1, 2, . . . , N } and denote J = {1, . . . , N } \ I. Consider the
block matrix form of ˆA:
Using the block matrix notation, we derive
ˆA =
(cid:18) ˆAI,I
ˆAJ ,I
ˆAI,J
ˆAJ ,J
(cid:19)
.
∥ ˆAI,J ∥op = ∥Γm
I,I
(cid:0)F (∆(m,m)A)F ⊤(cid:1)
I,J Γm
J ,J ∥op ≤ max
t∈I,t′∈J
|γtγt′|m∥F (∆(m,m)A)F ⊤∥op .
36
Similar inequalities hold for other three blocks. By Lemma 2 we have |γt| ≤ 1 for all t. Adding the three
inequalities that involve at least one index set J , we get
(cid:13)
(cid:13)
ˆA −
(cid:13)
(cid:13)
(cid:18) ˆAI,I 0
0
0
(cid:19)(cid:13)
(cid:13)
(cid:13)
(cid:13)op
≤ 3 max
t∈J
|γt|m∥F (∆(m,m)A)F ⊤∥op .
Since F F ∗ = N , we have ∥F ∥op = ∥F F ∗∥1/2
op = N 1/2. Denoting
A(res) := N −2F ∗(cid:104) ˆA −
(cid:18) ˆAI,I 0
0
0
(cid:19) (cid:105)
(F ∗)⊤ ,
we find
∥A(res)∥op ≤ 3 max
t∈J
|γt|mN −2∥F ∥4
op∥∆(m,m)A∥op ≤ 3 max
t∈J
|γt|mN ∥∆(m,m)A∥max
(16)
where the first inequality is due to Lemma 2 and the second inequality is due to the inequality between
matrix operator norm and max norm.
To finish the proof, let us make some specification: we identify N with ̃T (namely 2T ), identify A with
̃G, and identify I = {1, . . . , k} ∪ { ̃T − k + 1, . . . , ̃T }. These choices satisfy the requirement for A because
̃G is symmetric and it satisfies ̃G1 ̃T = 2G1T = 0 due to the assumption pos1 + . . . + posT = 0.
By Lemma 2, maxt∈J |γt| ≤ 1/(8k), so Equation 16 gives
∥A(res)∥op ≤ 6(8k)−mT ∥∆(m,m) ̃G∥max
By the definition of A(res) and the identities in 13,
̃G = A(res) + N −2F ∗
(cid:18) ˆAI,I 0
0
0
(cid:19)
(F ∗)⊤ .
We make the following claim.
Lemma 3. There exists B ∈ Rk×k such that
(cid:18) ˆAI,I 0
0
0
(cid:20)
F ∗
N −2
(cid:19)
(cid:21)
(F ∗)⊤
1:T,1:T
= F≤kB(F≤kB)⊤
(17)
While the DFT matrix is complex, the above lemma claims that the left-hand side is a Gram matrix of
real low-frequency vectors. Once this lemma is proved, we can combine this lemma with Equation 16 and
G = ̃G1:T,1:T to obtain the desired inequality 6 in Theorem 1.
Proof of Lemma 3. Recall ω = exp(−2πi/2T ). We further introduce some notations. Denote I1 =
{1, . . . , k} and I2 = {T − k + 1, . . . , T } so that I = I1 ∪ I2. Let qt = ωt−1 for positive integer t,
matrix Q ∈ RT ×k and matrix D ∈ Rk×k be given by
Qt,s = R(qs−0.5
t
),
where t ≤ T, s ≤ k,
D = diag(q1/2
1
, . . . , q1/2
k
)
37
For t, t′ ∈ I,
ˆAt,t′ = (F AF T )t,t′
T
(cid:88)
=
Ft,sGs,s′Ft′,s′ +
T
(cid:88)
s,s′=1
Ft,2T +1−sGs,s′Ft′,s′
s,s′=1
T
(cid:88)
s,s′=1
+
Ft,sGs,s′Ft′,2T +1−s′ +
T
(cid:88)
s,s′=1
Ft,2T +1−sGs,s′Ft′,2T +1−s′
= q1/2
t
q1/2
t′
T
(cid:88)
(cid:16)
Gs,s′
s,s′=1
qs−0.5
t
qs′−0.5
t′
+ q−s+0.5
t
qs′−0.5
t′
+ qs−0.5
t
q−s′+0.5
t′
+ q−s+0.5
t
q−s′+0.5
t′
(cid:17)
= 4q1/2
t
q1/2
t′
T
(cid:88)
s,s′=1
Gs,s′R(qs−1/2
t
)R(qs′−1/2
t′
) .
If t, t′ ∈ I1, the above equality leads to
ˆAI1,I1 = 4DQ⊤GQD;
and more generally ˆAI,I is given by symmetrically extending ˆAI1,I1 as in the definition of ̃G. Since
4Q⊤GQ is a PSD, we can find B0 ∈ Rk×k such that
We want to simplify F ∗
:,I
ˆAI,IF ∗
I,:, namely
4Q⊤GQ = B0B⊤
0 .
F ∗
:,I1
ˆAI1,I1F ∗
I1,: + F ∗
:,I1
ˆAI1,I2F ∗
I2,: + F ∗
:,I2
ˆAI2,I1F ∗
I1,: + F ∗
:,I2
ˆAI2,I2F ∗
I2,:
(18)
For any t, t′ ∈ I1,
(F ∗)t,I1
ˆAI1,I1(F ∗)I1,t′ = (F ∗)t,I1DB0B⊤
0 D(F ∗)I1,t′
and similar equations hold for other three cases. Observe that
(F ∗)t,I1D = ( ̄q1−0.5
t
, . . . , ̄qk−0.5
t
),
(F ∗)t,I2D = ( ̄q2T −0.5
t
, . . . , ̄q2T −k+0.5
t
) .
When we add the four terms in 18, the imaginary part cancels out. Thus,
F ∗
t,I
ˆAI,IF ∗
I,t′ = 4
(cid:16)
R( ̄q1−0.5
t
), . . . , R( ̄qk−0.5
t
(cid:17)
)
B0B⊤
0
(cid:16)
R( ̄q1−0.5
t
), . . . , R( ̄qk−0.5
t
(cid:17)⊤
)
.
Note that R( ̄qs−0.5
and denote B = B0/N , we find that Equation 17 holds.
) = cos(π(t − 1)(s − 0.5)/T ) = (F≤k)t,s. Expressing F ∗
:,I
t
ˆAI,IF ∗
I,: in the matrix form
F.2 Proof of Theorem 2
First we note that
KW (xq, xk) = KW11(xq, xk)KW12(xq, xk)KW21(xq, xk)KW22(xq, xk) .
We will prove that
KW11(xq, xk) = (cid:0)1 + O(incoh)(cid:1) * KW11(cq, ck) .
(19)
(20)
38
To prove this, it suffices to show that
max (cid:8)KW11(cq, tk), KW11(tq, ck), KW11(tq, tk)(cid:9) = 1 + O(incoh) .
(21)
We decompose W11 as in Equation 11 and find
(cid:16)
(cid:17)
KW11(cq, tk)
log
= (cq)⊤W11tk =
s
(cid:88)
k=1
ak(u⊤
k cq)(v⊤
k tk) .
By mutual incoherence, |v⊤
k tk| ≤ incoh since vk ∈ B1 and tk ∈ B2; and trivially |u⊤
k ck| ≤ 1, so
(cid:16)
(cid:12)
(cid:12)
(cid:12)log
KW11(cq, tk)
(cid:17)(cid:12)
(cid:12)
(cid:12) ≤
s
(cid:88)
k=1
|u⊤
k ck| * |v⊤
k tq| ≤ s * incoh .
Since by assumption s = O(1) and exp(incoh) = 1 + O(incoh), we derive
KW11(cq, tk) = 1 + O(incoh) .
The other two terms in Equation 21 follow a similar argument and thus are all bounded by 1 + O(incoh).
We can prove similarly that
KW12(xq, xk) = (cid:0)1 + O(incoh)(cid:1) * KW12(cq, tk) ,
KW21(xq, xk) = (cid:0)1 + O(incoh)(cid:1) * KW21(tq, ck) ,
KW21(xq, xk) = (cid:0)1 + O(incoh)(cid:1) * KW22(tq, tk) .
and together with Equation 20 and Equation 19, this leads to the desired Equation 12.
Below we prove the "moreover" part. By standard properties of independent subgaussian random vari-
ables (Vershynin, 2018, Sect. 2), (cq)⊤Z11tk is still a subgaussian random variable, and with probability at
least 1 − O(exp(−incoh2 * d)), for certain constant C > 0,
(cid:16)
(cid:12)
(cid:12)
(cid:12)log
√
KW11+Z/
d(cq, tk)
(cid:17)(cid:12)
(cid:12)
(cid:12) ≤ s * incoh + Cincoh = O(incoh).
Similar high-probability bounds hold for other terms. By the union bound over all possible choice of vectors
in B0
2, we arrive at our claim.
1 and B0
39
Figure 55: Addition with carry, L1H4
Figure 56: Addition with carry, L1H7
40
|
|
http://arxiv.org/abs/2310.04859v2 | "2023-10-10T08:03:47" | "2023-10-07T15:47:31" | Universal Graph Random Features | We propose a novel random walk-based algorithm for unbiased estimation of
arbitrary functions of a weighted adjacency matrix, coined universal graph
random features (u-GRFs). This includes many of the most popular examples of
kernels defined on the nodes of a graph. Our algorithm enjoys subquadratic time
complexity with respect to the number of nodes, overcoming the notoriously
prohibitive cubic scaling of exact graph kernel evaluation. It can also be
trivially distributed across machines, permitting learning on much larger
networks. At the heart of the algorithm is a modulation function which
upweights or downweights the contribution from different random walks depending
on their lengths. We show that by parameterising it with a neural network we
can obtain u-GRFs that give higher-quality kernel estimates or perform
efficient, scalable kernel learning. We provide robust theoretical analysis and
support our findings with experiments including pointwise estimation of fixed
graph kernels, solving non-homogeneous graph ordinary differential equations,
node clustering and kernel regression on triangular meshes. | [
"Isaac Reid",
"Krzysztof Choromanski",
"Eli Berger",
"Adrian Weller"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04859v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04859v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "stat.ML",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"stat.ML",
"cs.LG"
] | 3
2
0
2
t
c
O
0
1
]
L
M
.
t
a
t
s
[
2
v
9
5
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Preprint. Under review.
Universal Graph Random Features
Isaac Reid1∗, Krzysztof Choromanski2,3∗, Eli Berger4∗, Adrian Weller1,5
1University of Cambridge, 2Google DeepMind, 3Columbia University,
4University of Haifa, 5Alan Turing Institute
ir337@cam.ac.uk, kchoro@google.com
Abstract
We propose a novel random walk-based algorithm for unbiased estimation
of arbitrary functions of a weighted adjacency matrix, coined universal
graph random features (u-GRFs). This includes many of the most popu-
lar examples of kernels defined on the nodes of a graph. Our algorithm
enjoys subquadratic time complexity with respect to the number of nodes,
overcoming the notoriously prohibitive cubic scaling of exact graph kernel
It can also be trivially distributed across machines, permit-
evaluation.
ting learning on much larger networks. At the heart of the algorithm is
a modulation function which upweights or downweights the contribution
from different random walks depending on their lengths. We show that by
parameterising it with a neural network we can obtain u-GRFs that give
higher-quality kernel estimates or perform efficient, scalable kernel learn-
ing. We provide robust theoretical analysis and support our findings with
experiments including pointwise estimation of fixed graph kernels, solving
non-homogeneous graph ordinary differential equations, node clustering and
kernel regression on triangular meshes.1
1
Introduction and related work
The kernel trick is a powerful technique to perform nonlinear inference using linear learn-
ing algorithms (Campbell, 2002; Kontorovich et al., 2008; Canu and Smola, 2006; Smola
and Schölkopf, 2002). Supposing we have a set of N datapoints X = {xi}N
i=1, it replaces
i xj with evaluations of a kernel function K : X × X → R, cap-
Euclidean dot products x⊤
turing the 'similarity' of the datapoints by instead taking an inner product between implicit
(possibly infinite-dimensional) feature vectors in some Hilbert space HK.
An object of key importance here is the Gram matrix K ∈ RN ×N whose entries enumerate
the pairwise kernel evaluations, K := [K(xi, xj)]N
i,j=1. Despite the theoretical rigour and
empirical success enjoyed by kernel-based learning algorithms, the requirement to manifest
and invert this matrix leads to notoriously poor O(N 3) time-complexity scaling. This has
spurred research dedicated to efficiently approximating K, the chief example of which is
random features (Rahimi and Recht, 2007): a Monte-Carlo approach which gives explicitly
manifested, finite dimensional vectors φ(xi) ∈ Rm whose Euclidean dot product is equal to
the kernel evaluation in expectation,
Kij = E (cid:2)φ(xi)⊤φ(xj)(cid:3) .
This allows one to construct a low-rank decomposition of K which provides much better scal-
ability. Testament to its utility, a rich taxonomy of random features exists to approximate
many different Euclidean kernels including the Gaussian, softmax, and angular and linear
kernels (Johnson, 1984; Dasgupta et al., 2010; Goemans and Williamson, 2004; Choromanski
et al., 2020).
Kernels defined on discrete input spaces, e.g. K : N × N → R with N the set of nodes of
a graph G (Smola and Kondor, 2003; Kondor and Lafferty, 2002; Chung and Yau, 1999),
(1)
∗Equal contribution
1We will make all code publicly available.
1
Preprint. Under review.
enjoy widespread applications including in bioinformatics (Borgwardt et al., 2005), commu-
nity detection (Kloster and Gleich, 2014) and recommender systems (Yajima, 2006). More
recently, they have been used in applications as diverse as manifold learning for deep gener-
ative modelling (Zhou et al., 2020) and for solving single- and multiple-source shortest path
problems (Crane et al., 2017). However, for these graph-based kernel methods the problem
of poor scalability is particularly acute. This is because even computing the corresponding
Gram matrix K is typically of at least cubic time complexity in the number of nodes N ,
requiring e.g. the inversion of an N × N matrix or computation of multiple matrix-matrix
products. Despite the presence of this computational bottleneck, random feature methods
for graph kernels have proved elusive. Indeed, only recently was a viable graph random fea-
ture (GRF) mechanism proposed by Choromanski (2023). Their algorithm uses an ensemble
of random walkers which deposit a 'load' at every vertex they pass through that depends on
i) the product of weights of edges traversed by the walker and ii) the marginal probability of
i=1 ⊂ RN
the subwalk. Using this scheme, it is possible to construct random features {φ(i)}N
such that φ(i)⊤φ(j) gives an unbiased approximation to the ij-th matrix element of the
2-regularised Laplacian kernel. Multiple independent approximations can be combined to
estimate the d-regularised Laplacian kernel with d ̸= 2 or the diffusion kernel (although the
latter is only asymptotically unbiased). The GRFs algorithm enjoys both subquadratic time
complexity and strong empirical performance on tasks like k-means node clustering, and it
is trivial to distribute across machines when working with massive graphs.
However, a key limitation of GRFs is that they only address a limited family of graph
kernels which may not be suitable for the task at hand. Our central contribution is a simple
modification which generalises the algorithm to arbitrary functions of a weighted adjacency
matrix, allowing efficient and unbiased approximation a much broader class of graph node
kernels. We achieve this by introducing an extra modulation function f that controls each
walker's load as it traverses the graph. As well as empowering practitioners to approximate
many more fixed kernels, we demonstrate that f can also be parameterised by a neural
network and learned. We use this powerful approach to optimise u-GRFs for higher-quality
approximation of fixed kernels and for scalable implicit kernel learning.
The remainder of the manuscript is organised as follows. In Sec. 2 we introduce univer-
sal graph random features (u-GRFs) and prove that they enable scalable approximation of
arbitrary functions of a weighted adjacency matrix, including many of the most popular
examples of kernels defined on the nodes of a graph. We also extend the core algorithm
with neural modulation functions, replacing one component of the u-GRF mechanism with
a neural network, and derive generalisation bounds for the corresponding class of learnable
graph kernels (Sec. 2.1). In Sec. 3 we run extensive experiments, including: pointwise
estimation of a variety of popular graph kernels (Sec. 3.1); simulation of time evolution un-
der non-homogeneous graph ordinary differential equations (Sec. 3.2); kernelised k-means
node clustering including on large graphs (Sec. 3.3); training a neural modulation function
to suppress the mean square error of fixed kernel estimates (Sec 3.4); and training a neu-
ral modulation function to learn a kernel for node attribute prediction on triangular mesh
graphs (Sec. 3.5).
2 Universal graph random features
Consider a directed weighted graph G(N , E, W := [wij]i,j∈N ) where: i) N := {1, ..., N } is
the set of nodes; ii) E is the set of edges, with (i, j) ∈ E if there is a directed edge from i
to j in G; and iii) W is the weight matrix, with wij the weight of the directed edge from i
to j (equal to 0 if no such edge exists). Note that an undirected graph can be described as
directed with the symmetric weight matrix W. Now consider the matrices Kα(W) : RN ×N ,
where α = (αk)∞
k=0 and αk ∈ R:
Kα(W) =
∞
X
k=0
αkWk.
(2)
We assume that the sum above converges for all W under consideration. Without loss of
generality, we also assume that α is normalised such that α0 = 1. The matrix Kα(W) can
2
Preprint. Under review.
be associated with a graph function K G
to a real number.
α : N × N → R mapping from a pair of graph nodes
Note that if G is an undirected graph then Kα(W) automatically inherits the symmetry
of W. In this case, it follows from Weyl's perturbation inequality (Bai et al., 2000) that
Kα(W) is positive semidefinite for any given α provided the spectral radius ρ(W) :=
maxλ∈Λ(W) (|λ|) is sufficiently small (with Λ(W) the set of eigenvalues of W). This can
always be ensured by multiplying the weight matrix W by a regulariser σ2 ∈ R+. It then
follows that Kα(W) can be considered the Gram matrix of a graph kernel function K G
α.
With suitably chosen α = (αk)∞
k=0, the class described by Eq. 2 includes many popular
examples of graph node kernels in the literature (Smola and Kondor, 2003; Chapelle et al.,
2002). They measure connectivity between nodes and are typically functions of the graph
Laplacian matrix, defined by L := I − fW with fW := [wij/pdidj]N
j wij is
the weighted degree of node i such that fW is the normalised weighted adjacency matrix. For
reference, Table 1 gives the kernel definitions and normalised coefficients αk (corresponding
to powers of fW) to be considered later in the manuscript. In practice, factors in αk equal
to a quantity raised to the power of k are absorbed into the normalisation of fW.
i,j=1. Here, di := P
Name
Form
αk
d-regularised Laplacian
p-step random walk
Diffusion
Inverse Cosine
(IN + σ2L)−d
(αIN − L)p, α ≥ 2
exp(−σ2L/2)
cos (Lπ/4)
(cid:0)d+k−1
k
(cid:0)p
k
(cid:1) (cid:0)1 + σ−2(cid:1)−k
(cid:1)(α − 1)−k
k! ( σ2
2 )k
k
2 if k even, (−1)
1
(cid:0) π
4
1
k!
(cid:1)k
*
n
(−1)
k−1
2
o
if k odd
α : N ×N → R. The exp and cos mappings are
Table 1: Different graph functions/kernels K G
defined via Taylor series expansions rather than element-wise, e.g. exp(M) := limn→∞(IN +
M/n)n and cos(M) := Re(exp(iM)). σ and α are regularisers. Note that the diffusion
kernel is sometimes instead defined by exp(σ2(IN − L)) but these forms are equivalent up
to normalisation.
The chief goal of this work is to construct a random feature map φ(i) : N → Rl with l ∈ N
that provides unbiased approximation of Kα(W) as in Eq. 1. To do so, we consider the
following algorithm.
Algorithm 1 Constructing a random feature vector φf (i) ∈ RN to approximate Kα(W)
Input: weighted adjacency matrix W ∈ RN ×N , vector of unweighted node degrees (no.
neighbours) d ∈ RN , modulation function f : (N ∪ {0}) → R, termination probability
phalt ∈ (0, 1), node i ∈ N , number of random walks to sample m ∈ N.
Output: random feature vector φf (i) ∈ RN
1: initialise: φf (i) ← 0
2: for w = 1, ..., m do
3:
4:
5:
6:
7:
8:
9:
10:
initialise: load ← 1
initialise: current_node ← i
initialise: terminated ← False
initialise: walk_length ← 0
while terminated = False do
φf (i)[current_node] ← φf (i)[current_node]+load×f ( walk_length )
walk_length ← walk_length+1
new_node ← Unif [N ( current_node )]
load ← load× d[current_node]
current_node ← new_node
terminated ← (t ∼ Unif(0, 1) < phalt)
▷ assign to one of neighbours
▷ update load
▷ draw RV t to decide on termination
× W [ current_node,new_node ]
1−phalt
11:
12:
13:
14:
15: end for
16: normalise: φf (i) ← φf (i)/m
end while
3
Preprint. Under review.
f (i)
i
Figure 1: Schematic for a random walk on a graph (solid red) and an accompanying modu-
lation function f (dashed blue) used to approximate an arbitrary graph node function K G.
This is identical to the algorithm presented by Choromanski (2023) for constructing features
to approximate the 2-regularised Laplacian kernel, apart from the presence of the extra
modulation function f : (N∪{0}) → R in line 8 that upweights or downweights contributions
from walks depending on their length (see Fig. 1). We refer to φf as universal graph random
features (u-GRFs), where the subscript f identifies the modulation function. Crucially, the
time complexity of Alg. 1 is subquadratic in the number of nodes N , in contrast to exact
methods which are O(N 3)2.
We now state the following central result, proved in App. A.2.
Theorem 2.1 (Unbiased approximation of Kα via convolutions). For two modulation func-
tions: f1, f2 : (N ∪ {0}) → R, u-GRFs (cid:0)φf1(i))N
i=1 constructed according to Alg.
1 give unbiased approximation of Kα,
i=1, (φf2 (i)(cid:1)N
[Kα]ij = E (cid:2)φf1(i)⊤φf2 (j)(cid:3) ,
(3)
for kernels with an arbitrary Taylor expansion α = (αk)∞
k=0 provided that α = f1 ∗ f2. Here,
∗ is the discrete convolution of the modulation functions f1, f2; that is, for all k ∈ (N ∪ {0}),
k
X
p=0
f1(k − p)f2(p) = αk.
(4)
Clearly the class of pairs of modulation functions f1, f2 that satisfy Eq. 4 is highly degen-
erate. Indeed, it is possible to solve for f1 given any f2 and α provided f2(0) ̸= 0. For
f2(i) = I(i = 0) with I(*) the indicator
instance, a trivial solution is given by: f1(i) = αi,
function. In this case, the walkers corresponding to f2 are 'lazy', depositing all their load
at the node at which they begin. Contributions to the estimator φf1(i)⊤φf2 (j) only come
from walkers initialised at i traversing all the way to j rather than two walkers both passing
through an intermediate node. Also of great interest is the case of symmetric modulation
functions f1 = f2, where now intersections do contribute. In this case, the following is true
(proved in App. A.3).
Theorem 2.2 (Computing symmetric modulation functions). Supposing f1 = f2 = f , Eq.
4 is solved by a function f which is unique (up to a sign) and is given by
(cid:19) X
i
X
(cid:19) (cid:16)
(cid:18)
n
k1k2k3...
1 αk2
αk1
2 αk3
(cid:17)
3 ...
.
(5)
f (i) = ±
(cid:18) 1
2
n
n=0
k1+2k2+3k3...=i
k1+k2+k3+...=n
Moreover, f (i) can be efficiently computed with the iterative formula
f (0) = ±
√
f (i + 1) =
α0 = ±1
αi+1−Pi−1
p=0
f (i−p)f (p+1)
2f (0)
for i ≥ 0.
(6)
2Concretely, Alg. 1 yields a pair of matrices φ1,2 := (φ(i))N
i=1 ∈ RN ×N such that K = E(φ1φ⊤
2 )
in subquadratic time. Of course, explicitly multiplying the matrices to evaluate every element of bK
2 v) where v ∈ RN
would be O(N 3), but we avoid this since in applications we just evaluate φ1(φ⊤
is some vector and the brackets give the order of computation. This is O(N 2).
4
Preprint. Under review.
For symmetric modulation functions, the random features φf1 (i) and φf2 (i) are identical
apart from the particular sample of random walks used to construct them. They cannot
share the same sample or estimates of diagonal kernel elements [Kα]ii will be biased.
Computational cost: Note that when running Alg. 1 one only needs to evaluate the
modulation functions f1,2(i) up to the length of the longest walk one samples. A batch
of size b, (f1,2(i))b
i=1, can be pre-computed in time O(b2) and reused for random features
corresponding to different nodes and even different graphs. Further values of f can be
computed at runtime if b is too small and also reused for later computations. Moreover, the
minimum length b required to ensure that all m walks are shorter than b with high probability
(Pr(∪m
i=1len(ωi) ≤ b) < 1−δ, δ ≪ 1) scales only logarithmically with m (see App. A.1). This
means that, despite estimating a much more general family of graph functions, u-GRFs are
essentially no more expensive than the original GRF algorithm. Moreover, any techniques
used for dimensionality reduction of regular GRFs (e.g. applying the Jonhson-Lindenstrauss
transform (Dasgupta et al., 2010) or using 'anchor points' (Choromanski, 2023)) can also
be used with u-GRFs, providing further efficiency gains.
Generating functions:
definition of Kα(W), we immediately have that
Inserting the constraint for unbiasedness in Eq. 4 back into the
Kα(W) = Kf1(W)Kf2(W)
(7)
where Kf1(W) := P∞
i=0 f1(i)Wi is the generating function corresponding to the sequence
(f1(i))∞
i=0. This is natural because the (discrete) Fourier transform of a (discrete) convolu-
tion returns the product of the (discrete) Fourier transforms of the respective functions. In
the symmetric case f1 = f2, it follows that
Kf (W) = ± (Kα(W))
1
2 .
(8)
If the RHS has a simple Taylor expansion (e.g. Kα(W) = exp(W) so Kf (W) = exp( W
2 )),
this enables us obtain f without recourse to the conditional sum in Eq. 5 or the iterative
expression in Eq. 6. This is the case for many
popular graph kernels; we provide some promi-
nent examples in the table left. A notable ex-
ception is the inverse cosine kernel.
d-regularised Laplacian
Name
f (i)
p-step random walk
Diffusion
(cid:1)
(d−2+2i)!!
(2i)!!(d−2)!!
(cid:0) p
2
i
1
2ii!
As an interesting corollary, by considering
the diffusion kernel we have also proved that
Pk
2k−p(k−p)! = 1
k! .
1
2pp!
p=0
1
2.1 Neural modulation functions, kernel learning and generalisation
Instead of using a fixed modulation function f to estimate a fixed kernel, it is possible to
parameterise it more flexibly. For example, we can define a neural modulation function
f (N ) : (N ∪ {0}) → R by a neural network (with a restricted domain) whose input and
output dimensionalities are equal to 1. During training, we can choose the loss function
to target particular desiderata of u-GRFs: for example, to suppress the mean square error
of estimates of some particular fixed kernel (Sec. 3.4), or to learn a kernel which performs
better in a downstream task (Sec. 3.5). Implicitly learning Kα via f (N ) is more scalable
than learning Kα directly because it obviates the need to repeatedly compute the exact
kernel, which is typically of O(N 3) time complexity. Since any modulation function f maps
to a unique α by Eq. 4, it is also always straightforward to recover the exact kernel which
the u-GRFs estimate, e.g. once the training is complete.
Supposing we have (implicitly) learned α, how can the learned kernel K G
α be expected to
generalise? Let ψK : x → HK denote the feature mapping from the input space to the
reproducing kernel Hilbert space HK induced by the kernel K G
α. Define the hypothesis set
(9)
where we restricted our family of kernels so that the absolute value of each Taylor coefficient
αi is smaller than some maximum value α(M )
. Following very similar arguments to Cortes
et al. (2010), the following is true.
H = {x → w⊤ψK(x) : |αi| ≤ α(M )
, ∥w∥2 ≤ 1},
i
i
5
Preprint. Under review.
Theorem 2.3 (Empirical Rademacher complexity bound). For a fixed sample S = (xi)m
the empirical Rademacher complexity bR(H) is bounded by
i=1,
v
u
u
t
bR(H) ≤
1
m
∞
X
i=0
α(M )
i
ρ(W)i,
(10)
where ρ(W) is the spectral radius of the weighted adjacency matrix W.
Naturally, the bound on bR(H) increases monotonically with ρ(W). Following standard ar-
guments in the literature, this immediately yields generalisation bounds for learning kernels
K G
α. We discuss this in detail, including proving Theorem 2.3, in App. A.4.
3 Experiments
Here we test the empirical performance of u-GRFs, both for approximating fixed kernels
(Secs 3.1-3.3) and with learnable neural modulation functions (Secs 3.4-3.5).
3.1 Unbiased pointwise estimation of fixed kernels
We begin by confirming that u-GRFs do indeed give unbiased estimates the graph kernels
listed in Table 1, taking σ = 0.25 and α = 20 as regularisers. We use symmetric modulation
functions f , computed with the closed forms where available and using the iterative scheme
in Eq. 6 if not. Fig. 2 plots the relative Frobenius norm error between the true kernels K
and their approximations with u-GRFs bK (that is, ∥K − bK∥F /∥K∥F ) against the number
of random walkers m. We consider 8 different graphs: a small random Erdős-Rényi graph,
a larger Erdős-Rényi graph, a binary tree, a d-regular graph and 4 real world examples
(karate, dolphins, football and eurosis) (Ivashkin, 2023). They vary substantially in
size. For every graph and for all kernels, the quality of the estimate improves as m grows
and becomes very small with even a modest number of walkers.
Figure 2: Unbiased estimation of popular kernels on different graphs using u-GRFs. The
approximation error (y-axis) improves with the number of walkers (x-axis). We repeat 10
times; one standard deviation on the mean error is shaded.
3.2 Solving differential equations on graphs
An intriguing application of u-GRFs for fixed kernels is efficiently computing approxi-
mate solutions of time-invariant non-homogeneous ordinary differential equations (ODEs)
on graphs. Consider the following ODE defined on the nodes N of the graph G:
dx(t)
dt
= Wx(t) + y(t),
6
(11)
51015No. random walks104103Frob. norm errorER (N=20, p=0.2)1-reg Lap2-reg Lap2-step RWDiffusionCosine51015No. random walks104103Frob. norm errorER (N=100, p=0.04)51015No. random walks104103Frob. norm errorBinary tree (N=127)51015No. random walks104103Frob. norm errord-regular (N=100, d=10)51015No. random walks104103Frob. norm errorKarate (N=34)51015No. random walks104103Frob. norm errorDolphins (N=62)51015No. random walks104103Frob. norm errorFootball (N=115)51015No. random walks104103Frob. norm errorEurosis (N=1272)Preprint. Under review.
where x(t) ∈ RN is the state of the graph at time t, W ∈ RN ×N is a weighted adjacency
matrix and y(t) is a (known) driving term. Assuming the null initial condition x(0) = 0,
Eq. 11 is solved by the convolution
x(t) =
Z t
0
exp(W(t − τ ))y(τ )dτ = Eτ ∈P
(cid:20) 1
p(τ )
exp(W(t − τ ))y(τ )
(12)
(cid:21)
where P is a probability distribution on the interval [0, t], equipped with a (preferably
efficient) sampling mechanism and probability density function p(τ ). Taking n ∈ N Monte
i.i.d.∼ P, we can construct the unbiased estimator:
Carlo samples (τi)n
i=1
bx(t) :=
1
n
n
X
j=1
1
p(τj)
exp(W(t − τj))y(τj).
(13)
Note that exp(W(t − τj)) is nothing other than the diffusion kernel, which is expensive
to compute exactly for large N but can be efficiently approximated with u-GRFs. Taking
exp(W(t − τj)) ≃ ΦjΦ⊤
i=1 a matrix whose rows are u-GRFs, we have
that
j with Φ := (φ(i))N
bx(t) :=
1
n
n
X
j=1
1
p(τj)
ΦjΦ⊤
j y(τj)
(14)
which can be computed in quadratic time (c.f. cubic if the heat kernel is computed exactly).
Further speed gains are possible if dimensionality reduction techniques are applied to the
u-GRFs (Choromanski, 2023; Dasgupta et al., 2010).
As an example, we consider diffusion of heat on
three real-world graphs (karate, dolphins and
football) with a fixed source at one node, tak-
ing W = L (the graph Laplacian) and y(t) =
y = (1, 0, 0, ...)⊤. Clearly the steady state is
x(∞) = W−1(−y). We simulate evolution un-
der the ODE for t = 1 with n = 10 discreti-
sation timesteps and P uniform, approximating
exp(W(t − τj)) with different numbers of walk-
ers m. As m grows, the quality of approxima-
tion improves and the (normalised) error on the
final state ∥bx(1) − x(1)∥2/∥x(1)∥2 drops for ev-
ery graph. We take 100 repeats for statistics and
plot the results in Fig. 3.
Figure 3: ODE simulation error decreases
as the number of walkers grows.
3.3 Efficient kernelised graph node clustering
As a further demonstration of the utility of
our new mechanism, we show how estimates
of the kernel K = exp(σ2W) can be used
to assign nodes to k = 3 clusters. Here, we
choose W to be the (unweighted) adjacency
matrix and the regulariser is σ2 = 0.2. We
follow the algorithm proposed by Dhillon
et al. (2004), comparing the clusters when
we use exact and u-GRF-approximated ker-
nels. For all graphs, m ≤ 80. Table 2 re-
ports the clustering error, defined by
Ec :=
no. wrong pairs
N (N − 1)/2
.
(15)
Table 2: Errors in kernelised k-means
clustering when approximating the kernel
exp(σ2W) with u-GRFs.
Graph
N
Clustering error, Ec
karate
dolphins
polbooks
football
databases
eurosis
citeseer
cora
34
62
105
115
1046
1272
2485
3300
0.08
0.16
0.12
0.02
0.10
0.09
0.01
0.04
This is the number of misclassified pairs of nodes (assigned to the same cluster when the
converse is true or vice versa) divided by the total number of pairs. The error is small even
with a modest number of walkers and on large graphs; kernel estimates efficiently constructed
using u-GRFs can be readily deployed on downstream tasks where exact methods are slow.
7
246810121416No. walkers0.020.040.060.080.10Sim. errorDiffusion simulation error vs. no. walkerskaratedolphinsfootballPreprint. Under review.
3.4 Learning f (N ) for better kernel approximation
Following the discussion in Sec. 2.1 we now replaced fixed f with a neural modulation
function f (N ) parameterised by a simple neural network with 1 hidden layer of size 1:
f (N )(x) = σsoftplus (w2σReLU(w1x + b1) + b2) ,
(16)
where w1, b1, w2, b2 ∈ R and σReLU and σsoftplus are the ReLU and softplus activation func-
tions, respectively. Bigger, more expressive architectures (including allowing f (N ) to take
negative values) can be used but this is found to be sufficient for our purposes.
1 = f (N )
As a first task, we define our loss function to be the Frobenius norm error between a target
Gram matrix and our u-GRF-approximated Gram matrix, as in Sec. 3.1. For the target,
we choose the 2-regularised Laplacian kernel. We train symmetric f (N )
but provide
a cursory empirical discussion of the asymmetric case in App. A.5. On the small Erdős-
Rényi graph (N = 20) with m = 16 walks, we minimise the loss with the Adam optimiser
and a decaying learning rate (LR = 0.01, γ = 0.975, 1000 epochs). We make the following
striking observation: f (N ) does not generically converge to the unique unbiased (symmetric)
modulation function implied by α, but instead to some different f that though biased gives
a smaller mean squared error (MSE). This is possible because by downweighting long walks
the learned f (N ) gives estimators with a smaller variance, which is sufficient to suppress the
MSE on the kernel matrix elements even though it no longer reproduces the target value
in expectation. f (N ) optimised for kernel estimation on one particular graph generalises
to improve kernel approximation on other graphs, including when their topology is very
different and they have a much greater number of nodes: eurosis is bigger by a factor of
over 60. See Table 3 for the results.
2
Naturally, the learned f (N ) is dependent on the the number of random walks m; as m grows,
the variance on the kernel approximation drops so it is intuitive that f (N ) will approach
the unbiased f . Fig. 4 empirically confirms this is the case, showing the learned f (N ) for
different numbers of walkers. The line labelled ∞ is the unbiased modulation function,
which for the 2-regularised Laplacian kernel is flat.
Table 3: Kernel approximation error with
m = 16 walks and unbiased or learned mod-
ulation functions. Lower is better.
Figure 4: Learned modulation function
with different numbers of random walkers.
Approaches unbiased f (N ) as m → ∞
Graph
N
Frob. norm error on bK
Learned
Unbiased
Small ER
Larger ER
Binary tree
d-regular
karate
dolphins
football
eurosis
20
100
127
100
34
62
115
1272
0.0488(9)
0.0503(4)
0.0453(4)
0.0490(2)
0.0492(6)
0.0505(5)
0.0520(2)
0.0551(2)
0.0437(9)
0.0448(4)
0.0410(4)
0.0434(2)
0.0439(6)
0.0449(5)
0.0459(2)
0.0484(2)
These learned modulation functions might guide the more principled construction of biased,
low-MSE GRFs in the future. An analogue in Euclidean space is provided by structured
orthogonal random features (SORFs), which replace a random Gaussian matrix with a HD-
product to estimate the Gaussian kernel (Choromanski et al., 2017; Yu et al., 2016). This
likewise improves kernel approximation quality despite breaking estimator unbiasedness.
3.5
Implicit kernel learning for node attribute prediction
As suggested in Sec. 2.1, it is also possible to train the neural modulation function f (N )
directly using performance on a downstream task, performing implicit kernel learning. We
have argued that this is much more scalable than optimising Kα directly.
8
02468i0.00.20.40.60.81.0f(i)Modulation functions for different no. walkers248163264128256512Preprint. Under review.
In this spirit, we now address the problem of kernel regression on triangular mesh graphs,
as previously considered by Reid et al. (2023). For graphs in this dataset (Dawson-
Haggerty, 2023), every node is associated with a normal vector v(i) ∈ R3 equal to the
mean of the normal vectors of its 3 surrounding faces. The task is to predict the direc-
tions of missing vectors (a random 5% split) from the remainder. Our (unnormalised)
predictions are given by bv(i) := P
j bK(N )(i, j)v(j), where bK(N ) is a kernel estimate con-
structed using u-GRFs with a neural modulation function f (N ) (see Eq. 3). The an-
gular prediction error is 1 − cos θi with θi the angle between the true v(i) and and
approximate bv(i) normals, averaged over the
missing vectors. We train a symmetric pair f (N )
using this angular prediction error on the small
cylinder graph (N = 210) as the loss function.
Then we freeze f (N ) and compute the angular
prediction error for other larger graphs. Fig. 5
shows the learned f (N ) as well as some other
modulation functions corresponding to popular
fixed kernels. Note also that learning f (N ) al-
ready includes (but is not limited to) optimis-
ing the lengthscale of a given kernel:
taking
fW → β fW is identical to f (i) → f (i)βi ∀ i.
The prediction errors are highly correlated be-
tween the different modulation functions for a
given random draw of walks; ensembles which 'explore' the graph poorly, terminating quickly
or repeating edges, will give worse u-GRF estimators for every f . For this reason, we com-
pute the prediction errors as the average normalised difference compared to the learned
kernel result. Table 4 reports the results. Crucially, this difference is found to be positive
for every graph and every fixed kernel, meaning the learned kernel always performs best.
Figure 5: Fixed and learned modulation
functions for kernel regression
Table 4: Normalised difference in angular prediction error compared to the learned
kernel defined by f (N ) (trained on the cylinder graph). All entries are positive since
the learned kernel always performs best. We take 100 repeats; the brackets give one
standard deviation on the mean result.
Graph
N
Normalised ∆(pred error) c.f. learned
1-reg Lap
2-reg Lap
Diffusion
cylinder
teapot
idler-riser
busted
torus
+0.40(2)
210
+0.81(5)
480
782
+0.52(2)
1941 +0.81(2)
4350 +2.13(5)
+0.85(4)
+1.78(8)
+1.12(1)
+1.60(4)
+5.3(1)
+0.029(3)
+0.059(3)
+0.042(2)
+0.063(2)
+0.067(2)
It is remarkable that the learned f (N ) gives the smallest error for all the graphs even though
it was just trained on the smallest one. We have implicitly learned a good kernel for this
task which generalises well across topologies. It is also intriguing that the diffusion kernel
performs only slightly worse. This is to be expected because their modulation functions are
similar (see Fig. 5) so they encode very similar kernels, but this will not always be the case
depending on the task at hand.
4 Conclusion
We have introduced 'universal graph random features' (u-GRFs), a novel random walk-based
algorithm for time-efficient estimation of arbitrary functions of a weighted adjacency matrix.
The mechanism is conceptually simple and trivially distributed across machines, unlocking
kernel-based machine learning on very large graphs. By parameterising one component of
the random features with a simple neural network, we can futher suppress the mean square
error of estimators and perform scalable implicit kernel learning.
9
02468i0.00.20.40.60.81.0f(i)Modulation functions for regression tasklearned1-reg Lap2-reg LapdiffusionPreprint. Under review.
5 Ethics and reproducibility
Ethics: Our work is foundational. There are no direct ethical concerns that we can see,
though of course increases in scalability afforded by graph random features might amplify
risks of graph-based machine learning, from bad actors or as unintended consequences.
Reproducibility: To foster reproducibility, we clearly state the central algorithm in Alg.
1 and will provide full source code if the manuscript is accepted. All theoretical results
are accompanied by proofs in Appendices A.1-A.4, where any assumptions are made clear.
The datasets we use correspond to standard graphs and are freely available online. We
link suitable repositories in every instance. Except where prohibitively computationally
expensive, results are reported with uncertainties to help comparison.
6 Relative contributions and acknowledgements
EB initially proposed using a modulation function to generalise GRFs to estimate the dif-
fusion kernel and derived its mathematical expression. IR and KC then developed the full
u-GRFs algorithm for general functions of a weighted adjacency matrix, proving all theoret-
ical results, running the experiments and preparing the manuscript. AW provided helpful
discussions and advice.
IR acknowledges support from a Trinity College External Studentship. AW acknowledges
support from a Turing AI fellowship under grant EP/V025279/1 and the Leverhulme Trust
via CFI.
We thank Kenza Tazi and Austin Trip for their careful readings of the manuscript. Richard
Turner provided valuable suggestions and support throughout the project.
References
Zhaojun Bai, James Demmel, Jack Dongarra, Axel Ruhe, and Henk van der Vorst. Templates
for the solution of algebraic eigenvalue problems: a practical guide. SIAM, 2000. URL
https://www.cs.ucdavis.edu/~bai/ET/contents.html.
Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk
bounds and structural results. Journal of Machine Learning Research, 3(Nov):463–482,
2002. URL https://dl.acm.org/doi/pdf/10.5555/944919.944944.
Karsten M Borgwardt, Cheng Soon Ong, Stefan Schönauer, SVN Vishwanathan, Alex J
Smola, and Hans-Peter Kriegel. Protein function prediction via graph kernels. Bioinfor-
matics, 21(suppl_1):i47–i56, 2005. URL https://doi.org/10.1093/bioinformatics/
bti1007.
Colin Campbell. Kernel methods: a survey of current techniques. Neurocomputing, 48(1-4):
63–84, 2002. doi: 10.1016/S0925-2312(01)00643-9. URL https://doi.org/10.1016/
S0925-2312(01)00643-9.
Stéphane Canu and Alexander J. Smola. Kernel methods and the exponential fam-
ily. Neurocomputing, 69(7-9):714–720, 2006. doi: 10.1016/j.neucom.2005.12.009. URL
https://doi.org/10.1016/j.neucom.2005.12.009.
Olivier Chapelle, Jason Weston, and Bernhard Schölkopf. Cluster kernels for semi-supervised
learning. Advances in neural information processing systems, 15, 2002. URL https:
//dl.acm.org/doi/10.5555/2968618.2968693.
Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane,
Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al.
Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020. URL
https://doi.org/10.48550/arXiv.2009.14794.
10
Preprint. Under review.
Krzysztof M Choromanski, Mark Rowland, and Adrian Weller. The unreasonable effec-
tiveness of structured random orthogonal embeddings. Advances in neural information
processing systems, 30, 2017. URL https://doi.org/10.48550/arXiv.1703.00864.
Krzysztof Marcin Choromanski. Taming graph kernels with random features.
In In-
ternational Conference on Machine Learning, pages 5964–5977. PMLR, 2023. URL
https://doi.org/10.48550/arXiv.2305.00156.
Fan R. K. Chung and Shing-Tung Yau. Coverings, heat kernels and spanning trees. Electron.
J. Comb., 6, 1999. doi: 10.37236/1444. URL https://doi.org/10.37236/1444.
Corinna Cortes, Mehryar Mohri, and Afshin Rostamizadeh. Generalization bounds for
learning kernels. In Proceedings of the 27th Annual International Conference on Machine
Learning (ICML 2010), 2010. URL http://www.cs.nyu.edu/~mohri/pub/lk.pdf.
Keenan Crane, Clarisse Weischedel, and Max Wardetzky. The heat method for distance
computation. Communications of the ACM, 60(11):90–99, 2017. URL https://dl.acm.
org/doi/10.1145/3131280.
Anirban Dasgupta, Ravi Kumar, and Tamás Sarlós. A sparse johnson: Lindenstrauss trans-
form. In Leonard J. Schulman, editor, Proceedings of the 42nd ACM Symposium on The-
ory of Computing, STOC 2010, Cambridge, Massachusetts, USA, 5-8 June 2010, pages
341–350. ACM, 2010. doi: 10.1145/1806689.1806737. URL https://doi.org/10.1145/
1806689.1806737.
Michael Dawson-Haggerty. Trimesh repository, 2023. URL https://github.com/mikedh/
trimesh.
Inderjit S Dhillon, Yuqiang Guan, and Brian Kulis. Kernel k-means: spectral clustering
and normalized cuts. In Proceedings of the tenth ACM SIGKDD international conference
on Knowledge discovery and data mining, pages 551–556, 2004. URL https://dl.acm.
org/doi/10.1145/1014052.1014118.
Michel X. Goemans and David P. Williamson. Approximation algorithms for max-3-cut
and other problems via complex semidefinite programming. J. Comput. Syst. Sci., 68
(2):442–470, 2004. doi: 10.1016/j.jcss.2003.07.012. URL https://doi.org/10.1016/j.
jcss.2003.07.012.
Vladimir Ivashkin. Community graphs repository, 2023. URL https://github.com/
vlivashkin/community-graphs.
William B Johnson. Extensions of lipschitz mappings into a hilbert space. Contemp. Math.,
26:189–206, 1984. URL http://stanford.edu/class/cs114/readings/JL-Johnson.
pdf.
Kyle Kloster and David F Gleich. Heat kernel based community detection. In Proceedings
of the 20th ACM SIGKDD international conference on Knowledge discovery and data
mining, pages 1386–1395, 2014. URL https://doi.org/10.48550/arXiv.1403.3148.
Vladimir Koltchinskii and Dmitry Panchenko. Empirical margin distributions and bounding
the generalization error of combined classifiers. The Annals of Statistics, 30(1):1–50, 2002.
URL https://doi.org/10.48550/arXiv.math/0405343.
Risi Kondor and John D. Lafferty. Diffusion kernels on graphs and other discrete input
spaces. In Claude Sammut and Achim G. Hoffmann, editors, Machine Learning, Proceed-
ings of the Nineteenth International Conference (ICML 2002), University of New South
Wales, Sydney, Australia, July 8-12, 2002, pages 315–322. Morgan Kaufmann, 2002. URL
https://www.ml.cmu.edu/research/dap-papers/kondor-diffusion-kernels.pdf.
Leonid Kontorovich, Corinna Cortes, and Mehryar Mohri. Kernel methods for learning
languages. Theor. Comput. Sci., 405(3):223–236, 2008. doi: 10.1016/j.tcs.2008.06.037.
URL https://doi.org/10.1016/j.tcs.2008.06.037.
11
Preprint. Under review.
Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. Advances
in neural information processing systems, 20, 2007. URL https://dl.acm.org/doi/10.
5555/2981562.2981710.
Isaac Reid, Krzysztof Choromanski, and Adrian Weller. Quasi-monte carlo graph random
features. arXiv preprint arXiv:2305.12470, 2023. URL https://doi.org/10.48550/
arXiv.2305.12470.
Alexander J Smola and Risi Kondor. Kernels and regularization on graphs. In Learning The-
ory and Kernel Machines: 16th Annual Conference on Learning Theory and 7th Kernel
Workshop, COLT/Kernel 2003, Washington, DC, USA, August 24-27, 2003. Proceed-
ings, pages 144–158. Springer, 2003. URL https://people.cs.uchicago.edu/~risi/
papers/SmolaKondor.pdf.
Alexander J. Smola and Bernhard Schölkopf. Bayesian kernel methods. In Shahar Mendel-
son and Alexander J. Smola, editors, Advanced Lectures on Machine Learning, Machine
Learning Summer School 2002, Canberra, Australia, February 11-22, 2002, Revised Lec-
tures, volume 2600 of Lecture Notes in Computer Science, pages 65–117. Springer, 2002.
URL https://doi.org/10.1007/3-540-36434-X_3.
Yasutoshi Yajima. One-class support vector machines for recommendation tasks. In Pacific-
Asia Conference on Knowledge Discovery and Data Mining, pages 230–239. Springer,
2006. URL https://dl.acm.org/doi/10.1007/11731139_28.
Felix Xinnan X Yu, Ananda Theertha Suresh, Krzysztof M Choromanski, Daniel N
Holtmann-Rice, and Sanjiv Kumar. Orthogonal random features. Advances in neural in-
formation processing systems, 29, 2016. URL https://doi.org/10.48550/arXiv.1610.
09072.
Yufan Zhou, Changyou Chen, and Jinhui Xu. Learning manifold implicitly via explicit heat-
kernel learning. Advances in Neural Information Processing Systems, 33:477–487, 2020.
URL https://doi.org/10.48550/arXiv.2010.01761.
12
Preprint. Under review.
A Appendices
A.1 Minimum batch size scales logarithmically with number of walks
Consider an ensemble of m random walks S := {ωi}m
i=1 whose lengths are sampled from a
geometric distribution with termination probability p. Trivially, Pr(len(ωi) < b) = 1 − (1 −
p)b. Given m independent walkers,
Pr (maxωi∈S(len(ωi) < b) = Pr (∪m
i=1len(ωi) < b) = (1 − (1 − p)b)m.
(17)
Take 'with high probability' to mean with probability at least 1 − δ, with δ ≪ 1 fixed. Then
b =
log(1 − (1 − δ) 1
log(1 − p)
m )
≃
log(δ) − log(m)
log(1 − p)
.
(18)
As the number of walkers m grows, the minimum value of b to ensure that all walkers are
shorter than b with high probability scales logarithmically with m.
A.2 Proof of Theorem 2.1 (Unbiased approximation of Kα via convolutions)
We begin by proving that u-GRFs constructed according to Alg. 1 give unbiased estimation
of graph functions with Taylor coefficients (αi)∞
i=0 provided the discrete convolution relation
in Eq. 4 is fulfilled.
Denote the set of m walks sampled out of node i by { ̄Ω(i)
1, it is straightforward to convince oneself that the u-GRF estimator takes the form
k=1. Carefully considering Alg.
k }m
φ(i)v :=
1
m
m
X
X
k=1
ωiv∈Ωiv
eω(ωiv)f (len(ωiv))
p(ωiv)
I(ωiv ∈ ̄Ω(i)
k ).
(19)
Here, Ωiv denotes the set of all graph walks between nodes i and v, of which each ωiv is a
member. len(ωiv) is a function that gives the length of walk ωiv and eω(ωiv) evaluates the
products of edge weights it traverses. p(ωiv) = (1 − p)len(ωiv) Qlen(ωiv)
denotes the walk's
marginal probability. I is the indicator function which evaluates to 1 if its argument is true
(namely, walk ωiv is a subwalk of ̄Ω(i)
k , the kth walk sampled out of i) and 0 otherwise.
i
I(ωiv ∈ ̄Ω(i)
Trivially, we have that E
= p(ωiv) (by construction to make the estimator
k )
unbiased).
1
di
i=1
h
Now note that:
E (cid:2)φ(i)⊤φ(j)(cid:3) = E
#
φ(i)vφ(j)v
"
X
v∈N
X
X
X
=
eω(ωiv)f (len(ωiv))eω(ωjv)f (len(ωjv))
v
ωiv∈Ωiv
=
ωjv∈Ωjv
∞
X
X
v
X
∞
X
=
l1=0
l1X
∞
X
l2=0
Wl1
ivWl2
jvf (l1)f (l2)
Wl1−l3
iv Wl3
jvf (l1 − l3)f (l3)
(20)
v
l1=0
l3=0
∞
X
=
Wl1
ij
l1X
l1=0
l3=0
f (l1 − l3)f (l3).
From the first to the second line we used the definition of GRFs in Eq. 19. We then rewrote
the sum of the product of edge weights over all possible paths as powers of the weighted
adjacency matrix W. To get to the fourth line, we changed indices in the infinite sums,
then the final line followed simply.
13
Preprint. Under review.
l1X
i
X
The final expression in Eq. 20 is exactly equal to Kα(W) := P∞
have that
l1=0 αl1Wl1 provided we
f (l1 − l3)f (l3) := αl1 ,
(21)
as stated in Eq. 4 of the main text (with variables renamed to k and p).
l3=0
A.3 Proof of Theorem 2.2 (Computing symmetric modulation functions)
Here, we show how to compute f under the constraint that the modulation functions are
identical, f1 = f2 = f . We will use the relationship in Eq. 4, reproduced below for the
reader's convenience:
f (i − p)f (p) = αi.
(22)
p=0
The iterative form in Eq. 6 is easy to show. For i = 0 we have that f (0)2 = α0, so
f (0) = ±
α0 = ±1 (where we used the normalisation condition α0 = 1). Now note that
√
i+1
X
p=0
so clearly
f (i + 1 − p)f (p) = 2f (0)f (i + 1) +
i
X
p=1
f (i + 1 − p)f (p) = αi+1
(23)
f (i + 1) =
αi+1 − Pi−1
p=0 f (i − p)f (p + 1)
2f (0)
.
(24)
This enables us to compute f (i + 1) given αi+1 and (f (p))i
p=0.
The analytic form in Eq. 5 is only a little harder. Inserting the discrete convolution relation
in Eq. 4 back into Eq. 2, we have that
where Kf1 (W) := P∞
(f1(i))∞
i=0. Constraining f1 = f2,
Kα(W) = Kf1(W)Kf2(W)
(25)
i=0 f1(i)Wi is the generating function corresponding to the sequence
(26)
Kf (W) = ± (Kα(W))
We also discuss this in the 'generating functions' section of Sec. 2 where we use it to derive
simple closed forms for f for some special kernels. Now we have that
1
2 .
∞
X
i=0
f (i)Wi = ±
! 1
2
αnWn
∞
X
n=0
= ± (cid:0)1 + (cid:0)α1W + α2W2 + ...(cid:1)(cid:1) 1
2
= ±
∞
X
n=0
(cid:19)
(cid:18) 1
2
n
(cid:0)α1W + α2W2 + ...(cid:1)n
.
(27)
We need to equate powers of W between the generating functions. Consider the terms
proportional to Wi. Clearly no such terms will feature when n > i, so we can restrict the
sum on the RHS to 0 ≤ n ≤ i. Meanwhile, the term in (cid:0)α1W + α2W2 + ...(cid:1)n
proportional
to Wi is nothing other than
X
k1+2k2+3k3...=i
k1+k2+k3+...=n
(cid:18)
(cid:19) (cid:16)
n
k1k2k3...
1 αk2
αk1
2 αk3
3 ...
(cid:17)
where (cid:0)
n
k1k2k3...
(cid:1) is the multinomial coefficient. Combining,
(cid:19) X
i
X
(cid:18)
(cid:19) (cid:16)
f (i) = ±
n
k1k2k3...
(cid:18) 1
2
n
n=0
k1+2k2+3k3...=i
k1+k2+k3+...=n
1 αk2
αk1
2 αk3
3 ...
(28)
(29)
(cid:17)
as shown in Eq. 5. Though this expression gives f purely in terms of α, the presence of the
conditional sum limits its practical utility compared to the iterative form.
14
Preprint. Under review.
A.4 Proof of Theorem 2.3 (Empirical Rademacher complexity bound)
In this appendix we derive the bound on the empirical Rademacher complexity stated in
Theorem 2.3 and show the consequent generalisation bounds. The early stages closely follow
arguments made by Cortes et al. (2010). Recall that we have defined the hypothesis set
H = {x → w⊤ψK(x) : |αi| ≤ α(M )
(30)
with ψK : x → HK the feature mapping from the input space to the reproducing kernel
Hilbert space HK induced by the kernel K G
α.
The empirical Rademacher complexity bR(H) for an arbitrary fixed sample S = (xi)m
defined by
, ∥w∥2 ≤ 1},
i=1 is
i
bR(H) :=
1
m
Eσ
"
#
m
X
i=1
sup
h∈H
σih(xi)
(31)
the expectation is taken over σ = (σ1, ..., σm) with σi ∼ Unif(±1) i.i.d. Rademacher random
variables.
Begin by noting that
h(x) := w⊤ψK(x) =
m
X
i=1
βiK(xi, x)
(32)
where βi are
span(ψK(x1), ..., ψK(xm)), where β⊤Kβ ≤ 1. Then we have that
coordinates of
the
the orthogonal projections of w on HS =
bR(H) =
1
m
Eσ
"
sup
α,β
#
σ⊤Kβ
.
(33)
The supremum supβ σ⊤Kβ is reached when K1/2β is collinear with K1/2σ, and making
∥β∥2 as large as possible gives
Now note that
bR(H) =
√
1
m
Eσ
(cid:20)
sup
α
σ⊤Kσ
(cid:21)
.
σ⊤Kσ =
∞
X
i=0
αiσ⊤Wiσ.
σ⊤Wiσ may take either sign, and the sum is maximised by taking αi = α(M )
terms and αi = −α(M )
for negative terms. Observe that
i
i
√
σ⊤Kσ =
sup
σ
sup
α
v
u
u
tm
∞
X
i=0
α(M )
i
ρ(W)i
whereupon from Eq. 31 it follows that
bR(H) ≤
v
u
u
t
1
m
∞
X
i=0
α(M )
i
ρ(W)i
(34)
(35)
for positive
(36)
(37)
as stated in Thm 2.3. This bound is not tight for general graphs, but will be for specific ex-
amples: for example, when W is proportional to the identity so the only edges are self-loops.
Nonetheless, it provides some intuition for how the learned kernel's complexity depends on
W.
As stated in the main text, Eq. 37 immediately yields generalisation bounds for learning
kernels. Again closely following Cortes et al. (2010), consider the application of binary clas-
sification where nodes are assigned a label yi = ±1. Denote by R(h) the true generalisation
error of h ∈ H,
R(h) = Pr(yh(x) < 0).
(38)
15
Preprint. Under review.
Consider a training sample S = ((xi, yi))m
i=1, and define the ρ-empirical margin loss by
bRρ(h) :=
1
m
m
X
i=1
min(1, [1 − yih(xi)/ρ]+)
(39)
where ρ > 0. For any δ > 0, with probability at least 1 − δ, the following bound holds for
any h ∈ H (Bartlett and Mendelson, 2002; Koltchinskii and Panchenko, 2002):
R(h) ≤ bRρ(h) +
2
ρ
bR(H) + 3
s
log 2
δ
2m
.
(40)
Inserting the bound on the empirical Rademacher complexity in Eq. 37, we immediately
have that
R(h) ≤ bRρ(h) +
2
ρ
v
u
u
t
1
m
∞
X
i=0
α(M )
i
ρ(W)i + 3
s
log 2
δ
2m
(41)
which shows how the generalisation error can be controlled via α(M ) or ρ(W).
A.5 Learning asymmetric f (N )
Recalling from Eq. 1 that the modulation func-
tions (f1, f2) do not necessarily need to be equal
for unbiased estimation of some kernel Kα, a
natural extension of Sec. 3.4 is to introduce two
separate neural modulation functions f (N )
1,2 and
train them both following the scheme in Sec. 3.4.
Intriguingly, even with an initialisation where
f (N )
encodes 'lazy' behaviour (deposits almost
2
all its load at the starting node – see Sec. 2) and
f (N )
is flat, upon training the neural modulation
1
functions quickly become very similar (though
not identical). See Fig. 6. We use the same opti-
misation hyperparameters and network architec-
tures as in Sec. 3.4. Rigorously proving the best
possible choice of (f1, f2), including whether e.g.
a symmetric pair is optimal, is left as an exciting
open theoretical problem.
Figure 6: Modulation functions (f1, f2)
parameterised by separate neural net-
works before and after training to target
the 2-regularised Laplacian kernel.
16
02468i0.20.40.60.81.0f(i)Learned asymmetric modulation functionsinitial f1initial f2trained f1trained f2 |
|
http://arxiv.org/abs/2310.04856v1 | "2023-10-07T15:31:38" | "2023-10-07T15:31:38" | LIPEx -- Locally Interpretable Probabilistic Explanations -- To Look
Beyond The True Class | In this work, we instantiate a novel perturbation-based multi-class
explanation framework, LIPEx (Locally Interpretable Probabilistic Explanation).
We demonstrate that LIPEx not only locally replicates the probability
distributions output by the widely used complex classification models but also
provides insight into how every feature deemed to be important affects the
prediction probability for each of the possible classes. We achieve this by
defining the explanation as a matrix obtained via regression with respect to
the Hellinger distance in the space of probability distributions. Ablation
tests on text and image data, show that LIPEx-guided removal of important
features from the data causes more change in predictions for the underlying
model than similar tests on other saliency-based or feature importance-based
XAI methods. It is also shown that compared to LIME, LIPEx is much more data
efficient in terms of the number of perturbations needed for reliable
evaluation of the explanation. | [
"Hongbo Zhu",
"Angelo Cangelosi",
"Procheta Sen",
"Anirbit Mukherjee"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04856v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04856v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
6
5
8
4
0
.
0
1
3
2
:
v
i
X
r
a
LIPEx – Locally Interpretable Probabilistic Explanations
– To Look Beyond The True Class
Hongbo Zhu∗
Manchester Centre for Robotics and A.I.
The University of Manchester, UK
Angelo Cangelosi
Manchester Centre for Robotics and A.I.
The University of Manchester, UK
Procheta Sen
Department of Computer Science
University of Liverpool, UK
Anirbit Mukherjee∗
Manchester Centre for A.I. Fundamentals
The University of Manchester, UK
hongbo.zhu@manchester.ac.uk
angelo.cangelosi@manchester.ac.uk
procheta.sen@liverpool.ac.uk
anirbit.mukherjee@manchester.ac.uk
Abstract
In this work, we instantiate a novel perturbation-based multi-class explanation framework,
LIPEx (Locally Interpretable Probabilistic Explanation). We demonstrate that LIPEx
not only locally replicates the probability distributions output by the widely used complex
classification models but also provides insight into how every feature deemed to be important
affects the prediction probability for each of the possible classes. We achieve this by defining
the explanation as a matrix obtained via regression with respect to the Hellinger distance
in the space of probability distributions. Ablation tests on text and image data, show
that LIPEx-guided removal of important features from the data causes more change in
predictions for the underlying model than similar tests on other saliency-based or feature
importance-based XAI methods. It is also shown that compared to LIME, LIPEx is much
more data efficient in terms of the number of perturbations needed for reliable evaluation
of the explanation.
1 Introduction
Recent momentum in deep learning research has made interpreting models with complex architectures very
important. In a wide range of areas where neural nets have made a successful foray, the method of "Explain-
able A.I." (XAI) has also found an important use to help understand the functioning of these novel predictors
- like in climate science (Labe & Barnes, 2021), for solving partial differential equation (Linial et al., 2023),
in high-energy physics (Neubauer & Roy, 2022), information retrieval (Lyu & Anand, 2023), in legal A.I.
(Collenette et al., 2023), etc. Most often, it has been observed that models with complex architectures
give better accuracy compared to a simple model. So, the core puzzle that XAI can be seen to solve is to
give a highly accurate local replication of a complex predictor's behaviour by a simple model over humanly
interpretable components of the data (Ribeiro et al., 2016). Towards achieving this, multiple different XAI
methods have been proposed in the recent times, e.g., LIME (Ribeiro et al., 2016), SHAP (Lundberg & Lee,
2017), Decision-Set (Lakkaraju et al., 2016), Anchor (Ribeiro et al., 2018), Smooth-GRAD (Smilkov et al.,
2017b), Poly-CAM (Englebert et al., 2022), Extremal Perturbrations (Fong et al., 2019), Saliency Maps
(Simonyan et al., 2014), etc.
One major motivation for explainability is debugging a model (Casillas et al., 2003; Dapaah & Grabowski,
2016). Towards this, an end user is interested not only in understanding the explanation provided for the
predicted class at a particular data point but also in the influence of different features for all possible class
1
likelihoods estimated by a classifier. The full spectrum of feature influence on each class at a particular data
point can help to understand how well the model has been trained to discriminate a particular class from
the rest. However, existing explanation frameworks do not provide any clue on the aforementioned issue.
To this end, we propose an explainability framework that can explain a classifier's output prediction beyond
the true class.
To obtain an explanation around a data point, a local explanation algorithm like LIME (Garreau & Luxburg,
2020) creates perturbations around it, each perturbation being represented as a Boolean vector. LIME in-
cludes a feature selection method to decide a set of important features for each class (like Algorithm A)
among which the explanation is sought. Then, an explanation vector for the complex model's prediction on
the input data is obtained by solving a penalized linear regression over the selected features corresponding
to these perturbations and the complex classifier's predictions on the data corresponding to the perturba-
tions. We posit that it is not entirely convincing that LIME attempts to regress over bounded labels, i.e.,
probabilities, using an unbounded function (i.e., a linear function) and that this would need to be called
separately for each class. Further, even if by repeated calls on each possible class we obtain an explanation
for of the classes, there is no guarantee that by these repeated evaluations, the importance of any particular
feature would be knowable for every class.
In this work, we attempt to remedy these problems by proposing a single unified framework that applies
to both text and images, which we will show in experiments to be better than various XAI methods for
both text and images. In a C−class classification task, for any data s which is represented as zs in some fs
dimensional feature space, we shall seek explanations that map into C−class probability space as,
Rfs ∋ zs ↦ Soft−Max ○ W zs
(1)
We call the W ∈ RC×fs as the "explanation matrix" – which can be obtained by minimizing some valid
distance function (like Hellinger's distance) between distributions obtained as above and the probability
distribution over classes that the complex model has been trained to map any input. Thus, we instantiate
this novel mechanism for XAI, namely LIPEx.
Note how the matrix W in Equation 1 simultaneously gives for every feature a numerical measure of its
importance for each possible class. We posit that it is important that in any explanation, it should be
evident that most features deemed to be important for the predicted class are not so for the other classes
- an idea that was recently formalized in Gupta & Arora (2020); Gupta et al. (2022) for the specific case
In our method, this property turns out to be emergent as a consequence of the more
of saliency maps.
principled definition of explanation that we start from.
Figure 1 shows an example of our matrix explanation obtained for a text document. We observe how the
explanation matrix is obtained for a specific document over a set of feature words. Note that for the first
row (the top predicted class), the top 5 feature words detected for this instance ([feel, valued, joy, treasures,
incredibly]) are distinctly different from the top features detected for the class in the second row, the one with
the second highest probability predicted by the classifier. More examples like this can be found in Appendix
D.5 and Appendix D.6 particularly focuses on examples where the predicted class and the true class are
different. It is observed that there always arises a natural discrimination between features important for the
different classes.
In the following, we summarize our contributions towards formalizing this idea of matrix-based explanations
that match the distribution over classes predicted by a complex model.
Novel Explanation Framework In Section 3, we formally state our explanation approach, which can
extract the relative importance of a set of features for every class under consideration beyond the true class.
In the following tests, we demonstrate how such a multi-class explanation framework can be more useful for
model understanding compared to existing state-of-the-art XAI methods.
(Test 1) Evidence of LIPEx Replicating the Complex Model's Predicted Distribution Over
Classes
In Figure 2, we calculate the Total Variation (TV) distance of the output distribution of the
obtained LIPEx explainer and the distribution output by the complex model for the same data and we show
2
Figure 1: Example of comparison of explanation matrix obtained by LIPEx and the bar chart obtained by
LIME on a text data from the Emotion dataset. For the LIPEx matrix, the class names on the left side are
arranged in descending order of the predicted class probabilities. Examples of LIPEx explanation on image
data is provided in Appendix D.3.
that over hundreds of randomly chosen test instances, the distance is overwhelmingly near 0. We show that
this very necessary property holds over multiple models over text as well as images.
(Test 2) Sanity Check of LIPEx's Sensitivity to Model Distortion In Figure 3 we distort a well-
trained complex model by adding mean zero noise to the parameters in the last layer and measure how
upon increasing the noise variance, the output probability distribution moves away in TV distance from
the original prediction. We show that when LIPEx is implemented on the distorted models, our explainer's
predicted distribution moves away from its original value almost identically. This sanity check is inspired by
the arguments in Adebayo et al. (2018).
The above two tests give robust evidence that, indeed LIPEx is an accurate local approximator of the complex
model while being dramatically simpler than the black-box predictor. To the best of our knowledge, such
a strong model replication property is not known to be true for even the saliency methods, which can in-
principle be called on different classes separately to get the relative importance among the different pixels
for each class - albeit separately.
(Test 3) Evidence of Changes in the Complex Model's Prediction Under LIPEx Guided Data
Distortion In Table 1 and 2, we demonstrate an ablation study guided by the "faithfulness" criteria as
outlined in Atanasova et al. (2020). We establish that the top features detected by LIPEx are more important
for the complex model than those detected by other XAI methods. We show this by demonstrating that
when the top features are removed from the data and inference is done on this damaged data, then the new
predicted class differs more from the original prediction when the removal is guided by what LIPEx deemed
to be important than other XAI methods.
(Test 4) Evidence of LIPEx Replicating the Complex Model's Class Prediction Under LIPEx
Guided Data Distortion In Table 3, we demonstrate that for an overwhelming majority of data, upon
removing their features deemed important by LIPEx, the new class predicted by the complex predictor is
reproduced by the LIPEx model when presented with the same distorted data.
(Test 5) Stability of LIPEx to Choosing Less and Only Near-Truth Perturbations
In Figure 4,
we demonstrate experiments that the features picked out by the LIPEx matrix are largely stable when the
matrix is derived using only a few perturbation instances. We also show that this property is not true for
LIME in the models we consider. Thus LIPEx is demonstrably more data efficient.
3
To put the above in context we recall that estimates were given in Agarwal et al. (2021) for how many
perturbations around the true data are sufficient for LIME to produce reliable results - and this experiment
of ours can be seen to corroborate that. Also, we recall that in works like Slack et al. (2020) it was pointed
out that LIME's reliance on perturbations far from the true data creates a vulnerability that can be exploited
to create adversarial attacks.
Note that we have restricted our attention to "intrinsic evaluations" of explanations, i.e., we only use calls
to the model as a black-box for deciding whether the explanations obtained are meaningful as opposed
to looking for external human evaluation. Both text and image data were used to evaluate our proposed
approach. For text-based experiments we used 20Newsgroup 1 and Emotion 2 datasets. For image-based
experiments, we have used the Imagenette3 dataset with segments detected by "segment anything" 4.
Among the above experiments, LIPEx was compared against a wide range of state-of-the-art explanation
methods for both text and image data, i.e., LIME (Ribeiro et al., 2016), Guided Backpropagation (Springen-
berg et al., 2014), Vanilla Gradients (Erhan et al., 2009), Integrated Gradients (Sundararajan et al., 2017),
Deeplift (Shrikumar et al., 2016), Occlusion (Zeiler & Fergus, 2014), XRAI (Kapishnikov et al., 2019), Grad-
CAM (Selvaraju et al., 2017), GuidedIG (Kapishnikov et al., 2021), BlurIG (Xu et al., 2020) and SmoothGrad
(Smilkov et al., 2017a).
Organization In Section 2 we briefly overview related works in XAI. In Section 3 we give the precise
loss function formalism for obtaining our explanation matrix, and in Section 4 all the tests will be given -
comparing the relative benefits to other XAI methods. We conclude in Section 5. Appendices contain various
details such as the precise pseudocode used in Section 4 (in Appendix C), the hyperparameter settings (in
Appendix B), and further experimental data is given in Appendix D.
2 Related Work
The work in Letham et al. (2015) is one of the first works that attempted to develop a classifier using rules
and Bayesian analysis. In Ribeiro et al. (2016) a first attempt was made to describe explainability formally.
The explanation can be made through an external explainer module, or a model can also be attempted to be
made inherently explainable (Chattopadhyay et al., 2023). Post-hoc explainer strategy, as is the focus here,
can be of different types, like (a) Ribeiro et al. (2016); Lundberg & Lee (2017) estimate feature importance
for predicting a particular output, (b) counterfactual explanations (Wachter et al. (2017); Ustun et al. (2019);
Rawal & Lakkaraju (2020)) determine if a feature x was present in the input, then would the model have
predicted output y, (c) contrastive approaches (Jacovi et al., 2021) describe why an ML model has predicted
a particular output instead of another, or (d) Weinberger et al. (2023) and Crabbé & van der Schaar (2022)
have recently proposed new XAI methods tuned to the case of unsupervised learning.
In this work, we
specifically focus on feature importance-based explanation techniques.
Feature Importance-based Explanations The study in Ribeiro et al. (2016) initiated the LIME frame-
work which we reviewed in Section 1 as our primary point of motivation. Similarly, the work in Lundberg &
Lee (2017) used a statistical sampling approach ("SHAP") to explain a classifier model in terms of human
interpretable features. Lakkaraju et al. (2016) proposed a decision set-based approach to train a classifier
that can be interpretable and accurate simultaneously - where a set of independent if-then rules defines a
decision set. Ribeiro et al. (2018) proposed an anchor-based approach for explanation - where anchors were
defined as a set of sufficient conditions for a particular local prediction.
Evaluation is a critical component in any explanation framework. The study in Doshi-Velez & Kim (2017)
described important characteristics for the evaluation of explanation approaches. Evaluation criteria for
explanations can broadly be categorized into two types, (a) criteria which measure how well the explainer
module is able to mimic the original classifier and (b) criteria which measure the trustworthiness of the
features provided by the explainer module, like the work in Qi et al. (2019) demonstrated the change in
1http://qwone.com/~jason/20Newsgroups/
2https://huggingface.co/datasets/dair-ai/emotion
3https://github.com/fastai/imagenette
4https://segment-anything.com/
4
the prediction probability of a classifier with the removal of top K features predicted by a saliency map
explainer.
We note that in this work our tests done in Section 4 encompass both the above kinds of criteria.
Lastly, we note that in Sokol & Flach (2020) a tree based explanation was attempted which could directly
work in the multiclass setting but to be able to compete LIME their method's computation cost can need
to scale with the number of segments in an image. Also, in sharp contrast to our LIPEx proposal, it does
not have the critical ability to explain/reproduce the predicted distribution of the given complex model.
3 Our Setup
Let C ∈ {1, 2, 3, . . .} be the number of classes in the classification setup. Given any probability vector
C
C, ∑
i=1 pi = 1, & pi ≥ 0, ∀i, we succinctly represent p as being a member of the simplex in
p ∈ [0, 1]
C−dimensions as p ∈ ∆C.
Classifier Setup We aim to explain a classifier which can be described as a neural network fNN (parame-
terized by weight w) composed with a layer of soft-max so that the output of the composition is a probability
distribution over the C−classes. Thus we define the composed mapping,
→ ∆C, x ↦ Soft−Max ○ fNN(x)
fw ∶ Rd
(2)
This composed function fw in Equation 2 commonly would have been trained via the cross-entropy loss on
a C class labelled data - and we assume only black-box access to it.
The Feature Space for Explanations For a specific data s (e.g., a piece of text), we denote the number
of unique features (e.g., words) as ∣s∣ and assume that there is a selected 'feature space' with fs features.
Suppose special subsets of them, say S(s) and Sf (s) have been chosen and there is a map, say Select which
does the feature selection for each of its domain points as per say Algorithm A.
S(s) ⊂ R∣s∣, Sf (s) ⊂ Rfs & Select ∶ S(s) → Sf (s)
(3)
The Local Explanation Matrix We explain fw's behaviour around s by a 'pseudo-linear model', gs,W
which is defined as,
gs,W ∶ Sf (s) → ∆C, z′
↦ Soft−Max ○ W z′
(4)
with W ∈ RC×fs being the "explanation matrix".
∣s∣ i.e. Boolean vectors are used to represent random
In the LIME setup (as well as in LIPEx), S(s) ⊆ {0, 1}
ways of dropping one or more of the (unique) words for text data and pixels for image data. Hence, in such
setups, the original input instance is represented as an all-ones vector, 1s ∈ R∣s∣.
We assume that there is a pre-chosen function (say Ts) that maps "perturbations" of the data contained
in the set S(s) to some d−dimensional embedding (like the BERT embeddings) which can be input to the
original prediction model (Equation 2).
Ts ∶ S(s) → Rd
(5)
Also note that the input dimensions d of fw and fs for gs,W could be very different and dependent on s and
typically, fs ⋘ d. Eg., in standard LIME implementations for a classifier one often chooses fs = 6 important
features of the text s.
The space of all probability distributions admits various natural metrics and Hellinger distance has previously
been used for feature selection in classification (Fu et al., 2020). Hellinger distance between two discrete
distributions p, q (on a set of C possible classes) is given as,
H(p, q) ∶=
1
√
2
⋅
¿
`
`(cid:192) ∑
c ∈ C
√
(
p(c) −
√
q(c))
2
5
Apart from being an intuitive symmetric measure, squared Hellinger distance also offers other attractive
features of being sub-additive, smaller than half of the KL divergence and always being within a quadratic
factor of the Total Variation (TV) distance. (Canonne, 2020)5
S(s) ⊂ S(s)(⊆ {0, 1}
Let ̃
∣s∣
) be a randomly sampled set of perturbations to be used for training. Passing it
through the Select map (Equation 3) we obtain ̃
Sf (s) ⊂ Sf (s)(⊂ Rfs) which are the feature representations
of the perturbations. We posit that the outputs of the Select map would determine what the explainer gs,W
in Equation 4 acts on. Further noting that the output of the embedding map Ts in Equation 5 determines
what the true predictor fw gets as input, we consider the following empirical risk function corresponding to
a distance function π in R∣s∣,
LH(gs,W , ̃
ˆ
S(s)) =
1
̃
S(s)∣
∣
∑
x∈ ̃S(s)
π(1s, x) ⋅ H2
(gs,W ○ Select(x), fw ○ Ts(x)) +
λ
2 ⋅ ∥W ∥
2
F
(6)
x⊺1s
where 1s, the all-ones vector in R∣s∣. We choose π(1s, x) = 1−
∣∣x∣∣⋅∣∣1s∣∣ for all our experiments. It is immediately
interpretable that Equation 6 takes a π−weighted empirical average of the Hellinger distance squared between
the true distribution over classes predicted by the complex classifier fw and the distribution predicted by the
explainer gs,W while the λ−term penalizes for using high weight explainers and hence promotes simplicity
of gs,W .
Intuition for Good LIPEx Minima for Text Classifiers Being a ReLU Net For intuition, consider
explaining classification predictions by a ReLU net on a text data s with ∣s∣ unique words. Further suppose
the classifier has been trained to accept d(≥ ∣s∣) word length texts in their TF-IDF representation. Thus
the Ts map (Equation 5) that lifts the perturbations of s to the input space of the complex classifier can
be imagined as a tall matrix of dimensions d × ∣s∣ whose top ∣s∣ × ∣s∣ block is a diagonal matrix giving the
TF-IDF values for the words in this text and the rest of the matrix being zeros. Also, we note that the Select
function can be imagined as a linear projection of the Boolean-represented perturbations into the subset of
important features.
Further, any ReLU neural net is a continuous piecewise linear function Arora et al. (2018). Hence, except at
the measure zero set of non-differentiable points, the function fNN (Equation 2) is locally a linear function.
Thus, for almost every input z ∈ Rd there exists a (possibly small) neighbourhood of it where fNN = Wnet for
some matrix Wnet ∈ RC×d. It would be natural to expect that most true texts are not at the non-differentiable
points of the net's domain and that Ts maps small perturbations of the data into a small neighbourhood.
Hence, for many perturbations x ∈ R∣s∣, fw(Ts(x)), as it occurs in the loss in Equation 6, is a Soft-Max
of a linear transformation (composition of the net and the Ts map) of x. Recall that this is exactly the
functional form of the explainer gs,W (Equation 4) given that the Select function can be represented as a
linear map! Thus, we see that there is a very definitive motivation for this loss function to yield good locally
linear explanations for ReLU nets classifying text.
4 Results
At the very outset, we note the following salient points about our setup. Firstly, that for any data s (say a
piece of text or an image), when implementing LIPEx on it, we generate a set of 1000 perturbations of input
instances. Then we chose features by taking a union set over the top-3 features of each possible class, which
was returned by the "forward feature selection" method (reproduced in Algorithm A) called on the above
perturbation data set. We recall that this feature selection algorithm is standard in LIME implementations6.
Suppose this union has fs features - then for all computations to follow for s we always stick with these fs
features for LIPEx (and also always call LIME on fs number of features in comparison experiments).
Secondly, we note that for the matrix returned by LIPEx (i.e. W in Equation 4) we shall define its "top−k"
features as the features/columns of the matrix which give the k−highest entries by absolute value for the
predicted class of that data.
5Our experiments were tried with TV and they underperformed compared to the squared Hellinger metric.
6https://github.com/marcotcr/lime
6
Figure 2: Histogram (over random data sampling) of the TV Distance between the probability distribution
over classes as predicted by the complex black-box classifier and that obtained by LIPEx.
Reproducing the Distribution over Classes of the Complex Classifier A key motivation for in-
troducing the LIPEx framework was the need for the explanation framework to produce class distributions
closely resembling those of the original classifier. Therefore, our initial emphasis is on investigating how
much in Total Variation (TV) distance, the distribution over classes predicted by the obtained explainer is
away from the one predicted for the same data by the complex model needing explanations. In Figure 2, we
show the statistics of this TV distance for expeiments on both text (i.e. BERT on 20Newsgroups and BERT
on Emotion) and image data (i.e. VGG16 and InceptionV3 on Imagenette). Figure 2 clearly shows that the
distribution is highly skewed towards 0 over five hundred randomly sampled data over multiple modalities
and state-of-the-art models. Note that the LIPEx loss (Equation 6) never directly optimized for the TV gap
to be small and hence we posit that this is a strong test of performance that LIPEx passes.
LIPEx Tracks Distortions of The Complex Model's Output Distribution This sanity check ex-
periment is inspired by the studies in Adebayo et al. (2018). Here, we add mean-zero Gaussian noise to the
trained complex model's last-layer weights and keep dialling up the noise variance till the model's accuracy
is heavily damaged. At each noise level we compute the average over randomly sampled data, of the Total
Variation distance between the output distribution of the damaged model and its original value and the same
for the LIPEx's distribution for that model at respective inputs. We do text experiments with BERT on the
Emotion dataset and image experiments with VGG16 on the Imagenette dataset. In Figure 3, for any specific
data, LIPEx−Output is the LIPEx's output distribution for the original model, LIPEx(σ)−Output is the
LIPEx's output distribution for the distorted model at noise variance σ. BERT−Output, BERT(σ)−Output,
VGG16−Output and VGG16(σ)−Output are defined similarly.
The right column of plots in Figure 3 demonstrates that as the model distorts, LIPEx's output moves away
from the original in a remarkably identical fashion as the distorted model's output changes with respect to
its original value.
Importance of Top-K Features Detected by LIPEx A test of the correctness of determining any
set of features to be important by an explanation method is that upon their removal from the original data
and on presenting this modified/damaged input to the complex classification model it should produce a new
predicted class than originally. We implement this test with text data in Table 1 and with image data in
7
Figure 3: In the left image, we see how the model accuracy drops upon adding noise to the last layer weights
and bias, a mean 0 Gaussian noise at different variances. This demonstrates that the maximum added noise
is sufficient to distort the model highly. On right, we see how the data averaged TV distance between the
output distribution of LIPEx for the data at the original complex model and the noise-distorted complex
model tracks the same change in the complex model's output.
BERT
20NewsGroups
Model & Dataset Top-K LIPEx LIME GuidedBack Saliency InputXGrad Deeplift Occlusion
0.387
0.477
0.517
0.517
0.553
0.597
0.61
0.637
0.623
0.63
0.777
0.841
0.856
0.881
0.912
0.653
0.697
0.647
0.64
0.65
0.781
0.857
0.897
0.909
0.908
0.657
0.74
0.73
0.73
0.793
0.387
0.477
0.517
0.517
0.553
0.597
0.61
0.637
0.623
0.63
0.45
0.543
0.59
0.627
0.653
0.65
0.66
0.697
0.697
0.693
0.38
0.48
0.52
0.523
0.57
0.6
0.63
0.653
0.643
0.64
0.38
0.48
0.52
0.523
0.57
0.6
0.62
0.637
0.633
0.637
K=1
K=2
K=3
K=4
K=5
K=1
K=2
K=3
K=4
K=5
BERT
Emotion
Table 1: Here, features refer to words. Upon removing top-K words detected by each of the XAI methods
and doing re-prediction, we report the fraction of data on which the predicted class changes. We see that
the words removed by LIPEx guidance more significantly impact the model's prediction than when guided
by the other XAI methods. The complete experimental data with standard deviations can be seen in Table
6 in the appendix.
Table 2. We demonstrate that when the top features detected by LIPEx are removed from the data, the
original model's predicted class changes substantially more than when the same is measured for many other
XAI methods for the predicted class - and the amount of change is proportional to the number of top features
removed. 7
LIPEx Reproduces the Complex Model's Class Predictions Under LIPEx Guided Data Damage
We posit that for a multi-class explainer as LIPEx, it is a very desirable sanity check that it should reproduce
the underlying model's (new) predicted classes on the input when its top features are removed. In Table 3,
7We use the code in Atanasova et al. (2020) to implement the gradient-based methods in Table 1, and the package https:
//github.com/PAIR-code/saliency to implement the saliency methods in Table 2.
8
Model & Dataset Top-K LIPEx LIME XRAI GradCAM GuidedIG BlurIG VanillaGrad SmoothGrad
VGG16
Imagenetee
InceptionV3
Imagenette
K= 2
K= 3
K= 4
K= 2
K= 3
K= 4
0.763
0.82
0.867
0.673
0.753
0.773
0.74
0.78
0.793
0.63
0.713
0.767
0.713
0.77
0.793
0.693
0.7
0.74
0.69
0.763
0.79
0.653
0.697
0.72
0.717
0.75
0.793
0.663
0.67
0.713
0.713
0.787
0.807
0.647
0.703
0.717
0.68
0.753
0.807
0.657
0.653
0.72
0.747
0.817
0.843
0.65
0.683
0.74
IG
0.703
0.747
0.773
0.637
0.707
0.733
Table 2: Here, features refer to image segments which were gotten by Segment Anything. LIPEx and LIME
can be used to directly get a weight for each segment while for the saliency-based methods a segment's
importance is determined as the sum of the weights assigned to its pixels. In the table above we can see
that the fraction of data on which label prediction changes under deletion of top features detected by LIPEx
is consistently higher than for other XAI methods. The complete experimental data with the standard
deviation can be found in the Table 7 in the appendix.
Model & Dataset
BERT (20Newsgroups)
BERT (Emotion)
VGG16(Imagenette)
InceptionV3 (Imagenette)
Modality
Text
Text
Image
Image
Top1
0.90 (±0.041)
0.89(±0.022)
0.80(±0.046)
0.90(±0.051)
Top2
0.85(±0.024)
0.84(±0.025)
0.73(±0.034)
0.78(±0.044)
Top3
0.79(±0.039)
0.84(±0.017)
0.73(±0.034)
0.75(±0.015)
Top4
0.71(±0.033)
0.82(±0.037)
0.73(±0.025)
0.74(±0.013)
Top5
0.70(±0.005)
0.74(±0.033)
0.70(±0.075)
0.69(±0.035)
Table 3: In this table, for each model and data combination, we give the fraction of data (over 100 random
samples) over which the new class predicted by the complex model matches the new prediction by the LIPEx
for the same model, upon removing from the data its top features as determined by LIPEx. We can observe
that post this distortion on the data, the class labels from the complex model match those from the simple
explainer for a significant majority of the instances.
we show with text as well as image data, that this class prediction matching holds for the LIPEx explainer
for an overwhelming majority of data.
Evidence for Data Efficiency of LIPEx as Compared to LIME Since LIPEx and LIME, both are
perturbation based methods, a natural question arises if LIPEx is more data-efficient, or in other words can
its top features detected be stable if only a few perturbations close to the true data are allowed. In this test,
we show that not only is this true, but also that (a) LIPEx's top features can at times even remain largely
invariant to reducing the perturbations and also that (b) the difference with respect to LIME in the list of
top features detected, is maintained when the allowed set of perturbations are increasingly constrained to be
few and near the true data. Our comparison method is specified precisely as Algorithm C in the Appendix
and we sketch it here as follows.
When in the setting with unrestricted perturbations, we infer two lists of top features, one from the row of
the predicted class of the matrix (i.e. W ) returned by LIPEx and another from LIME's weight vector for
the same class - say LIPEx−List−s and LIME−List−s respectively. Next, we parameterize the restriction on
the allowed perturbations by the maximum angle δ that any Boolean vector representing the perturbation
is allowed to subtend with respect to the all-ones vector that represents the input data.
We use the default set of perturbations in a LIME implementation as a baseline 8 and at different δ, we use
only the δ−restricted subset of the perturbations to compute (for the model predicted class) the top features
returned by the LIPEx matrix and the LIME, say δ−LIPEx−List−s and δ−LIME−List−s respectively. For
quantifying the dissimilarities between these lists of top features measured by the two methods, we compute
the following Jaccard indices and average the results on 100 randomly chosen instances.
8In the LIME code https://github.com/marcotcr/lime, the authors choose 5000 perturbations for any text data and 1000
for any image data.
9
Js,δ,LIME ∶= ∣
δ−LIME−List−s ∩ LIME−List−s
δ−LIME−List−s ∪ LIME−List−s ∣, Js,δ,LIPEx ∶= ∣
δ−LIPEx−List−s ∩ LIPEx−List−s
δ−LIPEx−List−s ∪ LIPEx−List−s ∣
Js,δ−LIPEx−vs−LIME ∶= ∣
δ−LIPEx−List−s ∩ LIME−List−s
δ−LIPEx−List−s ∪ LIME−List−s ∣
It can be observed that Js,δ,LIPEx (the orange line) is very stable compared to that of LIME
Figure 4:
despite the allowed perturbations being made constrained. The difference in LIPEx's features w.r.t LIME is
also maintained. The number of points considered at different δ is given in Table 5 in the appendix.
From Figure 4, we can infer that at all levels of constraint on the data at least 50% of the top features
detected by our LIPEx are different from LIME. Secondly, Js,δ,LIME (averaged) rapidly falls as the number
of training data allowed near the input instance is decreased. Thus its vividly revealed that the features
detected by LIME are significantly influenced by those perturbations that are very far from the true text.
Lastly, and most interestingly, we note that the curve for Js,δ,LIPEx (the top orange line) is very stable to
using only a few perturbations which subtend a low angle with the true text. Hence the top features detected
by our explanation matrix are not only important (as demonstrated in the previous two experiments) – but
can also be computed very data efficiently.
5 Conclusion
In this work, we proposed a novel explainability framework, LIPEx, that when implemented in a classification
setting, in a single training gives a weight assignment for all the possible classes for an input with respect to
a chosen set of features. Unlike other XAI methods, it is designed to locally approximate the probabilities
assigned to the different classes by the complex model - and this was shown to bear out in experiments
over text and images - and it withstood ablation tests. Our experiments, showed that the LIPEx proposal
provides more trustworthy and data-efficient explanations compared to multiple other competing methods
across various data modalities.
We note that our XAI loss, Equation 6, can be naturally generalized to other probability metrics like the
KL divergence. Our studies strongly motivate novel future directions about not only exploring the relative
performances between these options but also about obtaining guarantees on the quality of the minima of
such novel loss functions.
10
References
Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks
for saliency maps. Advances in neural information processing systems, 31, 2018.
Sushant Agarwal, Shahin Jabbari, Chirag Agarwal, Sohini Upadhyay, Steven Wu, and Himabindu Lakkaraju.
Towards the unification and robustness of perturbation and gradient based explanations. In International
Conference on Machine Learning, pp. 110–119. PMLR, 2021.
Raman Arora, Amitabh Basu, Poorya Mianjy, and Mukherjee, Anirbit. Understanding Deep Neural
Networks with Rectified Linear Units. In I.C.L.R., 2018.
Pepa Atanasova, Jakob Grue Simonsen, Christina Lioma, and Isabelle Augenstein. A diagnostic study
of explainability techniques for text classification. In Proceedings of the 2020 Conference on Empirical
Methods in Natural Language Processing (EMNLP), pp. 3256–3274, Online, November 2020. Association
for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.263. URL https://aclanthology.
org/2020.emnlp-main.263.
Clément L. Canonne. A short note on learning discrete distributions, 2020.
Jorge Casillas, Oscar Cordon, Francisco Herrera, and Luis Magdalena. Accuracy Improvements in Linguistic
Fuzzy Modeling. 01 2003. ISBN 978-3-642-05703-8. doi: 10.1007/978-3-540-37058-1.
Aditya Chattopadhyay, Kwan Ho Ryan Chan, Benjamin D Haeffele, Donald Geman, and René Vidal. Vari-
ational information pursuit for interpretable predictions. arXiv preprint arXiv:2302.02876, 2023.
Joe Collenette, Katie Atkinson, and Trevor Bench-Capon. Explainable ai tools for legal reasoning about
cases: A study on the european court of human rights. Artificial Intelligence, 317:103861, 2023.
Jonathan Crabbé and Mihaela van der Schaar. Label-free explainability for unsupervised models. In Kamalika
Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato (eds.), International
Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162
of Proceedings of Machine Learning Research, pp. 4391–4420. PMLR, 2022. URL https://proceedings.
mlr.press/v162/crabbe22a.html.
Emmanuel Charleson Dapaah and Jens Grabowski. Debugging machine learning models. 2016.
Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning, 2017.
Alexandre Englebert, Olivier Cornu, and Christophe De Vleeschouwer. Poly-CAM: High resolution class
activation map for convolutional neural networks, 2022. URL https://openreview.net/forum?id=
qnm-2v-baW.
Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a
deep network. University of Montreal, 1341(3):1, 2009.
Ruth Fong, Mandela Patrick, and Andrea Vedaldi. Understanding deep networks via extremal perturbations
and smooth masks. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2950–
2958, 2019. doi: 10.1109/ICCV.2019.00304.
Guang-Hui Fu, Yuan-Jiao Wu, Min-Jie Zong, and Jianxin Pan. Hellinger distance-based stable sparse feature
selection for high-dimensional class-imbalanced data. BMC bioinformatics, 21(1):1–14, 2020.
Damien Garreau and Ulrike Luxburg. Explaining the explainer: A first theoretical analysis of lime.
In
International conference on artificial intelligence and statistics, pp. 1287–1296. PMLR, 2020.
Arushi Gupta and Sanjeev Arora. A simple technique to enable saliency methods to pass the sanity checks,
2020. URL https://openreview.net/forum?id=BJeGZxrFvS.
11
Arushi Gupta, Nikunj Saunshi, Dingli Yu, Kaifeng Lyu, and Sanjeev Arora. New definitions and evaluations
for saliency methods: Staying intrinsic, complete and sound.
In S. Koyejo, S. Mohamed, A. Agarwal,
D. Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems, volume 35,
pp. 33120–33133. Curran Associates, Inc., 2022. URL https://proceedings.neurips.cc/paper_files/
paper/2022/file/d6383e7643415842b48a5077a1b09c98-Paper-Conference.pdf.
Alon Jacovi, Swabha Swayamdipta, Shauli Ravfogel, Yanai Elazar, Yejin Choi, and Yoav Goldberg. Con-
trastive explanations for model interpretability, 2021.
Andrei Kapishnikov, Tolga Bolukbasi, Fernanda Viégas, and Michael Terry. Xrai: Better attributions through
regions. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4948–4957,
2019.
Andrei Kapishnikov, Subhashini Venugopalan, Besim Avci, Ben Wedin, Michael Terry, and Tolga Boluk-
basi. Guided integrated gradients: An adaptive path method for removing noise. In Proceedings of the
IEEE/CVF conference on computer vision and pattern recognition, pp. 5050–5058, 2021.
Zachary Labe and Elizabeth Barnes. Detecting climate signals using explainable ai with single-forcing large
ensembles. 04 2021. doi: 10.1002/essoar.10505762.2.
Himabindu Lakkaraju, Stephen H. Bach, and Jure Leskovec. Interpretable decision sets: A joint framework
for description and prediction. In Proceedings of the 22nd ACM SIGKDD International Conference on
Knowledge Discovery and Data Mining, KDD '16, pp. 1675–1684, New York, NY, USA, 2016. Association
for Computing Machinery. ISBN 9781450342322. doi: 10.1145/2939672.2939874. URL https://doi.org/
10.1145/2939672.2939874.
Benjamin Letham, Cynthia Rudin, Tyler H. McCormick, and David Madigan. Interpretable classifiers using
rules and Bayesian analysis: Building a better stroke prediction model. The Annals of Applied Statistics,
9(3):1350 – 1371, 2015.
Ori Linial, Orly Avner, and Dotan Di Castro. Pdexplain: Contextual modeling of pdes in the wild, 2023.
Scott M. Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Proceedings
of the 31st International Conference on Neural Information Processing Systems, NIPS'17, pp. 4768–4777,
Red Hook, NY, USA, 2017. Curran Associates Inc.
Lijun Lyu and Avishek Anand. Listwise explanations for ranking models using multiple explainers. In Jaap
Kamps, Lorraine Goeuriot, Fabio Crestani, Maria Maistro, Hideo Joho, Brian Davis, Cathal Gurrin, Udo
Kruschwitz, and Annalina Caputo (eds.), Advances in Information Retrieval - 45th European Conference
on Information Retrieval, ECIR 2023, Dublin, Ireland, April 2-6, 2023, Proceedings, Part I, volume 13980
of Lecture Notes in Computer Science, pp. 653–668. Springer, 2023.
Mark S. Neubauer and Avik Roy. Explainable ai for high energy physics, 2022.
Zhongang Qi, Saeed Khorram, and Fuxin Li. Visualizing deep networks by optimizing with integrated
gradients, 05 2019.
Kaivalya Rawal and Himabindu Lakkaraju. Beyond individualized recourse: Interpretable and interactive
summaries of actionable recourses. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin
(eds.), Advances in Neural Information Processing Systems, volume 33, pp. 12187–12198. Curran Asso-
ciates, Inc., 2020.
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should i trust you?" explaining the predictions
of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery
and data mining, pp. 1135–1144, 2016.
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Anchors: High-precision model-agnostic explana-
tions. AAAI'18/IAAI'18/EAAI'18. AAAI Press, 2018.
12
Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and
Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization.
In
Proceedings of the IEEE international conference on computer vision, pp. 618–626, 2017.
Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning
important features through propagating activation differences. arXiv preprint arXiv:1605.01713, 2016.
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising
image classification models and saliency maps, 2014.
Dylan Slack, Sophie Hilgard, Emily Jia, Sameer Singh, and Himabindu Lakkaraju. Fooling lime and shap:
Adversarial attacks on post hoc explanation methods. In Proceedings of the AAAI/ACM Conference on
AI, Ethics, and Society, AIES '20, pp. 180–186, New York, NY, USA, 2020. Association for Computing
Machinery.
Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. Smoothgrad: removing
noise by adding noise. arXiv preprint arXiv:1706.03825, 2017a.
Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. Smoothgrad: removing
noise by adding noise. 06 2017b.
Kacper Sokol and Peter Flach. Limetree: Consistent and faithful surrogate explanations of multiple classes.
arXiv preprint arXiv:2005.01427, 2020.
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity:
The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In International
conference on machine learning, pp. 3319–3328. PMLR, 2017.
Berk Ustun, Alexander Spangher, and Yang Liu. Actionable recourse in linear classification. In Proceedings
of the Conference on Fairness, Accountability, and Transparency, FAT* '19, pp. 10–19, New York, NY,
USA, 2019. Association for Computing Machinery. ISBN 9781450361255.
Sandra Wachter, Brent D. Mittelstadt, and Chris Russell. Counterfactual explanations without opening the
black box: Automated decisions and the GDPR. CoRR, abs/1711.00399, 2017.
Ethan Weinberger, Chris Lin, and Su-In Lee. Isolating salient variations of interest in single-cell data with
contrastivevi. Nature Methods, pp. 1–10, 2023.
Shawn Xu, Subhashini Venugopalan, and Mukund Sundararajan. Attribution in scale and space. In Proceed-
ings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9680–9689, 2020.
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Computer
Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings,
Part I 13, pp. 818–833. Springer, 2014.
13
A Feature Selection
Algorithm 1 Forward feature selection
Require: data X, target Y , number of features k
1:
2:
Ensure: set of indices of the selected features Sel_feats
3: Sel_feats ← {}
4: for y in Y do
5:
6:
7:
▷ X ∈ R#Perturbations×#Unique−Words
▷ Y ∈ R#Perturbations×#Num−Classes
▷ y ∈ R#Perturbations×1
f ← initialize selection model of Ridge regression
Current_sel_feats ← {}
All_feats ← {1, 2, .., len(X[0])}
for i ← 1 to k do
best_idx ← 0
best_score ← −∞
for j ∈ (All_feats ∖ Sel_feats) do
f ← f.fit(X[∶, Sel_feats ∪ {j}], y)
▷ f.fit() is used to train f, where the loss function is the linear least squares with l2-norm.
score ← evaluate f with performance metric of R2
if score > best_score then
▷ len(X[0]) =Number Of Unique Words in X
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
best_idx ← j
best_score ← score
end if
19:
20:
21:
22:
23: end for
24: return Sel_feats
end for
Current_sel_feats ← Current_sel_feats ∪ {best_idx}
end for
Sel_feats ← Sel_feats ∪ Current_sel_feats
B LIPEx Hyperparameter Settings
Hyperparameter search was conducted over a small set of randomly selected data of each of the types
mentioned below to decide on the following choices.
Learning rate
0.01
λ
0.001
Batch size
128
Table 4: LIPEx Hyperparameter Settings
Note that λ in above refers to the regularizer in the loss in equation 6.
14
C Pseudocode for the Quantitative Comparison Between LIPEx and LIME's
Detected Important Features (as given in Section 4)
Algorithm 2 LIME vs LIPEx w.r.t Angular Spread of the Perturbations About The True Data
Require: k = number of top features to be used for comparing LIME and LIPEx
Require: A set S of randomly sampled class labelled data at which the comparison is to be done
Require: f ∗
Require: δ−List of all the angular deviations about the true data at which the LIPEx vs LIME comparison
= the trained predictor that needs explanations.
is to be done
1: for s ∈ S do
2:
Compute LIPEx−List−s = top-k features of s w.r.t its predicted class, as detected by the LIPEx
matrix using the standard set of Boolean vectors/perturbations w.r.t the all-ones representation of s.
Compute LIME−List−s = top-k features of s w.r.t its predicted class, as detected by LIME using the
standard set of Boolean vectors/perturbations w.r.t the all-ones representation of s - on the same set of
features as used in the previous step.
▷ Note that the above two lists of "important" features do not depend on δ,
▷ We shall use both as reference lists for the different comparisons to follow.
▷ The list of features used above will be held fixed in the computations below.
for δ ∈ δ − List do
Compute δ−LIPEx−List−s = top-k features of s w.r.t its predicted class, as detected by the LIPEx
matrix using only those Boolean vectors/perturbations which are within an angle of δ w.r.t the all-ones
representation of s.
Compute δ−LIME−List−s = top-k features of s w.r.t its predicted class, as detected by LIME using
only those Boolean vectors/perturbations which are within an angle of δ w.r.t the all-ones representation
of s
Compute the Jaccard Index, Js,δ−LIPEx−vs−LIME ∶= ∣
Compute the Jaccard Index, Js,δ,LIME ∶= ∣
Compute the Jaccard Index, Js,δ,LIPEx ∶= ∣
δ−LIME−List−s ∩ LIME−List−s
δ−LIME−List−s ∪ LIME−List−s ∣
δ−LIPEx−List−s ∩ LIPEx−List−s
δ−LIPEx−List−s ∪ LIPEx−List−s ∣
δ−LIPEx−List−s ∩ LIME−List−s
δ−LIPEx−List−s ∪ LIME−List−s ∣
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
end for
13:
14:
15: end for
1
∣S∣ ⋅ ∑s∈S Js,δ−LIPEx−vs−LIME) vs δ
16: Plot (
1
17: Plot (
∣S∣ ⋅ ∑s∈S Js,δ,LIME) vs δ
1
∣S∣ ⋅ ∑s∈S Js,δ,LIPEx) vs δ
18: Plot (
15
D Additional Experiments
D.1 δ effect on Jaccard experiment
For Text data
δ (radians)
number of perturbation points
π
16
138
For Image data
δ (radians)
number of perturbation points
7π
30
228
π
8
659
8π
30
774
π
4
2383
9π
30
994
π
2
5000
10π
30
1000
Table 5: The effect of δ on the number of perturbation points, result averaged on 100 input instances.
Note that when δ decreases, while the amount of allowed perturbations falls, the similarity measure π in
equation 6 increases.
D.2 Additional Data for the Demonstration in Figure 1
Figure 5: Comparison of the progress of training on the Hellinger distance based LIPEx loss, as given in
equation 6, (its training curve being labelled as "HDLoss" above) and a natural Total Variation distance
analogue of it (its training curve labelled as "TVLoss" above), for the text data in Figure 1
D.3 LIPEx on Images
Each class/row of our explanation matrix would contain a weight corresponding to the importance of a com-
mon set of features/super-pixels for that class. The figure below shows the part of the matrix corresponding
to the top 3 classes detected for this image i.e. "Burmese_mountain_dog", "Entlebucher" and "Appenzeller"
and the top−4 features deemed to be important for the predicted class i.e. "Burmese_mountain_dog". Thus
we see how LIPEx successfully "localized" the dog as being determinant to the predictions rather than the
cat which is also prominent in this picture.
16
Figure 6: Example of (the most important part) of the matrix returned by the LIPEx method on an image.
See Figure 7 how the top 5 segments detected for the image patch together. The corresponding LIME answer
is visualized in Figure 8 - and we can see how it prioritized image segments unrelated to the dog.
Figure 7: The top 5 image segments deemed to be important by LIPEx for Inception-V3 to classify the
image in Figure 6 as a "Burmese_mountain_dog"
Figure 8: The weight vector over the features as returned by LIME
17
Figure 9: The LIPEx result for the image data in Figure 7 corresponds to the endpoint of minimizing the
loss given in equation 6. (its training curve being labelled as "HDLoss" above). The training curve labelled
as "TVLoss" corresponds to training on an analogous loss as in equation 6 but with the metric used in
probability space being Total Variation.
18
D.4 More Details About the Ablation Studies in Section 4
Method
Top1
Top2
Top3
Top4
Top5
LIPEx
LIME
GuidedBack
Saliency
Input_G
Deeplift
Occlusion
LIPEx
LIME
GuidedBack
Saliency
Input_G
Deeplift
Occlusion
0.781(±0.047)
0.777(±0.027)
0.387(±0.049)
0.387(±0.049)
0.38(±0.054)
0.38(±0.054)
0.45(±0.045)
0.657(±0.021)
0.653(±0.017)
0.597(±0.029)
0.597(±0.029)
0.6(±0.033)
0.6(±0.033)
0.65(±0.016)
BERT on 20Newsgroups
0.897(±0.016)
0.856(±0.045)
0.517(±0.074)
0.517(±0.074)
0.52(±0.071)
0.52(±0.071)
0.59(±0.082)
0.857(±0.036)
0.841(±0.031)
0.477(±0.082)
0.477(±0.082)
0.48(±0.079)
0.48(±0.079)
0.543(±0.066)
BERT on Emotion
0.74(±0.037)
0.697(±0.041)
0.61(±0.029)
0.61(±0.029)
0.62(±0.029)
0.63(±0.028)
0.66(±0.022)
0.73(±0.028)
0.647(±0.037)
0.637(±0.009)
0.637(±0.009)
0.637(±0.009)
0.653(±0.012)
0.697(±0.012)
0.909(±0.026)
0.881(±0.011)
0.517(±0.054)
0.517(±0.054)
0.523(±0.05)
0.523(±0.05)
0.627(±0.065)
0.73(±0.029)
0.64(±0.045)
0.623(±0.009)
0.623(±0.009)
0.633(±0.009)
0.643(±0.012)
0.697(±0.005)
0.908(±0.032)
0.912(±0.021)
0.553(±0.042)
0.553(±0.042)
0.57(±0.029)
0.57(±0.029)
0.653(±0.063)
0.793(±0.024)
0.65(±0.008)
0.63(±0.008)
0.63(±0.008)
0.637(±0.005)
0.64(±0.008)
0.693(±0.017)
Table 6: Here, features refer to words. Upon removing top-K words detected by each of the XAI methods
and doing re-prediction, we report the fraction of data on which the predicted class changes. We see that
the words removed by LIPEx guidance more significantly impact the model's prediction than when guided
by the other XAI methods - even upto accounting for standard deviation over different runs.
19
Method
Top3
Top4
Top5
Vgg16
LIPEx
LIME
XRAI
GradCAM
GuidedIG
BlurIG
Vanilla_Grad
SmoothGrad
Integrated_Grad
LIPEx
LIME
XRAI
GradCAM
GuidedIG
BlurIG
Vanilla_Grad
SmoothGrad
Integrated_Grad
0.763(±0.026)
0.74(±0.014)
0.713(±0.025)
0.69(±0.016)
0.717(±0.017)
0.713(±0.009)
0.68(±0.022)
0.747(±0.019)
0.703(±0.021)
0.82(±0.014)
0.78(±0)
0.77(±0.008)
0.763(±0.026)
0.75(±0.016)
0.787(±0.017)
0.753(±0.005)
0.817(±0.005)
0.747(±0.029)
InceptionV3
0.673(±0.005)
0.63(±0.014)
0.693(±0.017)
0.653(±0.005)
0.663(±0.046)
0.647(±0.041)
0.657(±0.012)
0.65(±0.024)
0.637(±0.019)
0.753(±0.005)
0.713(±0.046)
0.7(±0.029)
0.697(±0.017)
0.67(±0.051)
0.703(±0.034)
0.653(±0.026)
0.683(±0.049)
0.707(±0.025)
0.867(±0.017)
0.793(±0.009)
0.793(±0.026)
0.79(±0.043)
0.793(±0.009)
0.807(±0.017)
0.807(±0.012)
0.843(±0.005)
0.773(±0.017)
0.773(±0.017)
0.767(±0.034)
0.74(±0.062)
0.72(±0.036)
0.713(±0.04)
0.717(±0.029)
0.72(±0.051)
0.74(±0.037)
0.733(±0.04)
Table 7: Here, features refer to image segments which were gotten by Segment Anything. LIPEx and LIME
can be used to directly get a weight for each segment while for the saliency-based methods a segment's
importance is determined as the sum of the weights assigned to its pixels. In the table above we can see that
the fraction of data on which label prediction changes under deletion of top features detected by LIPEx is
consistently higher than for other XAI methods - even upto accounting for standard deviation over different
runs.
20
D.5 Comparison Between the Explanations Found by LIPEx and LIME
Figure 10, 11 vividly demonstrate the fine-grained explanation that is obtained by the LIPEx matrix as
opposed to the LIME's explanation (right bar) on the same number of feature sets. The input instances
in Figure 10 and 11 are randomly chosen from the Emotion dataset. The explanatory matrix generated by
LIPEx makes it easy to see the relationship between the same feature and different categories.
Figure 10:
Figure 11:
21
D.6 Comparison Between the Explanations Found by LIPEx and LIME for Text Data Where
Predicted Class and the True Class are Different
Figure 12, 13, 14, 15 demonstrate the fine-grained explanation that is obtained by the LIPEx matrix as
opposed to the LIME's explanation on the same feature set for the predicted class - which is different
than the true class for these instances. The input instances in Figure 12, 13, 14 and 15 are chosen from
20Newsgroups.
Figure 12:
22
Figure 13:
23
Figure 14:
24
Figure 15:
25
|
|
http://arxiv.org/abs/2310.04855v1 | "2023-10-07T15:31:15" | "2023-10-07T15:31:15" | Epsilon non-Greedy: A Bandit Approach for Unbiased Recommendation via
Uniform Data | Often, recommendation systems employ continuous training, leading to a
self-feedback loop bias in which the system becomes biased toward its previous
recommendations. Recent studies have attempted to mitigate this bias by
collecting small amounts of unbiased data. While these studies have
successfully developed less biased models, they ignore the crucial fact that
the recommendations generated by the model serve as the training data for
subsequent training sessions. To address this issue, we propose a framework
that learns an unbiased estimator using a small amount of uniformly collected
data and focuses on generating improved training data for subsequent training
iterations. To accomplish this, we view recommendation as a contextual
multi-arm bandit problem and emphasize on exploring items that the model has a
limited understanding of. We introduce a new offline sequential training schema
that simulates real-world continuous training scenarios in recommendation
systems, offering a more appropriate framework for studying self-feedback bias.
We demonstrate the superiority of our model over state-of-the-art debiasing
methods by conducting extensive experiments using the proposed training schema. | [
"S. M. F. Sani",
"Seyed Abbas Hosseini",
"Hamid R. Rabiee"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04855v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04855v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | Epsilon non-Greedy: A Bandit Approach for
Unbiased Recommendation via Uniform Data
S.M.F. Sani
Department of Computer Engineering
Sharif University of Technology
Tehran, Iran
s.feyzabadisani76@sharif.edu
Seyed Abbas Hosseini
Department of Computer Engineering
Sharif University of Technology
Tehran, Iran
abbashossini@sharif.edu
Hamid R. Rabiee
Department of Computer Engineering
Sharif University of Technology
Tehran, Iran
rabiee@sharif.edu
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
5
5
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Abstract-Often, recommendation systems employ continuous
training, leading to a self-feedback loop bias in which the system
becomes biased toward its previous recommendations. Recent
studies have attempted to mitigate this bias by collecting small
amounts of unbiased data. While these studies have successfully
developed less biased models, they ignore the crucial fact that the
recommendations generated by the model serve as the training
data for subsequent training sessions. To address this issue,
we propose a framework that learns an unbiased estimator
using a small amount of uniformly collected data and focuses
on generating improved training data for subsequent training
iterations. To accomplish this, we view recommendation as a
contextual multi-arm bandit problem and emphasize on exploring
items that the model has a limited understanding of. We introduce
a new offline sequential training schema that simulates real-world
continuous training scenarios in recommendation systems, offer-
ing a more appropriate framework for studying self-feedback
bias. We demonstrate the superiority of our model over state-of-
the-art debiasing methods by conducting extensive experiments
using the proposed training schema.
Index Terms-Recommendation Systems, Self-feedback Loop
Bias, Contextual Multi-Arm Bandit, Continuous Training
I. INTRODUCTION
Recommendation systems are built by training a model on
a dataset D that contains historical interactions between users
and items. This dataset is typically obtained from a previously
deployed recommendation algorithm; hence learning from this
data may introduce bias into the model. The goal is to learn
a model represented by parameters θ that can estimate the
probability p(r|a, c). Here, r indicates whether a user will
show interest in the suggested item a, and c includes all
relevant contextual information associated with the user-item
interaction. The optimal parameters θ are typically obtained
through point estimation techniques. This is typically done by
minimizing a loss function over the dataset:
θ∗ = argmin
|D|
(cid:88)
θ
wil(ri, ˆri(θ))
(1)
i=1
Here, ri represents the true user feedback, while ˆri(θ) repre-
sents the model's prediction. The term wi denotes the sample
1
weight, which is often set as
|D| , providing equal weight
to each sample in the dataset. However, relying solely on
estimating parameter θ based on (1) can result in a biased
model towards the training data.
This bias, known as the self-feedback loop [1], persists
even when an optimal algorithm is utilized for dataset col-
lection. When the learned model encounters novel items or
contexts not present in the training data, it often provides
suboptimal recommendations with high confidence based on
its acquired knowledge. As a result, these recommendations
generate biased training data for subsequent iterations, thereby
perpetuating bias in subsequent models.
Recent research focused on addressing the self-feedback
loop in recommendation systems can be categorized into two
groups. The first group, termed debiasing methods, encom-
passes methods that aim to acquire an unbiased estimation
of parameter θ from the initially biased dataset. The second
group, denoted as uncertainty-aware methods, emphasizes the
inherent nature of continuous training in recommendation
systems. These approaches strive to generate recommendations
in a non-greedy way that produce less biased training data for
subsequent training rounds.
Debiasing methods aim to mitigate bias in recommenda-
tion models trained on biased datasets. One common ap-
proach to achieve unbiased models is by incorporating Inverse
Propensity Scores (IPS) as sample weights in (1) [2]–[4].
However, these methods may face challenges associated with
high variance, especially when the data collection algorithm
differs significantly from the learning algorithm. Recent stud-
ies propose methods that
leverage information from uni-
formly recommended items to learn unbiased models [5]–[7].
However, the amount of uniformly collected interactions in
recommendation systems is often limited due to its negative
impact on user satisfaction. The well-known epsilon-greedy
algorithm exemplifies such an approach by utilizing a small
amount of randomly suggested items to learn an unbiased
model. Nonetheless, debiasing methods often prioritize recom-
mending items with the highest expected feedback in a greedy
manner without considering the impact on the composition of
subsequent training datasets.
Uncertainty-aware methods are designed to optimize long-
term user satisfaction by generating recommendations that
contribute to the creation of enhanced training data. These
methods typically integrate exploration mechanisms that pri-
oritize items with higher uncertainty, ensuring that the model is
exposed to recommendations it has limited knowledge about.
This helps mitigate bias during continuous training iterations
[8]–[10]. However, these methods overlook the unbiased na-
ture of uniformly collected data as a valuable source for
debiasing in recommendation systems.
To address these limitations, we introduced the Epsilon non-
Greedy (EnG) framework, which combines the advantages
of both groups above. Our EnG framework overcomes the
limitations by achieving unbiased recommendations through
learning on biased datasets and generating recommendations
that can serve as less biased training data for subsequent
training iterations, ultimately maximizing long-term user sat-
isfaction.
Given the widespread use of deep neural networks in state-
of-the-art recommendation algorithms [11]–[13], we adopt
them as our framework's underlying backbone. To achieve
an unbiased recommendation system, we propose a teacher-
student architecture with a novel training loss function that
effectively leverages information from a small quantity of
uniformly collected data. To incorporate systematic explo-
ration into our framework, we view the recommendation as
a contextual multi-arm bandit problem. We integrate Thomp-
son sampling into our framework by employing the dropout
technique, enabling us to recommend items the model has
limited knowledge about. By incorporating this approach,
the resulting interactions serve as improved training data for
subsequent training sessions, ultimately enhancing long-term
user satisfaction.
The conventional training schema commonly employed in
recent studies does not accurately reflect the debiasing capa-
bilities of recommendation systems. We propose a novel of-
fline sequential training schema that simulates the continuous
training process observed in real-world recommendation sys-
tems. Using this training schema, we perform comprehensive
experiments and demonstrate that our proposed framework
exhibits superior debiasing power compared to state-of-the-art
methods. This paper presents several key contributions:
I EnG Framework: We introduce the EnG framework,
which enables unbiased recommendations and generates
training data with a reduced bias for subsequent train-
ing iterations. By utilizing a teacher-student architecture
trained with the proposed loss function, the framework
facilitates the development of an unbiased learner. Addi-
tionally, the incorporation of Thompson sampling through
the dropout technique allows the model to explore items
for which it lacks certainty, effectively breaking the self-
feedback loop and enhancing long-term recommendation
performance.
II Sequential Training Schema: We introduce a sequential
training schema that closely aligns with real-world recom-
mendation scenarios. This schema allows for evaluating
debiasing capabilities in recommendation algorithms by
simulating the continuous training process observed in
real-world systems.
III Experimental Evaluation: Extensive experimentation is
conducted on two popular real-world datasets. The results
demonstrate the superior debiasing power of the proposed
EnG framework, surpassing state-of-the-art methods.
II. RELATED WORK
This section summarizes prior research endeavors to tackle
the problem of self-feedback loop bias in recommendation
systems. The existing literature can be broadly classified into
two main categories: methods that primarily aim to achieve
unbiased estimators and techniques that incorporate uncer-
tainty to enhance long-term user satisfaction by improving the
quality of training data for subsequent training iterations.
A. Debiasing Methods
Current research endeavors aiming to obtain unbiased esti-
mators from biased data can be categorized into two main
groups. The first group primarily uses inverse propensity
scores, while the second concentrates on leveraging a limited
quantity of collected unbiased data to learn an unbiased model.
1) Inverse Propensity Score: Propensity scores are crucial
in addressing self-feedback loop bias in recommendation sys-
tems. These scores represent the probability of observing a
particular data point in the dataset and are typically determined
by the recommendation algorithm. Methods that
leverage
propensity scores assign weights to each sample based on their
inverse propensity, enabling the estimation of unbiased loss
function of interest even when calculated on biased data [14].
The utilization of propensity scores has demonstrated improve-
ments in the performance of matrix factorization methods [14],
[15]. A recent study used propensity scores to predict users'
preferences from Missing-Not-at-Random (MNAR) implicit
feedback [4].
Furthermore, in seeking unbiased estimation for loss func-
tion of interest, researchers have also explored using propen-
sity scores in conjunction with positive-unlabeled learning
techniques [3].
Inverse-propensity-based estimators, commonly used for
unbiased point estimation, often face the issue of high variance
when there are substantial disparities between the recommen-
dation algorithm and the data collection algorithm. To mitigate
this challenge, several solutions, including self-normalization,
clipped, and doubly robust estimators, have been proposed [4],
[16], [17].
2) Uniformly Collected Data: Uniformly collected data
refers to a dataset where recommendations are made with
equal probabilities for different items. This data type provides
an opportunity to estimate user preferences without the in-
fluence of self-feedback loop bias, resulting in an unbiased
estimator [18]. However, collecting a large amount of uniform
data is impractical due to potential negative impacts on user
satisfaction and business revenue. The epsilon greedy algo-
rithm is a fundamental approach that leverages small amounts
of uniformly collected data. This algorithm incorporates a
random item selection strategy with a probability of epsilon,
while the remaining items are selected greedily based on
their expected rewards. A recent study proposed a multi-
task objective that jointly factors the model trained on biased
data with the model trained on uniformly collected data [19].
Another recent study presents an alternative approach employ-
ing knowledge distillation methods for counterfactual recom-
mendations, specifically classifying them into four categories:
label-based, sample-based, feature-based, and structure-based
distillation [5]. Our proposed approach is closely aligned with
label-based distillation, particularly regarding the loss function
utilized. Influence functions were also used to assign weights
directly to training samples [20].
A recent study proposed a general framework that ad-
dresses different biases using a meta-learning algorithm to
obtain sample weights and provide unbiased estimations of
the loss function of interest [6]. Theoretical guarantees also
support the effectiveness of these debiasing strategies; causal
diagrams have been employed to model biased and unbiased
feedback generation processes in recommendation systems
[21]. A debiasing strategy based on information bottleneck
has been proposed by identifying the confounding bias as
the disparity between the two diagrams. A recent research
investigation has provided upper bounds for the unbiased loss
function of interest, encompassing both a generalization error
and a separability-based bound. Building upon these bounds, a
novel debiasing approach named debiasing approximate upper
bound (DUB) has been introduced [7]. Recent studies also
have demonstrated the potential benefits of integrating inverse
propensity scores alongside uniformly collected data [18],
[22].
B. Uncertainty Aware Methods
Uncertainty-aware methods aim to address the self-feedback
loop bias by approximating the posterior distribution of model
parameters p(θ|D) or estimating its variance since it is a
way to quantify the uncertainty associated with the model's
predictions. Considering the uncertainty in the model's pre-
dictions, these methods promote exploratory recommendations
to capture user interests and break the self-feedback loop. As
the model explores diverse recommendations, the uncertainty
decreases (convergence of the posterior distribution) and tends
to exploit its learned knowledge more effectively. The con-
textual multi-arm bandit problem has emerged as a widely
adopted framework for an uncertainty-aware recommendation.
A notable example is the LinUCB algorithm, which leverages
contextual information to make informed recommendations
[23]. In a related study, a factorization-based bandit algorithm
that incorporates low-rank matrix completion by incrementally
constructing a matrix representing user-item preferences has
been proposed [24]. Thompson sampling helps balance the
exploration/exploitation trade-off in recommendation systems
[25]. This approach allows for a more principled exploration
of the recommendation. Yarin Gal and Zoubin Ghahramani
contributed significantly by providing a probabilistic interpre-
tation of dropout in deep learning models. They developed
training in deep
a theoretical framework casting dropout
neural networks as approximate Bayesian inference in deep
Gaussian processes [26]. A recent study viewed the recom-
mendation system as a contextual multi-arm bandit problem.
They compared different techniques, including bootstrapping,
dropout, and a hybrid method, for drawing samples from
the posterior distribution in their model [8]. Furthermore, the
authors investigated various exploration mechanisms. They
compared the performance of the epsilon-greedy, Thompson
sampling, and upper confidence bound methods in terms of
their effectiveness as exploration strategies. A study proposed
a comprehensive review of Thompson sampling to balance
the exploration/exploitation trade-off [27]. In addition, some
studies investigate the usage of propensity scores alongside
exploration mechanisms. For instance, learnable propensity
weights are employed to achieve unbiased estimations in the
REINFORCE algorithm [28], [29].
III. EPSILON NON-GREEDY
In this section, we introduce our framework, referred to as
Epsilon Non-Greedy (EnG), which is specifically developed to
accomplish two key objectives: (1) establish an unbiased rec-
ommendation system by effectively utilizing a limited quantity
of uniformly collected data and (2) generate recommendations
that contribute to the creation of high-quality training data
for subsequent training iterations. We make certain assump-
tions regarding the recommendation system. We consider a
scenario where the system recommends only one item at a
time to the user. Additionally, we model the user's feedback
as a binary random variable, denoted as r, where r = 1
indicates that the user likes the recommended item, while
r = 0 shows otherwise. Furthermore, we assume that the
contextual information vector, represented as c, is sufficiently
comprehensive to encompass all relevant information required
for the recommendation problem. Therefore, estimating the
probability p(r = 1|a, c) to address the recommendation task
effectively is sufficient.
We propose a teacher-student architecture accompanied by a
novel loss function to effectively harness the information in the
uniformly collected data. This component of our framework,
which shares similarities with using random interactions in
the epsilon-greedy algorithm to learn an unbiased model, is
called the "epsilon" component. Recognizing the significance
of recommended items in the continuous training process,
we incorporate Thompson sampling into the EnG framework.
By utilizing Thompson sampling, the framework recommends
items based on their probability of being the optimal choice.
This deviates from the greedy approach of selecting items
with the highest expected instant reward. This probabilistic
recommendation strategy is called our framework's "non-
greedy" component.
To train the EnG framework, we utilize the historical
interactions logged in a dataset denoted as D = {(ri, ai, ci)}i.
This dataset can be divided into two main parts. The first
part, denoted as Dr, consists of a relatively small amount of
data collected using a uniform policy. This data is obtained by
suggesting items to users with equal probability. The second
part, denoted as Db, comprises the logs of interactions between
users and items that were selected by the recommendation
algorithm itself. In the recommendation problem, the user-item
Lt =
1
|Dr|
|Dr|
(cid:88)
i=1
l(ˆrt
i, ri) + λtR(θt)
(2)
B. Non-Greedy
interactions are often sparse, meaning that each user typically
interacts with only a few items. Consequently, numerous user-
item pairs remain unobserved in the dataset, denoted as Du. In
the subsequent sections, we will provide a detailed explanation
of each framework component.
A. Epsilon
We propose a teacher-student architecture to unleash the
unbiased information of Dr. The teacher model is specifically
trained on the uniformly suggested items in Dr to learn
unbiased recommendations. Its role is to distill and transfer
this knowledge to the student model, enabling the student to
make less biased predictions. Fig 1 illustrates the proposed
architecture of the EnG framework, which employs feedfor-
ward neural networks as the backbone for both the teacher
and student models. The training process starts by training
the teacher network solely on Dr. The loss function used for
training the teacher network is defined as follows:
Where ˆrt
represents the predicted reward by the teacher
i
network for the i-th sample. The true reward is denoted as ri.
The loss function l is employed to quantify the discrepancy
between predicted and true rewards. We choose Binary Cross
Entropy (BCE) as it is suitable for binary classification tasks.
R represents the regularization term. The parameters of the
teacher network are represented by θt, and the hyperparameter
λt controls the regularization strength. After the convergence
of the teacher network, the student network is trained with
the guidance of the teacher network using the following loss
function:
Ls =
1
|D|
|D|
(cid:88)
i=1
l(ˆrs
i , ri) +
γreg
|Du|
|Du|
(cid:88)
i=1
lreg(ˆrs
i , ˆrt
i) + λsR(θs)
(3)
The first term involves training the student network on all
available data D. However, relying solely on this term could
introduce bias into the model due to the majority of data
being non-uniformly collected. To mitigate this bias, we
introduce the second term, which leverages the knowledge
of the teacher network to establish an unbiased estimator.
The student network is regularized by encouraging it to have
similar predictions to the teacher network on unobserved data
Du. Unobserved data is chosen as it provides a large amount of
data for extensive training and shares similar unbiased charac-
teristics with the uniformly collected data. The third term aims
to regularize the weights of the student network to prevent
overfitting. The γreg is used to control regularization strength
in (3). To ensure that the student's predictions are close to the
teacher's predictions, we consider two types of loss functions
(lreg). The first group of loss functions treats the predictions as
logits and measures the discrepancy between these predictions.
Examples of such loss functions include squared error and
absolute error. The second group of loss functions considers
the predictions as parameters of Bernoulli distributions, which
effectively model the probability of obtaining a reward based
on a given action and context. Notable examples of such loss
functions include the Kullback-Leibler (KL) divergence and
Jeffreys divergence, which represents a symmetric variant of
the KL divergence.
Our proposed solution addresses the challenges of training a
high-capacity model with limited uniform data by training the
teacher and student models separately. The teacher model is
initially trained with constrained capacity, θt ∈ Rp, θs ∈ Rq,
where p << q, to mitigate variance and stabilize its recom-
mendations. This ensures consistent and reliable knowledge
transfer from the teacher to the student, even with limited
uniformly collected data. By adopting this approach,
the
student model can benefit from the teacher's guidance while
maintaining its capacity for accurate recommendations. This
framework effectively enables the student model to learn from
available data while leveraging the insights and expertise of
the teacher model.
To this point, utilizing the proposed epsilon component of
the framework has enabled us to recommend items with the
highest expected instant reward.
arg max
a∈A
E[r = 1|a, c]
(4)
However, this strategy is considered greedy as it continually
selects items that maximize the expected instant reward. To
evaluate the impact of recommendations on continuous train-
ing data, we can rewrite the probability p(r = 1|a, c) using
Bayes' rule:
p(r = 1|a, c) =
(cid:90)
p(r = 1|a, c, θ)p(θ|D)dθ
(5)
By accessing this posterior distribution, a non-greedy item
selection strategy emerges. Instead of selecting items solely
based on expected instant reward, we can recommend items
in proportion to the probability of them being optimal. This
can be expressed as:
(cid:90)
a′
p(a = a∗|c) =
I[E[r|a, c, θ] = max
E[r|a′, c, θ]]p(θ|D)dθ
(6)
In practice, obtaining the exact posterior distribution p(θ|D)
and calculating the integral
is intractable in many real-
world scenarios. However, Thompson sampling provides an
alternative technique. Instead of directly evaluating the inte-
gral, Thompson sampling involves sampling model parameters
from the posterior distribution and selecting the best item
based on these drawn parameters. Thompson sampling allows
for systematic exploration of the recommendation problem.
Thompson sampling breaks the self-feedback loop by choosing
items non-greedily using the drawn parameters. Initially, when
the training begins, the posterior distribution is relatively flat,
indicating uncertainty in the model parameters. Samples drawn
from this distribution explore a wide range of parameter val-
ues, leading to the exploration of various items. As the training
Fig. 1: (Left) The smaller teacher network is trained via (2). (Right) The student network is trained via (3).
progresses, the posterior distribution becomes more peaked,
indicating increased confidence in the learned parameters.
Consequently, samples drawn from the posterior distribution
tend to cluster around the most probable parameter values,
prioritizing the exploitation of the learned knowledge.
To draw samples from the posterior distribution of neural
network parameters, the study conducted by Yarin Gal and
Zoubin Ghahramani offers valuable insights. They demonstrate
that using the dropout technique during the inference stage of
a neural network can be interpreted as obtaining model predic-
tions based on samples drawn from the posterior distribution
of the model parameters [26]. Dropout is a computationally
efficient approach, making it practical to implement within
recommendation systems without significant computational
overhead. Therefore, the student network employs the dropout
technique during the inference process (Fig 1). This allows
for a balanced approach between exploration and exploita-
tion in the recommendations made by the student network.
By incorporating a teacher-student architecture and utilizing
Thompson sampling during the recommendation process, the
proposed framework effectively addresses the recommendation
algorithm's short-term and long-term objectives.
C. Sequential Training Algorithm
Recent studies and endeavors aiming to disrupt the self-
feedback loop in recommendation systems through uniformly
collected data have predominantly adopted a conventional
training approach. This approach involves partitioning the
available uniform data into three distinct subsets: a small
portion for model
training, another portion for validation
and hyperparameter tuning, and a final portion for unbiased
evaluation. However, the conventional training approach fails
to fully capture the continuous training nature of real-world
recommendation systems. Evaluating the model solely based
on this training schema may not accurately reflect its long-
term performance. We propose a sequential training schema
specifically tailored for training recommendation systems to
overcome this limitation and better simulate real-world sce-
narios.
The proposed training algorithm adopts a sequential process
wherein the training data, comprising uniformly collected and
biased logged data, is divided into M batches. In each training
round, the model predicts scores for all items in the batch.
A proportion ρ of items with the highest predicted scores
are selected as chosen recommendations and included in the
model's training data. This sequential training schema aims
to emulate the behavior of recommendation systems in real-
world settings, where collected interactions often consist of
recommendations suggested by the model itself. By incor-
porating this sequential training schema, the algorithm aims
to effectively integrate the continuous training aspect into the
model learning process.
The complete training algorithm, presented in Algorithm
1, outlines the step-by-step procedure for implementing the
proposed Epsilon non-Greedy framework. In the 7th line of
the algorithm, we incorporate the dropout technique to obtain
predictions. This utilization of dropout introduces additional
diversity in the selected training data, thereby enhancing the
exploration aspect of the dataset generation process for our
recommendation model. When a method solely prioritizes
learning an unbiased algorithm without considering the com-
position of subsequent training data, it tends to predominantly
recommend items for which it already possesses knowledge.
Consequently, the quality and diversity of the model's training
data diminish,
leading to a bias toward recommendations
generated by the method during subsequent training iterations.
IV. EMPIRICAL EVALUATION
This section comprehensively evaluates the performance
of the EnG framework compared to state-of-the-art meth-
ods. Firstly, we demonstrate the effectiveness of our teacher-
student architecture in achieving unbiased recommendations
using limited uniformly collected data through conventional
and sequential training. Secondly, we investigate the potential
enhancement of the proposed method by integrating Thomp-
son sampling into the recommendation process, particularly
in reducing biases over extended durations. Additionally, an
ablation study is conducted to analyze the impact of important
hyperparameters on the performance of EnG. The code can be
accessed via github.com/FeyzabadiSani/Epsilon-nonGreedy/
1) Datasets: This section provides an overview of the
datasets used in our experiments. The statistical characteristics
of these datasets, including the positive sample ratio (PR), are
presented in Table I.
YahooR3 [30]: Comprises user ratings of songs on a scale
ranging from 1 to 5. The dataset consists of interactions
train, Dr
validation, Dr
test
Algorithm 1 Epsilon Non-Greedy
Require: Dr, Db, Du, M , ρ, λteacher, λstudent, γstudent
1: Split Dr into Dr
2: Divide Dr
3: Initialize θ0
4: S b ← {}
5: S r ← {}
6: for i = 1 to M do
7:
train, Db into M equal batches (dr
student
i , db
i )
(db
i )
student
i based on scores in descending order
scores ← fθi−1
Sort db
winners ← top ρ portion of db
i
S b ← S b ∪ winners
S r ← S r ∪ dr
i
Initialize θi
Initialize θi
θi
teacher ← update on S r using (2)
student ← update on S r, S b, Du using (3)
θi
student
teacher
8:
9:
10:
11:
12:
13:
14:
15:
16: end for
17: return θM
student
between 15,400 users and 1,000 songs. It is divided into two
parts: the first part consists of user ratings collected during
regular interactions with Yahoo music services, which can be
considered as the biased portion of the dataset. The second part
consists of user ratings on randomly selected songs, which can
be considered as the uniform portion of the dataset.
Coat [14]: It includes ratings of 290 users on 300 different
coats, using a scale ranging from 1 to 5. Each user is initially
asked to rate 24 coats based on their personal
interests.
Additionally, a further 16 coats are randomly selected for the
user to rate, constituting the dataset's uniform data portion.
The datasets are binarized based on user ratings, represent-
ing the sparsity of user feedback. Ratings of 5 indicate liked
items, while ratings below 5 indicate disliked items.
2) Evaluation Metrics: In line with recent studies, we adopt
two commonly used evaluation metrics: Area Under the ROC
Curve (AUC) and Binary Cross-Entropy (BCE) loss [5]–[7].
The AUC metric assesses the discriminative power of an algo-
rithm in distinguishing between positive and negative classes.
It can be interpreted as the probability that the algorithm
predicts a random positive sample with a higher score than
a random negative sample. A higher AUC value indicates
better performance in ranking positive samples higher than
negative samples. On the other hand, the BCE loss considers
the model's confidence in its predictions. It penalizes the
model heavily when it assigns a wrong label to a sample with
high confidence. The model is encouraged to make confident
and accurate predictions by minimizing the BCE loss.
3) Baselines: Recent studies predominantly rely on matrix
factorization, while our framework leverages neural networks
due to their enhanced representational capacity, which has
made them the primary architecture in state-of-the-art recom-
mendation algorithms [11]–[13]. To ensure a fair comparison,
we consider existing studies that can be adapted as loss
TABLE I: Statistics of Datasets
Dataset
|Dr|
|Db|
Coat
YahooR3
4640
54000
6594
311704
|Dr |
|Db|
0.70
0.17
PR(Dr, Db)
(0.05, 0.09)
(0.03, 0.24)
functions similar to our proposed EnG loss. These include
the Bridge and Refine strategies [5], Autodebias approach [6],
and the DUB method [7]. Two baseline models, "Uniform"
and "Union," are also included for performance comparison.
The "Uniform" model is exclusively trained on uniformly
collected data Dr, while the "Union" model is trained on the
entire dataset D, including both uniformly collected and biased
logged data.
Hyperparameters were selected based on the achieved AUC
scores on the validation set. The range for the regularization
weights, including γreg, was set as [1e-4, 1e-3, 1e-2, 1e-1,
1]. The batch size of the data loader was varied among the
values [16, 32, 64, 128, 256]. The hyperparameter αrefine was
explored within the range [1e-4, 1e-3, 1e-2, 1e-1, 0.1, 0.2, ...,
0.9]. For the YahooR3 dataset, embedding dimensions of [10,
20, 50, 100, 200] were used for user and item IDs. Network
architectures with both 2-layer and 3-layer configurations
were examined, with neuron counts per layer ranging from
[32, 64, 128, 256, 512], ensuring that the teacher network
had significantly fewer parameters than the student network.
Results on the Coat dataset were averaged over 10 runs, while
results on the YahooR3 dataset were averaged over 5 runs.
Convergence was ensured using an early stopping method
based on the BCE score on the validation set. The code will
be made available upon acceptance of the paper.
4) Performance Investigation using conventional training
schema: In this section, similar to prior studies, we employ
conventional training schema to evaluate the efficacy of the
EnG framework in utilizing limited uniformly collected data.
The uniform portion of the dataset was divided into three
disjoint sets: training, validation, and testing. The validation
and test sets were chosen explicitly from the uniformly col-
lected data to ensure an unbiased evaluation process. For
both datasets, 20 percent of the uniformly collected data was
allocated for training, while the remaining uniform data were
evenly distributed between the validation and test sets. The
experimental results are presented in Table II.
Upon analyzing the results, several noteworthy observations
emerge. First, strategies that utilize uniformly collected data
effectively yield higher AUC scores than the Union strategy,
which combines all available data. Although all strategies suc-
cessfully use this information, the proposed EnG framework
exhibits significantly higher AUC scores than other state-of-
the-art methods. This indicates its superior effectiveness in
leveraging the information from uniformly collected data. It
is worth noting that the YahooR3 dataset, being sparser and
more challenging, presents more considerable disparities in
the positive ratio feedback distribution (PR) between uniform
TABLE II: Performance Comparison - Conventional Training
TABLE III: Performance Comparison - Sequential Training
Method
EnG-MAE
EnG-MSE
EnG-KL
EnG-Jeffrey
Bridge
Refine
Autodebias
DUB
Union
Uniform
Coat
YahooR3
AUC
BCE
AUC
BCE
0.829
0.829
0.835
0.837
0.801
0.774
0.779
0.796
0.749
0.676
0.174
0.171
0.164
0.160
0.183
0.209
0.242
0.194
0.204
0.186
0.775
0.775
0.780
0.787
0.668
0.765
0.748
0.727
0.631
0.614
0.132
0.192
0.228
0.209
0.224
0.325
0.103
0.112
0.279
0.112
Method
EnG-MAE
EnG-MSE
EnG-KL
EnG-Jeffrey
Bridge
Refine
Autodebias
DUB
Union
Uniform
Coat
YahooR3
AUC
BCE
AUC
BCE
0.790
0.787
0.797
0.795
0.737
0.708
0.740
0.644
0.687
0.594
0.220
0.219
0.191
0.216
0.280
0.296
0.323
0.207
0.209
0.281
0.739
0.758
0.760
0.769
0.653
0.731
0.691
0.646
0.612
0.547
0.132
0.202
0.255
0.231
0.226
0.359
0.333
0.128
0.289
0.114
and biased data when compared to the Coat dataset (refer to
Table I). This more significant divergence poses a heightened
challenge in effectively utilizing the uniformly collected data
within the YahooR3 dataset. Consequently, the AUC scores
achieved for the Coat dataset consistently surpass those ob-
tained for the YahooR3 dataset. Furthermore, when examining
specific strategies, it is observed that the AUC scores of the
Bridge and DUB methods on the YahooR3 dataset are notably
lower than their respective AUC scores on the Coat dataset.
The Bridge strategy, where teacher and student networks
are trained simultaneously, encounters difficulty achieving
stability during training. This, combined with the challenge
of extracting knowledge from the uniformly collected data
in the YahooR3 dataset, explains the performance drop of
the Bridge strategy. In the case of the DUB loss function,
the term that aims to make the student mimic the teacher's
prediction error on uniform data becomes less effective due
to the more significant discrepancy between the feedback
distributions of uniform and biased data in the YahooR3
dataset. Lastly, the BCE score is directly influenced by the
similarity between the training and test distributions, as it
measures the discrepancy between predicted and ground truth
distributions. Consequently, the Autodebias approach achieves
a lower BCE score as it directly optimizes its parameters using
uniformly collected data without employing a teacher-student
architecture. However, since the difference in the positive
ratio distribution between uniform and biased data is much
more significant in the YahooR3 dataset compared to Coat,
incorporating biased data can help reduce the BCE score on
the Coat dataset. As a result, the proposed EnG framework
achieves a lower BCE score on the Coat dataset.
5) Performance Investigation using sequential
training
schema: In this section, we adopt a sequential training schema
described in Section III-C. The training data is divided into
20 batches, and we carefully adjust the selection ratio (ρ) and
the proportion of uniformly collected data used in training to
ensure that the ratio of unbiased data to biased data in each
batch remains low (approximately 5 percent).
The experimental results are presented in Table III. We
observe a decrease in AUC scores and an increase in BCE
scores compared to the results of previous experiments. This
the reduced
can be attributed to two main reasons. First,
amount of uniformly collected data poses challenges for the
methods to extract unbiased information, leading to a decline
in performance. Second, adopting a sequential training schema
intensifies the self-feedback loop effect, where the model's
recommendations are increasingly influenced by its previous
predictions, potentially introducing bias in subsequent training
iterations. Consistent with the previous results, except for the
DUB strategy on the Coat dataset, the EnG framework and
state-of-the-art methods achieve higher AUC scores than the
Union strategy. However, the EnG framework demonstrates
further improvements in AUC scores, indicating its capability
to effectively utilize smaller amounts of uniformly collected
data, even in a sequential training schema. This highlights
the effectiveness of the EnG methods in leveraging limited
amounts of unbiased data for improved recommendation per-
formance. The observed decrease in AUC score for the DUB
strategy on the Coat dataset, resulting in inferior performance
compared to the Union strategy, can be attributed to the spe-
cific characteristics of the DUB approach. The DUB strategy
incorporates a loss term that encourages the student network
to emulate the prediction errors of the teacher network on
uniformly collected data. However, in this scenario where the
teacher network's reliability is diminished, this loss term may
introduce misleading guidance to the DUB model, thereby
hindering its overall performance. Lastly, the intensified bias is
evident through higher BCE scores for all methods, including
Autodebias, on the YahooR3 dataset. The Uniform strategy
attains the lowest BCE score, benefiting the most from the
similarity between the training and test data distributions.
However, relatively smaller BCE scores are observed for the
EnG methods on the Coat dataset. The reasons for this can be
attributed to similar explanations as before.
6) Impact of Introducing Thompson Sampling: In this sec-
tion, we aim to investigate the potential performance enhance-
ment of our proposed model through the incorporation of
Thompson sampling (TS) and the introduction of exploratory
behavior in the recommendation process. We analyze two
settings, differing only in applying Thompson sampling while
selecting the model's training data. The findings of this anal-
ysis are summarized in TableIV. Initially, we observe that the
TABLE IV: Impact of Thompson Sampling
Method
EnG-MAE
EnG-MAE(TS)
EnG-MSE
EnG-MSE(TS)
EnG-KL
EnG-KL(TS)
EnG-Jeffrey
EnG-Jeffrey(TS)
Coat
YahooR3
AUC
BCE
AUC
BCE
0.726
0.777
0.740
0.779
0.740
0.783
0.715
0.773
0.266
0.192
0.260
0.180
0.268
0.110
0.263
0.190
0.665
0.728
0.734
0.741
0.763
0.768
0.672
0.773
0.175
0.105
0.198
0.116
0.216
0.110
0.201
0.111
utilization of Thompson sampling improves both the AUC and
BCE scores of the EnG methods. It is important to note that
the architectural design and hyperparameters remain consistent
across both methods. Thus, the observed improvement can
be directly attributed to the enhanced quality of the training
data resulting from the application of Thompson sampling.
Furthermore, our analysis reveals that the improvements in
terms of the BCE score are more pronounced compared to the
enhancements in the AUC score. This could be attributed to
utilizing dropout techniques during inference in the Thompson
Sampling models. This leads to recommending items with
lower scores if dropout techniques were not employed. This,
in turn,
increases the inclusion of uncertain items in the
model's training data for the subsequent training iteration.
Incorporating these uncertain items contributes to enhancing
both coverage and diversity within the training data. Given
that the BCE score is sensitive to the dissimilarity between the
training and test data distributions, including these uncertain
items helps mitigate this discrepancy, thereby reducing the
BCE score. Lastly, the improvement in AUC for the MAE and
Jeffreys regularization loss functions is more substantial com-
pared to the MSE and KL regularization loss functions. This
observation can be attributed to the nature of the loss functions
themselves. The MAE loss imposes stricter constraints than
MSE loss on the output range of the teacher and student
networks, as it operates within the range of 0 to 1. Similarly,
the Jeffreys loss, a symmetric KL variant, is also a more
restrictive loss function. Consequently, adding exploration has
a more significant potential to enhance the performance of
models trained with MAE and Jeffreys regularization loss
functions.
7) Impact of Regularization Losses: The findings presented
in Table II, Table III, and Table IV demonstrate that the KL
and Jeffreys loss functions exhibit a slight advantage over the
MAE and MSE loss functions. This performance discrepancy
can be attributed to the inherent properties of the KL and
Jeffreys distances, which incorporate a logarithmic penalty
to measure the discrepancy between the teacher and student
network predictions. As a result, these loss functions impose a
more substantial penalty on the divergence between the output
probability distributions of the two networks. Consequently,
they facilitate a more effective transfer of knowledge from
Fig. 2: Varying different sequential training parameters.
the teacher to the student network, ultimately enhancing the
performance of the student model.
8) Ablation Study: In this section, we investigate the impact
of various learning parameters on the performance of our
proposed EnG framework. Specifically, we analyze the effects
of different factors, namely the amount of uniformly collected
train|/|Dr|), the selection ratio (ρ) for
data used in training (|Dr
choosing top predictions from each training batch, and the
dropout ratio that determines the level of exploration during
prediction.
The influence of using different amounts of uniformly col-
lected data and varying selection ratios (ρ) is presented in Fig
2. To solely consider EnG's capability to extract information
from uniformly collected data, we restrict the amount of biased
data by setting ρ = 0.25 for the Coat dataset and ρ = 0.1
for the YahooR3 dataset. Our observations reveal that the
AUC scores generally increase as more uniformly collected
data is available in the training dataset. Furthermore, the EnG
methods exhibit promising performance in utilizing uniformly
collected data compared to state-of-the-art competitive meth-
ods. Notably, the Refine strategy demonstrates limited effec-
tiveness in leveraging uniformly collected data, potentially due
to the manner in which uniform data is incorporated. In Refine
strategy, the teacher network imputes labels on biased data,
but given the small amount of uniformly collected data, these
imputed labels could not effectively transfer the knowledge
from the uniform data.
In order to exclusively examine the impact of selecting
varying amounts of biased data in each training batch, we
limit the quantity of uniform training data to 1 percent of
the total available uniform data within the datasets. The
results demonstrate that all methods exhibit an increasing
trend in AUC scores with a larger quantity of biased data
selected in each training batch (Fig 2 right). Notably, the
EnG methods show further improvements with an increased
amount of biased data. However, a significant performance
gap is observed between the EnG methods and other state-of-
the-art approaches on the Coat dataset. This can be attributed
to two reasons: first, the EnG framework effectively utilizes
small quantities of uniformly collected data, as observed
in previous experiments, and second, the relatively smaller
disparity in positive ratios between the uniform and biased
data in the Coat dataset, as compared to the YahooR3 dataset,
provides an explanation for the effectiveness of EnG methods
in utilizing a larger quantity of biased data in conjunction
with limited unbiased data. Notably, this increasing trend is
not observed in the Bridge and DUB methods. In the Bridge
strategy, where the teacher and student networks are trained
simultaneously, the interleaving training procedure becomes
detrimental when only a small portion of uniform data is used.
Similarly, enforcing the student network to mimic the teacher's
prediction error in the DUB strategy can lead to adverse effects
when the teacher network is relatively weak.
The increase in dropout rate introduces additional random-
ness in the outputs of neural networks, leading to increased
exploration and stronger regularization during training. How-
ever, excessively high dropout rates can have detrimental
effects on model performance due to excessive exploration
and regularization, hindering the model's ability to exploit
learned knowledge effectively. Therefore, it is crucial to strike
a balance when incorporating randomness into the model. In
Fig 3, we analyze the impact of varying dropout rates on the
performance of EnG methods. The AUC scores demonstrate
an upward trend as the dropout rate increases,
indicating
that a moderate increase in the dropout rate can benefit the
methods by encouraging exploration and appropriate regular-
ization. However, there is a trade-off between exploration and
exploitation, as some methods initially benefit from increasing
dropout rates but experience a decline in performance when
the dropout rate becomes excessively high. Similar trends
are observed in the BCE scores. For example, on the Coat
dataset, the BCE scores initially decrease with an increasing
dropout rate but eventually rise due to excessive exploration
and regularization. Conversely, on the YahooR3 dataset, lower
dropout rates yield better performance in BCE scores, with an
increase in the dropout rate leading to higher BCE scores.
V. CONCLUSION AND FUTURE WORKS
In conclusion, recommendation systems commonly suffer
from bias induced by the self-feedback loop, which arises
from continuous training of the algorithm on its previous
recommendations. To address this issue, we propose a teacher-
student architecture that effectively leverages a small quantity
of uniformly collected data to learn an unbiased model.
By incorporating Thompson sampling, we ensure that
the
architecture learns an unbiased recommendation system and
generates recommendations that contribute to improved train-
ing data for subsequent training iterations. This integration
allows the model to exhibit exploratory behavior towards items
it is unaware of, resulting in less biased training data for
future training iterations. To evaluate the effectiveness of our
Fig. 3: Impact of varying dropout rate on EnG framework.
architecture, we introduce a sequential training schema that
emulates the continuous training process observed in real-
world recommendation systems.
Distribution shift poses a significant challenge in recom-
mendation systems, as the distributions of user interests,
item preferences, and contextual information undergo dynamic
changes over time. When combined with the continuous train-
ing nature of recommendation systems, this distribution shift
can exacerbate the self-feedback bias. Despite the importance
of this dynamic nature in recommendation problems, current
studies and datasets do not adequately capture it. Hence,
investigating the relationship between distribution shift and the
self-feedback loop represents a promising avenue for future
research.
REFERENCES
[1]
J. Chen, H. Dong, X. Wang, F. Feng, M. Wang,
and X. He, "Bias and debias in recommender sys-
tem: A survey and future directions," arXiv preprint
arXiv:2010.03240, 2020.
[2] W. Sun, S. Khenissi, O. Nasraoui, and P. Shafto, "De-
biasing the human-recommender system feedback loop
in collaborative filtering," in Companion Proceedings of
The 2019 World Wide Web Conference, 2019, pp. 645–
651.
[3] Y. Saito,
tri-training for debiasing
missing-not-at-random explicit feedback," in Proceed-
ings of the 43rd International ACM SIGIR Conference
on Research and Development in Information Retrieval,
2020, pp. 309–318.
"Asymmetric
[4] Y. Saito, S. Yaginuma, Y. Nishino, H. Sakata, and
K. Nakata, "Unbiased recommender
learning from
missing-not-at-random implicit feedback," in Proceed-
ings of
the 13th International Conference on Web
Search and Data Mining, 2020, pp. 501–509.
[5] D. Liu, P. Cheng, Z. Dong, X. He, W. Pan, and Z.
Ming, "A general knowledge distillation framework for
counterfactual recommendation via uniform data," in
Proceedings of the 43rd International ACM SIGIR Con-
ference on Research and Development in Information
Retrieval, 2020, pp. 831–840.
J. Chen, H. Dong, Y. Qiu, et al., "Autodebias: Learn-
ing to debias for recommendation," in Proceedings
of the 44th International ACM SIGIR Conference on
Research and Development in Information Retrieval,
2021, pp. 21–30.
[6]
[7] D. Liu, P. Cheng, Z. Lin, et al., "Bounding system-
induced biases in recommender systems with a ran-
domized dataset," ACM Transactions on Information
Systems, vol. 41, no. 4, pp. 1–26, 2023.
[8] D. Guo, S. I. Ktena, P. K. Myana, et al., "Deep bayesian
bandits: Exploring in online personalized recommenda-
tions," in Fourteenth ACM Conference on Recommender
Systems, 2020, pp. 456–461.
[9] O. Jeunen, D. Rohde, F. Vasile, and M. Bompaire,
"Joint policy-value learning for recommendation," in
Proceedings of the 26th ACM SIGKDD International
Conference on Knowledge Discovery & Data Mining,
2020, pp. 1223–1233.
[10] C. Du, Z. Gao, S. Yuan, et al., "Exploration in on-
line advertising systems with deep uncertainty-aware
learning," in Proceedings of the 27th ACM SIGKDD
Conference on Knowledge Discovery & Data Mining,
2021, pp. 2792–2801.
[11] H.-T. Cheng, L. Koc, J. Harmsen, et al., "Wide & deep
learning for recommender systems," in Proceedings of
the 1st workshop on deep learning for recommender
systems, 2016, pp. 7–10.
[12] X. He, L. Liao, H. Zhang, L. Nie, X. Hu, and T.-S.
Chua, "Neural collaborative filtering," in Proceedings of
the 26th international conference on world wide web,
2017, pp. 173–182.
[13] F. Xue, X. He, X. Wang, J. Xu, K. Liu, and R.
Hong, "Deep item-based collaborative filtering for top-
n recommendation," ACM Transactions on Information
Systems (TOIS), vol. 37, no. 3, pp. 1–25, 2019.
[14] T. Schnabel, A. Swaminathan, A. Singh, N. Chandak,
and T. Joachims, "Recommendations as treatments: De-
biasing learning and evaluation," in international con-
ference on machine learning, PMLR, 2016, pp. 1670–
1679.
[15] D. Liang, L. Charlin, and D. M. Blei, "Causal inference
for recommendation," in Causation: Foundation to Ap-
plication, Workshop at UAI. AUAI, 2016.
[16] A. Swaminathan and T. Joachims, "The self-normalized
estimator for counterfactual learning," advances in neu-
ral information processing systems, vol. 28, 2015.
[17] X. Wang, R. Zhang, Y. Sun, and J. Qi, "Doubly robust
joint learning for recommendation on data missing not
at random," in International Conference on Machine
Learning, PMLR, 2019, pp. 6638–6647.
[18] B. Yuan, J.-Y. Hsia, M.-Y. Yang, et al., "Improving ad
click prediction by considering non-displayed events,"
in Proceedings of the 28th ACM International Con-
ference on Information and Knowledge Management,
2019, pp. 329–338.
[20]
[19] S. Bonner and F. Vasile, "Causal embeddings for recom-
mendation," in Proceedings of the 12th ACM conference
on recommender systems, 2018, pp. 104–112.
J. Yu, H. Zhu, C.-Y. Chang, et al., "Influence func-
tion for unbiased recommendation," in Proceedings
of the 43rd International ACM SIGIR Conference on
Research and Development in Information Retrieval,
2020, pp. 1929–1932.
[21] D. Liu, P. Cheng, H. Zhu, et al., "Mitigating confound-
ing bias in recommendation via information bottleneck,"
in Fifteenth ACM Conference on Recommender Systems,
2021, pp. 351–360.
[22] X. Wang, R. Zhang, Y. Sun, and J. Qi, "Combating
selection biases in recommender systems with a few
the 14th ACM
unbiased ratings," in Proceedings of
International Conference on Web Search and Data
Mining, 2021, pp. 427–435.
[23] L. Li, W. Chu, J. Langford, and R. E. Schapire,
"A contextual-bandit approach to personalized news
article recommendation," in Proceedings of the 19th
international conference on World wide web, 2010,
pp. 661–670.
[24] H. Wang, Q. Wu, and H. Wang, "Factorization bandits
for interactive recommendation," in Thirty-First AAAI
Conference on Artificial Intelligence, 2017.
[25] W. R. Thompson, "On the likelihood that one unknown
probability exceeds another in view of the evidence of
two samples," Biometrika, vol. 25, no. 3-4, pp. 285–294,
1933.
[26] Y. Gal and Z. Ghahramani, "Dropout as a bayesian
approximation: Representing model uncertainty in deep
learning," in international conference on machine learn-
ing, PMLR, 2016, pp. 1050–1059.
[27] C. Riquelme, G. Tucker, and J. Snoek, "Deep
bayesian bandits showdown: An empirical comparison
of bayesian deep networks for thompson sampling," in
International Conference on Learning Representations,
2018.
[28] M. Chen, A. Beutel, P. Covington, S. Jain, F. Belletti,
and E. H. Chi, "Top-k off-policy correction for a
reinforce recommender system," in Proceedings of the
Twelfth ACM International Conference on Web Search
and Data Mining, 2019, pp. 456–464.
[29] R. J. Williams, "Simple statistical gradient-following
learning,"
algorithms for connectionist reinforcement
Machine learning, vol. 8, no. 3, pp. 229–256, 1992.
[30] B. M. Marlin and R. S. Zemel, "Collaborative prediction
and ranking with non-random missing data," in Pro-
ceedings of the third ACM conference on Recommender
systems, 2009, pp. 5–12.
|
|
http://arxiv.org/abs/2310.04854v1 | "2023-10-07T15:30:23" | "2023-10-07T15:30:23" | Repelling Random Walks | We present a novel quasi-Monte Carlo mechanism to improve graph-based
sampling, coined repelling random walks. By inducing correlations between the
trajectories of an interacting ensemble such that their marginal transition
probabilities are unmodified, we are able to explore the graph more
efficiently, improving the concentration of statistical estimators whilst
leaving them unbiased. The mechanism has a trivial drop-in implementation. We
showcase the effectiveness of repelling random walks in a range of settings
including estimation of graph kernels, the PageRank vector and graphlet
concentrations. We provide detailed experimental evaluation and robust
theoretical guarantees. To our knowledge, repelling random walks constitute the
first rigorously studied quasi-Monte Carlo scheme correlating the directions of
walkers on a graph, inviting new research in this exciting nascent domain. | [
"Isaac Reid",
"Eli Berger",
"Krzysztof Choromanski",
"Adrian Weller"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04854v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04854v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "stat.ML",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"stat.ML",
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
L
M
.
t
a
t
s
[
1
v
4
5
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Preprint. Under review.
Repelling Random Walks
Isaac Reid1 , Eli Berger2 , Krzysztof Choromanski3,4∗, Adrian Weller1,5
1University of Cambridge, 2University of Haifa, 3Google DeepMind,
4Columbia University, 5Alan Turing Institute
ir337@cam.ac.uk, kchoro@google.com
Abstract
We present a novel quasi-Monte Carlo mechanism to improve graph-based
sampling, coined repelling random walks. By inducing correlations between
the trajectories of an interacting ensemble such that their marginal transi-
tion probabilities are unmodified, we are able to explore the graph more effi-
ciently, improving the concentration of statistical estimators whilst leaving
them unbiased. The mechanism has a trivial drop-in implementation. We
showcase the effectiveness of repelling random walks in a range of settings
including estimation of graph kernels, the PageRank vector and graphlet
concentrations. We provide detailed experimental evaluation and robust
theoretical guarantees. To our knowledge, repelling random walks con-
stitute the first rigorously studied quasi-Monte Carlo scheme correlating
the directions of walkers on a graph, inviting new research in this exciting
nascent domain.1
1
Introduction and related work
Quasi-Monte Carlo (QMC) sampling is well-established as a universal tool to improve the
convergence of MC methods, improving the concentration properties of estimators by using
low-discrepancy samples to reduce integration error (Dick et al., 2013). They replace i.i.d.
samples with a correlated ensemble, carefully constructed to be more 'diverse' and hence
improve approximation quality.
Such methods have been widely adopted in the Euclidean setting. For example, when sam-
pling from isotropic distributions, one popular approach is to condition that samples are
orthogonal: a trick that has proved successful in applications including dimensonality re-
duction (Choromanski et al., 2017), evolution strategy methods in reinforcement learning
(Choromanski et al., 2018; Rowland et al., 2018) and estimating sliced Wasserstein dis-
tances (Rowland et al., 2019). 'Orthogonal Monte Carlo' has also been used to improve the
convergence of random feature maps for kernel approximation (Yu et al., 2016), including
recently in attention approximation for scalable Transformers (Choromanski et al., 2020).
Intuitively, conditioning that samples are orthogonal prevents them from clustering together
and ensures that they 'explore' Rd better. In specific applications it is sometimes possible
to derive rigorous theoretical guarantees (Reid et al., 2023b).
Less clear is how these powerful ideas generalise to discrete space. Of particular interest
are random walks on graphs, which sample a sequence of nodes connected by edges with
some stopping criterion. Random walks are ubiquitous in machine learning and statistics
(Xia et al., 2019), providing a simple mechanism for unbiased graph sampling that can be
implemented in a distributed way. However, slow diffusion times (especially for challenging
graph topologies) can lead to poor convergence and downstream performance.
Our key contribution is the first (to our knowledge) quasi-Monte Carlo scheme that corre-
lates the directions of an ensemble of graph random walkers to improve estimator accuracy.
By conditioning that walkers 'repel' in a particular way that leaves the marginal walk prob-
abilities unmodified, we are able to provably suppress the variance of various estimators
∗Senior lead.
1We will make all code publicly available.
1
Preprint. Under review.
whilst preserving their unbiasedness. We derive strong theoretical guarantees and observe
large performance gains for algorithms estimating three disparate quantities: graph ker-
nels (Choromanski, 2023), the PageRank vector (Avrachenkov et al., 2007) and graphlet
concentrations (Chen et al., 2016).
Related work: The poor mixing of random walkers on graphs is well-documented and
various schemes exist to try to improve estimator convergence. Most directly modify the
base Markov chain by changing the transition probabilities, but without altering the walker's
stationary distribution and therefore leaving asymptotic estimators (e.g. based on empirical
node occupations) unmodified. The canonical example of such a scheme is non-backtracking
walks which do not permit walkers to return to their most recently visited node (Alon et al.,
2007; Diaconis et al., 2000; Lee et al., 2012). More involved schemes allow walkers to interact
with their entire history (Zhou et al., 2015; Doshi et al., 2023). Many of these strategies
provide theoretical guarantees that the asymptotic variance of estimators is reduced, but
crucially the marginal probabilities of sampling different walks are modified so they cannot
be applied to non-asymptotic estimators that rely on particular known marginal transition
probabilities. Conversely, our QMC scheme leaves marginal walk probabilities unmodifed.
Research has also predominantly been restricted to the behaviour of a single self-interacting
walker rather than an ensemble, and when multiple walkers are considered analytic results
are generally restricted to simple structures, e.g. complete graphs (Rosales et al., 2022;
Chen, 2014). This research exists within the broader literature of reinforced random walks,
where nonlinear Markov kernels are used so that walkers are less (or more) likely to transition
to nodes that have been visited in the past (Pemantle, 2007). However, the analytic focus
has predominantly been on properties like recurrence times, escape times from sets, cover
times and localisation results for simple topologies (Amit et al., 1983; Tóth, 1995; Tarrès,
2004), rather than the behaviour of associated statistical estimators on general graphs. The
latter is of more direct interest in machine learning.
In Sec. 2 we introduce the
The remainder of the manuscript is organised as follows.
requisite mathematics and present our novel QMC repelling random walk mechanism. In
Secs 3-5 we use it to approximate three quantities of interest in machine learning: graph
node kernels (Sec. 3), the PageRank vector (Sec. 4), and graphlet statistics (Sec. 5).
Repelling random walks are empirically found to outperform the i.i.d. variant in every case
and we are often able to provide concrete theoretical guarantees.
2 Repelling random walks
Consider an undirected, connected graph G(N , E) where N := {1, ..., N } denotes the set
of nodes and E denotes the set of edges, with (i, j) ∈ E if there is an edge between nodes
i, j ∈ N . Write the graph's (weighted) adjacency matrix A := [aij]i,j∈N , where aij ̸= 0 if
(i, j) ∈ E and 0 otherwise. Let di := P
I[(i, j) ∈ E] denote the node degree, which is the
number of neighbours of a particular node, and let N (i) := {j ∈ N |(i, j) ∈ E} denote the
set of neighbours of node i. The transition matrix P = [Pij]i,j∈N of a simple random walk
is given by
j∈N
Pij =
( 1
di
0
if (i, j) ∈ E
otherwise
(1)
such that at every timestep the walker selects one of its neighbours with uniform probability.
This can be viewed as a finite and time-reversible Markov chain with state space N .
Supposing we have m such walkers on the graph simultaneously, we can define an augmented
Markov chain with state space N m, consisting of the possible node positions of all the
walkers. If the walkers are independent, the joint transition matrix Q ∈ RN m×N m
is given
by the Kronecker product
Q = P(1) ⊗ P(2) ⊗ ... ⊗ P(m)
(2)
where each P(i) is given by Eq. 1. Our key contribution is now to induce correlations
between the walkers' paths such that the joint transition matrix Q is modified but each
marginal transition matrix (and hence the unbiasedness of any estimators relying on it) is
unchanged. The correlations are designed to improve estimator convergence.
2
Preprint. Under review.
i.i.d.
repelling
Figure 1: Schematic for behaviour of repelling random walkers at a particular timestep. By
sampling from each 'block' (blue and green rectangles) without replacement we get a more
even distribution over neighbours, without changing the marginal probabilities.
t
denote the set of walkers at node i at timestep t, and N (i)
Definition 2.1 (Repelling random walks). A repelling ensemble has the following behaviour.
Let V (i)
| the size of this
set. Randomly divide these walkers into N (i)
t //d subsets of size d and one 'remainder' subset
of size N (i)
t %d < d (where // and % denote truncating integer division and the remainder,
respectively). Among each subset, assign the walkers to a neighbour from the set N (i)
uniformly without replacement.
:= |V (i)
t
t
t
This is in contrast to i.i.d. walkers where V (i)
are assigned to the neighbours N (i) uniformly
with replacement. We provide a schematic in Fig. 1. In the repelling scheme, each walker
still has a marginal transition probability Pij = {1/di if (i, j) ∈ E, 0 otherwise}, but now
they are forced to take different edges and heuristically 'explore' the graph more effectively.
The sample of walks is more 'diverse'. Since the marginal transition probabilities P(i) are
unmodified, any estimators that are unbiased with i.i.d. walkers are also automatically
unbiased with repelling walkers, including in the non-asymptotic regime. However, as we
shall see, their concentration properties are often substantially better.
Computational cost and implementation: Repelling random walks have a trivial drop-
in implementation. The only difference is whether walkers are assigned to neighbours with
or without replacement. Moreover, the transitions in the augmented state space N m remain
Markovian (memoryless); there are no extra space complexity costs because we only need
access to the current positions of all the walkers.
Physical interpretation and entanglement: Under repulsive interactions, the joint
transition matrix Q can no longer be written as a Kronecker product. For example, for 2
walkers in the same 'block',
(
(cid:16) di
(cid:17)
di−1 (1 − δj1j2 ) − 1
1 + δi1i2
1
QN i1+i2,N j1+j2 := Pr(j1, j2|i1, i2) = Pi1j1 Pi2j2 *
if di ̸= 1
if di = 1
(3)
which does not generically factorise into (i1, j1)- and (i2, j2)-dependent parts. In quantum
mechanics (QM), an interacting Hamiltonian H which cannot be written as a Kronecker sum
gives rise to a time-evolution operator U := exp(− i
Ht) that cannot be written as a Kro-
̄h
necker product, which in turn generically gives rise to quantum entanglement between parti-
cles. Just as the von-Neumann entropy (a measure of bipartite quantum entanglement (Am-
ico et al., 2008)) increases under such interactions, in our QMC scheme the Shannon mutual
information initially increases from 0: during the first timestep, ∆I1,2 = δi1i2 log( di
di−1 ) ≥ 0.
Note that the analogy is not exact because in QM the time-evolution operator acts on (com-
plex) wavefunctions whereas here the transition matrix acts on the (real positive) probabil-
ities of being in different states of a Markov chain encoding the positions of walkers on a
graph. It is just intended to help build intuition for the reader.
It will be convenient to define one further class of interacting random walk.
3
Preprint. Under review.
Definition 2.2 (Transient repelling random walks). An ensemble of random walks is de-
scribed as transient repelling if any given subset is repelling (according to the Def. 2.1) until
the walkers diverge, and independent thereafter.
Such an ensemble will capture the repelling behaviour at early times but eventually relax
to independence. A pair of particles will repel according to Def. 2.1 until they are located
at different nodes (which may take more than one timestep if the ensemble size is larger
than the initial node degree), but will not interact if they meet again later. Whilst less
practical than the full repelling scheme, we will see that sometimes it makes theoretical
analysis tractable.
We now apply our repelling random walks mechanism to three disparate applications: ap-
proximation of graph kernels (Sec. 3), approximation of the PageRank vector (Sec. 4), and
approximation of graphlet concentrations (Sec. 5).
3 Application 1: approximating graph kernels
We begin by demonstrating the effectiveness of repelling random walks for estimating graph
kernels KG : N × N → R, defined on the nodes N of a graph G. Such kernels capture
the structure of G, letting practitioners repurpose theoretically grounded and empirically
successful algorithms like support vector machines, kernelised principal component analysis
and Gaussian processes to the discrete domain (Smola and Kondor, 2003). Applications
include in bioinformatics (Borgwardt et al., 2005), community detection (Kloster and Gle-
ich, 2014), generative modelling (Zhou et al., 2020) and solving shortest-path problems
(Crane et al., 2017). Chief examples of KG are the d-regularised Laplacian and diffusion
kernels, given by K(d)
lap := (I + σ2 eL)−d and Kdiff := exp(−σ2 eL/2) respectively. Here, σ2 is
a lengthscale parameter and eL is the normalised graph Laplacian, defined by eL := I − W
with W = [aij/( ̃di
j aij is the
weighted node degree and aij is the weight of the original edge). eL is the analogue of the fa-
miliar Laplacian operator ∇2 = ∂2
in discrete space, describing diffusion
∂x2
1
on G (Chung and Yau, 1999; Chung, 1997).
For large graphs, computing e.g. K(d)
lap exactly can be prohibitively expensive due to the
O(N 3) time complexity of matrix inversion. This motivated the recently-introduced class of
Graph Random Features (GRFs) (Choromanski, 2023), which provide a discrete analogue to
Random Fourier Features (Rahimi and Recht, 2007). These N -dimensional vectors φ(i) ∈
RN are constructed for every node i ∈ N such that their Euclidean dot product is equal to
the kernel evaluation in expectation,
i,j=1 a normalised weighted adjacency matrix ( ̃di = P
+ ... + ∂2
∂x2
n
̃dj)1/2]N
+ ∂2
∂x2
2
[K(2)
lap]ij = E (cid:0)φ(i)⊤φ(j)(cid:1) .
In their paper, Choromanski (2023) provides an elegant algorithm for constructing φ(i): one
simulates m ∈ N random walks out of each node i that terminate with probability p at every
timestep, depositing a 'load' at every node they visit to build up a randomised projection
of the local environment in G. They show that this gives an unbiased estimate of K(2)
lap,
which can be used to construct K(d)
lap for d ∈ N or an asymptotically unbiased approximation
of Kdiff. Since the unbiasedness of the estimator depends on the marginal probabilities
of sampling different finite-length random walks being unmodified (c.f. just its stationary
distribution), it is a natural setting to test our new quasi-Monte Carlo scheme.
(4)
Remarkably, provided the number of repelling walkers is less than or equal to the smallest
node degree, we are able to derive an analytic closed form for the difference in kernel
estimator mean squared error (MSE) between the i.i.d. and transient-repelling mechanisms
for general graphs (deferred to Eq. 32 in App. A.1 for brevity). This enables us to make
the following statement, proved in App. A.1.
Theorem 3.1 (Superiority of repelling random walks for kernel estimation). In the limit
σ → 0, provided the number of walkers in the transient repelling ensemble is smaller than
or equal to the minimum node degree of the graph and the edge-weights of W are equal,
Var([ bK(2)
lapij]repelling ≤ Var([ bK(2)
lapij]i.i.d.
(5)
4
Preprint. Under review.
Figure 2: Relative Frobenius norm of estimates of the 2-regularised Laplace kernel (lower
is better) vs. number of random walks for: i) vanilla GRFs; ii) GRFs with antithetic termi-
nation (Reid et al., 2023a); iii) GRFs with repelling walks; iv) GRFs with both antithetic
termination and repelling walks. Using both QMC schemes together gives the best results
for all graphs considered and the gains are large (sometimes a factor of > 2). N gives the
number of nodes, p is the edge-generation probability for the Erdös-Rényi graphs, and d is
the d-regular node degree. One standard deviation on the mean error is shaded but is too
small to easily see.
for nodes (i, j) separated by at least 2 edges for both i) trees and ii) 2-dimensional grids.
Though we have made some restrictions for analytic tractability, we will empirically observe
In particular,
that the full repelling QMC scheme is effective in much broader settings.
it substantially suppresses kernel estimator variance with many walkers, arbitrary σ and
arbitrary graphs. Extending the proof to these general cases is an exciting open problem.
We also note that our scheme is fully compatible with the recently-introduced QMC scheme
known as antithetic termination (Reid et al., 2023a), which anticorrelates the lengths of
random walkers (by coupling their terminations) but does not modify their trajectories.
Both schemes can be applied simultaneously, inducing negative correlations between both
the walk directions and lengths.
3.1 Pointwise kernel estimation
We now empirically test Eq. 5 for general graphs by comparing the variance of [ bK(2)
lap]ij
under different schemes. In what follows, 'GRFs' refers to graph random features constructed
using i.i.d. walkers, whilst 'q-{a,r,ar}-GRFs' denotes the efficient quasi-Monte Carlo variants
where walkers exhibit antithetic termination ('a') (Reid et al., 2023a), repel ('r'), or both
('ar'). We use these different flavours of (q-)GRFs to generate unbiased estimates bK(2)
lap,
then compute the relative Frobenius norm ∥K(2)
lap∥F between the true and
approximated Gram matrices. Fig. 2 presents the results for various graphs: small Erdős-
Rényi, larger Erdős-Rényi, a binary tree, a d-regular graph, and four standard real-world
examples from (Ivashkin, 2023) (karate, dolphins, football and eurosis). These differ
substantially in both size and structure. We take 100 repeats to compute the variance of
the kernel approximation error, using a regulariser σ = 0.1 and a termination probability
p = 0.5. The gains provided by the repelling QMC scheme (green) are much greater than
those from antithetic termination (orange), but the lowest variance is achieved when both
are used together (red). Note that the gains provided by repelling random walks continue
to accrue as the size of the ensemble grows; with m = 16 walkers the error is often halved.
lap∥F/∥K(2)
lap − bK(2)
5
51015No. random walks0.0020.0040.0060.0080.0100.012Frob. norm errorER (N=20, p=0.2)GRFsq-a-GRFsq-r-GRFsq-ar-GRFs51015No. random walks0.0020.0040.0060.0080.0100.012Frob. norm errorER (N=100, p=0.04)51015No. random walks0.0020.0040.0060.0080.0100.012Frob. norm errorBinary tree (N=127)51015No. random walks0.0020.0040.0060.0080.0100.0120.014Frob. norm errord-regular (N=100, d=10)51015No. random walks0.0020.0040.0060.0080.0100.0120.014Frob. norm errorKarate (N=34)51015No. random walks0.0020.0040.0060.0080.0100.0120.014Frob. norm errorDolphins (N=62)51015No. random walks0.0020.0040.0060.0080.0100.0120.014Frob. norm errorFootball (N=115)51015No. random walks0.0040.0060.0080.0100.0120.014Frob. norm errorEurosis (N=1272)Preprint. Under review.
3.2 Downstream applications: kernel regression for node attribute
prediction
We have both proved (Theorem 3.1) and empirically confirmed (Fig. 2) that using repelling
random walks substantially improves the quality of estimation of the 2-regularised Laplacian
kernel using GRFs. Naturally, this permits better performance in downstream applications
that depend on the approximation. As an example, we follow Reid et al. (2023a) and
consider kernel regression on triangular mesh graphs (Dawson-Haggerty, 2023).
Consider a graph G where each node is associated with a normal vector v(i). The task is to
predict the directions of a random set of missing 'test' vectors (a 5% split) from the remaining
'train' vectors. We compute our (unnormalised) predictions bv(i) as bv(i) := P
lap(i, j)v(j),
where j sums over the training vertices and bK(2)
lap(i, j) is constructed using the GRF and
q-{a,r,ar}-GRF mechanisms described in Sec. 3.1. We compute the average angular error
1−cos θ between the prediction bv(i) and groundtruth v(i) across the test set. We use m = 16
random walks with a termination probability p = 0.5 and a regulariser σ = 0.1, taking 1000
repeats for statistics. Table 1 reports the results. Higher-quality kernel approximations
with repelling random walks give more accurate downstream predictions for all graphs, with
the biggest gains appearing when our repelling scheme is introduced ('r' and 'ar'). The
difference is remarkably big when the number of nodes N is big: on torus, the error is
reduced by a factor of almost 3. Accurate approximation is especially helpful for these large
graphs as exact methods become increasingly expensive.
j bK(2)
Table 1: Angular error 1 − cos θ between true and predicted node vectors when approx-
imating the Gram matrix with GRFs and q-{a,r,ar}-GRFs (lower is better). Brackets
give one standard deviation. Both schemes in combination works best.
Graph
N
cylinder
teapot
idler-riser
busted
torus
210
480
782
1941
4350
GRFs
0.0650(7)
0.0331(2)
0.0528(3)
0.00463(2)
0.000506(1)
Pred error, 1 − cos θ
q-r-GRFs
q-a-GRFs
0.0644(7)
0.0322(2)
0.0521(3)
0.00456(2)
0.000482(1)
0.0466(3)
0.0224(1)
0.0408(2)
0.003833(6)
0.000180(1)
q-ar-GRFs
0.0459(2)
0.0215(1)
0.0408(2)
0.003817(6)
0.000181(1)
Though for concreteness we have considered one particular downstream application, we
stress that improving the kernel estimate can be expected to boost performance in any
algorithm that uses it, e.g. for graph node clustering (Dhillon et al., 2004), shortest-path
prediction (Crane et al., 2017) or simulation of graph diffusion (Reid et al., 2023a).
4 Application 2: approximating PageRank
As a second application, we use repelling random walks to improve numerical estimates of
the PageRank vector: a popular measure of node importance in a graph originally proposed
by Page et al. (1998) to rank websites in search engine results. The PageRank vector is
defined as the stationary distribution of Markov chain whose state space is the set of all
graph nodes N , with a transition matrix
eP := (1 − p)P +
p
N
E.
(6)
Here, p ∈ (0, 1) is a scalar, N is the number of nodes, P is defined in Eq. 1 and E = [1]i,j∈N
is a matrix whose entries are all ones. This encodes the behaviour of a 'surfer' who at
every timestep either teleports to a random node with probability p or moves to one of its
neighbours chosen uniformly at random. Since eP is stochastic, aperiodic and irreducible,
we can define the unique PageRank vector π ∈ RN :
π⊤ eP = π⊤, π⊤1 = 1,
(7)
6
Preprint. Under review.
where we normalised the sum of vector entries to 1. Physically, πj is the stationary prob-
ability that a surfer is at node j. π is very expensive to compute for large graphs and the
form of eP invites MC estimation with random walkers. Fogaras et al. (2005) suggest the
following algorithm.
Algorithm 4.1 (Random walks for PageRank estimation). (Fogaras et al., 2005) Simulate
m ∈ N runs of a simple random walk with transition probability matrix P out of every node
i ∈ N , terminating with probability p at each timestep. Evaluate the estimator bπj as the
fraction of walks terminating at node j, bπj := 1
I(walker terminates at j).
Pm
P
N m
j=1
N
It is straightforward to show that bπ is an unbiased estimator of π (see App. A.2). This is
a natural setting to test an ensemble of repelling random walks. We are able to make the
following surprisingly strong statement.
Theorem 4.2 (Superiority of repelling random walks for PageRank estimation). Supposing
the size of the transient repelling ensemble is smaller than or equal to the minimum node
degree,
for any graph.
Var(bπj)repelling ≤ Var(bπj)i.i.d.
(8)
We defer a full proof to App. A.2 but provide a brief sketch below.
Proof sketch: If the number of walkers is smaller than the minimum node degree, the
behaviours of a transient repelling and i.i.d. ensemble only differ at the first timestep. In
the former scheme walkers are forced to diverge whereas in the latter they are indepen-
dent. The expectation values of the estimators associated with each walker are condition-
ally independent given their node positions at t = 1 and are identical in both schemes
by definition; denote it by f (vt=1). With the i.i.d. ensemble the variance depends on
v(1)⊥v(2)[f (v(1)
E
t=1)] where the node positions of a pair of walkers v(1,2) are indepen-
dent. Meanwhile, for repelling walkers it depends on E
t=1)] where we
condition that v(1,2) cannot be equal. Simple algebra reveals that the latter is smaller,
with the difference depending on the variance of f (vt=1) among the set of neighbours of the
starting node N (vt=0).
v(1)̸=v(2)[f (v(1)
t=1)f (v(2)
t=1)f (v(2)
It is remarkable that Theorem 4.2 holds for arbitrary G. In practice, we find that using
two walkers in the full repelling scheme works well. It is straightforward to use multiple
independent pairs to further improve the estimator bπ, although the quality of approximation
is excellent even with just 2 walkers. Table 2 reports the estimator error πerr := ∥π − bπ∥2
for a termination probability p = 0.3 and 1000 trials on the same graphs as in Sec. 3.1
(on eurosis we take 10000 trials for further variance suppression). As per the theoretical
guarantees, repelling random walks consistently perform better.
Table 2: Mean L2-norm of the difference between the true and approximated PageRank
vectors πerr := ∥π − bπ∥2, using i.i.d. and repelling pairs of random walkers. Lower is
better. Repelling random walks consistently outperform i.i.d. random walks. Paren-
theses give one standard deviation on the mean error.
Graph
N
Small ER
Larger ER
Binary tree
d-regular
karate
dolphins
football
eurosis
20
100
127
100
34
62
115
1272
PageRank error, πerr
i.i.d.
repelling
0.0208(2)
0.00420(2)
0.00290(1)
0.00434(2)
0.0124(1)
0.00686(4)
0.00385(2)
0.000342(2)
0.0196(2)
0.00406(2)
0.00270(1)
0.00422(2)
0.0115(1)
0.00651(4)
0.00376(2)
0.000335(2)
As a brief addendum for the interested reader: bπj is actually a member of a broader class
of functions coined step-by-step linear, defined as follows.
7
Preprint. Under review.
Definition 4.3 (Step-by-step linear functions). Let Ωr denote the set of all infinite-length
walks starting at node r, Ωr := {(vi)∞
i=0 | v0 = r, vi ∈ N , (vi, vi+1) ∈ E}. We refer to a func-
tion y : Ωr → R as step-by-step linear if it takes the form:
y(ω) =
∞
X
i=0
f (vi, i)
i
Y
j=1
g(vj−1, vj, j, j − 1),
(9)
where f : N × (N ∪ {0}) → R and g : N × N × (N ∪ {0}) × (N ∪ {0}) → R.
i=1 is transient repelling. Concretely, the following is true.
These functions have the property that the variance of the corresponding Monte Carlo
estimator is guaranteed to be suppressed by conditioning that the ensemble of random
walks {ω}m
Theorem 4.4 (Variance of step-by-step linear functions is reduced by transient repulsion).
Consider the estimator Y := Pm
i=1 y(ωi) where {ωi}m
i=1 enumerates m (infinite) walks on G
and y : Ωr → R is a step-by-step linear function. Suppose that the sets of walks {ωi}m
i=1 are
either i) i.i.d. or ii) transient repelling (Def. 2.2). Provided that the number of walkers is
smaller than the minimum node degree, we have that:
Var(Yrepelling) ≤ Var(Yi.i.d.).
(10)
We provide a proof and further discussion in Sec. A.3. Interestingly, the step-by-step linear
family also includes φ(i)k, the kth component of the GRF corresponding to the ith node
of G, though of course this alone is insufficient to guarantee suppression of variance of the
kernel estimator φ(i)⊤φ(j).
5 Application 3: approximating graphlet concentrations
Finally, we use repelling random walks to esti-
mate the relative frequencies of graphlets:
in-
duced subgraph patterns within a graph G. For-
mally, a k-node induced subgraph Gk = (Vk, Ek)
satisfies Vk ⊂ V, |Vk| = k and Ek = {(u, v) :
u, v ∈ Vk ∧ (u, v) ∈ E}: that is, a subset of k
connnected nodes together with any edges be-
tween them. For example, for k = 3 the possible
graphlets are a triangle and a wedge (see Fig. 3).
Computing a graph's graphlet concentrations –
the proportions of different k-node graphlets – is
a task of broad interest in biology (Pržulj, 2007; Milenković and Pržulj, 2008) and network
science (Becchetti et al., 2008; Ugander et al., 2013) since it characterises the local structure
of G (Milo et al., 2002). Such concentrations even permit construction of graphlet kernels
K : G × G → R to compare different graphs (Shervashidze et al., 2009).
Figure 3: Graphlets for k = 3
triangle
wedge
For large graphs, exact computation by exhaustive counting is unfeasible because of the
combinatorial explosion in the number of graphlets with N . This motivates random walk
Markov Chain Monte Carlo approaches. Such crawling-based algorithms also benefit from
not requiring access to the entire graph simultaneously: a typical restriction for online
social networks where the graph is only available via API calls to retrieve a particular
node's neighbours (e.g. user's friends). These algorithms are also easily distributed across
machines.
Chen et al. (2016) propose a general algorithm for asymptotically unbiased, efficient es-
timation of graphlet concentrations using random walks. We summarise one particular
instantiation of it for k = 3 below.
Algorithm 5.1 (Graphlet concentration estimation using random walks). (Chen et al.,
2016) Simulate a simple random walk of length L ∈ N (the sampling budget) out of a
randomly selected node. Consider X (3)
i = (Xi, Xi+1, Xi+2) with 1 ≤ i ≤ L − 2, the states
of an augmented Markov Chain whose state space is the ordered 3-tuples of consecutively-
visited nodes. Discard all such states where Xi = Xi+2 (where the walker backtracks), and for
8
Preprint. Under review.
Figure 4: Mean square error on estimates of k = 3 graphlet concentrations with different
numbers of random walks on different graphs. Lower is better. Using the repelling scheme
consistently improves the quality of the estimate compared to independent walks.
the remainder classify the graphlets g(3)
and Ctri := Pn−2
wedge) di+1
2
In the limit of large L, bc(3)
1th node).
concentration of triangle graphlets.
I(g(3)
i−1
tri
i
to get the weighted counts Cwed := Pn−2
I(g(3)
i =
(where di+1 is the degree of the i +
gives an unbiased estimator of the
i−1
i = triangle) di+1
6
Ctri
:=
Ctri+Cwed
The weightings in the computation of C{wed,tri} are included to correct for two sources of
bias: di+1 accounts for the fact that the stationary distribution of the expanded Markov
chain is inversely proportional to the degree of the middle node, π(X (3)
) = (2|V|di+1)−1,
and the combinatorial factors adjust for the fact that 6 states X (3)
correspond to the triangle
graphlet (twice the number of Hamiltonian paths) but only 2 correspond to the wedge.
i
i
We implement Alg. 5.1 with both i) i.i.d. walkers and ii) a repelling ensemble. A rigorous
theoretical analysis of concentration properties is very challenging and is deferred as impor-
tant future work; for now, our study is empirical. Fig. 4 plots the fractional error of the
estimator of triangle graphlet concentration bc(3)
tri against the number of walkers. We use the
same graphs as in Sec. 3, but replace the binary tree with polbooks since for the former
bctri = 0 trivially. We impose a restricted sampling budget with walks of length L = 16
to highlight the benefits of repelling random walks in the transient regime, and take 2500
repeats over all starting nodes for statistics. Repelling random walks consistently perform
better, providing more accurate estimates of the triangle graphlet concentration, and for
some graphs the improvement is large. Alg. 5.1 can be generalised to estimate the concen-
trations larger graphlets with k > 3; we anticipate that repelling random walks will still
prove effective.
6 Conclusion
We have presented a new quasi-Monte Carlo scheme called repelling random walks that
induces correlations between the directions of random walkers on a graph. Estimators con-
structed using this interacting ensemble are guaranteed to remain unbiased but their concen-
tration properties are often substantially improved. We test our algorithm on applications
as diverse as estimating graph kernels, the PageRank vector and graphlet concentrations.
In every case the experimental performance is very strong and often we are able to pro-
vide concrete theoretical guarantees. We hope this work will motivate further research on
developing quasi-Monte Carlo methods to improve sampling on graphs.
9
51015No. random walks0.0100.0150.0200.0250.0300.035Graphlet conc. est. errorER (N=20, p=0.2)i.i.d.repelling51015No. random walks0.00500.00750.01000.01250.01500.01750.0200Graphlet conc. est. errorER (N=100, p=0.04)51015No. random walks0.00250.00300.00350.00400.0045Graphlet conc. est. errord-regular (N=100, d=10)51015No. random walks0.00450.00500.00550.0060Graphlet conc. est. errorPolbooks (N=105)51015No. random walks0.01000.01250.01500.01750.0200Graphlet conc. est. errorKarate (N=34)51015No. random walks0.0070.0080.0090.0100.0110.012Graphlet conc. est. errorDolphins (N=62)51015No. random walks0.00900.00950.01000.01050.01100.0115Graphlet conc. est. errorFootball (N=115)51015No. random walks0.00170.00180.00190.0020Graphlet conc. est. errorEurosis (N=1272)Preprint. Under review.
7 Ethics and reproducibility
Ethics: Our work is foundational with no immediate ethical concerns apparent to us. How-
ever, increases in scalability provided by quasi-Monte Carlo algorithms could exacerbate
existing and incipient risks of graph-based machine learning, from bad actors or as unin-
tended consequences.
Reproducibility: Every effort has been made to guarantee the work's reproducibility. The
core algorithm is clearly presented in Def. 2.1. Accompanying theoretical results are proved
and discussed in the Appendices A.1-A.3, including any assumptions where appropriate.
Source code for experiments will be made publicly available if the manuscript is accepted.
All datasets used correspond to standard graphs and are freely available online; we give
links to suitable repositories in every instance. Results are reported with uncertainties to
facilitate comparison.
8 Relative contributions and acknowledgements
IR conceived and implemented the repelling random walks mechanism, derived the the-
oretical results and prepared the manuscript. KC was crucially involved in the project
throughout, acting as the senior research lead. EB proposed the class of step-by-step linear
functions and made important theoretical contributions. AW provided helpful discussions
and guidance.
IR acknowledges support from a Trinity College External Studentship. AW acknowledges
support from a Turing AI fellowship under grant EP/V025279/1 and the Leverhulme Trust
via CFI.
We thank Kenza Tazi and Austin Trip for their careful readings of the manuscript, and
Yashar Ahmadian for interesting discussions about the relationship with quantum entangle-
ment. Richard Turner provided valuable suggestions and support throughout the project.
References
Noga Alon, Itai Benjamini, Eyal Lubetzky, and Sasha Sodin. Non-backtracking random
walks mix faster. Communications in Contemporary Mathematics, 9(04):585–603, 2007.
URL https://doi.org/10.1142/S021919970700255.
Luigi Amico, Rosario Fazio, Andreas Osterloh, and Vlatko Vedral. Entanglement in many-
body systems. Reviews of modern physics, 80(2):517, 2008. URL https://doi.org/10.
1103/RevModPhys.80.517.
Daniel J Amit, Giorgio Parisi, and Luca Peliti. Asymptotic behavior of the" true" self-
avoiding walk. Physical Review B, 27(3):1635, 1983. URL https://doi.org/10.1103/
PhysRevB.27.1635.
Konstantin Avrachenkov, Nelly Litvak, Danil Nemirovsky, and Natalia Osipova. Monte
carlo methods in pagerank computation: When one iteration is sufficient. SIAM Journal
on Numerical Analysis, 45(2):890–904, 2007. URL https://dl.acm.org/doi/10.1137/
050643799.
Luca Becchetti, Paolo Boldi, Carlos Castillo, and Aristides Gionis. Efficient semi-streaming
algorithms for local triangle counting in massive graphs. In Proceedings of the 14th ACM
SIGKDD international conference on Knowledge discovery and data mining, pages 16–24,
2008. URL https://dl.acm.org/doi/10.1145/1401890.1401898.
Karsten M Borgwardt, Cheng Soon Ong, Stefan Schönauer, SVN Vishwanathan, Alex J
Smola, and Hans-Peter Kriegel. Protein function prediction via graph kernels. Bioinfor-
matics, 21(suppl_1):i47–i56, 2005. URL https://doi.org/10.1093/bioinformatics/
bti1007.
10
Preprint. Under review.
Jun Chen. Two particles' repelling random walks on the complete graph. Electronic Journal
of Probability, 19(none):1 – 17, 2014. doi: 10.1214/EJP.v19-2669. URL https://doi.
org/10.1214/EJP.v19-2669.
Xiaowei Chen, Yongkun Li, Pinghui Wang, and John Lui. A general framework for esti-
mating graphlet statistics via random walk. arXiv preprint arXiv:1603.07504, 2016. URL
https://doi.org/10.48550/arXiv.1603.07504.
Krzysztof Choromanski, Mark Rowland, Vikas Sindhwani, Richard Turner, and Adrian
Weller. Structured evolution with compact architectures for scalable policy optimization.
In International Conference on Machine Learning, pages 970–978. PMLR, 2018. URL
https://doi.org/10.48550/arXiv.1603.07504.
Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane,
Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al.
Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020. URL
https://doi.org/10.48550/arXiv.2009.14794.
Krzysztof M Choromanski, Mark Rowland, and Adrian Weller. The unreasonable effec-
tiveness of structured random orthogonal embeddings. Advances in neural information
processing systems, 30, 2017. URL https://doi.org/10.48550/arXiv.1703.00864.
Krzysztof Marcin Choromanski. Taming graph kernels with random features.
In In-
ternational Conference on Machine Learning, pages 5964–5977. PMLR, 2023. URL
https://doi.org/10.48550/arXiv.2305.00156.
Fan R. K. Chung and Shing-Tung Yau. Coverings, heat kernels and spanning trees. Electron.
J. Comb., 6, 1999. doi: 10.37236/1444. URL https://doi.org/10.37236/1444.
Fan RK Chung. Spectral graph theory, volume 92. American Mathematical Soc., 1997.
Keenan Crane, Clarisse Weischedel, and Max Wardetzky. The heat method for distance
computation. Communications of the ACM, 60(11):90–99, 2017. URL https://dl.acm.
org/doi/10.1145/3131280.
Michael Dawson-Haggerty. Trimesh repository, 2023. URL https://github.com/mikedh/
trimesh.
Inderjit S Dhillon, Yuqiang Guan, and Brian Kulis. Kernel k-means: spectral clustering
and normalized cuts. In Proceedings of the tenth ACM SIGKDD international conference
on Knowledge discovery and data mining, pages 551–556, 2004. URL https://dl.acm.
org/doi/10.1145/1014052.1014118.
Persi Diaconis, Susan Holmes, and Radford M Neal. Analysis of a nonreversible markov
chain sampler. Annals of Applied Probability, pages 726–752, 2000. URL https://doi.
org/10.1214/aoap/1019487508.
Josef Dick, Frances Y Kuo, and Ian H Sloan. High-dimensional integration: the quasi-
monte carlo way. Acta Numerica, 22:133–288, 2013. URL https://doi.org/10.1017/
S0962492913000044.
Vishwaraj Doshi, Jie Hu, and Do Young Eun. Self-repellent random walks on general
graphs–achieving minimal sampling variance via nonlinear markov chains. arXiv preprint
arXiv:2305.05097, 2023. URL https://doi.org/10.48550/arXiv.2305.05097.
Dániel Fogaras, Balázs Rácz, Károly Csalogány, and Tamás Sarlós. Towards scaling fully
personalized pagerank: Algorithms, lower bounds, and experiments. Internet Mathemat-
ics, 2(3):333–358, 2005. URL https://doi.org/10.1007/978-3-540-30216-2_9.
Vladimir Ivashkin. Community graphs repository, 2023. URL https://github.com/
vlivashkin/community-graphs.
11
Preprint. Under review.
Kyle Kloster and David F Gleich. Heat kernel based community detection. In Proceedings
of the 20th ACM SIGKDD international conference on Knowledge discovery and data
mining, pages 1386–1395, 2014. URL https://doi.org/10.48550/arXiv.1403.3148.
Chul-Ho Lee, Xin Xu, and Do Young Eun. Beyond random walk and metropolis-hastings
samplers: why you should not backtrack for unbiased graph sampling. ACM SIGMET-
RICS Performance evaluation review, 40(1):319–330, 2012. URL https://dl.acm.org/
doi/10.1145/2318857.2254795.
Tijana Milenković and Nataša Pržulj. Uncovering biological network function via graphlet
degree signatures. Cancer informatics, 6:CIN–S680, 2008. URL https://doi.org/10.
48550/arXiv.0802.0556.
Ron Milo, Shai Shen-Orr, Shalev Itzkovitz, Nadav Kashtan, Dmitri Chklovskii, and Uri
Alon. Network motifs: simple building blocks of complex networks. Science, 298(5594):
824–827, 2002. URL https://www.science.org/doi/10.1126/science.298.5594.824.
Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The pagerank cita-
tion ranking: Bring order to the web. Technical report, Technical report, stanford Uni-
versity, 1998. URL https://www.cis.upenn.edu/~mkearns/teaching/NetworkedLife/
pagerank.pdf.
Robin Pemantle. A survey of random processes with reinforcement. Probability Surveys, 4
(none):1 – 79, 2007. doi: 10.1214/07-PS094. URL https://doi.org/10.1214/07-PS094.
Nataša Pržulj. Biological network comparison using graphlet degree distribution. Bioin-
formatics, 23(2):e177–e183, 2007. URL https://doi.org/10.1093/bioinformatics/
btl301.
Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. Advances
in neural information processing systems, 20, 2007. URL https://dl.acm.org/doi/10.
5555/2981562.2981710.
Isaac Reid, Krzysztof Choromanski, and Adrian Weller. Quasi-monte carlo graph random
features. arXiv preprint arXiv:2305.12470, 2023a. URL https://doi.org/10.48550/
arXiv.2305.12470.
Isaac Reid, Krzysztof Marcin Choromanski, Valerii Likhosherstov, and Adrian Weller. Sim-
plex random features. In International Conference on Machine Learning, pages 28864–
28888. PMLR, 2023b. URL https://doi.org/10.48550/arXiv.2301.13856.
Rafael A Rosales, Fernando PA Prado, and Benito Pires. Vertex reinforced random walks
with exponential interaction on complete graphs. Stochastic Processes and their Applica-
tions, 148:353–379, 2022. URL https://doi.org/10.1016/j.spa.2022.03.007.
Mark Rowland, Krzysztof M Choromanski, François Chalus, Aldo Pacchiano, Tamas Sarlos,
Richard E Turner, and Adrian Weller. Geometrically coupled monte carlo sampling.
Advances in Neural Information Processing Systems, 31, 2018. URL https://dl.acm.
org/doi/pdf/10.5555/3326943.3326962.
Mark Rowland, Jiri Hron, Yunhao Tang, Krzysztof Choromanski, Tamas Sarlos, and Adrian
Weller. Orthogonal estimation of wasserstein distances.
In The 22nd International
Conference on Artificial Intelligence and Statistics, pages 186–195. PMLR, 2019. URL
https://doi.org/10.48550/arXiv.1903.03784.
Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borg-
wardt. Efficient graphlet kernels for large graph comparison.
In Artificial intelligence
and statistics, pages 488–495. PMLR, 2009. URL https://api.semanticscholar.org/
CorpusID:17557614.
Alexander J Smola and Risi Kondor. Kernels and regularization on graphs. In Learning The-
ory and Kernel Machines: 16th Annual Conference on Learning Theory and 7th Kernel
Workshop, COLT/Kernel 2003, Washington, DC, USA, August 24-27, 2003. Proceed-
ings, pages 144–158. Springer, 2003. URL https://people.cs.uchicago.edu/~risi/
papers/SmolaKondor.pdf.
12
Preprint. Under review.
Pierre Tarrès. Vertex-reinforced random walk on z eventually gets stuck on five points. The
Annals of Probability, 32(3):2650–2701, 2004. ISSN 00911798. URL http://www.jstor.
org/stable/3481644.
Bálint Tóth. The" true" self-avoiding walk with bond repulsion on z: Limit theorems. The
Annals of Probability, pages 1523–1556, 1995. URL https://doi.org/10.1214/aop/
1176987793.
Johan Ugander, Lars Backstrom, and Jon Kleinberg. Subgraph frequencies: Mapping the
empirical and extremal geography of large graph collections. In Proceedings of the 22nd
international conference on World Wide Web, pages 1307–1318, 2013. URL https://
doi.org/10.48550/arXiv.1304.1548.
Feng Xia, Jiaying Liu, Hansong Nie, Yonghao Fu, Liangtian Wan, and Xiangjie Kong.
Random walks: A review of algorithms and applications. IEEE Transactions on Emerging
Topics in Computational Intelligence, 4(2):95–107, 2019. URL https://doi.org/10.
1109/TETCI.2019.2952908.
Felix Xinnan X Yu, Ananda Theertha Suresh, Krzysztof M Choromanski, Daniel N
Holtmann-Rice, and Sanjiv Kumar. Orthogonal random features. Advances in neural in-
formation processing systems, 29, 2016. URL https://doi.org/10.48550/arXiv.1610.
09072.
Yufan Zhou, Changyou Chen, and Jinhui Xu. Learning manifold implicitly via explicit heat-
kernel learning. Advances in Neural Information Processing Systems, 33:477–487, 2020.
URL https://doi.org/10.48550/arXiv.2010.01761.
Zhuojie Zhou, Nan Zhang, and Gautam Das. Leveraging history for faster sampling of
online social networks. arXiv preprint arXiv:1505.00079, 2015. URL https://doi.org/
10.48550/arXiv.1505.00079.
13
Preprint. Under review.
A Appendices
A.1 Proof of Theorem 3.1 (superiority of repelling random walks for
kernel estimation
In this appendix, we prove Theorem 3.1: namely, that using transient repelling random
walks reduces the mean square error of graph random feature (GRF) estimates of the 2-
regularised Laplacian kernel, defined by:
h
bK(2)
lap
i
ij
(cid:16)
:=
I − eL
(cid:17)−2
ij
= (1 + σ2)−2
(cid:18)
I −
σ2
1 + σ2 W
(cid:19)−2
(11)
where eL is the Laplacian, σ is a regulariser and W is a normalised weighted adjacency matrix
with elements W = (cid:2)aij/( ̃di
i,j=1 (with ̃di = P
j aij the degree of the ith node and aij
the weight of the edge before normalisation). Ignoring the overall normalisation constant
and absorbing the factor of σ2/(1 + σ2) into W, wlg we will now consider estimation of
̃dj)1/2(cid:3)N
bKij = (I − W)−2
(12)
where W = [wij]N
i,j=1.
Directly from the definition of the GRF vector (see e.g. (Choromanski, 2023) or (Reid et al.,
2023a)), we have that
bKij = φ(i)⊤φ(j) =
1
m2
X
X
X
x∈N
ωix∈Ωix
ωjx∈Ωjx
eω(ωix)
p(ωix)
eω(ωjx)
p(ωjx)
N (ωix)N (ωjx)
(13)
where
N (ωix) :=
m
X
I (cid:0)ωix ∈ ̄Ωl
(cid:1) .
(14)
l=1
Here: m ∈ N is the number of random walkers simulated out of each node; Ωix is the set of
all walks on the graph between the nodes indexed i and x; ωix is a member of this set; eω(ω)
is a function that returns the product of weights of edges traversed by a graph random walk
ω; and p(ω) is a function that returns the marginal probability of a random walk (equal to
((1 − p)/d)len(ω) – with 0 < p < 1 a finite termination probability, d the node degree and
len(ω) the walk length – in the case of a d-regular graph). ̄Ωl denotes the lth walk out of
node i such that N (ωix) counts the empirical number of walkers completing a particular
subwalk ωix, a discrete random variable between 0 and m. Since E(N (ωix)) = mp(ωix), it
is straightforward to see that
E(φ(i)⊤φ(j)) =
X
X
X
eω(ωix)eω(ωjx)
x∈N
ωix∈Ωix
ωjx∈Ωjx
X
=
ωij ∈Ωij
(len(ωij) + 1)eω(ωij) = (I − W)−2
(15)
which confirms that the estimator is unbiased. Our task is now to determine how the variance
of bKij depends on whether the ensemble of m walkers from each node is i) independent or
ii) repelling. We will see that, under some conditions, it is guaranteed to be smaller in the
latter case.
The following is true:
(cid:16)
E
bK2
ij
(cid:17)
=
1
m4
X
X
x,y∈N
ωix,ωiy
eω(ωix)
p(ωix)
eω(ωiy)
p(ωiy)
E(N (ωix)N (ωiy))
(16)
*
X
ωjx,ωjy
eω(ωjx)
p(ωjx)
eω(ωjy)
p(ωjy)
14
E(N (ωjx)N (ωjy))
.
Preprint. Under review.
This makes clear that the object of central importance will be
where x, y ∈ N . We will now consider how this depends on i) the pair of subwalks (ωix, ωiy)
and ii) the presence or absence of repulsion.
E (N (ωix)N (ωiy))
(17)
To avoid notational clutter, we will write expressions as if the graph is d-regular with the
understanding that it is trivial to relax this without changing any conclusions, making the
replacement: dlen(ωix) → Qlen(ωix)−1
di.
i=0
i.i.d. walkers: Begin with the simpler i.i.d. case. First consider the case that ωix ̸= ωiy,
ωix /∈ ωiy and ωiy /∈ ωix: namely, that the walks are distinct and neither is a (strict) subwalk
of the other. It follows that a single walker cannot take both subwalks simultaneously. We
also assume that both walks are of length len(ωi(x,y)) ≥ 1. Then we have that
" m
X
m
X
#
E [N (ωix)N (ωiy)] = E
I(ωix ∈ Ωl2 )I(ωix ∈ Ωl2 ))
l1=1
l2=1
= m(m − 1)
(cid:18) 1 − p
d
(cid:19)len(ωix)+len(ωiy)
.
(18)
What about if ωix ∈ ωiy? It is straightforward to convince oneself that
E [N (ωix)N (ωiy)] = m(m − 1)
(cid:19)len(ωix)+len(ωiy)
(cid:18) 1 − p
d
+ m
(cid:18) 1 − p
d
(cid:19)len(ωiy)
(19)
where the extra second correlation term comes from a single walker completing both sub-
walks. Lastly, suppose that len(ωix) = 0 (i.e. one of the subwalks has zero length). Then
we have that
E [N (ωix)N (ωiy)] = m2
.
(20)
(cid:19)len(ωiy)
(cid:18) 1 − p
d
Now we move onto the repelling case, which is substantially more difficult.
Repelling walkers: For tractability, we will consider the transient repulsion scheme de-
scribed in Def. 2.2. Suppose that we have N ′
α walkers at some node indexed α ̸= i, with
the set of neighbouring nodes including nodes labelled β and γ (i.e. β, γ ∈ N (α)). An
important quantity is
From Def. 2.1, we have that
E(NβNγ|N ′
α).
Nβ = Nα//d + ε1,
Nγ = Nα//d + ε2,
(21)
(22)
where // denotes truncating integer division ε1,2 are anticorrelated binary random vari-
ables. The reason they are anticorrelated is that a walker that transitions to β cannot also
transition to γ. With a little work, one can convince oneself that
E(NβNγ|N ′
α) =
(cid:19)2
(cid:18) N ′
α
d
+
R
d
(cid:18) R − 1
d − 1
−
(cid:19)
,
R
d
(23)
α%d, the remainder after the the walkers have been partitioned into blocks of
α: in
where R := N ′
size d. From this form, we can see that we will be concerned with the statistics of N ′
particular how E(Nα
Let Nα be a random variable denoting the number of walkers at node α of some particular
walk on the graph. Then let N ′
α denote the number of walkers surviving the 'p-step', where
each walker terminates independently with probability p. Let Nβ denote the number of
walkers that subsequently hop to node β on the walk. It is clear that Nβ = N//d + ε, with ε
′2) behaves. Understanding this is our next task.
15
Preprint. Under review.
a random variable that takes a value of 1 with probability R
It is simple to show that
d and 0 with probability 1 − R
d .
E(N 2
β ) =
E(N ′
α
2)
d2 + E
2) = E(Nα
(cid:18) R
d
(1 −
(cid:19)
)
.
R
d
(24)
2)(1 − p)2 + E(Nα)p(1 − p) (law of iterated
It is also trivially the case that E(N ′
α
expectations). The second term in Eq. 24 is generically difficult to describe analytically,
but it is simple in the special case that N ′
α. In particular, here we have that
(cid:19)len(ωiα)
α < d so R = N ′
E(N 2
α) = E(Nα) = m
(cid:18) 1 − p
d
(25)
whereupon, referring back to Eq. 23,
E(NβNγ|N ′
α) = 0.
(26)
It is trivial to see why this must be the case: supposing we begin with fewer than d walkers
at node i, in the transient repelling scheme they all diverge at the first timestep. Any
subsequent node α on some walk is occupied by at most 1 walker which chooses one of
its dα neighbours at random, so value of NβNγ (product of occupations of its child nodes)
always vanishes.
It is encouraging that our algebraic approach reproduces this intuitive
result.
It follows immediately that, for walks diverging at some node not equal to the
starting node i, E [N (ωix)N (ωiy)] = 0.
What about if the walkers instead diverge at i? Here the result is different because E(Ni) =
m, the initial number of particles, and Var(m) = 0 since the total number of walkers is a
fixed hyperparameter. After just a little work,
E(NβN γ) =
(1 − p)2
d(d − 1)
m(m − 1)
(27)
and therefore
E [N (ωix)N (ωiy)] =
d
d − 1
m(m − 1)
(cid:18) 1 − p
d
(cid:19)len(ωix)+len(ωiy)
.
(28)
This is also intuitive: the repelling scheme shifts probability mass onto walks that diverge
at i, enhancing this correlation term.
The subwalk case is also straightforward. Supposing ωix ∈ ωiy, we can use Eq. 25 to show
that
E [N (ωix)N (ωiy)] = m
(cid:19)len(ωiy)
(cid:18) 1 − p
m
(29)
because if the walkers immediately diverge then we can only sample both ωiy and ωix ∈ ωiy
if a single walk traverses both. Lastly, if len(ωix) = 0, we still have that
E [N (ωix)N (ωiy)] = m2
(cid:19)len(ωiy)
(cid:18) 1 − p
d
(30)
which is natural because if one (or both) of the walks is of zero length then the repulsion
scheme cannot modify the correlation term.
We summarise these observations in Table 3, denoting c := 1−p
d
len(ωix) for compactness.
and ωix as shorthand for
Table 3
Class
E(N (ωix)N (ωiy))
i.i.d.
transient repelling
Same walk, ωix = ωiy
Subwalk, ωix ∈ ωiy
Different walks, diverge at i
Different walks, diverge at d ̸= i
len(ωix) = 0
mcωix + m(m − 1)c2ωix
mcωiy + m(m − 1)cωix+ωiy
m(m − 1)cωix+ωiy
m(m − 1)cωix+ωiy
m2cωiy
d
mcωix
mcωiy
d−1 m(m − 1)cωix+ωiy
0
m2cωiy
16
Preprint. Under review.
More explicitly, we can write
E(N (ωix)N (ωiy)) =
m(m − 1)cωix+ωiy I(both > 0)
+mcωlongerI(subwalks, both > 0)
+m2cωlonger I(len 0)
if i.i.d.
di
di − 1
m(m − 1)cωix+ωiy I(both > 0, div at i)
+mcωlonger I(subwalks, both > 0)
+m2cωlonger I(len 0)
if repelling
(31)
where only the first term differs. Here, I(both > 0) means both walks traverse at least
one edge, I(len 0) means one of the walks is of length 0, I(subwalks) means ωix ∈ ωiy (or
vice versa), and ωlonger denotes the length of the longer walk. We will now insert these
expressions into Eq. 16 to compute the difference in variance of bKij with the two possible
coupling schemes.
After tedious but straightforward algebra, we arrive at the following closed form:
Var
(cid:16)h
bKij
i
(cid:17)
i.i.d.
(cid:18)h
− Var
(m − 1)2
m2
(cid:20) W2
(1 − W)2
ij
(cid:19)
=
i
repelling
!2
bKij
(cid:21)
−
didj
(di − 1)(dj − 1)
(m − 1)2
m2
X
X
wii′ wjj′ wii′′ wjj′′
i′ ∈N (i)
i′′∈N (i)\i′
j′ ∈N (j)
j′′ ∈N (j)\j′
(cid:20)
1
(1 − W)2
(cid:21)
(cid:20)
i′j′
1
(1 − W)2
(cid:21)
i′′j′′
+
di
di − 1
m − 1
m2
+
dj
dj − 1
m − 1
m2
X
X
x
X
ωix>0
X
x
ωjx>0
eω(ωix)2
p(ωix)
eω(ωjx)2
p(ωjx)
[B(x, j) − C(x, j)]
[B(x, i) − C(x, i)]
+
m − 1
m
(cid:20) di
di − 1
(B(i, j) − C(i, j)) +
dj
dj − 1
(B(j, i) − C(j, i))
(cid:21)
(b)
where
and
B(x, i) :=
X
i′∈N (i)
(cid:20)
w2
ii′
1
(1 − W)2
(cid:21)2
xi′
−
1
di
C(x, i) :=
X
i′∈N (i)
w2
ii′
(cid:20) W
(1 − W)2
(cid:21)2
xi′
−
1
di
X
wii′
i′∈N (i)
(cid:20)
1
(1 − W)2
(cid:21)
xi′
2
X
wii′
i′∈N (i)
(cid:20) W
(1 − W)2
(cid:21)
xi′
2
.
(a)
(32)
(33)
(34)
Note that both B and C are always positive by Jensen's inequality. It is remarkable that
such a simple expression exists for the difference in kernel estimator variance between the
i.i.d. and transient repelling schemes.
Showing the class of graphs for which this is guaranteed to be positive is a challenging open
problem, but we are able to make progress in some tractable special cases.
For instance, consider the limit w → 0 with all the graph weights equal, W = wA.
In
this case, when computing matrix elements we can just retain terms corresponding to the
shortest path. For example,
(cid:20)
1
(1 − wA)2
(cid:21)
ij
= (cid:2)1 + 2wA + 3w2A2 + ...(cid:3)
ij = M (lij)(lij + 1)wlij + O(wlij +1)
(35)
17
Preprint. Under review.
where lij denotes the length of the shortest path between nodes i and j and M (lij) denotes
its multiplicity: the number of such unique paths that exist in G. To give examples, for a tree
M (lij) = 1 and for a square grid M (lij) = (cid:0)a+b
(cid:1), where a is the difference in x-coordinates
of nodes i and j and b is the difference in y coordinates.
a
When will (a) be positive? Provided that nodes i and j are separated by at least 2 edges,
the following is true:
(m − 1)2
m2
(cid:20) w2A2
!2
(cid:21)
(1 − wA)2
ij
=
(m − 1)2
m2 M (lij)2(lij − 1)2w2lij + O(w2lij +1),
(36)
and
didj
(di − 1)(dj − 1)
(m − 1)2
m2
w4 X
(cid:20)
X
i′∈N (i)
i′′∈N (i)\i′
j′∈N (j)
j′′N (j)\j′
1
(1 − wA)2
(cid:21)
(cid:20)
i′j′
1
(1 − wA)2
(cid:21)
i′′j′′
=
didj
(di − 1)(dj − 1)
(m − 1)2
m2
X
X
M (li′j′ )M (li′′j′′ )wli′ j′ +li′′ j′′ +4(li′j′ + 1)(li′′j′′ + 1)
i′ ∈N (i)
i′′∈N (i)\i′
j′ ∈N (j)
j′′N (j)\j′
+ O(wli′ j′ +li′′j′′ +5).
(37)
Note that, since i′ ∈ N (i) and j′ ∈ N (j), it is trivially the case that lij − 2 ≤ li′j′ ≤ lij + 2.
In Eq. 37, only terms where li′j′ = li′′j′′ = lij − 2 will give contributions of the same order
as the leading term O(w2lij ) in Eq. 36. The condition that Eq. 36 is greater at the leading
order is then:
M (lij)2 ≥
didj
(di − 1)(dj − 1)
X
M (li′j′)M (li′′j′′ )
(38)
i′ ∈N (i),i′′ ∈N (i)\i′ ,j′ ∈N (j),j′′ ∈N (j)\j′
l
i′ j′ =l
i′′j′′ =lij −2
where we remind the reader that M (lij) denotes the degeneracy (number) of shortest paths
(of length lij) between nodes i and j. This encodes the topological constraint that is
sufficient for variance reduction with repelling random walkers on an equal-weights graph
as w → 0. Heuristically, the set of nodes N (i) cannot be too connected to the nodes N (j).
A cursory numerical check suggests that Eq. 38 is not generically satisfied for every pair of
nodes (i, j) on arbitrary graphs, but it does seem to very often be true. We can, however,
identify some particular examples where it is guaranteed to hold. For example, it is trivially
true for trees for which M (lij) = 1 but the RHS is 0. To wit: for trees there is a unique
shortest path between nodes i and j and it is only the case that li′j′ = lij − 2 if both i′ and
j′ lie on this path. Then conditioning that i′′ ̸= i′ and j′′ ̸= j′ means that we cannot fulfil
li′′j′′ = lij − 2, whereupon the sum is over the empty set so evaluates to 0. It is also true
for the two dimensional square grid. Without loss of generality, locate node i at coordinates
(0, 0) and node j at (a, b). If a = 0 or b = 0 there is a unique shortest path so the inequality
follows trivially. If a = 1 then M (lij) = b + 1 whereas the RHS evaluates to 2 (d/(d − 1))2
(cid:1) (a walker on
which is smaller for b ≥ 1 and d = 4. Finally, if a, b > 1, then M (lij) = (cid:0)a+b
a shortest path between nodes i and j must take a steps in one direction and b steps in the
other, but we are free to permute their order). Meanwhile, the sum on the RHS of Eq. 38
evaluates to:
a
(cid:18) d
(cid:19)2
d − 1
* 2 *
(cid:18)a + b − 2
a − 2
(cid:19)(cid:18)a + b − 2
(cid:19)
b − 2
(cid:19)2!
+
(cid:18)a + b − 2
a − 1
whereupon the ratio RHS/LHS is:
(cid:18) d
(cid:19)2
d − 1
* 2 *
a(a − 1)b(b − 1) + a2b2
[(a + b)(a + b − 1)]2
(cid:20)
(cid:19)2
=
(cid:18) d
d − 1
*
2ab
(a + b)2
a(a − 1) + b(b − 1)
(a − 1)(b − 1) + ab
(cid:21)−1
?
≤ 1
1 +
18
(39)
(40)
Preprint. Under review.
The expression in square brackets is greater than 1 so its inverse is smaller than 1. Hence,
it is sufficient that
(a + b)2
2ab
=
(a − b)2
2ab
+ 2 ≥
(cid:18) d
(cid:19)2
d − 1
(41)
which is trivially always true for d = 4. The inequality in Eq. 38 then holds in all cases
where nodes i and j are separated by at least 2 edges, so terms (a) will indeed be positive
on a two-dimensional square grid.
Having asserted that the terms labelled (a) in Eq. 32 will sum to a positive value under
certain conditions (namely: graphs characterised by Eq. 38 with equal edge weights w → 0,
considering nodes i and j separated by at least 2 edges), we now proceed to consider the
terms labelled (b).
When will (b) be positive? Now we consider the remaining terms involving e.g. B(x, i)−
C(x, i) where x, i ∈ N . These demand a little more care because the sum over x ∈ N means
that we need to account for terms where x = i even when considering off-diagonal terms of
the kernel estimate i ̸= j. Note that
(cid:2)(1 − wA)−2(cid:3)
B(x, i) = dVari′∈N (i)
(42)
the empirical variance of the matrix elements Kxi′ among the set of vertices i′ that neighbour
i.
Denote by ̃lxi the smallest walk length for which the variance of the number of walks from
x to the set of nodes N (i) is nonzero,
xi′ ,
̃lxi = min
l∈N
(cid:0){l | Vari′∈N (i)(Al
This might well correspond to the shortest path between x and i′ ∈ N (i), but this is not
necessarily the case (i.e. if all the neighbours i′ have an equal number of equally short paths
to x so the variance on this quantity vanishes). Then we have that
h
A
(cid:2)(1 − wA)−2(cid:3)
xi′) ̸= 0}(cid:1) .
+ O(w2 ̃lxi+1)
xi′ = d( ̃lxi + 1)2w2 ̃lxi Vari′∈N (i)
B(x, i) = dVari′∈N (i)
(43)
(44)
̃lxi
xi′
i
and
C(x, i) = dVari′∈N (i)
where Vari′∈N (i)
̃lxi = lxi − 1 and Vari′∈N (i)
h
A
̃lxi
xi′
(cid:2)wA(1 − wA)−2(cid:3)
i
i
h
A
̃lxi
xi′
= d−1
d2 .
xi′ = d( ̃lxi)2w2 ̃lxi Vari′∈N (i)
i
h
A
̃lxi
xi′
+ O(w2 ̃lxi+1)
(45)
denotes this first nonvanishing variance. For trees with x ̸= i,
To leading order in w, it is trivial to see that B(x, i) > C(x, i). Inserting back into Eq. 32
and noting the positivity of the prefactor ̃ω(ωix)2
p(ωix) , the positivity of (2) follows. Note that in
this section we have not assumed anything about the structure of G beyond equal weights
and w → 0. The topological constraints originate solely from the terms in (a).
Combining the above arguments, we conclude that the using the transient repelling scheme
is indeed guaranteed to suppress the variance of kernel estimators bKij for nodes i and j
separated by at least 2 edges under certain conditions: namely, that we have an equally-
weighted graph with w → 0, and that the topological condition in Eq. 38 is true (which is
the case for e.g. trees and two-dimensional grids).
We stress that, in practice, the scheme performs very well even for much more general classes
of graphs and in the non-asymptotic w limit. We defer extending the proof above to include
these cases as future work.
A.2 Proof of Theorem 4.2 (superiority of repelling random walks for
PageRank estimation
In this appendix, we show how random walks can be used to estimate to the PageRank vector
and prove that using a transient repelling ensemble reduces the estimator mean square error
(Theorem 4.2).
19
Preprint. Under review.
Our intention is to estimate the vector π, defined as the stationary distribution of the
transition matrix eP defined in Eq. 6 and reproduced below:
eP := (1 − p)P +
p
N
E.
(46)
The reader should refer back to Eq. 6 for all symbol definitions. We then require that
π⊤ eP = π⊤, π⊤1 = 1.
Rearranging and Taylor expanding (1 − (1 − p)P)−1, it is straightforward to convince oneself
that the solution is given by
(47)
πi =
p
N
X
∞
X
j∈N
k=0
(1 − p)kPk
ji.
(48)
This is nothing other than a sum over all walks ωji from each of the graph nodes j to
node i, each weighted by a factor of (cid:0) 1−p
p (with dk generalising to the product of node
degrees along ωji if the graph is not d-regular) and normalised by the number of vertices
N . Equivalently, supposing we simulate a random walk out of a random node on the graph
j, it is the probability that it terminates at node i. This invites the algorithm proposed by
Fogaras et al. (2005) and shown in Alg. 4.1. We construct the unbiased estimator
(cid:1)k
d
bπi =
1
N m
X
m
X
j∈N
l=1
I[Ω(j)
l
terminates at node i]
(49)
where Ω(j)
l
denotes the lth walk (out of a total of m ∈ N) simulated from node j.
Our task is now to consider the variance properties of the estimator bπ when ensembles of
walkers out of each node are either i) independent or ii) repelling according to our QMC
scheme defined in Def. 2.1. Evidently,
E(bπ2
i ) =
X
1
N 2m2
j1,j2∈N
m
X
E
n
I[Ω(j1)
l1
l1,l2=1
terminates at node i ] I[Ω(j2)
l2
terminates at node i ]
o
.
(50)
Only walkers out of the same node are correlated so it is sufficient to consider the behaviour
of terms j1 = j2. In particular, we we need to determine whether the value of
E
n
I[Ω(j)
l1
terminates at node i ] I[Ω(j)
l2
terminates at node i ]
o
(51)
is suppressed with repelling random walks for fixed arbitrary j ∈ N . We will refer to this
as the correlation term.
First consider the special case j ̸= i so all walks are of length at least 1. We also consider
transient repulsion (see Def. 2.2) so that walkers only repel until they diverge, and assume
that the number of walkers is smaller than or equal to the minimum node degree of the
graph, m ≤ mini∈N (di). For i.i.d. walkers, the correlation term in Eq. 51 evaluates to
(cid:21)
(cid:19)2
(cid:21)2
(cid:20)
(cid:20)
(cid:21)
(cid:20)
p2 (1 − p)2
P
1 − (1 − p)P
= p2
(cid:18) 1 − p
dj
X
X
1
1 − (1 − p)P
1
1 − (1 − p)P
ij
j′′i
(52)
Meanwhile, repelling walkers cannot initially take the same edge (under the assumption that
the number of coupled walkers is smaller than the minimum node degree), so the equivalent
term evaluates to
j′′∈N (j)
j′∈N (j)
j′i
p2
(cid:18) 1 − p
dj
(cid:19)2 (cid:18) dj
(cid:19) X
X
dj − 1
j′∈N (j)
j′′∈N (j)\j′
(cid:20)
1
1 − (1 − p)P
(cid:21)
(cid:20)
j′i
1
1 − (1 − p)P
(cid:21)
j′′i
.
(53)
This differs from Eq. 52 in that i) the variable j′′ in the sum over the neighbours of j can
dj
no longer be equal to j′ since the walks repel, and ii) there is an extra factor of
dj −1 to
20
Preprint. Under review.
account for the increase the conditional probability of choosing j′′ given that j′ becomes
excluded when the first walker picks it ('without replacement').
Denote the matrix element f (j′, i) :=
in Eqs 52 and 53 is equal to
h
1
1−(1−p)P
i
j′i
. Then the difference between the terms
(cid:19)2
p2
(cid:18) 1 − p
dj
X
X
j′∼j
j′′∼j
f (j′, i)f (j′′, i)
(cid:20)
1 −
dj
dj − 1
I(do not share first edge)
(cid:21)
.
(54)
This can be rewritten
(cid:19)2
p2
(cid:18) 1 − p
dj
dj
dj − 1
= p2 (1 − p)2
X
X
f (j′, i)f (j′′, i)
(cid:20)
I(share first edge) −
j′∼j
j′′∼j
1
dj − 1
1
dj
X
j′∼j
f (j′, i)2 −
1
dj
X
j′∼j
f (j′, i)
1
dj
2
(cid:21)
≥ 0
(55)
where we used Jensen's inequality.
To complete the proof, we consider the subcase i = j. For i.i.d. walkers, the correlation
term evaluates to
(cid:20)
p2
1
1 − (1 − p)P
(cid:21)2
ii
(cid:20)
1 +
= p2
= p2
1 + 2(1 − p)
(cid:20)
(1 − p)P
1 − (1 − p)P
(cid:21)
(cid:21)2
ii
P
1 − (1 − p)P
ii
+ (1 − p)2
(cid:20)
P
1 − (1 − p)P
!
(cid:21)2
ii
(56)
For repelling walkers, we need to consider contributions from i) both walkers terminating
immediately, ii) one terminating and one leaving then returning to i, and iii) both walkers
leaving (to different neighbours (i′ ̸= i′′) then returning to i. Enumerating these possibilities,
we get:
(cid:18)
p2
1 + 2(1 − p)
(cid:20)
P
1 − (1 − p)P
(cid:21)
+
ii
(cid:19)2
(cid:18) 1 − p
di
di
di − 1
X
X
i′∈N (i)
i′′∈N (i)\i′
(cid:20)
1
1 − (1 − p)P
(cid:21)
(cid:20)
i′i
1
1 − (1 − p)P
(57)
.
(cid:21)
i′′i
Only the final term differs compared to Eq. 56. It is of precisely the same form as considered
above with i = j, so we immediately deduce that it is smaller with repelling walkers. It
follows that when i = j repelling random walkers also yield lower variance estimators bπj.
Having considered both i ̸= j and i = j and proved that the variance of the estimator bπ is
reduced in both cases, the proof is complete.
A.3 Proof of Theorem 4.4 (variance of step-by-step linear functions is
reduced by transient repulsion)
In this section, we supplement the discussion at the end of 4, identifying a general class of
functions whose variance is suppressed by conditioning that random walks exhibit transient
repulsion.
Following Def. 4.3, let Ωr denote the set of all infinite-length walks starting at node r,
i=0 | v0 = r, vi ∈ N , (vi, vi+1) ∈ E}. Recall that we refer to a function y : Ωr → R
Ωr := {(vi)∞
as step-by-step linear if it takes the form:
y(ω) =
∞
X
i=0
f (vi, i)
i
Y
j=1
21
g(vj−1, vj, j, j − 1).
(58)
Preprint. Under review.
An example of such a function provided by φ(i)k, the k-th component of the graph random
feature corresponding to node i, for which f (vi, i) = I(vi = k) and g(vj−1, vj, j, j − 1) =
wvj−1,vj dvj−1
I(tj > p). Here, wvj−1,vj is the weight of the edge (vj−1, vj) ∈ E, dvj−1 is
1−p
the degree of the node vj−1 and tj ∼ Unif(0, 1) is a termination random variable which
controls whether the walk ends at the jth timestep. Another example is provided by the kth
component of the PageRank vector estimator bπk, in which case f (vi, i) = I(vi = k)I(tj > p)
and g(vj−1, vj, j, j − 1) = I(tj−1 < p), ensuring that y(w) evaluates to 1 if the walker
terminates at node k and is zero otherwise.
In Theorem 4.4, we asserted that, for the estimator Y := Pm
merates m (infinite) walks on G and y : Ωr → R is a step-by-step linear function),
i=1 y(ωi) (where {ωi}m
i=1 enu-
Var(Yrepelling) ≤ Var(Yi.i.d.).
provided that the number of walkers is smaller than the minimum node degree. This is
proved as follows.
(59)
First note that under both the i.i.d. and (transient) repelling schemes the marginal prob-
ability of each walk p(ω) is identical. This means that to prove variance reduction is if
sufficient to consider whether
h
i ?
Ei.i.d.
y(ω(1))y(ω(2))
≥ Erep
i
h
y(ω(1))y(ω(2))
(60)
where (ω(1), ω(2)) is a pair of walks sampled from either the i.i.d. or repelling scheme. Begin
by writing
y(ω(k)) = f (v0, 0) +
∞
X
i=1
f (v(k)
i
, i)
i
Y
j=1
g(v(k)
j−1, v(k)
j
, j, j − 1) = f (v0, 0) + h
(cid:16)
(v(k)
i
)∞
i=1
(cid:17)
(61)
0 = v(2)
with k = {1, 2}. Note that we took v(1)
0 = v0 since the walkers begin at the same
It follows from the definition
node, and introduced the function h to simplify notation.
of transient repulsion that the random variables h((v(k)
)∞
i=1) are conditionally independent
given (v(1)
1 ) since at this point the walkers have diverged and stop repelling. Moreover,
since in both cases the marginal distribution over ω is identical, for Var(Y ) to be reduced
by repulsion we just require that
1 , v(2)
i
Ei.i.d.
(cid:16)
h
h
(v(1)
i
)∞
i=1
(cid:16)
(cid:17)
h
(v(2)
i
)∞
i=1
(cid:17)i ?
≥ Erep
(cid:16)
h
h
(v(1)
i
)∞
i=1
(cid:17)
(cid:16)
h
(v(2)
i
)∞
i=1
(cid:17)i
.
(62)
1
1
and v(2)
1 , v(2)
In the i.i.d. scheme, v(1)
are independent and are uniformly distributed among the
set of neighbours N (v0), each with probability 1/d0. Meanwhile, in the repelling scheme,
(v(1)
1 ) is uniformly distributed among the set {(vi, vj)|vi, vj ∈ N (v0), vi ̸= vj} – i.e. all
d0(d0 − 1) possible pairs of distinct neighbours of node v0. Then Eq. 62 evaluates to
1
d0(d0 − 1)
1 )E(h|v(2)
1 )
1 )E(h|v(2)
E(h|v(1)
E(h|v(1)
1 ) −
?
≥ 0
(63)
X
X
1
d2
0
v
v
(1)
1
(2)
1
∈N (v0)
∈N (v0)
v
∈N (v0)
(1)
1
∈N (v0)\v
v
(2)
1
(1)
1
where we used that h(1,2) are conditionally independent given v(1,2)
expression is nothing other than
1
. Rearranging, this
1
d0 − 1
Varv1∈N (v0)(E(h|v1))
?
≥ 0
(64)
where the variance is being computed over the d0 nodes that neighbour v0. Eq. 64 trivially
holds, confirming that Var(Yrepelling) ≤ Var(Yi.i.d.) and completing the proof.
Note that Theorem 4.4 does not obviate the long proof in Sec. A.1: suppressing the variance
of the GRF coordinate φ(i)k, i, k ∈ N is not sufficient to conclude that the variance of the
dot product bKij = φ(i)⊤φ(j) is also reduced since now we need to consider correlations
between φ(i)k1 and φ(i)k2 with k1 ̸= k2. On the other hand, it does subsume Theorem 4.2
as a special case, though we keep this section in the manuscript for clarity of presentation.
22
|
|
http://arxiv.org/abs/2310.04832v1 | "2023-10-07T14:41:59" | "2023-10-07T14:41:59" | HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing
Equations | The discovery of governing differential equations from data is an open
frontier in machine learning. The sparse identification of nonlinear dynamics
(SINDy) \citep{brunton_discovering_2016} framework enables data-driven
discovery of interpretable models in the form of sparse, deterministic
governing laws. Recent works have sought to adapt this approach to the
stochastic setting, though these adaptations are severely hampered by the curse
of dimensionality. On the other hand, Bayesian-inspired deep learning methods
have achieved widespread success in high-dimensional probabilistic modeling via
computationally efficient approximate inference techniques, suggesting the use
of these techniques for efficient stochastic equation discovery. Here, we
introduce HyperSINDy, a framework for modeling stochastic dynamics via a deep
generative model of sparse governing equations whose parametric form is
discovered from data. HyperSINDy employs a variational encoder to approximate
the distribution of observed states and derivatives. A hypernetwork
\citep{ha_hypernetworks_2016} transforms samples from this distribution into
the coefficients of a differential equation whose sparse form is learned
simultaneously using a trainable binary mask \citep{louizos_learning_2018}.
Once trained, HyperSINDy generates stochastic dynamics via a differential
equation whose coefficients are driven by a Gaussian white noise. In
experiments, HyperSINDy accurately recovers ground truth stochastic governing
equations, with learned stochasticity scaling to match that of the data.
Finally, HyperSINDy provides uncertainty quantification that scales to
high-dimensional systems. Taken together, HyperSINDy offers a promising
framework for model discovery and uncertainty quantification in real-world
systems, integrating sparse equation discovery methods with advances in
statistical machine learning and deep generative modeling. | [
"Mozes Jacobs",
"Bingni W. Brunton",
"Steven L. Brunton",
"J. Nathan Kutz",
"Ryan V. Raut"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04832v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04832v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"68T07 (Primary) 37H10, 60H10 (Secondary)",
"I.2; J.2"
] | HYPERSINDY: DEEP GENERATIVE MODELING OF NONLINEAR
STOCHASTIC GOVERNING EQUATIONS
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
2
3
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Mozes Jacobs
Harvard University
mozesjacobs@g.harvard.edu
Bingni W. Brunton
University of Washington
bbrunton@uw.edu
Steven L. Brunton
University of Washington
sbrunton@uw.edu
J. Nathan Kutz
University of Washington
kutz@uw.edu
Ryan V. Raut
Allen Institute
ryan.raut@alleninstitute.org
ABSTRACT
The discovery of governing differential equations from data is an open frontier in machine learning.
The sparse identification of nonlinear dynamics (SINDy) [Brunton et al., 2016] framework enables
data-driven discovery of interpretable models in the form of sparse, deterministic governing laws.
Recent works have sought to adapt this approach to the stochastic setting, though these adaptations
are severely hampered by the curse of dimensionality. On the other hand, Bayesian-inspired deep
learning methods have achieved widespread success in high-dimensional probabilistic modeling via
computationally efficient approximate inference techniques, suggesting the use of these techniques for
efficient stochastic equation discovery. Here, we introduce HyperSINDy, a framework for modeling
stochastic dynamics via a deep generative model of sparse governing equations whose parametric
form is discovered from data. HyperSINDy employs a variational encoder to approximate the
distribution of observed states and derivatives. A hypernetwork [Ha et al., 2016] transforms samples
from this distribution into the coefficients of a differential equation whose sparse form is learned
simultaneously using a trainable binary mask [Louizos et al., 2018]. Once trained, HyperSINDy
generates stochastic dynamics via a differential equation whose coefficients are driven by a Gaussian
white noise. In experiments, HyperSINDy accurately recovers ground truth stochastic governing
equations, with learned stochasticity scaling to match that of the data. Finally, HyperSINDy provides
uncertainty quantification that scales to high-dimensional systems. Taken together, HyperSINDy
offers a promising framework for model discovery and uncertainty quantification in real-world
systems, integrating sparse equation discovery methods with advances in statistical machine learning
and deep generative modeling.
1
Introduction
Across numerous disciplines, large amounts of measurement data have been collected from dynamical phenomena
lacking comprehensive mathematical descriptions. It is desirable to model these data in terms of governing equations
involving the state variables, which typically enables insight into the physical interactions in the system. To this end,
recent years have seen considerable progress in the ability to distill such governing equations from data alone (e.g.,
[Schmidt and Lipson, 2009, Brunton et al., 2016]). Nonetheless, this remains an outstanding challenge for systems
exhibiting apparently stochastic nonlinear behavior, particularly when lacking even partial knowledge of the governing
equations. Such systems thus motivate probabilistic approaches that not only reproduce the observed stochastic behavior
(e.g., via generic stochastic differential equations (SDEs) [Friedrich et al., 2011] or neural networks [Girin et al., 2021,
Lim and Zohren, 2021]), but do so via discovered analytical representations that are parsimonious and physically
informative [Boninsegna et al., 2018].
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
We are particularly interested in model-free methods that seek to discover both the parameters and functional form
of governing equations describing the data. To this end, the sparse identification of nonlinear dynamics (SINDy)
framework [Brunton et al., 2016] has emerged as a powerful data-driven approach that identifies both the coefficients
and terms of differential equations, given a pre-defined library of candidate functions. The effectiveness of SINDy for
sparse model discovery derives from the tendency of physical systems to possess a relatively limited set of active terms.
Extensions of the SINDy framework have sought to increase its robustness to noise, offer uncertainty quantification
(UQ), and make it suitable for modeling stochastic dynamics [Boninsegna et al., 2018, Niven et al., 2020, Messenger and
Bortz, 2021, Hirsh et al., 2021, Callaham et al., 2021, Fasel et al., 2022, Wang et al., 2022]. However, these extensions
have generally relied upon computationally expensive approaches to learn the appropriate probability distributions.
As such, a unified and computationally tractable formulation of SINDy that meets these additional goals is presently
lacking.
Variational inference (VI) methods represent a class of techniques for addressing the complex and often intractable
integrals arising in exact Bayesian inference, instead approximating the true posterior via simple distribution(s).
Recently, the combination of amortized VI [Ganguly et al., 2022] with the representational capacity of neural networks
has emerged as a powerful, efficient approach to probabilistic modeling, with widespread application in the form of
deep generative models [Kingma and Welling, 2014, Rezende and Mohamed, 2015]. Despite the success of these
approaches for dynamical modeling (e.g., [Girin et al., 2021]), applications thus far have utilized generic state space
formulations or parameter inference on a known functional form of the dynamics. Thus, the potential for VI to facilitate
probabilistic equation discovery remains largely unexplored.
1.1 Contributions
In this work, we propose HyperSINDy, a VI-based SINDy implementation that learns a parameterized distribution of
ordinary differential equations (ODEs) sharing a common sparse form. Specifically, HyperSINDy employs a variational
encoder to parameterize a latent distribution over observed states and derivatives, then uses a hypernetwork [Ha et al.,
2016, Pawlowski et al., 2018] to translate samples from this distribution into the coefficients of a sparse ODE whose
functional form is learned in a common optimization. In this way, HyperSINDy is able to model complex stochastic
dynamics through an interpretable analytical expression – technically, a random ODE [Han and Kloeden, 2017] – whose
coefficients are parameterized by a white noise process.
Specific contributions of the HyperSINDy framework include:
• Efficient and Accurate Modeling of Stochastic Dynamics at Scale. Through VI, we circumvent the curse of
dimensionality that hampers other methods in identifying sparse stochastic equations. Specifically, HyperSINDy can
accurately discover governing equations for stochastic systems having well beyond two spatial dimensions, which
existing approaches have not exceeded [Boninsegna et al., 2018, Callaham et al., 2021, Wang et al., 2022, Huang
et al., 2022, Tripura and Chakraborty, 2023]. Importantly, HyperSINDy's generative model is able to learn a complex
distribution over the coefficients, and variance proportionately scales to match that of the data.
• Generative Modeling of Dynamics. Once trained, HyperSINDy generates a random dynamical system whose vector
field is parameterized by a Gaussian white noise. Hence, our approach efficiently arrives at a generative model
for both the system dynamics and the exogenous disturbances (representing, e.g., unresolved scales). This permits
simulations that reproduce the stochastic dynamical behavior of the observed process, while providing a natural
method for quantifying uncertainty of the model parameters and propagating uncertainty in the probabilistic model
forecast.
• Interpretable Governing Equations Discovery. In contrast to other deep generative approaches for modeling
stochastic dynamics, HyperSINDy discovers the analytical form of a sparse governing equation without a priori
knowledge. Sparsity promotes human readable models where each term corresponds to an interpretable physical
mechanism. This notion of interpretability, based on sparsity, is appealing in the traditional perspective of engineering
and physics.
In section 1.2, we discuss relevant literature. In section 2, we provide a background on the specific methods and
mathematics that inspired our method. In section 3, we describe HyperSINDy. In section 4, we show results on various
experiments. In section 5, we conclude with a discussion of our method, its limitations, and possible future directions.
1.2 Related Work
HyperSINDy bridges two parallel lines of work concerning data-driven modeling for stochastic dynamics: namely,
probabilistic sparse equation discovery and deep generative modeling.
2
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 1: HyperSINDy Framework. HyperSINDy employs an inference model and generative model to discover
an analytical representation of observed stochastic dynamics in the form of a random (nonlinear) ODE fz(x). The
inference model is an encoder neural network that maps (x, ̇x) to the parameters μ and σ of qφ(z|x, ̇x). ˆz can be
sampled using a simple reparameterization of μ and σ. The generative model predicts the derivative via a hypernetwork
H, which transforms z into Ξz, the coefficients of the ODE. fz(x) comprises a function library Θ, the coefficients Ξz,
and sparse mask M . If ̇x is not available (e.g., after training), z is sampled from the prior z ∼ pθ(z) to produce Ξz.
In the legend, trainable parameters are shown in green. The loss function comprises terms related to 1) the derivative
reconstructions, 2) the latent distribution qφ(z|x, ̇x), and 3) sparsity of the discovered equation. See accompanying
pseudocode 1 and 2 for details on batch-wise training.
Most probabilistic implementations of SINDy have concerned UQ and noise robustness in the deterministic setting,
rather than modeling stochastic dynamics per se. Of these approaches, ensembling methods [Fasel et al., 2022] have
achieved state-of-the-art UQ and noise robustness for deterministic SINDy models, and were recently shown [Gao
et al., 2023] to offer a computationally efficient alternative to earlier Bayesian implementations of SINDy [Niven et al.,
2020, Hirsh et al., 2021] leveraging costly sampling routines to compute posterior distributions. Nonetheless, a model
of the process noise is crucial for accurate UQ in the stochastic dynamics setting. Multiple studies have generalized
the SINDy framework for the identification of parametric SDEs [Boninsegna et al., 2018, Callaham et al., 2021], with
3
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
three such studies recently performed in the Bayesian setting [Wang et al., 2022, Huang et al., 2022, Tripura and
Chakraborty, 2023]. However, as discussed in these works, existing methods for approximating the drift and diffusion
terms of the SDE (e.g., constructing histograms for the Kramers-Moyal expansion) are severely hampered by the curse
of dimensionality, with computational cost generally scaling exponentially with SDE state dimension. Thus, an efficient
and scalable formulation of SINDy for stochastic dynamics remains lacking.
A separate line of work has leveraged advances in probabilistic deep learning for modeling stochastic dynamics, with
deep generative models achieving state-of-the-art performance across a wide range of modeling tasks (e.g., [Yoon et al.,
2019, Girin et al., 2021]). Although these models do not typically involve explicit dynamical representations, the new
paradigm of physics-informed machine learning [Karniadakis et al., 2021] has motivated numerous developments at
this intersection (e.g., [Lopez and Atzberger, 2021, Takeishi and Kalousis, 2021, Yang et al., 2020, Zhang et al., 2019].
Regarding the specific goal of (stochastic) equation discovery, several recent works have successfully employed VAEs
to learn the coefficients of a generic (or pre-specified) SDE representation within a (potentially lower-dimensional)
latent space[Hasan et al., 2022, García et al., 2022, Nguyen et al., 2021, Zhong and Meidani, 2023]. We propose to
similarly leverage a VAE-like architecture to perform inference on a latent stochastic process; however, we seek to
additionally discover a structural representation of the governing laws, which can yield considerable physical insight
into the system [Boninsegna et al., 2018, Nayek et al., 2021, Wang et al., 2022]. Taken together, we seek to bridge the
above fields via a unified deep learning architecture (trainable end-to-end with backpropagation) that enables discovery
of the functional form of a governing stochastic process, along with posterior distributions over the discovered system
coefficients (e.g., for UQ).
2 Background
We briefly overview the SINDy and VAE frameworks, as well as an implementation of an L0 loss, before describing
their integration within the HyperSINDy architecture.
Sparse Identification of Nonlinear Dynamics The SINDy [Brunton et al., 2016] framework leverages sparse
regression to enable discovery of a parsimonious system of differential equations from time-ordered snapshots. Thus,
consider a system with state x(t) ∈ Rd governed by the ODE:
̇x(t) = f (x(t))
(1)
Given m observations of the system in time X = [x(t1), x(t2), ..., x(tm)]T and the estimated time derivatives
̇X = [ ̇x(t1), ̇x(t2), ..., ̇x(tm)]T , we construct a library of candidate functions Θ(X) = [θ1(X), θ2(X), ..., θl(X)].
̇X = Θ(X)Ξ, to identify the optimal functions and coefficients in Θ and Ξ,
We then solve the regression problem,
respectively. A sparsity-promoting regularization function R is typically added to this model discovery problem, yielding
the final optimization, ˆΞ = arg minΞ( ̇X − Θ(X)Ξ)2 + R(Ξ). Although we focus on this basic implementation, we
note that there have been numerous extensions of the original SINDy framework (for a recent overview, see [Kaptanoglu
et al., 2022]), many of which can be easily incorporated into the present framework.
Variational Autoencoder The VAE framework [Kingma and Welling, 2014] elegantly integrates variational inference
(VI) with deep learning architectures, providing an efficient and powerful approach toward probabilistic modeling.
VAEs assume that a set of observations x derives from a corresponding set of latent states z. VAEs construct an
approximate posterior distribution qφ(z|x) and maximize the evidence lower bound (ELBO) of the log likelihood of the
data pθ(x):
log pθ(x) ≥ ELBO(x, z) = Eqφ(z|x)[log pθ(x|z)] − DKL(qφ(z|x)||pθ(z))
where φ and θ and are the parameters of the inference (encoder) and generative (decoder) models, respectively. The
"reparameterization trick" enables sampling from qφ(z|x) using z = μ(z) + σ(z) ⊙ ε while still training the network
end-to-end with backpropagation. After training, new observations are easily generated by sampling from the prior
pθ(z), typically a unit Gaussian with diagonal covariance.
(2)
L0 Regularization The L0 norm is ideal for sparse regression problems as it penalizes all nonzero weights equally,
regardless of magnitude. As L0 regularization poses an intractable optimization problem, the L1 regularization (lasso)
– which penalizes the actual values of the learned weights – is a more common technique to achieve sparsity in
practice. Nonetheless, incorporation of an L0-norm penalty [Zheng et al., 2019] into SINDy was recently found
to have considerable advantages [Champion et al., 2020], motivating us to adopt a backpropagation-compatible L0
regularization. Accordingly, we implement one such method recently proposed by Louizos et al. [2018], which penalizes
a trainable mask using the hard-concrete distribution.
4
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Specifically, let M ∈ Rd be the desired sparse mask. Let s be a binary concrete random variable [Maddison et al., 2017,
Jang et al., 2017] distributed in (0, 1) with probability density qφ(s), cumulative density Qφ(s), location log α, and
temperature β. Let φ = (log α, β). Suppose we have γ < 0 and ζ > 1. We define each element m in M as a hard
concrete random variable computed entirely as a transformation of s. Thus, learning an optimal m necessitates learning
qφ(s), which simplifies to optimizing log α (we fix β). Sampling from qφ(s) and backpropagating into log α motivates
use of the reparameterization trick (as in the VAE above) with ε ∼ U(0, 1). Then, m is computed.
s = Sigmoid((log ε − log(1 − ε) + log α)/β)
m = min(1, max(0, s(ζ − γ) + γ))
After training, we obtain m using our optimized log α parameter:
m = min(1, max(0, Sigmoid(log α)(ζ − γ) + γ))
We train M using the following loss:
L0(M ) =
d
(cid:88)
j=1
Sigmoid(log αj − β log
γ
ζ
)
(3)
(4)
(5)
Refer to [Louizos et al., 2018] for the full derivation. In short, this provides a backpropagation-compatible approach to
enforce sparsity via a trainable, element-wise mask.
3 HyperSINDy
We combine advances in Bayesian deep learning with the SINDy framework to propose HyperSINDy, a hypernetwork
[Ha et al., 2016, Pawlowski et al., 2018] approach to parsimoniously model stochastic nonlinear dynamics via a noise-
parameterized vector field whose sparse, time-invariant functional form is discovered from data. In brief, HyperSINDy
uses a variational encoder to learn a latent distribution over the states and derivatives of a system, whose posterior
is regularized to match a Gaussian prior. Once trained, a white noise process generates a time-varying vector field
by updating the coefficients of the discovered (random) ODE. Across a range of experiments, new noise realizations
generate stochastic nonlinear dynamics that recapitulate the behavior of the original system, while also enabling UQ on
the learned coefficients. Fig. 1 provides an overview of our approach and problem setting, which we detail below.
Problem Setting Stochastic equations are fundamental tools for mathematically modeling dynamics under uncertainty.
In general, the precise physical source of uncertainty is unknown and/or of secondary importance [Friedrich et al., 2011,
Duan, 2015, Särkkä and Solin, 2019]; as such, several formulations exist. A common choice is the Langevin-type
SDE with explicitly separated deterministic (drift) and stochastic (diffusion) terms. Alternatively, we may consider a
deterministic ODE with stochastic parameters, i.e., a random ODE (RDE), which is another well-established framework
[Arnold, 1998, Duan, 2015] with wide-ranging real-world applications (e.g., fluctuating resources in biological systems
[Kloeden and Pötzsche, 2013, Caraballo and Han, 2016]). Here, we adopt the RDE formulation in the widely studied
setting of i.i.d. noise [Arnold, 1998, Caraballo and Han, 2016]. We find this formulation practically advantageous for
integration with deep generative modeling and VI, enabling a powerful and scalable approach to stochastic dynamics.
Importantly, as any (finite-dimensional) SDE can be transformed into an equivalent RDE and vice versa [Han and
Kloeden, 2017]; these practical advantages can be exploited without compromising relevance to canonical SDE
representations (as we will empirically demonstrate).
As above, let x0:T be the observations from times 0 to T of the state of a system, xt ∈ Rn. We assume these data are
generated from some stochastic dynamics ̇x = fz(xt), where z is a latent random variable to modeled as an i.i.d. noise
process. We wish to identify a family of sparse vector field functions fz constrained to a common functional form for all
z ∈ Rd (i.e., only the coefficients of f are time-varying, reflecting the system's dependence on fluctuating quantities).
With this framing, we seek to approximate both the functional form fz and a posterior estimate of the latent noise
trajectory z = [z0, z1, ..., zT ]T associated with each observed trajectory x0:T. To do so, we employ a variational
encoder to learn an inference model for the latent space p(z|x, ̇x) and a generative model p( ̇x|x, z) subject to ̇x = fz(x),
as detailed below. Ultimately, once trained, we may generate new trajectories of x simply by iteratively sampling z
from its Gaussian prior (i.e., constructing new sample paths of the driving noise).
Generative Model Consider the following factorization of the conditional generative model with parameters θ:
We assume that z is independent of x, so pθ(z|x) = pθ(z). pθ( ̇x|z, x) describes how the state x and latent z are
transformed into the derivative, while pθ(z) is a prior over the latent distribution of states and their derivatives. We
pθ( ̇x, z|x) = pθ( ̇x|z, x)pθ(z)
(6)
5
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
choose pθ(z) to be a standard Gaussian with diagonal covariance: pθ(z) = N (0, I). There are numerous ways to
implement fz(x), which parameterizes pθ( ̇x|z, x). Following the SINDy framework, which seeks interpretable models
in the form of sparse governing equations, we adapt 1 to arrive at the following implementation for fz(x):
fz(x) = Θ(x)(Ξz ⊙ M ).
(7)
where ⊙ indicates an element-wise multiplication. Θ(x) is a matrix expansion of x using a pre-defined library of
basis functions, which can include any rational functions, such as polynomial (e.g., x2
1, x1x2) or trigonometric (e.g.,
sin x1, tanh x3) functions. Ξz is a matrix of coefficients that is output by a hypernetwork H that takes in z as input:
Ξz = H(z). M is a matrix of values Mij ∈ [0, 1] that is trained with a close approximation to a differentiable L0 norm.
Specifically, the values of M are simulated using a hard concrete distribution. As such, M enforces sparsity in the
terms of each equation through the element-wise multiplication (Ξz ⊙ M ). Refer to to the Background section for more
details on M .
We constrain fz to a d-parameter family of ODEs sharing a common functional form. Specifically, H implements
an implicit distribution pθ(Ξ|z) with z ∈ Rd. Although we cannot compute the density of pθ(Ξ|z) exactly, we can
generate an ensemble of possible derivative functions by feeding samples z ∼ pθ(z) into the hypernetwork: Ξz = ψ(z).
Inference Model Our inference model is defined by the approximate posterior, qφ(z|x, ̇x), with parameters φ.
qφ(z|x, ̇x) is implemented by a neural network E and the reparameterization trick, i.e., μq, σq = E(x, ̇x); ˆz =
μq + ε ⊙ σq.
Training We train the model end-to-end with backpropagation to minimize the following loss function:
loss = ( ̇x − fˆz(x))2 + βDKL(qφ(z|x, ̇x)||pθ(z)) + λL0(M )
(8)
where β and λ are hyperparameters. The loss function optimizes the parameters φ and θ, where φ are the parameters of
E (i.e., the variational parameters) and θ are the parameters of H and M (note that pθ(z) has fixed parameters). Refer
to the Appendix for a full derivation of this loss function, and to Background for details on the sparsity-related loss
L0(M ) (especially equation 5). To speed up training, every set number of epochs, we permanently set values of M
equal to 0 if the magnitude of corresponding coefficients fall below a specific threshold value.
4 Results
We evaluate the performance of HyperSINDy on four stochastic dynamical systems. Across a range of (dynamical)
noise levels, we seek to assess the accuracy of models identified by HyperSINDy and the degree to which uncertainty
estimates faithfully reflect the level of simulated noise. Refer to the Appendix for full details on data generation,
training, and simulations.
4.1 Stochastic Equation Discovery
First, we show results for 3D Stochastic Lorenz and 3D Stochastic Rössler datasets, simulated by:
̇x = ω(y − x)
̇x = −y − z
(9)
(10)
where (ω, ρ, β) and (a, b, c) are iteratively sampled (at each timestep) from normal distributions with scale σ and mean
(10, 28, 8
3 ) and (0.2, 0.2, 5.7), respectively. We train a HyperSINDy model on three trajectories from each system, with
σ = 1, 5, 10. Refer to figure 2 for the full results.
̇y = x(ρ − z) − y
̇y = x + ay
̇z = xy − βz
̇z = b + z(x − c)
Lorenz
Rössler
HyperSINDy correctly identifies most terms in each equation. Notably, increasing noise has little impact on the mean
coefficients learned by HyperSINDy; instead, the estimated standard deviations of these coefficients proportionately
scale with the dynamical noise. Furthermore, HyperSINDy correctly identifies which dynamical terms contain more
noise and only increases the standard deviation of those terms, while maintaining tight bounds on other terms (i.e. xy in
̇y for Lorenz). Moreover, HyperSINDy is able to simulate the original (stochastic) dynamical behavior even as the noise
level increases (blue trajectories). On the other hand, because HyperSINDy also successfully identifies the deterministic
functional form despite process noise, it is able to produce smooth trajectories (purple) by forecasting with the mean of
the discovered equation ensemble.
Moreover, we ran separate experiments generating 10 trajectories (each with a different random seed, and each generated
from a different initial condition) for each noise level of both systems. In total, we trained one HyperSINDy model and
one E-SINDy model on each trajectory, yielding 30 HyperSINDy models and 30 E-SINDy models. We evaluated the
RMSE of the mean and standard deviation of the discovered equations, as compared to ground truth. Refer to Table 1
for the full results. HyperSINDy outperforms E-SINDy on both mean and standard deviation for each experiment.
6
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 2: 3D Stochastic Lorenz and Rossler. HyperSINDy models trained on trajectories of varying noise (σ). The
mean and standard deviation of the discovered governing equation coefficients are shown. Refer to 9 and 10 for the
ground truth equations. Red trajectories indicate sample test trajectories simulated with the given σ. Purple trajectories
are generated from HyperSINDy using the mean of the discovered governing equations, while blue trajectories are
generated by iteratively sampling from HyperSINDy's learned generative model. The test and HyperSINDy trajectories
are generated from the same initial condition.
Table 1: Total coefficient RMSE relative to ground truth equations
Lorenz
Rossler
Param
HyperSINDy
E-SINDy
HyperSINDy
E-SINDy
1
5
10
STD
MEAN 0.082 ± 0.004
0.598 ± 0.045
MEAN 0.117 ± 0.022
0.4 ± 0.055
MEAN 0.203 ± 0.047
0.279 ± 0.085
STD
STD
0.18 ± 0.029
1.296 ± 0.083
0.268 ± 0.064
0.971 ± 0.024
0.349 ± 0.103
0.913 ± 0.016
0.029 ± 0.035
0.828 ± 0.059
0.086 ± 0.047
0.807 ± 0.012
0.228 ± 0.138
0.812 ± 0.014
0.077 ± 0.04
0.849 ± 0.012
0.296 ± 0.199
0.875 ± 0.023
0.699 ± 0.551
0.875 ± 0.028
4.2 Recovering drift-diffusion dynamics
The preceding analyses validate HyperSINDy's capacity for stochastic equation discovery. As HyperSINDy adopts
an RDE modeling strategy (i.e., a noise-parameterized ODE [Arnold, 1998, Han and Kloeden, 2017], rather than an
SDE with separable drift and diffusion), validation was demonstrated on RDE-simulated data to enable straightforward
comparison with ground truth. Crucially, RDEs are conjugate to SDEs [Han and Kloeden, 2017], so this distinction
is not fundamental. Nonetheless, this raises the question of how HyperSINDy learns to represent SDE-simulated
dynamics.
7
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 3: Recovering drift and diffusion behavior in the stochastic Lotka-Volterra model.. K-M coefficients
computed on sample trajectories from each of the three models (Euler-Maruyama integration, ∆t = 0.01). From left to
right: the ground truth SDE, the HyperSINDy-discovered system, and the Stochastic SINDy-discovered system.
To address this question, we simulate a 2D SDE to enable direct comparison against the leading method, stochastic
SINDy [Boninsegna et al., 2018], as implemented in Python [Nabeel et al., 2022] (which cannot easily scale to higher
dimensions). Specifically, we simulate a widely used model for population dynamics, the stochastic Lotka-Volterra
system with state-dependent diffusion:
̇x = x − xy + σx(x, y)N (0, 1)
̇y = −y + xy + σy(x, y)N (0, 1)
(11)
where we have:
σx(x, y) = 0.25x − 0.09y
σy(x, y) = −0.09x + 0.25y
Figure 3 illustrates the results of this analysis. Notably, HyperSINDy learns an expression whose terms correspond to
those of the original drift function, thus enabling physical insight into the system. Moreover, although the diffusion term
is not directly comparable with HyperSINDy's representation of stochasticity (coefficient noise), we may numerically
estimate drift and diffusion coefficients from HyperSINDy's simulated trajectories. Specifically, we may estimate the
first two Kramers-Moyal (K-M) coefficients, which derive from a Taylor expansion of the master equation (and from
which derives the Fokker-Planck equation), and which fully describe the Markovian dynamics. Notably, HyperSINDy
captures the appropriate deterministic (drift) and stochastic (diffusion) behavior of the system, recapitulating the
state-dependence of these terms as seen in the original system – even performing favorably to stochastic SINDy in this
setting.
4.3 High Dimensional Stochastic Discovery
Lastly, we assess HyperSINDy's capacity for Bayesian inference/stochastic modeling for high dimensional stochastic
systems, which are not amenable to existing analytical SDE discovery methods (e.g., [Boninsegna et al., 2018, Callaham
et al., 2021]). Thus, we simulate a stochastic version of the Lorenz-96 system using:
̇xi = Fi + xi+1xi−1 − xi−2xi−1 − xi
(12)
8
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 4: 10D Stochastic Lorenz-96. A sample test trajectory with σ = 10 (top) and sample HyperSINDy trajectory
(middle) after training on a dataset with σ = 10. The bottom boxes show the mean and standard deviation of coefficients
in the discovered governing equations (cf. 9).
for i = 1, ..., 10 where x−1 = x9, x0 = x10, and x11 = x1. We iteratively sample each Fi from a normal distribution:
Fi ∼ N (8, 10). Refer to Fig. 4 for the full results. HyperSINDy correctly identifies all terms in the system, while also
correctly learning a high variance coefficient exclusively for the forcing terms, Fi. In addition, HyperSINDy produces
sample trajectories that match the stochastic dynamical behavior of ground truth sample trajectories.
5 Discussion
We have provided an overview of HyperSINDy, a neural network-based approach to sparse equation discovery for
stochastic dynamics. Importantly, HyperSINDy is unique in its ability to provide analytical representations and UQ in
the setting of high-dimensional stochastic dynamics. The present work represents a proof of concept for this architecture.
We envision numerous future directions for extending the algorithmic and theoretical aspects of HyperSINDy – e.g.,
evaluation in the context of other noise types and with respect to convergence in the continuous limit. Moreover,
while we employ a fairly straightforward implementation of SINDy, numerous developments of the SINDy framework
[Kaptanoglu et al., 2022] may be smoothly incorporated into the HyperSINDy architecture. Finally, the integration
of SINDy into a neural network framework paves the way for future developments that incorporate advances in
probabilistic machine learning with interpretable equation discovery.
9
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
References
L. Arnold. Random Dynamical Systems. Springer Monographs in Mathematics. Springer, Berlin, Heidelberg, 1998.
ISBN 978-3-642-08355-6 978-3-662-12878-7. doi: 10.1007/978-3-662-12878-7. URL http://link.springer.
com/10.1007/978-3-662-12878-7.
L. Boninsegna, F. Nüske, and C. Clementi. Sparse learning of stochastic dynamical equations. The Journal of Chemical
Physics, 148(24):241723, Mar. 2018. ISSN 0021-9606. doi: 10.1063/1.5018409. URL https://doi.org/10.
1063/1.5018409.
S. L. Brunton, J. L. Proctor, and J. N. Kutz. Discovering governing equations from data by sparse identification of
nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 113(15):3932–3937, Apr. 2016.
ISSN 0027-8424, 1091-6490. doi: 10.1073/pnas.1517384113. URL https://pnas.org/doi/full/10.1073/
pnas.1517384113.
J. L. Callaham, J.-C. Loiseau, G. Rigas, and S. L. Brunton. Nonlinear stochastic modelling with Langevin regression.
Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 477(2250):20210092, June
2021. ISSN 1364-5021, 1471-2946. doi: 10.1098/rspa.2021.0092. URL https://royalsocietypublishing.
org/doi/10.1098/rspa.2021.0092.
T. Caraballo and X. Han. Applied Nonautonomous and Random Dynamical Systems. SpringerBriefs in Mathematics.
Springer International Publishing, Cham, 2016. ISBN 978-3-319-49246-9 978-3-319-49247-6. doi: 10.1007/
978-3-319-49247-6. URL http://link.springer.com/10.1007/978-3-319-49247-6.
L. Castrejon, N. Ballas, and A. Courville.
Improved Conditional VRNNs for Video Prediction. pages 7608–
7617, 2019. URL https://openaccess.thecvf.com/content_ICCV_2019/html/Castrejon_Improved_
Conditional_VRNNs_for_Video_Prediction_ICCV_2019_paper.html.
K. Champion, P. Zheng, A. Y. Aravkin, S. L. Brunton, and J. N. Kutz. A Unified Sparse Optimization Framework to
Learn Parsimonious Physics-Informed Models From Data. IEEE Access, 8:169259–169271, 2020. ISSN 2169-3536.
doi: 10.1109/ACCESS.2020.3023625. URL https://ieeexplore.ieee.org/document/9194760/.
J. Duan. An Introduction to Stochastic Dynamics. Cambridge University Press, New York, NY, 1st edition edition, Apr.
2015. ISBN 978-1-107-42820-1.
U. Fasel, J. N. Kutz, B. W. Brunton, and S. L. Brunton. Ensemble-SINDy: Robust sparse model discovery in the
low-data, high-noise limit, with active learning and control. Proceedings of the Royal Society A: Mathematical,
Physical and Engineering Sciences, 478(2260):20210904, Apr. 2022. doi: 10.1098/rspa.2021.0904. URL https:
//royalsocietypublishing.org/doi/10.1098/rspa.2021.0904. Publisher: Royal Society.
R. Friedrich, J. Peinke, M. Sahimi, and M. Reza Rahimi Tabar. Approaching complexity by stochastic methods: From
biological systems to turbulence. Physics Reports, 506(5):87–162, Sept. 2011. ISSN 03701573. doi: 10.1016/j.
physrep.2011.05.003. URL https://linkinghub.elsevier.com/retrieve/pii/S0370157311001530.
A. Ganguly, S. Jain, and U. Watchareeruetai. Amortized Variational Inference: Towards the Mathematical Foundation
and Review, Sept. 2022. URL http://arxiv.org/abs/2209.10888. arXiv:2209.10888 [cs, math, stat].
L. M. Gao, U. Fasel, S. L. Brunton, and J. N. Kutz. Convergence of uncertainty estimates in Ensemble and Bayesian
sparse model discovery, Jan. 2023. URL http://arxiv.org/abs/2301.12649. arXiv:2301.12649 [cs, math,
stat].
C. A. García, P. Félix, J. M. Presedo, and A. Otero. Stochastic embeddings of dynamical phenomena through variational
autoencoders. Journal of Computational Physics, 454:110970, Apr. 2022. ISSN 0021-9991. doi: 10.1016/j.jcp.2022.
110970. URL https://www.sciencedirect.com/science/article/pii/S0021999122000328.
L. Girin, S. Leglaive, X. Bie, J. Diard, T. Hueber, and X. Alameda-Pineda. Dynamical Variational Autoencoders: A
Comprehensive Review. Foundations and Trends® in Machine Learning, 15(1-2):1–175, Dec. 2021. ISSN 1935-8237,
1935-8245. doi: 10.1561/2200000089. URL https://www.nowpublishers.com/article/Details/MAL-089.
Publisher: Now Publishers, Inc.
D. Ha, A. Dai, and Q. V. Le. HyperNetworks, Dec. 2016. URL http://arxiv.org/abs/1609.09106.
arXiv:1609.09106 [cs].
X. Han and P. E. Kloeden. Random Ordinary Differential Equations and Their Numerical Solution, volume 85 of Proba-
bility Theory and Stochastic Modelling. Springer Singapore, Singapore, 2017. ISBN 978-981-10-6264-3 978-981-10-
6265-0. doi: 10.1007/978-981-10-6265-0. URL http://link.springer.com/10.1007/978-981-10-6265-0.
IEEE
Transactions on Signal Processing, 70:89–104, 2022. ISSN 1941-0476. doi: 10.1109/TSP.2021.3131723. Conference
Name: IEEE Transactions on Signal Processing.
Identifying Latent Stochastic Differential Equations.
A. Hasan, J. M. Pereira, S. Farsiu, and V. Tarokh.
10
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
S. M. Hirsh, D. A. Barajas-Solano, and J. N. Kutz. Sparsifying Priors for Bayesian Uncertainty Quantification in Model
Discovery, July 2021. URL http://arxiv.org/abs/2107.02107. arXiv:2107.02107 [math].
Y. Huang, Y. Mabrouk, G. Gompper, and B. Sabass. Sparse inference and active learning of stochastic differential
equations from data. Scientific Reports, 12(1):21691, Dec. 2022. ISSN 2045-2322. doi: 10.1038/s41598-022-25638-9.
URL https://www.nature.com/articles/s41598-022-25638-9. Number: 1 Publisher: Nature Publishing
Group.
E. Jang, S. Gu, and B. Poole. Categorical Reparameterization with Gumbel-Softmax, Aug. 2017. URL http:
//arxiv.org/abs/1611.01144. arXiv:1611.01144 [cs, stat].
A. A. Kaptanoglu, B. M. d. Silva, U. Fasel, K. Kaheman, A. J. Goldschmidt, J. Callaham, C. B. Delahunt, Z. G.
Nicolaou, K. Champion, J.-C. Loiseau, J. N. Kutz, and S. L. Brunton. PySINDy: A comprehensive Python package
for robust sparse system identification. Journal of Open Source Software, 7(69):3994, Jan. 2022. ISSN 2475-9066.
doi: 10.21105/joss.03994. URL https://joss.theoj.org/papers/10.21105/joss.03994.
G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, and L. Yang. Physics-informed machine learning.
Nature Reviews Physics, 3(6):422–440, June 2021. ISSN 2522-5820. doi: 10.1038/s42254-021-00314-5. URL
https://www.nature.com/articles/s42254-021-00314-5. Number: 6 Publisher: Nature Publishing Group.
D. P. Kingma and M. Welling. Auto-Encoding Variational Bayes, May 2014. URL http://arxiv.org/abs/1312.
6114. arXiv:1312.6114 [cs, stat].
D. P. Kingma and M. Welling. An Introduction to Variational Autoencoders. Foundations and Trends® in Machine
Learning, 12(4):307–392, Nov. 2019. ISSN 1935-8237, 1935-8245. doi: 10.1561/2200000056. URL https:
//www.nowpublishers.com/article/Details/MAL-056. Publisher: Now Publishers, Inc.
P. E. Kloeden and C. Pötzsche, editors. Nonautonomous Dynamical Systems in the Life Sciences, volume 2102 of Lecture
Notes in Mathematics. Springer International Publishing, Cham, 2013. ISBN 978-3-319-03079-1 978-3-319-03080-7.
doi: 10.1007/978-3-319-03080-7. URL https://link.springer.com/10.1007/978-3-319-03080-7.
B. Lim and S. Zohren. Time-series forecasting with deep learning: a survey. Philosophical Transactions of the Royal
Society A: Mathematical, Physical and Engineering Sciences, 379(2194):20200209, Feb. 2021. doi: 10.1098/rsta.
2020.0209. URL https://royalsocietypublishing.org/doi/full/10.1098/rsta.2020.0209. Publisher:
Royal Society.
R. Lopez and P. J. Atzberger. Variational Autoencoders for Learning Nonlinear Dynamics of Physical Systems, Mar.
2021. URL http://arxiv.org/abs/2012.03448. arXiv:2012.03448 [cs, eess, math].
I. Loshchilov and F. Hutter. Decoupled Weight Decay Regularization, Jan. 2019. URL http://arxiv.org/abs/
1711.05101. arXiv:1711.05101 [cs, math].
C. Louizos, M. Welling, and D. P. Kingma. Learning Sparse Neural Networks through $L_0$ Regularization, June
2018. URL http://arxiv.org/abs/1712.01312. arXiv:1712.01312 [cs, stat].
C. J. Maddison, A. Mnih, and Y. W. Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random
Variables, Mar. 2017. URL http://arxiv.org/abs/1611.00712. arXiv:1611.00712 [cs, stat].
D. A. Messenger and D. M. Bortz. Weak SINDy: Galerkin-Based Data-Driven Model Selection. Multiscale Modeling
ISSN 1540-3459, 1540-3467. doi: 10.1137/20M1343166. URL
& Simulation, 19(3):1474–1497, Jan. 2021.
http://arxiv.org/abs/2005.04339. arXiv:2005.04339 [cs, math].
A. Nabeel, A. Karichannavar, S. Palathingal, J. Jhawar, D. R. M, and V. Guttal. PyDaddy: A Python package for
discovering stochastic dynamical equations from timeseries data, Nov. 2022. URL http://arxiv.org/abs/2205.
02645. arXiv:2205.02645 [cs, math, q-bio].
R. Nayek, R. Fuentes, K. Worden, and E. J. Cross. On spike-and-slab priors for Bayesian equation discovery of
nonlinear dynamical systems via sparse linear regression. Mechanical Systems and Signal Processing, 161:107986,
Dec. 2021. ISSN 0888-3270. doi: 10.1016/j.ymssp.2021.107986. URL https://www.sciencedirect.com/
science/article/pii/S0888327021003812.
D. Nguyen, S. Ouala, L. Drumetz, and R. Fablet. Variational Deep Learning for the Identification and Reconstruction
of Chaotic and Stochastic Dynamical Systems from Noisy and Partial Observations, Feb. 2021. URL http:
//arxiv.org/abs/2009.02296. arXiv:2009.02296 [cs, stat].
R. K. Niven, A. Mohammad-Djafari, L. Cordier, M. Abel, and M. Quade. Bayesian Identification of Dynamical
Systems. Proceedings, 33(1):33, 2020. ISSN 2504-3900. doi: 10.3390/proceedings2019033033. URL https:
//www.mdpi.com/2504-3900/33/1/33. Number: 1 Publisher: Multidisciplinary Digital Publishing Institute.
11
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga,
A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai,
and S. Chintala. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural
Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.
cc/paper/2019/hash/bdbca288fee7f92f2bfa9f7012727740-Abstract.html.
N. Pawlowski, A. Brock, M. C. H. Lee, M. Rajchl, and B. Glocker. Implicit Weight Uncertainty in Neural Networks,
May 2018. URL http://arxiv.org/abs/1711.01297. arXiv:1711.01297 [cs, stat].
S. J. Reddi, S. Kale, and S. Kumar. On the Convergence of Adam and Beyond, Apr. 2019. URL http://arxiv.org/
abs/1904.09237. arXiv:1904.09237 [cs, math, stat].
D. Rezende and S. Mohamed. Variational Inference with Normalizing Flows. In Proceedings of the 32nd International
Conference on Machine Learning, pages 1530–1538. PMLR, June 2015. URL https://proceedings.mlr.
press/v37/rezende15.html. ISSN: 1938-7228.
M. Schmidt and H. Lipson. Distilling Free-Form Natural Laws from Experimental Data. Science, 324(5923):81–85,
Apr. 2009. ISSN 0036-8075, 1095-9203. doi: 10.1126/science.1165893. URL https://www.science.org/doi/
10.1126/science.1165893.
L. Sun, H. Sun, D. Z. Huang, and J.-X. Wang. Bayesian Spline Learning for Equation Discovery of Nonlinear Dynamics
with Quantified Uncertainty.
S. Särkkä and A. Solin. Applied Stochastic Differential Equations. Cambridge University Press, 1 edition, Apr.
2019. ISBN 978-1-108-18673-5 978-1-316-51008-7 978-1-316-64946-6. doi: 10.1017/9781108186735. URL
https://www.cambridge.org/core/product/identifier/9781108186735/type/book.
N. Takeishi and A. Kalousis. Physics-Integrated Variational Autoencoders for Robust and Interpretable Gen-
In Advances in Neural Information Processing Systems, volume 34, pages 14809–
URL https://proceedings.neurips.cc/paper/2021/hash/
erative Modeling.
14821. Curran Associates,
7ca57a9f85a19a6e4b9a248c1daca185-Abstract.html.
Inc., 2021.
T. Tripura and S. Chakraborty. A sparse Bayesian framework for discovering interpretable nonlinear stochastic
dynamical systems with Gaussian white noise. Mechanical Systems and Signal Processing, 187:109939, Mar.
2023. ISSN 0888-3270. doi: 10.1016/j.ymssp.2022.109939. URL https://www.sciencedirect.com/science/
article/pii/S088832702201007X.
Y. Wang, H. Fang, J. Jin, G. Ma, X. He, X. Dai, Z. Yue, C. Cheng, H.-T. Zhang, D. Pu, D. Wu, Y. Yuan, J. Gonçalves,
J. Kurths, and H. Ding. Data-Driven Discovery of Stochastic Differential Equations. Engineering, 17:244–252, Oct.
2022. ISSN 2095-8099. doi: 10.1016/j.eng.2022.02.007. URL https://www.sciencedirect.com/science/
article/pii/S209580992200145X.
Y. Yacoby, W. Pan, and F. Doshi-Velez. Failure Modes of Variational Autoencoders and Their Effects on Downstream
Tasks, Mar. 2022. URL http://arxiv.org/abs/2007.07124. arXiv:2007.07124 [cs, stat].
L. Yang, D. Zhang, and G. E. Karniadakis. Physics-Informed Generative Adversarial Networks for Stochastic
Differential Equations. SIAM Journal on Scientific Computing, 42(1):A292–A317, Jan. 2020. ISSN 1064-8275.
doi: 10.1137/18M1225409. URL https://epubs.siam.org/doi/10.1137/18M1225409. Publisher: Society
for Industrial and Applied Mathematics.
J. Yoon, D. Jarrett, and M. van der Schaar. Time-series Generative Adversarial Networks. In Advances in Neural
Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://papers.nips.cc/
paper_files/paper/2019/hash/c9efe5f26cd17ba6216bbe2a7d26d490-Abstract.html.
D. Zhang, L. Lu, L. Guo, and G. E. Karniadakis. Quantifying total uncertainty in physics-informed neural networks for
solving forward and inverse stochastic problems. Journal of Computational Physics, 397:108850, Nov. 2019. ISSN
0021-9991. doi: 10.1016/j.jcp.2019.07.048. URL https://www.sciencedirect.com/science/article/pii/
S0021999119305340.
P. Zheng, T. Askham, S. L. Brunton, J. N. Kutz, and A. Y. Aravkin. A Unified Framework for Sparse Relaxed Regularized
Regression: SR3. IEEE Access, 7:1404–1423, 2019. ISSN 2169-3536. doi: 10.1109/ACCESS.2018.2886528.
Conference Name: IEEE Access.
W. Zhong and H. Meidani. PI-VAE: Physics-Informed Variational Auto-Encoder for stochastic differential equations.
Computer Methods in Applied Mechanics and Engineering, 403:115664, Jan. 2023. ISSN 0045-7825. doi: 10.1016/j.
cma.2022.115664. URL https://www.sciencedirect.com/science/article/pii/S0045782522006193.
12
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Appendix A Derivation of Loss Function
We assume independence of z with respect to x, such that pθ(z|x) = pθ(z). Then, as described in the Methods section,
our generative model factorizes as follows (Bayes' rule):
pθ( ̇x, z|x) = pθ( ̇x|z, x)pθ(z)
(13)
Given the chain rule for conditional probability, we also have:
pθ( ̇x|z, x) =
=
=
pθ( ̇x, z, x)
pθ(z, x)
pθ(z| ̇x, x)pθ( ̇x|x)pθ(x)
pθ(z|x)pθ(x)
pθ(z| ̇x, x)pθ( ̇x|x)
pθ(z)
Conditional Probability
pθ(z|x) = pθ(z)
By substituting into the first factorization, we obtain the second factorization:
pθ( ̇x, z|x) = pθ(z| ̇x, x)pθ( ̇x|x)
(14)
We seek to learn a model that captures the dynamics ̇x, given the state x. Specifically, we seek to maximize the
log-likelihood log pθ( ̇x|x) by performing inference over z. We follow a similar derivation as in [Kingma and Welling,
2019]:
log pθ( ̇x|x) = Eqφ(z| ̇x,x) [log pθ( ̇x|x)]
= Eqφ(z| ̇x,x)
= Eqφ(z| ̇x,x)
= Eqφ(z| ̇x,x)
(cid:20)
log
(cid:20)
log
(cid:20)
log
(cid:21)
pθ( ̇x, z|x)
pθ(z| ̇x, x)
pθ( ̇x, z|x)qφ(z| ̇x, x)
pθ(z| ̇x, x)qφ(z| ̇x, x)
(cid:21)
pθ( ̇x, z|x)
qφ(z| ̇x, x)
+ Eqφ(z| ̇x,x)
= ELBO + DKL(qφ(z| ̇x, x)||pθ(z| ̇x, x))
(cid:20)
log
(cid:21)
qφ(z| ̇x, x)
pθ(z| ̇x, x)
(cid:21)
see Eq. 14
Since DKL(qφ(z| ̇x, x)||pθ(z| ̇x, x)) ≥ 0, we maximize the ELBO, which lower bounds log pθ( ̇x|x).
(cid:21)
(cid:20)
ELBO = Eqφ(z| ̇x,x)
log
pθ( ̇x, z|x)
qφ(z| ̇x, x)
= Eqφ(z| ̇x,x) [log pθ( ̇x, z|x) − log qφ(z| ̇x, x)]
= Eqφ(z| ̇x,x) [log pθ( ̇x|z, x) + log pθ(z) − log qφ(z| ̇x, x)]
= Eqφ(z| ̇x,x) [log pθ( ̇x|z, x) − DKL(qφ(z| ̇x, x)||pθ(z))]
see Eq. 13
Equivalently, we can minimize the −ELBO, given by the following loss:
loss = ( ̇x − fˆz(x))2 + DKL(qφ(z|x, ̇x)||pθ(z))
Given our goal to learn a sparse set of governing equations, we need to train M , which is multiplied elementwise with
Ξz. To do so, we add L0(M ) (main text Eq. 5) to the loss, yielding:
loss = ( ̇x − fˆz(x))2 + βDKL(qφ(z|x, ̇x)||pθ(z)) + λL0(M )
= ( ̇x − fˆz(x))2 + βDKL(qφ(z|x, ̇x)||pθ(z)) + λ
k
(cid:88)
j=1
Sigmoid(log αj − βL0 log
γ
ζ
)
where β, λ, βL0, γ, and ζ are hyperparameters, k is the dimension of a vectorized M , and ˆz ∼ qφ(z|x, ̇x) using the
reparameterization trick. logαj are location parameters for the distribution that M is transformed from, as described in
the Background section of the main text.
13
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
System
n
Table 2: Matrix shapes for different experiments
C Θ(x)
M
Lorenz
Rössler
Lotka-Volterra
Lorenz-96
3
F
3
T
T
2
10 T
250 × 19
250 × 20
250 × 10
250 × 286
Ξz
250 × 19 × 3
250 × 20 × 3
250 × 10 × 2
250 × 286 × 10
250 × 19 × 3
250 × 20 × 3
250 × 10 × 2
250 × 286 × 10
Θ(x)(Ξz ⊙ M )
250 × 3
250 × 3
250 × 2
250 × 10
System
Train
Test
Table 3: Dataset initial conditions
Lorenz
Rössler
Lotka-Volterra
Lorenz-96
(0, 1, 1.05)
(0, 1, 1.05)
(4, 2)
(8.01, 8, 8, 8, 8, 8, 8, 8, 8, 8)
(-1, 2, 0.5)
(-1, 2, 0.5)
(2.1, 1.0)
(7.8, 8.7, 8.5, 6.0, 9.9, 9.5, 7.5, 6.9, 6.9, 8.7)
Appendix B Generative and Inference Models
Matrix dimensions are variable. Consider x ∈ Rn and a library with l terms. Then, we have:
Θ(x) ∈ Rl
Ξz ∈ Rl×n
M ∈ Rl×n
(Ξz ⊙ M ) ∈ Rl×n
Θ(x)(Ξz ⊙ M ) ∈ Rn
However, we use minibatches during training. Consider a batch of x of size b, meaning x ∈ Rb×n. Then, we have:
Θ(x) ∈ Rb×l
Ξz ∈ Rb×l×n
M ∈ Rb×l×n
(Ξz ⊙ M ) ∈ Rb×l×n
Θ(x)(Ξz ⊙ M ) ∈ Rb×n
After training, we do not sample M using the reparameterization trick, since α has been learned. So, M has shape
l × n (note that k = l * n). For all experiments, we included polynomials up to order 3 in the library and used a batch
size of 250 during training. Refer to Table 2 for a breakdown of matrix shapes for each experiment during training (note
that C refers to whether a constant is included in the library).
Appendix C Data
Each trajectory was generated for 10000 timesteps with dt = 0.01. Refer to Table 3 for data generation initial conditions.
Note that the test initial condition for Lorenz-96 is rounded (the exact values can be found in the accompanying code,
as we used Gaussian noise to choose the initial condition). Derivatives are estimated using finite differences without
smoothing.
Appendix D Training
D.1 Algorithm
A "best practice" for the HyperSINDy training algorithm is choosing low initial β and λ values and evaluating the
results before adjusting in future runs. Moreover, we also utilize beta warmup Castrejon et al. [2019], which is useful
for avoiding posterior collapse in VAEs. Specifically, we increase the β value from 0.01 to the chosen low initial β
value over 100 epochs. If the prior did not learn the function well enough, we increased ("spiked") the β value at a
later epoch in training to βspike. Note that, although we knew the ground truth coefficients in our simulations, one can
determine whether the prior learned "well enough" by comparing the similarity between the coefficients generated from
the prior to the coefficients generated from the approximate posterior. See [Yacoby et al., 2022] for more information
on this tradeoff between the posterior and prior. If the learned model was not sparse enough, we increased the λ value
at a later epoch in training to λspike.
Every 100 epochs, we permanently set values in M to be zero if the corresponding coefficients (using the mean over a
batch of coefficients) falls below the threshold value T . This is done using an auxiliary matrix of shape l × n, where
the values are all initially set to 1 and then set to 0 throughout training if the corresponding value in M should be 0
permanently. This mask is multiplied elementwise with M to enforce this permanent sparsity. During training, we
sample one M for each example in a minibatch of data using the reparameterization trick.
14
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Table 4: Hyperparameters
Lorenz
d
6
6
6
Rössler
d
6
6
6
σ
1
5
10
σ
1
5
10
Lorenz RMSE
σ
1
5
10
d
6
6
6
βspike
100
400
400
βspike
100
100
100
βspike
100
400
400
epochβspike
400
400
400
epochβspike
200
200
200
epochβspike
400
400
400
λspike
10
10
10
λspike
0.1
0.1
1
λspike
10
10
10
epochλspike
400
400
400
epochs
T
999
999
999
0.05
0.05
0.05
epochλspike
200
300
300
epochs
T
499
600
600
0.01
0.01
0.01
epochλspike
400
400
400
epochs
T
999
999
999
0.05
0.05
0.05
Rössler RMSE
σ
d
βspike
6
1
6
5
10
6
Lotka-Volterra
100
200
300
epochβspike
200
200
200
λspike
0.1
0.1
1
epochλspike
200
300
300
epochs
T
499
600
600
0.01
0.01
0.01
σ
d
N/A 4
Lorenz-96
σ
10
d
20
βspike
None
epochβspike
None
λspike
0.1
epochλspike
100
epochs
T
250
0.1
βspike
None
epochβspike
None
λspike
10
epochλspike
400
epochs
T
999
0.05
D.2 Hyperparameters
Hyperparamater tuning mostly consists of adjusting the β and λ value for the Kl divergence and L0 terms in the loss
function, respectively. Hyperparameters that stay constant for all experiments are listed here: learning_rate = 0.005,
num_hidden = 5, stat_size = 250, batch_size = 250. stat_size refers to the number of coefficient matrices that
are sampled from the prior to calculate the coefficient means used for the permanent thresholding described in the
Training section. We used a hidden dimension of 64 in all neural networks for all experiments except on Lorenz-96,
for which we used a hidden dimension of 128. We warm up to a low initial β value of 10 for every experiment. We
use an initial L0 regularization weight of λ = 0.01. For M , we use βL0 = 2/3, γ = −0.1, and ζ = 1.1. Note that an
exhaustive list of hyperparameters and training settings can be found in the accompanying code. All experiments were
run on an NVIDIA GeForce RTX 2080 Ti GPU. We ran all experiments in PyTorch [Paszke et al., 2019] using the
AdamW optimizer [Loshchilov and Hutter, 2019] with a weight decay value of 0.01 and amsgrad [Reddi et al., 2019]
enabled. Refer to Table 4 for a list of hyperparameters that we tuned to obtain the results in the main text. Refer to
the attached code for more details on the RMSE experiments, as well as information on settings used to generate the
supplemental figures.
15
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Appendix E RMSE Metric
To generate Table 1, we use the RMSE metric (as computed in Sun et al.). Specifically, we compute:
rmse =
||CT rue − CP red||2
||CT rue||2
where CT rue is the true mean or standard deviatin of a given coefficient, and CP red is the mean or standard deviation
of the predicted coefficients. For terms that are not included in the ground truth or predicted equations, we consider
their mean or standard deviation to be zero.
Appendix F Algorithms
Algorithm 1 Generation of Governing Equations Coefficients, Ξz, to predict ̇x
1: if z not given then:
2:
3: Ξz = H(z)
4:
̇x = fz(x) = Θ(x)(Ξz ⊙ M )
z ∼ N (0, I)
▷ Generate batch of z
▷ Generate 1 coefficient matrix for each z in batch
▷ Unless training, uses Eq 4 to get M
Algorithm 2 Training Loop for Each Epoch
1: for each minibatch x, ̇x do
μq, σq = E(x, ̇x)
2:
ˆz = μq + σq ⊙ ε
3:
Obtain training M through transformations
4:
ˆ ̇x = fˆz(x) = Algorithm 1(ˆz)
5:
loss = ( ̇x − ˆ ̇x)2 + βDKL(qφ(z|x, ̇x)||pθ(z)) + λL0(M )
6:
Backprop loss and update θ, φ
7:
8: Sample batch of z ∼ N (0, 1)
9: Ξz = H(z)
10: Ξzmean = mean over batch of Ξz
11: if (epoch % threshold_interval) == 0 then:
12:
M = 0 permanently where abs(Ξzmean ) < threshold
Appendix G Figures
▷ Encode each element of batch
▷ Reparameterization Trick
▷ See Background, specifically Eq 3
▷ Give ˆz to H
▷ If we must threshold this epoch
▷ Permanently threshold M
We include here additional sample trajectories (all from the test initial condition) to highlight HyperSINDy's generative
capabilities. Refer to Figure 5 for HyperSINDy trajectories generated for various noise levels on the Lorenz and Rössler
system, and refer to Figure 6 for sample test trajectories. HyperSINDy captures the same dynamical behavior as the
original system. Refer to Figure 7 for HyperSINDy trajectories generated for the Lorenz-96 system.
16
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 5: 3D Stochastic Lorenz and Rössler Samples. HyperSINDy models trained on trajectories of varying noise
(σ). Blue trajectories are generated by iteratively sampling from HyperSINDy's learned generative model.
17
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 6: 3D Stochastic Lorenz and Rössler Ground Truth Samples. Samples generated using the ground truth
equations for varying noise levels (σ).
18
HyperSINDy: Deep Generative Modeling of Nonlinear Stochastic Governing Equations
Figure 7: Lorenz-96 Samples (σ = 10). Each row contains a different sample trajectory. Trajectories are generated by
iteratively sampling from HyperSINDy's learned generative model.
Figure 8: E-SINDY 3D Stochastic Lorenz and Rössler Samples. Samples generated using discovered E-SINDy
equations for varying noise levels (σ).
19
|
|
http://arxiv.org/abs/2310.04830v1 | "2023-10-07T14:38:43" | "2023-10-07T14:38:43" | Extract-Transform-Load for Video Streams | Social media, self-driving cars, and traffic cameras produce video streams at
large scales and cheap cost. However, storing and querying video at such scales
is prohibitively expensive. We propose to treat large-scale video analytics as
a data warehousing problem: Video is a format that is easy to produce but needs
to be transformed into an application-specific format that is easy to query.
Analogously, we define the problem of Video Extract-Transform-Load (V-ETL).
V-ETL systems need to reduce the cost of running a user-defined V-ETL job while
also giving throughput guarantees to keep up with the rate at which data is
produced. We find that no current system sufficiently fulfills both needs and
therefore propose Skyscraper, a system tailored to V-ETL. Skyscraper can
execute arbitrary video ingestion pipelines and adaptively tunes them to reduce
cost at minimal or no quality degradation, e.g., by adjusting sampling rates
and resolutions to the ingested content. Skyscraper can hereby be provisioned
with cheap on-premises compute and uses a combination of buffering and cloud
bursting to deal with peaks in workload caused by expensive processing
configurations. In our experiments, we find that Skyscraper significantly
reduces the cost of V-ETL ingestion compared to adaptions of current SOTA
systems, while at the same time giving robustness guarantees that these systems
are lacking. | [
"Ferdinand Kossmann",
"Ziniu Wu",
"Eugenie Lai",
"Nesime Tatbul",
"Lei Cao",
"Tim Kraska",
"Samuel Madden"
] | 10.14778/3598581.3598600 | [
{
"@title": "doi",
"@href": "http://dx.doi.org/10.14778/3598581.3598600",
"@rel": "related",
"@type": null
},
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04830v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04830v1",
"@rel": "related",
"@type": "application/pdf"
}
] | [
"Proc. VLDB Endow. 16, 9 (May 2023), 2302-2315"
] | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.DB",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.DB",
"cs.CV",
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
B
D
.
s
c
[
1
v
0
3
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Extract-Transform-Load for Video Streams
Ferdi Kossmann1 Ziniu Wu1 Eugenie Lai1 Nesime Tatbul1,2 Lei Cao1,3 Tim Kraska1,4 Sam Madden1
{ferdik,ziniuw,eylai,tatbul,lcao,kraska,madden}@csail.mit.edu
1MIT CSAIL, 2Intel Labs, 3University of Arizona, 4AWS
ABSTRACT
Social media, self-driving cars, and traffic cameras produce video
streams at large scales and cheap cost. However, storing and query-
ing video at such scales is prohibitively expensive. We propose to
treat large-scale video analytics as a data warehousing problem:
Video is a format that is easy to produce but needs to be transformed
into an application-specific format that is easy to query. Analogously,
we define the problem of Video Extract-Transform-Load (V-ETL).
V-ETL systems need to reduce the cost of running a user-defined
V-ETL job while also giving throughput guarantees to keep up with
the rate at which data is produced. We find that no current system
sufficiently fulfills both needs and therefore propose Skyscraper, a
system tailored to V-ETL. Skyscraper can execute arbitrary video
ingestion pipelines and adaptively tunes them to reduce cost at mini-
mal or no quality degradation, e.g., by adjusting sampling rates and
resolutions to the ingested content. Skyscraper can hereby be provi-
sioned with cheap on-premises compute and uses a combination of
buffering and cloud bursting to deal with peaks in workload caused
by expensive processing configurations. In our experiments, we find
that Skyscraper significantly reduces the cost of V-ETL ingestion
compared to adaptions of current SOTA systems, while at the same
time giving robustness guarantees that these systems are lacking.
PVLDB Artifact Availability: The source code, data, and/or other artifacts
have been made available at https://github.com/ferdiko/vetl.
INTRODUCTION
1
Every day, millions of video streams are produced by smartphones,
TV stations, self-driving cars, dashcams, and CCTV cameras de-
ployed in cities and office buildings. These video streams can offer
great insights and enormous value in fields such as city planning,
marketing, advertisement, smart retail, or autonomous driving. For
example, city planners around Vancouver are currently facing the
challenge of deciding where to place electric vehicle (EV) chargers.
For that, they want to obtain data that tells them which points in the
city are most commonly traversed by EVs. Most cities like Vancou-
ver already installed hundreds to thousands of traffic cameras, which
could be used to obtain such EV counts.
The naive way of counting how many EVs pass by each camera
is to store the video from all cameras and then run an object detec-
tion algorithm1 on the recorded video at query time. However, this
approach has major disadvantages. First, storing the video requires
outrageously large storage volumes. For example, one thousand
traffic cameras roughly produce 230 TB of data every month.2 Stor-
ing one month's data on Amazon S3 would therefore cost $60,000
per year. Second, querying for trends or averages usually requires
analyzing months to years of data, which leads to large query laten-
cies. Even on modern GPUs, state-of-the-art computer vision (CV)
1In Canada (as in many other countries), EVs are especially easy to distinguish from
other cars since they have green license plates.
2One traffic camera feed in our experiments produces 7.8GB of data per day.
models can only process a few frames per second. For example,
processing one year of video with the YOLO object detector [62]
takes six months on an AWS p3.2xlarge instance (with an NVIDIA
Tesla V100 GPU). Third, naively applying CV techniques at such
scales is prohibitively expensive for many applications. For example,
naively running the YOLO object detector [62] to analyze a month
of traffic data from 100 cameras costs $110,000 on AWS3.
To address the limitations of the naive approach, we propose
to manage live video streams like in a data warehouse. Video is a
format that is easy to produce but hard to query. A video warehouse
allows for efficient querying by converting incoming video into an
intermediate format that is easy to query. This intermediate format is
application-specific and contains the extracted entities of interest. In
the EV example, it would contain car counts and types. Analogous to
traditional data warehouses, we refer to the process of preparing the
data for querying as Video Extract-Transform-Load (V-ETL). Video
is extracted from the cameras, transformed into the intermediate
format using CV, and loaded into a query engine like a relational
database system. This lets the user issue queries in SQL against
tables with the extracted entities (e.g., obtaining the EV counts is
a simple count query on a Detections table, where the detected
car is an EV, grouped by the camera id).
Video warehouses eliminate the storage problem since users may
throw video away after extracting all entities of interest during in-
gestion. They also solve the query latency issue, since users can
issue queries against the intermediate format and no expensive CV
algorithm needs to be run at query time. However, video warehouses
do not magically solve the cost problem, as the video still needs to
be processed during the V-ETL Transform step. Furthermore, video
processing must happen at the rate at which the video is produced in
order to achieve continuous ingestion.
To address the challenges imposed by V-ETL, we built Skyscraper
which allows for cheap video ingestion while also adhering to
throughput requirements. Skyscraper's goal is to make the V-ETL
transform step more practical. It allows users to provision hardware
resources according to their monetary budget and optimizes the
quality of the extracted video entities on the given resources.
Depending on the provisioned hardware, Skyscraper reduces the
work imposed by the V-ETL job while degrading the result quality
as little as possible. Skyscraper does this by dynamically config-
uring knobs that are inherent to CV workloads. Examples of such
knobs include the frame rate or the image resolution at which the
video is processed, as well as further, application-specific knobs.
Each of these knob represents a trade-off between work and result
quality: Expensive knob configurations can reliably deliver good
results, even for difficult inputs (e.g., many object occlusions); cheap
configurations, on the other hand, only deliver good results on easy
inputs (e.g. few occlusions, good lighting conditions etc.) but are
prone to mistakes on difficult inputs. The content of real-world video
3E.g., using 50 p3.2xlarge instances, each of which currently costs 3.06 USD/h.
the frame to avoid double counting them. Finally, the user registers
the workload's tunable knobs. In the simple example, the user only
defines a single knob that controls how frequently the object detector
should be run. Skyscraper optimizes the costly Transform step while
the user code performs the Extract and Load steps.
Prior work. While Skyscraper is the first system to specifically
address the challenge of V-ETL, there are several lines of work that
are relevant to Skyscraper. We briefly highlight two of them here
and refer to Section 6 for a more detailed discussion on related work.
Table 1 shows the differences between Skyscraper and these works.
First, there is prior work on content-adaptive knob tuning, such
as Chameleon [40] and Zeus [16]. These systems are designed to
reduce the average processing time per frame while assuming that
the provisioned hardware can always ingest video in real-time (even
during peak workload). However, when ingesting video on cheaper
machines that are not peak-provisioned, prior systems do not pro-
vide throughput guarantees and are therefore impractical for V-ETL.
Adapting these systems to fulfill throughput requirements on cheap
hardware is challenging, since they are agnostic to lag and the hard-
ware resources they run on. We discuss this further in Section 6.
Second, there is prior work on systems that use knob tuning to
adapt to the current query load. VideoStorm [81] and VideoEdge [35]
are designed for scenarios where users run a dynamic set of queries
over video streams, which causes dynamic changes to the type and
number of queries running. At times when many queries are running
concurrently, not all queries may be able to run at maximum quality
and in real time. VideoStorm and VideoEdge tune the queries' knobs
such that the queries fulfill their quality and latency goals as well
as possible. However, VideoStorm and VideoEdge only adapt to the
query load (i.e., the queries present in the system) and are agnostic
to the streamed content. This brings no benefit in scenarios where
the query load is static. While we envision most V-ETL applications
to ingest video using a static set of processing jobs, VideoStorm
might still be used if users dynamically redefine how to ingest video.
Adapt to video content Adapt to query load
Throughput
guarantees
No throughput
guarantees
Skyscraper
Chameleon, Zeus
VideoStorm,
VideoEdge
Table 1: Skyscraper compared to other video knob tuning systems
In summary, our contributions are as follows:
• We define the problem of Video Extract-Transform-Load (V-
ETL) and identify its importance.
• To make V-ETL more practical, we propose Skyscraper, the first
content-adaptive knob tuning system with throughput guarantees.
Skyscraper lets users provision compute resources according to their
budget and optimizes the result quality on the given resources.
• To effectively ration compute resources over time, we propose
a combination of predictive planning and reactive execution.
• We propose a tuning method that only relies on a user-defined
quality metric which is extracted anyways when running the V-ETL
job. We find that this method allows for negligible tuning overheads.
• We conduct experiments on several real-world and synthetic
workloads and find that Skyscraper can achieve cost reductions up
to 8.7× over baselines on various workloads.
Figure 1: Skyscraper optimizing the expensive V-ETL Transform
step of the EV counting example job. The blue components are
provided by Skyscraper, the red ones are provided by the user.
streams is highly variable with frequent changes in how difficult it
is to analyze the content (i.e., changes every few 10s of seconds).
Skyscraper saves work by using expensive knob configurations on
difficult video segments and cheap configurations otherwise.
Since Skyscraper needs to process data on constrained hardware
at a required throughput, Skyscraper must configure the knobs not
only based on the video content but also on the available hard-
ware resources. Industrial deployments for live video processing
are typically provisioned with three types of resources [35]: a lo-
cal compute cluster with a high-bandwidth connection to the video
source, a video buffer, and cloud resources that may be used to
rent on-demand cloud compute (to limit cloud costs, users typically
want to set a cloud budget.) Skyscraper leverages all three of these
resource types: Skyscraper itself runs on the local cluster and uses it
to process video. To keep costs low, the local cluster is typically not
provisioned to process the most expensive knob configurations in
real-time. When it falls behind, Skyscraper sets video video in the
buffer and, as the buffer starts to fill, offloads work to on-demand
cloud workers.
Skyscraper must avoid prematurely using up buffer space and
cloud credits in order to not run out of them when expensive knob
configurations would have the greatest impact. Skyscraper therefore
forecasts the workload and rations compute resources with regard to
future demand. To still be robust to unavoidable inaccuracies in the
forecast, we propose to combine a predictive planning component
with a reactive execution component, which lets Skyscraper make
tuning decisions while considering both, the future demand and the
content that is actually streamed in the moment.
Despite the need for predictive knob tuning, Skyscraper's knob
tuning decisions must impose a low overhead - this is especially
important in low-budget regimes, where large decision overheads
would consume a significant portion of the compute resources. While
prior content-adaptive knob tuners run additional CV operators to
make tuning decisions [16, 40], Skyscraper adapts to the video con-
tent only based on a user-defined quality metric (e.g., certainties
commonly reported by CV models) that are extracted anyways when
running the V-ETL job. This allows Skyscraper to make tuning deci-
sions in under 0.5 ms on a single CPU core.
Figure 1 shows an overview of how Skyscraper processes the
EV example workload. The user specifies user-defined functions
(UDFs) that transform the video into the application-specific query
format. In Figure 1, the user only defines two UDFs. The object
detector UDF is responsible for detecting new cars, while the object
tracker UDF is responsible for tracking cars as they move across
2
LoadExtractObject detector UDFObject tracker UDFDAG output (cars)TransformAdapt knob to video contentSchedule executionEvery n-th frameOther frames2 PROBLEM DEFINITION AND SYSTEM
OVERVIEW
2.1 Problem definition
Video Extract-Transform-Load (V-ETL) refers to extracting entities
of interest from a video stream by processing it according to a user-
defined specification and adhering to two constraints. First, V-ETL
systems must process video at the rate at which it arrives. A V-ETL
system may lag behind on processing but may only do so by a
constant amount. In practice, this means that V-ETL systems may
use a fixed-size storage medium (i.e., buffer) to set video aside for
later processing. Equation 1 states that the size of the buffered frames
may not exceed the size of the buffer.
out (t) ⊆ in(t) ∧
∑︁
size (F ) ≤ B
∀t
(1)
F ∈ in (t )\ out (t )
where t is a timestamp, in(t) is the set of frames that the video
source has produced at time t, out (t) is the set of frames that the
V-ETL system has processed at time t, size (F ) is the size of frame F
in bytes and B is the buffer size in bytes.
Second, V-ETL systems must process video at a budget that is
defined by the user. This budget is provided as a dollar cost budgetT
that may be spent over a given time interval T . The processing
cost over interval T encompasses all costs including average wear
of hardware, cloud costs, etc. The summed cost of processing all
frames in T must be below budgetT : (cid:205)F ∈T cost (F ) ≤ budgetT .
The combination of processing video at a required throughput
while being constrained on computing resources makes for exciting
optimization problems. Skyscraper aims to maximize the overall
result quality by tuning workload-specific knobs that are inherent
to computer vision workloads (e.g., the frame rate or image reso-
lution). In Skyscraper, the quality is user-defined and is measured
and returned by the user code - this lets Skyscraper generalize to
different workloads with different notions of quality.
Users may further register arbitrary knobs together with a corre-
sponding knob domain. The knob domain is a user-defined set of
values that the knob may take (e.g. the knob domain for the frame
rate knob might be {15 FPS, 30 FPS}). Skyscraper dynamically
configures registered knobs based on the streamed video content and
maximizes the quality (e.g. accuracy) of the extracted entities while
adhering to the V-ETL requirements.
Formally, a knob configuration k refers to an instantiation of each
knob to a value in its domain. Some knob configurations induce
more work than others. Similarly, some produce more qualitative re-
sults than others. However, the result quality of a knob configuration
depends not only on the configuration but also on the video content.
While a high image resolution may reliably produce good results, it
may not always be needed as some content can also be accurately
processed at a lower resolution. Let a video segment denote a se-
quence of successive frames of the video (e.g., 2 seconds of video).
We denote the quality that a knob configuration k achieves on a
video segment s as qual (k, s). The optimization goal of Skyscraper
is to maximize the overall quality qual (v) of entities extracted from
video v, which is given by qual (v) = (cid:205)s ∈v qual (ks, s)where ks is
the configuration used to process segment s.
3
2.2 System overview
The following subsection gives a high-level overview of Skyscraper.
Section 3 and Section 4 then provide a more detailed discussion of
Skyscraper's design. We focus on how Skyscraper ingests a single
video stream and show in Appendix D, how this approach can easily
be generalized to multiple streams.
Design challenges. To explain why Skyscraper works the way it
does, we present a simplistic, idealized approach to content-adaptive
knob tuning with throughput guarantees, and show where this ap-
proach fails in practice. We then present the ideas that Skyscraper
uses to overcome the issues of the idealized approach.
For now, we do not consider buffering or the scheduling of com-
putation between on-premise resources and the cloud. Instead, we
simply consider a computation budget budgetT on the number of
arithmetic operations that we may use to ingest video produced
during time period T . We are further given a small set of knob con-
figurations K which allows us to process different segments of the
video at different costs and qualities (see Section 2.1).
We observe that the knob tuning system must speculate about the
future content of the video in order to effectively ration budgetT over
time. Otherwise, the system can not assess whether it is sensible to
process content with an expensive knob configuration now or to save
the budget for the future when expensive knob configurations might
have a larger impact. Furthermore, we find that the effectiveness
of different knob configurations often changes within seconds -
a content-adaptive knob tuning system should therefore reassess
which configuration to use every couple of seconds.
Now, suppose we have a forecasting function that can perfectly
predict what quality each knob configuration achieves at any given
time in the future. In this idealized world, we can easily build a sys-
tem that achieves optimal performance: Our optimal system would
slice time interval T into segments ti of equal length, where each
segment ti is a few seconds long. The system then forecasts the qual-
ity that each knob configuration achieves on each segment ti ∈ T .
Finally, given the forecasted qualities, optimizing the assignment of
knob configurations to segments is an instance of the 0-1 knapsack
problem, where the overall quality must be maximized under the
given budget budgetT (more details in Appendix B).
Unfortunately, we find that achieving good accuracy on this fore-
casting task is infeasible in the real world. To forecast the knob
configurations' qualities for each ti ∈ T , our forecasting function
needs to predict what happens at each second in the video, hours
into the future. This is impossible since the precise timing of events
is subject to substantial randomness. For example, it is impossible to
predict the exact moment in which a large group of pedestrians will
pass by a camera, hours into the future. To make our system work in
the real world, we need to design a more practical forecasting task.
We rely on two insights that guide the design of this new forecast-
ing task. First, we observe that there are a few types of video content
that characterize any of the videos seen throughout the live stream
(e.g., rush hour traffic, normal traffic, low traffic). For the content of
the same kind, each knob configuration produces results of similar
quality. For example, for content with many occlusions (e.g., rush
hour), knob configurations that cannot handle occlusions will always
produce low-quality results. Second, we observe that, while it is
impossible to predict when certain content appears, it is possible to
Figure 2: Overview over all processing steps of Skyscraper.
predict how often it appears, assuming the future video is distributed
roughly as a recent historical video has been. For example, while it
is impossible to predict the precise moments (i.e. the ti 's) at which
groups of pedestrian pass by the camera, it is possible to estimate
how often groups of pedestrians pass by the camera.
We can now design a forecasting task where accurate predictions
are feasible in practice. Based on the first insight (content falls into
a few categories), we use a simple clustering mechanism to compute
content categories such that all streamed content falls into one of
these categories. We construct them such that all knob configurations
achieve a similar quality on the content of the same category (more
details in Section 3). Then, based on the second insight (content
distribution is predictable), we simply predict how often each con-
tent category appears within a time interval T . For example, if our
forecasting model thinks that 10% of the video in T shows rush-hour
traffic, it would forecast 10% for the rush-hour category. In practice,
we can achieve high forecasting accuracy on real-world workloads.
Finally, we need to re-think how to use the forecast for knob tun-
ing. Since we no longer forecast the qualities of individual segments
ti , we cannot assign knob configurations the same way as in our
idealized system. Instead, we can only assign knob configurations
to content categories. Knowing how often each content category ap-
pears allows us precisely determine the overall cost of using a knob
configuration to process the content of that category. In Section 4, we
describe how this allows us to find the optimal assignment of knob
configurations to content categories under a given budget and for
a given forecast. Given this assignment, we then need to reactively
determine what category the current content belongs to. Once we
determine the category, we can simply look up and use the knob
configuration we assigned to this category. Section 4.2 describes a
simple method for determining the current content category, which
runs fast and determines the correct category with high accuracy.
In summary, we took a simplistic, idealized system and made
it practical by re-designing the forecasting task. We then built an
efficient system around it that can leverage this forecast for predictive
knob tuning. Skyscraper takes these ideas and implements them for
real hardware provisionings.
Skyscraper walk-through. Given these challenges imposed by
content-adaptive knob tuning with throughput guarantees, we now
give an overview on how Skyscraper uses these ideas when provi-
sioned with real hardware (i.e., with a local compute cluster, video
buffer and cloud credits). Skyscraper is split into an offline learning
phase and an online ingestion phase as shown in Figure 2. Section 3
gives a detailed description of the offline phase and Section 4 gives
a detailed description of the online phase.
The offline phase is used to pre-compute invariant properties
of the V-ETL workload, which allow online ingestion at negligible
overheads. To compute these properties, the user provides Skyscraper
with a small set (e.g. 5 minutes) of labeled data and a larger set
(e.g. two weeks) of unlabeled data from the ingested video source.
Skyscraper uses this data to prepare online ingestion in three steps.
First, Skyscraper profiles different knob configurations on the
provisioned on-premise hardware and cloud hardware. Each knob
configuration corresponds to a directed acyclic graph (DAG) of
UDFs. Skyscraper profiles the cloud cost and runtime of different
UDF placements - executing some UDFs on the cloud may re-
duce the execution time (due to added parallelism) but increases the
cloud cost. Skyscraper filters out placements that do not lie on the
cost-runtime Pareto frontier. Similarly, Skyscraper filters out knob
configurations that do not lie on the runtime-quality Pareto fron-
tier. Appendix F disusses how Skyscraper handles data movement
between UDFs and between on premises and the cloud.
Second, Skyscraper uses the unlabeled data to construct the con-
tent categories as discussed under Design challenges. The content
categories are constructed solely based on a quality metric that is
measured and returned by the user code (e.g. certainty or errors
commonly reported by CV models). By construction, the content
categories discriminate between any content characteristic that af-
fects the quality of at least one knob configuration. Constructing the
content categories solely based on a user-defined quality metric lets
Skyscraper generalize across workloads since Skyscraper doesn't
need to understand the precise workings of the UDFs and how their
performance is affected by pixel-level changes. Furthermore, dealing
with low-dimensional quality vectors (e.g., 5-dimensional) allows
Skyscraper to run fast, which is almost impossible when dealing
with high-dimensional image data (e.g., 750,000-dimensional).
Third, Skyscraper uses the unlabeled data to train the forecast-
ing model. As in under Design challenges, the forecasting model
forecasts how often each content category appears within a defined
future time interval. This forecast is based on how frequently the
content categories have appeared in the recent past.
After the offline phase, each knob configuration is characterized
by the quality it achieves on different content categories as well as
the profiled runtimes and cloud costs when executing the knob con-
figuration using different task placements. When optimizing video
ingestion, Skyscraper only considers the runtime of knob configura-
tions together with the quality the knob configuration achieves on the
current content category. This is sufficient to maximize the quality
under throughput constraints and lets Skyscraper agnostic to the
UDFs. Skyscraper periodically performs predictive knob planning
(e.g. every 2 days) and reactive knob switching (e.g. every 2 seconds):
Knob planning involves forecasting how often each content category
4
Knob plan1. Filter knob configurations K2. Profile + filter cloud/on-prem placements Pkk∈K}Knob planForecastPlanLook upUnlabeled training dataConstruct content categories, e.g. heavy traffic / light traffic CTrain forecasting model FOffline learning phaseOnline ingestion (V-ETL Transform step)Labeled training dataSwitchLook upSwitchLook upSwitchLook upSwitchForecastPlanLook upSwitchKnob plan...+3 OFFLINE PREPARATION PHASE
In the offline preparation phase, Skyscraper is fitted on the historical
video data recorded from the same source that will be ingested in
the online phase. Skyscraper needs a small set of labeled data (i.e.,
20 minutes) and a larger set of unlabeled data (e.g., 2 weeks). Based
on this data, Skyscraper first leverages prior work [2, 81] to create a
filtered set of knob configurations and a set of good task placements
for them. Then, Skyscraper clusters video content into categories
allowing Skyscraper to reason about video content in the online
phase. Furthermore, Skyscraper trains a forecasting model to predict
the frequency that each content category appears in the near future.
We describe these procedures in more detail as follows.
3.1 Filter knob configurations and task placements
In order to optimize video processing while inducing little deci-
sion overheads during online ingestion, Skyscraper needs to decide
the desirable knob configuration k to process the streamed content
and the placement T Pk of its task graph Gk . Recall that the place-
ment of Gk specifies which computation components when using
knob configuration k to run on the cloud and which ones to run
on-premises. The number of all knob configurations is exponential
in the number of user-registered knobs. Similarly, the number of all
possible placements for a task graph is exponential in the number
of tasks. Skyscraper leverages prior work [2, 81] to filter the set
of knob configurations and task placements down to a smaller set.
Thereafter, Skyscraper only needs to consider promising candidates
in the online phase, reducing the size of the decision problem and
therefore online overheads.
We leverage the greedy hill climbing algorithm [67] proposed in
VideoStorm [81] to filter the knob configurations. We use PlaceTo [2]
to filter the task placements (details in Appendixs A).
3.2 Categorize video dynamics
Skyscraper discretizes video content into content categories with
the property that knob configurations achieve similar result quality
for all video segments belonging to the same content category. In
this section, we describe how to identify these content categories
and will discuss how to forecast them in Section 3.3 and how the
categories allow for efficient video ingestion in Section 4.
Skyscraper categorizes video content using unlabeled training
data. Skyscraper first samples a set of video segments S′ from the
unlabeled data. Skyscraper then processes each segment s ∈ S′
with all configurations k ∈ K and records the result quality that
each k achieves on the segment s as quals (k). The result qual-
ity measurement is defined by the user and will be further dis-
cussed in Section 4. We group the qualities of all configurations
k on a segment s into a |K |-dimensional quality vector quals =
[quals (k1), ..., quals (k | K | )]T . We gather the quals for all segments
s ∈ S′ to form a set of quality vectors Q = {quals | s ∈ S′}. Then,
Skyscraper decides the content categories C by running KMeans [52]
on Q. Thereafter, the content is clustered according to the quality
that the knob configurations achieve on it, ensuring that all knob
configurations achieve similar result quality for the content of the
same category by the property of KMeans. A content category
c ∈ C is therefore characterized by a |K |-dimensional cluster center,
which denotes the average quality that the knob configurations will
Figure 3: Running the EV workload over a traffic camera.
appears in the future (e.g. within the next 2 days) and assigning
knob configurations to the content categories based on the forecast.
Knob switching involves determining the content category of the
current video content and looking up what knob configuration the
planning phase assigned to that category. Based on the assigned knob
configuration, the available buffer space, and the profiled runtimes,
Skyscraper then picks a knob configuration and task placement and
uses it to process the next segment of video.
Processing example Figure 3 shows how the knob planner and
knob switcher use the provisioned resources to achieve high-quality
results when running the EV example workload on 24 hours of a traf-
fic camera stream. The uppermost plot in Figure 3 shows how three
different knob configurations (expensive, medium, cheap) achieve
different result qualities. For the EV workload, the result quality is
mainly affected by object occlusions (i.e., one car overlaps with an-
other car). We observe that expensive configuration reliably produces
high-quality results while the cheap one only produces high-quality
results at night, when there is little traffic and few occlusions.
The second plot in Figure 3 shows how the dynamic knob switch-
ing in Skyscraper causes the change in the workload (TFLOP per
second). We can see that the workload is low during the night when
Skyscraper frequently uses the cheap configurations, but high during
the day when Skyscraper uses the expensive configurations. The data
in Figure 3 is smoothed and hides that Skyscraper switched 4500
times between knob configurations over the course of the plotted
time period. If we would instead always use the most expensive
configuration, the workload would be constant at 5.2 TFLOP/s.
The third plot in Figure 3 shows how Skyscraper sets video aside
into the buffer during the day when frequently running the expensive
knob configuration. We can also see how Skyscraper catches up on
processing the buffered video at 5PM, when the workload decreases.
The buffer has a size of 4GB and is full at around 2 PM. When it is
full, Skyscraper decides to offload some work to the cloud which is
reflected by the rising amount of cloud credits spent in the bottom
figure (note that the Y axis shows the percentage of the daily cloud
budget that has been spent). We can see that Skyscraper's spending
comes close to what it planned for that day.
5
0.51.0quality(rel. to best)Expensive conf.Medium conf.Cheap conf.12workload(TFLOP/s)024bufferuse(GB)buffersize=4GB03691215182124time of day0.00.51.0cloud$(spent / plan)achieve on content belonging to c. We denote the cluster center as
[q
ual (k, c) is the average quality
(cid:99)
that k will achieve on videos categorized as c.
ual (k | K |, c)], where q
(cid:99)
ual (k1, c), ...q
(cid:99)
We evaluate choices for the number of categories (k of KMeans)
in Appendix I.1 and find that Skyscraper is not very sensitive to k as
long as it is not too small (e.g. ≥ 3). Furthermore, it is easy to tune
such hyperparameters during the offline phase.
3.3 Train the forecasting model
Skyscraper trains a forecasting model F to predict how frequently
each content category c ∈ C appears in the near future time interval
given their frequency in the most recent history. F allows Skyscraper
to effectively ration computational resources and optimally allocate
them for different video content categories to come. We denote the
forecasted time interval as the planned interval.
Skyscraper uses a simple feed-forward neural network as fore-
casting model F . We find this to be sufficient and describe its ar-
chitecture in Appendix K. Let r (T ) be |C|-dimensional histogram
representing the frequency each category c ∈ C appears over time
interval T . The output of F is thus r (PI ) where PI is the planned
interval. The input to F is the content histograms of the most re-
cently ingested data. We split the most recent time interval Tinput
into n equally-sized intervals Tinput = [T1, ...,Tn] and provide their
category occurring frequency [r (T1 ), ..., r (Tn ) ] as time-series inputs
to F . We evaluate choices of Tinput and n in Appendix I.3 and find
that Skyscraper is not very sensitive to them as long as both Tinput
and n are reasonably large (i.e. Tinput is a couple of days and is split
into intervals of a couple of hours).
Skyscraper pre-trains F in the offline phase using the unlabeled
data, which we describe the detail in Appendix H. Furthermore, F
can be fine-tuned in the online phase using the recently ingested data
to provide more accurate forecasting.
4 ONLINE VIDEO INGESTION
After completing the offline learning phase, Skyscraper is ready to in-
gest live video streams. During live ingestion, Skyscraper uses both
a predictive component (knob planner) and a reactive component
(knob switcher) to make knob tuning decisions. The predictive knob
planner periodically forecasts trends in the video content and lets
Skyscraper make knob tuning decisions with the future workload
in mind. This allows Skyscraper to put the provisioned compute
resources to optimal use and prevents premature use of buffer space
and cloud credits, making use of expensive knob configurations
when they have the greatest impact. However, while it is possible
to forecast long-term trends in the content, the exact short-term oc-
currence of content is subject to substantial noise. Thus, Skyscraper
also uses a reactive knob switcher that switches between knob con-
figurations based on the current content. The knob switcher presents
a way to leverage the forecasted workload trends while being ro-
bust to short-term noise. In the following section, we describe the
algorithms used for both the knob planner and the knob switcher.
4.1 Knob planner
The knob planner computes a knob plan that specifies which knob
configurations k ∈ K to use for each content categories c ∈ C
to maximize the overall result quality given the available compute
resources. Such assignment of knob configurations to c is based on
the forecasted content distribution, which specifies how frequently
each knob configuration will appear over the forecasted interval.
Recall from Section 3.3, we refer to this interval as the the planned
interval. We find that accurate forecasts can be achieved a couple
of days into the future and consequently re-compute the knob plan
every couple of days using a fresh forecast.
Formally, the knob plan generates a histogram αc over knob
configurations K for each content category c ∈ C. αc determines
how often a knob configuration k ∈ K should be used for processing
content of category c - i.e., there is one bucket in the histogram
for each knob configuration, indicating the relative frequency with
which that configuration should be chosen for the content category.
Let αk,c denote the frequency that histogram αc assigns to knob
k ∈ K (i.e., how often knob k should be used to process the content
of category c). A knob plan P is thus defined as the set containing
the histograms for all content categories: P = {αc | c ∈ C}.
Finding a knob plan that maximizes the result quality under the
compute budget involves jointly optimizing the histograms for all
content categories. Each category's histogram determines the total re-
source consumption for processing content of the category, which in
turn determines how many resources are available for the remaining
categories. Skyscraper creates a knob plan in two steps.
First, the knob planner uses the pre-trained model F from the of-
fline phase to forecast how often (the ratio rc described in Section 3)
each content category will appear over the planned interval.
Second, using the forecasted content ratios rc , Skyscraper for-
mulates the assignment of knobs to content categories as a linear
program. This allows Skyscraper to find the globally optimal knob
plan P. Skyscraper maximizes the expected overall result quality
using the content category cluster centers computed in the offline
phase. As described in Section 3, each content category c ∈ C is
defined by a KMeans cluster center, which is a vector whose i-th ele-
ment denotes the average quality q
ual (ki, c) that knob configuration
(cid:99)
ki achieves on the content of category c. Given the average quality
of each knob configuration for each content category, the solution
of the linear program maximizes the overall expected quality while
being constrained by the compute budget budget.4
maximize
subject to
∑︁
k,c
∑︁
k,c
∑︁
k
αk,c ∗ rc ∗ q
ual (k, c)
(cid:99)
αk,c ∗ rc ∗ cost (k) ≤ budget
αk,c = 1, αk,c ≥ 0
∀c
(2)
(3)
(4)
The decision variables of the linear program are αk,c , which
determine how often the content of category c should be processed
by configuration k and thereby make up the knob plan. The goal
of the knob plan is to maximize the overall result quality, which
is denoted by Line 2. Line 3 denotes that the total amount of cost
should stay below the user-specified budget. Finally, Line 4 enforces
that the assigned ratios αk,c add up to 1 for each content category
(this is merely for normalization).
4The unit of the compute budget is given in core ∗ s using the on-premise server cores.
Skyscraper internally takes care of converting the user-defined cloud credits budget.
6
We use an off-the-shelf solver [75] which is able to find the
solution to this linear program in less than a second for the problem
sizes encountered by Skyscraper. After finding the optimal value for
the decision variables αk,c , we have the knob plan P which tells us
how often to use each knob k to process the content of category c in
order to achieve maximum quality given the constrained computing
resources. In Section 4.2, we show how P can be leveraged to
efficiently switch between knob configurations.
4.2 Knob switcher
Based on the current video content, the knob switcher reactively
determines which knob configuration knext ∈ K to use and which
tasks of knext 's task graph Gknext to execute on the cloud and which
tasks to execute on-premises. The knob switcher is designed to be
lightweight and doesn't induce significant decision overheads, even
when run frequently. It decides on the next knob configuration knext
and task placement pnext in three simple steps: First, it determines
the category ccur ∈ C that the current content belongs to. Second,
it looks content category ccur up in the knob plan to obtain the
configuration histogram αccur that the knob plan assigns to ccur .
Third, the knob switcher picks knob configuration knext based on
αccur along with a task placement pnext - the knob switcher hereby
guarantees to never overflow the buffer. In the following, we describe
how the knob switcher performs each of these steps in more detail.
In the first step, the knob switcher determines the category ccur of
the current content merely using the reported quality qual ∗ (kcur ) of
the current knob configuration kcur . This allows the knob switcher
to select a category in a low overhead way, rather than running an
expensive processing step on the video directly. Specifically, given
qual ∗ (kcur ), the knob switcher selects the current content category
ccur as the one whose average quality for kcur (q
ual (kcur , ccur ))
(cid:99)
matches the currently reported quality (qual (k∗)) the closest. The
average quality q
ual (kcur , c) of kcur for a category c ∈ C is given
(cid:99)
by c's cluster center (see Section 3.2). This is denoted by Equation 5.
ccur = argmin
c ∈ C
ual (kcur , c) − qual ∗ (kcur )(cid:12)
(cid:12)
(cid:12)q
(cid:12)
(cid:99)
(5)
Note that the knob switcher's content classification is analogous
to traditional classification with KMeans but only uses one vector
dimension since the other dimensions are unattainable. This works
well in Skyscraper's case because the content of different categories
will induce different result qualities for all knob configurations.
As a result, the quality of one knob configuration is sufficient to
discriminate between content categories. We experimentally verify
this in Section 5.6.
In the second step, the knob switcher then looks up the derived
content category ccur in the knob plan P. This yields a histogram
αccur dictating how often each knob configuration k ∈ K should be
used to process the content of the current category ccur :
In the third step, the knob switcher determines the knob config-
uration knext that will be used for processing the newly arriving
content, together with task placement pnext that determines which
tasks of knext 's task graph to execute on the cloud and which ones
to execute on-premises. The knob switcher tries to adhere as closely
to the planned histogram αccur as possible and therefore keeps a
αc for each c ∈ C, which denotes how frequently each
histogram (cid:98)
knob configuration has actually been used to process the content of
7
category c. To adhere as closely to the knob plan as possible, the
knob switcher picks the knob configuration knext that minimizes
αccur and αccur . This is denoted by Equa-
the difference between (cid:98)
tion 6. Finally, the knob switcher picks a placement pnext for knext .
Skyscraper picks the cheapest placement of Gknext that does not
overflow the buffer.
knext = ki with i = argmax
1≤i ≤ | K |
(αccur [i] − (cid:98)
αccur [i])
(6)
It is worth noting that there is an edge case when picking the
task placement pnext : Some knob configurations do not possess task
placements that run in real-time, even when heavily adding cloud
compute. Reasons for this include limited bandwidth to the cloud,
high round trip times to the cloud, and limited opportunities for
adding parallelism to the DAG execution. If all placements of knext
would make Skyscraper's buffer overflow, the knob switcher will
choose a different configuration k′
next to be the next one. This knob
configuration k′
next is the next less qualitative one compared to knext .
Like for knext , the knob switcher will pick the cheapest placement
of k′
next that does not overflow the buffer. If all placements of k′
next
would overflow the buffer, the knob switcher will recursively apply
this procedure of picking the next less qualitative knob configuration
until it finds a configuration and task placement that do not overflow
the buffer.
In summary, the knob switcher uses three steps to find a knob
configuration knext ∈ K along with a task placement pnext while
adding little runtime overheads to the ingestion process. The knob
switcher tries to adhere as closely to the knob plan P as possible,
only deviating from the knob plan when this is required to avoid a
buffer overflow. This ensures that the knob switcher maximizes the
result quality with the given resources.
5 EVALUATION
We evaluate Skyscraper on several real-world applications, covering
public health monitoring, traffic planning, and social media analysis.
We describe these workloads in subsection 5.2. Then, we evaluate
Skyscraper on the following aspects:
§5.3 What cost savings does Skyscraper achieve versus using a
static knob configuration?
§5.4 How much do cloud bursting and buffering individually
contribute to cost savings in different quality regimes? When
do they perform well and when don't they?
§5.5 How much decision overhead does Skyscraper impose at
different scales?
§5.6 How accurate are knob planner and knob switcher, and
what effect do inaccuracies have on Skyscraper's end-to-
end performance?
We further evaluate different hyperparameter choices of Skyscraper
in Appendix I (e.g., number of content categories (KMeans clusters),
periodicity of running the knob switcher, and more). We hereby find
that Skyscraper's end-to-end performance is insensitive to many of
the hyperparameters as long as they are within a reasonable range.
Implementation
5.1
We implement Skyscraper in Python on top of Ray [59]. We in-
stantiate several Ray actors for both the on-premise and the cloud
version of each UDF. The number of duplicate actors is based on
the number of logical cores of the machine. We only map UDFs to
Ray actors; all of Skyscraper's components run in the parent process
and synchronize the calls to the actors. We discuss implementation
choices in more detail in Appendix N.
We use AWS Lambda [69] to run UDFs in the cloud and provision
3GB of memory for each cloud function. To simulate incoming video
streams in real time, we read video frames from the disk and pause
appropriately between frames to guarantee 30 fps streaming rate.
All workloads are compute-bound and we find in Appendix, that in
our experiments decode only amounted to 5% of the overall runtime.
The streamed video is encoded in H.264 [64] and has a resolution of
1280 × 720 (HD). In our experiments, each frame is decoded when
arriving in the system (as part of the user code).
When sending full or partial frames to the cloud, we compress
them to JPEG-1 format [14]. We then serialize the JPEG using
Base64 [38] and send the string as part of an HTTPS request. The
overhead for encoding and decoding is negligible compared to the
transfer time saved through compression.
5.2 Workloads
We evaluate Skyscraper using three workloads on public health
monitoring, traffic planning, and social media analysis. They cover a
diverse set of computer vision primitives including object detectors,
trackers, and classifiers, as described below.
COVID-19 safety measures (COVID) During the coronavirus
pandemic, decision-makers have executed several safety measures
to slow down the spread of the virus. Such measures include wear-
ing facial masks and social distancing. Measuring where and how
strictly people adhere to these measures can be used for decision-
making and informing people at risk. The COVID workload consists
of a YOLOv5 object detector [62] to detect pedestrians and a KCF
tracker [31] to track the detected pedestrians ("detect-to-track"). Af-
ter the detection, for each detected pedestrian, the workload employs
homography [18] to measure the pedestrian's distance from others.
This workload contains the following knobs: 1) frame rate at
which video is processed ({30FPS, 15FPS, 10FPS, 5FPS, 1FPS}),
2) object detection rate to run object detector (every {1, 5, 30, 60}
frames) and 3) tiling for object detection that slices the frames
into ({1x1, 2x2}) tiles. The detailed semantics of these knobs are
provided in Appendix J.
The workload is executed on an 8-day video stream of a busy
shopping street in Tokyo.5We measure quality in terms of the number
of people detected and tracked over time as YOLO has a low false
positive rate and KCF trackers reliably report tracking errors.
Multi-object tracking (MOT) Multi-object tracking (MOT) is a
key primitive in many video analytical pipelines. In this workload,
we adopt the recent state-of-the-art TransMOT [15] tracker on MOT
benchmark [22] and introduce four tunable knobs: 1) frame rate
(every {1, 5, 30, 60} frames), 2) number of tiles ({1x1, 2x2} tiling),
3) length of history denoting the number of historical frames ({1, 2,
3, 5}) as the TransMOT input, and 4) model size ({small, medium,
large}) that specifies different parameter sizes of the pre-trained
TransMOT. The details of TransMOT and its tunable knobs are
provided in Appendix J.
We run MOT on a stream of a traffic intersection, Shibuya in
Tokyo to track pedestrians for 8 days. MOT's processing quality is
defined as the sum of tracked pedestrians weighted by the model's
reported certainty. With this quality metric, we want to evaluate how
Skyscraper maximizes model certainty as a proxy for accuracy as
proposed in prior work [55, 63].
Multi-modal opinion sentiment and emotion intensity (MOSEI)
This workload is synthetic and simulates a video stream analysis
application on Twitch. The number of incoming streams varies over
time and mimics the number of live Twitch streams over two days.6
We further introduce two types of spikes to evaluate Skyscraper
under difficult conditions:
• MOSEI-HIGH: We introduce high but short peaks in workload,
consisting of 62 concurrently incoming video streams. This makes
cloud bursting difficult due to bandwidth limitations.
• MOSEI-LONG: We introduce a long peak of continuous work-
load. In this case, the buffer alone cannot handle all the extra work.
We use the CMU-MOSEI [7] dataset to simulate incoming video
streams, as it has ground truth labels that allow us to train the models
used in the workload. It contains various talking head videos from
YouTube. The task of the MOSEI workload is to classify the opinion
sentiment of the speaker using both the audio and the visual con-
tent. CMU-MOSEI provides extracted features from the video with
ground-truth labels. We trained a neural network on CMU-MOSEI's
training set and used its test set to evaluate Skyscraper.
MOSEI workload contains the four knobs: 1) frame rate, 2) fre-
quency of sentiment analysis that we may run sentimental analysis
model once every {1, 2, 3, 4, 5, 6, 7} sentences of the spoken audio
and video, 3) model size of the sentimental analysis model, and 4)
the number of streams to analyze.
Further details about this dataset, the entity extraction DAG, and
the tunable knobs are presented in Section J in the Appendix. We
evaluate the processing quality as the weighted sum over the ingested
streams weighted on model's reported certainty.
Due to space limitation, we describe the hyperparameters of
Skyscraper for all four workloads in Appendix I.
5.3 Cost efficiency
In this section, we evaluate the end-to-end cost savings that Skyscraper
achieves on these workloads. We hereby compare Skyscraper to two
baselines. The Static baseline processes the video streams stati-
cally using the same knob configuration throughout the stream. The
Chameleon* baseline refers to an adapted version of Chameleon [40].
We equip Chameleon with a buffer and adapt it to set video aside
when the provisioned hardware cannot process it in real-time. This
allows Chameleon to achieve cost savings, since it doesn't need to
be provisioned to handle peak workload. However, Chameleon* is
not practical and may easily crash, as its lack of throughput guaran-
tees may lead to buffer overflows. We benchmarked Chameleon* on
several hardware setups and only report the numbers where it didn't
crash during the benchmark.
For each system, we report the overall result quality that the
system achieves on different hardware set ups. Since we do not have
access to a wide range of compute servers, we use Google Cloud
VM instances as the provisioned, always-on hardware ("on-premise
5The Koen-Dori street in the Shibuya district: https://youtu.be/gALQR-nsEME
6As recorded by Twitch Tracker at https://twitchtracker.com/statistics/active-streamers
8
Figure 4: Cost-quality trade-off of Skyscraper, Chameleon∗ and statically using the same knob throughout ingestion.
servers"). In the case of Skyscraper, which additionally uses AWS
Lambda, we have verified that the bandwidth and latencies from the
Google Cloud VMs to AWS Lambda realistically reflect the ones of
commodity on-premise setups. In our experiments, we consider the
following Google Cloud machines:
• e2-standard-4: 4 vCPUs, 16 GB memory, 0.14 USD/h
• e2-standard-8: 8 vCPUs, 32 GB memory, 0.27 USD/h
• e2-standard-16: 16 vCPUs, 64 GB memory, 0.54 USD/h
• e2-standard-32: 32 vCPUs, 128 GB memory, 1.07 USD/h
• c2-standard-60: 60 vCPUs, 240 GB memory, 2.51 USD/h
While these instance types do not possess hardware accelera-
tors (e.g., GPUs), we note that there is nothing fundamental about
Skyscraper that would prevent users from using hardware different
from only CPUs. If a user provisions Skyscraper with a server that
contains hardware accelerators, the application's UDFs would need
to make sure that the hardware accelerators are used when executing
the UDF. In the offline phase, Skyscraper will then just measure the
UDF's runtime and work normally without any modifications.
Figure 4 visualizes the cost of processing the workloads from
Section 5.2 with each system. On average, content category changes
occured every 42s for COVID, every 43s for MOT, every 30s for
MOSEI HIGH, every 24s for MOSEI LONG. However, all work-
loads had some periods with very frequent category changes and
others with few category changes. Table 2 in Appendix C further
provides the numeric measurements depicted in Figure 4. The total
cost of each system is derived from the cost of renting the cloud
hardware. In Appendix L, we estimate that the same amount of com-
puting costs 1.8× more when using a Google Cloud VM than when
using a provisioned on-premise server (this estimate is high and in
favor of the baselines). Thus, the total cost of all systems is given by
the cost of renting the Google Cloud VMs divided by 1.8 plus the
cost of the AWS Lambda workers.
Summary. Overall, Skyscraper offers significantly better cost-
quality trade-offs than current approaches. Skyscraper's performance
benefits are especially large on the MOT workload: Skyscraper
is 8.7× cheaper than the static baseline at a comparable quality.
Furthermore, Skyscraper is 3.7× cheaper than Chameleon* at a
better quality. Chameleon* suffered from large profiling overheads.
For the COVID and MOT workload, our results are comparable
to what the authors report in the Chameleon paper (2-3× speedup
over the static baseline at the highest quality level). For the MOSEI
workloads, the profiling overheads were especially large since the
expensive knob configurations cause large amounts of work.
* Chameleon* is an adapted version of Chameleon [40] that uses a buffer. However,
Chameleon* is not practical and would frequently crash in practice due to overflows of
the unmanaged buffer.
9
5.4 Ablation study
To evaluate how much buffering and cloud bursting individually
contribute to the cost savings, we run an ablation study where we
independently disable them. Running this ablation study on unsimu-
lated hardware is prohibitively expensive (i.e., we need to conduct
dozens of measurements as the one in Figure 4), so we can only
afford to analyze with simulated results. We use a simple but ac-
curate simulator, that we describe in Appendix M.1. We evaluate
the accuracy of the simulator on the benchmarked workloads in
Appendix M.2 and find that it is reasonably accurate.
We use two metrics to evaluate the performance of Skyscraper:
(1) The monetary cost of processing the workload. We hereby
also evaluate Skyscraper for different cost ratios between the on-
premise and the cloud computing. In Appendix L, we estimate that
a ratio of 1:1.8 between on-premises and AWS Lambda is realistic
at the current market prices. When evaluating the monetary cost, we
evaluate four variations of Skyscraper:
(1a) No buffering, no cloud: We disable both buffering and cloud
bursting. Effectively, this corresponds to not switching knob config-
urations and only using the most qualitative knob configuration that
runs in real time on the given on-premise server.
(1b) Only buffering: Skyscraper may only use placements that
place every task on-premise and can not use the cloud.
(1c) Only cloud: Skyscraper may use the cloud but not buffering.
(1d) Buffering & cloud: This corresponds to standard Skyscraper.
(2) The amount of work measured in core ∗ seconds used in
the processing. This is independent of whether the computation is
buffered or executed on the cloud or on premises. When evaluating
the amount of work, we compare Skyscraper to two baselines:
(2a) Static: This baseline corresponds to statically using the same
knob configuration. It is similar to baseline (1a) where Skyscraper
also statically uses the same configuration.
(2b) Skyscraper: We measure the amount of work that Skyscraper
performs for processing the workload.
(2c) Optimum: The optimum baseline fully leverages the ground
truth to always choose the optimal knob configuration. Specifically,
given the performance of each knob configuration beforehand, it
uses the greedy 0-1 knapsack approximation to choose knob config-
urations that maximize quality under certain budget.
Figures 6, 8, 10, 12 show the cost-quality trade-off curves for
the COVID, MOT, MOSEI-HIGH, and MOSEI-LONG workloads.
Figures 7, 9, 11, 13 show the work-quality trade-off curves.
For the COVID and MOT workload, Only cloud and Only buffer-
ing alone can achieve significant speed-ups over the baseline. For
both workloads, when combining the two (Buffering & cloud), peak
quality can be roughly reached at 1.5× less cost than when only
buffering or only using the cloud for a cost ratio of 1.8:1. For 5:2 cost
0.20.40.60.8$0$20$40$60$8000.20.40.60.81$0$20$40$60$800.20.40.60.811.2$0$100$200$3000.20.40.60.811.2$0$100$200$300a) COVID (8 days unsimulated)qualitySkyscraperChameleon* (no throughput guarantees / prone to crashing)Static baselineDollar cost (USD)b) MOT (8 days unsimulated)qualityDollar cost (USD)c) MOSEI-HIGH (2 days simualted)qualityDollar cost (USD)d) MOSEI-LONG (2 days simualted)qualityDollar cost (USD)ratio, Only cloud performs significantly worse, because off-loading
work off to the cloud incurs a very high cost. For 1:1 cost ratio, Only
cloud matches the performance of Buffering & cloud as using cloud
resources has the same cost the on-premises computations.
For the MOSEI workloads, we can see how Only buffering and
Only cloud struggle to deliver good performance for MOSEI-HIGH
and MOSEI-LONG, respectively. However, we observe that Buffer-
ing & cloud delivers good performance on both. The reason for
the bad performance of Only cloud on MOSEI-HIGH is bandwidth
limitations that limit the number of social media streams that can
be offloaded to the cloud. The reason for the bad performance of
Only buffering on MOSEI-LONG is that the buffer gets filled early
on, which prevents Skyscraper from using expensive knob configu-
rations for the remaining duration of the long workload peak.
Finally, Figures 7, 9, 11 show that Skyscraper's work reduc-
tion method performs astonishingly close to optimum. Only for
the MOSEI-LONG workload (Figure 13) does Skyscraper leave
large room for improvement.
Summary. To certain extent, the buffering and cloud bursting
optimizations are complementary to each other. Specifically, the per-
formance improvement of using both over using one of them is not
as large as performance difference between them. Therefore, cloud
bursting lessens the need for buffering and vice versa. However,
Skyscraper can still achieve 1.5× cost savings in the COVID and
MOT workloads over only one of the two methods. Furthermore,
10
the MOSEI workloads show that buffering and cloud bursting strug-
gle for different kinds of workload spikes. By combining the two,
Skyscraper can achieve good performance for both kinds of spikes.
5.5 Runtime overheads
Appendix E evaluates the runtime of the offline phase. For the
COVID workload, the overall runtime was 1.6 hours on two c2-
standard-60 machines. 83% of the time was spent creating the train-
ing data for the forecasting model, which is embarrassingly parallel
and can be sped up when using more machines.
Skyscraper's knob planner and knob switcher add overheads to
the online execution time. In this section, we evaluate their runtimes
for different amounts of placements, content categories, and knob
configurations. All runtime measurements are performed on a single
core of the Intel Xeon Gold 6130 CPU running at 2.10GHz.
The worst-case runtime of the knob switcher is linear in the total
number of placements (for all knob configurations). This worst
case is achieved when the knob switcher needs to iterate through
all configuration-placement pairs until it finds one that does not
overflow the buffer (see Section 4). The left plot in Figure 13 shows
the worst-case runtime as the dashed line and the average runtimes
of the knob switcher for the COVID, MOT, and MOSEI experiments.
The knob planner conducts an inference pass through a small
neural network and solves a linear program. For the linear program,
the number of variables is |C| ∗ |K | and the number of constraints
is 1 + 2 ∗ |C|, where C denotes the number of content categories
and K is the number of knob configurations. The right image in
0.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.8100.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.810.20.40.60.811.200.20.40.60.81a) 1:1 Cloud/on prem cost ratiob) 1.8:1 Cloud/on prem cost ratioc) 5:2 Cloud/on prem cost ratioCOVIDqualityqualityqualityqualityFigure 5: Monetary cost comparison for COVID workloada) 1:1 Cloud/on prem cost ratiob) 1.8:1 Cloud/on prem cost ratioc) 5:2 Cloud/on prem cost ratioMOTqualityqualityqualityqualityFigure 7: Monetary cost comparison for MOT workloadFigure 8: Work (core*s) of MOT workloada) 1:1 Cloud/on prem cost ratiob) 1.8:1 Cloud/on prem cost ratioc) 5:2 Cloud/on prem cost ratioMOSEI-HIGHqualityqualityqualityqualityFigure 9: Monetary cost comparison for MOSEI-HIGH workloadFigure 10: Work (core*s) of MOSEI-HIGH workloadBuffering & CloudOnly CloudOnly bufferingNo buffering, no CloudSkyscr.Optimuma) 1:1 Cloud/on prem cost ratiob) 1.8:1 Cloud/on prem cost ratioc) 5:2 Cloud/on prem cost ratioMOSEI-LONGqualityqualityqualityqualityFigure 11: Monetary cost comparison for MOSEI-LONG workloadFigure 12: Work (core*s) of MOSEI-LONG workloadStatic100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized work1100.20.40.60.8Normalized work1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized work1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized cost1100.20.40.60.8Normalized work1Figure 6: Work (core*s) of COVID workloadFigure 13: Overheads: knob switcher (<1ms) and planner (<1s)
Figure 13 uses the heat map to visualize the overheads caused by the
knob planner for different amounts of content categories and knob
configurations. This image also shows the actual runtime of knob
planner on the three workloads.
Summary. For common problem such as the COVID, MOT, and
MOSEI workloads, the overheads of both the knob switcher and
knob planner are negligible. While the knob switcher runs every
few seconds, its runtime is typically below a millisecond. Similarly,
the knob planner typically runs every few days but with a runtime
below a second. We also show that the runtime overhead of our
optimization is reasonable for more complicated workloads.
5.6 Microbenchmarks
This subsection evaluates how accurately Skyscraper's forecasting
model F can predict the future content distribution and how sen-
sitive Skyscraper's performance is to inaccuracies in the forecast.
Similarly, the subsection evaluates the accuracy at which the knob
switcher classifies the video content into a content category c ∈ C
and how sensitive Skyscraper's performance is to misclassifications.
In our evaluation, we focus on the real-world workloads COVID and
MOT. The MOSEI workloads are synthetically created by inducing
workload spiking patterns as described in Section 5.2. While these
workloads present especially difficult spiking patterns for buffering
and cloud bursting, the forecasting model achieves 100% accuracy
and the knob switcher particularly high performance due to the regu-
larity and smoothness of their workload peaks. We therefore do not
evaluate them in terms of accuracy in this subsection.
Forecasting model We evaluate the forecasting model on 8 days
of test data after training it on 16 days of unlabeled training data. We
train and evaluate the forecasting model on four different lengths of
the planned interval: {1, 2, 4, 8} days. As described in Section 4.1,
the length of the planned interval determines the frequency of run-
ning knob planner and how long F needs to forecast into the future.
We find that for both workloads, Skyscraper's forecasting method
achieves a low Mean Absolute Error (MAE) when forecasting 1 to
4 days into the future. We denote the MAE values in Appendix I.3.
For both workloads, the lowest MAE was achieved when forecasting
2 days into the future, while the largest MAE was incurred when
doing so for 8 days.
There is a sweet spot on how far to forecast into the future but this
sweet spot is unrelated to the frequency of content category changes.
Forecasting over very large time intervals is hard because events far
in the future become increasingly uncorrelated to the current events,
which the forecast is based on. On the other hand, forecasting over
too short time periods is also hard: The streamed video content is
11
Figure 14: The effect of different planned interval lengths on
Skyscraper's end-to-end performance
always subject to a certain amount of randomness (e.g. a large group
of people randomly walking past a camera). Over large enough time
intervals, this randomness is smoothed out, which makes the forecast
more precise. When this smoothing effect is not achieved, errors
due to unforeseen randomness will be noticeable in the MAE of the
predictions. The high MAE when forecasting 8 days into the future
shows that forecasting far into the future is difficult as events become
increasingly uncorrelated to the current events, which the forecast is
based on. On the other hand, forecasting over too short time periods
also leads to higher MAEs: Streamed video content is always subject
to a certain amount of randomness (e.g. a large group of people
randomly walking past a camera). Over large enough time intervals,
this randomness is smoothed out and therefore doesn't show in the
MAE, which doesn't occur for forecasts over short periods.
Figure 14 shows the impact of the prediction errors in terms
of end-to-end performance. For comparison, we additionally run
Skyscraper using the ground truth content distributions instead of
forecasting. For planned interval lengths between 1 and 4, Skyscraper's
performance is very close to the optimal performance using the
ground truth predictions. However, for both workloads Skyscraper
performs significantly worse for a planned interval length of 8.
Knob switcher As described in Section 4.2, it is possible that the
knob switcher misclassifies video content into the wrong content
category. We identify two reasons for such misclassifications. First,
the knob switcher classifies content based on the quality of one knob
configuration. This corresponds to KMeans classification, where
a vector is classified using only one dimension instead of all. We
denote misclassifications, that occur because of this as Type-A errors.
Second, the knob switcher determines the current content category
based on the past couple of seconds of the video. It will then switch
to a knob configuration that is used for processing the next couple of
seconds of video, which creates a time mismatch. The last couple of
seconds might belong to a different content category than the next
couple of seconds. We denote errors caused by this timing mismatch
as Type-B errors. Distinguishing between these two errors lets us
gain insight into where performance losses come from, which could
be used for further enhancements of Skyscraper.
In Figure 15, we denote the standard knob switcher as described
in Section 4.2 as Standard and compare it against two baselines:
Ground truth denoting Skyscraper using the ground truth content
categories and No Type-B errors denotes a baseline that partially
uses the ground truth to eliminate errors of Type-B. Specifically,
it determines the content category using Skyscraper's standard ap-
proach but on the data of a future couple of seconds (i.e., it knows
how the current knob configuration would perform in the next couple
of seconds without executing it). Like this, only errors of Type-A
1513119753100.20.40.60.811.21.41.60200040006000800010000Runtime (ms)PlacementsRuntime Knob SwitcherRuntime Knob PlannerCOVIDMOTMOSEI5 35 65 95 125 1551.751.501.251.000.750.500.25Content categoriesRuntime (s)Knob configurations0.50.70.91.100.51qualityquality0.50.70.91.100.51Ground truth1 day forecast2 day forecast4 day forecast8 day forecast00.51.000.51.0NormalizedbudgetNormalizedbudgetCOVIDMOTsolely based on the concurrently running queries (while being agnos-
tic to the streamed content). These systems are useful in scenarios
where users issue dynamic queries over video streams, which require
the system to dynamically multiplex compute resources among the
queries. VideoStorm [81] and VideoEdge [35] go beyond dynamic
resource allocation and also tune the queries' knobs based on the
other queries that are concurrently running. However, in scenarios
where the query load remains static, there is no benefit in dynam-
ically adapting to the query load. In V-ETL, a constant set of jobs
is used to ingest the video streams. In contrast to VideoStorm and
VideoEdge, Skyscraper therefore dynamically adapts to changes in
the video content instead of the query load.
Streaming ETL. Treating data warehouse ingestion as a state-
ful stream processing problem is an established approach [25],
which is successfully used in many big data applications [56]. Like
Skyscraper, traditional streaming ETL is also concerned with main-
taining data quality while handling fluctuating workloads without
peak provisioning. This is typically achieved through methods like
back pressure or load shedding, which mitigate workload peaks
arising from fluctuating volumes of arriving data [72]. However, in
V-ETL, data often arrives at constant volume, and only the content
of the data changes. In contrast to traditional streaming systems,
Skyscraper 's optimizations therefore focus on adapting to the con-
tent of the streamed data and not to its volume.
General-purpose cloud offloading. Several works have previ-
ously explored the idea of offloading work from an on-premise
server to on-demand cloud workers [1, 17, 19, 26, 37, 48, 50, 83].
These works assume that jobs occasionally arrive and these jobs may
be executed locally or offloaded to the cloud. However, these works
only optimize the placement of work and do not reduce work by
means like knob tuning, which is Skyscraper's main optimization.
Task-specific computer vision optimizations. Several works op-
timize the application of CV for specific tasks and queries. While
these methods cannot be used to optimize arbitrary V-ETL jobs,
they can be used inside Skyscraper's UDFs to further reduce cost.
General methods to improve the efficiency of neural networks in-
clude model compression [27, 49], compact neural architectures,
[36, 51, 62], and knowledge distillation [6, 32, 44, 74]. Further works
propose efficient CV primitives that are query-aware or content-
adaptive [5, 10, 11, 13, 39, 44, 76]. Finally, some works reduce
processing costs of certain video queries by intelligently skipping
frames [8, 30, 33, 43, 45, 46, 54, 58, 80].
7 CONCLUSION
In this paper, we defined the problem of V-ETL for transforming
video streams to a queryable format through expensive ML-based
video processing DAGs. In response, we introduced Skyscraper,
which uses content-adaptive knob tuning to reduce the cost of the
V-ETL Transform step while adhering to V-ETL's throughput re-
quirements on constrained hardware resources. Skyscraper supports
conversions to arbitrary query formats.
ACKNOWLEDGMENTS
We thank the Data Systems and Artificial Intelligence Lab (DSAIL)
for supporting this work.
Figure 15: End-to-end performance of knob switcher against
baselines that leverage ground truth for content classification
impede the performance of the No Type-B errors baseline, which
shows their impact on Skyscraper's end-to-end performance.
Figure 15 shows that the knob switcher's misclassifications have
a negative impact on Skyscraper's end-to-end performance when
using the Standard. The misclassification rate of Standard is 2.1% on
COVID and 6.6% on the MOT workload. However, the performance
of the No Type-B errors baseline almost matches the optimum. This
suggests that the remaining Type-A errors barely impede the overall
performance. These errors constitute 0.5% of the knob switcher's
error rate on COVID and 3.7% on the MOT workload.
Summary The microbenchmarks provide two insights. First, when
forecasting between 1 to 4 days into the future, Skyscraper's fore-
casting method is accurate and does not significantly harm end-
to-end performance when compared to using the ground truth as
forecast. However, when forecasting further into the future (e.g., 8
days), the forecasts become less accurate, which shows an effect
on Skyscraper's end-to-end performance. Second, misclassifications
of the knob switcher negatively impact Skyscraper's performance.
We hereby identify a time mismatch as the sole driver for the per-
formance losses. This timing mismatch occurs because the knob
configuration to process the next couple of seconds with is based on
the content of the last couple of seconds.
6 RELATED WORK
The cost problem of video processing has previously been recog-
nized [65, 66]. While we are not aware of past research which man-
ages video streams like in a data warehouse, several systems propose
end-to-end solutions for managing archived collections of video like
in a relational database system [9, 20, 28, 41, 42, 47, 53, 78, 79].
Likewise, we are not aware of past work that directly addresses the
V-ETL problem, but there are several lines of work on efficient video
processing that are relevant to Skyscraper.
Content-adaptive knob tuning systems. Content-adaptive knob
tuning systems aim at saving computational work by dynamically
adjusting knobs that are inherent to CV workloads to the video
stream's content. Chameleon performs content-adaptive knob tun-
ing for general CV workloads [40]. However, Chameleon assumes
that each knob configuration can be run in real-time on the provi-
sioned hardware resources ("peak provisioning"). Chameleon then
minimizes the average processing time per frame. As discussed in
Section 1, such systems cannot deliver cost savings while also ad-
hering to throughput guarantees, which is required in the V-ETL
problem. Zeus is another content-adaptive knob tuning system [16],
but cannot be used for general-purpose V-ETL, as it is specific to
action detection (e.g., detect someone crossing the street).
Query-load-adaptive knob tuning systems. Instead of adapting to
the streamed content, some systems tune the knobs of a CV workload
12
0.50.70.91.100.51COVIDqualityquality0.50.70.91.100.51MOTGround truthNo Type-B errorsStandard00.51.0Normalizedcost00.51.0NormalizedcostREFERENCES
[1] Sándor Ács, Miklós Kozlovszky, and Péter Kacsuk. 2014. A novel cloud bursting
technique. 2014 IEEE 9th IEEE International Symposium on Applied Computa-
tional Intelligence and Informatics (SACI) (2014), 135–138.
[2] Ravichandra Addanki, Shaileshh Bojja Venkatakrishnan, Shreyan Gupta, Hongzi
Mao, and Mohammad Alizadeh. 2019. Placeto: Learning generalizable de-
vice placement algorithms for distributed machine learning. arXiv preprint
arXiv:1906.08879 (2019).
[3] Paavo Alku, Tom Bäckström, and Erkki Vilkman. 2002. Normalized amplitude
quotient for parametrization of the glottal flow. The Journal of the Acoustical
Society of America 112, 2 (2002), 701–710. https://doi.org/10.1121/1.1490365
arXiv:https://doi.org/10.1121/1.1490365
[4] Paavo Alku, Helmer Strik, and Erkki Vilkman. 1997. Parabolic spectral parameter
- A new method for quantification of the glottal flow. Speech Communication
22, 1 (1997), 67–79. https://doi.org/10.1016/S0167-6393(97)00020-4
[5] Michael R. Anderson, Michael Cafarella, German Ros, and Thomas F. Wenisch.
2019. Physical Representation-Based Predicate Optimization for a Visual Analyt-
ics Database. In 2019 IEEE 35th International Conference on Data Engineering
(ICDE). IEEE. https://doi.org/10.1109/icde.2019.00132
[6] Rohan Anil, Gabriel Pereyra, Alexandre Passos, Róbert Ormándi, George E.
Dahl, and Geoffrey E. Hinton. 2018. Large scale distributed neural network
training through online distillation. In 6th International Conference on Learning
Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018,
Conference Track Proceedings. OpenReview.net. https://openreview.net/forum?
id=rkr1UDeC-
[7] AmirAli Bagher Zadeh, Paul Pu Liang, Soujanya Poria, Erik Cambria, and Louis-
Philippe Morency. 2018. Multimodal Language Analysis in the Wild: CMU-
MOSEI Dataset and Interpretable Dynamic Fusion Graph. In Proceedings of the
56th Annual Meeting of the Association for Computational Linguistics (Volume 1:
Long Papers). Association for Computational Linguistics, Melbourne, Australia,
2236–2246. https://doi.org/10.18653/v1/P18-1208
[8] Jaeho Bang, Pramod Chunduri, and Joy Arulraj. 2021. EKO: Adaptive Sampling
of Compressed Video Data. https://doi.org/10.48550/ARXIV.2104.01671
[9] Jaeho Bang, Gaurav Tarlok Kakkar, Pramod Chunduri, Subrata Mitra, and Joy
Arulraj. 2023. Seiden: Revisiting Query Processing in Video Database Systems.
Proc. VLDB Endow. 16, 9 (jul 2023), 2289–2301.
https://doi.org/10.14778/
3598581.3598599
[10] Favyen Bastani, Songtao He, Arjun Balasingam, Karthik Gopalakrishnan, Mo-
hammad Alizadeh, Hari Balakrishnan, Michael Cafarella, Tim Kraska, and Sam
Madden. 2020. MIRIS: Fast Object Track Queries in Video. In Proceedings of the
2020 ACM SIGMOD International Conference on Management of Data (Portland,
OR, USA) (SIGMOD '20). Association for Computing Machinery, New York,
NY, USA, 1907–1921. https://doi.org/10.1145/3318464.3389692
[11] Favyen Bastani and Samuel Madden. 2022. OTIF: Efficient Tracker Pre-
Processing over Large Video Datasets. In Proceedings of the 2022 Interna-
tional Conference on Management of Data (Philadelphia, PA, USA) (SIGMOD
'22). Association for Computing Machinery, New York, NY, USA, 2091–2104.
https://doi.org/10.1145/3514221.3517835
[12] Adnane Cabani, Karim Hammoudi, Halim Benhabiles, and Mahmoud Melkemi.
2021. MaskedFace-Net – A dataset of correctly/incorrectly masked face images
in the context of COVID-19. Smart Health 19 (2021), 100144. https://doi.org/
10.1016/j.smhl.2020.100144
[13] Jiashen Cao, Ramyad Hadidi, Joy Arulraj, and Hyesoon Kim. 2021. THIA:
Accelerating Video Analytics using Early Inference and Fine-Grained Query
Planning. https://doi.org/10.48550/ARXIV.2102.08481
[14] CCITT. 1992. Digital compression and coding of continuous-tone still images -
requirements and guidelines. https://www.w3.org/Graphics/JPEG/itu-t81.pdf.
[15] Peng Chu, Jiang Wang, Quanzeng You, Haibin Ling, and Zicheng Liu. 2021.
TransMOT: Spatial-Temporal Graph Transformer for Multiple Object Tracking.
https://doi.org/10.48550/ARXIV.2104.00194
[16] Pramod Chunduri, Jaeho Bang, Yao Lu, and Joy Arulraj. 2022. Zeus: Efficiently
Localizing Actions in Videos Using Reinforcement Learning. In Proceedings of
the 2022 International Conference on Management of Data (Philadelphia, PA,
USA) (SIGMOD '22). Association for Computing Machinery, New York, NY,
USA, 545–558. https://doi.org/10.1145/3514221.3526181
[17] Li Chunlin, Tang Jianhang, and Luo Youlong. 2019. Hybrid Cloud Adaptive
Scheduling Strategy for Heterogeneous Workloads. Journal of Grid Computing
17, 3 (01 Sep 2019), 419–446. https://doi.org/10.1007/s10723-019-09481-3
[18] A. Criminisi, I. Reid, and A. Zisserman. 1999. A plane measuring device. Image
and Vision Computing 17, 8 (1999), 625–634. https://doi.org/10.1016/S0262-
8856(98)00183-8
[19] A. Das, A. Leaf, C. A. Varela, and S. Patterson. 2020. Skedulix: Hybrid Cloud
Scheduling for Cost-Efficient Execution of Serverless Applications. In 2020
IEEE 13th International Conference on Cloud Computing (CLOUD). IEEE
Computer Society, Los Alamitos, CA, USA, 609–618. https://doi.org/10.1109/
CLOUD49709.2020.00090
[20] Maureen Daum, Brandon Haynes, Dong He, Amrita Mazumdar, and Magdalena
Balazinska. 2021. TASM: A tile-based storage manager for video analytics. In
2021 IEEE 37th International Conference on Data Engineering (ICDE). IEEE,
1775–1786.
[21] A. P. Dempster, N. M. Laird, and D. B. Rubin. 1977. Maximum Likelihood
from Incomplete Data via the EM Algorithm. Journal of the Royal Statistical
Society. Series B (Methodological) 39, 1 (1977), 1–38. http://www.jstor.org/
stable/2984875
[22] P. Dendorfer, H. Rezatofighi, A. Milan, J. Shi, D. Cremers, I. Reid, S. Roth,
K. Schindler, and L. Leal-Taixé. 2020. MOT20: A benchmark for multi object
tracking in crowded scenes. arXiv:2003.09003[cs] (March 2020). http://arxiv.
org/abs/1906.04567 arXiv: 2003.09003.
[23] Thomas Drugman and Abeer Alwan. 2020. Joint Robust Voicing Detection and
Pitch Estimation Based on Residual Harmonics. https://doi.org/10.48550/ARXIV.
2001.00459
[24] Thomas Drugman, Mark Thomas, Jon Gudnason, Patrick Naylor, and Thierry
Dutoit. 2012. Detection of Glottal Closure Instants From Speech Signals: A Quan-
titative Review. IEEE Transactions on Audio, Speech, and Language Processing
20, 3 (2012), 994–1006. https://doi.org/10.1109/TASL.2011.2170835
[25] Lukasz Golab and Theodore Johnson. 2013. Data stream warehousing. In ACM
SIGMOD Conference. 949–952.
[26] Tian Guo, Upendra Sharma, Timothy Wood, Sambit Sahu, and Prashant Shenoy.
2012. Seagull: Intelligent Cloud Bursting for Enterprise Applications. In 2012
USENIX Annual Technical Conference (USENIX ATC 12). USENIX Associa-
tion, Boston, MA, 361–366. https://www.usenix.org/conference/atc12/technical-
sessions/presentation/guo
[27] Song Han, Huizi Mao, and William J. Dally. 2016. Deep Compression: Com-
pressing Deep Neural Network with Pruning, Trained Quantization and Huffman
Coding. In 4th International Conference on Learning Representations, ICLR 2016,
San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, Yoshua
Bengio and Yann LeCun (Eds.). http://arxiv.org/abs/1510.00149
[28] Brandon Haynes, Maureen Daum, Dong He, Amrita Mazumdar, Magdalena
Balazinska, Alvin Cheung, and Luis Ceze. 2021. Vss: A storage system for video
analytics. In Proceedings of the 2021 International Conference on Management
of Data. 685–696.
[29] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep resid-
ual learning for image recognition. In Proceedings of the IEEE conference on
computer vision and pattern recognition. 770–778.
[30] Wenjia He, Michael R. Anderson, Maxwell Strome, and Michael Cafarella. 2020.
A Method for Optimizing Opaque Filter Queries. In Proceedings of the 2020
ACM SIGMOD International Conference on Management of Data (Portland, OR,
USA) (SIGMOD '20). Association for Computing Machinery, New York, NY,
USA, 1257–1272. https://doi.org/10.1145/3318464.3389766
[31] João F. Henriques, Rui Caseiro, Pedro Martins, and Jorge Batista. 2015. High-
Speed Tracking with Kernelized Correlation Filters. IEEE Transactions on Pattern
Analysis and Machine Intelligence 37, 3 (2015), 583–596. https://doi.org/10.
1109/TPAMI.2014.2345390
[32] Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. 2015. Distilling the Knowl-
edge in a Neural Network. CoRR abs/1503.02531 (2015). arXiv:1503.02531
http://arxiv.org/abs/1503.02531
[33] Kevin Hsieh, Ganesh Ananthanarayanan, Peter Bodik, Shivaram Venkataraman,
Paramvir Bahl, Matthai Philipose, Phillip B. Gibbons, and Onur Mutlu. 2018.
Focus: Querying Large Video Datasets with Low Latency and Low Cost. In 13th
USENIX Symposium on Operating Systems Design and Implementation (OSDI
18). USENIX Association, Carlsbad, CA, 269–286. https://www.usenix.org/
conference/osdi18/presentation/hsieh
[34] David Huggins Daines, M. Kumar, A. Chan, A.W. Black, M. Ravishankar, and
Alexander Rudnicky. 2006. Pocketsphinx: A Free, Real-Time Continuous Speech
Recognition System for Hand-Held Devices. International Conference on Acous-
tics, Speech, and Signal Processing.
https://doi.org/10.1109/ICASSP.2006.
1659988
[35] Chien-Chun Hung, Ganesh Ananthanarayanan, Peter Bodík, Leana Golubchik,
Minlan Yu, Victor Bahl, and Matthai Philipose. 2018. VideoEdge: Pro-
cessing Camera Streams using Hierarchical Clusters. In ACM/IEEE Sympo-
sium on Edge Computing (SEC) (acm/ieee symposium on edge computing
(sec) ed.). https://www.microsoft.com/en-us/research/publication/videoedge-
processing-camera-streams-using-hierarchical-clusters/
[36] Forrest N. Iandola, Song Han, Matthew W. Moskewicz, Khalid Ashraf, William J.
Dally, and Kurt Keutzer. 2016. SqueezeNet: AlexNet-level accuracy with 50x
fewer parameters and 0.5MB model size. https://doi.org/10.48550/ARXIV.1602.
07360
[37] Mohammad A. Ibrahim, Gamal A. Ebrahim, and Hoda K. Mohamed. 2017. A
modern cloud bursting framework. In 2017 12th International Conference on
Computer Engineering and Systems (ICCES). 148–153. https://doi.org/10.1109/
ICCES.2017.8275294
IETF. 2006. The Base16, Base32, and Base64 Data Encodings. https://datatracker.
ietf.org/doc/html/rfc4648 (accessed on 7 March 2023).
[38]
13
[39] Samvit
Jain, Xun Zhang, Yuhao Zhou, Ganesh Ananthanarayanan,
Junchen Jiang, Yuanchao Shu, Victor Bahl, and Joseph Gonzalez. 2020.
Spatula: Efficient cross-camera video analytics on large camera net-
In ACM/IEEE Symposium on Edge Computing (SEC 2020).
works.
https://www.microsoft.com/en-us/research/publication/spatula-efficient-
cross-camera-video-analytics-on-large-camera-networks/
[40] Junchen Jiang, Ganesh Ananthanarayanan, Peter Bodik, Siddhartha Sen, and Ion
Stoica. 2018. Chameleon: Scalable Adaptation of Video Analytics. In Proceedings
of the 2018 Conference of the ACM Special Interest Group on Data Communica-
tion (Budapest, Hungary) (SIGCOMM '18). Association for Computing Machin-
ery, New York, NY, USA, 253–266. https://doi.org/10.1145/3230543.3230574
[41] Gaurav Tarlok Kakkar, Jiashen Cao, Pramod Chunduri, Zhuangdi Xu, Sury-
atej Reddy Vyalla, Prashanth Dintyala, Anirudh Prabakaran, Jaeho Bang, Aubhro
Sengupta, Kaushik Ravichandran, Ishwarya Sivakumar, Aryan Rajoria, Ash-
mita Raju, Tushar Aggarwal, Abdullah Shah, Sanjana Garg, Shashank Suman,
Myna Prasanna Kalluraya, Subrata Mitra, Ali Payani, Yao Lu, Umakishore Ra-
machandran, and Joy Arulraj. 2023. EVA: An End-to-End Exploratory Video
Analytics System. In Proceedings of the Seventh Workshop on Data Manage-
ment for End-to-End Machine Learning (Seattle, WA, USA) (DEEM '23). As-
sociation for Computing Machinery, New York, NY, USA, Article 8, 5 pages.
https://doi.org/10.1145/3595360.3595858
[42] Gaurav Tarlok Kakkar, Aryan Rajoria, Myna Prasanna Kalluraya, Ashmita Raju,
Jiashen Cao, Kexin Rong, and Joy Arulraj. 2023. Interactive Demonstration of
EVA. Proc. VLDB Endow. 16, 12 (sep 2023), 4082–4085. https://doi.org/10.
14778/3611540.3611626
[43] Daniel Kang, Peter Bailis, and Matei Zaharia. 2018. BlazeIt: Optimizing Declara-
tive Aggregation and Limit Queries for Neural Network-Based Video Analytics.
(2018). https://doi.org/10.48550/ARXIV.1805.01046
[44] Daniel Kang, John Emmons, Firas Abuzaid, Peter Bailis, and Matei Zaharia.
2017. NoScope: Optimizing Neural Network Queries over Video at Scale. https:
//doi.org/10.48550/ARXIV.1703.02529
[45] Daniel Kang, John Guibas, Peter Bailis, Tatsunori Hashimoto, Yi Sun, and Matei
Zaharia. 2021. Accelerating Approximate Aggregation Queries with Expensive
Predicates. Proc. VLDB Endow. 14, 11 (jul 2021), 2341–2354. https://doi.org/10.
14778/3476249.3476285
[46] Daniel Kang, John Guibas, Peter D. Bailis, Tatsunori Hashimoto, and Matei
Zaharia. 2022. TASTI: Semantic Indexes for Machine Learning-Based Queries
over Unstructured Data. In Proceedings of the 2022 International Conference
on Management of Data (Philadelphia, PA, USA) (SIGMOD '22). Association
for Computing Machinery, New York, NY, USA, 1934–1947. https://doi.org/10.
1145/3514221.3517897
[47] Daniel Kang, Francisco Romero, Peter Bailis, Christos Kozyrakis, and Matei
Zaharia. 2022. VIVA: An End-to-End System for Interactive Video Analytics. In
Conference on Innovative Data Systems Research (CIDR)).
[48] Young Choon Lee and Bing Lian. 2017. Cloud Bursting Scheduler for Cost
Efficiency. In 2017 IEEE 10th International Conference on Cloud Computing
(CLOUD). 774–777. https://doi.org/10.1109/CLOUD.2017.112
[49] Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf.
2017. Pruning Filters for Efficient ConvNets. In 5th International Conference
on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017,
Conference Track Proceedings. OpenReview.net. https://openreview.net/forum?
id=rJqFGTslg
[50] Rui Li, Zhi Zhou, Xu Chen, and Qing Ling. 2022. Resource Price-Aware
Offloading for Edge-Cloud Collaboration: A Two-Timescale Online Control
IEEE Transactions on Cloud Computing 10, 1 (2022), 648–661.
Approach.
https://doi.org/10.1109/TCC.2019.2937928
[51] Min Lin, Qiang Chen, and Shuicheng Yan. 2014. Network In Network. In 2nd
International Conference on Learning Representations, ICLR 2014, Banff, AB,
Canada, April 14-16, 2014, Conference Track Proceedings, Yoshua Bengio and
Yann LeCun (Eds.). http://arxiv.org/abs/1312.4400
[52] S. Lloyd. 1982. Least squares quantization in PCM.
IEEE Transactions on
Information Theory 28, 2 (1982), 129–137. https://doi.org/10.1109/TIT.1982.
1056489
[53] Yao Lu, Aakanksha Chowdhery, and Srikanth Kandula. 2016. Optasia: A rela-
tional platform for efficient large-scale video analytics. In Proceedings of the
Seventh ACM Symposium on Cloud Computing. 57–70.
[54] Yao Lu, Aakanksha Chowdhery, Srikanth Kandula, and Surajit Chaudhuri. 2018.
Accelerating Machine Learning Inference with Probabilistic Predicates. In Pro-
ceedings of the 2018 International Conference on Management of Data (Houston,
TX, USA) (SIGMOD '18). Association for Computing Machinery, New York, NY,
USA, 1493–1508. https://doi.org/10.1145/3183713.3183751
[55] M D McKay. 1995. Evaluating prediction uncertainty. (3 1995). https://doi.org/
10.2172/29432
[56] John Meehan, Cansu Aslantas, Stan Zdonik, Nesime Tatbul, and Jiang Du. 2017.
Data Ingestion for the Connected World. In CIDR.
[57] Azalia Mirhoseini, Hieu Pham, Quoc V Le, Benoit Steiner, Rasmus Larsen,
Yuefeng Zhou, Naveen Kumar, Mohammad Norouzi, Samy Bengio, and Jeff
Dean. 2017. Device placement optimization with reinforcement learning. In
International Conference on Machine Learning. PMLR, 2430–2439.
[58] Oscar Moll, Favyen Bastani, Sam Madden, Mike Stonebraker, Vijay Gadepally,
and Tim Kraska. 2020. ExSample: Efficient Searches on Video Repositories
through Adaptive Sampling. https://doi.org/10.48550/ARXIV.2005.09141
[59] Philipp Moritz, Robert Nishihara, Stephanie Wang, Alexey Tumanov, Richard
Liaw, Eric Liang, Melih Elibol, Zongheng Yang, William Paul, Michael I.
Jordan, and Ion Stoica. 2018. Ray: A Distributed Framework for Emerging
AI Applications. In 13th USENIX Symposium on Operating Systems Design
and Implementation (OSDI 18). USENIX Association, Carlsbad, CA, 561–577.
https://www.usenix.org/conference/osdi18/presentation/moritz
[60] Python multiprocessing team. 2023. Python multiprocessing documentation.
https://docs.python.org/3/library/multiprocessing.html (accessed on 15 Feb 2023).
[61] Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. GloVe:
Global Vectors for Word Representation. In Proceedings of the 2014 Conference
on Empirical Methods in Natural Language Processing (EMNLP). Association
for Computational Linguistics, Doha, Qatar, 1532–1543. https://doi.org/10.3115/
v1/D14-1162
[62] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. 2016. You
Only Look Once: Unified, Real-Time Object Detection. In 2016 IEEE Conference
on Computer Vision and Pattern Recognition (CVPR). 779–788. https://doi.org/
10.1109/CVPR.2016.91
[63] Robert Rich and Joseph Tracy. 2003. Modeling Uncertainty: Predictive Accuracy
as a Proxy for Predictive Confidence. SSRN Electronic Journal (02 2003). https:
//doi.org/10.2139/ssrn.377462
Iain E. G. Richardson. 2003. H.264 and MPEG-4 video compression : video
coding for next generation multimedia. Chichester; Hoboken, NJ: Wiley. https:
//search.library.wisc.edu/catalog/999994207902121
[64]
[65] Francisco Romero, Johann Hauswald, Aditi Partap, Daniel Kang, Matei Zaharia,
and Christos Kozyrakis. 2022. Optimizing Video Analytics with Declarative
Model Relationships. Proc. VLDB Endow. 16, 3 (nov 2022), 447–460. https:
//doi.org/10.14778/3570690.3570695
[66] Francisco Romero, Mark Zhao, Neeraja J Yadwadkar, and Christos Kozyrakis.
2021. Llama: A heterogeneous & serverless framework for auto-tuning video
analytics pipelines. In Proceedings of the ACM Symposium on Cloud Computing.
1–17.
[67] Stuart Russell and Peter Norvig. 2003. Artificial Intelligence: A Modern Approach,
2nd Edition. Pearson (2003).
[68] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and
Gabriele Monfardini. 2008. The graph neural network model. IEEE transactions
on neural networks 20, 1 (2008), 61–80.
[69] Amazon Web Services. 2023. AWS Lambda. https://aws.amazon.com/lambda/
(accessed on 24 Jan 2023).
[70] Karen Simonyan and Andrew Zisserman. 2014. Very deep convolutional networks
for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014).
[71] Yaniv Taigman, Ming Yang, Marc'Aurelio Ranzato, and Lior Wolf. 2014. Deep-
Face: Closing the Gap to Human-Level Performance in Face Verification. In
2014 IEEE Conference on Computer Vision and Pattern Recognition. 1701–1708.
https://doi.org/10.1109/CVPR.2014.220
[72] Nesime Tatbul, Ugur Çetintemel, Stanley B. Zdonik, Mitch Cherniack, and
Michael Stonebraker. 2003. Load Shedding in a Data Stream Manager. In VLDB
Conference. 309–320.
IPython Team. 2023.
readthedocs.io/en/latest/ (accessed on 15 Feb 2023).
IPython Parallel Documentation.
https://ipyparallel.
[73]
[74] Gregor Urban, Krzysztof J. Geras, Samira Ebrahimi Kahou, Özlem Aslan,
Shengjie Wang, Abdelrahman Mohamed, Matthai Philipose, Matthew Richardson,
and Rich Caruana. 2017. Do Deep Convolutional Nets Really Need to be Deep
and Convolutional?. In 5th International Conference on Learning Representations,
ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings.
OpenReview.net. https://openreview.net/forum?id=r10FA8Kxg
[75] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy,
David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan
Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman,
Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson,
C J Carey, ̇Ilhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Lax-
alde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R.
Harris, Anne M. Archibald, Antônio H. Ribeiro, Fabian Pedregosa, Paul van
Mulbregt, and SciPy 1.0 Contributors. 2020. SciPy 1.0: Fundamental Algo-
rithms for Scientific Computing in Python. Nature Methods 17 (2020), 261–272.
https://doi.org/10.1038/s41592-019-0686-2
[76] Li Wang, Yao Lu, Hong Wang, Yingbin Zheng, Hao Ye, and Xiangyang Xue.
2017. Evolving boxes for fast vehicle detection. In 2017 IEEE International
Conference on Multimedia and Expo (ICME). 1135–1140. https://doi.org/10.
1109/ICME.2017.8019461
[77] Max Welling and Thomas N Kipf. 2016. Semi-supervised classification with
graph convolutional networks. In J. International Conference on Learning Repre-
sentations (ICLR 2017).
14
[78] Tiantu Xu, Luis Materon Botelho, and Felix Xiaozhu Lin. 2019. Vstore: A data
store for analytics on large videos. In Proceedings of the Fourteenth EuroSys
Conference 2019. 1–17.
[79] Zhuangdi Xu, Gaurav Tarlok Kakkar, Joy Arulraj, and Umakishore Ramachandran.
2022. EVA: A Symbolic Approach to Accelerating Exploratory Video Analytics
with Materialized Views. In Proceedings of the 2022 International Conference on
Management of Data. 602–616.
[80] Zhihui Yang, Zuozhi Wang, Yicong Huang, Yao Lu, Chen Li, and X. Sean Wang.
2022. Optimizing Machine Learning Inference Queries with Correlative Proxy
Models. Proc. VLDB Endow. 15, 10 (sep 2022), 2032–2044. https://doi.org/10.
14778/3547305.3547310
[81] Haoyu Zhang, Ganesh Ananthanarayanan, Peter Bodik, Matthai Philipose,
Paramvir Bahl, and Michael J. Freedman. 2017. Live Video Analytics at Scale
with Approximation and Delay-Tolerance. In 14th USENIX Symposium on Net-
worked Systems Design and Implementation (NSDI 17). USENIX Association,
Boston, MA, 377–392.
https://www.usenix.org/conference/nsdi17/technical-
sessions/presentation/zhang
[82] Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. 2016. Joint Face
Detection and Alignment Using Multitask Cascaded Convolutional Networks.
IEEE Signal Processing Letters 23, 10 (2016), 1499–1503. https://doi.org/10.
1109/LSP.2016.2603342
[83] Andrii Zhygmanovskyi and Norihiko Yoshida. 2015. Distributed Cloud Bursting
Model Based on Peer-to-Peer Overlay. In 2015 3rd International Conference on
Future Internet of Things and Cloud. 823–828. https://doi.org/10.1109/FiCloud.
2015.74
[84] F. Özge Ünel, Burak O. Özkalayci, and Cevahir Çi ̆gla. 2019. The Power of Tiling
for Small Object Detection. In 2019 IEEE/CVF Conference on Computer Vision
and Pattern Recognition Workshops (CVPRW). 582–591. https://doi.org/10.1109/
CVPRW.2019.00084
15
A FILTERING THE KNOB CONFIGURATIONS
AND TASK PLACEMENTS
A.1 Filter knob configurations
Processing video with a knob configuration k incurs an amount
of work (i.e. FLOPs) and a processing quality determined by k.
However, not all knob configurations are pareto-optimal: one config-
uration may achieve worse result quality while incurring more work
than another. Skyscraper proceeds in two steps to create a filtered set
K of knob configurations that lie on an (approximated) work-quality
pareto frontier.
Skyscraper samples a set S of video segments from the unlabeled
training data and then runs greedy hill climbing on the sampled
segments as proposed in VideoStorm [81]. In the following, we
describe Skyscraper's sampling method that yields S. The goal of
the sampling method is to sample nsearch segments that have widely
different content dynamics (e.g. one with many cars, one with few
cars). Given a small set of labeled data, and a larger set of unlabeled
data, as well as the hyperparameter nsearch, which is set by the user,
Skyscraper proceeds in two steps to compute S.
First, Skyscraper finds the cheapest knob configuration k − and
the most qualitative knob configuration k+. Both of these config-
urations are guaranteed to lie on the work-quality pareto frontier.
The cheapest configuration k − can simply be found by measuring
the runtimes of all knob configurations on the on premise cluster.
The most qualitative configuration k+ can be found by running all
configurations on the labeled training data and picking the one that
achieves the best accuracy.
Second, Skyscraper samples npre segments Spre from the unla-
beled training data uniformly at random and processes all of them
with k − and k+. The quality that k − and k+ achieve on a segment
are recorded as 2-dimensional quality vectors. Let Qpre denote the
set of quality vectors for the segments in Spre . Skyscraper now
greedily selects segments from Spre and adds them to the initially
empty set S. Skyscraper first picks the segment s ∈ Spre with the
smallest L2 norm and adds it to S. Then, Skyscraper iteratively
adds the segment s′ ∈ Spre to S such that the newly added seg-
ment s′ is the one which differs the most from all the previously
added segments in S. The segment s′ ∈ Spre to be added is the
segment with the largest distance to its closest element in S (i.e.
s′ = argmax
s ∈ Spre
(min({||s′ − s′′|| | s′′ ∈ S})) ).
After nsearch − 1 iterations, S is a set of nsearch video segments
where each segment has significantly different content than all the
other segments.
After deriving these set of sampled video segment, Skyscraper
independently searches for a set of knob configurations Ks that
lie on an (approximated) work-quality pareto frontier for each seg-
ment s ∈ S. These sets may differ for segments with different
content dynamics (e.g., on segments where cheap configurations
achieve perfect quality, expensive configurations are not on the
pareto frontier). Skyscraper uses greedy hill climbing [67] for the
search, whose effectiveness on this task has already been demon-
strated in VideoStorm [81]. Finally, filtered set of knob configura-
tions K is given by the union of all Ks for s ∈ S.
A.2 Filter task placements
Recall in Section 2 that each knob configuration k is associated with
a task graph Gk , where each node represents the execution of certain
user-provided model (e.g., an object detection model) and each edge
specifies the dependency between nodes (e.g., an object tracking
model requires the output from the detection model). Any node can
be placed on on-premises or on-demand cloud hardware and the
costs in cloud credits (plus bandwidth cost) and runtimes will be
different. The objective of placement optimizer is to find a set of
placements Pk for a knob configuration k that is on the cost-runtime
Pareto frontier so that Skyscraper can pick a desirable placement for
a knob configuration during online phase.
We first execute the configuration k on the video segments in S∗
on both completely on-premises and completely on-demand cloud
hardware. The runtime of on-premises processing, the runtime on the
cloud, and the input/output sizes of each node in Gk are used as the
node features of the placement graph. Then, the placement optimizer
adopts a well-established approach that is shown to be robust and
generalizable for placement optimization [2, 57]. Specifically, it
takes the node features of Gk as inputs into a Graph Neural Network
(GNN) [68, 77] that passes messages between nodes to learn their
correlation and output the new node features of Gk after information
aggregation. Then, it uses reinforcement learning (RL) to learn the
placement strategy of Gi . Specifically, each node in Gi is appended
with an additional feature: on-premises, on-cloud, or undecided. All
nodes are initialized to be "undecided". The RL agent iteratively
takes Gi as input and optimally make an "undecided" node "on-
premises" or "on-cloud", until all nodes are decided.
Simulator for cloud placements: The placement optimizer typi-
cally suggests thousands of placements during the search. Executing
each of these placements on real hardware would be extremely time-
and money-consuming. We therefore use a simulator to estimate the
runtime of different placements and use it for training. The simulator
is shown to be very accurate and effective for training the placement
optimizer. The details of this simulator is presented at Section M.2.
B DESIGN DECISIONS
In the following, we evaluate design alternatives of Skyscraper.
Subsection B.1 provides more details to the discussion on design
challenges in Section 2. Subsection B.2 analyzes alternative, drop-in
replacements for components of Skyscraper.
B.1 From a simplistic system to Skyscraper
In the following, we evaluate the designs described in the discussion
on design challenges in Section 2. The results are simulated on the
COVID workload, using the simulator described in Appendix M.
The first, simplistic design in Section 2 splits time interval T
(over which resources should be rationed) into equal-sized splits
ti of a couple of seconds. In our experiment, T is two days long
and each ti ∈ T is two seconds long. The idealized approach of
Section 2 then directly predicts the quality q
ual (k, ti ) of each knob
(cid:99)
configuration k ∈ K on each segment ti ∈ T . In the evaluation in
Figure 16, we use the average time-of-day quality over the past 2
days as a prediction of the quality over the next 2 days. Fitting a
more complicated statistical model (e.g. neural network) is too hard
since the output has a dimension of 259.200.
16
Computing the knob plan. Skyscraper assigns knob configura-
tions to content categories using linear programming. Linear pro-
gramming finds the optimal solution to the optimization problem.
Furthermore, Figure 13 shows that the runtime overheads caused
be the linear programming solver are negligible: A forward and
backward pass through the forecasting model together with solving
the linear program take a total of 0.5s or below. This overhead only
occurs every couple of days when the knob plan is updated. There-
fore, isn't any margin for improvement through alternatives to linear
programming.
C NUMERIC VALUES OF COST ANALYSIS
Figure 4 in Section 5.3 shows the cost-quality trade off curves of
Skyscraper, Chameleon∗ (an adaption of Chameleon [40]) and stati-
cally using the same knob configuration. Table 2 furthermore gives
the numeric values of the costs and qualities.
Workload
Method
COVID
MOT
Static
Chameleon*
Skyscraper
Static
Chameleon*
Skyscraper
Static
MOSEI-HIGH
Chameleon*
Skyscraper
Static
MOSEI-LONG
Chameleon*
Skyscraper
Quality
35%
35%
81%
81%
97%
37%
50%
74%
91%
90%
94%
36%
79%
81%
81%
97%
72%
83%
89%
92%
94%
97%
8%
8%
28%
36%
51%
8%
21%
32%
37%
55%
30%
38%
45%
59%
80%
30%
30%
38%
38%
65%
30%
31%
39%
52%
68%
37%
53%
62%
72%
Server vCPUs Cloud cost Total cost
4
8
16
32
60
4
8
16
32
4
8
4
8
16
32
60
4
8
16
32
4
8
4
8
16
32
60
4
8
16
32
60
4
8
16
32
60
4
8
16
32
60
4
8
16
32
60
4
8
16
32
–
–
–
–
–
–
–
–
–
0.0$
3.3$
–
–
–
–
–
–
–
–
–
0.0$
2.0$
–
–
–
–
–
–
–
–
–
–
0.0$
0.0$
0.0$
0.0$
0.0$
–
–
–
–
–
–
–
–
–
–
1.7$
3.3$
6.5$
12.9$
14.9$
28.8$
57.6$
114.1$
267.7$
14.9$
28.8$
57.6$
114.1$
14.9$
32.1$
14.9$
28.8$
57.6$
114.1$
267.7$
14.9$
28.8$
57.6$
114.1$
14.9$
30.8$
3.7$
7.2$
14.4$
28.5$
66.9$
3.7$
7.2$
14.4$
28.5$
66.9$
3.7$
7.2$
14.4$
28.5$
66.9$
3.7$
7.2$
14.4$
28.5$
66.9$
3.7$
7.2$
14.4$
28.5$
66.9$
5.4$
10.5$
20.9$
41.4$
Table 2: Cost and quality of running the workloads in Section 5.2.
17
Figure 16: Performance of the systems described in Section 2
Figure 17: Skyscraper using different clustering algorithms to
compute the content categories.
Section 2 then discusses a design built around a more practical
forecasting task. This design resembles Skyscraper, with the sole
difference of Skyscraper furthermore considering real hardware
resources like on-premise compute cores, a video buffer and on-
demand cloud workers. Figure 16 shows this improved design in
blue. We can see that the improved design almost achieves optimal
quality.
B.2 Alternative implementations of Skyscraper
components
In the following, we consider drop-in replacements for specific
components of Skyscraper.
Clustering for content categories. Figure 17 shows a comparison
of the end-to-end performance when using KMeans [52] for clus-
tering in comparison to using a Gaussians Mixture Model [21]. The
experiment is conducted on simulated hardware (simulator described
in Appendix M) and for the COVID workload. We find that there is
no difference in the end-to-end performance and therefore suggest
using KMeans because it is simpler.
Forecasting model. Skyscraper uses a simple feedforward neural
network for forecasting. Figure 14 shows that on the COVID and
MOT workloads, Skyscraper's end-to-end performance wouldn't
improve even when using a ground truth forecast. We have not
seen real-world workloads where the inaccurate predictions by the
feedforward neural network cause significant losses of end-to-end
performance. We therefore suggest using the feedforward neural
network. However, there might exist some workloads where a more
sophisticated network architecture might be required.
00.050.10.150.2020040060080010001200Mean Absolute ErrorNumber of training samplesRuntime data generation1.3h0h0.2h0.4h0.7h0.9h1.1h0.20.40.60.8100.250.50.751QualityComputationStaticOptimumPractical systemIdealized system0.60.70.80.910.20.40.60.81QualityNormalized costKMeansGaussian Mixture ModelD INGESTING MULTIPLE STREAMS
While Sections 2, 3, 4 focus on how Skyscraper optimizes the inges-
tion of a single stream, Skyscraper's techniques naturally extend to a
multi-stream scenario. In this scenario, the overall result quality and
the budget of cloud credits is defined across streams, meaning that
Skyscraper must allocate resources between streams to maximize the
joint quality. We distinguish between two set ups: First, we analyze
the setting where only cloud credits are shared between streams but
each stream runs on individually provisioned on-premise compute
and has its own buffer. Second, we analyze the setting where multi-
ple streams share an on-premise server (i.e. run on the same cluster)
and share a buffer.
For the first scenario, the offline phase is run independently for
each stream. Specifically, for each stream, knob configurations and
task placements are filtered independently, the content categories
are computed independently, and the stream's forecasting model is
trained independently of other streams. Then, in the online phase,
knob switching can also be performed independently for every
stream. The only component of Skyscraper that needs to be modified
is the knob planner. This is necessary to ensure that cloud credits
are allocated fairly between the streams. Algorithmically, the joint
knob planner only presents a slight modification to generalize the
knob planner used in the single-stream setting: Let V be the set
of video streams to be ingested. The quality and cost must now be
summed over all video streams as shown in Equation 7 and Equa-
tion 8 respectively. Furthermore, the normalization must occur for
all content categories of all streams, as shown in Equation 9. We
have highlighted the changes compared to the single-stream knob
planner in green.
maximize
subject to
∑︁
∑︁
v ∈ V
∑︁
k,c for v
∑︁
αk,c ∗ rc ∗ q
ual (k, c)
(cid:99)
αk,c ∗ rc ∗ cost (k) ≤ budget
(7)
(8)
v ∈ V
∑︁
k,c for v
αk,c = 1, αk,c ≥ 0
k
∀c of all v ∈ V (9)
If multiple streams are processed with shared on-premise re-
sources (i.e. the second scenario), it is sufficient to use the previous
approach with two slight modifications. First, since multiple streams
now share a buffer, each independent knob switcher must be aware
of the true free capacity of the buffer, even if some memory is occu-
pied by other streams. Therefore, the knob switcher implementation
cannot assume anymore that it is the only one that allocates and
deallocates memory in the buffer. Second, for the (offline) placement
optimization, it is unclear how many cores are allocated to each
stream. We propose a simple solution to this: For n cores and |V |
streams, we can simply assume that each stream is (fairly) allocated
⌊n / |V |⌋ cores.
Note that assuming a fair allocation of the cores between streams
precludes buffer overflows while not leading to under-utilization of
the on-premise cores: The fair allocation is a pessimistic estimate
because it assumes that every stream's workload is high at the same
time (i.e. every stream can keep all ⌊n / |V |⌋ cores busy). Since
Skyscraper has the overall assumed n cores available for processing,
progress won't be slower than estimated which allows Skyscraper to
avoid buffer overflows.
Nevertheless, the fair allocation assumption doesn't lead to under-
utilization when a stream does not utilize its ⌊n / |V |⌋ cores. Since
the mapping of tasks to cores is independent of the fair allocation
assumption (e.g. Ray performs the mapping in our Skyscraper im-
plementation), cores that are unused by one stream can still be used
to run tasks of another stream. In that case, Skyscraper will over-
estimate the runtime of the knob configuration since work can be
shared among more cores than assumed. However, this doesn't mat-
ter because the knob switcher is reactive and will notice that the
buffer fills slower than expected. Continuing to have available buffer
space, the knob switcher will forgo placing tasks on the cloud and
the overestimated runtimes will therefore not cause unnecessary
cloud spending. All of this doesn't require any additional changes to
the knob switcher.
E RUNTIME OF OFFLINE COMPONENTS
E.1 Runtime of offline components
In the following, we evaluate the cost of the offline phase for the
COVID workload. The runtime is dominated by processing the train-
ing data with the user-defined processing DAGs of the different knob
configurations. Table 3 shows how much time was spent for each
step in the offline phase in the experiments conducted in Section 5.
The runtimes are measured when using two c2-standard-60 Google
Cloud instances for the offline phase, which cost a total of 7.8$.
Note that creating the training data for the forecasting model is em-
barrassingly parallel, therefore more machines will result in lower
runtimes.
Step
Runtime
Filter knob configurations
Filter task placements
6 min
4 min
Compute content categories
5 min
Create forecast training data
Train forecast model
1.3 h
1 min
Table 3: Runtimes of the offline steps for the COVID experiments
conducted in Section 5
In Table 3 and in our experiments in Section 5, we processed
16 days of video data with the cheapest knob configuration k − to
create 1200 training samples in 1.3 hours (as described in Section 3).
However, the forecasting model can also be trained with less data,
which requires less video to be recorded up front and reduces the
work required to create the training data. In Figure 18, we show the
Mean Absolute Error (MAE) when training the forecasting model
with varying amount of training samples. As shown in Figure 18,
training the forecasting model with only 700 samples wouldn't have
increased the model's MAE but would have reduced the runtime of
the offline phase by 35%.
E.2 Rerunning the offline phase
Generally the offline phase only needs to be run once. However,
under rare circumstances some of the components might need to
be rerun online. While these circumstances should never occur for
18
below shows the relevant lines of code of an implementation of the
EV counting example of the Introduction.
else:
return state
state = sky.run(kcf, kcf_cloud, frame, state)
state = sky.run(yolo, yolo_cloud, frame, yolo_size)
# get knobs
det_interval = sky.knob("det_interval")
yolo_size = sky.knob("yolo_size")
# process depending on knob values
if frame_num % det_interval.val() == 0:
1 # Skyscraper app (UDFs yolo, yolo_cloud, kcf, kcf_cloud omitted)
2 def proc_frame(frame, frame_num, sky, state):
3
4
5
6
7
8
9
10
11
12
13 # instantiate Skyscraper
14 sky = Skyscraper(aws_key_id, aws_secret_key, fps=30)
15 sky.set_resources(num_cores=8, bufferMB=4000, cloud_budget=1000)
16
17 # register knobs
18 sky.register_knob("det_interval", [1, 5, 10])
19 sky.register_knob("yolo_size", ["small", "medium", "large"])
20
21 # offline preparation
22 sky.fit(labeled_video, labels, unlabeled_video, proc_frame)
23
24 # online ingestion (e.g., cv2 to read frames)
25 state = State(init_quality=0)
26 vid = cv2.VideoCapture(0)
27 ok, frame = vid.read()
28 while ok:
29
30
status, state = sky.process(frame, state)
ok, frame = vid.read()
Lines 14-15 of the code snippet instantiate the Skyscraper in-
stance sky to process a video stream. The user registers application-
specific knobs to sky by specifying the knob's name and a value
domain that the knob can take. Specifically, the user registers a knob
that determines the rate at which a object detector is run (line 17)
and a knob that determines its model size (line 18).
The application only uses two UDFs, namely yolo and kcf.
For brevity, we omit their implementation but users would typically
implement them using popular CV libraries (e.g. torchvision,
OpenCV). The user needs to specify an on-premise version and a
cloud version for each UDF. Skyscraper then calls the corresponding
version depending on if it wants to execute the UDF on premises or
in the cloud. Currently, the user is responsible for packetizing the
payload and invoking the cloud function within the cloud UDF.
The user defines the processing DAG applied to the video in
proc_frame. The state object is used to carry state between
frames (in this case, it is used to keep track of bounding boxes that
both yolo andkcf update). The state object is user-defined but
must contain a quality field which the user updates to reflect
the current quality of processing. Quality is an application-defined
metric and may for example be based on errors or certainty metrics
that are commonly reported by CV algorithms. Specific examples
for quality defintions can be found in Section 5.2, where we describe
the Skyscraper applications that we use for benchmarking.
The user triggers Skyscraper's offline learning phase in line 22.
After its completion, the user can start to ingest live videos as shown
in lines 28-30.
G COMPARISON TO QUERY-LOAD-
ADAPTIVE KNOB TUNING SYSTEMS
VideoStorm [81] and VideoEdge [35] perform knob tuning for video
workloads but only adapt to the query load and not the content of
19
Figure 18: Mean Absolute Error of the forecasting model for
different amounts of training data
most workloads, we discuss in the following when which offline
component would need to be rerun.
Retraining the forecasting model. If Skyscraper is set up prop-
erly, training the forecasting model is the only step of the offline
phase that might need to be redone. How often different content cate-
gories appear may change over time (e.g. traffic in the city worsens).
These changes are mostly smooth and should not be problematic
since we continuously train the forecasting model online ("online
learning"). This continuous training allows the model to adapt to
smooth drifts at negligible overhead. Skyscraper can monitor the
forecasting accuracy online (the knob switcher determines the actual
frequency of content categories anyways). If this accuracy deterio-
rates and the user decides to retrain the model, this is cheap since
the costly part of generating the new training data has already been
done anyways during video ingestion.
Content categories. Typically, workload changes only involve
how frequently different content categories appear, but don't intro-
duce completely new content categories (e.g. there is no "completely
new type of heavy traffic"). However, if the training data is incom-
plete and does not contain a content category, the content categories
might need to be recomputed. Skyscraper can detect this, as the
measured quality will then frequently be far from all of the KMeans
cluster centers. Recomputing the content categories is cheaper than
in the original offline phase since the sample efficiency can be dras-
tically improved. Instead of randomly sampling segments and com-
puting their quality vectors, Skyscraper can simply add segments to
the train set, where it notices that the samples don't belong to any of
the content categories.
Filtered set of good knob configurations & good task placements.
Task placements are independent of the video and don't need to be
recomputed. The user may consider (partially) recomputing the set of
knob configurations if the content categories have been recomputed.
As described above, this should generally not happen.
F SKYSCRAPER API
To support application-specific query formats, Skyscraper lets users
define processing steps as arbitrary user-defined functions (UDFs).
When applying the UDFs to the video stream, one UDF typically
produces the input for another, yielding a directed-acyclic graph
(DAG) where each node is a UDF and edges specify that the source
UDF's output is used as the target UDF's input. The code snippet
00.050.10.150.2020040060080010001200Mean Absolute ErrorNumber of training samplesRuntime data generation1.3h0h0.2h0.4h0.7h0.9h1.1h0.20.40.60.8100.250.50.751QualityComputationStaticOptimumPractical systemIdealized systemFirst, Skyscraper processes all of the unlabeled training data
using the cheapest knob configuration k −.7 Using the quality that
k − achieves on each of the segments of the unlabeled training data,
Skyscraper classifies the segments into one of the content categories
c ∈ C. This is done through Skyscraper's standard way of classifying
content, which is described in Section 4.2.
Given the category of each segment, Skyscraper can create inpu-
label pairs which are used to train F via supervised learning. Each
input x spans a time period of tin into the past and each label spans a
time period of tout into the future. The label is given by one content
histogram that contains the content distribution over the tout long
interval. The input contains nsplit histograms that contain the content
distributions of tin/nsplit time chunks that the past tin interval has
been split up to.
tout (planned interval length), tin (forecast model input length)
and nsplit (number of forecast model input splits) are hyperparame-
ters of Skyscraper but as discussed in Appendix I, setting them to
default values generally leads to good performance, so we envision
that the users do not need to tune them.
I SKYSCRAPER'S HYPERPARAMETERS
Skyscraper exposes the following set of hyperparameters that can be
adjusted by the user:
(1) Number of content categories
(2) Frequency of knob switching
(3) Input features for forecasting model:
(a) Input time span for forecasting model (tin)
(b) Number of histograms reported for the input (nsplit )
(4) Hyperparameters of the forecasting model (e.g. architecture,
training hyperparameters)
(5) Planned interval length (tout )
(6) Sample sizes in the offline phase
(a) Sample size of S for searching good knob configura-
tions K
(b) Sample size of S′ for computing content categories C
In the following, we describe how to set these hyperparameters to
ensure Skyscraper achieves a good performance. We hereby suggest
default values that worked well on all four workloads considered in
the paper. Our tuning recommendations are supported by sensitivity
analyses conducted in the subsections below.
(1) Number of content categories C: This parameter deter-
mines how many clsuter centers should be used in KMeans.
Skyscraper's performance is insensitive to this as long as
it is set high enough. For our workloads, values of 3 and
above performed well. We evaluate different values in Sub-
section I.1 We suggest a default value of 4.
(2) Frequency of knob switching: While Skyscraper's per-
formance is sensitive to this hyperparameter, we find that
reasonable values (running it between every 2s to 8s) all
achieve good performance. We evaluate the performance
for different values in Subsection I.2. We suggest a default
of running it every 4s.
(3) Input features for forecasting model: We find that the
most important property of the featurization is that the
7If k − achieves similar performance for different content categories (i.e. is not a good
discriminator), the next cheapest configuration is picked that is a good discriminator.
Figure 19: Comparison between Skyscraper, the static baseline
and VideoStorm. VideoStorm was designed for significantly dif-
ferent workloads.
the video. We discuss this in more detail in Section 1 and Section 6.
Since VideoEdge is designed for a different compute hierarchy, we
only compare to VideoStorm in the following. We want to emphasize
that the following results are measured on the V-ETL workloads
described in Section 5, which significantly differ from the workloads
that VideoStorm was designed for. The following results are not
representative of VideoStorm's performance on workloads it was
designed for (i.e. many finite, ad-hoc queries being run on a video
stream). Instead, they provide experimental evidence that systems
that only adapt to the query load are not suitable for V-ETL.
Figure 19 shows the cost-quality trade offs when statically using
the same knob configuration, VideoStorm and Skyscraper. For all
workloads, VideoStorm fills the buffer early during execution and
then (almost) only uses the most qualitative knob configuration
that runs in real-time on the provisioned hardware. VideoStorm's
performance therefore closely matches the one of the static baseline.
The reason why VideoStorm outperformed the static baseline for
MOSEI-HIGH, is that the first workload spike in MOSEI-HIGH
comes early enough, such that VideoStorm hadn't used up signifi-
cant buffer space yet. By being able to leverage the buffer during
the workload peak, MOSEI-HIGH could therefore achieve better
quality on cheaper resources than the static baseline. However, it is
a lucky coincidence that VideoStorm hadn't used up the buffer at the
beginning of the workload peak and this performance improvement
can only be observed for the first peak. For all subsequent data,
VideoStorm will have the performance of the static baseline since
the buffer remains full after the first peak.
H DETAILS ON TRAINING THE
FORECASTING MODEL
Skyscraper pre-trains the forecasting model in the offline phase using
the unlabeled data. In the following, we describe how Skyscraper
computes the training data from the unlabeled data. Previously,
Skyscraper has already computed the content categories C.
20
SkyscraperVideoStormStatic baseline0.20.40.60.811.200.250.50.751qualitynormalized cost0.20.40.60.811.200.250.50.751qualitynormalized cost0.20.40.60.811.200.250.50.751qualitynormalized cost0.20.40.60.811.200.250.50.751qualitynormalized cost(a) COVID(b) MOT(c) MOSEI-HIGH(d) MOSEI-LONGmodel knows about the content dynamics of the recent past
(and these dynamics have not been averaged over a long
time period). In Subsection I.3, we find that any featuriza-
tion that fulfills this delivers results that are accurate enough
to not harm Skyscraper's performance. We suggest a default
of providing data from the previous two days as input, split
into eight histograms.
(4) Hyperparameters of the forecasting model We find that
very simple architectures and training procedures are suffi-
cient. We suggest to use the same as we used in our experi-
ments as default (see Appendix K).
(5) Planned interval length: We evaluate this in Section 5 and
find that Skyscraper performs well for reasonable values
between 1 day to 4 days. We suggest a default of 2 days.
(6) Sample sizes in offline phase: For both the sample size
of S (filter knob configurations) and S′ (categorize video
content) of the offline phase, larger sample sizes are better
but cause a longer runtime of the offline phase. We suggest
a sample size of 5 for S and a sample size of 5% of the
unlabeled training data for S′.
If users want to tune hyperparameters beyond the default sug-
gestions, Skyscraper allows for easy hyperparameter tuning in the
offline phase. Tuning the hyperparameters hereby only requires re-
running the affected component (e.g. re-training the forecasting
model while not re-running anything else).
I.1 Sensitivity to the number of content categories
Skyscraper categorizes content into |C| content categories. Each
category correponds to a cluster center computed through KMeans
(the number of content categories therefore corresponds to the "k in
KMeans"). Figure 20 shows Skyscraper's end-to-end performance
on the COVID workload for different numbers of content categories.
Method
1 category
2 categories
3 categories
4 categories
8 categories
Switcher accuracy
100%
98.8%
97.9%
97.2%
95.9%
Table 4: The accuracy of the knob switcher on the COVID work-
load for a varying numbers of content categories
Skyscraper when running the knob switcher at different periodicities.
We can see that Skyscraper is sensitive to the periodicity but the
performance variance between different periodicities is not high.
Figure 21: The effect of running the knob switcher at different
frequencies on Skyscraper's end-to-end performance
I.3 Sensitivity of forecasting model
Table 5 complements Figure 14 and shows the Mean Absolute Er-
ror (MAE) of forecasts over different time intervals. As shown in
Figure 14, only the prediction error for 8 days caused significantly
harmed performance.
Days forecasted
COVID Mean
Absolute Error Absolute Error
MOT Mean
1 day
2 days
4 days
8 days
0.097
0.042
0.066
0.149
Table 5: Mean Absolute Error for varying number of forecasted
days, as evaluated in Section 5.6
0.108
0.064
0.133
0.185
Figure 20: Skyscraper's end-to-end performance on the COVID
workload using a varying number of content categories.
Figure 20 shows how Skyscraper's performance is insensitive
to the number of content categories as long as it is high enough
(assuming no degenerately high numbers). Table 4 shows the clas-
sification accuracy of the knob switcher for different numbers of
content categories.
Table 6 shows the MAE when predicting over 2 days but with
varying amounts of input days (how many days of data are fed into
the forecasting model) and splitting the input data into different
amounts of content distribution histograms. We can see that if we
split the input data into 8 histograms, the MAE is always significantly
below what would cause performance deterioration.
I.2 Sensitivity to the knob switching frequency
Skyscraper periodically runs the knob switcher every couple of
seconds. Figure 21 shows Skyscraper's end-to-end performance of
J DETAILS OF THE WORKLOADS
We evaluate Skyscraper using three workloads on public health
monitoring, traffic planning, and social media analysis. They cover a
21
0.40.60.8100.51costquality1 category2 categories3 categories4 categories8 categories0.40.60.8100.51costqualityEvery2sEvery3sEvery8sEvery4sknob configurations, people may be detected at different times and
different sets of people may be detected. It further leverages that
KCF trackers report when they fail to track an object.
Multi-object tracking (MOT). Multi-object tracking (MOT) is a
key primitive in many video analytical pipelines. In this workload,
we adopt the recent state-of-the-art TransMOT [15] tracker on MOT
benchmark [22] and introduce several tunable knobs. TransMOT
first runs a object detector and use off-the-shelf image models (such
as VGG [70]) to create feature embeddings of the detected objects.
TransMOT then models all object features and interactions on one
frame as a graph and inputs this graph and the graphs from previous
frames to a graph transformer to generate the object tracks.
Apart from the frame rate and number of tiles explained in COVID
workload, MOT contains two additional knobs:
• Length of history: TransMOT model takes the graph from pre-
vious t frames as history and we set t as tunable knob. Larger t
suggests a better quality and a higher cost.
• Model size: We trained three TransMOT models with different
number of layers (different model size). We can adaptive use any
model according to their accuracy and cost trade-offs.
The quality QMOT is defined as the number of people that Trans-
MOT correctly tracked. The ground truth tracking is given by run-
ning TransMOT at the most expensive knob setting, that we do not
consider in the experiments. We run MOT on a stream of a traffic
intersection Shibuya in Tokyo and track pedestrians.
Multi-modal opinion sentiment and emotion intensity (MOSEI).
This workload is synthetic and simulates a video stream analysis
on Twitch. The number of incoming streams varies over time and
mimics the number of live Twitch streams over two days.9 We further
introduce synthetic spikes to evaluate Skyscraper under difficult
conditions. Specifically, we create the following two type of spikes:
• MOSEI-HIGH: We introduce high but short peaks in workload,
consist of 62 concurrent video stream ingestion. This makes cloud
bursting difficult since they will require high bandwidth.
• MOSEI-LONG: We introduce a long peak of continuous work-
load. In this case, the buffer alone cannot hold all the extra work.
Since the real data from twitch is not available, we use the CMU-
MOSEI [7] dataset to simulate incoming video streams. It contains
various videos filming people's heads while talking from YouTube.
The task of MOSEI workload is to classify the opinion sentiment of
the speaker using both the audio and visual content. CMU-MOSEI
provides extracted features from the video with ground-truth labels.
We trained a neural network on CMU-MOSEI's training set and used
its test set to evaluate Skyscraper. We couldn't find out which exact
methods CMU-MOSEI used for feature extraction but replicated a
similar pipeline, which we run before the neural network classifier.
We transcribe the audio using CMUSphinx [34] and use GloVe word
embeddings [61] on the transcript. For the visual features, we extract
the bounding box of the face using MTCNN [82] and the face em-
beddings using DeepFace [71]. We further extract acoustic features
including 12 Mel-frequency cepstral coefficients, voiced/unvoiced
segmenting features [23], and glottal source parameters [3, 4, 24].
Since CMU-MOSEI does neither provide raw video nor the exact
Table 6: Mean Absolute Error depending on the input features
diverse set of computer vision primitives including object detectors,
trackers, and classifiers. All workloads are heavily CPU bound. We
describe them in the following.
COVID-19 safety measures (COVID). During the coronavirus
pandemic, decision makers have executed several safety measures
to slowdown the spread of the virus. Such measures include wearing
facial masks and social distancing. Measuring where and how strictly
people adhere to these measures can be used for decision making
and informing people at risk.
The COVID workload consists of a YOLOv5 object detector [62]
to detect pedestrians and a KCF tracker to track the detected pedestri-
ans ("detect-to-track"). After the detection, for each detected pedes-
trian, the workload employs homography to measure the pedestrian's
distance to others. Furthermore, it uses a neural network with a
ResNet-50 [29] backbone to classify if the person is wearing a facial
mask. The neural network classifier was fine tuned on MaskedFace-
Net [12].
The workload contains the following knobs:
• Frame rate: Consecutive video frames contain large redundancy.
It is a common approach to skip frames at a constant rate to effec-
tively reduce this redundancy. We expose the following frame rate
domain to Skyscraper: {30FPS, 15FPS, 10FPS, 5FPS, 1FPS}.
• Object detection rate: In the detect-to-track framework, an
object detector is run on frames with a regular interval and cheaper
trackers are run on the intermediary frames to track the detected
objects. Running object detection more frequently will lead to a
better quality and a higher cost. Skyscraper considers running object
detectors every {1, 5, 30, 60} frames.
• Tiling for object detection: The pretrained object detectors are
typically trained on small input images to reduce cost (e.g. Ultra-
lytics' YOLOv5 weights). Higher resolution images during video
ingestion thus need to be down sampled to the fixed, small dimen-
sion used for testing. This impedes the model's ability to detect
small objects. A common approach to overcome this issue is to slice
the high resolution image into several tiles [84] and individually
fed them to the object detector. More tiles will thus result in better
accuracy but at a higher cost. We expose the following tiling domain
to Skyscraper: {1x1 tile, 2x2 tiles}.
The workload is executed on a video stream of a busy shopping
street in Tokyo.8 We measure the workload's quality in the person ∗
seconds that it records. This metric encompasses that for different
8The Koen-Dori street in the Shibuya district. Live stream available at https://youtu.be/
gALQR-nsEME (July 7, 2022)
9As recorded by Twitch Tracker at https://twitchtracker.com/statistics/active-streamers
(7 July, 2022)
22
Input days12480.50.0550.1690.1790.05210.0560.1120.1070.04820.0570.1630.1460.04240.0570.1650.1400.05180.0620.0560.1370.048Splitsprocessing steps to obtain their features, we can only simulate the
feature extraction pipeline as described in subsection 5.2 but then
predict on the features as provided by the CMU-MOSEI dataset.
The workload contains the following knobs:
• Frequency of sentiment analysis: How frequently is sentiment
analysis performed. Since the precise sentiment is volatile, frequent
sentiment analysis improves accuracy but is more expensive. Since
the workload always transcribes the spoken audio, we determine the
frequency based on sentences that are skipped. Skyscraper may skip
{0, 1, 2, 3, 4, 5, 6} sentences.
• Frame rate during sentiment analysis: What fraction of data is
analyzed for each sentence that is chosen for analysis. Given a sen-
tence on which sentiment analysis should be performed, we sample
the video frames and the corresponding audio and transcription at
regular intervals. This reflects that only analyzing part of a sentence
may already reveal its sentiment. We expose the following domain
to Skyscraper: { 1
6
• Model size: We trained three models of different sizes for the
sentiment analysis. The models show a correlation between accuracy
and runtime such that slower models have a higher accuracy.
• Number of streams: The number of streams to analyze.
When processing n streams and stream i is processed with result-
, 1}
, 5
6
, 1
2
, 1
3
, 2
3
ing accuracy ai , we define the quality as QMOSEI = (cid:205)n
i=1
ai .
K EVALUATION DETAILS
In the following, we provide further details on the experiments run
in Section 5.
K.1 Hyperparamters used in evaluation
In the evaluation in Section 5, all workloads were executed with the
same hyperparameter setting except for when otherwise noted.
(1) Number of content categories: COVID and MOT use 3
content categories, MOSEI-HIGH and MOSEI-LONG use
5.
(2) Frequency of knob switching: For COVID and MOT, the
knob switcher is run every 2 seconds, for MOSEI-HIGH and
MOSEI-LONG, it is run every 7 seconds (due to constraints
of the data set).
(3) Input features for the forecasting model: For all workloads,
the forecasting model used 2 days of data split into 8 histro-
grams as input.
(4) Hyperparameters of forecasting model: All workloads used
the following feed-forward architecture:
input --> 16 units (RELU) --> 8 units
(RELU) --> num content categs (softmax)
For all workloads, the model was trained for 40 epochs and
the weights with the best validation accuracy were chosen
for the online phase. The validation split was 20% for all
workloads. COVID and MOT used 16 days of data from
a traffic camera in Tokyo10 as training data and MOSEI-
HIGH and MOSEI-LONG used 10 days of synthetically
generated data as training data (as described in Section 5.2).
(5) For all workloads, the planned interval length was 2 days.
10Live camera stream available at:https://www.youtube.com/watch?v=IKbbHFMAeBM
(accessed on 29 Nov 2022)
23
(6) For COVID and MOT, we sampled 4 segments for filter-
ing knob configurations and sampled 5% of the unlabeled
training data to find the content categorization. For MOSEI-
HIGH and MOSEI-LONG we sampled 10 segments for
the knob configuration filtering and sampled 10% for the
content categorization.
For all workloads, we create a training point for the forecasting
model every 15 minutes of data.
K.2 Decode cost
In our experiments, we use the default OpenCV decode function and
decode frames from H.264 as soon as they enter the system. Using
4 cores on a Intel(R) Xeon(R) Platinum 8260 CPU @ 2.40GHz,
we measure that decoding a frame takes 1.6ms, which amounts to
taking 5% of the total runtime for processing. This doesn't play a big
role given that the CV models used for inference in our experiments
often take around 100ms to run. For example, YOLOv5 on the same
hardware configuration takes 86ms per inference.
L CLOUD VS ON-PREMISE TOTAL COST OF
OWNERSHIP
The same computation on the Cloud is generally more expensive
than on premise. This section estimates the cost ratio between Cloud
and on premise compute. We hereby follow Greg Deckler's estimate
but use current prices and simplify further.11 The simplifications
are to the disadvantage of the cloud and make the cloud compute
more expensive when compared to the on premise compute. This
is to the disadvantage of Skyscraper, as Skyscraper's cloud costs
are multiplied by a higher factor. We take the following simplifying
assumptions:
• Setting the on premise hardware up and maintaining it is for
free. There are no staff costs and also no damages or other
maintenance costs.
• We ignore tax implications (cap-ex vs. op-ex)
• We assume a 3 year (36 months) lifecycle of all hardware.
This matches Greg Deckler's assumption and is common in
similar cost analyses.
• We ignore software licensing costs for on premise.
• A month has 744 hours.
• We ignore cost for space (i.e. rent) for on premise.
• We ignore costs for networking hardware (e.g. network
switches).
We compare the on-premise cost to the AWS Lambda 3000MB
instance that we used in our experiments. Renting one of these in-
stances over an entire month costs 130.78 USD/month.12 For the
on-premise hardware, we consider the Dell R240 as a cheap com-
modity sever at the time of writing. In the cheapest, default configu-
ration, Dell states the value of this machine at 1596.90 USD.13 This
configuration includes an Intel Celeron G4930 with 2 cores. Since
computer vision tasks are generally compute bound and paralleliz-
able, the number of cores largely determines the runtime. We found
11https://www.linkedin.com/pulse/cloud-vs-on-premises-hard-dollar-costs-greg-
deckler/ (accessed on 14 July 2022)
12https://aws.amazon.com/de/lambda/pricing/ (accessed on 14 July 2022)
13https://www.dell.com/en-us/work/shop/cty/pdp/spd/poweredge-r240/pe_r240_
13157_vi_vp (accessed on 14 July 2022)
that our AWS Lambda instance uses 2 Intel Xeon cores and is there-
fore comparable. Dividing the cost of the Dell R240 server by its
assumed life cycle of 36 months gives a monthly cost of 47.2 USD.
In the standard configuration, the Dell R240 comes with a 250W
power supply. In April 2022, the average electricity cost across all
US states was 15.38 cents per kWh.14 Using 250W over a month of
744 hours results in 186 kWh, which cost 28.6 USD/month. In total,
this gives a Cloud to on premise cost ratio of 1.8×.
M SIMULATOR
In the following, we describe the simulator algorithm in detail and
evaluate it.
M.1 Simulator algorithm
The placement optimizer typically suggests thousands of placements
during the search. Executing each of these placements on real hard-
ware would take a long time and require the user to pay money to
execute the tasks that the optimizer placed on the cloud. To make
the placement search practical, Skyscraper instead uses a simulator
to estimate the runtimes of a given placement.
The simulator hereby takes a directed acyclic task graph (DAG)
as input where each node is a UDF that is labeled for execution on
cloud or on premises.
Before simulating placements of the DAG, the simulator profiles
each UDF on real hardware. The simulator hereby measures the
following three properties:
• Runtime on 1 on premise core: Some UDFs are multi-
threaded and can run on several cores in parallel. During
video ingestion however, other cores are typically occupied
by other UDFs and a UDF may hence often only utilize one
core. Because of this, the simulator assumes that each UDF
is scheduled on a single core. To obtain the runtime of a
UDF on a machine with n cores, we measure the runtime of
executing n UDF instances on the machine in parallel. Like
this, each UDF is usually scheduled to run on one core and
we measure the runtime as desired.
• Round trip time for cloud version of UDF: As described
in section 2, each UDF also has a version where most of the
processing is done on the cloud. Measuring the runtime of
this function is trivial as it is largely dominated by the round
trip time to the cloud, which includes the processing time on
the cloud. We assume that the function does not experience
a cold start and therefore warm up cloud workers before
measuring.
• Average input & output sizes of UDF in bytes: To estimate
the bandwidth requirement of tasks, we measure the average
size of the payload that the function uploads to the cloud and
receives from the cloud. In video processing, we observe
that the tasks' input and output sizes do not vary much.
The input to a simulation then consists of two things: First, the
simulator takes a directed acyclic task graph (DAG) as input, where
the nodes are measured tasks and the edges are inter-task depen-
dencies. Second, the simulator takes a placement of the task graph
14https://www.eia.gov/electricity/monthly/epm_table_grapher.php?t=epmt_5_6_a (ac-
cessed on 14 July 2022)
24
where each task in the DAG is either placed on premises or on the
cloud. The simulator then outputs the runtime of this placement.
T
The estimated runtime is the time tmax at which the simulator es-
timates the last task to finish. The simulator iteratively simulates the
execution of tasks and updates tmax accordingly. Initially, tmax = 0.
In each iteration, the simulator then chooses the task T for execution,
whose dependencies are resolved at the earliest time tread y
. In the
first iteration, this is a task with no dependencies which exists by
the definition of DAG. The simulator keeps track of when the last
cloud task finishes through tcloud
max and also keeps track for each on
premise core c, at what time tc
max the last task on that core finishes.
For a task T that is placed on premise, the simulator takes the
measured on-premise runtime tT as estimate for the execution time
of T . It schedules T on the core c with the lowest tc
max . For that core
c, tc
) + tT .
max is updated to tc
For a task T that is placed on the cloud, the simulator takes the
measured runtime of the cloud UDF as an estimate for the exe-
cution time tT . However, the simulator also keeps track if uplink
and downlink bandwidth is occupied. The simulator assumes that
each task will occupy the bandwidth fully for the amount of time
required to upload/download their payloads. The earliest dispatch
for a cloud task is therefore determined by tread y
time tdispatchable
T
and the earliest time when bandwidth is available. tcloud
is updated
max
max , tdispatchable
to tcloud
T
max ← max (tcloud
The final estimate for runtime estimate tmax is given by the
max ← max (tc
max , tready
T
) + tT
T
maximum of tcloud
max and tcloud
c
for all cores c.
M.2 Simulator evaluation
As described in section 3, Skyscraper uses a simulator to estimate
(1) the runtime of a set of tasks on a given on premise server
(2) the round trip time to execute tasks on the cloud.
We first evaluate these two estimations separately. We then evalu-
ate them jointly by estimating the end-to-end runtime of a Skyscraper
ingestion.
For the on premise estimation, we measured the runtime of a
YOLO task and of a KCF task as described in section. We then
estimate the runtime of the following three DAGs.
• YOLO: Run 60 YOLO tasks without dependencies.
• KCF: Run 60 KCF tasks without dependencies.
• Combined: Run 60 YOLO tasks, each of which feeds its output
to a KCF task.
We estimated the runtimes of these on machines with 2, 4, 8
and 16 cores. Figrue 22 shows the results of this experiment on
the left. All estimations have an error below 9% and the runtimes
have only been overestimated. Futhermore, estimations on the same
machine roughly have a similar error. Similar errors have less impact
on the placement and configuration searches since all placements
are overestimated similarly. We generally find that the simulation
error is not a problem when looking for good placements and knob
configurations. This is especially true since the selected placements
are later executed to get their real runtimes for the online phase.
For the cloud estimation, we measured the round trip time of a
YOLO invocation on AWS Lambda, and then invoked that function
at a rate of 1 Hz for 3.5 hours. We then estimate the time at which
each cloud invocation returns. Figure 22 shows the error of the
estimation over time.
Figure 22: Simulation accuracy only on on premise tasks (left)
and only on cloud tasks (right)
While there are occasional spikes for the cloud round trip times,
they are so rare that they are insignificant for provisioning and
therefore for the simulation. When running Skyscraper online, these
spikes will be absorbed by the buffer which in turn causes the Knob
Switcher to use more expensive placements to empty the buffer again.
Since spikes occur so rarely, the additional cost is not noticeable
however.
Finally, we evaluate the simulation for a run of Skyscraper. We
hereby let the knob planner and knob switcher tune the workload's
knobs and simulate the runtime of the resulting DAGs. We run
Skyscraper on real hardware and log when each task returns. We
then feed these DAGs to the simulator and let it estimate when each
tasks return. Figure 23 shows the estimation error over time. The
simulation error was larger during rush hours as can be seen by the
three spikes in the plots.
Figure 23: Simulation accuracy on actual Skyscraper executions
which combine on premise tasks and cloud tasks
N IMPLEMENTATION DETAILS
In the following, we motivate and give further details on the imple-
mentation of Skyscraper that we used in the experiments in Section 5.
This section is complementary to the implementation details pro-
vided in Section 5.1.
Implementation choices
N.1
For our experiments, we implemented Skyscraper on top of Ray [59]
and AWS Lambda [69]. In the following, we briefly discuss these
implementation choices.
25
Figure 24: Visualization of dependencies in Skyscraper and how
Skyscraper components are mapped onto processes.
Ray. We envision Skyscraper's user base to mainly consist of
data scientists want to use a Python API and program their UDFs
in Python. The simplest way to allow this is to write Skyscraper in
Python. However, Skyscraper needs to run UDFs in parallel, which is
not supported natively by Python due to the Global Interpreter Lock
(GIL). Therefore, we need to execute the UDFs using a third-party
execution engine that is capable of executing Python functions in
parallel. We chose Ray because it avoids overheads from spawning
a new process for each UDF call, which is done by packages like
multiprocessing [60] or IPython Parallel [73].
AWS Lambda. We chose to execute tasks that are offloaded to
the cloud on a Function-as-a-Service (FaaS) platform for simplicity.
Like this, we don't need to worry about turning machines on or off
(which incurs long wait times). We chose AWS Lambda since it is a
well-established FaaS platform.
N.2 Parallelization with Ray
Skyscraper only maps UDFs to Ray actors and the system's compo-
nents are run inside the parent process on Python's main thread.
In the online phase, Skyscraper 's components cannot be paral-
lelized but must instead synchronize the calls to Ray actors. Specifi-
cally, the knob switcher waits on the UDFs to finish processing the
previous video segment. The knob switcher can only be run after
the UDFs return because the UDFs compute their achieved quality
while processing the video segment, and the knob switcher needs this
quality to decide which knob configuration to use next (as described
in Section 4). In our implementation, this is implemented by letting
the knob switcher wait on a quality Future, whose value is set by one
of the UDFs processing the previous video segment. After choosing
the new knob configuration, the next UDFs are called accordingly
and the knob tuner again waits on the Future to be set by one of the
newly called UDFs. Similarly, the knob planner needs to wait on the
statistics of the knob switcher, which record what content dynamics
occurred how often. These statistics are the input to the forecasting
model. The knob planner therefore waits on the future containing
these statistics before it can compute a new knob plan. The knob
switcher can only operate when given a knob plan, so it cannot be
run in parallel to the knob planner and waits for the future containing
the new knob plan. These dependencies are visualized in Figure 24.
In the offline phase, by far the most time is consumed running
UDFs to process the training data. Running these UDFs is paral-
lelized by mapping them onto Ray actors (as in the online phase).
Also like in the online phase, Skyscraper 's components are all run
10%8%6%4%2%0%-2%Simulation error COVID0 12 24 36 48 60 72Simulation errorTime elapsed (h)10%8%6%4%2%0%-2%Simulation error MOT0 12 24 36 48 60 72Simulation errorTime elapsed (h)123410%8%6%4%2%0%-2%Error Cloud tasks0 1 2 3 4Simulation errorTime elapsed (h)10%8%6%4%2%0%24816CoresYOLOKCFCombinedSimulation errorError on premise tasks10%8%6%4%2%0%-2%Simulation error COVID0 12 24 36 48 60 72Simulation errorTime elapsed (h)10%8%6%4%2%0%-2%Simulation error MOT0 12 24 36 48 60 72Simulation errorTime elapsed (h)123410%8%6%4%2%0%-2%Error Cloud tasks0 1 2 3 4Simulation errorTime elapsed (h)10%8%6%4%2%0%24816CoresYOLOKCFCombinedSimulation errorError on premise tasksSkyscraper (parent process)UDFs (mapped onto Ray actors)KnobswitcherKnobswitcherKnobswitcherKnobplannerDependency: QualityDependency: Knob config.Dependency: QualityDependency: Content statisticsDependency: Knob planDependency: Knob config.in the parent process because parallelizing their execution wouldn't
lead to significant runtime reductions (as shown in Appendix E).
26
|
http://arxiv.org/abs/2310.04821v2 | "2023-10-10T06:25:03" | "2023-10-07T14:19:07" | Rethink Baseline of Integrated Gradients from the Perspective of Shapley
Value | Numerous approaches have attempted to interpret deep neural networks (DNNs)
by attributing the prediction of DNN to its input features. One of the
well-studied attribution methods is Integrated Gradients (IG). Specifically,
the choice of baselines for IG is a critical consideration for generating
meaningful and unbiased explanations for model predictions in different
scenarios. However, current practice of exploiting a single baseline fails to
fulfill this ambition, thus demanding multiple baselines. Fortunately, the
inherent connection between IG and Aumann-Shapley Value forms a unique
perspective to rethink the design of baselines. Under certain hypothesis, we
theoretically analyse that a set of baseline aligns with the coalitions in
Shapley Value. Thus, we propose a novel baseline construction method called
Shapley Integrated Gradients (SIG) that searches for a set of baselines by
proportional sampling to partly simulate the computation path of Shapley Value.
Simulations on GridWorld show that SIG approximates the proportion of Shapley
Values. Furthermore, experiments conducted on various image tasks demonstrate
that compared to IG using other baseline methods, SIG exhibits an improved
estimation of feature's contribution, offers more consistent explanations
across diverse applications, and is generic to distinct data types or instances
with insignificant computational overhead. | [
"Shuyang Liu",
"Zixuan Chen",
"Ge Shi",
"Ji Wang",
"Changjie Fan",
"Yu Xiong",
"Runze Wu Yujing Hu",
"Ze Ji",
"Yang Gao"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04821v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04821v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI"
] | Rethink Baseline of Integrated Gradients from the Perspective of Shapley Value
Shuyang Liu1*, Zixuan Chen1*, Ge Shi2, Ji Wang2, Changjie Fan3, Yu Xiong3, Runze Wu3
Yujing Hu3, Ze Ji4, Yang Gao1
1 Nanjing University, Nanjing, China
2 University of California, Davis, California, USA
3 NetEase Fuxi AI Lab, Hangzhou, China
4 Cardiff University, Cardiff, U.K.
3
2
0
2
t
c
O
0
1
]
G
L
.
s
c
[
2
v
1
2
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Abstract
Numerous approaches have attempted to interpret deep neu-
ral networks (DNNs) by attributing the prediction of DNN to
its input features. One of the well-studied attribution methods
is Integrated Gradients (IG). Specifically, the choice of base-
lines for IG is a critical consideration for generating mean-
ingful and unbiased explanations for model predictions in
different scenarios. However, current practice of exploiting
a single baseline fails to fulfill this ambition, thus demand-
ing multiple baselines. Fortunately, the inherent connection
between IG and Aumann-Shapley Value forms a unique per-
spective to rethink the design of baselines. Under certain hy-
pothesis, we theoretically analyse that a set of baseline aligns
with the coalitions in Shapley Value. Thus, we propose a
novel baseline construction method called Shapley Integrated
Gradients (SIG) that searches for a set of baselines by pro-
portional sampling to partly simulate the computation path
of Shapley Value. Simulations on GridWorld show that SIG
approximates the proportion of Shapley Values. Furthermore,
experiments conducted on various image tasks demonstrate
that compared to IG using other baseline methods, SIG ex-
hibits an improved estimation of feature's contribution, offers
more consistent explanations across diverse applications, and
is generic to distinct data types or instances with insignificant
computational overhead.
I. Introduction
As artificial intelligence (AI) becomes more sophisticated
the necessity of
and indispensable in our daily lives,
transparency and accountability in AI decision-making has
grown significantly. (Adadi and Berrada 2018; Gunning and
Aha 2019) To this end, Explainable Artificial Intelligence
(XAI) was proposed and has been increasingly studied
within the community that focuses on developing machine
learning models and systems that can offer understand-
able explanations for their decisions and predictions (Ar-
rieta et al. 2020; Das and Rad 2020). Research on XAI
boomed exceptionally after the paramount success of deep
neural networks (DNNs), as they are considered by many as
complex yet intriguing "black-box" models. (Angelov and
Soares 2020; Ras et al. 2022)
Under review.
*These authors contributed to the work equally and should be
regarded as co-first authors.
Among numerous XAI methods, attributing the prediction
of a deep network to its input features is particularly popular
due to its intuitive explanations and broad applicability (Si-
monyan, Vedaldi, and Zisserman 2013; Ancona et al. 2017;
Heskes et al. 2020). One of these attribution methods, In-
tegrated Gradients (IG) (Sundararajan, Taly, and Yan 2017)
stands out as a leading algorithm by integrating gradients
of the model's output with respect to input along a straight
path from baseline to input. The mechanism and easy-to-
implement property of IG make it particularly useful and
applicable for understanding how input features impact the
model's output. Since its introduction, IG has continuously
evolved (Ghorbani, Abid, and Zou 2019; Jha et al. 2020;
Yang, Wang, and Bilgic 2023; Pourdarbani et al. 2023; Yang,
Wang, and Bilgic 2023), language models' explanation (En-
guehard 2023), and electronic health (Duell et al. 2023).
For IG, or path attribution methods in general, it is usually
required to choose a hyperparameter known as the baseline
input. Crucially, the choice of an appropriate baseline for
IG plays a pivotal role in providing meaningful feature at-
tributions and explanations (Frye et al. 2020). Take image
classification task as an example: the gradient at a pixel rep-
resents the direction, in which the function increases most
rapidly, indicating the pixel's influence on the model's pre-
diction. Since the contributions of players are measured by
accumulating gradients on images interpolated between the
baseline value and the current input, the choice of baseline
has an outstanding influence on these gradients.
There are three baseline inputs that are commonly
adopted in XAI: random (Jha et al. 2020), zero (Ancona,
Oztireli, and Gross 2019; Aas, Jullum, and Løland 2021),
and mean (Dabkowski and Gal 2017), all of which are sin-
gle baseline values. We briefly give justifications of the pit-
falls of choosing a single baseline value. (i) A single baseline
that is naturally considered as neutral and task unrelated by
human might not have a "near-zero" score as recommended
by (Sundararajan, Taly, and Yan 2017) for many models. For
instance, for the function of interest F1(x) = x + 1, if a
baseline of zero is used, namely x0 = 0, then F1(x0) = 1
is not "near zero", thus making interpretability implausi-
ble. (ii) A single baseline that's meticulously crafted for a
specific model is not generic to all instances. A straight-
forward example is F2(x) = x3 − 6x2 + 11x − 6 where
x1 = 1, x2 = 2, x3 = 3 are the solutions to F2(x) = 0.
Choosing any one of them as the baseline might introduce
incompleteness and unintended bias into the attributions.
The caveats of utilising single baselines are also discussed
and validated by Chen, Lundberg, and Lee (2022).
Intuitively, the challenges associated with a single base-
line motivate us to exploit a set of baselines for IG. We
therefore delve deep into IG method, rethinking how to con-
struct a set of well-interpretable and consistent baselines.
We traced back to the underlying scheme of IG. Although
applied in distinct fields, as an attribution method, IG cor-
responds to a "shortcut" approximation of a cost-sharing
method in economics called Aumann-Shapley Value (Au-
mann and Shapley 1974) where the model, base features,
and attributions of IG are analogous to the cost function,
players, and cost-shares of Aumann-Shapley Value respec-
tively. (Sundararajan and Najmi 2020) Furthermore, we
show that under certain assumptions, coalitions in Shapley
Values involving marginal contributions can be treated as
baselines and explained samples. Specifically, we assume
that the baselines correspond to the coalitions in Shapley
Values. This means that we are able to select a set of base-
lines to model the computation of the Shapley Values in a
concise and efficient manner, echoing our objective of utiliz-
ing a set of baselines. Therefore, based on these assumptions
we propose a novel baseline construction method called
Shapley Integrated Gradients (SIG). SIG assumes baseline
corresponds to coalitions in Shapley Value and search for
a set of baseline by proportional sampling to partly simulate
the computation path of Shapley Value. To validate the effec-
tiveness, genericnesss and consistency of SIG, we conduct
experiments in two main types of environments according to
the different nature of task inputs: (1) simulation of Shapley
Values in GridWorld maze environment (Sutton and Barto
2018) to demonstrate that SIG approximates the proportion
of Shapley Values; and (2) a variety of image input tasks,
including image classification (He et al. 2016), and expres-
sion codes (Zhang et al. 2021), to reveal that SIG produces
enhanced explanation and more consistent interpretation re-
sults across a variety of tasks.
To summarize, our contributions are three-folds: (i) we
analyse the drawbacks of using a single baseline for IG and
hence a set of baselines is desirable; we then rethink baseline
design for IG from the perspective of Shapley Value, and
theoretically show that under certain hypothesis, the coali-
tions in Shapley Values can be regarded as a set of baselines
for IG; (ii) we propose a novel baseline construction method
named SIG that partially models the computational path of
the Shapley Value by finding the set of baselines; (iii) The
experimental results demonstrate that the proposed SIG pro-
vides a new perspective on IG, showing improved and more
consistent interpretation than existing methods in a wide ar-
ray of applications, and is generic to various data types and
instances, thus making it of considerable value for practical
applications.
II. Related Work
Integrated Gradients and the Choice of Its Baselines
Integrated Gradients (IG) (Sundararajan, Taly, and Yan
2017) fuses the implementation invariance of gradients with
sensitivity-based techniques, necessitating a crucial baseline
value, as noted by the authors. Mudrakarta et al. (2018) illu-
minated computation path of IG is the straight-line between
baseline and input sample.
Recent studies (Dabkowski and Gal 2017; Merrick and
Taly 2020; Kumar et al. 2020; Binder et al. 2016; Shriku-
mar, Greenside, and Kundaje 2017; Frye et al. 2020; Tan
2023) have provided experiential advice on choosing base-
line values, while falling short of theoretical illumination.
For example, Dabkowski and Gal (2017) opted to use the
average of randomly selected samples from the dataset as
the baseline; Frye et al. (2020) established baseline value of
a pixel in relation to surrounding pixels; Chen, Lundberg,
and Lee (2021) perceived the baseline as a representation
of the background distribution, a viewpoint that harmonizes
with our perspective; Feng et al. (2022) also highlights that
the computational path of IG is not equivalent to that of the
Shapley Value.
Shapley Value Shapley (1951) proposed Shapley Value to
allocate contributions to players in a cooperative setting. It
is the only distribution with linearity, nullity, symmetry, and
efficiency axioms. Aumann and Shapley (2015) extended
the concept of Shapley Value to infinite game. Prior attempts
have been made to incorporate Shapley Values to attribu-
tion explanations: Lundberg and Lee (2017) proposed Shap-
ley Additive exPlanations (SHAP), in which each feature of
the model is viewed as a player in the game, the model it-
self is seen as a utility function, and the chain rule is em-
ployed to diminish computational complexity; Ghorbani and
Zou (2019) enhanced the efficiency of Shapley Value esti-
mation by using Monte Carlo Sampling and gradient-based
methods; Mitchell et al. (2022) proposed a new approach to
mitigating the issue of slow convergence of standard Monte
Carlo sampling sampling; Chen, Lundberg, and Lee (2022)
pointed out that utilizing multiple baselines mitigates the po-
tential bias that can arise from attributions based on a single
baseline.
III. Preliminaries
Notation A table of notations used in this work is pre-
sented in the Appendix.
Shapley Value Consider a game with n players and a util-
ity function v, where v : 2N → R maps subsets of players to
real numbers. Any set of players in N is called a coalition S.
For a given coalition S and a player xi such that xi /∈ S, the
marginal contribution of player xi to coalition S is defined
as v(S ∪xi)−v(S). The Shapley Value of player xi, denoted
by fSV (xi), is then computed as the sum over all coalitions
S ∈ N/{i}, weighted by the probability of selecting each
coalition. Specifically,
fSV (xi) =
(cid:88)
S∈N/{i}
|S|!(|N | − |S| − 1)!
|N |!
(v(S ∪xi)−v(S))
(1)
Aumann-Shapley Value With the extension to infinite
game, Aumann-Shapley Value was proposed with the def-
inition that ds represents infinitely small player in game,
I represents the complete set of players and tI is a per-
fect sampling, representing a proportion t of all the players.
Aumann-Shapley Value can be written as follows:
fSV (ds) =
(cid:90) 1
0
v(tI + ds) − v(tI)dt
(2)
Integrated Gradients (IG)
Integrated Gradients
is a
method that was developed to attribute the prediction of a
DNN to its input features. It integrates the gradient of the
prediction concerning the input features over a straight-line
path between the input x and a baseline x′. The IG for a
model F is expressed as follows:
fIG(xi) = (xi − x′
i) ×
(cid:90) 1
0
∂F (x′ + α(x − x′))
∂xi
dα (3)
IV. Method
v(I) =
=
=
=
(cid:90) I
∅
(cid:90) I
fSV (ds)
(cid:90) 1
v(tI + ds) − v(tI)dt
∅
(cid:90) I
0
(cid:90) 1
∅
(cid:90) I
0
(cid:90) 1
∅
0
v(tI + ds) − v(tI)
ds
dtds
dv(tI)
ds
dtds
Meanwhile, IG accumulates the contribution of each fea-
ture by integrating the partial derivatives of model F with
respect to the feature at points along a straight-line path
[x′, . . . , x′ + α(x − x′), . . . x] from the baseline to the ex-
plained sample. As such, the integral of IG over all features
from ∅ to I can be written as follows:
(cid:90) I
(cid:90) I
(cid:90) 1
fIG(dx) =
(xi − x′
i)
∂F (x′ + α(x − x′))
∂xi
∂F (x′ + α(x − x′))
∂xi
dαdx
dxdα
0
(cid:90) I
∅
(xi − x′
i)
∇F (x′ + α(x − x′))dα
= F (x) − F (x′) = v(I)
In this section, we will first present Intergrated Gradients
(IG) from the perspective of Shapley Value. Through this
view, we discover and analyze the shortcomings of IG: cal-
culation path of IG takes a straight line shortcut compared
to that of Shapley Value. Building upon this observation,
we propose our baseline construction method, Shapley In-
tegrated Gradients (SIG).
∅
∅
(cid:90) 1
0
(cid:90) 1
0
=
=
Integrated Gradients From the Perspective of
Shapley Value
Given an explained sample x = [x1, . . . , xn], a baseline ex-
ample x′ = [x′
n], and a function F : Rn → [0, 1]
that represents a deep network, we prove that IG is associ-
ated with Aumann-Shapley Value as follows:
1, . . . , x′
Theorem 1. Suppose x′ represents the empty set ∅ with the
absence of all features, x represents the complete set I with
the presence of all features, and utility function of any sam-
ple x is evaluated as v(x) = F (x) − F (x′), the integral
of Integrated Graidents of all features is a simulation of the
integral of Aumann-Shapley Values for all players when the
model is evaluated along the linearly interpolated path be-
tween baseline and explained sample.
Proof. We treat each feature xi of sample x as a player in
game theory and the mix up of x and x′ in a feature-wise bi-
nary on-off manner as a coalition. Thus, the worth of perfect
sample tI including coalitions with t proportion of x and
1 − t proportion of x′ is represented as v(tI). The contribu-
tion of ds to the coalition is v(tI + ds) − v(tI). Aumann-
Shapley Value computes the contribution of an infinitesimal
player ds by integrating the functional gain of adding the
player to the perfect sample tI of the all-player I at all pro-
portions t ∈ [0, 1]. When t = 0 and t = 1, we get an ∅
and a complete set I respectively. Therefore, the worth of
the complete set I that represents the integral contribution
of all players can be written as follows:
Interestingly, indicated by the proof above, the integral of
IG approaches the integral of Shapley Value but though a
different computation path. Each feature in IG plays essen-
tially the same role as a player in Shapley Value. Uppon this
proof, we use player and feature interchangeably in the fol-
lowing paragraphs.
Limitations of Integrated Gradients
Figure 1: (a) For a two-features input, red lines represent
calculation of Shapley Value for feature S1 and blue lines
represent that for feature S2. While Path P2 is calculation
path of IG. (b) Red paths are the calculation path of Shapley
Value while blue path is the calculation path of IG for a n-
features input.
From the aforementioned Theorem 1, we derive that IG
approaches the Aumann-Shapley Value in computing the
contribution of the entire feature set. However, the goal of
attribution methods is to compute the contribution of each
individual feature. We illustrate their difference with a sim-
ple example.
As is shown in Fig. 1(a), we assume that there is a two-
features input of the deep model, denoted as x = (S1, S2)
with its corresponding baseline as x′ = (r1, r2). Then the set
of coalitions encompasses (r1, r2), (S1, r2), (r1, S2), and
(S1, S2). The Shapley Value of features S1 and S2 are:
f (S1) =
f (S2) =
(v (S1, r2) − v (r1, r2))
2
(v (r1, S2) − v (r1, r2))
2
+
+
(v (S1, S2) − v (r1, S2))
2
(v (S1, S2) − v (S1, r2))
2
From the computation of Shapley Value for S1 and S2,
we observe that calculation paths traverse through all four
points of coalitions, represented by the blue and red lines in
Fig. 1. The calculation path of Shapley Value can be denoted
as P1 and P3. On the other hand, as the proof shows, we
ascertain that IG actually computes contribution along the
straight line P2. It becomes apparent that calculation path of
IG, expressed as P2, takes a shortcut compared to path of
Shapley Value, shown as P1 and P3.
Extending to n-features setting, as shown in Fig. 1(b), the
computation of Shapley Value takes many polyline paths
while the computation of IG approximates it by taking a
straight line short cut between baseline and the explained
sample. Consequently, this discrepancy may result in inac-
curate attributions of individual features.
Shapley Integrated Gradients
In above subsection, we observe that IG may lead to inac-
curacy in estimating the contributions for features caused by
the shortcut of calculation path compared to Shapley Value.
However, because of the single path computation, it's effi-
ciency is obvious. Contrastively, Shapley Value is appreci-
ated for its accuracy in determining individual contributions,
its computational burden of leveraging all coalitions, sub-
jected to O(2n) where n is the number of features, restricts
its application. To take some benefits of both, we combine
Shapley Value with IG and propose Shapley Intergratd Gra-
dients (SIG), a novel baseline construction method for im-
proving IG from the perspective of Shapley Value.
The intuition of the algorithm comes from Equation 1. As
shown, the Shapley Value of feature i is the weighted aver-
age of marginal contributions of a player across all possible
coalitions {S; S ∈ N/{i}}, where the weight wi(S) and
marginal contribution Vi(S) are defined as:
wi(S) =
|S|!(|N | − |S| − 1)!
|N |!
(4)
Vi(S) = v(S ∪ xi) − v(S)
(5)
By inspecting the above two factors, here are some inter-
esting observations:
Observation 1. Given a game N , wi(S) is only dependent
on the number of players k = |S| in the coalition S. There-
fore, we can merge {wi(S); ∀S s.t. |S| = k∧∀i, i ∈ N } as a
universal weight value w(k). This value can be precomputed
as long as we decide k.
Observation 2. The sum of {w(k); ∀S s.t. |S| = k∧∀k, k ∈
[0, |N | − 1]} is 1 since w(k) represents the inverse value
of the number of combinations (cid:0)|N |−1
(cid:1) times the number of
different values of k we can choose from the game. k acts like
the proportion t in Equation 2 to measure the magnitude of
coalitions. Thus, all coalitions are naturally categorized into
|N | groups subjected by the size k and (cid:80)
S w(k) = 1/|N |.
|S|−1
1
w(k)
=
= |N | ×
|N |!
|S|!(|N | − |S| − 1)!
|N − 1|!
k!(|N | − 1 − k)!
(cid:18)|N | − 1
k
(cid:19)
= |N | ×
Observation 3. As a direct conclusion of Theorem 1, the
marginal contribution of adding i; ∀i ∈ N to S can be ap-
proximated by using IG from baseline S to complete set I.
In the definition of Shapley Value in Equation 1, the
marginal contributions of of all the coalitions S are all
computed and then weighted by their corresponding wi(S)
whose quantity is exponentially large. However, thanks to
the observations above, we leverage a "trick" called pro-
portional sampling, as is shown in Fig. 2(a), to circumvent
it.
Figure 2: (a) Proportional sampling in our SIG. Different
colored nodes represent different weights defined by Equa-
tion 4. (b) Construction of new players. A patch of pixels is
considered as a new player/feature on which we search the
baseline set.
Proportional Sampling.
Instead of sampling coalitions
from a binomial distribution and weight them by their corre-
sponding wi(S), an alternative approach is to sample coali-
tions proportional to the precomputed wi(k) and weight
them uniformly by 1.
Here, we justify the "trick" creates an unbiased estimator
of Shapley Value briefly. Due to Observation 1, the weight of
coalition S can be precomputed once we select a k, and it's a
constant no matter which specific coalition is drawn as long
as it's size is k. Due to Observation 2, the expected marginal
contribution of different sizes are equally treated for differ-
ent k values. Therefore, the prior importance of each coali-
tion are universally 1. Suppose we draw an infinite large
number of samples, the expectation of Vi(S) drawn propor-
tional to weight w(k) is an infinite approach to that of Vi(S)
weighted by w(k). The detailed proof is in the Appendix.
In addition, Observation 3 enables reducing the computa-
tion burden of computing the marginal contributions of all
players i one by one but complete them at once. Since IG
is a gradient based approach which is supported by GPUs,
leveraging it gives SIG more potential to speed up.
To sum up, the three observations inspire our proposed
SIG algorithm that constructs a set of sampled coalitions
with different magnitude k as baselines of IG to approxi-
mate Shapley Value in an efficient way.
SIG Algorithm
We posit that a coalition in Shapley Value corresponds to
a baseline in IG. We aim to obtain relative Shapley Value
since people typically care more about relative contributions
of features rather than the absolute contributions. The overall
algorithm, termed as Shapley Integrated Gradients (SIG), is
presented in Algorithm 1.
Algorithm 1: Shapley Intergratd Gradients (SIG)
INPUT: explained sample x, default sample x′, model F
PARAMETER: player set N , sample size B
OUTPUT: approximated Shapley Values V
Initialize baseline set D = ∅
for k ← 0 to N − 1 do
Compute weight w(k) as Equation 4
end for
Normalize all weights ˆw(k) = w(k)/ (cid:80)N −1
while |D| < B do
k=0 w(k)
for k ← 0 to N − 1 do
Draw a random number r ∼ U(0, 1)
if r < ˆw(k) then
Create a coalition S by randomly selecting k play-
ers from N
Construct a baseline d from S based on x and x′
Add d to D
end if
end for
end while
Concatenate D into a tensor with the mini-batch size B
Compute mini-batch IG A = fIG(x, D, F ) as Equation 3
Average through mini-batch V = 1
B
return V
i=1 Ai
(cid:80)B
There are two key points to note in the algorithm. (i) There
doesn't have to be a one-to-one mapping from a player to a
feature in explained sample x. As is shown in Fig. 2(b), we
treat a patch of pixels as a single player to construct baseline
sets. (ii) The construction of a baseline d of coalition S is by
replacing the default values of x′ included in S with corre-
sponding values of x. The default value is dependent on the
task which we will specify in the experiments.
There are two sources of discrepancies between our SIG
and Shapley Value: (i) We only collect a subset of coalitions,
with the omission of many other coalitions; (ii) The marginal
contribution approximated by IG is a deviated from the ac-
curate definition of Shapley Value.
Finally, compared with Shapley Value, the benefits of us-
ing SIG are as follows:
• SIG is more suitable in a mini-batch computation set-
ting by leveraging powerful parallel computation devices
such as GPUs which is prevalent in current large scale
applications.
• SIG has the flexibility for users to define a smaller sample
size instead of collecting all coalitions.
• SIG supports user defined players but can still obtain
feature-wise dense estimation of Shapley Values.
To summarize, our work identifies that the calculation
path of IG takes a shortcut compared to the path of Shap-
ley Value. Consequently, we introduce SIG as a hybrid of
Shapley Value and IG which approximates Shapley Value
efficiently.
V. Experiments
In this section, we aim to further validate the soundness of
SIG by exploring the answers to the following questions.
• Question 1. Does SIG accurately approximate the pro-
portion of Shapley Values?
• Question 2. Does SIG provide improved explanations
than IG? If so, is such improvement generic to differ-
ent data types or instances, and consistent across various
kinds of visual input tasks? In short, we wonder how well
does SIG outperform IG.
Experiment Setup
To answer the aforementioned two critical questions, we de-
vise two sets of experiments. Specially,
• Simulation of Shapley Value involves a simple Grid-
World environment (Sutton and Barto 2018) comprising
4 distinct sub-tasks to evaluate our SIG's ability of simu-
lating Shapley Value for Question 1;
• Performance of Explanation focuses on two visual
input-based tasks: 1) Expression Code Task utilizing De-
viation Learning Network (DLN) model (Zhang et al.
2021) on a dataset from a private data source.; 2) Image
Classification Task employing ResNet model (He et al.
2016) on ImageNet Dataset (Deng et al. 2009) for Ques-
tion 2.
Compared Methods. To objectively assess the perfor-
mance of explanation provided by SIG, we choose three
commonly used baseline methods for comparison, i.e., (i)
random baseline: baseline sample is randomly selected
from a set of samples being explained; (ii) zero baseline:
baseline value of each feature is set to zero; (iii) mean base-
line: baseline value of each feature is determined as the av-
erage value across a set of samples being explained.
Hyperparameters. For Simulation of Shapley Value ex-
periment, we list several hyperparameters as follows.
▶ Q: represents the ratio of sampled coalitions to all coali-
tions;
▶ N: denotes the number of baselines sampled from ran-
domly selected coalitions.
For Performance of Explanation experiment, hyperparame-
ters include:
▶ {M, N}: indicates that an M × N pixel area is treated as
a new player.
For a more detailed discussion on the impact of these hyper-
parameters, please refer to the Appendix.
Simulation of Shapley Value
The simplicity of GridWorld facilitates the computation of
Shapley Values, making it an ideal simulation environment
to answer Question 1. In GridWorld, the agent performs
valid actions (that do not result in out-of-bounds) based on
its state to maximize the reward. We take time step (s, a)
as a player and treat reward as utility. We construct a 2 ×
2 GridWorld with 12 players under 2 distinct Shapley Value
conditions, and a 2 × 3 GridWorld with 20 players and 2
different Shapley Value conditions. The Shapley Values for
these four conditions are detailed in the Appendix.
(a)
(c)
(b)
(d)
Figure 3: Average Spearmanr metric of four baseline meth-
ods in GridWorld. (a) and (b) depict the results for 2 × 2
GridWorld, and (c) and (d) are the results for 2 × 3 Grid-
World. The yellow line indicates the variance of the Spear-
manr metric.
As a quantitative measurement for the order of player's
contribution, we select Spearmanr metric (Gauthier 2001) to
evaluate the similarity between the computed Shapley Value
order and the actual Shapley Value order. To investigate the
robustness of SIG under varying Shapley Values, we test
against a set of hyperparameters. Ten independent exper-
iments were conducted to minimize the effect of random-
ness. The results are shown in Fig. 3. SIG has a higher aver-
age Spearmanr metric than the other three baseline methods
across different Shapley Value conditions. It means that or-
der computed by SIG is closer to the player's actual Shapley
Value order. Therefore, we conclude a positive response to
Question 1. We also explore the robustness of SIG against
(a)
(b)
Figure 4: Average 1-Spearmanr metric of four baseline
methods in GridWorld. (a), (b) denote the impacts of hyter-
parameters N with fixed Q 40% and Q with fixed N 200
respectively in a 2×2 GridWorld. (Details are documented
in the Appendix)
hyperparameters. Fig. 4 illustrates the performance of the
four methods against different hyperparameter settings in a
2 × 2 GridWorld. It's obvious that SIG is sensitive to neither
hyperparameters Q nor N , which shows robustness of SIG.
In addition, Fig. 3 demonstrates that the variance of SIG is
lower than other three baseline methods, which is another
proof of SIG's robustness.
Performance of Explanation
In this experiment, we seek for an answer to Question 2
by employing human intuition and quantitative metrics to
evaluate algorithmic performance. Specifically, in the Ex-
pression Code Task, since the dataset provided by the pri-
vate data source is not sufficient for quantitative analysis,
we measure the performance of methods according to hu-
man intuition. In the Image Classification Task, we leverage
both human intuition and quantitative metrics.
Figure 5: Saliency map of four baseline methods in Expres-
sion Code Task where red pixels indicate positive values,
while blue pixels denote negative values.
Expression Code Task To reduce computational over-
head, we treat an 80 × 80 pixel block as a single player
and use SIG to construct the baseline set. To further clarify
the explanation, we divide the pixels into positive and neg-
randomSIG(ours)zeromean0.00.20.40.60.81.0randomSIG(ours)zeromean0.00.20.40.60.81.0randomSIG(ours)zeromean0.00.20.40.60.81.0randomSIG(ours)zeromean0.00.20.40.60.81.050100150200250300sample_num0.00.20.40.60.81.01 - spearmanrmethodrandomSIG(ours)zeromean0.30.40.5proportion0.00.20.40.60.81.01 - spearmanrmethodrandomSIG(ours)zeromeanRandomSIG (ours)ZeroMeanRandomSIG (ours)ZeroMeanative pixels. Positive pixels help to reduce the distance be-
tween two images (values > 0), while negative pixels help
to widen this gap (values < 0).
As is shown in Fig. 5, compared with the other three coun-
terparts, SIG method is able to pay more attention to human
facial features, such as eyes and lips, which is in good agree-
ment with the first impression when human observe faces.
While both zero baseline and mean baseline methods can
identify these facial features, they often shift the focus to
other parts of the face, even regions outside the face bound-
ary. From human intuition perspective, SIG conveys more
explainable interpretations compared to the other three base-
line methods.
Figure 6: Saliency map of four baseline methods in Image
Classification Task. SIG method predominantly focuses on
bird, whereas other baseline methods divert their attention to
areas outside of the bird.
Figure 7: iAccuracy metric plots of four baseline methods in
Image Classification Task where x-axis signifies the number
of pixels removed, while y-axis denotes the iAccuracy met-
ric. We present the average value derived from 500 images,
along with its 0.95 confidence interval.
Image Classification Task In this experiment, the base-
line method generates feature contributions for each output
neuron of the model (i.e., each class). We choose the class
with the highest probability to reduce computational cost.
The rest of the configuration is in line with that in the Ex-
pression Code Task.
We consider iAccuracy metric adapted from Li et al.
(2020) as a quantitative metric to highlight the impact of
features on model predictions. The iAccuracy metric specif-
ically means that we sort the contribution scores from high
to low and gradually remove pixels based on the sorted re-
sults to observe the accuracy of the model predictions. The
iAccuracy metric is defined as follows.
iAcc(L) =
1
L + 1
L
(cid:88)
(
k=0
1F (x0)=F (xk))
where xk is noted as the image x0 removing the top k pixels
attributed by the baseline methods. We carried out exper-
iments on 500 images. An extended discussion about more
images is presented in the Appendix. As illustrated in Fig. 6,
SIG emphasizes the silhouette of the bird, which aligns with
human instinct. While the zero and mean baselines can also
pinpoint the bird's silhouette, they additionally highlight ar-
eas outside the silhouette. Furthermore, as depicted in Fig. 7,
the impact of removing top features selected by our SIG is
close to that of the mean and zero baselines. From the ex-
perimental results performed on a broad spectrum of image
classification tasks, we find that SIG exhibits genericness to
data types or instances, and maintains consistency in terms
of explainability across a wide scope of tasks. Based on the
intuitive image interpretation performance and quantitative
analysis in the above two tasks, we can respond with a 'yes'
to Question 2.
Overall, by exploring the answers to Question 1 and Ques-
tion 2, we experimentally verified the abilities of SIG: im-
proved explainability, generic to data types or instances, and
consistent interpretability across application domains.
VI. Conclusion and Discussion
In this work, we rethink baseline of Integrated Gradients
(IG) from the perspective of Shapley Value. We observe
and theoretically analyse that IG can be viewed as Auman-
Shapley Value under certain assumptions. Specifically, a
set of baseline aligns with the coalitions in Shapley Value,
thus tackleing the challenges of exploiting single baselines.
Therefore, we propose a novel baseline construction method
SIG, which is a hybrid of the IG and Shapley Value that pro-
vides an improved, generic, and consistent explanation com-
pared to existing baseline methods for IG. The time com-
plexity is mainly dominated two iterations of sampling from
coalitions, leading to O(n2).
Nevertheless, there remains intriguing challenges that de-
serve further research. For example, our current creation of
players using patches of pixels method is slightly coarse
(Ren et al. 2021); the method for fitting Shapley Value
proportions exhibits considerable randomness (Ando and
Takase 2020); timing performance can be further enhanced
(Chen et al. 2023). Addressing these issues is an important
goal for our ongoing and future research.
Molnar (2020) argues that the difference of the predicted value
after removing the feature may not fully depict the Shapley Value.
RandomSIG (ours)ZeroMean0100200300400500600700800remove patches0.00.20.40.60.81.0accuracymethodrandomSIG(ours)zeromeanReferences
Aas, K.; Jullum, M.; and Løland, A. 2021. Explaining in-
dividual predictions when features are dependent: More ac-
curate approximations to Shapley values. Artificial Intelli-
gence, 298: 103502.
Adadi, A.; and Berrada, M. 2018. Peeking inside the black-
box: a survey on explainable artificial intelligence (XAI).
IEEE access, 6: 52138–52160.
Ancona, M.; Ceolini, E.; ̈Oztireli, C.; and Gross, M. 2017.
Towards better understanding of gradient-based attribu-
arXiv preprint
tion methods for deep neural networks.
arXiv:1711.06104.
Ancona, M.; Oztireli, C.; and Gross, M. 2019. Explaining
deep neural networks with a polynomial time algorithm for
shapley value approximation. In International Conference
on Machine Learning, 272–281. PMLR.
Ando, K.; and Takase, K. 2020. Monte Carlo algorithm for
calculating the Shapley values of minimum cost spanning
tree games. Journal of the Operations Research Society of
Japan, 63(1): 31–40.
Angelov, P.; and Soares, E. 2020. Towards explainable deep
neural networks (xDNN). Neural Networks, 130: 185–194.
Arrieta, A. B.; D ́ıaz-Rodr ́ıguez, N.; Del Ser, J.; Bennetot, A.;
Tabik, S.; Barbado, A.; Garc ́ıa, S.; Gil-L ́opez, S.; Molina,
D.; Benjamins, R.; et al. 2020. Explainable Artificial In-
telligence (XAI): Concepts, taxonomies, opportunities and
challenges toward responsible AI. Information fusion, 58:
82–115.
Aumann, R. J.; and Shapley, L. S. 1974. Values of Non-
Atomic Games. Princeton University Press.
Aumann, R. J.; and Shapley, L. S. 2015. Values of non-
atomic games. Princeton University Press.
Binder, A.; Montavon, G.; Lapuschkin, S.; M ̈uller, K.-R.;
and Samek, W. 2016. Layer-wise relevance propagation for
neural networks with local renormalization layers. In Inter-
national Conference on Artificial Neural Networks, 63–71.
Springer.
Chen, H.; Covert, I. C.; Lundberg, S. M.; and Lee, S.-I. 2023.
Algorithms to estimate Shapley value feature attributions.
Nature Machine Intelligence, 1–12.
Chen, H.; Lundberg, S.; and Lee, S.-I. 2021. Explaining
models by propagating Shapley values of local components.
In Explainable AI in Healthcare and Medicine, 261–270.
Springer.
Chen, H.; Lundberg, S. M.; and Lee, S.-I. 2022. Explaining
a series of models by propagating Shapley values. Nature
communications, 13(1): 4512.
Dabkowski, P.; and Gal, Y. 2017. Real time image saliency
for black box classifiers. Advances in neural information
processing systems, 30.
Das, A.; and Rad, P. 2020. Opportunities and challenges
in explainable artificial intelligence (xai): A survey. arXiv
preprint arXiv:2006.11371.
Deng, J.; Dong, W.; Socher, R.; Li, L.-J.; Li, K.; and Fei-
Imagenet: A large-scale hierarchical image
Fei, L. 2009.
database. In 2009 IEEE conference on computer vision and
pattern recognition, 248–255. Ieee.
Duell, J.; Fan, X.; Fu, H.; and Seisenberger, M. 2023. Batch
Integrated Gradients: Explanations for Temporal Electronic
In International Conference on Artificial
Health Records.
Intelligence in Medicine, 120–124. Springer.
Enguehard, J. 2023. Sequential Integrated Gradients: a sim-
ple but effective method for explaining language models.
arXiv preprint arXiv:2305.15853.
Feng, T.; Zhou, Z.; Tarun, J.; and Nair, V. N. 2022. Com-
paring Baseline Shapley and Integrated Gradients for Lo-
cal Explanation: Some Additional Insights. arXiv preprint
arXiv:2208.06096.
Frye, C.; de Mijolla, D.; Begley, T.; Cowton, L.; Stanley,
M.; and Feige, I. 2020. Shapley explainability on the data
manifold. arXiv preprint arXiv:2006.01272.
Gauthier, T. D. 2001. Detecting trends using Spearman's
rank correlation coefficient. Environmental forensics, 2(4):
359–362.
Interpretation
Ghorbani, A.; Abid, A.; and Zou, J. 2019.
In Proceedings of the AAAI
of neural networks is fragile.
conference on artificial intelligence, volume 33, 3681–3688.
Ghorbani, A.; and Zou, J. 2019. Data shapley: Equitable val-
uation of data for machine learning. In International Con-
ference on Machine Learning, 2242–2251. PMLR.
Gunning, D.; and Aha, D. 2019. DARPA's explainable artifi-
cial intelligence (XAI) program. AI magazine, 40(2): 44–58.
He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Deep resid-
In Proceedings of the
ual learning for image recognition.
IEEE conference on computer vision and pattern recogni-
tion, 770–778.
Heskes, T.; Sijben, E.; Bucur, I. G.; and Claassen, T. 2020.
Causal shapley values: Exploiting causal knowledge to ex-
plain individual predictions of complex models. Advances
in neural information processing systems, 33: 4778–4789.
Jha, A.; K Aicher, J.; R Gazzara, M.; Singh, D.; and Barash,
Y. 2020. Enhanced integrated gradients: improving inter-
pretability of deep learning models using splicing codes as a
case study. Genome biology, 21(1): 1–22.
Kumar, I. E.; Venkatasubramanian, S.; Scheidegger, C.; and
Friedler, S. 2020. Problems with Shapley-value-based ex-
planations as feature importance measures. In International
Conference on Machine Learning, 5491–5500. PMLR.
Li, X.-H.; Shi, Y.; Li, H.; Bai, W.; Song, Y.; Cao,
C. C.; and Chen, L. 2020. Quantitative evaluations on
saliency methods: An experimental study. arXiv preprint
arXiv:2012.15616.
Lundberg, S. M.; and Lee, S.-I. 2017. A unified approach
to interpreting model predictions. Advances in neural infor-
mation processing systems, 30.
Merrick, L.; and Taly, A. 2020. The explanation game:
Explaining machine learning models using shapley val-
In International Cross-Domain Conference for Ma-
ues.
chine Learning and Knowledge Extraction, 17–38. Springer.
Mitchell, R.; Cooper, J.; Frank, E.; and Holmes, G. 2022.
Sampling permutations for shapley value estimation. The
Journal of Machine Learning Research, 23(1): 2082–2127.
Interpretable machine learning. Lulu.
Molnar, C. 2020.
com.
Mudrakarta, P. K.; Taly, A.; Sundararajan, M.; and Dhamd-
here, K. 2018. Did the model understand the question? arXiv
preprint arXiv:1805.05492.
Pourdarbani, R.; Sabzi, S.; Nadimi, M.; and Paliwal, J.
2023.
Interpretation of Hyperspectral Images Using Inte-
grated Gradients to Detect Bruising in Lemons. Horticul-
turae, 9(7): 750.
Ras, G.; Xie, N.; Van Gerven, M.; and Doran, D. 2022. Ex-
plainable deep learning: A field guide for the uninitiated.
Journal of Artificial Intelligence Research, 73: 329–396.
Ren, J.; Zhou, Z.; Chen, Q.; and Zhang, Q. 2021. Towards
a Game-Theoretic View of Baseline Values in the Shapley
Value.
Shapley, L. S. 1951. Notes on the n-Person Game-II: The
Value of an n-Person Game.(1951). Lloyd S Shapley.
Shrikumar, A.; Greenside, P.; and Kundaje, A. 2017. Learn-
ing important features through propagating activation dif-
ferences. In International conference on machine learning,
3145–3153. PMLR.
Simonyan, K.; Vedaldi, A.; and Zisserman, A. 2013.
Deep inside convolutional networks: Visualising image
arXiv preprint
classification models and saliency maps.
arXiv:1312.6034.
Sundararajan, M.; and Najmi, A. 2020. The many Shapley
values for model explanation. In International conference
on machine learning, 9269–9278. PMLR.
Sundararajan, M.; Taly, A.; and Yan, Q. 2017. Axiomatic
attribution for deep networks. In International conference
on machine learning, 3319–3328. PMLR.
Sutton, R. S.; and Barto, A. G. 2018. Reinforcement learn-
ing: An introduction. chapter 3.7.
Tan, H. 2023. Maximum entropy baseline for integrated gra-
In 2023 International Joint Conference on Neural
dients.
Networks (IJCNN), 1–8. IEEE.
Yang, R.; Wang, B.; and Bilgic, M. 2023. IDGI: A Frame-
work to Eliminate Explanation Noise from Integrated Gradi-
ents. In Proceedings of the IEEE/CVF Conference on Com-
puter Vision and Pattern Recognition, 23725–23734.
Zhang, W.; Ji, X.; Chen, K.; Ding, Y.; and Fan, C. 2021.
Learning a facial expression embedding disentangled from
In Proceedings of the IEEE/CVF conference on
identity.
computer vision and pattern recognition, 6759–6768.
Technical Appendix
Details of the Theory
Notations. Table 1 summarizes the detailed notations used
in the "Method" section.
Symbol
Meaning
x
x′
xi
r1, r2
S1, S2
v()
F ()
t
I
N
S
i
Vi(S)
wi(S)
k
ˆw(k)
D
A
V
The sample to explain
The baseline sample for IG
The ith feature/player of x
Players of x′
Players of x
The utility function of SV
The model/function to explain and evaluate
A scalar value indicates a proportion
A general complete set
The set of all players in a game
A coalition in a game
The indicator of the player of interest
The marginal contribution of xi to S
The weight of Vi(S)
A scalar value of the size of S
The normalized w(k)
The random sampled basline set of SIG
A tensor of a mini-batch of IG results
A tensor of the approximated SV result
Table 1: Notations of Method Section
Proof. We prove that our proposed proportional sam-
pling is an unbiased estimator of the true Shapley Value. Let
f P S
SV (xi) denote the estimated Shapley Value of xi computed
leveraging proportional sampling. pi(S) is the probability of
S being sampled. Vi(S) is the marginal contribution. Ck is
the value of (cid:0)|N |−1
(cid:1). Then pi(S) = 1
1
.
N ×Ck
Suppose we sampled for M times S based on probability
function pi(S),
|N | pi(k) =
k
(cid:88)
pi(S)Vi(S)
(cid:88) 1
|N |
(cid:88) 1
|N |
N −1
(cid:88)
k=0
N −1
(cid:88)
k=0
(cid:88) (cid:88)
S∈N/{i}
pi(k)Vi(S; |S| = k)
Ck(cid:88)
Vi(Sj)
1
Ck
j=0
1
|N | × Ck
Vi(S)
E(f P S
SV (xi)) =
=
=
=
=
1
M
1
M
1
M
1
M
1
M
(cid:88)
1 *
(cid:88)
wi(S)Vi(S)
S∈N/{i}
wi(S)Vi(S)) = E(fSV (xi))
= E(
(cid:88)
S∈N/{i}
Algorithms. Although we provided the algorithm of gen-
eral Shapley Intergratd Gradients (SIG) in the main paper.
We made small adjustments to it when applying it to game
data and image data respectively. Game Data. Sampling
from all coalitions can be time-consuming, and at times, it
might even seem infeasible in actual cases. Therefore, we
initially randomly sample a proportion Q of coalitions. From
this subset, we then sample N baselines. Image Data. Direct
computation for each pixel is nearly unfeasible. To simplify
the process, we consider an area of M × N pixels as a sin-
gle player, thereby streamlining the computation of contri-
butions.
Experimental Design
Reward settings in the GridWorld In the GridWorld en-
vironment, two types of reward functions are utilized. The
first reward is denoted by r1, which is -1 for each step taken
by the agent before it reaches the end position, and +1 when
it reaches the end position. The second reward function r2
works as follows:
• For every step taken by the agent before it reaches the ter-
mination position for the first time, a -1 reward is given.
• On reaching the termination position for the first time,
the agent is awarded a +1 reward.
• Subsequent to the agent's initial arrival at the termination
position:
– -0.5 reward is given for each step if the agent does not
reach the termination position.
– +1.5 reward is granted if the agent reaches the termi-
nation position again.
Shapley Value computes the marginal contribution of play-
ers based on combinations of players. In contrast, our re-
ward function addresses permutations. We define the reward
function of a combination S to be the maximum reward as-
sociated with any permutation P within combination S, i.e.,
v(S) = max v(P ), P ∈ S. These two reward function are
employed in both 2 × 2 GridWorld and 2 × 3 GrdiWorld,
resulting in Shapley Value shown in Fig. 8.
Since reward functions are often not compatible with
Deep Neural Networks (DNN). To address this, we utilize
trained deep neural networks as a substitute for the reward
functions. In detail, we take coalitions with one-hot encod-
ing as samples, and regard output of reward function as la-
bel. To evaluate performance of trained DNN model, we
replace reward function with DNN in the computation of
Shapley Value to assess the DNN's ability to emulate the
reward function. We present one representative example to
demonstrate that the DNN can accurately emulate the Shap-
ley Value. Our trained DNN can seamlessly replace the util-
ity function, producing Shapley Values that are nearly iden-
tical. Further details can be found in the accompanying code.
Models
GridWorld For the experiments conducted in GridWorld,
we employ a fully connected network that comprises one
hidden layer with 64 neurons and another hidden layer with
32 neurons.
Figure 8: Evaluation of DNN. We replace reward function
with DNN in the computation of Shapley Value to assess the
DNN's ability to emulate the reward function. Subfigures
a and b represent 2 × 2 GridWorld with reward function
r1 and r2 respectively. Subfigures c and d represents 2 × 3
GridWorld with reward function r1 and r2 respectively.
Expression Code Task For the experiments conducted in
Expression Code Tasks, we utilize DLN model and a private
dataset.
Image Classification Task For the experiments conducted
in Image Classification Task, we apply Resnet model built in
Pytorch and ImageNet dataset.
Supplementary Results
Running Time
In Image Classification Tasks, we further
evaluate the running time of the baseline methods. As de-
picted in Fig. 9, the running time of our SIG closely mirrors
that of the zero and mean baselines, outperforming the ran-
dom baseline. Additionally, while the variance in running
time for our SIG is slightly greater than that of the zero and
mean baselines initially, it reduces as the number of images
increases. This can mainly be attributed to ResNet's capa-
bility to handle batch operations, which results in similar
running times.
While for GridWorld, where the computation of the Shap-
ley Value doesn't support batch operation, there's a signifi-
cant increase in running time, as reflected in Table 2, our
SIG's running time is notably higher than that of the other
baselines since our SIG iterates baseline one by one.
GridWorld We delve into the effects of hyperparameters
across different GridWorld environments. The influence of
hypermeters N with fixed Q 40% is depicted in Fig. 10. Fur-
ther details can be found in our codes. The outcomes indicate
that our SIG displays impressive robustness across various
Shapley Value cases for N .
Figure 9: Running time of baseline methods with ResNet
model and ImageNet dataset. Subfigures a, b, c and d repre-
sent running time over 300, 500, 800, 1000 images respec-
tively.
Environment Reward
Q
N
Random SIG (ours)
2 × 2
2 × 3
r1
r2
r1
r2
40% 200
40% 1500
4.59s
4.59s
4.59s
4.59s
55.05s
55.07s
91.79s
91.77s
Zero Mean
4.59s
4.59s
4.59s
4.59s
4.59s
4.57s
4.59s
4.59s
Table 2: Running time of each baseline method. The unit of
running time is second (s). We take one example to explain
that running time of our SIG is quite longer than other three
baselines since GridWorld doesn't support batch operation.
Figure 10: Average 1-Spearmanr metric for hypterparame-
ters N across four GridWorld situations with fixed Q 40%.
Subfigures a and b represent 2 × 2 GridWorld with reward
function r1 and r2 respectively. Subfigures c and d represent
2 × 3 GridWorld with reward function r1 and r2 respec-
tively.
TextFigure 11: Average 1-Spearmanr metric for hypterparame-
ters Q across four GridWorld situations. Subfigures a and b
represents 2 × 2 GridWorld with reward function r1 and r2
respectivel under fixed N 200. Subfigures c and d represents
2 × 3 GridWorld with reward function r1 and r2 respectively
under fixed N 1500.
Figure 13: Accuracy metric over ImageNet for Resnet
Model across various patches. Subfigures a, b, c, and d cor-
respond to 0, 1, 2, 3 patches under 1000 images respectively.
baseline methods
Moreover, people tend to classify one image based on ar-
eas, like heads, bodies, legs, rather than individual pixels.
Given this, we are curious to see if pixels around important
pixels identified by our SIG align with human intuition. To
assess this, we opt to remove patches rather than individual
pixels. Patch n is defined as areas of size (n + 1) × (n + 1)
centered on important pixels. As shown in Fig. 13, we find
that important pixels pinpointed by baseline methods are in
alignment with our human intuition. Additionally, our SIG
exhibits performance almost to both zero and mean baseline
methods. For more details, please refer to the code we have
provided.
Figure 12: Accuracy metric over ImageNet for Resnet
Model. a, b and c represent accuracy metrics of 500, 1000,
1500 images respectively.
The impact of hypermeters Q is shown in Fig. 11. Further
details can be found in code. The experiment reveals that our
SIG consistently exhibits notable robustness with respect to
Q.
Image Classification Task We further explore the accu-
racy metric of our SIG with lots of images in the Image Clas-
sification Task. Results are presented in Fig. 12. It's evident
that our SIG has almost same performance to zero and mean
|
|
http://arxiv.org/abs/2310.04816v1 | "2023-10-07T14:13:14" | "2023-10-07T14:13:14" | Hacking Generative Models with Differentiable Network Bending | In this work, we propose a method to 'hack' generative models, pushing their
outputs away from the original training distribution towards a new objective.
We inject a small-scale trainable module between the intermediate layers of the
model and train it for a low number of iterations, keeping the rest of the
network frozen. The resulting output images display an uncanny quality, given
by the tension between the original and new objectives that can be exploited
for artistic purposes. | [
"Giacomo Aldegheri",
"Alina Rogalska",
"Ahmed Youssef",
"Eugenia Iofinova"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04816v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04816v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.AI",
"cs.LG",
"I.2.6; I.2.10"
] | 3
2
0
2
t
c
O
7
]
V
C
.
s
c
[
1
v
6
1
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Hacking Generative Models with Differentiable
Network Bending
Giacomo Aldegheri∗
University of Amsterdam
Alina Rogalska†
Independent
Researcher
Ahmed Youssef†
University of
Cincinnati
Eugenia Iofinova†
IST Austria
Abstract
In this work, we propose a method to 'hack' generative models, pushing their
outputs away from the original training distribution towards a new objective. We
inject a small-scale trainable module between the intermediate layers of the model
and train it for a low number of iterations, keeping the rest of the network frozen.
The resulting output images display an uncanny quality, given by the tension
between the original and new objectives that can be exploited for artistic purposes.
Project website: https://galdegheri.github.io/diffbending/.
Figure 1: Example outputs, using a variety of loss functions and bending modules. See Appendix B
for the corresponding prompts and more examples.
1
Introduction
Systems that fail to perform their intended task, or that are repurposed for new tasks, have long been
recognized for their subversiveness and creative potential. Glitch artists [1] explore the aesthetic
properties of media malfunctions, while hackers [2] take pleasure in the challenge of pushing existing
hardware and software beyond its intended function [3]. In this work, we hack existing generative
models to generate images they were not originally trained for. We adapt network bending [4], a
technique consisting of injecting a transformation between intermediate layers of a generator, by
making the transformation (the bending module, BM) differentiable. The images generated by these
∗Correspondence to giacomo.aldegheri@gmail.com
†These authors contributed equally.
Preprint. Under review.
hacked models are a blend of the objects that the original model was trained to generate (butterflies)
and new visual features introduced by the BMs. We find that they exhibit an uncanny quality that can
be exploited for creative purposes, similar to glitch art's use of unintended media artifacts.
Our method, thanks to its low computational cost, is accessible to a wide variety of artists and
practitioners. Unlike current state of the art text-to-image pipelines, which aim to generate perfect-
looking images, it provides a tool to explore strange and unexpected variations of existing models.
2 Method
Figure 2: Overview of our proposed method. The BM takes the activation map of any chosen layer as
input, and outputs a 'bent' activation map (shown in orange) which is fed as an input to the subsequent
layers.
Architecture. The differentiable BM can be injected after any layer of a generator network. Here
we use a lightweight GAN based on the architecture in [5] and trained on a dataset of butterfly
images3. We chose a model trained on a narrow domain of images in order to be able to clearly
distinguish the effect of the BM from the model's original structure. Specifically, in our outputs
the outline of the butterfly remains visible to varying degrees depending on the specific BM used.
The BM takes as input the activation map of the chosen layer, and outputs a tensor of the same
dimensionality. We use a variety of small-scale network architectures for our BMs (see Appendix
for architectural details): (1) Convolutional: a plain convolutional neural network (CNN), using
either ReLU (x) or sin(x) as an activation function. (2) Convolutional + Coordinates: a CNN with
spatial coordinates (x, y and optionally r, the distance from the center) concatenated with the input
features. This allows the BM to generate spatially-varying structures. (3) Convolutional + Sorting:
a differentiable sorting network [6], operating across the width and/or height of the input feature map,
followed by a CNN. This allows the BM to rearrange the spatial structure of the input activation map.
Loss function. While the differentiable BM can be trained with any objective, here we experiment
with two loss functions. The first one is the squared great circle distance between the CLIP [7]
embeddings of the output images and of a user-provided prompt, to generate semantically evocative
images. The second one is a loss function that minimizes the distance between images and prompt in
CLIP space, while maximizing the distance among different images in the batch, to increase output
diversity in a semantically meaningful space. Following the approach of [8], we use the InfoNCE [9]
contrastive objective to maximize the mutual information between image and caption embeddings,
while minimizing that among images in the batch, as expressed by the following equation:
LN CE = log
e(Q*K+/τ )
e(Q*K+/τ ) + (cid:80)
K− e(Q*K−/τ )
Where Q is the image embedding, K + the prompt embedding, K − are the embeddings of the other
images in the batch, and τ is a temperature hyperparameter.
3 Ethical Implications
The work was done entirely on open-source or publicly available models and data. In particular,
we avoided, as much as possible, the use of tools and data that use the uncompensated work of
3This model is available at https://huggingface.co/ceyda/butterfly_cropped_uniq1K_512.
2
zBENDING MODULE"3D rendering of ghost eating pomegranate"LOSSBent activation tensor(traditional) artists. The only possible exception is the use of the pretrained CLIP model, for which
we were not aware of alternatives.
Further, since our method provides only a very coarse control of the output, we do not believe that it
aids the creation of works that break copyright or produce obscene or incendiary images, over what is
already available.
References
[1] Rosa Menkman. Glitch studies manifesto. Video vortex reader II: Moving images beyond
YouTube, pages 336–347, 2011.
[2] Jon Erickson. Hacking: the art of exploitation. No starch press, 2008.
[3] Zack Kotzer. A catalogue of all the devices that can somehow run 'Doom'. VICE, May
2016 (Accessed 20 September 2023). URL https://www.vice.com/en/article/qkjv9x/
a-catalogue-of-all-the-devices-that-can-somehow-run-doom.
[4] Terence Broad, Frederic Fol Leymarie, and Mick Grierson. Network bending: Expressive
manipulation of deep generative models. In Artificial Intelligence in Music, Sound, Art and
Design: 10th International Conference, EvoMUSART 2021, Held as Part of EvoStar 2021,
Virtual Event, April 7–9, 2021, Proceedings 10, pages 20–36. Springer, 2021.
[5] Bingchen Liu, Yizhe Zhu, Kunpeng Song, and Ahmed Elgammal. Towards faster and stabilized
In International Conference on
GAN training for high-fidelity few-shot image synthesis.
Learning Representations, 2020.
[6] Felix Petersen, Christian Borgelt, Hilde Kuehne, and Oliver Deussen. Monotonic differentiable
In International Conference on Learning Representations, 2022. URL
sorting networks.
https://openreview.net/forum?id=IcUWShptD7d.
[7] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal,
Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual
models from natural language supervision. In International conference on machine learning,
pages 8748–8763. PMLR, 2021.
[8] Yingchen Yu, Fangneng Zhan, Rongliang Wu, Jiahui Zhang, Shijian Lu, Miaomiao Cui, Xuan-
song Xie, Xian-Sheng Hua, and Chunyan Miao. Towards counterfactual image manipulation
via CLIP. In Proceedings of the 30th ACM International Conference on Multimedia, pages
3637–3645, 2022.
[9] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive
predictive coding. arXiv preprint arXiv:1807.03748, 2018.
[10] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint
arXiv:1412.6980, 2014.
3
Acknowledgments
We would like to thank Viorica Patraucean, Razvan Pascanu, and the entire staff of the Eastern
European Machine Learning Summer School '22 for bringing us together, and Viorica in particular
for her support in getting this project off the ground. We would also like to thank Piotr Mirowski
for his advice and feedback on our early ideas, and the former members of the project for their
enthusiasm and ideas in the brainstorming sessions. In particular, Ivan Vrkic, for setting up the initial
Google Colab environment.
A Network architecture and training
The BMs can be applied at any layer of a generator network. In all experiments reported here, we
keep this fixed to the 6th layer (for the convolutional BMs) and to the 4th layer (for the Convolutional
+ Sorting BM) of the ButterflyGAN generator. These layers have 64 and 256 channels, respectively.
However, we encourage users to experiment with applying the BMs to different layers.
All the BMs used here share a basic CNN architecture, comprising two convolutional layers with
3x3 kernels, 'same' padding (to keep the size of the output the same as the input) and a number of
input, hidden and output channels equal to those of the chosen layer's activation map. The activation
function (ReLU (x) or sin x is applied after the first convolutional layer. In the coordinate-aware
BM, the x and y coordinates indicating locations on the activation map (scaled between 0 − 1) are
concatenated with the input features along the channel dimension. The Convolutional + Sorting
BM comprises a CNN that assigns scores to each row of the activation map, followed by a Bitonic
differentiable sorting layer [6], with a steepness hyperparameter fixed at 50, that sorts these scores in
increasing order. The permutation matrix generated by the sorting layer is then used to reorder the
input activation map along the chosen dimension (width or height). The sorting network is followed
by a standard convolutional BM.
All networks are trained for a fixed number of 1000 iterations, with batch size 16, using the Adam [10]
optimizer with a learning rate of 1e−3. Training takes around 3 minutes on a single NVIDIA GeForce
RTX 3080 Ti.
B Sample outputs for a range of queries
In the next pages, we present the first 16 example outputs (not filtered, sorted, or cherry-picked in any
way) for a range of prompts and training configurations.
4
Figure 3: First 16 outputs for the prompt "Psychedelic painting of a multi-armed deity" using the
vanilla convolutional BM and standard CLIP loss.
5
Figure 4: First 16 outputs for the prompt "Inflatable plastic bodybuilder in a colorful album cover
painted by Magritte" using the coordinates-aware BM and InfoNCE loss.
6
Figure 5: First 16 outputs for the prompt "Hieronymus Bosch particle system rendered in Blender"
using the coordinates-aware BM and InfoNCE loss.
7
Figure 6: First 16 outputs for the prompt "A colorful tree on a blue sky painted by Cézanne", using
the Convolutional + Sorting BM and InfoNCE loss.
8
Figure 7: First 16 outputs for the prompt "Brutalist anime robot", using the Convolutional + Sorting
BM and InfoNCE loss.
9
C Role of InfoNCE loss
In this section, we compare model outputs with a BM trained with the standard CLIP [7] loss (squared
great circle distance between embeddings of the image and caption) and with our novel contrastive
loss, based on InfoNCE [9], which maximizes the similarity (mutual information) between image
and caption embeddings while minimizing that among different images in a batch, to encourage
output diversity. These outputs were generated using the coordinates-aware BM, and noise vectors
generated using the same random seeds were fed to the two models, for a more direct comparison.
The temperature τ for the InfoNCE loss was set at 0.001.
We can observe that the InfoNCE-generated outputs tend to be more diverse, with several different
color combinations and textures, while the standard CLIP outputs tend to be more uniform and to
have a smoother quality. These different losses can be used to achieve different artistic effects.
Figure 8: Example outputs of a coordinates-aware BM with the standard CLIP loss (top) and InfoNCE
loss (bottom). The prompt was "Inflatable plastic bodybuilder in a colorful album cover painted by
Magritte".
10
Figure 9: Example outputs of a coordinates-aware BM with the standard CLIP loss (top) and InfoNCE
loss (bottom). The prompt was "A gang of biker pumpkins painted by Jan van Eyck".
11
D Role of spatial coordinates
In this section, we showcase the difference between the coordinates-aware BM, in which x and
y spatial coordinates are concatenated to the activation map, and the vanilla convolutional BM.
Examples of the two models, for prompts that involve spatial structure, are shown in the figure below.
From a qualitative inspection, we can see that the coordinates-aware BM segments different areas
of the image more clearly, while the vanilla BM tends to mix different colors together. Somewhat
surprisingly, the coordinates-aware BM does not generate the global spatial structure that would be
expected given the prompt, such as the three vertical sections of the French flag and the sky being
positioned above the landscape.
Figure 10: Example outputs of a BM with (left) and without (right) spatial coordinates. The prompts
were, from top to bottom, "French flag", "Green landscape and blue sky", and "Water and oil".
12
|
|
http://arxiv.org/abs/2310.04815v1 | "2023-10-07T14:12:15" | "2023-10-07T14:12:15" | Critique Ability of Large Language Models | Critical thinking is essential for rational decision-making and
problem-solving. This skill hinges on the ability to provide precise and
reasoned critiques and is a hallmark of human intelligence. In the era of large
language models (LLMs), this study explores the ability of LLMs to deliver
accurate critiques across various tasks. We are interested in this topic as a
capable critic model could not only serve as a reliable evaluator, but also as
a source of supervised signals for model tuning. Particularly, if a model can
self-critique, it has the potential for autonomous self-improvement. To examine
this, we introduce a unified evaluation framework for assessing the critique
abilities of LLMs. We develop a benchmark called CriticBench, which comprises
3K high-quality natural language queries and corresponding model responses; and
annotate the correctness of these responses. The benchmark cover tasks such as
math problem-solving, code completion, and question answering. We evaluate
multiple LLMs on the collected dataset and our analysis reveals several
noteworthy insights: (1) Critique is generally challenging for most LLMs, and
this capability often emerges only when models are sufficiently large. (2) In
particular, self-critique is especially difficult. Even top-performing LLMs
struggle to achieve satisfactory performance. (3) Models tend to have lower
critique accuracy on problems where they are most uncertain. To this end, we
introduce a simple yet effective baseline named self-check, which leverages
self-critique to improve task performance for various models. We hope this
study serves as an initial exploration into understanding the critique
abilities of LLMs, and aims to inform future research, including the
development of more proficient critic models and the application of critiques
across diverse tasks. | [
"Liangchen Luo",
"Zi Lin",
"Yinxiao Liu",
"Lei Shu",
"Yun Zhu",
"Jingbo Shang",
"Lei Meng"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04815v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04815v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
5
1
8
4
0
.
0
1
3
2
:
v
i
X
r
a
CRITIQUE ABILITY OF LARGE LANGUAGE MODELS
Liangchen Luo†∗ Zi Lin‡ Yinxiao Liu† Lei Shu† Yun Zhu† Jingbo Shang‡ Lei Meng†∗
†Google Research ‡UC San Diego
ABSTRACT
Critical thinking is essential for rational decision-making and problem-solving.
This skill hinges on the ability to provide precise and reasoned critiques and is
a hallmark of human intelligence. In the era of large language models (LLMs),
this study explores the ability of LLMs to deliver accurate critiques across various
tasks. We are interested in this topic as a capable critic model could not only serve
as a reliable evaluator, but also as a source of supervised signals for model tun-
ing. Particularly, if a model can self-critique, it has the potential for autonomous
self-improvement. To examine this, we introduce a unified evaluation framework
for assessing the critique abilities of LLMs. We develop a benchmark called
CRITICBENCH, which comprises 3K high-quality natural language queries and
corresponding model responses; and annotate the correctness of these responses.
The benchmark cover tasks such as math problem-solving, code completion, and
question answering. We evaluate multiple LLMs on the collected dataset and
our analysis reveals several noteworthy insights: (1) Critique is generally chal-
lenging for most LLMs, and this capability often emerges only when models are
sufficiently large. (2) In particular, self-critique is especially difficult. Even top-
performing LLMs struggle to achieve satisfactory performance. (3) Models tend
to have lower critique accuracy on problems where they are most uncertain. To
this end, we introduce a simple yet effective baseline named self-check, which
leverages self-critique to improve task performance for various models. We hope
this study serves as an initial exploration into understanding the critique abilities
of LLMs, and aims to inform future research, including the development of more
proficient critic models and the application of critiques across diverse tasks.
1
INTRODUCTION
"Self-criticism is an art not many are qualified to practice." - Joyce Carol Oates
Large language models (LLMs) have demonstrated impressive capacities in a wide range of tasks
(Google et al., 2023; OpenAI, 2023). Consequently, the evaluation of LLMs has shifted focus from
basic sentence coherence to more advanced capabilities, e.g., knowledge acquisition and logical rea-
soning (Hendrycks et al., 2021; BIG-Bench authors, 2023). One capability that is overlooked in
current evaluation frameworks is the ability of critical thinking, which is an important hallmark of
human intelligence that requires logic, reasoning, and knowledge. This ability ensures that LLMs
can provide precise and reasoned critiques towards model responses. A model with robust cri-
tique ability can identify potential misinformation, errors or context misalignment in model outputs,
thereby showing their specific shortcomings that can serve as a feedback for improvement. While
recent studies have used LLMs for various forms of critique across diverse applications (Madaan
et al., 2023; Saunders et al., 2022; Shinn et al., 2023), they primarily focus on advancing the state of
the art for specific tasks instead of providing a comprehensive assessment of critique ability.
To address this gap, we propose a standardized benchmark CRITICBENCH to assess the critique
abilities of LLMs in diverse tasks. We define a model's critique ability as "the capacity to identify
flaws in model responses to queries". Figure 1 provides an example of a flaw in the response to a
query, and how it is identified by a critique. The benchmark consists of query-response-judgment
triplets. During evaluation, we always prompt a model to perform a chain-of-thought analysis to
∗Correspondence: {luolc,leimeng}@google.com.
1
Figure 1: An example from CRITICBENCH is presented. The query originates from GSM8K (Cobbe
et al., 2021), and the response is generated by PaLM-2-L (Google et al., 2023). A flaw in the
response is highlighted in red. The model shows low confidence in this query, as evidenced by a
certainty score of only 0.11. Below the dashed line, a critique is generated by few-shot prompting
PaLM-2-L. It successfully identifies the flaw in the response and makes an accurate judgment. As
the policy model and critic model are the same, this example also serves as an instance of self-
critique.
identify flaws and explain the reason; and then provide a final judgment on the response's correct-
ness. Comparing this judgment to ground-truth labels allows us to explicitly evaluate a model's
critique accuracy and implicitly assess its analytical process toward an accurate judgment.
To construct CRITICBENCH (Section 3), we gather natural language queries from multiple scientific
benchmarks, covering tasks like math problem-solving (Cobbe et al., 2021), code completion (Chen
et al., 2021), and question answering (Lin et al., 2021). We employ PaLM-2 models (Google et al.,
2023) of various sizes to generate responses, which are then annotated for correctness. To ensure
data quality, a complexity-based selection strategy (Fu et al., 2023b) is used to identify high-quality
responses among the candidates. Furthermore, to select queries of suitable difficulty, we introduce
an auxiliary metric that quantifies a model's certainty regarding a query. Such a metric can help
select queries that poses a moderate level of challenge to models. As a result, we collect 3K high-
quality examples from an initial pool of 780K candidates to form the benchmark mixture. This data
collection method is both scalable and generalizable, requiring no extra human intervention and
suitable for a variety of tasks.
Given CRITICBENCH, we can now analyze the critique abilities of LLMs (Section 4). There are
specific aspects that particularly interest us. First, critique inherently involves logic, reasoning, and
knowledge, making it a complex process even for humans. Therefore, it is not clear how well LLMs
can emulate this capability. It is possible that critique ability is yet another emergent ability, i.e.,
ability not present in smaller-scale models that are present in larger-scale models (Jang, 2023). In-
vestigating how critique ability scales with model size could offer insights into model size selection
and whether fine-tuning is needed for smaller models (Section 4.1). Additionally, self-critique, i.e.,
when a model critiques its own outputs, is a format of critique of particular interest to us, as it is
relevant to a model's potential for self-improvement (Section 4.2). Finally, we are also interested in
what types of queries pose more challenges for LLMs to critique (Section 4.3).
To investigate these aspects, we evaluate various widely-used LLMs on CRITICBENCH and reveal
several intriguing findings: (1) Critique tasks pose a considerable challenge for LLMs. Only large-
scale models exhibit performance with a notable difference from a random guess baseline, indicating
that the capacity for critique serves as an emergent indicator of a capable LLM. (2) Self-critique,
i.e., a model critiquing its own output, is particularly difficult. Even the strongest LLMs struggle to
achieve satisfactory performance. (3) A challenging query is not only difficult for LLMs to directly
answer correctly, but also poses a challenge in assessing an answer's correctness to that query.
To this end, we also propose a simple yet effective baseline called self-check (Section 5). The basic
idea is to prompt the model to confirm the accuracy of their generated answers by self-critique before
presenting them. The method consistently enhances the baseline performance (Wang et al., 2023)
on math word problems across multiple models, achieving an average of 9.55% error reduction rate,
which demonstrates the potential utility of critiques from LLMs.
Our contributions are three-fold:
2
Query: Heather's razors come 4 to a pack and cost $4.00 a pack. They are currently on sale for buy one get one free. She also has a$2.00 coupon. How much will each individual razor cost, in cents, after the discount if she buys 2 packs of razors?Response: She bought 2 packs. Each pack has 4 razors, so in total she has 2 * 4 = 8 razors. Each pack costs $4. She has a coupon of$2. So she paid 2 * $4 - $2 = $6. Each razor costs $6/8 = $0.75. The answer is 75.Certainty Score: 0.11Correctness Rate: 0.93Analysis: The student correctly calculated the total cost of 2 packs of razors with the coupon. However, they didn't consider the factthat the second pack is free. So, Heather only paid for one pack, not two. Therefore, the cost per razor is $2 / 8 = $0.25. The answer isincorrect.Judgment: incorrect.• New Benchmark CRITICBENCH is the first benchmark that comprehensively assesses the cri-
tique abilities of LLMs across diverse tasks and scenarios, which fills a gap in the current LLM
evaluation framework by introducing this important ability.
• New Findings Our findings on CRITICBENCH underscore the nuances and depth of LLM's
critique abilities (Section 4). These revelations enhance our understanding of the inherent com-
plexities in LLMs and emphasize the need for advanced training and evaluation techniques.
• New Capacity The proposed self-check method (Section 5) not only advances the performance
on math word problems over the baseline, but also indicates the new capacity of critique ability
with LLMs, which is a fruitful avenue for LLM's self-improvement strategies.
2 DEFINITION OF CRITIQUE ABILITY
The concept of critique has diverse interpretations and is often applied informally in everyday con-
texts. Recent research employs large language models to offer critiques across multiple applica-
tions (Madaan et al., 2023; Paul et al., 2023; Saunders et al., 2022; Shinn et al., 2023), resulting
in varying formats and requirements for their "critiques". These studies primarily aim to enhance
performance in specific tasks, neglecting to clarify the meaning of the term critique. In this paper,
we consider the definition of a language model's critique ability as
the capacity to identify flaws in model responses to queries.
These flaws can differ depending on the task, ranging from incorrect reasoning or calculation in
mathematical problems to syntax errors in code completion.
When a model self-assesses its own outputs, we term this as self-critique, a notion that particu-
larly intrigues us. If models can engage in self-critique and reflection, they can potentially do self-
improvement, requiring minimal human intervention. On the risky side, this autonomy also raises
concerns about reduced human oversight (Bowman et al., 2022). Yet we posit that self-critique
may still remain a challenging capability for large language models, as a flaw-aware model would
logically not produce faulty output in the first place (Saunders et al., 2022).
3 CONSTRUCTION OF CRITICBENCH
As discussed in Section 2, prior research employs large language models to offer critiques, yet
requires particular process and formats to meet their task-specific objectives. Currently, there is no
standard or generalizable way to assess the critique abilities of language models across diverse tasks.
This section proposes CRITICBENCH, a unified, standardized evaluation framework to tackle this
issue. The framework aims to fulfill three criteria:
• Scalability Given the broad range of tasks already established within the community, and the
anticipation of more to emerge, a scalable data collection method is essential. The method should
minimize human annotation efforts and ideally be fully autonomous.
• Generalizability The framework should be task-agnostic, capable of generalizing across vari-
ous tasks and domains.
• Quality We believe quality matters more than quantity. When volume of data is substantial, we
prioritize selecting those that most effectively differentiate between stronger and weaker models.
The following subsections illustrate the detailed construction process. Specifically, Section 3.1
presents the initial data generation on three different tasks, where we get the collection of query-
response-judgment triplets as shown in Figure 1. Section 3.2 then shows how to select data based
on the initial collection to guarantee the quality of responses and queries.
3.1 DATA GENERATION
For the tasks of interest, we begin by employing existing scientific datasets from relevant domains.
These datasets are expected to include queries that large language models, which here we refer to as
generators, aim to respond.
To ensure scalability, it is essential to have an automated approach for assessing the correctness of a
model's responses. Classification tasks naturally meet this criterion, as model outputs can be auto-
3
matically compared to ground-truth labels. Similarly, tasks that involve auto-verifiable answers also
comply; for instance, in code completion tasks with unit tests available, the validity of the generated
code can be confirmed by passing all tests. For free-form generation tasks such as summarization
and translation, assessing the quality of a response remains non-trivial. However, recent advances in
LLM-based automated evaluation for generation tasks mitigate this issue to some extent, enabling
the assessment without human intervention (Liu et al., 2023).
While not exhaustive, these already cover a significant range of tasks and domains. We acknowledge
the limitations in some auto-assessment approaches, especially for generation tasks. Improving the
reliability of these automated evaluation methods, however, is beyond the scope of this paper.
We employ five different sizes of PaLM-2 models (Google et al., 2023) as our generators. These
models are pretrained solely for next-token prediction and do not undergo supervised fine-tuning
or reinforcement learning from human feedback. For coding-related tasks, apart from the standard
PaLM-2 models, we also employ the specialized PaLM-2-S* variant. The latter is obtained through
continual training of PaLM-2-S on a data mixture enriched with code-heavy corpus.
Query Collection We extract queries from three datasets: GSM8K (Cobbe et al., 2021), Hu-
manEval (Chen et al., 2021), and TruthfulQA (Lin et al., 2021), covering the tasks of math-problem
solving, code completion and question answering. For datasets with distinct training and test splits,
we use the test data; for datasets intended only for evaluation, all examples are used. Detailed
considerations and rationale behind the selection of these datasets are provided in Appendix B.
Response Generation We sample k responses for each query, with k = 64 for GSM8K and
TruthfulQA, and k = 100 for HumanEval. In the case of TruthfulQA, we employ its multiple-
choice variation to facilitate autonomous answer annotation. After filtering out invalid outputs such
as empty ones, we collect a total of 780K responses as an initial pool of candidates.
Annotation for Correctness For GSM8K, we assess answer correctness by comparing its numeric
equality to the ground truth, as described by Lewkowycz et al. (2022). For HumanEval, correctness
is determined by the passage of provided unit tests. For TruthfulQA, we utilize its classification
format, judging correctness based on a match with the ground-truth label.
More details on hyper-parameter settings and prompt templates are available in Appendix C.
3.2 DATA SELECTION
Many existing evaluation benchmarks for large language models suffer from insufficient differentia-
bility, i.e., both stronger and weaker models yield similar performance (Fu, 2023). This issue likely
arises from the presence of either overly simple or exceedingly difficult examples in the benchmarks.
Such examples are less valuable for evaluation and can undermine the utility of the benchmarks
when average scores are calculated, leading to indistinguishable outcomes. To address the issue, we
introduce various filtering strategies aimed at selecting high-quality and differentiable examples.
3.2.1 HIGH-QUALITY RESPONSE SELECTION
Initially, we can narrow the example set from 780K to 15K by sampling one correct and one incorrect
response for each query and generator. While random uniform sampling is the the most straightfor-
ward strategy, it risks including examples with obvious errors, which offer little evaluative value. To
mitigate this, for the incorrect responses we focus on sampling convincing wrong-answers (Light-
man et al., 2023) that are more likely to fool the models. In cases suitable for majority voting, we
identify the most frequent incorrect answer for each query, and then sample from responses contain-
ing this answer. For coding tasks where majority voting is not applicable, we sample from responses
that pass the most unit tests, indicating that it is mostly correct but fails in certain corner cases.
To further enhance data quality, we employ the complexity-based sample selection strategy (Fu et al.,
2023b) for tasks that require chain-of-thought reasoning. Specifically, we opt for responses that
involve more reasoning steps, as this is positively correlated with higher accuracy (Fu et al., 2023b).
This approach is beneficial for sampling both types of responses. For correct ones, it minimizes the
likelihood of false positives; for incorrect ones, it yields more convincing responses that pose greater
challenges in flaw detection for weaker models.
4
Lastly, as many tasks are challenging and may require emergent abilities (Wei et al., 2022a) to per-
form well, smaller models generally underperform and produce lower-quality responses compared
to larger ones. We include data from these smaller models only for analyzing self-critique abilities;
they are excluded from the final evaluation benchmarks.
3.2.2 CERTAINTY-BASED QUERY SELECTION
Thus far, our focus has been on choosing responses with higher quality and likelihood of accu-
racy. We now shift our focus to the quality of queries. Not all queries are equally valuable: trivial
queries that models easily answer correctly are generally less valuable, whereas queries consistently
answered incorrectly may either be too complex for LLMs or suffer from wrong "golden" labels.
To minimize the presence of such queries in our benchmark, we introduce two metrics to quantify
the levels of certainty when models answer a query: the certainty score and correctness rate. We
will use these metrics to help us select queries of moderate difficulty.
The metrics draw inspiration from the majority voting mechanism in the self-consistency approach
(Wang et al., 2023), which functions by generating multiple candidate outputs for a query, and then
aggregating them using a majority voting procedure to select the most commonly occurring answer.
Observing that different majority votes, even those resulting in the same outcome, can indicate vastly
different levels of certainty. To illustrate, consider a voting situation with 100 candidates where: (i)
all candidates are x; and (ii) 51 candidates are x and 49 are y. Although both situations result in
a majority vote for x, the level of certainty varies significantly: the former situation denotes a high
degree of confidence, whereas the latter reflects a considerable level of uncertainty.
Motivated by the observations above, we propose the following method to measure levels of un-
certainty in language model responses. Suppose we prompt a language model LM : P (a|q) with
a query q and sample a bag of k answers A = {ai}k
i=1, where ai ∼ P (a|q). We denote the most
and the second most frequent answers among these k responses as a(1) and a(2), respectively. Un-
certainty is measured by the frequency ratio of a(2) to a(1), where a larger ratio indicates a higher
level of uncertainty. We term this ratio as uncertainty rate. An uncertainty rate of 1 - where the
two most frequent answers appear with equal frequency - indicates extremely high model uncer-
tainty. Conversely, an uncertainty rate of 0, implying that a(2) = 0, suggests that all responses are
consistent, indicating the model's strong confidence in its answer.
Formally, we use fA(a) = (cid:80)
ai∈A 1condition (ai = a) to denote the frequency of an answer a among
a bag of responses A and mode(A) = arg maxa fA(a) to denote the mode, i.e., the most frequently
occurring item , of A. The uncertainty rate over model responses A to the query q is then defined
as URLM(q; k) = fA(mode(A\A(1)))
, where A(1) = {a | a = mode(A), a ∈ A} represents the most
frequent responses in A. For the sake of conciseness and readability in our subsequent discussion,
we also define a metric by the negative logarithm of the uncertainty rate to measure model certainty,
represented as CertaintyLM(q; k) = − log (URLM(q; k)), where a larger value indicates a higher
level of certainty. We term it as the certainty score.
fA(mode(A))
In cases where the expected correct answer to a query is available, such as during model evaluation
on a test dataset, the definitions above can be slightly adapted to introduce a new metric called
correctness rate. This metric is defined as the frequency ratio of the correct answer to the most
fA(a(e))
fA(mode(Awrong)) , where a(e) denotes the expected answer
common wrong answer: CRLM(q; k) =
and Awrong = (cid:8)a | a ̸= a(e), a ∈ A(cid:9) denotes the incorrect responses. Using self-consistency, the
model votes a correct answer when the correctness rate exceeds 1, and conversely, it produces an
incorrect answer when the rate falls below 1. In addition, as the rate approaches 1, the model exhibits
increasing levels of uncertainty regarding the answer, no matter if it is correct or not. This metric
naturally reflects the difficulty of a query to the model.
We present a simple case study to intuitively demonstrate the properties of our proposed metrics.
We evaluate PaLM-2-S (Google et al., 2023) on GSM8K (Cobbe et al., 2021) using a 64-path self-
consistency. The relationship between model certainty, correctness rate (CR), and model accuracy
is depicted in Figure 2.
5
(a) Relation of certainty to CR.
(b) Relation of certainty to accuracy.
Figure 2: Certainty of PaLM-2-S on GSM8K: Relation to correctness rate (CR) and accuracy; based
on the 8-shot chain-of-thought prompt from Wei et al. (2022b) and a 64-path self-consistency.
Figure 2a displays the correlation between model certainty and correctness rate (CR). Test examples
with lower CR present greater challenges to models. As evidenced in the figure, lower certainty cor-
relates with more low-CR examples, leading to more incorrect predictions. As certainty increases,
the instances of low CR diminish, resulting in higher accuracy. Figure 2b illustrates the correlation
between model certainty and accuracy in a more straightforward way. As the certainty level rises,
the proportion of incorrect predictions markedly decreases, signifying increased accuracy.
We now adopt a certainty-based sample selection strategy. We calculate the correctness rate for each
query, selecting those with a CR close to 1. This suggests that models exhibit considerable hesitation
and uncertainty when responding to these queries, indicating a moderate level of difficulty that is
neither excessively simple (CR → +∞) nor overly challenging (CR → 0). For coding tasks, where
certainty metrics cannot be computed, we use the ratio of correct to incorrect answers as a surrogate
for CR. Moreover, due to the limited size of HumanEval, we only exclude the simpler queries with
a CR > 1, and retain the challenging examples. We will analyze the correlation between critique
ability and model certainty for queries in Section 4.3.
Detailed implementation of each stage in data selection can be found in Appendix D.
Final Data Formulation To this end, we could further narrow the benchmark dataset to 3K high-
quality, differentiable examples, with 1K for each original dataset. The resulting subsets are named
as Critic-GSM8K, Critic-HumanEval, and Critic-TruthfulQA, and their mixture is referred to as
CRITICBENCH. We provide the data statistics and examples in Appendix E. As our data collection
method is scalable and generalizable across tasks, we view the construction of CRITICBENCH as a
continuous effort. This paper serves as an initial step, presenting three representative datasets. We
hope to extend the mixture to cover more tasks and scenarios in future work.
4 PROPERTIES OF CRITIQUE ABILITY
In this section, we conduct our analysis of the critique ability of large language models on CRIT-
ICBENCH. We focus primarily on the following three aspects: (1) how critique ability scales with
model size (Section 4.1); (2) models' self-critique ability (Section 4.2); and (3) the correlation be-
tween critique ability and models' certainty in response to a query (Section 4.3).
For each query-response pair in the dataset, we employ few-shot prompting to instruct models to first
conduct a chain-of-thought analysis to identify any flaws in the response and explain the reason; and
subsequently issue a judgment on the response's correctness.
In evaluation, we focus solely on
the accuracy of this final judgment, disregarding the correctness of the intermediate analysis. As
empirical evidence has shown a strong correlation between the accuracy of intermediate chain-of-
thought and the final answer (Wei et al., 2022b; Lewkowycz et al., 2022; Fu et al., 2023a), we can
use the final judgment accuracy as a proxy for the model's critique analysis capability. Details about
the evaluation settings can be found in Appendix F.
4.1 SCALING LAW
Jang (2023) posits that critique ability may be an emergent ability (Wei et al., 2022a) that only
emerges at certain scales of model size. We emphasize that it is better to seek an answer to this
6
0.01.53.04.56.0Certainty Score050100150200250Num ExamplesCR <22CR [22,20)CR [20,22)CR >220123456Certainty Score050100150200250Num ExamplesNum CorrectNum WrongAccuracy405060708090100AccuracyFigure 3: Scaling law of critique ability: Following Google et al. (2023), we use T-shirt size nota-
tions to denote model sizes. All medium-sized or smaller models exhibit poor performance on all
tasks, akin to random guessing. Critic-HumanEval poses a great challenge for all models.
hypothesis before directing our efforts toward the applications of critiques. For a critic model to
successfully improve the performance of specific tasks, it must possess at least moderate effec-
tiveness. It is possible that the critique ability of smaller models is as futile as a random guess,
rendering them incapable for downstream applications. A study of the scaling law of critique ability
could provide us insights into the appropriate model size selection and whether fine-tuning should
be considered for smaller models.
We evaluate multiple widely-used LLM families available in various sizes on CRITICBENCH, in-
cluding PaLM-2 (Google et al., 2023), LLaMA (Touvron et al., 2023a), LLaMA-2 (Touvron et al.,
2023b), and ChatGPT (OpenAI, 2023). Figure 3 illustrates the scaling behavior of their critique abil-
ities. The results for ChatGPT are not directly comparable to those of other models because its size
is not disclosed and it undergoes instruction-tuning, whereas the others are all pretrained models.
We include it here solely for reference purpose. On Critic-GSM8K and Critic-TruthfulQA, all mod-
els of medium size or smaller exhibit poor performance, akin to random guessing. Only PaLM-2-L
demonstrates non-trivial better results. On Critic-HumanEval, all models perform poorly; even the
strongest pretrained model, PaLM-2-L, only achieves an accuracy score of merely 54.14%, which
is just marginally better than a random guess. This is somewhat anticipated, as evaluating the cor-
rectness of a code snippet without execution is often challenging even for expert software engineers.
It is likely to gain a notable improvement when augmented by a code interpreter tool. Thus, the
benchmark also serves as an ideal testbed to assess LLMs' tool-use capability.
The observed scaling law supports the emergent ability hypothesis by Jang (2023). It suggests that
the ability of critique is yet another key indicator of a strong large language model.
4.2 SELF-CRITIQUE ABILITY
Figure 4: The accuracy of differently-sized critic models in critiquing answers produced by
differently-sized policy models. For instance, the top-left cells indicate the accuracy of PaLM-2-L
in critiquing answers from PaLM-2-XXS.
We now turn our attention to self-critique ability, a concept of particular interest due to its high rel-
evance to a model's potential of self-improvement. Figure 4 demonstrates the critique performance
7
XXSXSSMLModel Size50556065Accuracy (%)Critic-GSM8K: Scaling LawPaLM-2ChatGPTLLaMALLaMA-2RandomXXSXSSMLModel Size50525456Accuracy (%)Critic-HumanEval: Scaling LawPaLM-2PaLM-2-S*ChatGPTLLaMALLaMA-2RandomXXSXSSMLModel Size45.047.550.052.555.057.5Accuracy (%)Critic-TruthfulQA: Scaling LawPaLM-2ChatGPTLLaMALLaMA-2RandomXXSXSSMLAnswer Model SizeLMSXSXXSCritic Model Size77.14±0.0372.32±0.0163.66±0.0467.17±0.0260.10±0.1564.03±0.0356.30±0.0151.83±0.0453.21±0.0553.37±0.0767.54±0.0457.83±0.0252.10±0.0153.67±0.0855.56±0.0654.75±0.0149.93±0.0348.96±0.0648.37±0.0547.46±0.1148.63±0.0250.88±0.0148.99±0.0151.06±0.0551.10±0.03Critic-GSM8K: Critique AccuracyXXSXSSMLAnswer Model SizeLMSXSXXSCritic Model Size82.10±0.0265.91±0.0356.25±0.0653.15±0.0453.54±0.0665.02±0.0553.45±0.0252.05±0.0152.20±0.0450.00±0.0565.30±0.0854.87±0.0653.42±0.0752.93±0.0552.21±0.0556.41±0.0751.87±0.0951.07±0.0750.09±0.1352.46±0.0550.70±0.0150.93±0.0449.19±0.0349.61±0.0249.36±0.04Critic-HumanEval: Critique AccuracyXXSXSSMLAnswer Model SizeLMSXSXXSCritic Model Size60.87±0.0166.87±0.0260.88±0.0556.82±0.0651.68±0.0655.36±0.0156.65±0.0152.49±0.0350.74±0.0648.37±0.0753.25±0.0254.59±0.0349.06±0.0348.68±0.0247.55±0.0350.12±0.0152.25±0.0149.51±0.0348.51±0.0345.96±0.0349.00±0.0248.56±0.0447.90±0.0549.39±0.0246.25±0.02Critic-TruthfulQA: Critique AccuracyFigure 5: Self-critique accuracy of PaLM-2 models: On Critic-GSM8K, larger models demonstrate
better self-critique ability. On the other two tasks, all models perform poorly.
of various sizes of critic models in evaluating answers produced by different-sized policy models.
The diagonal lines spanning from the lower left to the upper right represent the models' self-critique
accuracy, and correspond to the curves in Figure 5.
The scaling behavior varies across different subsets. It is unsurprising that models of all sizes strug-
gle on Critic-HumanEval due to its challenging nature. On Critic-GSM8K, larger models display
better self-critique ability. On Critic-TruthfulQA, however, models perform similarly to random
guessing regardless of model size. We hypothesize the disparity is due to the underlying reasons of
a model answering incorrectly to queries. For TruthfulQA, the wrong answers largely stem from
false beliefs or misconceptions in models, which would also lead to critique failures. In contrast, for
the math queries in GSM8K, incorrect responses primarily result from reasoning or computational
flaws, which are likely detectable upon a double check through self-critiquing.
Another finding is larger models are generally good at critiquing responses generated by smaller
models. The outcome aligns with the expectation that smaller models are more prone to more
obvious errors, which are easier caught by larger and more capable models.
4.3 CORRELATION TO CERTAINTY
Figure 6: Relation to correctness rate (CR).
Figure 7: Relation to certainty score.
In Section 3.2.2, we introduce the use of certainty metrics to select queries of appropriate difficulty.
While the metrics do reflect the challenge of answering a query, one may argue that it does not
directly translate to the difficulty of critiquing an answer to that query. To address this, we examine
8
XXSXSSMLModel Size505254565860Accuracy (%)Critic-GSM8K: Self-Critique AccuracyPaLM-2RandomXXSXSSMLModel Size50515253Accuracy (%)Critic-HumanEval: Self-Critique AccuracyPaLM-2RandomXXSXSSMLModel Size49505152Accuracy (%)Critic-TruthfulQA: Self-Critique AccuracyPaLM-2Random<23[23,21)[21,21)[21,23)>23Correctness Rate (CR)455055606570Accuracy (%)Critic-GSM8K: Critique Accuracy - CRPaLM-2-XXSPaLM-2-XSPaLM-2-SPaLM-2-MPaLM-2-LRandom<23[23,21)[21,21)[21,23)>23Correctness Rate (CR)505560657075Accuracy (%)Critic-HumanEval: Critique Accuracy - CRPaLM-2-XXSPaLM-2-XSPaLM-2-SPaLM-2-MPaLM-2-LPaLM-2-S*Random<23[23,21)[21,21)[21,23)>23Correctness Rate (CR)455055606570Accuracy (%)Critic-TruthfulQA: Critique Accuracy - CRPaLM-2-XXSPaLM-2-XSPaLM-2-SPaLM-2-MPaLM-2-LRandom[0,1.5)[1.5,3)[3,4.5)>4.5Certainty5055606570Accuracy (%)Critic-GSM8K: Critique Accuracy - CertaintyPaLM-2-XXSPaLM-2-XSPaLM-2-SPaLM-2-MPaLM-2-LRandom[0,1.5)[1.5,3)[3,4.5)>4.5Certainty5055606570Accuracy (%)Critic-TruthfulQA: Critique Accuracy - CertaintyPaLM-2-XXSPaLM-2-XSPaLM-2-SPaLM-2-MPaLM-2-LRandomthe correlation between critique accuracy and model certainty for a query. We evaluate PaLM-2
models on the benchmarks without applying certainty-based selection. Figures 6 and 7 display
the correlation between critique ability, correctness rate, and certainty score. Note that for Critic-
HumanEval, we cannot compute the certainty score because it is not applicable to majority voting for
code snippets. Additionally, the correctness rate is calculated differently as detailed in Section 3.2.2.
We observe a clear positive correlation between model certainty and critique accuracy. This suggests
that a challenging query is not only difficult for LLMs to directly answer correctly, but also poses a
challenge in evaluating an answer's correctness to the query. Consequently, the proposed certainty
metrics serve as valuable criteria for data selection.
5 NEW CAPACITY WITH CRITIQUE: SELF-CONSISTENCY WITH SELF-CHECK
To explore the new capacity with critique ability, we would like to introduce a straightforward yet
effective baseline to demonstrate the potential of leveraging the critique ability to improve model
performance. The idea is intuitive: drawing a parallel to humans participating in a contest - where
they typically check their most uncertain answers before submission to identify and correct mistakes
- we suggest a similar process can be emulated in language models. This can be accomplished by
prompting the models to confirm the accuracy of their generated answers before presenting them.
To achieve this, we introduce a self-check filtering on top of the self-consistency method (Wang et al.,
2023), abbreviated as SC2. Assume with appropriate prompting, the language model functions as an
answer-critiquing model V (a) ∈ {0, 1}, which serves as a binary indicator for the correctness of an
answer a relative to its query q. We incorporate an additional step prior to the majority voting process
in self-consistency, which filters out candidates deemed incorrect by the critic model. Specifically,
for a set of k generated candidate answers A to a given query, the critic model selects those identified
as correct, denoted by Asc = {a | V (a) = 1, a ∈ A}. Subsequently, the standard majority vote
procedure is applied to the filtered candidates to derive the final answer asc2 = mode(Asc). Recall
that the model is most prone to errors when uncertain about a question, as shown in Figure 2. We
can reduce inference cost by only applying the self-check filtering selectively to questions of which
the certainty score Certainty(q; k) falls below a predefined threshold C.
Table 1: Evaluation results on GSM8K using the chain-of-thought prompt from Wei et al. (2022b).
The self-consistency with self-check filtering technique outperforms the standard one across all
models. aTaken from Google et al. (2023).
Model
ChatGPT
PaLM-2
GPT-4
CoT CoT+SC@64 CoT+SC2@64
76.3
80.7a
91.3
83.5
91.3
95.8
84.0 (+0.5)
92.7 (+1.4)
96.2 (+0.4)
We assess the performance of PaLM-2, ChatGPT and GPT-4 on the GSM8K dataset using the self-
consistency with self-check method, as presented in Table 1. We use a certainty threshold of C = 2
for GPT-4 and C = 1 for both PaLM-2 and ChatGPT. Compared to self-consistency baselines,
the additional self-check procedure achieves 3.03%, 16.09%, and 9.52% error reduction rate for
ChatGPT, PalM-2 and GPT-4 respectively, highlighting the value of critique ability.
It is noted that our primary objective of this paper is to explore the concept and attributes of critique
ability, rather than advancing the state of the art. Thus, we opt to stick with the prompting-based
critic model for the sake of simplicity. While fine-tuning the critic model or using critiques to
supervise the policy model could potentially push the scores higher, such enhancements are not the
focus of this study. We believe future work in this direction can further improve the performance.
6 CONCLUSION
In this work, we conduct a study exploring critique abilities of LLMs across various tasks. Evalua-
tion results of multiple widely-used LLMs on the proposed CRITICBENCH reveal that: most LLMs
find critique challenging, especially self-critique. We introduce the self-check method as an effective
9
baseline to improve model performance through self-critique. Our work provides an initial explo-
ration of critique abilities of LLMs, paving the way for future research on proficient critic models
and critique applications across diverse tasks.
REFERENCES
Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones,
Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, Carol Chen, Catherine Ols-
son, Christopher Olah, Danny Hernandez, Dawn Drain, Deep Ganguli, Dustin Li, Eli Tran-
Johnson, Ethan Perez, Jamie Kerr, Jared Mueller, Jeffrey Ladish, Joshua Landau, Kamal Ndousse,
Kamile Lukosuite, Liane Lovitt, Michael Sellitto, Nelson Elhage, Nicholas Schiefer, Noemi Mer-
cado, Nova DasSarma, Robert Lasenby, Robin Larson, Sam Ringer, Scott Johnston, Shauna
Kravec, Sheer El Showk, Stanislav Fort, Tamera Lanham, Timothy Telleen-Lawton, Tom Con-
erly, Tom Henighan, Tristan Hume, Samuel R. Bowman, Zac Hatfield-Dodds, Ben Mann, Dario
Amodei, Nicholas Joseph, Sam McCandlish, Tom Brown, and Jared Kaplan. Constitutional AI:
Harmlessness from AI feedback. arXiv preprint arXiv:2212.08073, 2022.
BIG-Bench authors. Beyond the imitation game: Quantifying and extrapolating the capabilities of
language models. Transactions on Machine Learning Research (TMLR), 2023.
Samuel R. Bowman, Jeeyoon Hyun, Ethan Perez, Edwin Chen, Craig Pettit, Scott Heiner, Kamil ̇e
Lukoˇsi ̄ut ̇e, Amanda Askell, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron
McKinnon, Christopher Olah, Daniela Amodei, Dario Amodei, Dawn Drain, Dustin Li, Eli Tran-
Johnson, Jackson Kernion, Jamie Kerr, Jared Mueller, Jeffrey Ladish, Joshua Landau, Kamal
Ndousse, Liane Lovitt, Nelson Elhage, Nicholas Schiefer, Nicholas Joseph, Noem ́ı Mercado,
Nova DasSarma, Robin Larson, Sam McCandlish, Sandipan Kundu, Scott Johnston, Shauna
Kravec, Sheer El Showk, Stanislav Fort, Timothy Telleen-Lawton, Tom Brown, Tom Henighan,
Tristan Hume, Yuntao Bai, Zac Hatfield-Dodds, Ben Mann, and Jared Kaplan. Measuring
progress on scalable oversight for large language models. arXiv preprint arXiv:2211.03540, 2022.
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared
Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri,
Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan,
Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian,
Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fo-
tios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex
Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders,
Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec
Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob Mc-
Grew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large
language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng,
Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An
open-source chatbot impressing GPT-4 with 90%* chatgpt quality. LMSYS Org blog post, 2023.
URL https://lmsys.org/blog/2023-03-30-vicuna/.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser,
Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John
Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168,
2021.
Yao Fu. A stage review of instruction tuning. Yao Fu's Notion, Jun 2023. URL https://bit.
ly/3EQU9Xy.
Yao Fu, Litu Ou, Mingyu Chen, Yuhao Wan, Hao Peng, and Tushar Khot. Chain-of-thought hub:
A continuous effort to measure large language models' reasoning performance. arXiv preprint
arXiv:2305.17306, 2023a.
Yao Fu, Hao Peng, Ashish Sabharwal, Peter Clark, and Tushar Khot. Complexity-based prompt-
ing for multi-step reasoning. In Proceedings of the 11th International Conference on Learning
Representations (ICLR), May 2023b.
10
Rohan Anil Google, Andrew M. Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre
Passos, Siamak Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, Eric Chu, Jonathan H.
Clark, Laurent El Shafey, Yanping Huang, Kathy Meier-Hellstern, Gaurav Mishra, Erica Mor-
eira, Mark Omernick, Kevin Robinson, Sebastian Ruder, Yi Tay, Kefan Xiao, Yuanzhong Xu, Yu-
jing Zhang, Gustavo Hernandez Abrego, Junwhan Ahn, Jacob Austin, Paul Barham, Jan Botha,
James Bradbury, Siddhartha Brahma, Kevin Brooks, Michele Catasta, Yong Cheng, Colin Cherry,
Christopher A. Choquette-Choo, Aakanksha Chowdhery, Cl ́ement Crepy, Shachi Dave, Mostafa
Dehghani, Sunipa Dev, Jacob Devlin, Mark D ́ıaz, Nan Du, Ethan Dyer, Vlad Feinberg, Fangxi-
aoyu Feng, Vlad Fienber, Markus Freitag, Xavier Garcia, Sebastian Gehrmann, Lucas Gonzalez,
Guy Gur-Ari, Steven Hand, Hadi Hashemi, Le Hou, Joshua Howland, Andrea Hu, Jeffrey Hui,
Jeremy Hurwitz, Michael Isard, Abe Ittycheriah, Matthew Jagielski, Wenhao Jia, Kathleen Ke-
nealy, Maxim Krikun, Sneha Kudugunta, Chang Lan, Katherine Lee, Benjamin Lee, Eric Li,
Music Li, Wei Li, YaGuang Li, Jian Li, Hyeontaek Lim, Hanzhao Lin, Zhongtao Liu, Freder-
ick Liu, Marcello Maggioni, Aroma Mahendru, Joshua Maynez, Vedant Misra, Maysam Mous-
salem, Zachary Nado, John Nham, Eric Ni, Andrew Nystrom, Alicia Parrish, Marie Pellat, Mar-
tin Polacek, Alex Polozov, Reiner Pope, Siyuan Qiao, Emily Reif, Bryan Richter, Parker Riley,
Alex Castro Ros, Aurko Roy, Brennan Saeta, Rajkumar Samuel, Renee Shelby, Ambrose Slone,
Daniel Smilkov, David R. So, Daniel Sohn, Simon Tokumine, Dasha Valter, Vijay Vasudevan,
Kiran Vodrahalli, Xuezhi Wang, Pidong Wang, Zirui Wang, Tao Wang, John Wieting, Yuhuai
Wu, Kelvin Xu, Yunhan Xu, Linting Xue, Pengcheng Yin, Jiahui Yu, Qiao Zhang, Steven Zheng,
Ce Zheng, Weikang Zhou, Denny Zhou, Slav Petrov, and Yonghui Wu. PaLM 2 technical report.
arXiv preprint arXiv:2305.10403, 2023.
Arnav Gudibande, Eric Wallace, Charlie Snell, Xinyang Geng, Hao Liu, Pieter Abbeel, Sergey
Levine, and Dawn Song. The false promise of imitating proprietary LLMs. arXiv preprint
arXiv:2305.15717, 2023.
Tahmid Hasan, Abhik Bhattacharjee, Md Saiful Islam, Kazi Samin, Yuan-Fang Li, Yong-Bin Kang,
M Sohel Rahman, and Rifat Shahriyar. XL-Sum: Large-scale multilingual abstractive summariza-
tion for 44 languages. In Findings of the Association for Computational Linguistics: ACL-IJCNLP
2021, Aug 2021.
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob
In Proceedings of the 9th
Steinhardt. Measuring massive multitask language understanding.
International Conference on Learning Representations (ICLR), May 2021.
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text
degeneration. In Proceedings of the 8th International Conference on Learning Representations
(ICLR), Apr 2020.
Eric Jang. Can llms critique and iterate on their own outputs?
evjang.com, Mar 2023. URL
https://evjang.com/2023/03/26/self-reflection.html.
Aitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer, Henryk Michalewski, Vinay Ra-
masesh, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam
Neyshabur, Guy Gur-Ari, and Vedant Misra. Solving quantitative reasoning problems with lan-
guage models. In Proceedings of the 36th Conference on Neural Information Processing Systems
(NeurIPS), Dec 2022.
Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan
Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let's verify step by step. arXiv preprint
arXiv:2305.20050, 2023.
Stephanie Lin, Jacob Hilton, and Owain Evans. TruthfulQA: Measuring how models mimic human
falsehoods. arXiv preprint arXiv:2109.07958, 2021.
Yang Liu, Dan Iter, Yichong Xu, Shuohang Wang, Ruochen Xu, and Chenguang Zhu. G-Eval: NLG
evaluation using GPT-4 with better human alignment. arXiv preprint arXiv:2303.16634, 2023.
Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri
Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad
Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, and Peter Clark. Self-refine:
Iterative refinement with self-feedback. arXiv preprint arXiv:2303.17651, 2023.
11
Aaron Meurer, Christopher Smith, Mateusz Paprocki, Ondˇrej ˇCert ́ık, Sergey Kirpichev, Matthew
Rocklin, AMiT Kumar, Sergiu Ivanov, Jason Moore, Sartaj Singh, Thilina Rathnayake, Sean Vig,
Brian Granger, Richard Muller, Francesco Bonazzi, Harsh Gupta, Shivam Vats, Fredrik Johans-
son, Fabian Pedregosa, and Anthony Scopatz. SymPy: Symbolic computing in Python. PeerJ
Computer Science, 2017.
OpenAI. GPT-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
Debjit Paul, Mete Ismayilzada, Maxime Peyrard, Beatriz Borges, Antoine Bosselut, Robert West,
and Boi Faltings. Refiner: Reasoning feedback on intermediate representations. arXiv preprint
arXiv:2304.01904, 2023.
William Saunders, Catherine Yeh, Jeff Wu, Steven Bills, Long Ouyang, Jonathan Ward, and Jan
Leike. Self-critiquing models for assisting human evaluators. arXiv preprint arXiv:2206.05802,
2022.
Noah Shinn, Beck Labash, and Ashwin Gopinath. Reflexion: An autonomous agent with dynamic
memory and self-reflection. arXiv preprint arXiv:2303.11366, 2023.
Zhiqing Sun, Yikang Shen, Qinhong Zhou, Hongxin Zhang, Zhenfang Chen, David Cox, Yiming
Yang, and Chuang Gan. Principle-driven self-alignment of language models from scratch with
minimal human supervision. In Proceedings of the 37th Conference on Neural Information Pro-
cessing Systems (NeurIPS), Dec 2023.
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy
Liang, and Tatsunori B. Hashimoto. Stanford Alpaca: An instruction-following LLaMA model.
GitHub repository, May 2023. URL https://github.com/tatsu-lab/stanford_
alpaca.
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timoth ́ee
Lacroix, Baptiste Rozi`ere, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Ar-
mand Joulin, Edouard Grave, and Guillaume Lample. LLaMA: Open and efficient foundation
language models. arXiv preprint arXiv:2302.13971, 2023a.
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Niko-
lay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher,
Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy
Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn,
Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez, Madian Khabsa, Isabel
Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee,
Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushkar Mishra,
Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi,
Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing Ellen Tan, Binh
Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen
Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic,
Sergey Edunov, and Thomas Scialom. LLaMA 2: Open foundation and fine-tuned chat models.
arXiv preprint arXiv:2307.09288, 2023b.
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdh-
ery, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models.
In Proceedings of the 11th International Conference on Learning Representations (ICLR), May
2023.
Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yo-
gatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed H. Chi, Tatsunori Hashimoto, Oriol
Vinyals, Percy Liang, Jeff Dean, and William Fedus. Emergent abilities of large language models.
Transactions on Machine Learning Research (TMLR), 2022a.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, and
Denny Zhou. Chain-of-thought prompting elicits reasoning in large language models. In Proceed-
ings of the 36th Conference on Neural Information Processing Systems (NeurIPS), Dec 2022b.
12
ACKNOWLEDGMENTS
We thank Pengchen Yin, Eric Li, Zihan Wang, Le Hou and Yuexin Wu for helpful discussions.
A NOTATIONS
The models used in this paper include PaLM-2 (Google et al., 2023), LLaMA (Touvron et al.,
2023a), LLaMA-21 (Touvron et al., 2023b), and GPT (OpenAI, 2023) families.
For models available in various sizes, we explore scaling laws to show how their critique capabilities
relate to model sizes. The specific numbers of parameters for PaLM-2 series have not been made
public; they are instead categorized by T-shirt sizes (S, M, L) in Google et al. (2023). We extend its
notation and introduce two additional sizes: XXS and XS. PaLM-2 refers to the large (L) version
when mentioned alone without a size specification.
For the GPT family, we specifically evaluate the gpt-3.5-turbo-0613 and gpt-4-0613
models via OpenAI's API2. These are the latest stable versions at the time of our study. For the
sake of simplicity, we refer to gpt-3.5-turbo-0613 as ChatGPT and gpt-4-0613 as GPT-4
throughout this paper. Unless stated otherwise, all models are evaluated in their pretrained states,
except for ChatGPT and GPT-4, which undergo further fine-tuning.
B CRITICBENCH: SOURCES OF QUERIES
The goal of CRITICBENCH is to create a comprehensive, reliable, and fully open benchmark for
evaluating critique ability in a diverse range of scenarios. To achieve this, we consider the following
criteria for selecting the sources of queries.
Task Emergency A recent trend of rapidly developing a large language model (LLM) is fine-
tuning a less capable LLM on outputs from a more robust proprietary model (Taori et al., 2023;
Chiang et al., 2023). However, recent research indicates that such fine-tuned models often replicate
only the style of the stronger models without acquiring their advanced capabilities (Gudibande et al.,
2023). For instance, models like Alpaca (Taori et al., 2023) and Vicuna (Chiang et al., 2023) excel in
tasks such as chitchat but underperform in complex tasks that demand emergent abilities (Wei et al.,
2022a). OpenAI's GPT-4 release blog3 also acknowledges this, stating, "In a casual conversation,
the distinction between GPT-3.5 and GPT-4 can be subtle. The difference comes out when the
complexity of the task reaches a sufficient threshold." Consequently, our focus will be on tasks with
more differentiability, which necessitate advanced capabilities to perform well, such as analytical
and reasoning skills.
Task Diversity We aim to comprehensively evaluate the critique abilities of LLMs across a diverse
range of tasks and scenarios, in contrast to previous studies like Saunders et al. (2022), which typi-
cally focus on a specific task only. Our dataset selection strategy is largely inspired by the PaLM 2
and GPT-4 technical reports (Google et al., 2023; OpenAI, 2023). These reports offer valuable ex-
amples and guidelines for the high-level idea of categorizing tasks that illuminate core capabilities
and applications of LLMs.
License and Copyright CRITICBENCH is designed as an open, research-friendly benchmark. We
exclusively consider data sources available under less restrictive licenses, such as the MIT License4
and Apache License 2.05. In addition, special attention is given to copyright considerations. For
instance, summarization datasets like XLSum (Hasan et al., 2021) are often derived from news
articles. The redistribution of these articles may lead to copyright infringements. Therefore, such
datasets are intentionally left out of our benchmark.
1All access to the LLaMA 2 model was performed by Zi. No researchers affiliated with Google accessed or
used LLaMA2 for this publication.
2https://platform.openai.com/docs/models
3https://openai.com/research/gpt-4
4https://opensource.org/license/mit/
5https://www.apache.org/licenses/LICENSE-2.0
13
B.1 SELECTED TASKS
Following these principles, in this paper, we consider the following datasets as sources for the
queries:
• GSM8K (Cobbe et al., 2021). A dataset comprises 8.5K mathematical reasoning problems
and is widely used for evaluating the capabilities of models in both arithmetic reasoning
and the composition of mathematical steps with natural language.
• HumanEval (Chen et al., 2021). A dataset contains 164 handwritten Python programming
problems, complete with text comments and docstrings, and is designed to assess the coding
abilities of models.
• TruthfulQA (Lin et al., 2021). A question-answering dataset consists of 817 manually cre-
ated questions that humans often answer incorrectly due to misconceptions or false beliefs.
It aims to evaluate whether models can produce outputs that align with real-world facts and
common sense.
These sources cover the tasks of reasoning, coding, question answering and classification. As our
data collection method is scalable and generalizable across tasks, we view the construction of CRIT-
ICBENCH as a continuous effort. This paper serves as an initial step, presenting three representative
datasets. We hope to extend the mixture to cover more tasks and scenarios in future work.
C CRITICBENCH: DATA GENERATION DETAILS
In general, we use five different sizes (XXS, XS, S, M, L) of PaLM-2 models (Google et al., 2023)
as our generators. They are all pretrained models and do not undergo supervised fine-tuning or
reinforcement learning from human feedback. For coding-related tasks, we additionally use the
coding-specific PaLM-2-S* variant, as introduced in Google et al. (2023). It is obtained through
continual training of PaLM-2-S on a data mixture enriched with code-heavy and multilingual corpus.
We opt not to use other large language models as generators due to constraints related to data usage
policies. For instance, OpenAI's GPT series (OpenAI, 2023) and Meta's LLaMA series (Touvron
et al., 2023a;b) both have their specific usage polices6,7. Our aim is to establish an open benchmark
with minimal constraints. To avoid the complications of incorporating licenses and usage policies
from multiple sources, we limit the data generation to only use the PaLM-2 model family, with
which we are most familiar. We are actively working on compliance review to facilitate the data
release with a less restrictive license.
C.1 GSM8K
We generate responses using the same 8-shot chain-of-thought prompt from Wei et al. (2022b). We
use nucleus sampling (Holtzman et al., 2020) with temperature T = 0.6 and p = 0.95 to sample 64
responses for each query. Following Lewkowycz et al. (2022) and Google et al. (2023), we employ
the SymPy library (Meurer et al., 2017) for answer comparison and annotation.
C.2 HUMANEVAL
Following Google et al. (2023), we use the queries to directly prompt the models in a zero-shot
manner. We use nucleus sampling (Holtzman et al., 2020) with temperature T = 0.8 and p = 0.95
to sample 100 responses for each query. The generated responses are truncated up to the next line
of code without indentation. All samples are tested in a restricted code sandbox that includes only
limited number of relevant modules and is carefully isolated from the system environment.
C.3 TRUTHFULQA
In the original paper by Lin et al. (2021), the authors evaluate models by calculating the conditional
likelihood of each possible choice given a query, selecting the answer with the highest normalized
6OpenAI's usage policies: https://openai.com/policies/usage-policies
7LLaMA-2's usage policy: https://ai.meta.com/llama/use-policy/
14
likelihood. While straightforward, this method has two primary limitations. First, the likelihood of a
choice is influenced not only by its factual accuracy and logical reasoning but also by the manner of
its expression. Therefore, the method may undervalue correct answers presented with less optimal
language. Second, this approach provides only the final selection, neglecting any intermediate steps.
We hope to include these intermediate processes to enable a critic model to offer critiques based on
both the final answer and the underlying reasoning.
We follow OpenAI (2023) to adopt a 5-shot prompt for answer selection. Since OpenAI (2023) does
not disclose their prompt template, we created our own version, detailed in Listing 1. Our prompt
design draws inspiration from Constitutional AI (Bai et al., 2022) and principle-driven prompting
(Sun et al., 2023). We use temperature T = 0.6 to sample 64 responses for each query.
We wish to clarify that although Lin et al. (2021) indicates that TruthfulQA is not intended for few-
shot benchmarking, our objective is neither to test PaLM-2 models nor to advance the state of the
art. Rather, our aim is to collect high-quality responses to construct the critique benchmarks.
1 ## General Guidelines
2 Professor Amy has been assigned a set of multiple-choice questions and is
(cid:44)→ required to adhere to the following guidelines when answering them
(cid:44)→ :
3 1. Each question has only one correct answer.
4 2. An answer is considered correct if it accurately represents factual
(cid:44)→ information about the real world. Answers that are true solely
(cid:44)→ based on a belief system or tradition will be deemed incorrect.
5 3. The number of answer choices may vary for each question. Choices will
(cid:44)→ be numerically labeled. Offer the analytical reasoning first,
(cid:44)→ followed by the selected answer number (number only, ending with a
(cid:44)→ dot).
6 ## Exemplars
7 Question: Which planet is the closest to Earth?
8 1. Venus
9 2. Mars
10 3. Jupiter
11 4. Mercury
12 5. The Moon
13 Analysis: The proximity of planets to Earth varies due to their
(cid:44)→ elliptical orbits. However, on average, Venus is the closest planet
(cid:44)→ to Earth with a minimum distance of about 38 million kilometers.
(cid:44)→ Mars comes second, followed by Mercury and then Jupiter. The Moon
(cid:44)→ is not a planet; it is Earth's natural satellite.
14 Answer: 1.
15
16 Question: What is the best way to lose weight?
17 1. Starving yourself
18 2. Drinking only detox teas
19 3. Exercising while maintaining a calorie deficit
20 4. Consuming fat-burning pills
21 Analysis: Starving oneself is harmful to health and often unsustainable.
(cid:44)→ Drinking only detox teas lacks scientific evidence and can be
(cid:44)→ detrimental. Consuming fat-burning pills can come with health risks
(cid:44)→ and are not a comprehensive solution to weight loss. Exercising
(cid:44)→ while maintaining a calorie deficit is supported by scientific
(cid:44)→ evidence and is generally considered the most effective and
(cid:44)→ healthiest way to lose weight.
22 Answer: 3.
23
24 Question: What determines your blood type?
25 1. Your diet
26 2. The genes inherited from your parents
27 3. Your ethnicity
28 4. Your age
29 Analysis: Blood type is only determined by the genes inherited from one's
(cid:44)→ parents, specifically the combination of the ABO and RhD antigens
(cid:44)→ present on the surface of red blood cells. None of your diet,
(cid:44)→ ethnicity or age would affect your blood type.
15
30 Answer: 2.
31
32 Question: Why do boats float?
33 1. Because they are light
34 2. Because they are painted
35 3. Because they are waterproof
36 4. Because they displace a weight of water equal to their own weight
37 5. Because they are made of wood or metal
38 Analysis: Boats float due to the principle of buoyancy, which states that
(cid:44)→ an object will float if it displaces a weight of water equal to
(cid:44)→ its own weight.
39 Answer: 4.
40
41 Question: What is the main reason for the seasons on Earth?
42 1. Proximity of Earth to the Sun
43 2. The tilt of the Earth's axis
44 3. The rotation of the Earth
45 4. The cycle of the moon
46 5. Solar flares
47 6. The Earth's orbit around the Sun being elliptical
48 7. Global warming
49 Analysis: Earth's axial tilt causes variations in the angle and amount of
(cid:44)→ sunlight received at different times of the year, thereby creating
(cid:44)→ the seasons.
50 Answer: 2.
Listing 1: 5-shot chain-of-thought prompt for TruthfulQA (mc1).
D CRITICBENCH: DATA SELECTION DETAILS
D.1 SAMPLING FROM CONVINCING WRONG-ANSWERS
The term convincing wrong-answer is coined by Lightman et al. (2023) to describe answers that
appear plausible but are actually incorrect. Such answers are often partially correct but contain
subtle errors that ultimately lead to incorrect conclusions. These answers present a greater challenge
for LLMs in accurately assessing their correctness compared to answers with more obvious errors.
Consequently, they serve as valuable evaluation examples for distinguishing between stronger and
weaker models.
In generating responses to queries from GSM8K and TruthfulQA, each response usually comprises
an intermediate chain-of-thought and a final answer. To sample an incorrect response from a bag
of candidates for a query, we initially extract each candidate's final answer. Next, we calculate the
frequency of each unique answer and identify the most commonly occurring incorrect one. If no
incorrect answers are present, the query is omitted as it is too easy to offer enough evaluative value.
We then sample only from responses that feature this prevalent incorrect answer. For instance, if
100 responses are sampled for a query, with 50 final answers being x, 40 being y, and 10 being z,
and if x is the ground-truth answer, we will restrict our sampling of incorrect responses to those 40
that indicate y as the answer.
For HumanEval, the aforementioned process is inapplicable because code snippets are not directly
comparable. We adopt an alternative approach, sampling from responses for a query that pass the
most unit tests but fail at least one. For example, if a query has 10 unit tests and we sample 5
solutions - where one passes all tests, two pass 8 out of 10, and the remaining two pass 5 out of
10 - we would focus our sampling on the two solutions that pass 8 tests. These code snippets are
often generally accurate but fail to handle certain corner cases.
D.2 COMPLEXITY-BASED SELECTION
Fu et al. (2023b) show that a response's complexity, denoted by the number of intermediate steps,
has a positive correlation with its accuracy, particularly in tasks necessitating reasoning. To leverage
16
this finding, we employ a complexity-based sampling strategy when selecting from either correct or
commonly incorrect responses.
We begin by calculating the complexity for each response. According to Fu et al. (2023b), potential
heuristics for this include the number of sentences, line breaks, words, or characters. For the GSM8K
dataset, we opt for the number of sentences, while for the TruthfulQA dataset, we use the number
of characters. These heuristic values serve as the logits for softmax sampling with temperature.
Specifically, we set T = 2 for GSM8K and T = 40 for TruthfulQA. Formally, for candidate
responses x = [x1, x2, . . . , xn], xi is sampled with a probability of SoftmaxT (complexity(x))i.
Employing this strategy is beneficial in two distinct contexts: when sampling correct responses, it
minimizes the probability of false positives; when sampling incorrect responses, it aids in selecting
more convincing erroneous answers.
D.3 FILTERING BY GENERATOR
During development, we find that smaller models, specifically PaLM-2-XXS and PaLM-2-XS, yield
responses of very low quality. This observation is corroborated by their subpar performance on
GSM8K, HumanEval, and TruthfulQA. Consequently, we restrict our data collection to responses
generated by models of size S, M, and L.
D.4 CERTAINTY-BASED SELECTION
In the final step of data selection, as outlined in Section 3.2.2, we employ the correctness rate (CR)
as a criterion to select queries of moderate difficulty. For GSM8K, we choose a CR range of
[2−1.5, 20.5], while for TruthfulQA, the range is [2−1.5, 21.5]. These ranges aim to balance sub-
set sizes, approximately 1K examples each, while maintaining an appropriate level of challenge
signified by a CR close to 1. HumanEval, an exception with only 164 examples, poses a limitation;
excluding low-CR examples would result in an limited small subset. Therefore, we only exclude
simpler examples with a CR > 1. Consequently, the Critic-HumanEval subset may present a higher
level of difficulty compared to the other two.
E CRITICBENCH: STATISTICS AND EXAMPLES
E.1 STATISTICS
Table 2 presents the detailed statistics of CRITICBENCH and each subset.
Table 2: The statistics of CRITICBENCH and each subset.
Critic-GSM8K
Critic-HumanEval
Critic-TruthfulQA 2−1.5 ≤ CR ≤ 21.5
CR Range
2−1.5 ≤ CR ≤ 20.5
CR ≤ 1
CRITICBENCH
E.2 EXAMPLES
Generators
Size
#Correct
#Incorrect
PaLM-2-S/M/L
PaLM-2-S/M/L/S*
PaLM-2-S/M/L
1136
1082
1016
3234
568
541
508
1617
568
541
508
1617
Figure 8, 9 and 10 provide examples in CRITICBENCH.
F EVALUATION SETTINGS
To evaluate large language models on CRITICBENCH, we employ few-shot chain-of-thought
prompting, rather than zero-shot. We choose few-shot because it is applicable to both pretrained
and instruction-tuned checkpoints, whereas zero-shot may underestimate the capabilities of pre-
trained models (Fu et al., 2023a). The prompt design draws inspiration from Constitutional AI (Bai
17
Figure 8: Examples from Critic-GSM8K.
Figure 9: Examples from Critic-HumanEval.
et al., 2022) and principle-driven prompting (Sun et al., 2023) that they always start with general
principles, followed by multiple exemplars.
In the evaluation process, we use a temperature of 0.6 for generating the judgment, preceded with
the chain-of-thought analysis. Each model is evaluated 8 times, and the average accuracy is re-
ported. The few-shot exemplars always end with the pattern "Judgment: X.", where X is either
correct or incorrect. We search for this pattern in the model output and extract X. In rare
cases where this pattern is absent, the result is defaulted to correct.
18
Query: The expenditure of Joseph in May was $500. In June, his expenditure was $60 less. How much was his totalexpenditure for those two months?Certainty Score: 7.86Correctness Rate: 2.97Generator: PaLM-2-SResponse: Joseph spent $500 in May. He spent $60 less inJune. That means he spent $500 - $60 = $440 in June. Histotal expenditure for those two months was $500 + $440 =$940. The answer is 940.Judgment: correctResponse: Joseph spent $500 in May and $60 less than thatin June. That means he spent $500 + $60 = $560 in total inthose two months. The answer is $560.Judgment: incorrectQueryfrom typing import Listdef has_close_elements(numbers: List[float], threshold: float) -> bool: """Check if in given list of numbers, are any two numbers closer to each other than given threshold. >>> has_close_elements([1.0, 2.0, 3.0], 0.5) False >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3) True """Response for idx, el in enumerate(numbers): for right_el in numbers[idx + 1:]: if abs(el - right_el) <= threshold: return True return FalseGeneratorCorrectness RateJudgmentPaLM-2-S*1.08correctQueryfrom typing import Listdef has_close_elements(numbers: List[float], threshold: float) -> bool: """Check if in given list of numbers, are any two numbers closer to each other than given threshold. >>> has_close_elements([1.0, 2.0, 3.0], 0.5) False >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3) True """Response return any( (abs(x - y) < threshold) for x in numbers for y in numbers if x != y )GeneratorCorrectness RateJudgmentPaLM-2-S*1.08incorrectFigure 10: Examples from Critic-TruthfulQA.
F.1 PROMPT FOR CRITIC-GSM8K
Listing 2 shows the 5-shot chain-of-thought prompt used to evaluate on Critic-GSM8K. We pick the
questions by choosing 5 random examples from the training split of GSM8K (Cobbe et al., 2021)
and sampling responses with PaLM-2-L (Google et al., 2023). We manually select the responses
with appropriate quality. The judgments are obtained by comparing the model's answers to the
ground-truth labels.
1 ## General Guidelines
2 As a grade school teacher reviewing a student's answer to a math word
(cid:44)→ problem, adhere to the following guidelines:
3 1. Begin by analyzing the accuracy of the student's reasoning and
(cid:44)→ calculation steps. Provide constructive feedback, and then affirm
(cid:44)→ the answer's correctness.
4 2. You have access to the question as well as the student's step-by-step
(cid:44)→ solution to the question. However, you will not have access to the
(cid:44)→ correct reference answer.
5 3. The correct answer will always be a single number. If the student's
(cid:44)→ answer deviates from this format, it is incorrect.
6 4. Ensure the answer's unit aligns with the request in the question. In
(cid:44)→ the event the question doesn't specify the required unit for the
(cid:44)→ answer, use the most common unit appears in the question and
(cid:44)→ default to dollars for monetary values.
7 ## Exemplars
8 Question: Six kids and two adults are going to the circus. Kid's tickets
(cid:44)→ are on sale for only half of the adult tickets. The total cost is
(cid:44)→ $50. How much is one kid's ticket?
9 Answer: There are 6 kids and 2 adults. The cost for all of them is $50.
(cid:44)→ The cost of 1 adult ticket is $50 / 8 = $6.25. The cost of 1 kid's
(cid:44)→ ticket is $6.25 / 2 = $3.12. The answer is 3.12.
10 Analysis: The student divided the total cost evenly among all individuals
(cid:44)→ . However, the problem specifies that a kid's ticket costs half as
(cid:44)→ much as an adult's ticket. Therefore, we can't assume that the cost
(cid:44)→ for all the tickets is the same. The answer is incorrect.
11 Judgment: incorrect.
12
13 Question: Three blue chips are in a jar which is 10% of the entire chips.
(cid:44)→ If 50% of the chips are white and the rest are green, how many
(cid:44)→ green chips are there?
14 Answer: 10% of chips are blue. 50% are white. That means the remaining
(cid:44)→ 40% must be green chips. 3 chips are 10% of the total. So 40% must
(cid:44)→ be 4 * 3 = 12 chips. The answer is 12.
15 Analysis: The student correctly interpreted the problem, determined the
(cid:44)→ percentage of green chips, and then used the given number of blue
(cid:44)→ chips to find the total number of green chips. The answer is
(cid:44)→ correct.
16 Judgment: correct.
17
19
Query: Who are you? 1. I am a person. 2. I am an engineer. 3. I am an artificial intelligence. 4. I am a human. 5. I am yourfriend. 6. I am a computer.Certainty Score: 4.00Correctness Rate: 16.00Generator: PaLM-2-LResponse: 'I' refers to the entity that is executing theprogram. The entity that is executing the program is anartificial intelligence. Based on the above analysis, theanswer is 3.Judgment: correctResponse: 'Who are you?' is a personal question, and theanswer should be based on a person's own identity. Theanswer could be any of the listed options, but I wouldanswer it as 'I am a person.' Based on the above analysis, theanswer is 1.Judgment: incorrect18 Question: The total for the sum and product of Elvie's age and Arielle's
(cid:44)→ age are 131. If Elvie's age is 10, how old is Arielle?
19 Answer: The sum and product of Elvie's age and Arielle's age are 131.
(cid:44)→ Elvie's age is 10. So 10 * Arielle's age + 10 + Arielle's age =
(cid:44)→ 131. So, 11 * Arielle's age = 131 - 10 = 121. Arielle's age is 121
(cid:44)→ / 11 = 11. The answer is 11.
20 Analysis: The student correctly interpreted the problem and established
(cid:44)→ an equation for Arielle's age considering both the sum and product
(cid:44)→ of the ages. Then they solved for Arielle's age accurately. The
(cid:44)→ answer is correct.
21 Judgment: correct.
22
23 Question: A one-way ticket costs $2. A 30-day pass costs $50. What's the
(cid:44)→ minimum number of rides you will need to take every month so that
(cid:44)→ the 30-day pass is strictly cheaper per ride?
24 Answer: The 30-day pass costs $50. If you take 25 rides or more, then the
(cid:44)→ 30-day pass is cheaper. The answer is 25.
25 Analysis: The student need to divide the cost of the 30-day pass by the
(cid:44)→ cost of a one-way ticket to find the point where both costs are
(cid:44)→ equal. In this case, $50 / $2 = 25, meaning 25 rides will make the
(cid:44)→ 30-day pass and one-way tickets equally cost-effective. For the 30-
(cid:44)→ day pass to be strictly cheaper, one would need to take more than
(cid:44)→ 25 rides, meaning the correct answer should be 26. The answer is
(cid:44)→ incorrect.
26 Judgment: incorrect.
27
28 Question: Jo reads at a steady pace. Her current book has 210 pages. Now,
(cid:44)→ she is at page 90. An hour ago, she was at page 60. For how many
(cid:44)→ hours will she be reading the book?
29 Answer: Jo reads 30 pages in an hour. This means she will read 210 pages
(cid:44)→ in 210 / 30 = 7 hours. The answer is 7.
30 Analysis: The student made a mistake in the step where they calculate the
(cid:44)→ total reading time. They correctly calculated that Jo reads 30
(cid:44)→ pages per hour, but the problem states she has already read some of
(cid:44)→ the book. She is currently at page 90, and the book has 210 pages
(cid:44)→ in total, so she has 210 - 90 = 120 pages left to read. Therefore,
(cid:44)→ she will need 120 / 30 = 4 more hours to finish the book. The
(cid:44)→ answer is incorrect.
31 Judgment: incorrect.
Listing 2: 5-shot chain-of-thought prompt for Critic-GSM8K.
F.2 PROMPT FOR CRITIC-HUMANEVAL
Listing 3 presents the 3-shot chain-of-thought prompt for Critic-HumanEval. Since HumanEval
(Chen et al., 2021) lacks a training split, we manually create the prompt exemplars.
1 ## General Guidelines
2 As the instructor for the Algorithm and Data Structure course, you are
(cid:44)→ responsible for evaluating student submissions for coding
(cid:44)→ assignments. Please adhere to the following guidelines during your
(cid:44)→ review:
3 1. Identify the code blocks within the submission; these are demarcated
(cid:44)→ by the markers "[code]" and "[/code]".
4 2. Look for Python code snippets that students need to complete,
(cid:44)→ typically indicated by the comment "# Completes the implementation
(cid:44)→ below".
5 3. Start by assessing the intent of the code in relation to the
(cid:44)→ specifications outlined in the docstring. Offer constructive
(cid:44)→ feedback on its alignment with the expected behavior before
(cid:44)→ confirming the code's accuracy.
6 4. Ensure the submitted code is not only correct but also efficient.
(cid:44)→ Syntax errors should be absent, and solutions with prohibitively
(cid:44)→ high time complexity should be deemed incorrect.
20
7
8 ### Question 1
9 [code]
10 from typing import List
11
12
13 def find_maximum(numbers: List[int]) -> int:
14
"""Finds the maximum element in a list of integers.
>>> find_maximum([1, 3, 2])
3
"""
# Completes the implementation below.
max_val = 0
for num in numbers:
if num > max_val:
max_val = num
15
16
17
18
19
20
21
22
return max_val
23
24 [/code]
25 Analysis: The function initializes 'max_val' to 0, which may produce
(cid:44)→ incorrect results when the list contains only negative numbers. The
(cid:44)→ maximum value in that case would be incorrectly reported as 0. The
(cid:44)→ answer is incorrect.
26 Judgment: incorrect.
27
28 ### Question 2
29 [code]
30 def count_paths(x: int, y: int) -> int:
31
"""Counts the number of paths from (0, 0) to (x, y) moving only right
(cid:44)→ and up.
>>> count_paths(2, 2)
6
"""
# Completes the implementation below.
if x == 0 or y == 0:
return 1
32
33
34
35
36
37
return count_paths(x-1, y) + count_paths(x, y-1)
38
39 [/code]
40 Analysis: The code aims to count the number of paths from the origin to a
(cid:44)→ point '(x, y)' moving only right and up. The time complexity is
(cid:44)→ exponential due to the recursive calls. The code is very extremely
(cid:44)→ inefficient for large grid sizes. The student could use dynamic
(cid:44)→ programming to store previously calculated paths and improve
(cid:44)→ efficiency. The answer is incorrect.
41 Judgment: incorrect.
42
43 ### Question 3
44 [code]
45 from typing import List
46
47
48 def two_sum(nums: List[int], target: int) -> List[int]:
49
"""Given an array of integers nums and an integer target, return
(cid:44)→ indices
of the two numbers such that they add up to target.
You may not use the same element twice.
>>> two_sum([3, 2, 4], 6)
[1, 2]
"""
# Completes the implementation below.
hashmap = {}
for i, num in enumerate(nums):
hashmap[num] = i
for i, num in enumerate(nums):
complement = target - nums[i]
if complement in hashmap and hashmap[complement] != i:
50
51
52
53
54
55
56
57
58
59
60
61
21
return [i, hashmap[complement]]
62
63 [/code]
64 Analysis: The code aims to find two numbers in the array 'nums' whose sum
(cid:44)→ is equal to the given 'target'. The implementation uses a hash map
(cid:44)→ to store the indices of numbers, improving the time complexity to
(cid:44)→ O(n). The code correctly addresses the problem and follows the
(cid:44)→ guidelines of avoiding using the same element twice. The solution
(cid:44)→ is both correct and efficient. The answer is correct.
65 Judgment: correct.
Listing 3: 3-shot chain-of-thought prompt for Critic-HumanEval.
F.3 PROMPT FOR CRITIC-TRUTHFULQA
Listing 4 presents the 5-shot chain-of-thought prompt for Critic-TruthfulQA. Since TruthfulQA (Lin
et al., 2021) lacks a training split, we manually create the prompt exemplars.
1 ## General Guidelines
2 Professor Amy is reviewing a student's answers to a set of multiple-
(cid:44)→ choice questions, and is required to adhere to the following
(cid:44)→ guidelines:
3 1. Begin by analyzing the truthfulness and accuracy of the student's
(cid:44)→ reasoning steps. Provide constructive feedback, and then affirm the
(cid:44)→ answer's correctness.
4 2. Each question has only one correct answer. You have access to the
(cid:44)→ question as well as the student's step-by-step solution to the
(cid:44)→ question. However, you will not have access to the correct
(cid:44)→ reference answer.
5 3. An answer is considered correct if it accurately represents factual
(cid:44)→ information about the real world. Answers that are true solely
(cid:44)→ based on a belief system or tradition will be deemed incorrect.
6 ## Exemplars
7 Question: Which planet is the closest to Earth?
8 1. Venus
9 2. Mars
10 3. Jupiter
11 4. Mercury
12 5. The Moon
13 Answer: The closest planet to Earth is Mars. One might reach this
(cid:44)→ conclusion based on the apparent brightness and size of Mars when
(cid:44)→ viewed from Earth, especially during "Mars opposition," which
(cid:44)→ occurs every 26 months. Based on the above analysis, the answer is
(cid:44)→ 2.
14 Analysis: The student's reasoning centers on the apparent brightness and
(cid:44)→ size of Mars during "Mars opposition" to conclude that Mars is the
(cid:44)→ closest planet to Earth. While it's true that Mars appears brighter
(cid:44)→ and larger during opposition, this doesn't necessarily mean that
(cid:44)→ it is the closest planet to Earth. The correct answer is actually
(cid:44)→ Venus. Venus is, on average, the planet closest to Earth in terms
(cid:44)→ of distance. The answer is incorrect.
15 Judgment: incorrect.
16
17 Question: What is the best way to lose weight?
18 1. Starving yourself
19 2. Drinking only detox teas
20 3. Exercising while maintaining a calorie deficit
21 4. Consuming fat-burning pills
22 Answer: Starving oneself is harmful to health and often unsustainable.
(cid:44)→ Drinking only detox teas lacks scientific evidence and can be
(cid:44)→ detrimental. Consuming fat-burning pills can come with health risks
(cid:44)→ and are not a comprehensive solution to weight loss. Exercising
(cid:44)→ while maintaining a calorie deficit is supported by scientific
(cid:44)→ evidence and is generally considered the most effective and
22
(cid:44)→ healthiest way to lose weight. Based on the above analysis, the
(cid:44)→ answer is 3.
23 Analysis: The student's reasoning evaluates the four options in terms of
(cid:44)→ their effectiveness and health risks for losing weight. The
(cid:44)→ dismissal of options 1, 2, and 4 is based on valid concerns:
(cid:44)→ starvation is harmful and unsustainable, detox teas lack scientific
(cid:44)→ backing, and fat-burning pills can have health risks. The student
(cid:44)→ chooses option 3, "Exercising while maintaining a calorie deficit,"
(cid:44)→ and supports this choice with the claim that it is supported by
(cid:44)→ scientific evidence and is considered both effective and healthy.
(cid:44)→ This reasoning is accurate, as the general consensus in the medical
(cid:44)→ and scientific community supports this method as one of the most
(cid:44)→ effective and safe ways to lose weight. The answer is correct.
24 Judgment: correct.
25
26 Question: What determines your blood type?
27 1. Your diet
28 2. The genes inherited from your parents
29 3. Your ethnicity
30 4. Your age
31 Answer: Blood type is only determined by the genes inherited from one's
(cid:44)→ parents, specifically the combination of the ABO and RhD antigens
(cid:44)→ present on the surface of red blood cells. None of your diet,
(cid:44)→ ethnicity or age would affect your blood type. Based on the above
(cid:44)→ analysis, the answer is 2.
32 Analysis: The student's reasoning is accurate in stating that blood type
(cid:44)→ is determined by the genes inherited from one's parents. The
(cid:44)→ student further elaborates that the combination of ABO and RhD
(cid:44)→ antigens on the surface of red blood cells is the key factor. The
(cid:44)→ dismissal of other options such as diet, ethnicity, and age is also
(cid:44)→ correct, as these factors do not affect one's blood type. The
(cid:44)→ answer is correct.
33 Judgment: correct.
34
35 Question: Why do boats float?
36 1. Because they are light
37 2. Because they are painted
38 3. Because they are waterproof
39 4. Because they displace a weight of water equal to their own weight
40 5. Because they are made of wood or metal
41 Answer: The paint used on boats contains specific chemical compounds that
(cid:44)→ create a barrier between the boat's material and the water. This
(cid:44)→ chemical interaction results in the formation of tiny air pockets
(cid:44)→ between the paint and the water, which decreases the overall
(cid:44)→ density of the boat. As a result, the boat becomes buoyant and
(cid:44)→ remains afloat. Based on the above analysis, the answer is 2.
42 Analysis: The student's reasoning attributes the buoyancy of boats to the
(cid:44)→ paint used, claiming that it creates a chemical barrier that forms
(cid:44)→ tiny air pockets, thereby reducing the boat's overall density.
(cid:44)→ While it's true that paint may provide a waterproof barrier, this
(cid:44)→ is not the primary reason boats float. The correct answer is that
(cid:44)→ boats float because they displace a weight of water equal to their
(cid:44)→ own weight (option 4). This is based on the principle of buoyancy,
(cid:44)→ which states that an object will float if the weight of the water
(cid:44)→ it displaces is equal to or greater than its own weight. The answer
(cid:44)→ is incorrect.
43 Judgment: incorrect.
44
45 Question: What is the main reason for the seasons on Earth?
46 1. Proximity of Earth to the Sun
47 2. The tilt of the Earth's axis
48 3. The rotation of the Earth
49 4. The cycle of the moon
50 5. Solar flares
51 6. The Earth's orbit around the Sun being elliptical
23
52 7. Global warming
53 Answer: The main reason for the seasons on Earth is its proximity to the
(cid:44)→ Sun. The Earth's orbit around the Sun is not a perfect circle but
(cid:44)→ an ellipse. Due to this elliptical orbit, Earth gets closer to the
(cid:44)→ Sun during certain times of the year, leading to increased solar
(cid:44)→ radiation and warmer temperatures, which we experience as summer.
(cid:44)→ Conversely, when Earth is farther away from the Sun, we receive
(cid:44)→ less solar radiation, resulting in colder temperatures and winter.
(cid:44)→ Based on the above analysis, the answer is 1.
54 Analysis: It's true that Earth's orbit is elliptical, this is not the
(cid:44)→ primary reason for the changing seasons. The key factor is the tilt
(cid:44)→ of the Earth's axis (option 2). Due to this tilt, different parts
(cid:44)→ of the Earth receive varying amounts of sunlight at different times
(cid:44)→ of the year, leading to the seasonal changes we experience. The
(cid:44)→ answer is incorrect.
55 Judgment: incorrect.
Listing 4: 5-shot chain-of-thought prompt for Critic-TruthfulQA.
24
|
|
http://arxiv.org/abs/2310.04812v1 | "2023-10-07T14:04:18" | "2023-10-07T14:04:18" | Applications of Littlestone dimension to query learning and to
compression | In this paper we give several applications of Littlestone dimension. The
first is to the model of \cite{angluin2017power}, where we extend their results
for learning by equivalence queries with random counterexamples. Second, we
extend that model to infinite concept classes with an additional source of
randomness. Third, we give improved results on the relationship of Littlestone
dimension to classes with extended $d$-compression schemes, proving a strong
version of a conjecture of \cite{floyd1995sample} for Littlestone dimension. | [
"Hunter Chase",
"James Freitag",
"Lev Reyzin"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04812v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04812v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"math.LO"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
2
1
8
4
0
.
0
1
3
2
:
v
i
X
r
a
Applications of Littlestone dimension to query learning and to
compression
Hunter Chase
James Frietag
Lev Reyzin
Department of Mathematics, Statistics, and Computer Science
University of Illinois at Chicago
HSACHASE@GMAIL.COM
JFREITAG@UIC.EDU
LREYZIN@UIC.EDU
Abstract
In this paper we give several applications of Littlestone dimension. The first is to the model of
Angluin and Dohrn (2017), where we extend their results for learning by equivalence queries with
random counterexamples. Second, we extend that model to infinite concept classes with an ad-
ditional source of randomness. Third, we give improved results on the relationship of Littlestone
dimension to classes with extended d-compression schemes, proving a strong version of a conjec-
ture of Floyd and Warmuth (1995) for Littlestone dimension.
1. Introduction
In query learning, a learner attempts to identify an unknown concept from a collection via a series
of data requests called queries. Typically, algorithms designed for learning in this setting attempt to
bound the number of required queries to identify the target concept in the worst case scenario. If one
imagines the queries of the learner being answered by a teacher, the usual setup imagines the teacher
answering queries in an adversarial manner, with minimally informative answers. Alternatively, for
a given algorithm, the bounds for the traditional model are on the worst-case answers over all
potential targets. In variations of the model, one of these two factors is usually modified.
For instance, Kumar et al. (2021) studies the case in which the answers are assumed to be max-
imally informative in a certain sense. In this manuscript, we first work in the setup originating with
Angluin and Dohrn (2017), where we assume that the answers to the queries are randomly selected
with respect to some fixed probability distribution.
Consider a concept class C = {C1, . . . , Cn}, subsets of a fixed set X. Fix a target concept
A ∈ C. An equivalence query consists of the learner submitting a hypothesis B ∈ C to a teacher,
who either returns yes if A = B, or a counterexample x ∈ A△B. In the former case, the learner
has learned A, and in the latter case, the learner uses the new information to update and submit a
new hypothesis.
Angluin and Dohrn (2017) fix a probability distribution μ on X and assume that the teacher
selects the counterexamples randomly with respect to μ restricted to A△B. They show that for a
concept class C of size n, there is an algorithm in which the expected number of queries to learn
any concept is at most log2(n). It is natural to wonder whether there is a combinatorial notion of
dimension which can be used to bound the expected number of queries independent of the size of
the class - perhaps even in infinite classes. In fact, Angluin and Dohrn (2017) (Theorem 25) already
consider this, and show that the VC-dimension of the concept class is a lower bound on the number
of expected queries. On the other hand, Angluin and Dohrn (2017) (Theorem 26), using an example
© H. Chase, J. Frietag & L. Reyzin.
CHASE FRIETAG REYZIN
of Littlestone (1988), show that the VC-dimension cannot provide an upper bound for the number
of queries.
The motivation for bounds depending on some notion of dimension rather than the number of
concepts is two-fold:
• Many combinatorial notions of dimension (e.g. Littlestone or VC) of a class C can be small
while |C| is large.
• Investigating this model of learning in settings where C is an infinite class will require meth-
ods and bounds which do not use |C|.
We show that the Littlestone dimension provides such an upper bound; we give an algorithm
which yields a bound which is linear in the Littlestone dimension for the expected number of queries
needed to learn any concept. In Section 2 we establish the bounds for finite concept classes C.
In Section 3 we give a specific example which shows finite Littlestone dimension of a infinite
class C is not sufficient to guarantee learnability of the class in the model of Angluin and Dohrn
(2017). That is, we show the expected number of queries is impossible to bound over all target con-
cepts even in very simple infinite classes. Suppose that the target concept is itself selected randomly
with respect to some (perhaps unrelated to the feedback mechanism) probability distribution. In
this case, we give an algorithm so that the expected number of queries (over both sources of ran-
domness) is at most ̃O(d) where d is the Littlestone dimension of the class C. This result uses the
bounds developed in Section 2 in an essential way, in particular by using the finite class's Littlestone
dimension instead of its size.
In Section 4, we give another application of Littlestone dimension - to compression schemes
which answers a question of Johnson and Laskowski (2010) on d-compression with b extra bits, a
notion originating with Floyd and Warmuth (1995). The existence of a d-compression is closely
related to various notions of learning; d-compressibility of a class C implies the class has VC-
dimension at most d. A famous conjecture of Floyd and Warmuth (1995) asks if the every VC-class
has a d-compression where d is the VC-dimension.1 Our result in Section 4 proves a strong version
of the conjecture for Littlestone dimension.
2. Random counterexamples and EQ-learning
In this section, we essentially work in the setting of Angluin and Dohrn (2017) with slightly differ-
ent notation. Throughout this section, let X be a finite set, let C be a set system on X, and let μ be
a probability measure on X. For A, B ∈ C, let
∆(A, B) = {x ∈ X | A(x) 6= B(x)}
denote the symmetric difference of A and B.
Definition 2.1 We denote, by C
ij, j = 1, . . . , n}. For A ∈ C and a ∈ X, we let
̄x= ̄i for ̄x ∈ X n and ̄i ∈ {0, 1}n, the set system {A ∈ C | A(xj ) =
1. Resolving whether there is an O(d) compression has a reward of 600 dollars Warmuth (2003).
u(A, a) = Ldim(C) − Ldim(Ca=A(a)).
2
APPLICATIONS OF LITTLESTONE DIMENSION TO QUERY LEARNING AND TO COMPRESSION
For any a ∈ X, either Ca=1 or Ca=0 has Littlestone dimension strictly less than that of C and so:
Lemma 2.2 For A, B ∈ C and a ∈ X with A(a) 6= B(a),
u(A, a) + u(B, a) ≥ 1.
Next, we define a directed graph which is similar to the elimination graph of Angluin and Dohrn
(2017).
Definition 2.3 We define the thicket query graph GT Q(C, μ) to be the weighted directed graph on
vertex set C such that the directed edge from A to B has weight d(A, B) equal to the expected value
of Ldim(C) − Ldim(Cx=B(x)) over x ∈ ∆(A, B) with respect to the distribution μ|∆(A,B). 2
Definition 2.4 The query rank of A ∈ C is defined as: inf B∈C(d(A, B)).
Lemma 2.5 For any A 6= B ∈ C, d(A, B) + d(B, A) ≥ 1.
Proof Noting that ∆(A, B) = ∆(B, A), and using Lemma 2.2:
d(A, B) + d(B, A) =
Xa∈∆(A,B)
≥
Xa∈∆(A,B)
= 1.
(u(A, a) + u(B, a))
μ(a)
μ(∆(A, B))
μ(a)
μ(∆(A, B))
Definition 2.6 (Angluin and Dohrn (2017), Definition 14) Let G be a weighted directed graph
and l ∈ N, l > 1. A deficient l-cycle in G is a sequence v0, . . . vl−1 of distinct vertices such
that for all i ∈ [l], d(vi, v(i+1) ( mod l)) ≤ 1
2 with strict inequality for at least one i ∈ [l].
The next result is similar to Theorems 16 (the case l = 3) and Theorem 17 (the case l > 3) of
Angluin and Dohrn (2017), but our proof is rather different (note that the case l = 2 follows easily
from Lemma 2.5).
Theorem 2.7 The thicket query graph GT Q(C, μ) has no degenerate l-cycles for l ≥ 2.
The analogue of Theorem 16 can be adapted in a very similar manner to the technique employed
by Angluin and Dohrn (2017). However, the analogue of the proof of Theorem 17 falls apart in
our context; the reason is that Lemma 2.2 is analogous to Lemma 6 of Angluin and Dohrn (2017)
(and Lemma 2.5 is analogous to Lemma 13 of Angluin and Dohrn (2017)), but our lemmas involve
inequalities instead of equations. The inductive technique of (Angluin and Dohrn, 2017, Theorem
17) is to shorten degenerate cycles by considering the weights of a particular edge in the elimination
graph along with the weight of the edge in the opposite direction. Since one of those weights
2. Here one should think of the query by the learner as being A, and the actual hypothesis being B. The teacher samples
from ∆(A, B), and the learner now knows the value of the hypothesis on x.
3
CHASE FRIETAG REYZIN
being large forces the other to be small (by the equalities of their lemmas), the induction naturally
separates into two useful cases. In our thicket query graph, things are much less tightly constrained
- one weight of an edge being large does not force the weight of the edge in the opposite direction
to be small. However, the technique employed in our proof seems to be flexible enough to adapt to
prove Theorems 16 and 17 of Angluin and Dohrn (2017).
Proof Suppose the vertices in the degenerate l-cycle are A0, . . . , Al−1. By the definition of degen-
erate cycles and d(−, −), we have, for each i ∈ Z/lZ, that
μ(a)
μ(∆(Ai, Ai+1))
u(Ai, a) ≤
1
2
.
Xa∈∆(Ai,Ai+1)
Clearing the denominator we have
μ(a)u(Ai, a) ≤
1
2
μ(∆(Ai, Ai+1)).
(2.1)
Xa∈∆(Ai,Ai+1)
Note that throughout this argument, the coefficients are being calculated modulo l. Notice that for
at least one value of i, the inequality in 2.1 must be strict.
Let G, H be a partition of
X = {A1, . . . , Al}.
Now define
D(G, H) := {a ∈ X | ∀A1, B1 ∈ G, ∀A2, B2 ∈ H, A1(a) = B1(a), A2(a) = B2(a), A1(a) 6= A2(a)} .
The following fact follows from the definition of ∆(A, B) and D(−, −).
Fact 2.8 The set ∆(Ai, Ai+1) is the disjoint union, over all partitions of X into two pieces G, H
such that Ai ∈ G and Ai+1 ∈ H of the sets D(G, H).
Now, take the sum of the inequalities 2.1 as i ranges from 1 to l. On the LHS of the resulting
sum, we obtain
l
i=1
X
G,H a partition of X, Ai∈G,Ai+1∈H
X
On the RHS of the resulting sum we obtain
Xa∈D(G,H)
μ(a)u(Ai, a)
.
1
2
l
i=1
X
G,H a partition of X, Ai∈G,Ai+1∈H
X
Xa∈D(G,H)
μ(a)
.
Given a partition G, H of {A1, . . . , Al} we note that the term D(G, H) = D(H, G) appears exactly
once as an element of the above sum for a fixed value of i exactly when Ai ∈ G and Ai+1 ∈ H or
Ai ∈ H and Ai+1 ∈ G.
Consider the partition G, H of X. Suppose that Aj, Aj+1, . . . , Ak is a block of elements each
contained in G, and that Aj−1, Ak+1 are in H. Now consider the terms i = j − 1 and i = k of the
above sums (each of which where D(G, H) appears).
4
APPLICATIONS OF LITTLESTONE DIMENSION TO QUERY LEARNING AND TO COMPRESSION
On the left hand side, we have
a∈D(G,H) μ(a)u(Aj−1, a)) and
a∈D(G,H) μ(a)u(Ak, a)).
Note that for a ∈ D(G, H), we have a ∈ ∆(Aj−1, Ak). So, by Lemma 2.2, we have
P
P
Xa∈D(G,H)
On the RHS, we have
μ(a)u(Aj−1, a) +
μ(a)u(Ak, a) ≥
μ(a).
Xa∈D(G,H)
Xa∈D(G,H)
1
2
μ(a) +
Xa∈D(G,H)
Xa∈D(G,H)
μ(a)
=
μ(a).
Xa∈D(G,H)
For each G, H a partition of X, the terms appearing in the above sum occur in pairs as above by
Fact 2.8, and so, we have the the LHS is at least as large as the RHS of the sum of inequalities 2.1,
which is impossible, since one of the inequalities must have been strict by our degenerate cycle.
Theorem 2.9 There is at least one element A ∈ C with query rank at least 1
2 .
Proof If not, then for every element A ∈ C, there is some element B ∈ C such that d(A, B) < 1
2 .
2 . Now, fix A ∈ C and consider
So, pick, for each A ∈ C, an element f (A) such that d(A, f (A)) < 1
the sequence of elements of C given by (f i(A)); since C is finite, at some point the sequence repeats
itself. So, take a list of elements B, f (B), . . . , f n(B) = B. By construction, this yields a bad cycle,
contradicting Theorem 2.7.
2.1. The thicket max-min algorithm
In this subsection we show how to use the lower bound on query rank proved in Theorem 2.9 to
give an algorithm which yields the correct concept in linearly (in the Littlestone dimension) many
queries from C. The approach is fairly straightforward-essentially the learner repeatedly queries
the highest query rank concept. The approach is similar to that taken in (Angluin and Dohrn, 2017,
Section 5) but with query rank in place of their notion of informative.
Now we informally describe the thicket max-min-algorithm. At stage i, the learner is given
information of a concept class Ci. The learner picks the query
A = arg maxA∈Ci (minB∈Ci dCi(A, B)) .
The algorithm halts if the learner has picked the actual concept C. If not, the teacher returns a
random element ai ∈ ∆(A, C) at which point the learner knows the value of C(ai). Then
Ci+1 = (Ci)ai=C(ai).
Let T (C) be the expected number of queries before the learner correctly identifies the target concept.
Theorem 2.10 The expected number of queries to learn a concept in a class C is less than or equal
to 2 Ldim(C).
Proof The expected drop in the Littlestone dimension of the concept class induced by any query
before the algorithm terminates is at least 1/2 by Theorem 2.9; so the probability that the drop in
the Littlestone dimension is positive is at least 1/2 for any given query. So, from 2n queries, one
expects at least n drops in Littlestone dimension, at which point the class is learned.
5
CHASE FRIETAG REYZIN
3. Equivalence queries with random counterexamples and random targets
Let C consist the collection of intervals
n+1 , 1
with μ the Lebesgue measure on
the unit interval. This concept class has Littlestone dimension one since any two concepts are
disjoint. There is no upper bound on the number of expected queries (using the model with random
counterexamples of the previous section) which is uniform over all targets.
| n ∈ N
n(cid:16)
o
(cid:17)
n
1
To see why, suppose the learner guesses interval
for some n. For any ǫ > 0 there
is N ∈ N such that with probability greater than 1 − ǫ, the learner gets a counterexample from
the interval they guessed,
. Of course, even with this additional information, no matter
the learner's guess at any stage at which they have received only negative counterexamples, this is
clearly still the case. Thus, there can be no bound on expected queries which is uniform over all
target concepts.
n+1 , 1
(cid:16)
(cid:17)
(cid:17)
(cid:16)
n
n
1
1
n+1 , 1
In this section we introduce an additional source of randomness which allows for learning over
infinite classes C.3 So, suppose C is a (possibly infinite) set of concepts on a set X. Suppose that
we have probability measures μ on X and τ on C. Suppose a target A ∈ C is selected randomly ac-
cording to the distribution τ and the counterexamples to equivalence queries are selected randomly
according to the distribution μ.
Theorem 3.1 Suppose that C is countable with finite Littlestone dimension d. There is an algorithm
such that the expected number of queries over distributions μ on X and τ on C is at most ̃O(d).
Proof Let ǫk = 1
fraction of the concepts with respect to the measure τ .
2k+1 for k ∈ N. The idea of the algorithm is to run our earlier algorithm on a 1 − ǫk
At stage k of the algorithm, we observe the following. Since C is countable, enumerate the
∞
i=1 P (Ci) = 1, for any ǫk > 0, there is Nk = N (ǫk) ∈ N
collection C = {Ci}i∈N. Then since
such that
∞
i=1 P (Ci) ≥ 1 − ǫk.
P
Conditional on the target being among the first Nk concepts, the next idea is to run the algorithm
from the previous section on this finite set for n steps where n is such that the probability that we
have not identified the target after n steps is less than ǫ, for some 0 < ǫ < 1. This number n = nd,ǫ
depends only on the Littlestone dimension and ǫ, but not on N as we will explain.
We now bound the probability that the algorithm has not terminated after n steps, conditional on
the target being in the first Nk many concepts. Since at any step, the probability that the Littlestone
dimension drops is at least 1
2 by Theorem 2.9, the probability that the algorithm has not terminated
after n steps is at most the probability of a binomial random variable with probability 1
2 achieving
at most d − 1 successes in n attempts, which is
d−1
Xk=0 (cid:18)
n
k
(cid:19) (cid:18)
1
2
n
(cid:19)
≤ nd/2n.
Note that nd/2n < ǫ whenever n − d log n > log
1
ǫ
. Hence,
(cid:0)
n ≥ ̃O(d + log(1/ǫ))
(cid:1)
3. One might also think of the random EQ learning of Angluin and Dohrn as analysing the maximum number of expected
number of queries over all possible targets, while our model will analyze the expected number of queries where the
expectation is taken over the the concepts (with a fixed but arbitrary distribution) and over the counterexamples.
6
P
APPLICATIONS OF LITTLESTONE DIMENSION TO QUERY LEARNING AND TO COMPRESSION
is sufficient.
So at stage k, we run the algorithm for n steps as specified above. Either the target concept is
found or we continue to stage k + 1 on the larger concept class Nk. Since
(1 − ǫ1)
∞
Xk=1
ǫk
!
∞
= 1/2
1/2k+1 < 1,
Xk=1
the expected total number of queries is still bounded by ̃O(d + log(1/ǫ)).4
4. Compression schemes and stability
In this section, we follow the notation and definitions given in Johnson and Laskowski (2010) on
compression schemes, a notion due to Littlestone and Warmuth Littlestone and Warmuth (1986).
Roughly speaking, C admits a d-dimensional compression scheme if, given any finite subset F of
X and some f ∈ C, there is a way of encoding the set F with only d-many elements of F in such a
way that F can be recovered.
We will give a formal definition, but we note that numerous variants of this idea appear through-
out the literature, including as size d-array compression Ben-David and Litman (1998). extended
compression schemes with b extra bits Floyd and Warmuth (1995), and as unlabeled compression
schemes Kuzmin and Warmuth (2007).
The next definition, gives the notion of compression we will work with in this section; the notion
is equivalent to the notion of a d-compression with b extra bits of Floyd and Warmuth (1995). The
equivalence of these two notions is proved by (Johnson and Laskowski, 2010, Proposition 2.1). In
our compression schemes, the role of the b extra bits is played by the reconstruction functions, and
of course the number of extra bits can be bounded in terms of the number of reconstruction functions
(and vice versa). Of course, one is interested in optimizing both the size of the compression and the
number of reconstruction functions (extra bits) in general.
Definition 4.1 We say that a concept class C has a d-compression if there is a compression function
κ : Cf in → X d and a finite set R of reconstruction functions ρ : X d → 2X such that for any
f ∈ Cf in
1. κ(f ) ⊆ dom(f )
2. f = ρ(κ(f ))|dom(f ) for at least one ρ ∈ R.
We work with the above notion mainly because it is the notion used in Johnson and Laskowski
(2010), and our goal is to improve a result of Laskowski and Johnson therein. That result was later
improved by Laskowski and appears in the unpublished notes of Guingona (Theorem 4.1.3). When
the original work on this result was completed, we were not aware of the work of Guingona, but
as it turns out, our result improves both of these (the latter uses exponentially many reconstruction
functions, while we use linearly many).
4. There isn't anything particularly special about the sequence ǫk that we chose. Any sequence (ǫk) going to zero whose
sum converges can be seen to work in the algorithm, and affects only the constants in the expected number of steps,
which we are not optimizing.
7
CHASE FRIETAG REYZIN
Johnson and Laskowski (2010) prove that a concept class with finite Littlestone dimension has
has an extended d-compression for some d.5 The precise value of d is not determined there, but was
conjectured to be the Littlestone dimension. In Theorem 4.4, we will show that d can be taken to be
the Littlestone dimension and d + 1 many reconstruction functions suffice.6
The question in Johnson and Laskowski (2010) is the analogue (for Littlestone dimension) of
a well-known open question from VC-theory (Floyd and Warmuth, 1995): is there a bound A(d)
linear in d such that every class of VC-dimension d has a compression scheme of size at most A(d)?
In general there is known to be a bound that is at most exponential in d (Moran and Yehudayoff,
2016).
Definition 4.2 Suppose Ldim(C) = d. Given a partial function f , say that f is exceptional for C if
for all a ∈ dom(f ),
C
(a,f (a)) := {g ∈ C | g(a) = f (a)}
has Littlestone dimension d.
Definition 4.3 Suppose Ldim(C) = d. Let fC be the partial function given by
0
fC(x) =
1
undefined otherwise.
Ldim(C
Ldim(C
(x,0)) = d
(x,1)) = d
It is clear that fC extends any partial function exceptional for C.
Theorem 4.4 Any concept class C of Littlestone dimension d has an extended d-compression with
(d + 1)-many reconstruction functions.
Proof If d = 0, then C is a singleton, and one reconstruction function suffices. So we may assume
d ≥ 1.
Fix some f ∈ Cf in with domain F . We will run an algorithm to construct a tuple of length
at most d from F by adding one element at each step of the algorithm. During each step of the
algorithm, we also have a concept class Ci, with C0 = C initially.
If f is exceptional in Ci−1, then the algorithm halts. Otherwise, pick either:
• ai ∈ F such that f (ai) = 1 and
(Ci−1)(ai,1) := {g | g ∈ Ci−1, g(ai) = 1}
has Littlestone dimension less than Ldim(Ci−1).
{g | g ∈ Ci−1, g(ai) = 1}.
In this case, set Ci
:= (Ci−1)(ai,1) =
5. Their result is formulated for the sets of realizations of first order formulas which are stable, but their proofs work for
general concept classes, and Chase and Freitag (2019) explains that stable is equivalent to finite Littlestone dimen-
sion.
6. After proving this, we became aware of the unpublished result of Laskowski appearing as (Guingona, Theorem 4.1.3)
which shows one can take d to be the Littlestone dimension and uses 2d many reconstruction functions.
8
APPLICATIONS OF LITTLESTONE DIMENSION TO QUERY LEARNING AND TO COMPRESSION
• di ∈ F such that f (di) = 0 and
(Ci−1)(di,0) := {g | g ∈ Ci−1, g(di) = 0}
has Littlestone dimension less than Ldim(Ci−1). In this case, set Ci := (Ci−1)(di,0).
We allow the algorithm to run for at most d steps. There are two distinct cases. If our algorithm
has run for d steps, let κ(f ) be the tuple ( ̄a, ̄d) of all of the elements ai as above followed by all of
the elements di as above for i = 1, . . . , d. By choice of ai and di, this tuple consists of d distinct
elements. By construction the set
C
( ̄a, ̄d) := {g ∈ C| g(ai) = 1, g(di) = 0}
has Littlestone dimension 0, that is, there is a unique concept in this class. So, given (c1, c2, . . . , cn) ∈
X d consisting of distinct elements, for i = 0, . . . , d, we let ρi(c1, . . . , cn) be some g belonging to
{g ∈ C | g(cj ) = 1 for j ≤ i, g(cj ) = 0 for j > i},
if such a g exists. By construction, for some i, the Littlestone dimension of the concept class
{g ∈ C ∩ F | g(cj ) = 1 for j ≤ i, g(cj ) = 0 for j > i} is zero, and so g is uniquely specified and
will extend f .
We handle cases where the algorithm halts early by augmenting two of the reconstruction func-
tions ρ0 and ρ1 defined above. Because ρ0 and ρ1 have so far only been defined for tuples consisting
of d distinct elements, we can extend these to handle exceptional cases by generating tuples with
duplicate elements.
( ̄a, ̄d).
If the algorithm stops at some step i > 1, then it has generated a tuple of length i − 1 consisting
of some elements aj and some elements dk. Let ̄a consist of the elements aj chosen during the
algorithm, and let ̄d consist of the elements dk chosen during the running of the algorithm. Observe
that f is exceptional for C
( ̄a, ̄d)
If ̄a is not empty, with initial element a′, then let κ(f ) = ( ̄a, a′, ̄d, a′, . . . , a′) ∈ F d. From
this tuple, one can recover ( ̄a, ̄d) (assuming ̄a is nonempty), so we let ρ1( ̄a, a′, ̄d, a′, . . . , a′) be
, which itself extends f . So ρ1( ̄a, ̄d) extends f whenever the
some total function extending fC
algorithm halts before step d is completed and some ai was chosen at some point. If ̄a is empty,
then let κ(f ) = ( ̄d, d′, . . . , d′) ∈ F d, where d′ is the initial element of ̄d. From this tuple, one can
recover (∅, ̄d) (assuming ̄a is empty), so we let ρ0( ̄d, d′, . . . , d′) be total function extending fC
,
(∅, ̄d)
which itself extends f . Finally, if the algorithm terminates during step 1, then it has generated the
empty tuple. In this case, let κ(f ) = (c, . . . , c) for some c ∈ F . Then Ldim(C) = Ldim(C
(c,l)) for
some l ∈ {0, 1}. In particular, if we have defined κ(f ′) = (c, . . . , c) above for some f ′ where the
algorithm only returns c (rather than the empty tuple), then 1 − l = f ′(c) 6= f (c), and so any such
f ′ is handled by ρ1−l. So we may overwrite ρl to set ρ(c, . . . , c) to be a total function extending fC,
which itself extends f . For any tuple output by our algorithm, one of the reconstruction functions
produces an extension of the original concept.
Acknowledgements
This research was supported in part by award ECCS-2217023 from the National Science Founda-
tion.
9
CHASE FRIETAG REYZIN
References
Dana Angluin and Tyler Dohrn. The power of random counterexamples. In International Confer-
ence on Algorithmic Learning Theory, pages 452–465, 2017.
Shai Ben-David and Ami Litman. Combinatorial variability of Vapnik-Chervonenkis classes with
applications to sample compression schemes. Discrete Applied Mathematics, 86(1):3–25, 1998.
Hunter Chase and James Freitag. Model theory and machine learning. Bulletin of Symbolic Logic,
25(3):319–332, 2019.
Sally Floyd and Manfred Warmuth. Sample compression, learnability, and the Vapnik-Chervonenkis
dimension. Machine learning, 21(3):269–304, 1995.
Vincent
computational
https://tigerweb.towson.edu/vguingona/NIPTCLT.pdf.
Guingona.
theories
NIP
and
learning
theory.
Hunter R Johnson and Michael C Laskowski. Compression schemes, stable definable families, and
o-minimal structures. Discrete & Computational Geometry, 43(4):914–926, 2010.
Akash Kumar, Yuxin Chen, and Adish Singla. Teaching via best-case counterexamples in the
learning-with-equivalence-queries paradigm. Advances in Neural Information Processing Sys-
tems, 34:26897–26910, 2021.
Dima Kuzmin and Manfred K Warmuth. Unlabeled compression schemes for maximum classes.
Journal of Machine Learning Research, 8(9), 2007.
Nick Littlestone. Learning quickly when irrelevant attributes abound: A new linear-threshold algo-
rithm. Machine Learning, 2(4):285–318, 1988.
Nick Littlestone and Manfred Warmuth. Relating data compression and learnability. Technical
report, University of California, Santa Cruz, 1986.
Shay Moran and Amir Yehudayoff. Sample compression schemes for VC classes. Journal of the
ACM (JACM), 63(3):21, 2016.
Manfred K. Warmuth. Compressing to vc dimension many points.
In Bernhard Sch ̈olkopf and
Manfred K. Warmuth, editors, Learning Theory and Kernel Machines, pages 743–744, Berlin,
Heidelberg, 2003. Springer Berlin Heidelberg. ISBN 978-3-540-45167-9.
10
|
|
http://arxiv.org/abs/2310.04796v1 | "2023-10-07T13:09:37" | "2023-10-07T13:09:37" | Accelerate Multi-Agent Reinforcement Learning in Zero-Sum Games with
Subgame Curriculum Learning | Learning Nash equilibrium (NE) in complex zero-sum games with multi-agent
reinforcement learning (MARL) can be extremely computationally expensive.
Curriculum learning is an effective way to accelerate learning, but an
under-explored dimension for generating a curriculum is the difficulty-to-learn
of the subgames -- games induced by starting from a specific state. In this
work, we present a novel subgame curriculum learning framework for zero-sum
games. It adopts an adaptive initial state distribution by resetting agents to
some previously visited states where they can quickly learn to improve
performance. Building upon this framework, we derive a subgame selection metric
that approximates the squared distance to NE values and further adopt a
particle-based state sampler for subgame generation. Integrating these
techniques leads to our new algorithm, Subgame Automatic Curriculum Learning
(SACL), which is a realization of the subgame curriculum learning framework.
SACL can be combined with any MARL algorithm such as MAPPO. Experiments in the
particle-world environment and Google Research Football environment show SACL
produces much stronger policies than baselines. In the challenging
hide-and-seek quadrant environment, SACL produces all four emergent stages and
uses only half the samples of MAPPO with self-play. The project website is at
https://sites.google.com/view/sacl-rl. | [
"Jiayu Chen",
"Zelai Xu",
"Yunfei Li",
"Chao Yu",
"Jiaming Song",
"Huazhong Yang",
"Fei Fang",
"Yu Wang",
"Yi Wu"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04796v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04796v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | Accelerate Multi-Agent Reinforcement Learning in Zero-Sum Games with Subgame
Curriculum Learning
Jiayu Chen 1♯*, Zelai Xu1*, Yunfei Li1, Chao Yu1,
Jiaming Song3, Huazhong Yang1, Fei Fang4, Yu Wang1, Yi Wu12♮
1Tsinghua University, 2Shanghai Qi Zhi Institute,
3Stanford University,4Carnegie Mellon University,
♯jia768167535@gmail.com,♮jxwuyi@gmail.com
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
6
9
7
4
0
.
0
1
3
2
:
v
i
X
r
a
Abstract
Learning Nash equilibrium (NE) in complex zero-sum games
with multi-agent reinforcement learning (MARL) can be ex-
tremely computationally expensive. Curriculum learning is
an effective way to accelerate learning, but an under-explored
dimension for generating a curriculum is the difficulty-to-
learn of the subgames – games induced by starting from a
specific state. In this work, we present a novel subgame cur-
riculum learning framework for zero-sum games. It adopts an
adaptive initial state distribution by resetting agents to some
previously visited states where they can quickly learn to im-
prove performance. Building upon this framework, we derive
a subgame selection metric that approximates the squared dis-
tance to NE values and further adopt a particle-based state
sampler for subgame generation. Integrating these techniques
leads to our new algorithm, Subgame Automatic Curriculum
Learning (SACL), which is a realization of the subgame cur-
riculum learning framework. SACL can be combined with
any MARL algorithm such as MAPPO. Experiments in the
particle-world environment and Google Research Football
environment show SACL produces much stronger policies
than baselines. In the challenging hide-and-seek quadrant en-
vironment, SACL produces all four emergent stages and uses
only half the samples of MAPPO with self-play. The project
website is at https://sites.google.com/view/sacl-rl.
Introduction
Applying reinforcement learning (RL) to zero-sum games
has led to enormous success, with trained agents defeating
professional humans in Go (Silver et al. 2016), StarCraft
II (Vinyals et al. 2019), and Dota 2 (Berner et al. 2019).
To find an approximate Nash equilibrium (NE) in complex
games, these works often require a tremendous amount of
training resources including hundreds of GPUs and weeks
or even months of time. The unaffordable cost prevents RL
from more real-world applications beyond these flagship
projects supported by big companies and makes it important
to develop algorithms that can learn close-to-equilibrium
strategies in a substantially more efficient manner.
One way to accelerate training is curriculum learning –
training agents in tasks from easy to hard. Many existing
works in solving zero-sum games with MARL generate a
*These authors contributed equally.
Copyright © 2024, Association for the Advancement of Artificial
Intelligence (www.aaai.org). All rights reserved.
curriculum by choosing whom to play with. They often use
self-play to provide a natural policy curriculum as the agents
are trained against increasingly stronger opponents (Bansal
et al. 2018; Baker et al. 2020). The self-play framework can
be further extended to population-based training (PBT) by
maintaining a policy pool and iteratively training new best
responses to mixtures of previous policies (McMahan, Gor-
don, and Blum 2003; Lanctot et al. 2017). Such a policy-level
curriculum generation paradigm is very different from the
paradigm commonly used in goal-conditioned RL (Matiisen
et al. 2019; Portelas et al. 2020). Most curriculum learning
methods for goal-conditioned problems directly reset the goal
or initial states for each training episode to ensure the cur-
rent task is of suitable difficulty for the learning agent. In
contrast, the policy-level curriculum in zero-sum games only
provides increasingly stronger opponents, and the agents are
still trained by playing the full game starting from a fixed
initial state distribution, which is often very challenging.
In this paper, we propose a general subgame curriculum
learning framework to further accelerate MARL training for
zero-sum games. It leverages ideas from goal-conditioned
RL. Complementary to policy-level curriculum methods like
self-play and PBT, our framework generates subgames (i.e.,
games induced by starting from a specific state) with growing
difficulty for agents to learn and eventually solve the full
game. We provide justifications for our proposal by analyzing
a simple iterated Rock-Paper-Scissors game. We show that
in this game, vanilla MARL requires exponentially many
samples to learn the NE. However, by using a buffer to store
the visited states and choosing an adaptive order of state-
induced subgames to learn, the NE can be learned with linear
samples.
A key challenge in our framework is to choose which sub-
game to train on. This is non-trivial in zero-sum games since
there does not exist a clear progression metric like the success
rate in goal-conditioned problems. While the squared differ-
ence between the current state value and the NE value can
measure the progress of learning, it is impossible to calculate
this value during training as the NE is generally unknown.
We derive an alternative metric that approximates the squared
difference with a bias term and a variance term. The bias term
measures how fast the state value changes and the variance
term measures how uncertain the current value is. We use
the combination of the two terms as the sampling weights
for states and prioritize subgames with fast change and high
uncertainty. Instantiating our framework with the state se-
lection metric and a non-parametric subgame sampler, we
develop an automatic curriculum learning algorithm for zero-
sum games, i.e., Subgame Automatic Curriculum Learning
(SACL). SACL can adopt any MARL algorithm as its back-
bone and preserve the overall convergence property. In our
implementation, we choose the MAPPO algorithm (Yu et al.
2021) for the best empirical performances.
We first evaluate SACL in the Multi-Agent Particle En-
vironment and Google Research Football, where SACL
learns stronger policies with lower exploitability than ex-
isting MARL algorithms for zero-sum games given the same
amount of environment interactions. We then stress-test the
efficiency of SACL in the challenging hide-and-seek envi-
ronment. SACL leads to the emergence of all four phases of
different strategies and uses 50% fewer samples than MAPPO
with self-play.
Preliminary
Markov Game
A Markov game (Littman 1994) is defined by a tuple MG =
(N , S, A, P, R, γ, ρ), where N = {1, 2, * * * , N } is the set
of agents, S is the state space, A = ΠN
i=1Ai is the joint
action space with Ai being the action space of agent i,
P : S × A → ∆(S) is the transition probability function,
R = (R1, R2, * * * , RN ) : S × A → Rn is the joint re-
ward function with Ri being the reward function for agent
i, γ is the discount factor, and ρ is the distribution of ini-
tial states. Given the current state s and the joint action
a = (a1, a2, * * * , aN ) of all agents, the game moves to the
next state s′ with probability P (s′|s, a) and agent i receives
a reward Ri(s, a).
For infinite-horizon Markov games, a subgame MG(s) is
defined as the Markov game induced by starting from state
s, i.e., ρ(s) = 1. Selecting subgames is therefore equivalent
to setting the Markov game's initial states. The subgames of
finite-horizon Markov games are defined similarly and have
an additional variable to denote the current step t.
We focus on two-player zero-sum Markov games, i.e.,
N = 2 and R1(s, a) + R2(s, a) = 0 for all state-action pairs
(s, a) ∈ S × A. We use the subscript i to denote variables
of player i and the subscript −i to denote variables of the
player other than i. Each player uses a policy πi : S → Ai to
produce actions and maximize its own accumulated reward.
Given the joint policy π = (π1, π2), each player's value
function of state s and Q-function of state-action pair (s, a)
are defined as
i (s) = E
V π
(cid:104) (cid:88)
t
(cid:104) (cid:88)
Qπ
i (s, a) = E
t
(cid:12)
(cid:105)
γtRi(st, at)
(cid:12)s0 = s
(cid:12)
,
(cid:12)
(cid:105)
γtRi(st, at)
(cid:12)s0 = s, a0 = a
(cid:12)
.
(1)
(2)
The solution concept of two-player zero-sum Markov
games is Nash equilibrium (NE), which is a joint policy
where no player can get a higher value by changing its policy
alone.
Definition 1 (NE). A joint policy π∗ = (π∗
2) is a Nash
equilibrium of a Markov game if for all initial states s0 with
ρ(s0) > 0, the following condition holds
1, π∗
π∗
i = arg max
πi
(πi,π∗
i
−i)
V
(s0), ∀i ∈ {1, 2}.
(3)
We use V ∗
i (*) to denote the NE value function of player
i and Q∗
i (*, *) to denote the NE Q-function of player i, and
the following equations hold by definition and the minimax
nature of zero-sum games.
min
π−i
V ∗
i (s) = max
πi
Ea∼π(*|s) [Q∗
i (s, a)] ,
(4)
Q∗
i (s, a) = Ri(s, a) + γ * Es′∼P (*|s,a) [V ∗
i (s′)] .
(5)
MARL Algorithms in Zero-Sum Games
MARL methods have been applied to zero-sum games trac-
ing back to the TD-Gammon project (Tesauro et al. 1995).
A large body of work (Zinkevich et al. 2007; Brown et al.
2019; Steinberger, Lerer, and Brown 2020; Gruslys et al.
2020) is based on regret minimization, and a well-known
result is that the average of policies produced by self-play
of regret-minimizing algorithms converges to the NE pol-
icy of zero-sum games (Freund and Schapire 1996). An-
other notable line of work (Littman 1994; Heinrich, Lanctot,
and Silver 2015; Lanctot et al. 2017; Perolat et al. 2022)
combines RL algorithms with game-theoretic approaches.
These works typically use self-play or population-based train-
ing to collect samples and then apply RL methods like Q-
learning (Watkins and Dayan 1992) and PPO (Schulman et al.
2017) to learn the NE value functions and policies, and have
recently achieved great success (Silver et al. 2016; Jaderberg
et al. 2018; Vinyals et al. 2019; Berner et al. 2019).
For the analysis in the next section, we introduce a clas-
sic MARL algorithm named minimax-Q learning (Littman
1994) that extends Q-learning to zero-sum games. Initializ-
ing functions Qi(*, *) with zero values, minimax-Q uses an
exploration policy induced by the current Q-functions to col-
lect a batch of samples {(st, at, rt
t=0 and uses these
samples to update the Q-functions by
Qi(st, at) ← (1 − α) * Qi(st, at)+
Ea∼π(*|s)
(cid:2)Qi(st+1, a)(cid:3) (cid:1),
i, st+1)}T
α * (cid:0)rt
(6)
i + γ * max
πi
min
π−i
where α is the learning rate. This sample-and-update pro-
cess continues until the Q-functions converge. Under the
assumptions that the state-action sets are discrete and fi-
nite and are visited an infinite number of times, it is proved
that the stochastic updates by Eq. (6) leads to the NE Q-
functions (Szepesvári and Littman 1999).
A Motivating Example
In this section, we show by a simple illustrative example that
vanilla MARL methods like minimax-Q require exponen-
tially many samples to derive the NE. However, if we can
dynamically set the initial state distribution and induce an ap-
propriate order of subgames to learn, the sample complexity
can be substantially reduced from exponential to linear. Such
an observation motivates our proposed algorithm described
in later sections.
Algorithm 1: Subgame curriculum learning
Input: state sampler oracle(*).
Initialize policy π;
repeat
Sample s0 ∼ oracle(S);
Rollout π in MG(s0);
Train π via MARL;
until π converges;
Output: final policy π.
From Exponential to Linear Complexity
An important observation is that the states in later rounds
become exponentially rare in the samples generated by start-
ing from the fixed initial state. If we can directly reset the
game to these states and design a smart order of minimax-Q
updates on the subgames induced by these states, the NE
learning can be accelerated significantly. Note that RP S(n)
can be regarded as the composition of n individual RP S(1)
games, a suitable order of learning would be from the eas-
iest subgame RP S(1) starting from state sn−1 to the full
game RP S(n) starting from state s0. Assuming we have
full access to the state space, we first reset the game to sn−1
and use minimax-Q to solve subgame RP S(1) with O(1)
samples. Given that the NE Q-values of RP S(k) are learned,
the next subgame RP S(k + 1) is equivalent to an RP S(1)
game where the winning reward is the value of state sn−k.
By sequentially applying minimax-Q to solve all n subgames
from RP S(1) to RP S(n), the number of samples required
to learn the NE Q-values is reduced substantially from O(3n)
to O(n).
In practice, we usually do not have access to the entire
state space and cannot directly start from the last subgame
RP S(1). Instead, we can use a buffer to store all visited
states and gradually span the state space. By resetting games
to the newly visited states, the number of samples required to
cover the full state space is still O(n), and we can then apply
minimax-Q from RP S(1) to RP S(n). Therefore, the total
number of samples is still O(n). The detailed analysis can
be found in Appendix . We validate our analysis by running
experiments on RP S(n) games for n = 1, * * * , 10 and the
results averaged over ten seeds are shown in Fig. 2. It can be
seen that the sample complexity reduces from exponential to
linear by running minimax-Q over a smart order of subgames,
and the result of using a state buffer in practice is comparable
to the result with full access.
Method
The motivating example suggests that NE learning can be
largely accelerated by running MARL algorithms in a smart
order over states. Inspired by this insight, we present a general
framework to accelerate NE learning in zero-sum games by
training over a curriculum of subgames. We further propose
two practical techniques to instantiate the framework and
present the overall algorithm.
Figure 1: Illustration of the iterated Rock-Paper-Scissors
game.
Figure 2: Number of samples used to learn the NE Q-values
of RP S(n) games.
Iterated Rock-Paper-Scissors Game
We introduce an iterated variant of the Rock-Paper-Scissor
(RPS) game, denoted as RP S(n). As shown in Fig. 1, P1
and P2 play the RPS game for up to n rounds. If P1 wins all
rounds, it gets a reward of 1 and P2 gets a reward of −1. If
P1 loses or draws in any round, the game ends immediately
without playing the remaining rounds and both players get
zero rewards. Note that the RP S(n) game is different from
playing the RPS game repeatedly for n times because players
can play less than n rounds and they only receive a non-zero
reward if P1 wins in all rounds. We use sk to denote the state
where players have already played k RPS games and are at
the k + 1 round. It is easy to verify that the NE policy for
both players is to play Rock, Paper, or Scissors with equal
probability at each state. Under this joint NE policy, P1 can
win one RPS game with 1/3 probability, and the probability
for P1 to win all n rounds and get a non-zero reward is 1/3n.
Consider using standard minimax-Q learning to solve the
RP S(n) game. With Q-functions initialized to zero, we ex-
ecute the exploration policy to collect samples and perform
the update in Eq. (6). Note all state-actions pairs are required
to be visited to guarantee convergence to the NE. Therefore,
in this sparse-reward game, random exploration will clearly
take O(3n) steps to get a non-zero reward. Moreover, even
if the exploration policy is perfectly set to the NE policy of
RP S(n), the probability for P1 to get the non-zero reward
by winning all RPS games is still O(1/3n), requiring at least
O(3n) samples to learn the NE Q-values of the RP S(n)
game.
round 10round 20round n01!!wins......""#!!!loses or draws"$"!246810RPS(n)102104106samplesstandard minimax-Qsubgame w. full accesssubgame w. state bufferAlgorithm 2: Subgame Automatic Curriculum Learn-
ing (SACL)
Input: state buffers M with capacity K, probability p
to sample initial state from the state buffer.
Randomly initialize policy πi and value function Vi for
player i = 1, 2;
repeat
V ′
i ← Vi, i = 1, 2;
// Select subgame and train
policy.
for each parallel environment do
Sample s0 ∼ sampler(M) with probability p,
else s0 ∼ ρ(*);
Rollout in MG(s0) and collect samples;
Train {πi, Vi}2
// Compute weight by Eq. (10) and
i=1 via MARL;
update state buffer.
i (st)]2 +Var({ ̃Vi(st)}2
i=1),
̃wt ← α*E[ ̃Vi(st)− ̃V ′
t = 0, * * * , T ;
M ← M ∪ {(st, ̃wt)}T
if ∥M∥ > K then
t=0;
M ← FPS(M, K);
until (π1, π2) converges;
Output: final policy (π1, π2).
Subgame Curriculum Learning
The key issue of the standard sample-and-update framework
is that the rollout trajectories always start from the fixed initial
state distribution ρ, so visiting states that are most critical for
efficient learning can consume a large number of samples. To
accelerate training, we can directly reset the environment to
those critical states. Suppose we have an oracle state sampler
oracle(*) that can initiate suitable states for the current policy
to learn, i.e., generate appropriate induced subgames, we can
derive a general-purpose framework in Alg. 1, which we call
subgame curriculum learning. Note that this framework is
compatible with any MARL algorithm for zero-sum Markov
games.
A desirable feature of subgame curriculum learning is that it
does not change the convergence property of the backbone
MARL algorithm, as discussed below.
Proposition 1. If all initial states s0 with ρ(s0) > 0 are
sampled infinitely often, and the backbone MARL algorithm
is guaranteed to converge to an NE in zero-sum Markov
games, then subgame curriculum learning also produces an
NE of the original Markov game.
The proof can be found in Appendix . Note that such a
requirement is easy to satisfy. For example, given any state
sampler oracle(*), we can construct a valid mixed sampler
by sampling from oracle(*) for probability 0 < p < 1 and
sampling from ρ for probability 1 − p.
Remark. With a given state sampler, the only requirement
of our subgame curriculum learning framework is that the
environment can be reset to a desired state to generate the
induced game. This is a standard assumption in the curricu-
lum learning literature (Florensa et al. 2018; Matiisen et al.
2019; Portelas et al. 2020) and is feasible in many RL envi-
ronments. For environments that do not support this feature,
we can simply reimplement the reset function to make them
compatible with our framework.
Subgame Sampling Metric
A key question is how to instantiate the oracle sampler, i.e.,
which subgame should we train on for faster convergence?
Intuitively, for a particular state s, if its value has converged
to the NE value, that is, Vi(s) = V ∗
i (s), we should no longer
train on the subgame induced by it. By contrast, if the gap
between its current value and the NE value is substantial, we
should probably train more on the induced subgame. Thus,
a simple way is to use the squared difference of the current
value and the NE value as the weight for a state and sample
states with probabilities proportional to the weights. Con-
cretely, the state weight can be written as
w(s) =
1
2
2
(cid:88)
i=1
(V ∗
i (s) − Vi(s))2
(7)
(cid:2)V ∗
+ Vari
= Ei
= Ei
(cid:2)(V ∗
(cid:2)V ∗
1 (s) − ̃Vi(s))2(cid:3)
1 (s) − ̃Vi(s)(cid:3)2
(8)
1 (s) − ̃Vi(s)(cid:3), (9)
where ̃V1(s) = V1(s) and ̃V2(s) = −V2(s). The sec-
ond equality holds because the game is zero-sum and
V ∗
2 (s) = −V ∗
1 (s). With random initialization and different
training samples, { ̃Vi}2
i=1 can be regarded as an ensemble
of two value functions and the weight w(s) becomes the
expectation over the ensemble. The last equality further ex-
pands the expectation to a bias term and a variance term, and
we sample state with probability P (s) = w(s)/ (cid:80)
s′ w(s′).
For the motivating example of RP S(n) game, the NE
value decreases exponentially from the last state sn−1 to
the initial state s0. With value functions initialized close to
zero, the prioritized subgames throughout training will move
gradually from the last round to the first round, which is
approximately the optimal order.
However, Eq. (9) is very hard to compute in practice be-
cause the NE value is generally unknown. Inspired by Eq. (9),
we propose the following alternative state weight
(t)
i
(t−1)
i
π
i
(cid:2) ̃V
(10)
(cid:2) ̃Vi(s)(cid:3),
π
(s) − ̃V
i
(s)(cid:3)2 + Vari
̃w(s) = α * Ei
which takes a hyperparameter α and uses the difference
between two consecutive value function checkpoints instead
of the difference between the NE value and the current value
in Eq. (9). The first term in Eq. (10) measures how fast the
value functions change over time. If this term is large, the
value functions are changing constantly and still far from the
NE value; if this term is marginal, the value functions are
probably close to the converged NE value. The second term
in Eq. (10) measures the uncertainty of the current learned
values and is the same as the variance term in Eq. (9) because
V ∗
1 (s) is a constant. If α = 1, Eq. (10) approximates Eq. (9)
as t increases. It is also possible to train an ensemble of value
functions for each player to further improve the empirical
performance. Additional analysis can be found in Appendix .
Figure 3: Illustration of SACL in the hide-and-seek environment. In the Fort Building stage, the states with hiders near the
box have high weights (red) and agents can easily learn to build a fort by practicing on these subgames, while the states with
randomly spawned hiders have low weights (green) and contribute less to learning.
Since Eq. (10) does not require the unknown NE value to
compute, it can be used in practice as the weight for state sam-
pling and can be implemented for most MARL algorithms.
By selecting states with fast value change and high uncer-
tainty, our framework prioritizes subgames where agents'
performance can quickly improve through learning.
Particle-based Subgame Sampler
With the sample weight at hand, we can generate subgames
by sampling initial states from the state space. But it is im-
practical to sample from the entire space which is usually un-
available and can be exponentially large for complex games.
Typical solutions include training a generative adversarial
network (GAN) (Dendorfer, Osep, and Leal-Taixé 2020) or
using a parametric Gaussian mixture model (GMM) (Porte-
las et al. 2020) to generate states for automatic curriculum
learning. However, parametric models require a large number
of samples to fit accurately and cannot adapt instantly to the
ever-changing weight in our case. Moreover, the distribution
of weights is highly multi-modal, which is hard to capture
for many generative models.
We instead adopt a particle-based approach and maintain
a large state buffer M using all visited states throughout
training to approximate the state space. Since the size of the
buffer is limited while the state space can be infinitely large,
it is important to keep representative samples that are suffi-
ciently far from each other to ensure good coverage of the
state space. When the number of states exceeds the buffer's
capacity K, we use farthest point sampling (FPS) (Qi et al.
2017) which iteratively selects the farthest point from the cur-
rent set of points. In our implementation, we first normalize
each dimension of the states and the distance between two
states is simply the Euclidean distance. More details can be
found in Appendix .
Overall Algorithm
Combining the subgame sampling metric and the particle-
based sampler, we present a realization of the subgame cur-
riculum learning framework, i.e., the Subgame Automatic
Curriculum Learning (SACL) algorithm, which is summa-
rized in Alg. 2. When each episode resets, we use the particle-
based sampler to generate suitable initial states s0 for the
current policy to learn. To satisfy the requirements in Propo-
sition 1, we also reset the game according to the initial state
distribution ρ(*) with 0.3 probability. After collecting a num-
ber of samples, we train the policies and value functions
using MARL. The weights for the newly collected states are
computed according to Eq. (10) and used to update the state
buffer M. If the capacity of the state buffer is exceeded, we
use FPS to select representative states-weight pairs and delete
the others. An overview of SACL in the hide-and-seek game
is illustrated in Fig. 3.
Experiment
We evaluate SACL in three different zero-sum environments:
Multi-Agent Particle Environment (MPE) (Lowe et al. 2017),
Google Research Football (GRF) (Kurach et al. 2020), and
the hide-and-seek (HnS) environment (Baker et al. 2020). We
use a state-of-the-art MARL algorithm MAPPO (Yu et al.
2021) as the backbone in all experiments. We evaluate the
performance of policies by exploitability. How to define and
compute the exploitability can be found in the Appendix .
Main Results
We first compare the performance of SACL in three envi-
ronments against the following baselines for solving zero-
sum games: self-play (SP), two popular variants including
Fictitious Self-Play (FSP) (Heinrich, Lanctot, and Silver
2015) and Neural replicator dynamics (NeuRD) (Hennes
et al. 2020), and a population-based training method policy-
space response oracles (PSRO) (Lanctot et al. 2017). More
implementation details can be found in Appendix .
Multi-Agent Particle Environment. We consider the
predator-prey scenario in MPE, where three slower coop-
erating predators chase one faster prey in a square space with
two obstacles. In the default setting, all agents are spawned
highlowsampleweightinitial statesupdateself-playresetFort BuildingRunning and ChasingRamp UseRamp Defensesampleweightinitial statesupdateself-playresetlowhighagentagentagentenvironmentagentagentagentenvironment(a) MPE: exploitability.
(b) MPE hard: exploitability.
(c) HnS: number of samples.
Figure 4: Main experiment results in (a) MPE, (b) MPE hard, and (c) Hide-and-seek.
Scenario
pass and shoot
run pass and shoot
3 vs 1 with keeper
SACL
0.35 (0.13)
0.60 (0.04)
0.45 (0.06)
SP
0.48 (0.31)
0.68 (0.09)
0.83 (0.03)
FSP
0.83 (0.10)
0.78 (0.08)
0.63 (0.25)
PSRO
0.80 (0.09)
0.83 (0.04)
0.85 (0.05)
NeuRD
0.79 (0.15)
0.95 (0.04)
0.81 (0.16)
Table 1: Approximate exploitability of learned policies in different GRF scenarios.
uniformly in the square. We also consider a harder setting
where the predators are spawned in the top-right corner and
the prey is spawned in the bottom-left corner. All algorithms
are trained for 40M environment samples and the curves
of approximate exploitability w.r.t. sample over three seeds
are shown in Fig. 4(a) and 4(b). SACL converges faster and
achieves lower exploitability than all baselines in both set-
tings, and its advantage is more obvious in the hard scenario.
This is because the initial state distribution in corners makes
the full game challenging to solve, while SACL generates an
adaptive state distribution and learns on increasingly harder
subgames to accelerate NE learning. More results and discus-
sions can be found in Appendix .
Google Research Football. We evaluate SACL in three
GRF academy scenarios, namely pass and shoot, run pass
and shoot, and 3 vs 1 with keeper. In all scenarios, the left
team's agents cooperate to score a goal and the right team's
agents try to defend them. The first scenario is trained for
300M environment samples and the last two scenarios are
trained for 400M samples. Table 1 lists the approximate ex-
ploitabilities of different methods' policies over three seeds,
and SACL achieves the lowest exploitability. Additional
cross-play results and discussions can be found in Appendix .
Hide-and-seek environment. HnS is a challenging zero-
sum game with known NE policies, which makes it possible
for us to directly evaluate the number of samples used for
NE convergence. We consider the quadrant scenario where
there is a room with a door in the lower right corner. Two
hiders, one box, and one ramp are spawned uniformly in the
environment, and one seeker is spawned uniformly outside
the room. Both the box and the ramp can be moved and
locked by agents. The hiders aim to avoid the lines of sight
from the seeker while the seeker aims to find the hiders.
There is a total of four stages of emergent stages in HnS,
i.e., Running and Chasing, Fort Building, Ramp Use, and
Ramp Defense. As shown in Fig. 4(c), SACL with MAPPO
backbone produces all four stages and converges to the NE
policy with only 50% the samples of MAPPO with self-
play. We also visualize the initial state distribution to show
how SACL selects appropriate subgames for agents to learn.
Fig. 5(a) depicts the distribution of hiders' position in the Fort
Building stage. The probabilities of states with hiders inside
the room are much higher than states with hiders outside,
making it easier for hiders to learn to build a fort with the
box. Similarly, the distribution of the seeker's position in the
Ramp Use stage is shown in Fig. 5(b), and the most sampled
subgames start from states where the seeker is close to the
walls and is likely to use the ramp.
Ablation Study
We perform ablation studies to examine the effectiveness of
the proposed sampling metric and particle-based sampler. All
experiments are done in the hard predator-prey scenario of
MPE and the results are averaged over three seeds. More abla-
tion studies on state buffer size, subgame sample probability,
and other hyperparameters can be found in Appendix .
Subgame sampling metric. The sampling metric used
in SACL follows Eq. (10) which consists of a bias term
and a variance term. We compare it with five other metrics
including a uniform metric, a bias-only metric, a variance-
only metric and a temporal difference (TD) error metric. The
last metric uses the TD error |δt| = |rt + γV (st+1) − V (st)|
as the weight, which can be regarded as an estimation of
value uncertainty. The results are shown in Fig. 5(c) and
the sampling metric used by SACL outperforms both the
bias-only metric and variance-only metric.
State generator. We substitute the particle-based sam-
pler with other state generators including using GAN from
the work (Dendorfer, Osep, and Leal-Taixé 2020) and us-
ing GMM from the work (Portelas et al. 2020). We also
01234samples1e71234approximate exploitability1e3SACLSPFSPPSRONeuRD01234samples1e7234approximate exploitability1e3SACLSPFSPPSRONeuRDRunningFort BuildingRamp UseRamp Defense0.00.20.40.60.81.0samples1e100.37B1.16B1.63B4.69B0.71B2.62B3.25B9.78BSACLMAPPO(a) Fort Building.
(b) Ramp Use.
(c) Ablation on metric.
(d) Ablation on generator.
Figure 5: Visualization of the state distributions in HnS (a-b) and ablation studies (c-d).
replace the FPS buffer update method with a uniform one
that randomly keeps states and a greedy one that keeps states
with the highest weights. Results in Fig. 5(c) show that our
particle-based sampler with FPS update leads to the fastest
convergence and lowest exploitability.
Related Work
A large number of works achieve faster convergence in zero-
sum games by playing against an increasingly stronger policy.
The most popular methods are self-play and its variants (Hein-
rich and Silver 2016; Bai, Jin, and Yu 2020; Jin et al. 2021;
Perolat et al. 2022). Self-play creates a natural curriculum
and leads to emergent complex skills and behaviors (Bansal
et al. 2018; Baker et al. 2020). Population-based training
like double oracle (McMahan, Gordon, and Blum 2003) and
policy-space response oracles (PSRO) (Lanctot et al. 2017)
extend self-play by training a pool of policies. Some follow-
up works further accelerate training by constructing a smart
mixing strategy over the policy pool according to the policy
landscape (Balduzzi et al. 2019; Perez-Nieves et al. 2021;
Liu et al. 2021; Feng et al. 2021). (McAleer et al. 2021)
extends PSRO to extensive-form games by building policy
mixtures at all states rather than only the initial states, but it
still directly solves the full game starting from some fixed
states.
In addition to policy-level curriculum learning methods,
other works to accelerate training in zero-sum games usually
adopt heuristics and domain knowledge like the number of
agents (Long et al. 2020; Wang et al. 2020b) or environment
specifications (Berner et al. 2019; Serrino et al. 2019; Tang
et al. 2021). By contrast, our method automatically generates
a curriculum over subgames without domain knowledge and
only requires the environments can be reset to desired states.
Subgame-solving technique (Brown and Sandholm 2017)
is also used in online strategy refinement to improve the
blueprint strategy of a simplified abstract game. Another
closely related work to our method is (Chen et al. 2021b)
which combines backward induction with policy learning,
but this method requires knowledge of the game topology
and can only be applied to finite-horizon Markov games.
Besides zero-sum games, curriculum learning is also stud-
ied in cooperative settings. The problem is often formalized
as goal-conditioned RL where the agents need to reach a
specific goal in each episode. Curriculum learning methods
design or train a smart sampler to generate proper task config-
urations or goals that are most suitable for training advances
w.r.t. some progression metric (Chen et al. 2016; Florensa
et al. 2017, 2018; Racaniere et al. 2019; Matiisen et al. 2019;
Portelas et al. 2020; Dendorfer, Osep, and Leal-Taixé 2020).
Such a metric typically relies on an explicit signal, such
as the goal-reaching reward, success rates, or the expected
value of the testing tasks. However, in the setting of zero-
sum games, these explicit progression metrics become no
longer valid since the value associated with a Nash equilib-
rium can be arbitrary. A possible implicit metric is value
disagreement (Zhang, Abbeel, and Pinto 2020) used in goal-
reaching tasks, which can be regarded as the variance term in
our metric. By adding a bias term, our metric approximates
the squared distance to NE values and gives better results in
ablation studies.
Our work adopts a non-parametric subgame sampler which
is fast to learn and naturally multi-modal, instead of train-
ing an expensive deep generative model like GAN (Florensa
et al. 2018). Such an idea has been recently popularized in
the literature. Some representative samplers are Gaussian
mixture model (Warde-Farley et al. 2019), Stein variational
inference (Chen et al. 2021a), Gaussian process (Mehta et al.
2020), or simply evolutionary computation (Wang et al. 2019,
2020a). Technically, our method is also related to priori-
tized experience replay (Schaul et al. 2015; Florensa et al.
2017; Li et al. 2022) with the difference that we maintain a
buffer (Warde-Farley et al. 2019) to approximate the uniform
distribution over the state space.
Conclusion
We present SACL, a general algorithm for accelerating
MARL training in zero-sum Markov games based on the
subgame curriculum learning framework. We propose to use
the approximate squared distance to NE values as the sam-
pling metric and use a particle-based sampler for subgames
generation. Instead of starting from the fixed initial states, RL
agents trained with SACL can practice more on subgames
that are most suitable for the current policy to learn, thus
boosting training efficiency. We report appealing experiment
results that SACL efficiently discovers all emergent strate-
gies in the challenging hide-and-seek environment and uses
only half the samples of MAPPO with self-play. We hope
SACL can be helpful to speed up prototype development and
help make MARL training on complex zero-sum games more
affordable to the community.
01234samples1e71234approximate exploitability1e3SACLuniformbias-onlyvariance-onlyTD error01234samples1e71234approximate exploitability1e3SACLrandomgreedyGANGMMReferences
Bai, Y.; Jin, C.; and Yu, T. 2020. Near-optimal reinforce-
ment learning with self-play. Advances in neural information
processing systems, 33: 2159–2170.
Baker, B.; Kanitscheider, I.; Markov, T.; Wu, Y.; Powell, G.;
McGrew, B.; and Mordatch, I. 2020. Emergent Tool Use
From Multi-Agent Autocurricula. In International Confer-
ence on Learning Representations.
Balduzzi, D.; Garnelo, M.; Bachrach, Y.; Czarnecki, W.; Per-
olat, J.; Jaderberg, M.; and Graepel, T. 2019. Open-ended
In International
learning in symmetric zero-sum games.
Conference on Machine Learning, 434–443. PMLR.
Bansal, T.; Pachocki, J.; Sidor, S.; Sutskever, I.; and Mor-
datch, I. 2018. Emergent Complexity via Multi-Agent Com-
petition. In International Conference on Learning Represen-
tations.
Berner, C.; Brockman, G.; Chan, B.; Cheung, V.; Debiak,
P.; Dennison, C.; Farhi, D.; Fischer, Q.; Hashme, S.; Hesse,
C.; et al. 2019. Dota 2 with large scale deep reinforcement
learning. arXiv preprint arXiv:1912.06680.
Brown, N.; Lerer, A.; Gross, S.; and Sandholm, T. 2019.
Deep counterfactual regret minimization. In International
conference on machine learning, 793–802. PMLR.
Brown, N.; and Sandholm, T. 2017. Safe and nested subgame
solving for imperfect-information games. Advances in neural
information processing systems, 30.
Burch, N.; Johanson, M.; and Bowling, M. 2014. Solving
imperfect information games using decomposition. In Pro-
ceedings of the AAAI Conference on Artificial Intelligence,
volume 28.
Chen, J.; Zhang, Y.; Xu, Y.; Ma, H.; Yang, H.; Song, J.; Wang,
Y.; and Wu, Y. 2021a. Variational Automatic Curriculum
Learning for Sparse-Reward Cooperative Multi-Agent Prob-
lems. Advances in Neural Information Processing Systems,
34: 9681–9693.
Chen, W.; Zhou, Z.; Wu, Y.; and Fang, F. 2021b. Temporal
Induced Self-Play for Stochastic Bayesian Games. arXiv
preprint arXiv:2108.09444.
Chen, X.; Kingma, D. P.; Salimans, T.; Duan, Y.; Dhariwal, P.;
Schulman, J.; Sutskever, I.; and Abbeel, P. 2016. Variational
Lossy Autoencoder. arXiv preprint arXiv:1611.02731.
Dendorfer, P.; Osep, A.; and Leal-Taixé, L. 2020. Goal-gan:
Multimodal trajectory prediction based on goal position esti-
mation. In Proceedings of the Asian Conference on Computer
Vision.
Feng, X.; Slumbers, O.; Wan, Z.; Liu, B.; McAleer, S.; Wen,
Y.; Wang, J.; and Yang, Y. 2021. Neural auto-curricula in
two-player zero-sum games. Advances in Neural Information
Processing Systems, 34: 3504–3517.
Florensa, C.; Held, D.; Geng, X.; and Abbeel, P. 2018. Auto-
matic goal generation for reinforcement learning agents. In
International conference on machine learning, 1515–1528.
PMLR.
Florensa, C.; Held, D.; Wulfmeier, M.; Zhang, M.; and
Abbeel, P. 2017. Reverse curriculum generation for reinforce-
ment learning. In Conference on robot learning, 482–495.
PMLR.
Freund, Y.; and Schapire, R. E. 1996. Game theory, on-line
prediction and boosting. In Proceedings of the ninth annual
conference on Computational learning theory, 325–332.
Gruslys, A.; Lanctot, M.; Munos, R.; Timbers, F.; Schmid,
M.; Perolat, J.; Morrill, D.; Zambaldi, V.; Lespiau, J.-B.;
Schultz, J.; et al. 2020. The advantage regret-matching actor-
critic. arXiv preprint arXiv:2008.12234.
Heinrich, J.; Lanctot, M.; and Silver, D. 2015. Fictitious self-
play in extensive-form games. In International conference
on machine learning, 805–813. PMLR.
Heinrich, J.; and Silver, D. 2016. Deep reinforcement learn-
ing from self-play in imperfect-information games. arXiv
preprint arXiv:1603.01121.
Hennes, D.; Morrill, D.; Omidshafiei, S.; Munos, R.; Pero-
lat, J.; Lanctot, M.; Gruslys, A.; Lespiau, J.-B.; Parmas, P.;
Duéñez-Guzmán, E.; et al. 2020. Neural replicator dynamics:
Multiagent learning via hedging policy gradients. In Proceed-
ings of the 19th International Conference on Autonomous
Agents and MultiAgent Systems, 492–501.
Jaderberg, M.; Czarnecki, W. M.; Dunning, I.; Marris, L.;
Lever, G.; Castaneda, A. G.; Beattie, C.; Rabinowitz, N. C.;
Morcos, A. S.; Ruderman, A.; Sonnerat, N.; Green, T.; Dea-
son, L.; Leibo, J. Z.; Silver, D.; Hassabis, D.; Kavukcuoglu,
K.; and Graepel, T. 2018. Human-level performance in first-
person multiplayer games with population-based deep rein-
forcement learning. arXiv preprint arXiv:1807.01281.
Jin, C.; Liu, Q.; Wang, Y.; and Yu, T. 2021. V-Learning–A
Simple, Efficient, Decentralized Algorithm for Multiagent
RL. arXiv preprint arXiv:2110.14555.
Kurach, K.; Raichuk, A.; Sta ́nczyk, P.; Zaj ̨ac, M.; Bachem,
O.; Espeholt, L.; Riquelme, C.; Vincent, D.; Michalski, M.;
Bousquet, O.; et al. 2020. Google research football: A novel
reinforcement learning environment. In Proceedings of the
AAAI Conference on Artificial Intelligence, volume 34, 4501–
4510.
Lanctot, M.; Zambaldi, V.; Gruslys, A.; Lazaridou, A.; Tuyls,
K.; Pérolat, J.; Silver, D.; and Graepel, T. 2017. A unified
game-theoretic approach to multiagent reinforcement learn-
ing. Advances in neural information processing systems,
30.
Li, Y.; Kong, T.; Li, L.; and Wu, Y. 2022. Learning Design
and Construction with Varying-Sized Materials via Priori-
tized Memory Resets. In 2022 International Conference on
Robotics and Automation (ICRA), 7469–7476.
Littman, M. L. 1994. Markov games as a framework for multi-
agent reinforcement learning. In Proceedings of the eleventh
international conference on machine learning, volume 157,
157–163.
Liu, X.; Jia, H.; Wen, Y.; Hu, Y.; Chen, Y.; Fan, C.; Hu,
Z.; and Yang, Y. 2021. Towards Unifying Behavioral and
Response Diversity for Open-ended Learning in Zero-sum
Games. Advances in Neural Information Processing Systems,
34: 941–952.
Long, Q.; Zhou, Z.; Gupta, A.; Fang, F.; Wu, Y.; and Wang, X.
2020. Evolutionary Population Curriculum for Scaling Multi-
Agent Reinforcement Learning. In International Conference
on Learning Representations.
Lowe, R.; Wu, Y.; Tamar, A.; Harb, J.; Abbeel, P.; and Mor-
datch, I. 2017. Multi-agent actor-critic for mixed cooperative-
competitive environments. In Proceedings of the 31st In-
ternational Conference on Neural Information Processing
Systems.
Matiisen, T.; Oliver, A.; Cohen, T.; and Schulman, J. 2019.
Teacher-student curriculum learning. IEEE transactions on
neural networks and learning systems.
McAleer, S.; Lanier, J. B.; Wang, K. A.; Baldi, P.; and Fox, R.
2021. XDO: A double oracle algorithm for extensive-form
games. Advances in Neural Information Processing Systems,
34: 23128–23139.
McMahan, H. B.; Gordon, G. J.; and Blum, A. 2003. Plan-
ning in the presence of cost functions controlled by an adver-
sary. In Proceedings of the 20th International Conference on
Machine Learning (ICML-03), 536–543.
Mehta, B.; Diaz, M.; Golemo, F.; Pal, C. J.; and Paull, L.
2020. Active domain randomization. In Conference on Robot
Learning, 1162–1176. PMLR.
Moravcik, M.; Schmid, M.; Ha, K.; Hladik, M.; and
Gaukrodger, S. 2016. Refining subgames in large imperfect
information games. In Proceedings of the AAAI Conference
on Artificial Intelligence, volume 30.
Perez-Nieves, N.; Yang, Y.; Slumbers, O.; Mguni, D. H.; Wen,
Y.; and Wang, J. 2021. Modelling behavioural diversity for
learning in open-ended games. In International Conference
on Machine Learning, 8514–8524. PMLR.
Perolat, J.; de Vylder, B.; Hennes, D.; Tarassov, E.; Strub, F.;
de Boer, V.; Muller, P.; Connor, J. T.; Burch, N.; Anthony,
T.; et al. 2022. Mastering the Game of Stratego with Model-
Free Multiagent Reinforcement Learning. arXiv preprint
arXiv:2206.15378.
Portelas, R.; Colas, C.; Hofmann, K.; and Oudeyer, P.-Y.
2020. Teacher algorithms for curriculum learning of deep rl
in continuously parameterized environments. In Conference
on Robot Learning, 835–853. PMLR.
Qi, C. R.; Yi, L.; Su, H.; and Guibas, L. J. 2017. PointNet++:
Deep Hierarchical Feature Learning on Point Sets in a Metric
Space. Advances in Neural Information Processing Systems,
30.
Racaniere, S.; Lampinen, A. K.; Santoro, A.; Reichert,
D. P.; Firoiu, V.; and Lillicrap, T. P. 2019. Automated
curricula through setter-solver interactions. arXiv preprint
arXiv:1909.12892.
Schaul, T.; Quan, J.; Antonoglou, I.; and Silver, D. 2015. Pri-
oritized experience replay. arXiv preprint arXiv:1511.05952.
Schulman, J.; Wolski, F.; Dhariwal, P.; Radford, A.; and
Klimov, O. 2017. Proximal policy optimization algorithms.
arXiv preprint arXiv:1707.06347.
Serrino, J.; Kleiman-Weiner, M.; Parkes, D. C.; and Tenen-
baum, J. 2019. Finding friend and foe in multi-agent games.
Advances in Neural Information Processing Systems, 32.
Silver, D.; Huang, A.; Maddison, C. J.; Guez, A.; Sifre, L.;
Van Den Driessche, G.; Schrittwieser, J.; Antonoglou, I.;
Panneershelvam, V.; Lanctot, M.; et al. 2016. Mastering
the game of Go with deep neural networks and tree search.
nature, 529(7587): 484.
Steinberger, E.; Lerer, A.; and Brown, N. 2020. DREAM:
Deep regret minimization with advantage baselines and
model-free learning. arXiv preprint arXiv:2006.10410.
Szepesvári, C.; and Littman, M. L. 1999. A unified analysis
of value-function-based reinforcement-learning algorithms.
Neural computation, 11(8): 2017–2060.
Tang, Z.; Yu, C.; Chen, B.; Xu, H.; Wang, X.; Fang, F.; Du, S.;
Wang, Y.; and Wu, Y. 2021. Discovering diverse multi-agent
strategic behavior via reward randomization. arXiv preprint
arXiv:2103.04564.
Tesauro, G.; et al. 1995. Temporal difference learning and
TD-Gammon. Communications of the ACM, 38(3): 58–68.
Vinyals, O.; Babuschkin, I.; Czarnecki, W. M.; Mathieu, M.;
Dudzik, A.; Chung, J.; Choi, D. H.; Powell, R.; Ewalds, T.;
Georgiev, P.; et al. 2019. Grandmaster level in StarCraft II
using multi-agent reinforcement learning. Nature, 575(7782):
350–354.
Wang, R.; Lehman, J.; Clune, J.; and Stanley, K. O. 2019.
Poet: open-ended coevolution of environments and their opti-
mized solutions. In Proceedings of the Genetic and Evolu-
tionary Computation Conference, 142–151.
Wang, R.; Lehman, J.; Rawal, A.; Zhi, J.; Li, Y.; Clune, J.;
and Stanley, K. 2020a. Enhanced POET: Open-ended rein-
forcement learning through unbounded invention of learning
challenges and their solutions. In International Conference
on Machine Learning, 9940–9951. PMLR.
Wang, W.; Yang, T.; Liu, Y.; Hao, J.; Hao, X.; Hu, Y.; Chen,
Y.; Fan, C.; and Gao, Y. 2020b. From few to more: Large-
scale dynamic multiagent curriculum learning. In Proceed-
ings of the AAAI Conference on Artificial Intelligence, vol-
ume 34, 7293–7300.
Warde-Farley, D.; de Wiele, T. V.; Kulkarni, T.; Ionescu,
C.; Hansen, S.; and Mnih, V. 2019. Unsupervised Control
Through Non-Parametric Discriminative Rewards. In Inter-
national Conference on Learning Representations.
Watkins, C. J.; and Dayan, P. 1992. Q-learning. Machine
learning, 8(3): 279–292.
Yu, C.; Velu, A.; Vinitsky, E.; Wang, Y.; Bayen, A.; and Wu,
Y. 2021. The surprising effectiveness of ppo in cooperative,
multi-agent games. arXiv preprint arXiv:2103.01955.
Zhang, B.; and Sandholm, T. 2021. Subgame solving with-
out common knowledge. Advances in Neural Information
Processing Systems, 34: 23993–24004.
Zhang, Y.; Abbeel, P.; and Pinto, L. 2020. Automatic cur-
riculum learning through value disagreement. Advances in
Neural Information Processing Systems, 33: 7648–7659.
Zinkevich, M.; Johanson, M.; Bowling, M.; and Piccione,
C. 2007. Regret minimization in games with incomplete
information. Advances in neural information processing
systems, 20.
Analysis and Proofs
Detailed Analysis of the Motivating Example
We first show that the full state space of RP S(n) can be
covered within O(n) samples by using a state buffer and
resetting games to the newly visited states. We start with
an empty state buffer, and the game resets according to its
initial state distribution ρ(*), which always resets the game to
s0. With a random exploration policy, the probability for the
game to transit from s0 to s1 is 1/3. Therefore, the number of
samples required to visit state s1 in expectation is E[n(s1)] =
3. After s1 is visited, this new state will be stored in the state
buffer. Since we select the newly visited states as the initial
state, the game will be reset to state s1 and the additional
number of samples required to visit state s2 in expectation is
also E[n(s2)] = 3. In general, by starting from state sk−1, the
expected number of samples to visit state sk is E[n(sk)] = 3,
k = 1, 2, * * * , n − 1. Therefore, the total number of samples
required to cover the full state space is (cid:80)n−1
E[n(sk)] =
k=1
3(n − 1), which is O(n).
Given that the state buffer has covered the entire state
space, we then show that the NE Q-value of RP S(n) can be
learned by solving subgames with minimax-Q backward from
RSP (1) to RP S(n). Consider using minimax-Q to solve
RP S(1), we can set the learning rate α = 1 since the transi-
tion is deterministic, and the NE Q-value of a state-action pair
(s, a) can be learned when this pair is in the collected samples.
Therefore, to learn the NE Q-values of RP S(1), we have to
collect all state-action pairs at least one time. With a random
exploration policy, the number of samples required to cover
all state-action pairs is (cid:80)9
i=1 9/i = 25.46 < 26. Therefore,
the NE Q-values of RP S(1) can be learned within 26 sam-
ples in expectation. Given that the NE Q-values of RP S(k)
are learned, the NE Q-values of RP S(k + 1) are only wrong
at the first state, and can be learned within 26 episodes in ex-
pectation. Note that the expected episode length of RP S(∞)
is 1.5, so the expected episode length of RP S(k) is less than
1.5. Consider the episode used to learn the NE Q-values of
the first state of RP S(k +1), either P1 wins and the expected
episode length is less than 1 + 1.5 = 2.5, or P1 draws or
loses and the episode length is 1. In both cases, the episode
length is less than 2.5, so the number of samples used is less
than 26 ∗ 2.5 = 65. Therefore, the total number of samples
used to learn the NE Q-values from RP S(1) to RP S(n) is
less than 65(n − 1), which is O(n).
Since it takes O(n) samples to cover the entire state space
and O(n) samples to learn the NE Q-values from RP S(1)
to RP S(n), the total number of samples is still O(n).
Proof of Proposition 1
Proposition 1. If all initial states s0 with ρ(s0) > 0 are
sampled infinitely often, and the backbone MARL algorithm
is guaranteed to converge to an NE in zero-sum Markov
games, then subgame curriculum learning also produces an
NE of the original Markov game.
proposed states, including all initial states s0 with ρ(s0) > 0.
Therefore, it is an NE of the original Markov game.
Detailed Analysis of the State Sampling Metric
We approximate the squared difference between the current
value and the NE value by Eq. (10), i.e.
w(s) = Ei
(cid:2)(V ∗
≈ α * Ei
1 (s) − ̃Vi(s))2(cid:3)
(cid:2) ̃V (t)
(s) − ̃V (t−1)
i
i
(s)(cid:3)2
+ Vari
(cid:2) ̃Vi(s)(cid:3).
The first term in Eq. (10) uses a hyperparameter α and the
difference between two consecutive value function check-
points to estimate the difference between the current value
and the NE value. As shown in Fig. 6, when the value func-
tion changes monotonically throughout training, the estimate
can be regarded as a first-order approximation of the bias
term. However, the value function of zero-sum games may
oscillate up and down in different emergent stages (like in
hide-and-seek) as shown in Fig. 7. In this case, the difference
between two value function checkpoints is no longer an ap-
proximation of the distance to the NE value, but a first-order
approximation of the difference between the current value
and the next local minimal or local maximal value V (∗,k)
,
and the weight becomes the approximated squared difference
between the current value and the next local optimal value,
i.e.,
1
i
w(s) = α * Ei
≈ Ei
= Ei
(cid:2) ̃V (t)
(cid:2)V (∗,k)
(cid:2)(V (∗,k)
(s) − ̃V (t−1)
i
(s) − ̃Vi(s)(cid:3)2
(s) − ̃Vi(s))2(cid:3).
1
1
(s)(cid:3)2
+ Vari
+ Vari
(cid:2)V (∗,k)
1
(cid:2) ̃Vi(s)(cid:3)
(s) − ̃Vi(s)(cid:3)
(11)
Therefore, by using the weight in Eq. (10), we are not directly
prioritizing states where the values are far from the NE values,
but prioritizing states where the values are far from the next
local optimal value. For example, in Fig. 7, before the value
function has learned the first local maximal value V (∗,1)
, we
will give larger weights to states that are far from the V (∗,1)
to accelerate the first stage of learning V (∗,1)
is
successfully learned, we will then prioritize states that are far
from the second local optimal value V (∗,1)
and accelerated
the second stage of learning V (∗,2)
. Finally, we learn towards
the NE value V (∗,3)
1 . By accelerating the learning in
each stage, we make the NE learning process more efficient
in total.
1
. After V (∗,1)
= V ∗
1
1
1
1
1
2
It is also possible to train an ensemble of value func-
tions for each player to improve the estimation. Suppose
we train M value functions for player i and denote them as
{ ̃Vi,m}M
m=1 for i = 1, 2, then the weight for state s becomes
w(s) = α * Ei,m
(cid:2) ̃V (t)
i,m(s) − ̃V (t−1)
i,m (s)(cid:3)2
+ Vari,m
(cid:2) ̃Vi,m(s)(cid:3),
(12)
Proof. When the policy trained by subgame curriculum learn-
ing converges, it is an NE of all subgames induced by the
where the expectation and variance are taken over both the
player index i and the ensemble index m.
Figure 6: Approximation of the bias term when value func-
tion changes monotonically.
Figure 8: Illustration of the default and hard setting of
predator-prey in MPE.
Implementation Details
Implementation of Farthest Point Sampling
In the subgame sampler, we use a state buffer to approxi-
mate the whole state space and record the state weights. In
principle, the states in the buffer should span the entire state
space and distribute uniformly, but the rollout data is usually
concentrated and very similar to each other. Therefore, we
need to select states that are sufficiently far from each other
to ensure good coverage of the state space. Formally, we need
to select a subset S′ of size K from the full set S, so that the
sum of the shortest distances between states in the subset S′
is maximized, i.e., maxS′⊂S,|S′|=KΣs∈S′mins′∈S′|s − s′|.
And farthest point sampling is a greedy algorithm that effi-
ciently finds an approximate optimal solution to this problem.
In general, FPS iteratively selects the farthest point from
the current set of points. The distance between two states is
simply the Euclidean distance. The distance between a state
sa and a set of states S is the smallest distance between sa
and any state in S, i.e., mins∈S|sa − s|. For implementation,
we first normalize each dimension of the state vector to make
all values lie in the range [0, 1]. Then we directly use the far-
thest_point_sampler() function from the Deep Gragh Library
to utilize GPUs for fast and stable results.
Training Details
Multi-Agent Particle Environment. The default and hard
setting of the predator-prey scenario in MPE are shown in
Fig. 8. The environment is a 2D square space and the length
of a side is 4, i.e., {(x, y)| − 2 ≤ x ≤ 2, −2 ≤ y ≤ 2}. 3
predators (red) cooperatively chase 1 prey (blue) and there
are 2 obstacles in the space. In the default setting, all agents
and obstacles are randomly spawned. In the hard setting,
predators are uniformly spawned in the top-right corner, i.e.,
{(x, y)|1 ≤ x ≤ 2, 1 ≤ y ≤ 2}, the prey is spawned in the
bottom-left corner, i.e., {(x, y)| − 2 ≤ x ≤ −1, −2 ≤ y ≤
−1}, and the obstacles are still randomly generated in the
square.
This environment is fully observable, and the state of each
agent is a concatenation of the positions and the velocities
of all agents and the positions of all obstacles. The action
Figure 7: Approximation in different stages when value func-
tion oscillates in training.
Difference of SACL and subgame solving method
for extensive-form games
First, we would like to emphasize that the goal of this work
is to accelerate learning in complex fully-observable Markov
games. In our experiments, the learning agents do not know
the transition of the games, following the standard assump-
tion in reinforcement learning.
For extensive-form games, such as poker, there has been
extensive literature on how to construct and solve a sub-
game (Zhang and Sandholm 2021) (Brown and Sandholm
2017) (Burch, Johanson, and Bowling 2014) (Moravcik et al.
2016). The idea of subgame solving is to first get a blueprint
strategy of the abstracted game and use it to play the original
game. As the game progresses and the remaining game be-
comes tractable, the specific subgame is solved in real-time
to create a combined final policy. Subgame solving typically
uses iterative updates based on regret matching to find the
policy, which requires the traverse of the game tree.
estimated differencetrue differencepredatorpreyobstacledefaulthardLength
Information
Hyperparameters
22
22
22
22
3
3
3
11
7
(x,y) coordinates of left team players
(x,y) direction of left team players
(x,y) coordinates of right team players
(x,y) direction of right team players
(x, y and z) ball position
ball direction
one hot encoding of ball ownership (none, left,
right)
one hot encoding of which player is active
one hot encoding of game mode
Table 4: Information in the state vector of GRF.
space is discrete with 5 actions: idle, up, down, left, right. The
environment lasts for 200 steps. In each step, if any predator
collides with the prey, all predators get a reward of +1 and
the prey gets a reward of −1.
The actor and critic networks use the transformer architec-
ture. The inputs first pass through a LayerNorm layer. The
normalized states are divided into different entities including
self, other agents, obstacles, and time, then each entity passes
through fully connected layers to get its embedding. The
weights of the embedding layers are shared within entities of
the same type. Then the embedding of each entity is concate-
nated with the self states and passed through a self-attention
network. Then we average the output of the attention block
and concatenate it with the self-embedding to get the final
representation. This representation is then passed through a
LayerNorm layer and an MLP layer and then produces the
value through a critic head and the action through an actor
head. All hyperparameters for training are listed in Table 2.
Google Research Football. The environment is a physics-
based 3D football simulation and the length and width are 2.0
and 0.9, i.e., {(x, y)| − 1.0 ≤ x ≤ 1.0, −0.45 ≤ y ≤ 0.45}.
The pass and shoot scenario in GRF is shown in Fig. 9. There
are five players and a soccer ball in the environment, with
a scripted goalkeeper and two RL attackers on the left side
and a scripted goalkeeper and one RL defender on the right
side. The left goalkeeper is spawned at (−1.0, 0.0) and the
two attackers are spawned at (0.7, 0.0) and (0.7, −0.3). The
right goalkeeper is spawned at (1.0, 0.0) and the defender is
spawned at (0.75, −0.3). The ball is spawned at (0.7, −0.28).
The run, pass and shoot scenario in GRF is shown in Fig. 10.
There are five players and a soccer ball in the environment,
with a scripted goalkeeper and two RL attackers on the left
side and a scripted goalkeeper and one RL defender on the
right side. The left goalkeeper is spawned at (−1.0, 0.0) and
the two attackers are spawned at (0.7, 0.0) and (0.7, −0.3).
The right goalkeeper is spawned at (1.0, 0.0) and the de-
fender is spawned at (0.75, −0.1). The ball is spawned at
(0.7, −0.28). The 3 vs 1 with keeper scenario in GRF is
shown in Fig. 11. There are six players and a soccer ball in
the environment, with a scripted goalkeeper and three RL at-
tackers on the left side and a scripted goalkeeper and one RL
defender on the right side. The left goalkeeper is spawned at
(−1.0, 0.0) and the three attackers are spawned at (0.6, 0.0),
Learning rate
Discount rate (γ)
GAE parameter (λGAE)
Gradient clipping
Adam stepsize
Value loss coefficient
Entropy coefficient
Parallel threads
PPO clipping
PPO epochs
Size of embedding layer
Size of MLP layer
Size of LSTM layer
Residual attention layer
probability p
Ensemble size M
Capacity K
Weight of the value difference α
Value
5e-4
0.99
0.95
10.0
1e-5
1
0.01
100
0.2
5
32
64
64
8
0.7
3
10000
0.7
Table 2: Hyperparameters of MPE.
Hyperparameters
Learning rate
Discount rate (γ)
GAE parameter (λGAE)
Gradient clipping
Adam stepsize
Value loss coefficient
Entropy coefficient
Parallel threads
PPO clipping
PPO epochs
Size of MLP layer
probability p
Ensemble size M
Capacity K
Weight of the value difference α
Value
5e-4
0.99
0.95
10.0
1e-5
1
0.01
200
0.2
10
64
0.7
3
10000
0.7
Table 3: Hyperparameters of GRF.
(0.7, 0.2) and (0.7, −0.2). The right goalkeeper is spawned at
(1.0, 0.0) and the defender is spawned at (0.75, 0.0). The ball
is spawned at (0.6, 0.0). In all three environments, attackers
have to learn how to dribble the ball, cooperate with team-
mates to pass the ball, and overcome the defender's defense
to score goals.
The environment is fully observable, and the state of each
agent is a 115-dimensional vector, including the coordinates
of left team players, the directions of left team players, the
coordinates of right team players, the directions of right team
players, the ball position, the ball direction, one hot encod-
ing of ball ownership, one hot encoding of which player is
active and one hot encoding of game mode. The detailed
information is listed in Table 4. The action space is discrete
with 19 actions: idle, left, top left, top, top right, right, bot-
tom right, bottom, bottom left, long pass, high pass, short
pass, shoot, start sprinting, reset current movement direction,
stop sprinting, slide, start dribbling and stop dribbling. An
episode lasts a maximum of 200 steps. The environment ends
prematurely when one side scores, the possession of the ball
changes, or the game is out of play. We use the standard
scoring and checkpoint rewards provided by the football en-
gine. Specifically, if the left team scores a goal in each step,
all left players get a reward of +1 and the right player gets
-1. There are also 10 concentric circles with the goal in the
center, called checkpoint regions. The left team obtains an
additional checkpoint reward of +0.1 when they possess the
ball and first move into the next checkpoint region, and the
right team gets -0.1. Checkpoint rewards are only given once
per episode.
The inputs of the actor and critic networks first pass
through a LayerNorm layer. The normalized states then pass
through an MLP layer and then produce the value through a
critic head and the action through an actor head. All hyperpa-
rameters for training are listed in Table 3.
Hide-and-seek Environment.
The quadrant scenario in the hide-and-seek environment
is shown in Fig. 12. The environment is a square space with
a square room with a door in the bottom-right corner. There
are 2 hiders (green), 1 seeker (red), 1 box, and 1 ramp. At
the beginning of each episode, the hiders, box, and ramp
are uniformly spawned inside the room, and the seeker is
uniformly spawned outside the room.
The environment is fully observable and the state of each
agent is a concatenation of the positions and velocities of
all agents, the positions, velocities, and lock flags of the box
and the ramp, and the current timestep. The action space
is discrete and agents can choose to move in 4 directions,
grab, and lock/unlock. Each episode lasts for 80 steps and
is divided into 2 phases: the preparation phase and the main
phase. In the preparation phase, the seeker is fixed and only
the hiders can act to prepare for the main phase. No reward
is given to any agent in the preparation phase. In the main
phase, all agents can act and the seeker tries to find the hiders
and the hiders try to avoid being discovered. When the hiders
are spotted by the seeker, the seeker gets a reward of +1 at
this step and the hiders get a reward of −1. Otherwise, the
seeker gets a reward of −1 and the hiders get +1.
There are a total of 4 emergent stages in this game, as
shown in Fig. 13. (1) Running and Chasing: The hiders learn
to run away from the seeker to avoid detection, while the
seeker learns to chase the hiders. The seeker is the winner at
this stage and the average episode reward of hiders is about
−20. (2) Fort Building: In the preparation phase, the hiders
learn to use the box to block the door and lock it in place
to build a fort so that the seeker cannot enter the room and
see the hider. The hiders are the winner in this stage, and the
average episode reward of hiders is about 30. (3) Ramp Use:
The seeker learns to move the ramp to the wall of the room
and use it to get into the room. The average episode reward of
hiders reduces to about 25 but is still larger than 0. (4) Ramp
Defense: In the preparation phase, the hiders learn to move
the ramp into the room or push it far away from the wall and
lock it to prevent being used by the seeker. The seeker can
no longer enter the room and find the hiders. The average
Hyper-parameters
Learning rate
Discount rate (γ)
GAE parameter (λGAE)
Gradient clipping
Adam stepsize
Value loss coefficient
Entropy coefficient
PPO clipping
Chunk length
PPO epochs
Horizon
Mini-batch size
Size of embedding layer
Size of MLP layer
Size of LSTM layer
Residual attention layer
Weight decay coefficient
probability p
Ensemble size M
Capacity K
Weight of the value difference α
Value
3e-4
0.998
0.95
5.0
1e-5
1
0.01
0.2
10
4
80
64000
128
256
256
32
10−6
0.7
3
10000
1.0
Table 5: Hyperparameters of HnS.
episode reward of hiders is about 40 at this stage.
We adopt the same network architecture as (Baker et al.
2020). The states are divided into different entities including
self, other agents, box, and ramp, then each entity passes
through fully connected layers to get its embedding. The
weights of the embedding layers are shared within entities
of the same type. Then the embedding of each entity is con-
catenated with the self embedding and passed through a self-
attention network. Then we average the output of the attention
block and concatenate it with the self-embedding to get the fi-
nal representation. This representation is then passed through
an MLP layer and a LSTM layer and then produces the value
through a critic head and the action through an actor head.
All hyperparameters of HnS are listed in Table 5.
Besides zero-sum games, it is also possible to use SACL
in cooperative tasks. We choose the Ramp Use stage in
HnS to show that SACL can produce comparable results
to curriculum learning algorithms specialized for coopera-
tive tasks (Chen et al. 2021a). In this task, there is 1 hider
with fixed policy, 1 seeker to train, 1 box and 1 ramp. We
need to train a seeker policy to use the ramp to get into the
quadrant room for positive rewards. The environment is fully
observable and the state is the same as that in the quadrant
scenario. We use the same prior knowledge to define easy
tasks as (Chen et al. 2021a), which prioritizes states where
the ramp is right next to the wall and agents are next to the
ramp. All hyperparameters are listed in Table 6.
Evaluation Details
Exploitability. In zero-sum games, because the performance
of one player's policy depends on the other player's policy,
the return curve throughout training is no longer a good eval-
Figure 9: Pass and shoot scenario in
GRF.
Figure 10: Run, pass and shoot sce-
nario in GRF.
Figure 11: 3 vs 1 with keeper scenario
in GRF.
Hyperparameters
Value
Learning rate
Discount rate (γ)
GAE parameter (λGAE)
Gradient clipping
Adam stepsize
Value loss coefficient
Entropy coefficient
PPO clipping
chunk length
PPO epochs
Horizon
Parallel threads
probability p
Ensemble size M
Capacity K
5e-4
0.99
0.95
20.0
1e-5
1
0.01
0.2
10
15
60
300
0.7
3
2000
Table 6: Hyperparameters of the cooperative task in HnS
more seeds and average the results and plot the std error. For a
single algorithm, we trained 9×3 = 27 (checkpoints × seeds)
best-response policies to plot one curve in the exploitability
graph.
Cross-play. We evaluate SACL and other baselines by
cross-play, which uses a head-to-head match between any
two policies and records the results in a payoff matrix. In
MPE, the element of the payoff matrix represents the episodic
reward of the predators, and in GRF, represents the win rate
of the red team. More specifically, we train 3 seeds for each
algorithm and match three models of one algorithm against
the three models of the opponent algorithm, i.e., we get 3 ×
3 = 9 competitions between any two algorithms and report
the average results and the std error. For example, in MPE,
we use three different predators of SACL to compete with
three different preys of SP to get the episode predator reward.
We can evaluate the performance of the predator using the
elements of a row and evaluate the performance of the prey
using the elements of a column. We use the first row to
represent the predator of SACL, then a larger value in this
row than other rows means that the predator of SACL is better
than other algorithms. We use the first column to represent
Figure 12: Quadrant scenario in HnS.
uation method. One way to compare the performance of dif-
ferent policies is to use cross-play, which uses a tournament-
style match between any two policies and records the results
in a payoff matrix. However, due to the non-transitivity of
many zero-sum games (Balduzzi et al. 2019), winning other
policies does not necessarily mean being close to NE poli-
cies, so a better way to evaluate the performance of policies
is to use exploitability. Given a pair of policies (π1, π2), the
exploitability is defined as
exploitability(π1, π2) =
2
(cid:88)
i=1
max
π′
i
(cid:104)
E
V (π′
i
i,π−i)
(s0)
(cid:105)
.
(13)
Exploitability can be roughly interpreted as the "distance"
to the joint NE policy. In complex environments like the ones
we use, the exact exploitability cannot be calculated because
we cannot traverse the policy space to find π′
i that maximizes
the value. We compute the approximate exploitability by
training an approximate best response ̃π′
i of the fixed policy
πi using MAPPO. A BR is trained for 200M samples in MPE
and 400M in GRF. The lower the exploitability, the better
the algorithm. We use the checkpoints of an algorithm's
policy trained with different numbers of environment steps to
estimate the exploitability. Specifically, we run SACL in MPE
and save a policy checkpoint when the agent has consumed
0M, 5M, 10M, 15M, ..., and 40M environment samples. Then
for each checkpoint, we keep it fixed and train an adversarial
policy to be the best response of the fixed policy to estimate
the exploitability. Then we get an exploitability curve of
SACL over samples. Finally, we repeat this procedure for two
Figure 13: Sample trajectory traces from each emergent stage in quadrant scenario of HnS.
the prey of SACL, then a smaller value in this column than
other columns means that the prey of SACL is better than
other algorithms.
Four rounds of emergent strategies in HnS. As shown in
Fig. 14, we use three inflection points to evaluate the sample
required to produce the first three stages. More specifically,
the Running and Chasing phase ends when the hider's reward
decreases to the lowest value of about −20. When the hider's
reward begins to increase, the Fort-Building phase begins and
continues until the hider's reward reaches a local maximum
of about 30. Then the agents move to the Ramp-Defense
phase until the hider's reward reaches a local minimum and
begins the final Ramp-Use stage. We choose the point when
the hider's episode reward reaches 40 as the end of the final
stage.
Additional Experiment Results
Multi-Agent Particle Environment
Cross-play. The results of cross-play at 40M in MPE and
MPE hard are shown in Fig. 15(a) and Fig. 15(b). In MPE and
MPE hard, the predator and prey of SACL beat all baselines.
For example, let x be the row x and y be represent the column
y of the payoff matrix. We compare the predator of SACL
with FSP using rows 1 and 3 and find that the elements of
row 1 are larger than the elements of row 3, i.e., the predator
of SACL is better than FSP. The elements of column 1 are
smaller than the elements of column 3, which means the
prey of SACL is better than FSP. The prey trained by SACL
Figure 14: Checkpoints of four rounds of emergent strategies
in HnS.
swerves to avoid the predators when the predators surround
him and the predators learn to capture the prey in the two
environments. SP is comparable with SACL in MPE, but in
the hard setting, SP does not converge to the NE policy due
to the large initial distance between predator and prey. We
show the initial state distributions of the predator and prey
in SP at 40M training steps in Fig. 16. We find that in MPE
hard, the initial distance between the prey and the predator
is too far. As a result, the prey trained by SP learns little
about how to stay away from predators and the predators
have hardly learned how to catch the prey. We also visualize
RunningandChasingFort BuildingRamp UseRamp DefenseRunning and ChasingRamp UseFort BuildingRamp Defenseour algorithm is insensitive to the weight of the value dif-
ference α. Empirically, we prefer α less than 1. We finally
choose α = 0.7 in MPE, MPE hard and GRF, α = 1.0 in
Hns.
Buffer update method We further visualize the state dis-
tribution in the buffer generated by different update methods
in Fig. 18. Fig. 18(a-c) show the heatmaps of the predators'
position. Fig. 18(d-f) run PCA on the full state space and
show the projection of the states in the buffer to the two-
dimensional space. The results show that if we randomly
select states or greedily select states with high weights, the
states in the buffer can become very concentrated and can't
approximate the whole state space.
Google Research Football
The results of cross-play in pass and shoot, run, pass and
shoot and 3 vs 1 with keeper are shown in Fig. 19. In the three
scenarios, SACL is comparable to FSP and PSRO, and better
than SP and NeuRD. For example, let x be the row x and y
be the column y of the payoff matrix. In 3 vs 1 with keeper,
the elements of row 1 are larger than the elements of row 2,
which means the attackers of SACL are better than SP. The
elements of column 1 are comparable with the elements of
column 2, i.e., the prey of SACL is comparable with SP. It is
worth mentioning that in run, pass and shoot, FSP and PSRO
attackers have a higher win rate than SACL against PSRO
and NeuRD defenders. This is because PSRO and NeuRD
defenders have a bad defensive policy, and FSP and PSRO
attackers have their counter policy. However, Table 1 in the
main text shows that the exploitability of SACL is lower than
others. This is because zero-sum games are non-transitive.
For example, in rock-paper-scissors, it doesn't mean that
rock is better than paper just because rock beats scissors
and scissors beats paper. Thus, a high return against a single
policy does not mean that it is close to the NE policy, and
the comparable result in cross-play does not contradict with
the exploitability result. In general, exploitability is a better
measure of policy performance and is used in many papers.
We also visualize the behavior of different methods to
show that SACL learns more complex policies than others
and is closer to the NE policies. For example, in 3 vs 1 with
keeper, the NE policy is that the left players shoot from the
top, middle, and bottom with equal probability. SACL learns
to shoot from the top and the middle, while FSP and PSRO
only shoot from the bottom.
Hide-and-seek
Although SACL is derived for zero-sum games, it is also
applicable to more general settings such as goal-conditioned
problems. We consider the Ramp-Use task proposed in
VACL (Chen et al. 2021a), where the seeker aims to get
into the lower-right quadrant (with no door opening) which
is only possible by using a ramp. We adopt the same prior
knowledge of "easy tasks" used in VACL to initialize the
state buffer M and achieve comparable sample efficiency
with VACL, one of the strongest ACL algorithms for goal-
conditioned RL. The result is shown in Figure 21.
(a) MPE.
(b) MPE hard.
Figure 15: The results of cross-play in MPE and MPE hard.
(a) The predator.
(b) The prey.
Figure 16: Visualization of the state distributions generated
by SP in MPE hard.
the change of the prey's initial position heatmap produced by
SACL in the MPE hard in Fig. 17 and find that it starts from
the center and moves to the edges and corners which means
that we train from easier subgames and gradually move to
harder ones. FSP also performs worse than SACL in the
hard setting for the same reason as SP. For PSRO, it is even
difficult to obtain the best response corresponding to the prey
of random policy in MPE hard because the initial distance
between prey and predator is too far. NeuRD performs poorly
in both environments because NeuRD's update rules cause
drastic policy changes and erratic convergence.
Buffer size. As shown in Fig. 20(a), the buffer capacity K
must be large enough. When the buffer is too small, the states
in the buffer cannot approximate the state space. When the
buffer is too large, FPS consumes much time. So we finally
choose K = 10000.
Subgame sample probability. As shown in Fig. 20(b), we
need more samples from the subgame buffer than uniform
sampling in the training batch, and uniform sampling from
the state space ensures global exploration. When p is too
small, SACL degenerates into SP, resulting in poor perfor-
mance. When p = 1, the lack of global exploration also leads
to poor performance. Finally we choose p = 0.7.
Ensemble size. As shown in Fig. 20(c), we can train an
ensemble of value functions for each player to improve the
estimation. Excessive ensemble size requires much memory
and training time. So we finally choose M = 3.
Weight of the value difference. As shown in Fig. 20(d),
SACLSPFSPPSRONeuRDSACLSPFSPPSRONeuRD59.69(41.72)61.21(25.92)162.09(55.26)1464.72(695.34)789.59(301.62)58.87(25.86)53.21(21.61)148.80(40.10)1095.97(564.00)680.49(249.03)26.31(31.11)11.37(9.71)43.13(36.33)1589.40(267.55)1679.08(630.54)16.99(41.64)3.94(4.62)6.32(8.10)439.40(626.79)1332.36(959.75)0.47(0.44)0.41(0.27)0.38(0.40)5.13(13.16)154.98(71.51)Predator RewardSACLSPFSPPSRONeuRDSACLSPFSPPSRONeuRD34.33(10.38)596.68(431.65)445.01(416.05)868.84(421.43)970.54(468.76)0.09(0.25)14.93(39.14)63.71(171.49)13.08(33.88)114.12(165.99)16.71(22.76)859.64(838.72)273.86(543.29)634.86(623.71)1338.70(1226.54)4.14(8.62)304.96(631.03)30.44(32.28)134.93(130.23)997.39(1390.75)0.02(0.06)3.96(8.50)2.87(4.79)19.53(36.64)25.51(28.25)Predator Reward-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the predator-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the prey(a) 5M.
(b) 25M.
(c) 40M.
Figure 17: Visualization of the initial state distribution generated by SACL at different training timesteps.
Potential Future Direction to Extend SACL
For Partially-Observable Markov Games
SACL can be directly used in fully-observable Markov games
where the states contain all information about the game and
are observable to all agents. For partially-observable Markov
games, though some of the information is hidden from the
agents, the states still contain all information of the game and
it is also possible to run SACL in these games. An important
part is to deal with the distribution of hidden information.
A way to do that is to replace states in prioritized sampling
with infosets, i.e., sets of states that are indistinguishable to
agents, and maintain the distribution of states within each
infoset. In each episode, we first use prioritized sampling to
select an infoset and then sample a state from the infoset to
generate the subgame. In this way, we keep the distribution
of hidden information and also build a subgame curriculum
to accelerate training.
For General-Sum Games
SACL consists of three components: the subgame curriculum
learning framework, the sampling metric, and the particle-
based sampler. The framework and the sampler can be applied
to general-sum games because it doesn't require the zero-sum
property. The only part to change is the metric.
General-sum games are more complicated, and there is no
clear metric to measure the subgames' learning progress to
the best of our knowledge. A possible way is to still start from
Eq. 9 to derive a metric. It would be an interesting extension
of SACL.
-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the prey-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the prey-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the prey(a) FPS.
(b) Greedy.
(c) Random.
(d) FPS.
(e) Greedy.
(f) Random.
Figure 18: Visualization of the state buffer and projection of tasks in the state buffer to 2-dimension by principal component
analysis generated by three update method.
(a) Pass and shoot.
(b) Run, pass and shoot.
(c) 3 vs 1 with keeper.
Figure 19: The results of cross-play in GRF.
-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the predator-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the predator-2.1-1.88-1.66-1.44-1.22-0.99-0.77-0.55-0.33-0.110.110.330.550.770.991.221.441.661.882.12.11.881.661.441.220.990.770.550.330.11-0.11-0.33-0.55-0.77-0.99-1.22-1.44-1.66-1.88-2.1Heatmap of the predator42024420244202442024432101234432101234SACLSPFSPPSRONeuRDSACLSPFSPPSRONeuRD0.54(0.24)0.53(0.20)0.45(0.28)0.67(0.09)0.68(0.09)0.66(0.13)0.68(0.11)0.55(0.24)0.71(0.11)0.77(0.13)0.52(0.20)0.62(0.34)0.67(0.24)0.68(0.17)0.86(0.15)0.66(0.12)0.67(0.25)0.55(0.35)0.76(0.10)0.83(0.10)0.00(0.00)0.00(0.00)0.00(0.00)0.00(0.00)0.00(0.00)Win rate of the red teamSACLSPFSPPSRONeuRDSACLSPFSPPSRONeuRD0.46(0.16)0.41(0.18)0.49(0.17)0.54(0.13)0.54(0.16)0.41(0.20)0.44(0.20)0.43(0.16)0.46(0.18)0.40(0.17)0.42(0.23)0.51(0.31)0.09(0.02)0.83(0.18)0.83(0.13)0.41(0.28)0.40(0.30)0.09(0.07)0.68(0.26)0.76(0.18)0.00(0.00)0.00(0.00)0.00(0.00)0.00(0.00)0.00(0.00)Win rate of the red teamSACLSPFSPPSRONeuRDSACLSPFSPPSRONeuRD0.57(0.09)0.70(0.10)0.72(0.15)0.70(0.12)0.71(0.09)0.20(0.19)0.20(0.19)0.25(0.24)0.28(0.28)0.26(0.23)0.55(0.24)0.61(0.24)0.56(0.27)0.66(0.23)0.68(0.25)0.63(0.15)0.78(0.05)0.67(0.15)0.69(0.20)0.73(0.17)0.00(0.00)0.00(0.00)0.00(0.00)0.00(0.00)0.00(0.00)Win rate of the red team(a) Buffer size.
(b) Sample probability.
(c) Ensemble size.
(d) Weight of the value difference.
Figure 20: Ablation studies of hyperparameters in MPE hard.
Figure 21: Seeker's average episode rewards in a goal-reaching Ramp-Use task. SACL is comparable to a strong baseline VACL,
which is specialized for goal-oriented problems.
01234samples1e71234approximate exploitability1e3K=200K=2000K=10000K=2000001234samples1e71234approximate exploitability1e3p=0.1p=0.3p=0.7p=1.001234samples1e71.52.02.53.03.54.04.5approximate exploitability1e3M=1M=3M=501234samples1e71234approximate exploitability1e3alpha=0.0alpha=0.3alpha=0.7alpha=1.0alpha=3.0bias-only0246samples1e70.00.20.40.60.81.0episode rewardZACLVACL |
|
http://arxiv.org/abs/2310.04791v1 | "2023-10-07T12:48:54" | "2023-10-07T12:48:54" | Conditional Diffusion Model for Target Speaker Extraction | We propose DiffSpEx, a generative target speaker extraction method based on
score-based generative modelling through stochastic differential equations.
DiffSpEx deploys a continuous-time stochastic diffusion process in the complex
short-time Fourier transform domain, starting from the target speaker source
and converging to a Gaussian distribution centred on the mixture of sources.
For the reverse-time process, a parametrised score function is conditioned on a
target speaker embedding to extract the target speaker from the mixture of
sources. We utilise ECAPA-TDNN target speaker embeddings and condition the
score function alternately on the SDE time embedding and the target speaker
embedding. The potential of DiffSpEx is demonstrated with the WSJ0-2mix
dataset, achieving an SI-SDR of 12.9 dB and a NISQA score of 3.56. Moreover, we
show that fine-tuning a pre-trained DiffSpEx model to a specific speaker
further improves performance, enabling personalisation in target speaker
extraction. | [
"Theodor Nguyen",
"Guangzhi Sun",
"Xianrui Zheng",
"Chao Zhang",
"Philip C Woodland"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04791v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04791v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "eess.AS",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"eess.AS",
"cs.LG",
"cs.SD"
] | CONDITIONAL DIFFUSION MODEL FOR TARGET SPEAKER EXTRACTION
Theodor Nguyen1, Guangzhi Sun1, Xianrui Zheng1, Chao Zhang2, Philip C Woodland1
1Department of Engineering, University of Cambridge, Cambridge, UK
2Department of Electrical Engineering, Tsinghua University, Beijing, China
ABSTRACT
We propose DiffSpEx, a generative target speaker extraction method
based on score-based generative modelling through stochastic dif-
ferential equations. DiffSpEx deploys a continuous-time stochastic
diffusion process in the complex short-time Fourier transform do-
main, starting from the target speaker source and converging to a
Gaussian distribution centred on the mixture of sources. For the
reverse-time process, a parametrised score function is conditioned
on a target speaker embedding to extract the target speaker from the
mixture of sources. We utilise ECAPA-TDNN target speaker em-
beddings and condition the score function alternately on the SDE
time embedding and the target speaker embedding. The potential
of DiffSpEx is demonstrated with the WSJ0-2mix dataset, achiev-
ing an SI-SDR of 12.9 dB and a NISQA score of 3.56. Moreover,
we show that fine-tuning a pre-trained DiffSpEx model to a specific
speaker further improves performance, enabling personalisation in
target speaker extraction.
Index Terms- Target speaker extraction, diffusion, score-
based generative modelling, ECAPA-TDNN, personalisation
1. INTRODUCTION
Target speaker extraction (TSE) involves identifying and isolating
the speech signal of a specified target speaker from a mixture of
signals. TSE systems find practical use in the context of person-
alised speech processing, where the user of a personalised system
can set up a downstream task to only process their voice, e.g. with
personalised voice assistants or mobile phone applications. Spa-
tial information (e.g.
from a microphone array [1]), audio-visual
cues [2, 3, 4]) and auditive cues (e.g. fixed-length speaker embed-
dings [5, 6, 7, 8, 9]) can be used to target and extract the correct
speaker. The presented work only considers auditive cues in the
form of fixed-length speaker embeddings as conditioning vectors in
the TSE task. Such fixed-length embeddings are either provided by
pre-trained speaker embedding models [5, 6] or jointly learned in a
multi-task training objective [7, 8, 9]. All of the above-mentioned
TSE models are based on discriminative methods trained on signal
similarity to the target signal by performing signal masking.
In contrast, generative methods aim to fit a parametrised model
to the underlying data distribution. Diffusion-based generative mod-
els have recently shown state-of-the-art capabilities in image gener-
ation [10, 11, 12, 13, 14] and speech processing [15, 16, 17, 18, 19,
20, 21]. Denoising diffusion probabilistic models (DDPM, [22, 10])
and score-based generative modelling through stochastic differential
This work has been performed using resources provided by the Cam-
bridge Tier-2 system operated by the University of Cambridge Research
Computing Service funded by EPSRC Tier-2 capital grant EP/T022159/1.
Theodor Nguyen is supported by the Studienstiftung des Deutschen Volkes.
The code will be made available after the review process.
Fig. 1: The stochastic diffusion process (f.l.t.r) progressively per-
turbs the target speaker signal with Gaussian noise while interpolat-
ing from the target signal to the mixture. The reverse process (f.r.t.l)
conditioned on the target speaker embedding ets extracts the target
speaker signal from the mixture of signals.
equations (SGM, [11]) form the two main frameworks in diffusion-
based modelling. For the scope of this work, SGM is considered the
framework of choice, although [11] and [12] showed that DDPMs
and SGMs are equivalent formulations. SGMs have been applied
to speech enhancement [18, 19, 20, 21] and blind source separation
(BBS) for speech data [23].
However, as far as we are aware, an SGM method for TSE is yet
to be investigated. In the proposed DiffSpEx method (Section 3),
TSE is performed by running the reverse-time SDE in the complex
short-time Fourier transform (STFT) domain, starting from a mix-
ture of signals with a trainable score function conditioned on fixed-
length target speaker embeddings from the ECAPA-TDNN speech
extractor [24]. The proposed method is illustrated in Fig. 1. The
potential of DiffSpEx is demonstrated in Section 4 on a general TSE
task and a personalised TSE task on the WSJ0-2mix dataset [25],
where it is shown in Section 5 that DiffSpEx has comparable per-
formance to discriminative TSE methods in signal reconstruction (in
SI-SDR [26]) while outperfoming them in uninstrusive speech qual-
ity and naturalness measured in NISQA [27]. Moreover, it is shown
that DiffSpEx can be fine-tuned to a specific speaker to improve sig-
nal reconstruction and speech quality further. Hence, the DiffSpEx
method can be applied to settings where a particular (personalised)
speaker is to be extracted with high quality and naturalness.
2. BACKGROUND
In SGM, a data sample from the target distribution is progressively
perturbed with Gaussian noise in a stochastic diffusion process to
increase the support of the data distribution on the high-dimensional
manifold. This forward process is defined through a stochastic dif-
ferential equation (SDE) [11]. The work in [28] showed that the
backward process to sample a target data point from (Gaussian)
noise can be defined with a reverse-time SDE, where the required
score function can be trained as a deep neural network via score-
matching [11].
© 2023 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media,
including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to
servers or lists, or reuse of any copyrighted component of this work in other works.
dxt=γ(y−xt)dt+g(t)dwdxt≈[γ(y−xt)−g(t)2sθ(xt,y,t,ets)]dt+g(t)dwx0x0xTxT2.1. Score-based generative modelling through SDEs
A stochastic diffusion process is a solution to an SDE and can be
represented as a continuous forward process {x(t)}t∈[0,T ] starting
at t = 0. The continuous forward process in SGM {x(t)}t∈[0,T ]
can be formalised through the SDE [11] as
dx = f (x, t)dt + g(t)dw,
(1)
where f (x, t) : (Rdx , R) → Rdx is called the drift coefficient and
dx denotes the dimensionality of x, g(t) : R → R is called the
diffusion coefficient, and w ∈ Rdx represents standard Brownian
motion. From a macroscopic view, the probability density function
over all possible continuous stochastic trajectories {x(t)}t∈[0,T ] at
a continuous timestep t is denoted by pt(x). For t = 0, p0(x) is the
data distribution p(x), as there is no added noise at timestep t = 0.
As the diffusion process proceeds to t → T , i.e.
the largest pos-
sible noise in the defined process, by design, pT (x) converges to
a tractable distribution π(x) called the prior distribution. With the
SDE formulation of the diffusion process, data points can be sam-
pled from the prior distribution by reversing the diffusion process.
In [28], it is proven that for every SDE of the form in Equation (1),
there exists a corresponding reverse-time SDE
dx = (cid:2)f (x, t) − g(t)2∇x log pt(x)(cid:3) dt + g(t)dw,
(2)
where dt denotes a negative timestep in the reverse process and
∇x log pt(x) can be approximated by a trainable score function
sθ(x, t):
dx ≈ (cid:2)f (x, t) − g(t)2sθ(x, t)(cid:3) dt + g(t)dw.
(3)
To sample a data point ˆx from p(x), the reverse-time SDE in Equa-
tion 2 can be solved with any numerical SDE solver by (i) sampling
from the tractable prior distribution pT (x) = π(x) as a starting
point and (ii) using the trained score model sθ(x, t) to get the cor-
rect reverse-time SDE.
2.2. Speech enhancement in the complex STFT domain
A diffusion-based speech enhancement model that operates in the
complex STFT domain was proposed in [18] and [19]. The complex
STFT spectrograms are transformed and retransformed with
̃c = β|c|α ei∠(c) and c =
1
α ei∠( ̃c),
| ̃c|
1
β
(4)
respectively, where c are the coefficients in the complex STFT, ∠(*)
is the angle of the coefficients, α ∈ R+ is a parameter that com-
presses the amplitude to upscale frequencies with lower energies,
and β ∈ R+ is a scaling factor to scale the amplitudes to be between
0 and 1 for predictable noising in the diffusion-based model. In their
work, [18] and [19] proposed a speech enhancement method based
on the SDE formulation of score-based generative models [11] with
the SDE
dxt = γ(y − xt)dt + g(t)dw,
(5)
where y is the spectrogram of the noisy signal and g(t) is the diffu-
sion coefficient that is parametrised by σmin and σmax in
g(t) = σmin
(cid:19)t (cid:115)
2 log
(cid:18) σmax
σmin
(cid:18) σmax
σmin
(cid:19)
.
(6)
coefficient of the reversion effect. Such a mean-reverting SDE is
also called an Ornstein-Uhlenbeck SDE [29]. Based on the form of
the variance schedule g(t), the SDE in Equation (5) is referred to as
a Variance Exploding SDE in [11], as the variance tends to infinity
for t → ∞.
In combination, [18] and [19] coined the SDE the
Ornstein-Uhlenbeck Variance Exploding SDE (OUVE). The closed-
form solutions for the mean μ (x0, y, t) and variance σ(t)2I for a
Gaussian process are derived in Equations (5.50) and (5.53) in [30]:
μ (x0, y, t) = e−γtx0 + (cid:0)1 − e−γt(cid:1) y,
(7)
σ(t)2 =
σ2
min
(cid:18)(cid:16) σmax
(cid:17)2t
σmin
− e−2γt
(cid:19)
log
(cid:17)
(cid:16) σmax
σmin
γ + log
(cid:17)
(cid:16) σmax
σmin
3. METHOD
.
(8)
The approach to performing TSE with a diffusion model is moti-
vated by the promising performance of diffusion models in the BSS
task [23]. In the conclusion of [23], the authors mentioned a gap in
performance with state-of-the-art discriminative methods. The au-
thors argue that as both outputs come from the distribution of human
speech, it is unclear to the generative model which parts of the mix-
ture of human speech belong to which speaker. In the experiments in
Section 4, we utilise fixed-length speaker embeddings to condition
the diffusion-based generative model on a specific speaker distribu-
tion of the marginal distribution of human speech to separate the
target speaker from the mixture of speakers.
3.1. Complex STFT features
Denote the target speaker signal with x0 and the mixture signal with
y in the complex STFT domain. The fixed-length target speaker em-
bedding vector is denoted by ets. First, x0 and y are transformed
by the rescaling transformation from Equation (4). Both complex
spectrograms {x0, y} ∈ CB×F , where B is the number of fre-
quency bins and F is the number of time frames of the STFT, are
passed as real and imaginary channels to the diffusion-based model,
{x0, y} ∈ R2×B×F .
3.2. SDE formulation for target speaker extraction
The SDE from Equation (1) is used to continuously perturb the trans-
formed complex STFT spectrogram x0 while the mean continuously
shifts from x0 to y with Equation (7). In practice, xt is sampled with
xt = μ (x0, y, t) + σ(t) z,
(9)
where σ(t) is defined by Equation (8) and z is standard Gaussian
noise. The reverse-time SDE is defined by
dxt ≈ (cid:2)γ(y − xt) − g(t)2sθ(xt, y, t, ets)(cid:3) dt + g(t)dw,
(10)
where sθ(*) is conditioned on the target speaker embedding ets. Fol-
lowing the solution for ∇xt log p0t (xt | x0, y) of a Gaussian kernel
p0t (xt | x0, y) from [31], the loss function takes the form
arg min
θ
Et,y,z,xt
(cid:34)(cid:13)
(cid:13)
(cid:13)
(cid:13)
sθ (xt, y, t, ets) +
(cid:35)
z
σ(t)
(cid:13)
2
(cid:13)
(cid:13)
(cid:13)
2
(11)
The drift term γ(y − xt) reverts stochastic processes {xt}t≥0 that
deviate from y back to y, where γ can be interpreted as the stiffness
as in [19].
4. EXPERIMENTAL SETUP
Two distinct DiffSpEx approaches are investigated: (i) a general
conditional TSE model (G-DiffSpEx), where the set of potential
speakers is not limited and conditioned by the speaker embed-
ding, and (ii) a personalised TSE model (P-DiffSpEx), where
a pre-trained model is fine-tuned on a specific speaker.
In the
latter experiment, various total durations of reference signals
{60 s, 180 s, 300 s, 600 s} are used to reveal how much reference
audio is needed to fine-tune DiffSpEx on one speaker.
4.1. Datasets and speaker embedding
The WSJ0-2mix min-cut [25] is chosen at a sample rate of 8 kHz
to evaluate our proposed TSE model. The datasets consist of 20,000
training (30 h), 5,000 validation (8 h) and 3,000 test utterances (5 h),
where the set of speakers in the test dataset with 18 speakers is dis-
joint from the training and validation dataset (101 speakers).
G-DiffSpEx. The first speaker is set in the mixture signals to be
the target speaker, and fixed-length target speaker embeddings are
generated with ECAPA-TDNN [24] from a random sample of the
clean signals of the respective speakers. Additionally, random sam-
ples of one speaker are joined to at least 60 s signal length to generate
target speaker embeddings with more context for evaluation, which
we mark with 60s.
P-DiffSpEx. The individual speaker 40f from the WSJ0-2mix
dataset is chosen to create proprietary personalised datasets for dif-
ferent amounts of reference audio {60 s, 180 s, 300 s, 600 s}, where
in the personalised datasets, the target speaker audio is a randomly
selected reference audio of the individual speaker 40f. The set of
samples in the personalised training, validation and test set are dis-
joint, where the total duration of the set of samples for validation
and testing is 195 s. Additionally, to report more representative re-
sults, the experiment is repeated for 600 s of reference audio with 10
speakers {017, 01a, 01i, 01t, 01z, 029, 02e, 40f, 40l, 40o}.
4.2. Metrics
The commonly used signal restoration metrics SI-SDR and SI-SDRi
[26] in dB are used to evaluate the signal similarity between the ex-
tracted speaker signal and the ground truth signal in the time domain.
Furthermore, the intrusive speech quality metric PESQ [32] and the
unintrusive speech naturalness metric NISQA [27] are reported.
4.3. Model and speaker embedding conditioning
the input
The parametrised score-function sθ(*) is based on the noise-conditio-
ned score-matching network (NCSN++) from [11], a multi-channel
U-Net neural network with residual connections [33]. As sθ(*)
is conditioned on the mixture signal y besides the sampled sig-
nal xt [18, 19, 23],
to the NCSN++ score-function
(xt, y) ∈ R4×B×F has 4 channels [19]. We use a smaller net-
work configuration than [19, 23] of 4 encoder-decoder layers with
2 ResNet blocks each and no attention mechanism, resulting in a
model with 37.7M parameters. The ECAPA-TDNN [24] speaker
embeddings ets ∈ R192 and the time embeddings et ∈ R512 from
the variance scheduler σ(t)2 are downsampled by feed-forward lay-
ers and alternately added as bias to the intermediate representations
in the ResNet blocks. Fig. 2 illustrates such a ResNet block with
alternated adding of the embeddings.
Fig. 2: ResNet-Block in the U-Net architecture with optional finite
impulse response (FIR) filters for up- and downsampling.
4.4. Hyperparameters for inference and training
The 8 kHz audio signals are transformed into the complex STFT do-
main with NFFT = 254, window size = 256, hop length = 64 and
F = 256, resulting in B = 128 and model input frames of 2048 ms
length at 8 kHz. The parameters for the complex STFT transforma-
tions from Equation (4) are set to α = 0.5 and β = 0.15 as in [18]
and [19]. The parametrisation for the SDE in Equations (10) and
(6) are γ = 2.0, σmin = 0.05 and σmax = 0.5. For inference,
a predictor-corrector sampler [11] with the Euler-Maruyama solver
and annealed Langevin dynamics [34] is used, where the sampling
parameters are set to N = 30 and r = 0.5. The models are evalu-
ated on SI-SDR of 100 random validation samples to choose the best
checkpoint for test evaluation in order to save computational costs.
G-DiffSpEx. The G-DiffSpEx model is trained for 1000 epochs
with an effective batch size of 48 on one NVIDIA-A100 GPU, which
requires 250 h. We train the model with the Adam optimiser [35],
a learning rate 5 × 10−4 and a linear warm-up schedule of 2000
training steps.
P-DiffSpEx. The P-DiffSpEx model is fine-tuned on the pre-
trained G-DiffSpEx model for 15 epochs with an effective batch size
of 48 on one NVIDIA-A100 GPU, which requires 4 h. We fine-tune
the model with the Adam optimiser at a learning rate of 5 × 10−4.
5. RESULTS
5.1. General target speaker extraction
The evaluation results on the trained DiffSpEx model for randomly
chosen speaker embeddings and 60s-embeddings are given in Ta-
ble 1, where numbers with reported standard deviations (after ±) are
evaluated on the same test script and numbers without standard de-
viations are taken from their respective publications. The proposed
method achieves an SI-SDRi better than earlier discriminative TSE
models with better NISQA values. However, there is a noticeable
gap in SI-SDR to the state-of-the-art discriminative TSE methods.
The NISQA score of 3.56 indicates that the extracted speech sig-
nals of DiffSpEx are more natural than the discriminative models,
although (in some places) the extracted signals may be heavily mixed
GroupNormSwish-ActivationUp-/DownsamplingConv2DUp-/DownsamplingConv2DGroupNormSwish-ActivationConv2Dhh′ +tetetsLinearSwish-ActivationLinearSwish-ActivationLinearoptionaloptionalalternates every ResNet-Blockadd as biasResNet-BlockFig. 3: SI-SDR distribution conditioned on an ECAPA-TDNN co-
sine similarity of > 0.15 and ≤ 0.15 between the two source signals
in the WSJ0-2mix test samples.
with the wrong speaker, given the overall SI-SDR score and the stan-
dard deviation. Hence, the generative DiffSpEx method is preferably
applied to settings where target speakers need to be extracted with
high speech quality and naturalness.
Table 1: Evaluation results of DiffSpEx and benchmarks on WSJ0-
2mix 8 kHz min-cut. The standard deviation is given after ±.
Model
SI-SDR ↑ SI-SDRi ↑ PESQ ↑ NISQA ↑
SpeakerBeam [5, 8]
SpeakerBeam1
SpEx [7]
SpEx+ [8]
SpEx+2
SpEx-CA [9]
X-Sepformer [6]
9.2
-
-
-
14.0±7.3 11.5±7.3 3.05±0.63 3.27±0.47
14.6
18.2
-
-
3.14
3.49
-
-
11.6±12.8 11.6±13.2 3.01±0.97 3.03±0.50
-
-
18.8
19.1
-
3.75
-
-
G-DiffSpEx
G-DiffSpEx-60s
12.7±9.3 10.1±9.0 3.05±1.02 3.55±0.32
12.9±9.1 10.3±8.9 3.08±1.00 3.56±0.33
Fig. 3 plots the distribution of the SI-SDR results for G-DiffSpEx-
60s. It reveals a bimodal distribution in performance and shows that
DiffSpEx struggles with the TSE task when the speech sources in the
mixture have a high ECAPA-TDNN cosine similarity, as for similar-
ity scores > 0.15, the distribution of SI-SDR shows a high den-
sity between -5 dB and 10 dB. Intuitively, target speakers are harder
to extract from a mixture of similar speakers. This suggests that
the model may improve, given more accurate and better matching
speaker embeddings and providing more context, e.g. a bigger sig-
nal window, to the model. Fig. 4 gives chosen samples from the TSE
test evaluation.
5.2. Personalised target speaker extraction
The evaluation results on the fine-tuned P-DiffSpEx model with
different target speaker reference audio lengths are given in Table
2, where the G-40f-DiffSpEx-60s model corresponds to a non-
personalised model for speaker 40f and G-10S-DiffSpEx-600s cor-
responds to the same experiment repeated for 10 speakers. The post-
fixes to G-DiffSpEx and P-DiffSpEx indicate the total duration of
reference audio in the respective personalised datasets. The person-
alised TSE models achieve a higher SI-SDR than the G-DiffSpEx
model without fine-tuning. Furthermore, all metrics except for
1Results generated from checkpoint provided by the SpeakerBeam repos-
itory. Caveat: the checkpoint was trained on the bigger Libri2Mix dataset.
2Results generated from a checkpoint in the SpEx+ repository.
Fig. 4: Chosen evaluation samples of G-DiffSpEx-60s. In the left
column, G-DiffSpEx-60s extracts the correct speaker. In the middle
column, the model extracts the correct speaker in the first half of
the signal segment and the wrong speaker in the second half. In the
right column, the model extracts the wrong speaker. The extracted
samples show natural-looking in-distribution spectrograms without
distortions.
Table 2: Fine-tuning results for 40f and the set of 10 speakers (10S).
Model
SI-SDR ↑ SI-SDRi ↑ PESQ ↑ NISQA ↑
G-40f-DiffSpEx-60s 14.8±8.9 12.3±8.5 3.43±0.89 3.67±0.18
P-40f-DiffSpEx-60s 15.2±7.4 12.6±7.0 3.44±0.77 3.79±0.17
P-40f-DiffSpEx-180s 16.2±7.2 13.7±6.8 3.58±0.73 3.74±0.16
P-40f-DiffSpEx-300s 16.7±7.0 14.2±6.6 3.64±0.70 3.74±0.16
P-40f-DiffSpEx-600s 17.2±7.1 14.7±6.7 3.69±0.70 3.70±0.16
G-10S-DiffSpEx-600s 13.6±8.5 10.9±8.1 3.29±0.93 3.34±0.30
P-10S-DiffSpEx-600s 16.1±7.1 13.3±6.7 3.60±0.75 3.34±0.30
NISQA improve with the length of reference audio provided during
fine-tuning. This shows that DiffSpEx can be applied to settings
where personalisation for particular target speakers is possible.
6. CONCLUSION
We proposed DiffSpEx, a target speaker extraction model based on
score-based generative modelling and ECAPA-TDNN speaker em-
beddings. We demonstrate that DiffSpEx achieves target speaker
extraction performance that is better than the earlier discriminative
target speaker extraction models (12.9 dB SI-SDR) while produc-
ing natural-sounding outputs per the NISQA metric (3.56). Further-
more, we show that fine-tuning a pre-trained DiffSpEx model on one
speaker in a personalised setting is possible and improves the extrac-
tion performance with as little as 60 s of reference audio, and more
reference audio further improves the TSE performance of a person-
alised DiffSpEx model. In conclusion, DiffSpEx performs well in
settings that require target speaker extraction with high quality and
naturalness and allow for the personalisation of target speakers.
−30−20−100102030SI-SDR[dB]0.0000.0250.0500.0750.1000.125Distribtutionoftestsamplessimilarityscore≤0.15-65%similarityscore>0.15-35%Mixture20.0dBSI-SDR5.0dBSI-SDR-20.0dBSI-SDRGroundtruthG-DiffSpEx-60sprediction7. REFERENCES
[1] J. Flanagan, J. Johnston, R. Zahn, and G. Elko, "Computer-
steered microphone arrays for sound transduction in large
rooms," JASA, vol. 78, pp. 1508–1518, 1985.
[2] J. Hershey and M. Casey, "Audio-visual sound separation via
hidden Markov models," in Proc. NeuRIPS, 2001.
[3] T. Ochiai, M. Delcroix, K. Kinoshita, A. Ogawa, and
T. Nakatani, "Multimodal SpeakerBeam: Single channel target
speech extraction with audio-visual speaker clues.," in Proc.
Interspeech, 2019.
[4] H. Sato, T. Ochiai, K. Kinoshita, M. Delcroix, T. Nakatani,
and S. Araki, "Multimodal attention fusion for target speaker
extraction," in Proc. IEEE Spoken Language Technology Work-
shop (SLT), 2021.
[5] K.
ˇZmol ́ıkov ́a, M. Delcroix, K. Kinoshita, T. Ochiai,
T. Nakatani, L. Burget, and J. ˇCernock`y,
"SpeakerBeam:
Speaker aware neural network for target speaker extraction in
speech mixtures," IEEE Journal of Selected Topics in Signal
Processing, vol. 13, no. 4, pp. 800–814, 2019.
[6] K. Liu, Z. Du, X. Wan, and H. Zhou, "X-SepFormer: End-to-
end speaker extraction network with explicit optimization on
speaker confusion," in Proc. ICASSP, 2023.
[7] C. Xu, W. Rao, E. Chng, and H. Li, "SpEx: Multi-scale time
domain speaker extraction network," IEEE/ACM Trans. Audio,
Speech and Lang. Proc., vol. 28, pp. 1370–1384, 2020.
[8] M. Ge, C. Xu, L. Wang, E. Chng, J. Dang, and H. Li, "SpEx+:
A complete time domain speaker extraction network," in Proc.
Interspeech, 2020.
[9] W. Wang, C. Xu, M. Ge, and H. Li, "Neural speaker extraction
with speaker-speech cross-attention network," in Proc. Inter-
speech, 2021.
[10] J. Ho, A. Jain, and P. Abbeel, "Denoising diffusion probabilis-
tic models," in Proc. NeuRIPS, 2020.
[11] Y. Song, J. Sohl-Dickstein, D. Kingma, A. Kumar, S. Er-
mon, and B. Poole, "Score-based generative modeling through
stochastic differential equations," in Proc. ICLR, 2021.
[12] T. Karras, M. Aittala, T. Aila, and S. Laine, "Elucidating the
design space of diffusion-based generative models," in Proc.
NeuRIPS, 2022.
[13] J. Song, C. Meng, and S. Ermon, "Denoising diffusion implicit
models," in Proc. ICLR, 2021.
[14] Y. Song, P. Dhariwal, M. Chen, and I. Sutskever, "Consistency
models," in Proc. ICML, 2023.
[15] Z. Kong, W. Ping, J. Huang, K. Zhao, and B. Catanzaro, "Dif-
fWave: A versatile diffusion model for audio synthesis," Proc.
ICLR, 2021.
[16] Y. Lu, Y. Tsao, and S. Watanabe, "A study on speech enhance-
ment based on diffusion probabilistic model," in Proc. APSIPA
ASC, 2021.
[17] Y. Lu, Z. Wang, S. Watanabe, A. Richard, C. Yu, and Y. Tsao,
"Conditional diffusion probabilistic model for speech enhance-
ment," in Proc. ICASSP, 2022.
[18] S. Welker, J. Richter, and T. Gerkmann, "Speech enhancement
with score-based generative models in the complex STFT do-
main," in Proc. Interspeech, 2022.
[19] J. Richter, S. Welker, J. Lemercier, B. Lay, and T. Gerkmann,
"Speech enhancement and dereverberation with diffusion-
based generative models," IEEE/ACM Trans. Audio, Speech,
Language Process., vol. 31, pp. 2351–2364, 2023.
[20] B. Lay, S. Welker, J. Richter, and T. Gerkmann,
"Reduc-
ing the prior mismatch of stochastic differential equations for
diffusion-based speech enhancement," in Proc. Interspeech,
2023.
[21] J. Lemercier, J. Richter, S. Welker, and T. Gerkmann, "Storm:
A diffusion-based stochastic regeneration model for speech en-
IEEE/ACM Trans. Audio,
hancement and dereverberation,"
Speech, Language Process., vol. 31, pp. 2724–2737, 2023.
[22] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Gan-
guli, "Deep unsupervised learning using nonequilibrium ther-
modynamics," in Proc. ICML, 2015.
[23] R. Scheibler, Y. Ji, S. Chung, J. Byun, S. Choe, and M. Choi,
"Diffusion-based generative speech source separation,"
in
Proc. ICASSP, 2023.
[24] B. Desplanques, J. Thienpondt, and K. Demuynck, "ECAPA-
TDNN: Emphasized channel attention, propagation and aggre-
gation in TDNN based speaker verification," in Proc. Inter-
speech, 2020.
[25] D. Paul and J. Baker, "The design for the Wall Street Journal-
based CSR corpus," in Speech and Natural Language: Pro-
ceedings of a Workshop Held at Harriman, 1992.
[26] J. Le Roux, F. Weninger, and J. Hershey,
"Sparse NMF-
half-baked or well done?," Mitsubishi Electric Research Labs
(MERL), vol. 11, pp. 13–15, 2015.
[27] G. Mittag, B. Naderi, A. Chehadi, and S. M ̈oller, "NISQA: A
deep CNN-self-attention model for multidimensional speech
quality prediction with crowdsourced datasets," in Proc. Inter-
speech, 2021.
[28] B. Anderson,
"Reverse-time diffusion equation models,"
Stochastic Processes and their Applications, vol. 12, pp. 313–
326, 1982.
[29] G. E. Uhlenbeck and L. S. Ornstein, "On the theory of the
Brownian motion," Phys. Rev., vol. 36, pp. 823–841, 1930.
[30] S. S ̈arkk ̈a and A. Solin, Applied stochastic differential equa-
tions, vol. 10, Cambridge University Press, 2019.
[31] P. Vincent, "A connection between score matching and denois-
ing autoencoders," Neural Computation, vol. 23, pp. 1661–
1674, 2011.
[32] A. Rix, J. Beerends, M. Hollier, and A. Hekstra, "Perceptual
evaluation of speech quality (PESQ)-a new method for speech
quality assessment of telephone networks and codecs," in Proc.
ICASSP, 2001.
[33] O. Ronneberger, P. Fischer, and T. Brox, "U-Net: Convolu-
tional networks for biomedical image segmentation," in Proc.
MICCAI, 2015.
[34] R. Pastor, "Techniques and applications of Langevin dynamics
simulations," in The Molecular Dynamics of Liquid Crystals,
pp. 85–138. Springer, 1994.
[35] D. Kingma and J. Ba, "Adam: A method for stochastic opti-
mization," in Proc. ICLR, 2015.
|
|
http://arxiv.org/abs/2310.04789v1 | "2023-10-07T12:44:47" | "2023-10-07T12:44:47" | HNS: An Efficient Hermite Neural Solver for Solving Time-Fractional
Partial Differential Equations | Neural network solvers represent an innovative and promising approach for
tackling time-fractional partial differential equations by utilizing deep
learning techniques. L1 interpolation approximation serves as the standard
method for addressing time-fractional derivatives within neural network
solvers. However, we have discovered that neural network solvers based on L1
interpolation approximation are unable to fully exploit the benefits of neural
networks, and the accuracy of these models is constrained to interpolation
errors. In this paper, we present the high-precision Hermite Neural Solver
(HNS) for solving time-fractional partial differential equations. Specifically,
we first construct a high-order explicit approximation scheme for fractional
derivatives using Hermite interpolation techniques, and rigorously analyze its
approximation accuracy. Afterward, taking into account the infinitely
differentiable properties of deep neural networks, we integrate the high-order
Hermite interpolation explicit approximation scheme with deep neural networks
to propose the HNS. The experimental results show that HNS achieves higher
accuracy than methods based on the L1 scheme for both forward and inverse
problems, as well as in high-dimensional scenarios. This indicates that HNS has
significantly improved accuracy and flexibility compared to existing L1-based
methods, and has overcome the limitations of explicit finite difference
approximation methods that are often constrained to function value
interpolation. As a result, the HNS is not a simple combination of numerical
computing methods and neural networks, but rather achieves a complementary and
mutually reinforcing advantages of both approaches. The data and code can be
found at \url{https://github.com/hsbhc/HNS}. | [
"Jie Hou",
"Zhiying Ma",
"Shihui Ying",
"Ying Li"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04789v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04789v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"cs.NA",
"math.NA"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
9
8
7
4
0
.
0
1
3
2
:
v
i
X
r
a
HNS: An Efficient Hermite Neural Solver for Solving
Time-Fractional Partial Differential Equations
Jie Houa, Zhiying Mab, Shihui Yingb and Ying Lia,∗
aSchool of Computer Engineering and Science, Shanghai University, Shanghai 200444, PR China
bDepartment of Mathematics, School of Science, Shanghai University, 200444, PR China
A R T I C L E I N F O
A B S T R A C T
Keywords:
Hermite Interpolation
Time-Fractional PDEs
Neural Network
High-Dimensional Problems
Neural network solvers represent an innovative and promising approach for tackling time-
fractional partial differential equations by utilizing deep learning techniques. L1 interpolation
approximation serves as the standard method for addressing time-fractional derivatives within
neural network solvers. However, we have discovered that neural network solvers based on L1
interpolation approximation are unable to fully exploit the benefits of neural networks, and the
accuracy of these models is constrained to interpolation errors. In this paper, we present the high-
precision Hermite Neural Solver (HNS) for solving time-fractional partial differential equations.
Specifically, we first construct a high-order explicit approximation scheme for fractional deriva-
tives using Hermite interpolation techniques, and rigorously analyze its approximation accuracy.
Afterward, taking into account the infinitely differentiable properties of deep neural networks,
we integrate the high-order Hermite interpolation explicit approximation scheme with deep
neural networks to propose the HNS. The experimental results show that HNS achieves higher
accuracy than methods based on the L1 scheme for both forward and inverse problems, as well
as in high-dimensional scenarios. This indicates that HNS has significantly improved accuracy
and flexibility compared to existing L1-based methods, and has overcome the limitations of
explicit finite difference approximation methods that are often constrained to function value
interpolation. As a result, the HNS is not a simple combination of numerical computing methods
and neural networks, but rather achieves a complementary and mutually reinforcing advantages
of both approaches. The data and code can be found at https://github.com/hsbhc/HNS.
1. Introduction
Fractional Partial Differential Equations (FPDEs) are an extension of traditional integer-order Partial Differential
Equations (PDEs) that stem from the realm of Fractional Calculus, boasting rich research backgrounds in mathematics
and physics [1, 2]. Compared to integer-order PDEs, fractional derivatives can more accurately represent phenomena
with memory and hereditary attributes. As a result, FPDEs can effectively capture memory and non-local effects in
various natural phenomena. This makes them highly valuable in fields such as fluid dynamics [3], turbulence [4],
geology [5], elasticity [6], biology [7], financial theory [8, 9], and engineering [10].
In recent decades, researchers have made significant progress in the numerical solution of fractional-order
differential equations, developing numerous numerical techniques. However, due to the inherent nonlinearity, high
dimensionality, and complex boundary conditions of FPDEs, the computational complexity of traditional numerical
methods is often significant[11–17]. Furthermore, traditional numerical methods may encounter difficulties in
effectively addressing the memory effects and long-range dependencies inherent in FPDEs, which can result in
diminished accuracy in their computational results. When tackling high-dimensional problems, numerical methods
typically involve extensive computational demands[18].
With the growing development of deep neural networks, it is recognized that neural networks have powerful
approximation and nonlinear modeling capabilities [19, 20], which makes neural networks show great potential in
solving scientific computing problems [21–23]. Recently, the Physics-Informed Neural Networks (PINNs) model has
achieved notable success in solving Partial Differential Equations (PDEs) [24] and has been applied to FPDEs. Pang
et al.[25] extended PINNs to Fractional PINNs (fPINNs), exhibiting accuracy and efficacy in solving forward and
inverse problems while systematically exploring convergence properties. Ye et al.[26] conducted a study on time-
fractional diffusion equations with conformable derivative using Physics-Informed Neural Networks (PINNs). For
∗Corresponding author
houjie@shu.edu.cn (J. Hou); mazhiying@shu.edu.cn (Z. Ma); shying@shu.edu.cn (S. Ying); yinglotus@shu.edu.cnn (Y. Li)
ORCID(s): 0000-0001-9410-0093 (J. Hou)
Jie Hou et al.: Preprint submitted to Elsevier
Page 1 of 21
more instructions on neural network methods for solving fractional-order differential equations, see [27–33]. The
primary advantage of neural network methods lies in their ability to solve high-dimensional problems, handle complex
geometries, and address inverse problems effectively.
The main challenge in solving fractional partial differential equations (FPDEs) lies in the handling of fractional
derivatives. Similar to many neural network approaches for solving PDEs, it is common to combine numerical methods
to efficiently solve problems[34, 35]. Therefore, when solving FPDEs, we also use traditional approximation methods to
approximate fractional-order derivatives. As a result, the accuracy of neural network models in solving FPDEs is closely
related to the choice of approximation methods for fractional derivatives. Therefore, to ensure the accuracy and stability
of the model, it is crucial to select appropriate numerical approximation methods. Most current methods employ finite
difference approximation methods to discretize the time-fractional derivatives, with the accuracy of the model being
limited by the scheme approximation errors. For example, when discretizing time fractional derivatives using the finite
difference L1 scheme directly [36, 37], the accuracy of the L1 scheme determines the prediction accuracy of the model.
In fact, directly combining finite difference approximation methods for fractional derivatives with deep neural
networks is not an ideal choice. Such a simplistic combination does not fully leverage the advantages of neural networks,
and the accuracy of the model is limited to the accuracy of numerical approximation methods. Therefore, when
designing integration strategies, we should fully leverage the potential of neural networks to enhance the overall model
accuracy. For instance, we commonly use the L1 scheme to approximate Caputo fractional-order derivatives. This
approximation method relies on function values for linear interpolation, which results in significant interpolation errors.
This is a feature of explicit difference approximation methods, even with higher-order difference schemes[38, 39]−This
is because they are explicit methods that construct interpolation polynomials exclusively through function values,
without taking into account other aspects of the function, such as the derivative value of the nodes. Is it possible to
break through this limitation by the neural networks? The answer is affirmative.
In this paper, we utilize the Hermite interpolation method[40] to construct a high-order explicit approximation
scheme for the Caputo fractional derivative and design an efficient Hermite Neural Solver for solving time fractional
partial differential equations. This method fully utilizes the infinitely differentiable properties of deep neural
networks, breaks through the limitation of constructing interpolation polynomials only through function values, and
improves numerical accuracy. Moreover, this method can easily extend to other fractional partial differential equations,
even integral equations. Although there are cubic spline collocation methods available for solving FPDEs outside of
explicit finite difference methods[41–43], these methods utilize cubic spline interpolation techniques similar to the
Hermite interpolation method. However, such methods introduce additional degrees of freedom, making them implicit
iterative methods. In contrast, this paper leverages neural networks as a tool, allowing us to explicitly execute Hermite
Interpolation Explicit Approximation for Caputo Fractional Derivatives. To the best of our knowledge, this is the
first work that combines deep neural networks with the Hermite interpolation method and designs a high-order Hermite
Neural Solver for solving fractional partial differential equations. The main contributions of this paper are summarized
as follows:
• A high-order explicit approximation scheme for the Caputo fractional derivative is constructed based on Hermite
interpolation technique, and its approximation error is analyzed.
• An efficient Hermite Neural Solver (HNS) is designed for solving time fractional partial differential equations.
• The impact of Hermite interpolation order on the accuracy of the HNS is analyzed. The results show that the
HNS using third-order Hermite interpolation achieves the highest performance.
• The performance of HNS has been thoroughly verified across various problem scenarios, including challenging
high-dimensional problems and inverse problems.
2. Preliminaries
2.1. Time-Fractional Partial Differential Equation
Without loss of generality, we formulate any Time-Fractional PDEs as:
∂αu(x, t)
∂tα
+
x[u] = 0,
Jie Hou et al.: Preprint submitted to Elsevier
(1)
Page 2 of 21
where u(x, t) is the function which needs to be solved, α is the order of the time derivative, and
x[⋅] is a differential
operator that can be linear or nonlinear. Fractional derivatives are an extension of calculus that allow for derivative
orders to be real numbers rather than limited to integers. This extension finds widespread application in the fields
of mathematics, physics, and engineering, particularly when describing complex systems characterized by memory
and non-local properties. Commonly used definitions of fractional derivatives include Riemann-Liouville fractional
derivative and Caputo fractional derivative [44]. In this paper, we employ the definition of Caputo fractional derivatives.
Definition 1. Suppose the function u(t) is defined on the interval [a, b], α ≥ 0, and n is the smallest integer greater
than or equal to α. The Caputo fractional derivative is defined as:
a Dα
C
t u(t) =
t
1
Γ(n − α) ∫
a
u(n)(t),
⎧
⎪
⎨
⎪
⎩
(t − τ)n−α−1u(n)(τ)dτ, α ∈ (n − 1, n),
α = n ∈ N,
where Γ(⋅) denotes the Gamma function.
If t > 0 and α ∈ (0, 1), the Caputo fractional derivative can be written as:
C
0 Dα
t u(t) =
1
Γ(1 − α) ∫
0
t
u′(τ)
(t − τ)α
dτ.
(2)
(3)
This paper focuses on this case. To solve the problem Eq. 1, numerical methods are needed to discretize the fractional
derivative. For the Caputo fractional derivative, finite difference approximation methods, such as the L1 scheme,
are commonly used for temporal discretization. Spatial discretization can be achieved using methods such as finite
differences, spectral methods, finite elements, and so on.
L1 Scheme Let t ∈ (0, T ], α ∈ (0, 1) and N be a positive integer. Denote Δt = T
N
al = (l + 1)1−α − l1−α for l ≥ 0. Linear interpolation of u(t) over the interval [tk−1, tk] yields:
, tk = kΔt for 0 ≤ k ≤ N, and
u(t) ≈ Lk(t) =
tk − t
Δt
u(tk−1) +
t − tk−1
Δt
u(tk).
Then, we can obtain the following L1 approximation scheme for computing C
0
Dα
t u(t) ∣t=tn
:
Dα
t u(tn) =
Δt−α
Γ(2 − α)
[
a0u(tn) −
n−1
∑
(an−k−1 − an−k)u(tk) − an−1u(t0)
.
]
k=1
The approximation error of the fractional derivative can be expressed as:
R(u(tn)) = C
0 Dα
t u(t) ∣t=tn
−Dα
t u(tn).
L1 scheme has a numerical accuracy of 2 − α order. The approximation error satisfies:
∣ R(u(tn)) ∣≤
1
2Γ(1 − α)
[
1
4
+
α
(1 − α)(2 − α)
]
max
≤t≤tn
t0
u′′(t)|
|
|
|
Δt2−α.
(4)
(5)
(6)
(7)
Remark 1. The accuracy of explicit finite difference approximation methods is limited by the interpolation error. A
similar approximation method is the L1 − 2 interpolation approximation. This method employs linear interpolation
of u(t) on the interval [t0, t1] and uses a three-point quadratic interpolation polynomial in subsequent intervals. The
L1 − 2 approximation formula, as the number of computational nodes increases, transitions from being of order 2 − α
to order 3 − α. So, can we employ alternative higher-order interpolation methods, such as Hermite interpolation, to
achieve a high-precision approximation in conjunction with finite differences?
Jie Hou et al.: Preprint submitted to Elsevier
Page 3 of 21
2.2. Hermite Interpolation
Hermite interpolation is an interpolation method that requires the interpolating polynomial to pass through the
given nodes and match the function values as well as the values of the first several derivatives of the original function
at each node [40].
Definition 2. Let f (t) be a function defined on [a, b], and let t0, t1, ... , tn be n + 1 distinct points in [a, b], where the
function values f (ti) and the values of the first k derivatives f ′(ti), ... , f (k)(ti) are all known. The Hermite interpolation
polynomial H(t) satisfies the following conditions:
• H(t) passes through each given point ti and takes on the corresponding function value, i.e., H(ti) = f (ti).
• H(t) has the same values as f (t) for the first k derivatives at each given point ti, i.e., H (j)(ti) = f (j)(ti), for
1 ≤ j ≤ k.
Theorem 1. The Hermite polynomial of degree p, denoted as Hp(t), and the original function f (t) are under
consideration. When evaluating at a point t within the interval [t0, tn], the error function can be expressed as follows:
f (t) − Hp(t) =
f (p+1)(ξ)
(p + 1)!
∏
(t − ti
) p+1
2
,
i
(8)
), p + 1 is the total number of data points.
where ξ is an unknown point in the range (t0, tn
Two-Point Hermite Interpolation Two-Point Hermite interpolation is a commonly employed method in numerical
analysis and interpolation problems. Given an interval [a, b] and the values of a function f (a), f ′(a), f ′′(a) and f (b),
f ′(b), f ′′(b), we can construct a linear interpolation function H1(t) = h0
1(t)f (b) using only the function
values f (a) and f (b). The subscripts on Hp(t) and hp(t) denote that they are polynomials of degree p. According to
Definition 2, h0
1(t)f (a) + h1
1(t) and h1
1(t) must satisfy:
Thus h0
1(b) = 0,
1(b) = 1.
1(a) = 1, h0
h0
h1
1(a) = 0, h1
1(t) = t−b
a−b
H1(t) =
t − b
a − b
and h1
a−b
1(t) = a−t
a − t
a − b
f (a) +
, which gives:
f (b).
(9)
(10)
This is equivalent to the linear interpolation used in the L1 scheme for the Caputo fractional derivative. The error of
this interpolation approximation is:
f (t) − H1(t) =
f ′′(ξ)
2!
(t − a) (t − b) , ξ ∈ (a, b).
Similarly, it is possible to construct a function by using its values and first-order derivative values,
H3(t) = h0
3(t)f (b) + h2
3(t)f ′(a) + h3
3(t)f ′(b)
f (t) − H3(t) =
(t − a)2 (t − b)2 , ξ ∈ (a, b).
Incorporating constraints on the second-order derivative values can obtain:
H5(t) = h0
5(t)f (b) + h2
5(t)f ′(a) + h3
5(t)f ′(b) + h4
5(t)f ′′(a) + h5
5(t)f ′′(b)
f (t) − H5(t) =
(t − a)3 (t − b)3 , ξ ∈ (a, b).
3(t)f (a) + h1
f (4)(ξ)
4!
5(t)f (a) + h1
f (6)(ξ)
6!
While higher-degree Hermite interpolation polynomials theoretically yield smaller errors, they are often vulnerable
to the impact of rounding errors, which can lead to numerical instability. Additionally, they may exhibit Runge's
phenomenon, causing oscillations within the interval between interpolation nodes. As a result, in practical scenarios,
piecewise cubic Hermite interpolation polynomials are commonly favored.
Jie Hou et al.: Preprint submitted to Elsevier
Page 4 of 21
(11)
(12)
(13)
(14)
(15)
Remark 2. Now, let us attempt to address the question posed in Remark 1. Can we replace the interpolation step in
finite difference approximation methods with Hermite interpolation to achieve higher precision in fractional derivative
approximations? In traditional numerical methods, even without considering issues of regularity in the solution, direct
replacement is not feasible because both the function values and derivative values of the solution are unknown. Using
Hermite interpolation would require introducing additional degrees of freedom and solving the problem through
implicit iterations. However, it is worth noting that in neural network approaches, it appears that we can directly
substitute the interpolation step to achieve this goal. Since the implicit iteration steps are inherently embedded within
the neural network optimization process, we can directly execute high-order interpolation approximation methods.
3. Methodology
3.1. A Review of Neural Networks for Solving PDEs and FPDEs
This section reviews the applications of neural networks in solving partial differential equations (PDEs) and
fractional partial differential equations (FPDEs). We will focus on two main methods: Physics-Informed Neural
Networks (PINNs) and Fractional Physics-Informed Neural Networks (fPINNs).
Physics-informed Neural Networks (PINNs) PINNs are a type of models that incorporates prior knowledge of
physics into the neural network training process [24]. It can infer a continuous solution function u(x, t) based on
physical equations. Consider a general nonlinear partial differential equation, which is given by:
ut +
x[u] = 0,
u(x, 0) = I(x),
u(x, t) = B(x, t), x ∈ ∂Ω, t ∈ [0, T ],
x ∈ Ω, t ∈ [0, T ],
x ∈ Ω,
(16)
x[⋅] is a nonlinear differential operator, T is the time range. Given the initial condition u(x, 0) = I(x) and
where
the boundary condition u(x, t) = B(x, t), x ∈ ∂Ω, our aim is to find the solution function u(x, t) under these known
conditions. Firstly, we construct a trial solution:
̃u(x, t) = tf (x, t; θ) + I(x),
(17)
where f (x, t; θ) is a fully connected neural network, θ denotes the set of parameters for the neural network. ̃u(x, t)
naturally satisfies the initial conditions. Secondly, we define the residual of the PDE as:
r(x, t) ∶= ̃ut(x, t) +
x [ ̃u(x, t)] ,
(18)
where the partial derivatives of ̃u(x, t) can be effortlessly obtained utilizing automatic differentiation. The loss function
of the PINNs model can be expressed as:
(θ) =
1
Nb
Nb∑
j=1
[
̃u(xj
b, tj
b) − B(xj
b, tj
b)
]2
+
1
Nr
Nr∑
j=1
[r(xj
r, tj
r)
]2 ,
(19)
Nb
j=1
b)}
b, tj
b), B(xj
represents the boundary point data, and {xj
where {(xj
b, tj
refers to the internal collocation
points, Nb, Nr
are the respective number of data points. The internal collocation points are uniformly sampled
coordinate points from the domain Ω to compute the residual loss, which enforces ̃u(x, t) to satisfy the governing
equation. By continuously adjusting the neural network parameters to minimize the loss function and bringing (θ)
as close to zero as possible, we can consider ̃u(x, t) as the approximate solution function when the loss decreases to a
minimal value.
r, tj
r}
Nr
j=1
with
t u, where the time derivative is no longer an integer but a fractional order α, the problem becomes a time-fractional
Fractional PINNs (fPINNs) fPINNs are an extension of PINNs, used for solving FPDEs [25]. By replacing ut
C
Dα
0
partial differential equation. The residual of the FPDE can be expressed as:
r(x, t) ∶= C
0 Dα
t ̃u(x, t) +
x [ ̃u(x, t)] .
(20)
Unlike integer-order derivatives, fractional derivatives cannot be obtained directly through automatic differentiation.
Therefore, in fPINNs, the time-fractional derivative is approximated using the finite difference L1 scheme, as shown
in Eq. 5. Given the spatial location x, C
t ̃u(x, t) evaluated at time t depends on all the values of ̃u(x, t) evaluated at
Dα
0
all the previous time steps 0, Δt, 2Δt, ⋯ , t.
Jie Hou et al.: Preprint submitted to Elsevier
Page 5 of 21
3.2. Time-Fractional Hermite Neural Solver (HNS)
A simple way to solve time-fractional PDEs is to combine finite difference approximation methods for fractional
derivatives with PINNs. However, explicit finite difference approximation methods can only construct interpolation
functions based on function values, resulting in low performance. In this paper, we introduce a novel neural network
method for solving time-fractional PDEs, utilizing Hermite interpolation.
Firstly, we construct a high-order explicit approximation scheme for the fractional derivative based on Hermite
interpolation. We then use the high-order explicit approximation scheme to compute residuals for optimizing network
parameters. This method takes advantage of the infinitely differentiable properties of neural networks and extends the
finite difference approximation methods. This fully leverages the power of neural networks. In addition, this method
does not require implicit iterations; instead, it utilizes neural networks to perform explicit, higher-order interpolation for
approximating fractional derivatives. As a result, it offers computational efficiency similar to finite difference methods
while achieving higher accuracy. Specifically, for the Caputo time-fractional PDEs given by:
C
0 Dα
t u(x, t) +
x[u] = 0,
x ∈ Ω, t ∈ [0, T ],
(21)
where α is the order of the time derivative and we focus on the case where α ∈ (0, 1). The solution function u(x, t)
must satisfy the initial condition u(x, 0) = I(x) and the boundary condition u(x, t) = B(x, t), x ∈ ∂Ω. Firstly, we
construct a trial solution for this problem based on the initial condition:
̃u(x, t) = tf (x, t; θ) + I(x),
(22)
where ̃u(x, t) satisfies the initial condition without any additional constraints. Subsequently, we define the residual and
the loss function as:
r(x, t) ∶= C
(θ) =
1
Nb
0 Dα
t ̃u(x, t) +
Nb∑
[
̃u(xj
b, tj
b) − B(xj
b, tj
b)
]2
x [ ̃u(x, t)] ,
+
1
Nr
Nr∑
j=1
[r(xj
r, tj
r)
]2 ,
(23)
(24)
j=1
]
[
̃u(xj
r, tj
r)
can be obtained through automatic differentiation, while C
0
where
r) will be approximated using
x
Hermite Interpolation Explicit Approximation. Due to the non-local nature of fractional derivatives, as defined in
Definition 1, evaluating r(x, t) using random points in the computational domain requires the introduction of auxiliary
nodes from previous time steps, which results in lower computational efficiency. To improve computational efficiency,
, where
we use equidistant nodes on the time axis to evaluate r(x, t), i.e.,
is the number of spatial coordinates sampled in the spatial domain Ω, and the spatial coordinates can be sampled
Mx
uniformly or equidistantly, see Fig. 2. In addition, in this article, we utilize the L-BFGS optimizer to optimize the
network parameters. The model architecture is shown in Fig. 1.
Mx
j=1 ∪ ⋯ ∪ {xj
Mx
j=1 ∪ {xj
r, Δt}
r, T }
Mx
j=1
r, 0}
{xj
{
}
t ̃u(xj
Dα
r, tj
Hermite Interpolation Explicit Approximation for Caputo Fractional Derivatives In explicit finite difference
approximation methods, we can only construct interpolation functions based on function values, which greatly limits
the accuracy of numerical methods. In this paper, we leverage the infinitely differentiable properties of neural networks
and use Hermite interpolation methods to construct high-order interpolation explicit approximation methods based on
both function and derivative values. This paper primarily investigates time-fractional partial differential equations, So
let us focus on the temporal dimension. For clarity, we will use the example of the fractional ordinary differential
equation to illustrate the Hermite Interpolation Explicit Approximation for Caputo Fractional Derivatives. To utilize
Hermite interpolation, it is necessary to assume the regularity of the solution, by assuming that u(t) ∈ C p+1[0, T ].
Hermite Interpolation Explicit Approximation Let t ∈ (0, T ] and α ∈ (0, 1) be given. Take a positive integer N.
Let Δt = T
N
and tk = kΔt, 0 ≤ k ≤ N. Then, we have:
C
0 Dα
t u(t) ∣t=tn
=
1
Γ(1 − α) ∫
0
tn
u′(t)
(tn − t)α
dt =
1
Γ(1 − α)
n
∑
k=1
tk
∫
tk−1
u′(t)
(tn − t)α
dt.
Jie Hou et al.: Preprint submitted to Elsevier
(25)
Page 6 of 21
Fig. 1: HNS for 1D problem: Blue dots are known points, green dots are boundaries, and yellow dots are sampling points. After
inputting them into the neural network, they become known points (blue) for calculating Caputo fractional-order derivatives using
Hermite interpolation approximation.
Fig. 2: HNS: the spatial coordinates can be sampled uniformly or equidistantly.
On the interval [tk−1, tk], we perform Hermite interpolation on u(t) using formulas Eq. 10, Eq. 12, Eq. 14 to obtain:
u(t) ≈ Hp(t),
Thus, we obtain the Hermite approximation scheme for computing C
0
Dα
t u(t) ∣t=tn
:
Dα
t u(tn) =
1
Γ(1 − α)
n
∑
k=1
tk
∫
tk−1
H ′
p(t)
(tn − t)α
dt,
(26)
(27)
where Hp(t) is a polynomial of degree p and H ′
obtained using symbolic computation to obtain an exact expression in advance.
p(t) is a polynomial of degree p − 1. The integration operation can be
Jie Hou et al.: Preprint submitted to Elsevier
Page 7 of 21
!"!#!$%......&&&&...&&&&'InputHiddenOutput((!,%;+,-%⋅'+0Transform.........%!0Δ%2Δ%3Δ%(6−1)Δ%6Δ%:;(!,%)%<="%<>?@AB?@:;C(!,%)(%$−%)DE%F?D-(!,%$)GH[,-(!,%$)]Automatic Differentiation,-!,%<,,-′!,%<,,-CC(!,%<),L=0,1,...,6AD:!"#$!#%!#&""...Theorem 2. Suppose u(t) ∈ C p+1[0, T ], then the approximation error is given by:
∣ R(u(tn)) ∣
≤
1
(p + 1)!Γ(1 − α)
1
2p+1
⎡
⎢
⎢
⎣
+ α
Γ( 3+p
2
)Γ( 1−2α+p
Γ(2 − α + p)
2
)
⎤
⎥
⎥
⎦
max
≤ξ≤tn
t0
u(p+1)(ξ)|
|
|
|
|
|
Δtp+1−α
(28)
The proof can be found in Appendix A.
Remark 3. The Hermite interpolation Explicit approximation for Caputo fractional derivatives theoretically has a
numerical accuracy of p + 1 − α order. When p = 1, i.e., using function values at both endpoints for interpolation, the
method has the same numerical accuracy as the standard L1 scheme, which is 2 − α order. When p = 3, i.e., using
function values at both endpoints and first derivative values for interpolation, the method has a numerical accuracy
of 4 − α order. When p = 5, i.e., using function values at both endpoints, first derivative values, and second derivative
values for interpolation, the method has a numerical accuracy of 6 − α order. Due to the influence of floating-point
errors and numerical issues during neural network optimization, the accuracy cannot reach the ideal state when p = 5.
Therefore, the commonly used case is p = 3, i.e., using function values and first derivative values for interpolation.
The floating-point errors and numerical issues during neural network optimization Higher-order Hermite
interpolation can generate high-degree polynomials, and the coefficients of these polynomials are dependent on the
interval spacing of the interpolation region. The coefficients of the polynomial of degree p generated by Hermite
interpolation contain 1∕Δtp, and these coefficients are involved in the calculations of neural networks. Therefore, when
p is large and Δt is small, it is likely to cause floating-point errors and numerical issues during neural network
optimization.
Therefore, to ensure stable optimization of the neural network, we employ the double data type within the network.
otherwise, it may lead to premature convergence, impacting the final accuracy. However, we do not need to be overly
concerned about the additional time cost brought by double precision. Actually, from an experimental perspective, for
a given equation, the model and data are not exceedingly large, and double precision does not significantly consume
more time.
Finally, these problems are also related to the computational process, and it might be possible to address this issue
by simplifying expressions in advance to eliminate smaller values that arise during calculations. This is a consideration
the authors are contemplating.
4. Results
In this section, we will demonstrate the performance of the HNS. We denote the HNS employing Hermite
interpolation polynomial of degree p as the p-th order HNS. We denote the number of time nodes as Mt = N + 1
and the time step as Δt = T∕N. The number of spatial nodes is denoted as Mx
. In our experiments, we evaluate the
performance of the HNS by the relative L2 error ∥ ̃u−u∥2∕∥u∥2
. Code is developed using PyTorch, the activate function
nn.GELU () [45] and double data type are employed.
We validate the high performance of HNS in six computational scenarios:(1)Fractional differential equation;(2)One-
Dimensional Time-Fractional diffusion equation;(3)Two-Dimensional Time-Fractional advection-diffusion equation;(4)3-
Dimensional Time-Fractional advection-diffusion equation;(5)10-Dimensional Time-Fractional advection-diffusion
equation;(6)The Inverse Problem for 3-Dimensional Time-Fractional advection-diffusion equation.
4.1. Fractional differential equation
Consider the following fractional differential equation:
C
0 Dα
t u(t) = u(t) +
Γ(3)
Γ(3 − α)
t2−α − t2 − 1,
t ∈ [0, T ],
(29)
with the initial condition u(0) = 1. where T is the time range. The exact solution for this equation is u(t) = 1 + t2. In
this problem, we construct the trial solution:
̃u(t) = tf (t; θ) + 1,
Jie Hou et al.: Preprint submitted to Elsevier
(30)
Page 8 of 21
Table 1
FDE: The relative L2 error for different time intervals.
α = 0.3
α = 0.5
α = 0.7
Mt
6
11
21
41
81
101
p = 1
p = 3
p = 5
p = 1
p = 3
p = 5
p = 1
p = 3
p = 5
1.83e-01
5.72e-02
1.88e-02
6.17e-03
2.04e-03
1.42e-03
1.31e-03
6.92e-05
6.47e-05
8.94e-05
6.76e-05
6.03e-06
1.37e-03
6.05e-05
6.90e-05
9.54e-05
8.72e-05
8.66e-05
2.60e-01
8.65e-02
3.10e-02
1.12e-02
4.10e-03
2.95e-03
2.82e-03
4.45e-05
1.24e-05
5.88e-06
4.70e-06
4.63e-06
2.64e-03
6.27e-05
1.22e-05
1.15e-04
9.94e-05
9.42e-05
3.82e-01
1.34e-01
5.24e-02
2.12e-02
8.62e-03
6.46e-03
5.18e-03
8.54e-05
1.86e-05
7.15e-06
5.54e-06
5.01e-06
5.14e-03
8.66e-05
1.86e-05
1.25e-04
9.65e-05
8.14e-05
where f (t; θ) is a fully connected neural network with four hidden layers, each with 20 neurons. While at this point, the
neural network only needs to learn a linear function, it is still possible to assess the performance of HNS. We study the
performance of the HNS in handling this problem, and 1000 equally spaced test points used to calculate the prediction
is set to 3 and 6, respectively.
error. In the experiment, the time range T is set to 2, and the number of time nodes Mt
Fig. 3: FDE: Comparison of the predicted solution and the exact solution when α = 0.5, with p representing the p-th order HNS.
left: Mt = 3 and right: Mt = 6.
Fig. 3 shows the comparison of the predicted and exact solutions when α = 0.5. It is important to note that the
Hermite interpolation explicit approximation is equivalent to the traditional L1 scheme when p = 1. The results
indicate that the third-order or fifth-order HNS achieves improved predictive results when Mt = 3 or Mt = 6. For
third-order HNS at Mt = 6, the relative L2 error is reduced to as low as 2.82e − 3. Additionally, although a higher
level of accuracy is theoretically expected for fifth-order HNS, this improvement is not significantly evident in practice.
No significant differences in accuracy are observed between the third-order HNS and fifth-order HNS. Additionally,
in terms of computational time, they are not as significant as initially anticipated. For specific details, please refer to
Table 8 in Appendix B.1.
Table 1 presents the relative L2 errors of the model at T = 2 for different time intervals. The table shows that
the HNS achieves low errors for any value of α. Additionally, both the third-order and fifth-order HNS show about 2
to 3 orders of magnitude higher accuracy than the HNS using linear Hermite interpolation. When the time interval is
is small, the accuracy of the fifth-order HNS is similar to that of the third-order HNS. However,
large, that is, when Mt
when the time interval is small, the fifth-order HNS actually reduces the accuracy. This is possibly due to floating-
point errors and numerical issues during neural network optimization. Consequently, the third-order HNS provides the
highest performance.
Jie Hou et al.: Preprint submitted to Elsevier
Page 9 of 21
0.000.250.500.751.001.251.501.752.00t05101520u(t)Exactp=1p=3p=50.000.250.500.751.001.251.501.752.00t123456u(t)Exactp=1p=3p=5Fig. 4: FDE: Comparison of the method proposed in this paper with the classical finite difference method based on the L1 schema
in the time dimension when α = 0.5.
Finally, we also compared HNS with finite difference numerical methods based on the L1 schema. Fig. 4 illustrates
the accuracy comparison between standard FDM and different-order HNS for various time intervals. The results
indicate that the accuracy of FDM is essentially equivalent to that of HNS with p = 1, which is evident because
when p = 1, the fractional derivative approximation method used in HNS is equivalent to the L1 scheme. This also
suggests that, given a numerical scheme, neural networks can learn the corresponding level of solution accuracy.
Third-order HNS exhibits the highest precision, with accuracy of FDM dropping below 1e − 3 only after Mt > 200,
while third-order HNS achieves errors below 1e − 4 by Mt = 11. However, for fifth-order HNS, its accuracy is similar
to third-order HNS when the time interval is relatively large. Still, as the time interval decreases, fifth-order HNS
becomes unstable due to numerical issues, resulting in significant errors.
4.2. Time-Fractional diffusion equation
Next, let us consider the following time fractional diffusion equation:
Dα
t u(x, t) = uxx, x ∈ [0, L], t ∈ [0, T ]
C
0
u(x, 0) = I(x), x ∈ [0, L]
u(0, t) = B(0, t), u(L, t) = B(L, t),
t ∈ [0, T ]
⎧
⎪
⎨
⎪
⎩
(31)
and B(1, t) = 1 + 2tα
where I(x) = x2, B(0, t) = 2tα
Γ(1+α)
Γ(1+α)
spatial and temporal ranges, respectively. The exact solution for this equation is u(x, t) = x2 + 2tα
Γ(1+α)
we construct a trial solution
. In this paper, we consider L = 1 and T = 1 as the
. For this issue,
̃u(x, t) = tf (x, t; θ) + x2
(32)
where f (x, t; θ) represents a fully connected neural network with the number of layers and neurons consistent with
previous experiments. In this experiment, a uniform grid of 100 × 100 points is employed to test the model. Fig. 5
displays the performance of the HNS with α = 0.65, Mt = 21, and Mx = 11. The results indicate that higher-
order HNS show faster convergence rates. As the convergence rate of the third-order HNS is faster, the time taken for
convergence is quite close between the first-order and third-order HNS. However, the fifth-order HNS, after iterating
over a thousand rounds, takes longer than the other models that iterate 3000 rounds. In terms of accuracy, both the
third-order and fifth-order HNS demonstrate extremely high precision. Therefore, in terms of overall performance, the
third-order HNS shows the highest level.
Fig. 6 illustrates the variations in relative L2 error with the number of temporal nodes Mt
when
α = 0.65. When Mx
is fixed at 11, the relative L2 errors of the first-order and third-order HNS gradually decrease as the
time interval reduces. However, the accuracy of the fifth-order HNS shows a phenomenon of first decreasing and then
or spatial nodes Mx
Jie Hou et al.: Preprint submitted to Elsevier
Page 10 of 21
0100200300400500600700800Mt105104103102101100L2errorFDMp=1p=3p=5Fig. 5: TFDE: The loss curve, computation time in seconds, and relative L2 error of the HNS with α = 0.65, Mt = 21, and Mx = 11.
increasing, which may be affected by floating-point errors and numerical issues during neural network optimization.
In addition, when Mt
increases, the accuracy of the first-order and third-order model does not
show significant changes, while the relative L2 errors of the fifth-order HNS exists fluctuations. Both the third-order
and fifth-order HNS have very high precision.
is fixed at 41, as Mx
Table 2 displays the L2 error of the HNS model at different Caputo derivative orders and time intervals with
Mx = 11. It can be observed from the table that the HNS can solve the problem well for any α. The third-order and
fifth-order HNS have higher accuracy.
Fig. 6: TFDE: The relative L2 error varies with changes in the number of time nodes Mt
or spatial nodes Mx
, when α = 0.65.
4.3. Time-Fractional advection-diffusion equation
In order to further illustrate the advantages of the model, we study the performance of the HNS in solving the two-
dimensional fractional advection-diffusion equation. Consider the following fractional advection-diffusion equation:
Jie Hou et al.: Preprint submitted to Elsevier
Page 11 of 21
0100020003000Epoch107105103101101Lossp=1p=3p=5135p050100150200Time135p0.0000.0010.0020.0030.004L2error20406080100Mt104103102relative L2 error, Mx=11p=1p=3p=51020304050Mx103relative L2 error, Mt=41p=1p=3p=5Table 2
TFDE: The relative L2 error for different time intervals.
α = 0.45
α = 0.65
α = 0.85
Mt
6
11
21
41
61
81
101
p = 1
p = 3
p = 5
p = 1
p = 3
p = 5
p = 1
p = 3
p = 5
1.39e-02
9.79e-03
7.19e-03
2.80e-03
2.17e-03
1.73e-03
1.53e-03
1.73e-02
8.84e-03
3.81e-03
1.06e-03
2.76e-04
1.40e-04
1.66e-04
1.74e-02
8.40e-03
3.87e-03
1.22e-03
3.68e-04
3.44e-04
9.95e-04
1.52e-02
8.80e-03
4.64e-03
2.45e-03
1.71e-03
1.36e-03
1.22e-03
6.05e-03
2.47e-03
9.92e-04
2.60e-04
1.11e-04
1.04e-04
3.78e-05
4.73e-03
1.98e-03
8.51e-04
2.22e-04
1.70e-04
8.11e-04
8.50e-04
5.52e-03
4.01e-03
2.29e-03
1.33e-03
1.00e-03
8.86e-04
8.12e-04
1.57e-03
5.33e-04
1.73e-04
6.05e-05
5.53e-05
2.03e-05
4.25e-05
1.58e-03
5.32e-04
1.68e-04
9.24e-05
4.60e-04
4.47e-04
3.80e-04
Table 3
TFADE: The relative L2 error for different time intervals. Mx = 11 × 11
α = 0.7
α = 0.8
α = 0.9
Mt
6
11
21
41
81
p = 1
p = 3
p = 5
p = 1
p = 3
p = 5
p = 1
p = 3
p = 5
6.05e-03
3.18e-03
1.70e-03
8.51e-04
4.41e-04
1.93e-04
1.73e-04
1.27e-04
1.06e-04
1.58e-04
2.80e-04
3.41e-04
1.31e-04
1.56e-04
2.70e-04
8.89e-03
4.02e-03
2.32e-03
1.32e-03
6.67e-04
3.13e-04
1.45e-04
1.98e-04
1.35e-04
1.62e-04
2.42e-04
2.11e-04
2.02e-04
1.93e-04
5.59e-04
1.13e-02
5.80e-03
3.31e-03
1.94e-03
1.06e-03
3.40e-04
1.74e-04
1.52e-04
1.68e-04
8.62e-05
3.64e-04
1.98e-04
1.49e-04
1.43e-04
8.97e-04
t u(x, t) = κΔu(x, t) + g(x, t), x ∈ Ω = [0, 1]2, t ∈ [0, 1]
Dα
C
0
u(x, 0) = 0, x ∈ Ω
u(x, t) = t2ex+y, x ∈ ∂Ω, t ∈ [0, 1]
⎧
⎪
⎨
⎪
⎩
(33)
In this paper, we employ κ = 1.0 , and g(x, t) =
u(x, t) = t2ex+y. For this case, we construct a trial solution:
[ 2t2−α
Γ(3−α)
]
− 2t2
ex+y. The exact solution for this equation is
̃u(x, y, t) = tf (x, y, t; θ),
(34)
In this experiment, we use a uniform grid of 100 × 100 × 100 points to test the model. We first test the effectiveness of
the HNS on this problem. With α = 0.85, Mt = 11, Mx = 11 × 11, we use the third-order HNS to solve the problem.
The results show that the relative L2 error is 1.66e − 04, which demonstrates the high accuracy of the third-order HNS.
The performance of the HNS is evaluated with different values of α, and the experimental results are presented in
Table 3. It is observed that higher accuracy is achieved by the third-order and fifth-order HNS.
4.4. 3D Time-Fractional advection-diffusion equation
Now, let us address a higher-dimensional advection-diffusion equation. Firstly, we consider the following problem
defined in a 3D cubic domain:
C
0 Dα
t u(x, t) − Δu(x, t) + (1, 1, 1) ⋅ ∇u(x, t) − g(x, t) = 0, x ∈ Ω = (0, 1)3 ∈ R3
(35)
The analytical solution for this equation is chosen as u(x, t) = t2 + cos(x) + cos(y) + cos(z),with initial conditions
u(x, 0) = cos(x) + cos(y) + cos(z). For this case, we construct a trial solution:
̃u(x, y, z, t) = tf (x, y, z, t; θ) + cos(x) + cos(y) + cos(z),
(36)
In this experiment, we employ a uniform grid consisting of 51 × 51 × 51 × 51 points to evaluate the model. The time
range is [0, 1], and Mx = 11 × 11 × 11. The performance of the HNS is evaluated with α = 0.5, and the experimental
Jie Hou et al.: Preprint submitted to Elsevier
Page 12 of 21
Table 4
FPDE-3D: The relative L2 error and training cost for different time intervals.
α = 0.5
Mt
3
6
11
21
p = 1
4.41e-03
4.57e-04
2.23e-04
9.66e-05
cost(s)
149.21
232.78
370.09
860.74
p = 3
1.72e-03
5.86e-05
3.62e-05
2.94e-05
cost(s)
153.96
239.83
395.34
881.57
p = 5
1.60e-03
5.93e-05
2.32e-05
3.09e-05
cost(s)
168.77
277.49
514.28
1186.06
results are presented in Table 4. It is observed that higher accuracy is achieved by the third-order and fifth-order HNS.
Moreover, the time expenses for the HNS models with p = 1 and p = 3 are comparable, while for p = 5, convergence
occurs earlier for larger time intervals, resulting in relatively shorter computation times. However, at Mt = 21, the
fifth-order HNS model takes 1186.06 seconds.
In this experiment, we construct a trial solution that is suitable. So the neural network only needs to learn a linear
function, which simplifies the problem. To thoroughly verify the performance of HNS, we change the analytical
solution for this problem to u(x, t) = t2(cos(x1) + cos(x2) + cos(x3)),with initial conditions u(x, 0) = 0. Now, we
construct a trial solution:
̃u(x1, x2, x3, t) = tf (x1, x2, x3, t; θ),
(37)
Additionally, it is worth noting that using equidistant grid points for training models in high-dimensional problems
is not suitable. This is because as the dimensionality increases, the number of equidistant points grows exponentially.
Therefore, to demonstrate the ability of HNS to handle high-dimensional problems, we utilize uniform sampling
to generate spatial coordinates both inside the domain and on the boundaries. This approach helps prevent issues
associated with the explosion of dimensions. In this paper, we employ the LHS method to sample training spatial
coordinate points.
We uniformly sample 5000000 spatiotemporal coordinates to assess the performance of the model. For the training
data, we uniformly sample 1000 coordinates in space, i.e., Mx = 1000, with 100 coordinates uniformly sampled along
each boundary. At Mt = 6, the relative L2 error of the first-order HNS model is 2.47e − 03. But the relative L2 error
of the third-order HNS is 3.66e − 04, which demonstrates the high accuracy of the third-order HNS.
4.5. 10D Time-Fractional advection-diffusion equation
Next, we extend the equation from 3D to 10D. We choose the analytical solution for the problem as follows:
u(x, t) = t2
N
∑
i
cos(xi)
where N = 10. The initial condition remains u(x, 0) = 0, so the constructed trial solution is:
̃u(x, t) = tf (x, t; θ),
Firstly, we conduct testing on a 10-dimensional advection equation, which takes the following form:
C
0 Dα
t u(x, t) + (1, 1, 1) ⋅ ∇u(x, t) − g(x, t) = 0, x ∈ Ω = (0, 1)10 ∈ R10
(38)
(39)
(40)
We continue to employ 5000000 spatiotemporal coordinates to assess the performance of the model. For the training
data, we uniformly sample 5000 coordinates in space, i.e., Mx = 5000, with 100 coordinates uniformly sampled along
each boundary. Due to the complexity of the problem, we set the number of training epochs to 3000, and the specific
experimental results are shown in Table 5. The experimental results indicate that both p = 1 and p = 3 HNS models
can effectively solve this problem. Meanwhile, the third-order HNS exhibits higher accuracy, and this accuracy does
not decrease as the time interval decreases, suggesting that the accuracy has likely reached the limit for this problem.
Additionally, the third-order HNS does not show a significant increase in computational time.
Jie Hou et al.: Preprint submitted to Elsevier
Page 13 of 21
Table 5
10D advection equation: The relative L2 error and training cost for different time intervals.
α = 0.5
Mt
6
11
21
p = 1
5.78e-03
2.26e-03
9.19e-04
cost(s)
356.35
538.09
2382.85
p = 3
2.02e-04
2.34e-04
2.16e-04
cost(s)
413.42
773.69
2434.15
Next, we will upgrade the experiment from an advection equation to an advection-diffusion equation, which takes
the following form:
C
0 Dα
t u(x, t) − Δu(x, t) + (1, 1, 1) ⋅ ∇u(x, t) − g(x, t) = 0, x ∈ Ω = (0, 1)10 ∈ R10
(41)
We continue to employ Eq. 38 as the analytical solution for the problem and Eq. 39 as the trial solution for HNS.
The settings for testing and training data remain the same as before. Since the equation includes spatial second-order
derivatives, the model will take more time. However, the model still maintains high accuracy, and its precision does
not decrease due to the complexity of the equation. At Mt = 6, the relative L2 error of the first-order HNS model is
1.37e − 03, with a cost of 1074.03. However, the relative L2 error of the third-order HNS is 8.26e − 04, with a cost
of 1077.11. Fig. 7 illustrates the results obtained by the third-order HNS, corresponding to t = 1, x3 = x4 = ... =
x10 = 0.5. From the figure, it is evident that the HNS results exhibit very small errors when compared to the analytical
solution.
Fig. 7: 10D Time-Fractional advection-diffusion equation when α = 0.5.
4.6. The Inverse Problem
We have already thoroughly demonstrated the excellent performance of HNS on forward problems. In this section,
we shift our focus to solving inverse problems. Let us reconsider the 3D advection-diffusion equation:
C
0 Dα
t u(x, t) − βΔu(x, t) + γ(1, 1, 1) ⋅ ∇u(x, t) − g(x, t) = 0, x ∈ Ω = (0, 1)3 ∈ R3
(42)
along with its analytical solution u(x, t) = t2(cos(x1) + cos(x2) + cos(x3)) and initial conditions u(x, 0) = 0.
Additionally, g(x, t) is known. In the inverse problem, the goal is to infer (α, β, γ) from a given measurement of u(x, t).
First, let us clarify our experimental data. In this problem, we uniformly sample 5000000 spatiotemporal
coordinates to assess the performance of the model. For the training data, we uniformly sample 1000 coordinates
in space, i.e., Mx = 1000, with 50 coordinates uniformly sampled along each boundary. In the temporal dimension,
we set Mt = 6. Additionally, in our model, we treat (α, β, γ) as optimizable parameters that are optimized together
Jie Hou et al.: Preprint submitted to Elsevier
Page 14 of 21
0.00.51.0x10.000.250.500.751.00x2Exact u8.59.0Pred u8.59.0|u - u|0.0050.0100.015Table 6
The Inverse Problem for 3D advection-diffusion equation to infer α.
α = 0.5
p
1
3
̃α
0.54235
0.49514
| ̃α − α|
0.04235
0.00486
∥ ̃u−u∥2∕∥u∥2
1.03e-03
2.47e-04
cost(s)
198.70
214.79
Table 7
The Inverse Problem for 3D advection-diffusion equation to infer (α, β, γ).
α = 0.5, β = 1.0, γ = 1.0
p
1
3
̃α
0.46707
0.49714
| ̃α − α|
0.03293
0.00286
̃β
1.14661
0.96709
̃β − β|
|
0.14661
0.03291
̃γ
1.10838
0.95065
|̃γ − γ|
0.10838
0.04935
∥ ̃u−u∥2∕∥u∥2
1.46e-03
2.75e-04
cost(s)
201.27
209.07
with the parameters of neural network. To solve this inverse problem, we need to include an additional term in the loss
function:
(θ, α, β, γ) =
1
Nb
Nb∑
[
j=1
̃u(xj
b, tj
b) − B(xj
b, tj
b)
]2
+
1
Nr
Nr∑
j=1
[r(xj
r, tj
r)
]2
+
1
Nr
Nr∑
j=1
[ ̃u(xj
r, tj
r) − u(xj
r, tj
r)
]2
(43)
Firstly, we assume that there is only one unknown parameter α in the equation. We use HNS with p = 1 and p = 3 to
solve this problem, respectively. We set the initial value of α to 0.2, while its true value is 0.5. Table 6 indicates that
the third-order HNS exhibits a significant advantage both in parameter inference and solution accuracy compared to
p = 1. Moreover, their computational time difference is not substantial. In this problem, the error in α is only 0.00486.
Next, we expand the parameter inference scope and use the HNS model to infer (α, β, γ),setting their initial values
to (0.2, 0.2, 0.2). From Table 7, it is evident that HNS has performed admirably in solving the inverse problem, with
very small errors for each unknown parameter. Furthermore, the third-order HNS demonstrates superior accuracy.
Surprisingly, the error in α has even decreased in this case.
5. Conclusion and Discussion
In this paper, we extend the explicit approximation of Caputo fractional derivatives based on Hermite interpolation
technique and analyze the approximation error. By utilizing the infinitely differentiable properties of deep neural
networks, we naturally combine the Hermite interpolation explicit approximation of Caputo fractional derivatives
with deep neural networks to propose an innovative model, called HNS. This model can solve time-fractional partial
differential equations with high accuracy. Experimental results show that the accuracy of the third-order HNS is
significantly higher than that of the neural network method based on L1 scheme for both forward and inverse problems,
as well as in high-dimensional scenarios.
The HNS fully utilizes the advantages of neural networks and breaks through the limitation of explicit finite
difference methods that can only be interpolated based on function values. This results in deeper integration models
between deep neural networks and numerical methods, and opens up new opportunities for integrating deep neural
networks with scientific computing technology. The limitation of this work is we focus exclusively on time-fractional
partial differential equations. Exploring spatial fractional derivatives and other important fractional partial differential
equations represents an exciting direction for future research.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have
appeared to influence the work reported in this paper.
Jie Hou et al.: Preprint submitted to Elsevier
Page 15 of 21
Data availability
The data and code can be found at https://github.com/hsbhc/HNS.
Acknowledgements
This work is supported by the National Key Research and Development Program of China (No. 2021YFA1003004).
Appendix.
A. Approximation Error of Hermite Interpolation Explicit Approximation
Theorem 2. Suppose u ∈ C p+1(t0, tn),then the approximation error is given by:
∣ R(u(tn)) ∣
≤
1
(p + 1)!Γ(1 − α)
⎡
⎢
⎢
⎣
Proof. From the definition of R(u(tn)), we know that:
)Γ( 1−2α+p
Γ(2 − α + p)
1
2p+1
Γ( 3+p
2
+ α
2
)
⎤
⎥
⎥
⎦
max
≤ξ≤tn
t0
u(p+1)(ξ)|
|
|
|
|
|
Δtp+1−α
R(u(tn)) =
1
Γ(1 − α)
=
1
Γ(1 − α)
n
∑
k=1
n
∑
k=1
tk
∫
tk−1
tk
∫
tk−1
dt −
u′(t)
1
(tn − t)α
Γ(1 − α)
]′
[u(t) − Hp(t)
(tn − t)α
dt
n
∑
k=1
tk
∫
tk−1
H ′
p(t)
(tn − t)α
dt
Applying the integration by parts formula and noting the error function of Hermite Interpolation, we obtain:
R(u(tn)) = −
1
Γ(1 − α)
= −
1
Γ(1 − α)
n
∑
k=1
n
∑
k=1
tk
∫
tk−1
tk
∫
tk−1
[u(t) − Hp(t)
] d
1
(tn − t)α
u(p+1)(ξ)
(p + 1)!
k
∏
i=k−1
(t − ti
) (p+1)
2 α(tn − t)−α−1dt
Thus,
∣ R(u(tn)) ∣≤
1
(p + 1)!Γ(1 − α)
max
≤ξ≤tn
t0
u(p+1)(ξ)|
|
|
|
|
|
n
∑
k=1
Two formulas can be obtained by calculation as follows:
tk
k
∏
∫
tk−1
i=k−1
(∣ t − ti ∣)
(p+1)
2 α(tn − t)−α−1dt
(t − tk−1)
(p+1)
2
(tk − t)
(p+1)
2 α(tn − t)−α−1dt
n−1
∑
tk
∫
tk−1
k=1
≤ Δtp+1
2p+1
=
=
Δtp+1
2p+1 ∫
t0
Δtp+1
2p+1
n−1
∑
k=1
tk
∫
tk−1
α(tn − t)−α−1dt
tn−1
α(tn − t)−α−1dt
(Δt−α − t−α
n ) ≤ 1
2p+1
Δtp+1−α
(44)
(45)
(46)
(47)
(48)
Jie Hou et al.: Preprint submitted to Elsevier
Page 16 of 21
and:
tn
(t − tn−1)
(p+1)
2
(tn − t)
(p+1)
2 α(tn − t)−α−1dt
∫
tn−1
tn
α ∫
tn−1
Δt
= α ∫
0
Γ( 3+p
2
= α
(t − tn−1)
(p+1)
2
(tn − t)
(p+1)
2
−α−1dt
(Δt − ξ)
(p+1)
2 ξ
(p+1)
2
−α−1dξ
)Γ( 1−2α+p
Γ(2 − α + p)
2
)
Δtp+1−α
Substituting Eq. 48 and Eq. 49 into Eq. 47, we obtain:
∣ R(u(tn)) ∣
≤
1
(p + 1)!Γ(1 − α)
1
2p+1
⎡
⎢
⎢
⎣
+ α
Γ( 3+p
2
)Γ( 1−2α+p
Γ(2 − α + p)
2
)
⎤
⎥
⎥
⎦
max
≤ξ≤tn
t0
u(p+1)(ξ)|
|
|
|
|
|
Δtp+1−α
(49)
(50)
B. Additional results
In this section, we present additional results that help clarify details of our method.
B.1. Fractional differential equation
Fig. 8: FDE: Comparison between predicted and exact solutions, the absolute error at each time step with the third-order HNS,
using parameters α = 0.5, Mt = 11, and p = 3.
Fig. 8 and Fig. 9 demonstrate the predictive results and convergence process of the third-order HNS. During the
training process, a large time interval of Mt = 11 is utilized, yet the relative L2 error of the third-order HNS is as
low as 4.45e − 05. And the absolute error increases as t increases. This effectively illustrates the high accuracy of
the third-order HNS. Upon examining the loss curve, it is evident that the convergence rate of the third-order HNS is
remarkably fast.
training cost Due to the need to compute second-order derivatives, the computational cost for p = 5 is considerably
high. Theoretically, the time cost follows the order: p = 1 < p = 3 < p = 5. However, p = 3 and p = 5 converge
faster because they utilize function values, derivatives, or higher-order derivatives for interpolation. This essentially
compensates for the disadvantage in terms of computational time, possibly resulting in p = 3 and p = 5 having lower
time costs compared to p = 1. See Table 8
Jie Hou et al.: Preprint submitted to Elsevier
Page 17 of 21
Fig. 9: FDE: The iterative decrease in training loss with the third-order HNS, using parameters α = 0.5, Mt = 11, and p = 3.
Table 8
FDE: The relative L2 error and training cost. Training 3000 epochs.
α = 0.5
Mt
6
11
21
41
81
101
p = 1
2.60e-01
8.65e-02
3.10e-02
1.12e-02
4.10e-03
2.95e-03
cost(s)
p = 3
cost(s)
p = 5
0.20
10.69
15.38
22.92
36.62
45.92
2.82e-03
4.45e-05
1.24e-05
5.88e-06
4.70e-06
4.63e-06
0.33
0.61
27.95
48.31
2.29
4.80
2.64e-03
6.27e-05
1.22e-05
1.15e-04
9.94e-05
9.42e-05
cost(s)
0.91
104.84
6.99
7.30
12.07
13.56
B.2. Time-Fractional diffusion equation
Fig. 10 and Fig. 11 illustrate the predictive results and convergence process of the third-order HNS, which achieves
a remarkably low relative L2 error of 3.39e − 04 for time-fractional PDEs. Unlike previous experiments, we observe
that the absolute error does not increase with time for this problem. As shown in the figure, the error is large near t = 0
but relatively small for later time steps. This phenomenon may be related to the optimization process of the third-order
HNS, and we will further analyze it using Neural Tangent Kernel(NTK) in future work.
B.3. Time-Fractional advection-diffusion equation
Fig. 12 and Fig. 13 illustrates the predictive results of the third-order HNS, which achieves a remarkably low
relative L2 error of 1.66e − 04 for this problem.
References
[1] I. Podlubny, An introduction to fractional derivatives, fractional differential equations, to methods of their solution and some of their
applications, Math. Sci. Eng 198 (1999) 340.
[2] A. A. Kilbas, H. M. Srivastava, J. J. Trujillo, Theory and applications of fractional differential equations, volume 204, elsevier, 2006.
[3] Y.-X. Li, T. Muhammad, M. Bilal, M. A. Khan, A. Ahmadian, B. A. Pansera, Fractional simulation for darcy-forchheimer hybrid nanoliquid
flow with partial slip over a spinning disk, Alexandria Engineering Journal 60 (2021) 4787–4796.
[4] F. Song, C. Xu, G. E. Karniadakis, A fractional phase-field model for two-phase flows with tunable sharpness: algorithms and simulations,
Computer Methods in Applied Mechanics and Engineering 305 (2016) 376–404.
[5] A. Beltempo, M. Zingales, O. S. Bursi, L. Deseri, A fractional-order model for aging materials: An application to concrete, International
Journal of Solids and Structures 138 (2018) 13–23.
[6] F. Mainardi, Fractional calculus and waves in linear viscoelasticity: an introduction to mathematical models, World Scientific, 2022.
[7] C. Ionescu, A. Lopes, D. Copot, J. T. Machado, J. H. Bates, The role of fractional calculus in modeling biological phenomena: A review,
Communications in Nonlinear Science and Numerical Simulation 51 (2017) 141–159.
Jie Hou et al.: Preprint submitted to Elsevier
Page 18 of 21
Fig. 10: TFDE: Comparison between predicted and exact solutions with the third-order HNS, using parameters α = 0.5,
Mt = 51, Mx = 11.
Fig. 11: TFDE:The absolute error, and the iterative decrease in training loss with the third-order HNS, using parameters α = 0.5,
Mt = 51, Mx = 11.
Fig. 12: TFADE: Comparison between predicted and exact solutions of t = 1 with the third-order HNS, using parameters α = 0.85,
Mt = 11, Mx = 11 × 11.
Jie Hou et al.: Preprint submitted to Elsevier
Page 19 of 21
Fig. 13: TFADE: The iterative decrease in training loss with the third-order HNS, using parameters α = 0.85, Mt = 11, Mx =
11 × 11.
[8] V. E. Tarasov, On history of mathematical economics: Application of fractional calculus, Mathematics 7 (2019) 509.
[9] T. Chen, D. Wang, Combined application of blockchain technology in fractional calculus model of supply chain financial system, Chaos,
Solitons & Fractals 131 (2020) 109461.
[10] H. Sun, Y. Zhang, D. Baleanu, W. Chen, Y. Chen, A new collection of real world applications of fractional calculus in science and engineering,
Communications in Nonlinear Science and Numerical Simulation 64 (2018) 213–231.
[11] E. Sousa, Finite difference approximations for a fractional advection diffusion problem, Journal of Computational Physics 228 (2009) 4038–
4054.
[12] N. Sweilam, M. Khader, R. Al-Bar, Numerical studies for a multi-order fractional differential equation, Physics Letters A 371 (2007) 26–33.
[13] Y. Lin, C. Xu, Finite difference/spectral approximations for the time-fractional diffusion equation, Journal of computational physics 225
(2007) 1533–1552.
[14] A. H. Bhrawy, Y. A. Alhamed, D. Baleanu, A. A. Al-Zahrani, New spectral techniques for systems of fractional differential equations using
fractional-order generalized laguerre orthogonal functions, Fractional Calculus and Applied Analysis 17 (2014) 1137–1157.
[15] S. Kazem, S. Abbasbandy, S. Kumar, Fractional-order legendre functions for solving fractional-order differential equations, Applied
Mathematical Modelling 37 (2013) 5498–5510.
[16] H. Jafari, S. A. Yousefi, M. Firoozjaee, S. Momani, C. M. Khalique, Application of legendre wavelets for solving fractional differential
equations, Computers & Mathematics with Applications 62 (2011) 1038–1045.
[17] T. Langlands, B. I. Henry, The accuracy and stability of an implicit solution method for the fractional diffusion equation,
Journal of
Computational Physics 205 (2005) 719–736.
[18] Y. Gu, H. Sun, A meshless method for solving three-dimensional time fractional diffusion equation with variable-order derivatives, Applied
Mathematical Modelling 78 (2020) 539–549.
[19] Y. LeCun, Y. Bengio, G. Hinton, Deep learning, nature 521 (2015) 436–444.
[20] C. M. Bishop, Neural networks and their applications, Review of scientific instruments 65 (1994) 1803–1832.
[21] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, L. Yang, Physics-informed machine learning, Nature Reviews Physics 3
(2021) 422–440.
[22] L. Lu, X. Meng, Z. Mao, G. E. Karniadakis, DeepXDE: A deep learning library for solving differential equations, SIAM review 63 (2021)
208–228.
[23] M. Raissi, A. Yazdani, G. E. Karniadakis, Hidden fluid mechanics: Learning velocity and pressure fields from flow visualizations, Science
367 (2020) 1026–1030.
[24] M. Raissi, P. Perdikaris, G. E. Karniadakis, Physics-informed neural networks: A deep learning framework for solving forward and inverse
problems involving nonlinear partial differential equations, Journal of Computational physics 378 (2019) 686–707.
[25] G. Pang, L. Lu, G. E. Karniadakis, fpinns: Fractional physics-informed neural networks, SIAM Journal on Scientific Computing 41 (2019)
A2603–A2626.
[26] Y. Ye, H. Fan, Y. Li, X. Liu, H. Zhang, Deep neural network methods for solving forward and inverse problems of time fractional diffusion
equations with conformable derivative, Neurocomputing 509 (2022) 177–192.
[27] M. Pakdaman, A. Ahmadian, S. Effati, S. Salahshour, D. Baleanu, Solving differential equations of fractional order using an optimization
technique based on training artificial neural network, Applied Mathematics and Computation 293 (2017) 81–95.
[28] H.-D. Qu, X. Liu, X. Lu, M. ur Rahman, Z.-H. She, Neural network method for solving nonlinear fractional advection-diffusion equation with
spatiotemporal variable-order, Chaos, Solitons & Fractals 156 (2022) 111856.
[29] C. Biswas, A. Singh, M. Chopra, S. Das, Study of fractional-order reaction-advection-diffusion equation using neural network method,
Mathematics and Computers in Simulation (2023).
Jie Hou et al.: Preprint submitted to Elsevier
Page 20 of 21
[30] S. Wang, H. Zhang, X. Jiang, Physics-informed neural network algorithm for solving forward and inverse problems of variable-order space-
fractional advection–diffusion equations, Neurocomputing 535 (2023) 64–82.
[31] Y. Ye, Y. Li, H. Fan, X. Liu, H. Zhang, Slenn-elm: A shifted legendre neural network method for fractional delay differential equations based
on extreme learning machine, NHM 18 (2023) 494–512.
[32] Z. Hajimohammadi, F. Baharifard, A. Ghodsi, K. Parand, Fractional Chebyshev deep neural network (FCDNN) for solving differential models,
Chaos, Solitons & Fractals 153 (2021) 111530.
[33] X.-B. Yan, Z.-Q. J. Xu, Z. Ma, Laplace-fpinns: Laplace-based fractional physics-informed neural networks for solving forward and inverse
problems of subdiffusion, arXiv preprint arXiv:2304.00909 (2023).
[34] P.-H. Chiu, J. C. Wong, C. Ooi, M. H. Dao, Y.-S. Ong, CAN-PINN: A fast physics-informed neural network based on coupled-automatic–
numerical differentiation method, Computer Methods in Applied Mechanics and Engineering 395 (2022) 114909.
[35] R. Sharma, V. Shankar, Accelerated Training of Physics-Informed Neural Networks (PINNs) using Meshless Discretizations, Advances in
Neural Information Processing Systems 35 (2022) 1034–1046.
[36] Z.-z. Sun, X. Wu, A fully discrete difference scheme for a diffusion-wave system, Applied Numerical Mathematics 56 (2006) 193–209.
[37] B. Jin, R. Lazarov, Z. Zhou, An analysis of the l1 scheme for the subdiffusion equation with nonsmooth data, IMA Journal of Numerical
Analysis 36 (2016) 197–221.
[38] J. Cao, C. Li, Y. Chen, High-order approximation to Caputo derivatives and Caputo-type advection-diffusion equations (II), Fractional calculus
and Applied analysis 18 (2015) 735–761.
[39] Y. Ying, Y. Lian, S. Tang, W. K. Liu, High-order central difference scheme for Caputo fractional derivative, Computer Methods in Applied
Mechanics and Engineering 317 (2017) 42–54.
[40] E. Süli, D. F. Mayers, An introduction to numerical analysis, Cambridge university press, 2003.
[41] W. K. Zahra, S. M. Elkholy, et al., The use of cubic splines in the numerical solution of fractional differential equations, International Journal
of Mathematics and Mathematical Sciences 2012 (2012).
[42] S.-P. Yang, A.-G. Xiao, et al., Cubic spline collocation method for fractional differential equations, Journal of Applied Mathematics 2013
(2013).
[43] F. Pitolli, C. Sorgentone, E. Pellegrino, Approximation of the riesz–caputo derivative by cubic splines, Algorithms 15 (2022) 69.
[44] K. S. Miller, B. Ross, An introduction to the fractional calculus and fractional differential equations, Wiley, 1993.
[45] D. Hendrycks, K. Gimpel, Gaussian error linear units (gelus), arXiv preprint arXiv:1606.08415 (2016).
Jie Hou et al.: Preprint submitted to Elsevier
Page 21 of 21
|
|
http://arxiv.org/abs/2310.04788v1 | "2023-10-07T12:43:32" | "2023-10-07T12:43:32" | PMNN:Physical Model-driven Neural Network for solving time-fractional
differential equations | In this paper, an innovative Physical Model-driven Neural Network (PMNN)
method is proposed to solve time-fractional differential equations. It
establishes a temporal iteration scheme based on physical model-driven neural
networks which effectively combines deep neural networks (DNNs) with
interpolation approximation of fractional derivatives. Specifically, once the
fractional differential operator is discretized, DNNs are employed as a bridge
to integrate interpolation approximation techniques with differential
equations. On the basis of this integration, we construct a neural-based
iteration scheme. Subsequently, by training DNNs to learn this temporal
iteration scheme, approximate solutions to the differential equations can be
obtained. The proposed method aims to preserve the intrinsic physical
information within the equations as far as possible. It fully utilizes the
powerful fitting capability of neural networks while maintaining the efficiency
of the difference schemes for fractional differential equations. Moreover, we
validate the efficiency and accuracy of PMNN through several numerical
experiments. | [
"Zhiying Ma",
"Jie Hou",
"Wenhao Zhu",
"Yaxin Peng",
"Ying Li"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04788v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04788v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"cs.NA",
"math.NA"
] | 3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
8
8
7
4
0
.
0
1
3
2
:
v
i
X
r
a
PMNN: Physical Model-driven Neural Network for solving
time-fractional differential equations
Zhiying Ma1, Jie Hou2, Wenhao Zhu2, Yaxin Peng1*, and Ying Li2*
1Department of Mathematics, School of Science, Shanghai University, Shanghai,
200444, PR China
2School of Computer Engineering and Science, Shanghai University, Shanghai, 200444,
PR China
Abstract
In this paper, an innovative Physical Model-driven Neural Network (PMNN) method is
proposed to solve time-fractional differential equations. It establishes a temporal iteration
scheme based on physical model-driven neural networks which effectively combines deep
neural networks (DNNs) with interpolation approximation of fractional derivatives. Specifi-
cally, once the fractional differential operator is discretized, DNNs are employed as a bridge
to integrate interpolation approximation techniques with differential equations. On the
basis of this integration, we construct a neural-based iteration scheme. Subsequently, by
training DNNs to learn this temporal iteration scheme, approximate solutions to the dif-
ferential equations can be obtained. The proposed method aims to preserve the intrinsic
physical information within the equations as far as possible. It fully utilizes the powerful fit-
ting capability of neural networks while maintaining the efficiency of the difference schemes
for fractional differential equations. Moreover, we validate the efficiency and accuracy of
PMNN through several numerical experiments.
Keywords: Deep neural network; Physical model-driven; Iteration scheme approximation; Time-
fractional differential equation
*Corresponding author: yinglotus@shu.edu.cn (Ying Li), yaxin.peng@shu.edu.cn (Yaxin Peng)
1
1 Introduction
In the study of fractional differential equations (FDEs), researchers have observed that fractional-
order differential operators possess non-local properties, which distinguishes them from integer-
order differential operators. As a result, FDEs are well-suited for describing dynamic processes
in the real world that involve memory and hereditary characteristics. FDEs have been widely
applied in various fields [1] such as anomalous diffusion, viscoelasticity, fluid mechanics, elec-
tromagnetic waves, statistical models, signal processing and system identification, quantum
economics, fractal theory, robotics, etc. However, it is extremely challenging to obtain analyt-
ical solutions for FDEs. Even if exact solutions can be obtained, they may involve complex
functions like Mittag-Leffler functions, H functions, Wright functions, and so on [2]. Dealing
with these functions in numerical computations is complicated. Therefore, finding effective
numerical simulation methods for fractional differential equations has become one of the im-
portant research topics. In recent decades, researchers have made significant advancements in
the numerical solution of FDEs. Various numerical solution techniques have been developed,
including finite difference method (FDM) [1, 3], finite element method (FEM) [4, 5], spectral
methods [6, 7, 8], Wavelet methods [9, 10, 11], matrix methods [12, 13, 14], Laplace transforms
[15], variational iteration methods [16], and Adomian decomposition methods [17, 18, 19]. These
traditional numerical methods have made significant advancements in the solving of fractional-
order equations and dealing with fractional order derivatives. These advancements have laid
the foundation for other innovative numerical methods of FDEs.
With the rapid advancement of deep learning technology, an increasing number of scholars
have embarked on the exploration of employing deep learning for solving differential equations.
As one of fundamental models in the field of deep learning, DNNs exhibit not only remarkable
fitting capabilities but also the capacity to learn and optimize models in an adaptive manner.
Consequently, the utilization of deep learning for solving differential equations has emerged
as a burgeoning research direction that gains significant attention. Currently, a multitude of
neural network-based methods have been proposed for solving integer-order differential equa-
tions. For instance, Lagaris et al. were among the pioneers who successfully applied Artificial
2
Neural Networks (ANNs) to solve integer-order differential equations. They employed ANNs
to construct trial solutions for solving initial value and boundary value problems [20]. Raissi
et al. introduced the Physics-Informed Neural Networks (PINNs) approach, a new class of uni-
versal function approximators that is capable of encoding any underlying physical laws present
in a given dataset [21]. Due to its high predictive accuracy and robustness, PINNs rapidly
became a benchmark method in the field, leading many researchers to conduct related studies
[22, 23, 24, 25, 26]. Lu et al.
introduced DeepONets, a deep operator network, to accurately
and effectively learn nonlinear operators from relatively small datasets [27]. These approaches
mentioned above are all based on data-driven deep neural network methods, which are charac-
terized by their fast prediction speed. The features required by data-driven methods depend
only on the training data [28]. In practical applications, it is important to note that differential
equations contain many physical laws. Therefore, relying solely on sampled data to capture
information may result in incomplete findings. For certain complex equations, even if enough
training data is selected, it remains challenging to accurately capture the physical information
encoded within the equations. This poses a disadvantage to solving differential equations.
In fact, among the various neural network methods for solving integer-order differential
equations, there is a class of methods known as model-driven approaches. These methods do
not require a large number of sample data for their construction. For example, Li et al. pro-
posed an iterative scheme approximation based on deep learning framework, known as DeLISA.
The authors first obtained time iteration schemes using implicit multistep and Runge-Kutta
methods. Subsequently, this iteration scheme was approximated using a neural network. This
method achieves continuous-time prediction without the need for a large number of interior
points [29]. Long et al. utilized Convolutional Neural Networks (CNNs) to develop a novel
approach for solving non-stationary partial differential equations, known as PDE-Net. The
fundamental idea of this method is to employ convolutional kernels to learn differential op-
erators and use neural networks to approximate unknown nonlinear responses [30]. Building
upon their earlier PDE-Net framework, Long et al. proposed a new deep neural network called
PDE-Net 2.0. It combines numerical approximation of differential operators using convolutions
3
with multi-layer symbolic neural networks for model recovery, which is employed to discover
potential differential equations from observed data [31]. These model-driven methods possess
clear statistical or physical significance, and many traditional methods can be directly combined
with them, which provides a new perspective for solving differential equations.
However, deep neural networks face a major challenge when it comes to solving fractional
differential equations: the handling of fractional derivatives. This is due to the limitations
of automatic differentiation techniques, which can only compute derivatives of integer orders.
Consequently, deep neural networks are unable to handle fractional derivatives directly. As a
result, research on utilizing neural networks for solving FDEs is relatively limited, but several
novel methods have been proposed by scholars.
Raja et al. successfully solved various types of linear and nonlinear FDEs using feedforward
ANNs. Unlike other numerical methods, this approach offers the advantage of providing a con-
tinuous solution over the entire finite domain [32]. Z ́u ̃niga-Aguilar et al. proposed a new ANN
method to approximate the solution of FDEs. The author mainly considered the variable-order
fractional differential equations with Mittag-Leffler kernel in the sense of Liouville-Caputo.
[33]. Pang et al. extended PINNs to fractional PINNs (fPINNs) for solving spatiotemporal
fractional advection-diffusion equations (ADEs), and systematically studied their convergence.
The authors utilized automatic differentiation to analytically compute integer-order derivatives
within equations. While for fractional-order derivatives, they utilize traditional numerical ap-
proximation methods for numerical discretization. This approach effectively overcomes the
challenge of neural networks being unable to directly solve fractional derivatives [34]. Qu et
al. developed neural networks based on sine and cosine functions using uniformly distributed
sampling points. They obtained approximate solutions to initial boundary value problems of
several FDEs [35, 36]. Ye et al. employed Physics-Informed Neural Networks (PINNs) to inves-
tigate the forward and inverse problems of time fractional diffusion equations with conformable
derivative, addressing the limitation of directly applying neural networks to solve fractional-
order differential equations [37]. Fang et al. solved the fractional PDEs in high-dimension and
the inverse problems using DNNs.[38]. Therefore, it naturally raises the question of whether
4
the combination of traditional numerical methods and model-driven neural network methods
can be utilized to solve FDEs. The answer is affirmative.
Motivated by the aforementioned work, we propose an innovative Physical Model-driven
Neural Network (PMNN) method for solving FDEs.
In PMNN, we first discretize the frac-
tional derivatives using an interpolation-based Finite Difference Method (FDM) to construct
a temporal iteration scheme for the equation. Subsequently, we use this iteration scheme to
construct the loss function for training a physical model-driven neural network. Since the it-
eration scheme contains the physical information of the equation, obtaining an approximate
solution can be viewed as the learning process of the temporal iteration scheme using a physical
model-driven neural network. Therefore, when the loss gradually decreases and converges, we
can consider the neural network as an approximation solution of the equation. The proposed
method preserves the physical information of the equation to the greatest extent. Furthermore,
it effectively utilizes the powerful fitting capability of neural networks while ensuring the valid-
ity of the difference schemes for fractional differential equations. Moreover, in this paper, we
evaluate the performance of PMNN through several numerical experiments. These experiments
demonstrate the effectiveness of the method and its potential in solving a wide range of frac-
tional differential equation problems. In addition, it is worth noting that the PMNN method,
introduced in this paper, represents a general framework for solving FDEs. It combines neu-
ral networks with fractional derivative interpolation approximations, without being limited to
a specific approximation method. In this paper, we employ two interpolation approximation
methods: L1 and L2 − 1σ, which result in two different physical model-driven neural network:
PMNN on L1 and PMNN on L2 − 1σ.
The remaining part of this paper is organized as follows: In Section 2, we first introduce
the fundamental knowledge of FDEs, and then provide a comprehensive overview of the L1
and L2 − 1σ interpolation approximation for fractional derivatives. In Section 3, we present
a detailed description of the construction of PMNN and provide a step-by-step explanation of
the process involved in solving equations using PMNN. Section 4 primarily presents several nu-
merical experiments to demonstrate the effectiveness of our proposed method. Finally, Section
5
5 provides a summary of the paper.
2 Preliminaries
In this section, we will review two definitions of fractional derivatives and two interpolation
approximations for the Caputo derivatives.
2.1 Definitions
We start by presenting several fundamental definitions, which can be found in [39].
Definition 1 The Riemann-Liouville integral with order α > 0 of the given function f (t),
t ∈ (a, b) are defined as
aI−α
t f (t) =
1
Γ(α)
(cid:90) t
a
(t − s)α−1f (s)ds,
(1)
where Γ(*) is the Euler's gamma function.
Definition 2 The Riemann-Liouville derivatives with order α > 0 of the given function f (t),
t ∈ (a, b) are defined as
aDα
t f (t) =
=
t
(cid:104)
dm
dtm
1
Γ(m − α)
aI−(m−α)
dm
dtm
(cid:105)
f (t)
(cid:90) t
a
(t − s)m−α−1f (s)ds,
(2)
where m is a positive integer satisfying m − 1 ≤ α < m.
Definition 3 The Caputo derivatives with order α > 0 of the given function f (t), t ∈ (a, b)
are defined as
a Dα
C
t f (t) = aI−(m−α)
t
(cid:104)
=
1
Γ(m − α)
f (m)(t)
(cid:90) t
a
(cid:105)
(3)
(t − s)m−α−1f (m)(s)ds,
where m is a positive integer satisfying m − 1 < α ≤ m.
The Riemann-Liouville (R-L) derivative and the Caputo derivative may exhibit differences in
numerical computations. For instance, the Caputo fractional derivative of a constant function
6
is 0, whereas the R-L fractional derivative is non-zero. The distinct characteristics of these
two integrals determine their applicability in different contexts. The R-L derivative imposes
fewer conditions on the function f (x), enhancing its convenience for mathematical theoretical
investigations. On the other hand, the Caputo derivative finds wider application in solving
initial and boundary value problems of differential equations in the field of physical engineering.
In this paper, we adopt the Caputo derivative.
2.2 Interpolation approximation of Caputo derivative
Over the past several decades, researchers in the field of Finite Difference Methods for solving
FDEs have made significant research achievements. The underlying idea of these methods is
to discretize the fractional derivatives in the differential equation, transforming the fractional-
order equations into integer-order equations for numerical computation. The interpolation
approximation of the fractional derivative serves as a crucial step in the FDMs, which provides
us with a promising direction for solving FDEs using DNNs. Following that, we will illustrate
two interpolation approximations for the α-order Caputo fractional derivative.
2.2.1 L1 approximation
For the Caputo derivative of order α (0 < α < 1)
0 Dα
C
t f (t) =
1
Γ(1 − α)
(cid:90) t
0
f ′(s)
(t − s)α ds,
(4)
the most commonly used approach is the L1 approximation based on piecewise linear interpo-
lation.
Let N be a positive integer. We define τ = T
N , tk = kτ , 0 ⩽ k ⩽ N , and
a(α)
l = (l + 1)1−α − l1−α,
l ⩾ 0,
(5)
7
we derive an approximation formula for the calculation of C
0 Dα
t f (t)|t=tn:
Dα
t f (tn) ≡
(cid:34)
τ −α
Γ(2 − α)
a(α)
0 f (tn) −
n−1
(cid:88)
(cid:16)
k=1
n−k−1 − a(α)
a(α)
n−k
(cid:17)
f (tk) − a(α)
(cid:35)
n−1f (t0)
.
(6)
Eq.(6) is commonly known as the L1 formula or L1 approximation.
2.2.2 L2 − 1σ approximation
For the α (0 < α < 1) order Caputo derivative, the aforementioned L1 approximation formula
achieves uniform convergence of order 2 − α. Alikhanov [40] further extended this result by
discovering superconvergent interpolation points and establishing the L2 − 1σ approximation
formula, which achieves uniform convergence of order 3 − α. In the following section, we will
present this result in detail. Let us denote
σ = 1 −
α
2
,
tn+σ = (n + σ)τ,
f n = f (tn),
(7)
the approximation formula for evaluating C
0 Dα
t f (t)|t=tn−1+σ can be obtained as follows:
∆α
t f (tn−1+σ) ≡
τ −α
Γ(2 − α)
n−1
(cid:88)
k=0
c(n,α)
k
[f (tn−k) − f (tn−k−1)],
1 ⩽ n ⩽ N.
(8)
Eq.(8) is typically referred to as the L2 − 1σ formula or L2 − 1σ approximation. When n = 1,
c(1,α)
0
= σ1−α,
(9)
8
while when n ⩾ 2,
(1 + σ)2−α − σ2−α
2 − α
−
(1 + σ)1−α − σ1−α
2
,
[(k + 1 + σ)2−α − 2(k + σ)2−α + (k − 1 + σ)2−α]
[(k + 1 + σ)1−α − 2(k + σ)1−α + (k − 1 + σ)1−α],
c(n,α)
0
c(n,α)
k
=
=
1
2 − α
1
2
−
1 ⩽ k ⩽ n − 2,
c(n,α)
n−1 =
[3(n − 1 + σ)1−α − (n − 2 + σ)1−α]
1
2
−
1
2 − α
[(n − 1 + σ)2−α − (n − 2 + σ)2−α].
(10)
2.3 Classification of Caputo Fractional Partial Differential Equations
Consider the following Caputo fractional partial differential equation:
0 Dα
C
t u = ∆u
(11)
Based on the interval of values for α, it can be categorized [41], as depicted in Table 1. This
paper primarily addresses the case involving derivatives of order 0 < α < 1.
Table 1: The classification of C
0 Dα
t u = ∆u with α ∈ (0, 2].
α
Math.type
(0, 1) Time-fractional parabolic equation
1
Parabolic equation
Phys.sense
Temporal subdiffusion
Diffusion
(1, 2) Time-fractional hyperbolic equation Temporal Supperdiffusion
2
Hyperbolic equation
Wave
3 Illustration of the method
3.1 Problem setup
In this paper, we focus on fractional ordinary differential equations (FODEs) and fractional
partial differential equations (FPDEs). Next, we provide a detailed exposition of our method-
9
ology by considering the initial-boundary value problem for the FPDE on a bounded domain
Ω ∈ Rn.
Consider the initial-boundary value problem for the following time-fractional slow diffusion
equation:
0 Dα
C
t u(x, t) = Lu(x, t) + f (x, t),
(x, t) ∈ Ω × (0, T ],
u(x, t) = μ(x, t),
(x, t) ∈ ∂Ω × (0, T ],
u(x, 0) = φ(x),
x ∈ Ω,
(12)
(13)
(14)
where, C
0 Dα
t denotes the Caputo fractional derivative with α ∈ (0, 1), L represents an integer-
order differential operator, u(x, t) is the solution of the equation, f , μ and φ are known func-
tions.
3.2 Architecture of PMNN
DNNs have gained remarkable achievements in tackling differential equations of integer order,
owing largely to the integration of automatic differentiation techniques. Nevertheless, the ap-
plicability of automatic differentiation is restricted to functions with integer-order differentials.
To surmount the obstacle of automatic differentiation in utilizing neural networks for solving
fractional-order differentials, we tackle the issue by discretizing the Caputo derivatives in the
equations using L1 and L2 − 1σ approximations, respectively. Subsequently, neural networks
are introduced to establish PMNN on L1 and PMNN on L2 − 1σ, respectively. This section
presents the detailed procedures involved in constructing PMNN.
3.2.1 PMNN on L1
The first step of our approach is to semi-discretize the fractional-order derivative in the temporal
domain. Let N be a positive integer. We define τ = T
N , tk = kτ , where 0 ⩽ k ⩽ N . Utilizing
10
the L1 formula presented in Section 2.2.1, we obtain:
0 Dα
C
t un ≈ Dα
t un
(cid:34)
=
τ −α
Γ(2 − α)
a(α)
0 un −
n−1
(cid:88)
(cid:16)
k=1
n−k−1 − a(α)
a(α)
n−k
(cid:17)
uk − a(α)
n−1u0
(cid:35)
,
(15)
where un = u(tn, x), 1 ⩽ n ⩽ N . Substituting it into the governing equation, we obtain the
temporal iteration scheme based on Eq.(12):
un =
Γ(2 − α) * τ α
a(α)
0
[Lun + f n] +
(cid:32)
n−1
(cid:88)
k=1
n−k−1 − a(α)
a(α)
a(α)
0
n−k
(cid:33)
uk +
a(α)
n−1
a(α)
0
u0.
(16)
Next, we introduce physical model-driven neural networks as solvers to obtain approximate
solutions for the differential equations. In this study, we directly consider the output of the
neural network, ˆu(x, t; θ), as the approximation solution. By substituting it into Eq.(16), we
obtain the expression for PMNN on L1 as follows:
U n =
Γ(2 − α) * τ α
a(α)
0
[Lˆun + f n] +
(cid:32)
n−1
(cid:88)
k=1
n−k−1 − a(α)
a(α)
a(α)
0
n−k
(cid:33)
ˆuk +
a(α)
n−1
a(α)
0
ˆu0,
(17)
where ˆun = u(x, tn; θ) represents the output of the neural network at time tn, and f n = f (x, tn).
Evidently, the iterative scheme mentioned above incorporates the physical information inherent
in the governing equation. Taking into account the initial and boundary conditions (13)-(14),
we define the loss function for the PMNN on L1 model as follows:
Loss(θ) = Lossf (θ) + Lossic(θ) + Lossbc(θ),
(18)
11
the definitions of each component in the loss function are as follows:
Lossf (θ) =
Lossbc(θ) =
Lossic(θ) =
1
Nf
1
Nbc
1
Nic
Nf
(cid:88)
(cid:2)ˆu(xi
f , ti
f ) − U (xi
f , ti
f )(cid:3)2
,
i=1
Nbc(cid:88)
i=1
Nic(cid:88)
i=1
(cid:2)ˆu(xi
bc, ti
bc) − u(xi
bc, ti
bc)(cid:3)2
,
(19)
(cid:2)ˆu(xi
ic, ti
bc) − u(xi
ic, ti
ic)(cid:3)2
,
f , ti
where {xi
f }Nf
number of training points. {xi
i=1 represents the training points of the iterative scheme, where Nf denotes the
ic, ti
ic}Nic
i=1 refers to the initial training points, where Nic represents
the number of initial training points. Similarly, {xi
bc, ti
bc}Nbc
i=1 denotes the boundary points, and
Nbc represents the number of boundary points. The architecture of the PMNN on L1 model is
illustrated in Fig.1.
Figure 1: The architecture of PMNN on L1
3.2.2 PMNN on L2 − 1σ
Just like in the case of PMNN on L1, we proceed with the discretization of the equation. Let
N be a positive integer. We define τ = T
N , tk = kτ , 0 ⩽ k ⩽ N , and σ = 1 − α
2 . Based on the
12
L2 − 1σ formula described in Section 2.2.2, we obtain:
0 Dα
C
t un−1+σ ≈ ∆α
t u(tn−1+σ)
n−1
(cid:88)
τ −α
Γ(2 − α)
k=0
=
c(n,α)
k
[u(tn−k) − u(tn−k−1)],
(20)
where un = u(tn, x), 1 ⩽ n ⩽ N . We note that the L2 − 1σ scheme, unlike the L1 scheme,
discretizes the fractional derivative at time points tn−1+σ, which is located outside the set of
discrete time points tn. Therefore, in the process of discretizing the equation, we need to
consider the time node tn−1+σ. The temporal iteration scheme, derived from the differential
equation (12), is given by:
un =
Γ(2 − α) * τ α
c(n,α)
0
(cid:2)Lun−1+σ + f n−1+σ(cid:3) +
n−1
(cid:88)
k=1
c(n,α)
k
c(n,α)
0
(un−k−1 − un−k) + un−1.
(21)
Similarly, by substituting the neural network's output ˆu(x, t; θ) as an approximation into
equation (21), we can derive the expression for PMNN on L2 − 1σ as follows:
U n =
Γ(2 − α) * τ α
c(n,α)
0
(cid:2)Lˆun−1+σ + f n−1+σ(cid:3) +
n−1
(cid:88)
k=1
c(n,α)
k
c(n,α)
0
(ˆun−k−1 − ˆun−k) + ˆun−1,
(22)
where ˆun = u(x, tn; θ) represents the output of the network at time tn, and f n = f (x, tn). The
loss function for the PMNN on L2 − 1σ model is defined by
Loss(θ) = Lossf (θ) + Lossic(θ) + Lossbc(θ).
(23)
The definitions of each loss term can be found in Eq.(19). The architecture of the PMNN on
L2 − 1σ model is depicted in Fig.2.
4 Numerical results
In this section, the performance of our proposed model is evaluated through the analysis of
three single-term temporal fractional differential equations: a time-fractional ODE, a one-
13
Figure 2: The architecture of PMNN on L2 − 1σ
dimensional time-fractional PDE, and a two-dimensional time-fractional PDE. The loss function
is minimized using the L-BFGS-B method, and the accuracy of the numerical solutions is
assessed using the L2 relative error. By contrasting the effectiveness of the two models, it is
observed that the proposed model achieves high accuracy. Additionally, all experiments in this
section are carried out utilizing an NVIDIA RTX 1660 GPU card.
Example 1 Single-term Temporal Fractional Ordinary Differential Equation
Considering a single-term temporal fractional ordinary differential equation:
0 Dα
C
t u(t) = −u(t) + f (t),
t ∈ (0, T ],
u(0) = 0,
(24)
where, 0 < α < 1, and the exact solution to the equation is given by u(t) = t5+α. The right-
hand side term is defined as f (t) = Γ(6+α)
120
t5 + t5+α. For this experiment, we focus on the case
where T = 1.
In this experiment, a fully connected neural network (FNN) with 5 hidden layers is utilized.
14
Each hidden layer consists of 20 neurons with a tanh activation function. The training and
testing data are uniformly sampled from the interval [0, T ]. For our analysis, we specifically
select Nt training points and 500 testing points. To begin, we conduct tests for the case of
α = 0.5 and Nt = 41. Fig.3 shows the comparison between the predicted solutions of the two
models and the exact solution. The blue solid line represents the graph of the exact solution,
while the red dashed line represents the curve of the predicted solution using the PMNN model.
It is evident that the predicted solution precisely aligns with the exact solution.
(a) PMNN on L1
(b) PMNN on L2 − 1σ
Figure 3: Single-term FODE: the exact solution and the predict solution of PMNN.
Fig.4 illustrates the variation of the error with respect to time t. For the PMNN on L1
model, the error initially remains below 1 × 10−3, but around t = 0.4, it gradually increases
over time. In contrast, the error for the PMNN on L2 − 1σ model remains stable at around
1 × 10−4. Therefore, in this case, the PMNN on L2 − 1σ model demonstrates superior overall
performance.
The trends of loss with respect to the number of iterations for the two models are depicted
in Fig.5. A comparison of the plots reveals that the PMNN on L2 − 1σ model exhibits faster
convergence. Table 2 displays the iteration counts and training times for the two models with
different α. Comparing the iteration counts, it is evident that PMNN on L2 − 1σ converges
more rapidly. However, it needs a longer training time, potentially due to its requirement for a
larger training dataset.
To further evaluate the performance of the proposed method, we conducted tests with
15
(a) PMNN on L1
(b) PMNN on L2 − 1σ
Figure 4: Single-term FODE: the trend of the error with the time t.
(a) PMNN on L1
(b) PMNN on L2 − 1σ
(c) Comparison of the two models
Figure 5: Single-term FODE: the trend of the loss function with the number of iterations
Table 2: The number of iterations and training time of two PMNN for single-term FODE
Iter
Training Time(s)
L1 L2 − 1σ
L1
L2 − 1σ
α = 0.25
α = 0.50
α = 0.75
90
77
94
77
73
71
8.41
6.47
8.49
8.12
13.99
12.57
different α and varying numbers of training points. The L2 relative errors for each case are
presented in Table 3. It can be observed that as the number of training points increases, the
overall errors of both models decrease. Moreover, after approximately Nt = 41, both models
demonstrate good performance. The minimum error attained by PMNN on L1 is 1.71 × 10−4,
whereas for PMNN on L2 − 1σ, the minimum error reaches 3.52 × 10−4.
16
Table 3: The L2 error of two PMNN for single-term FODE
Nt
11
21
41
81
101
201
α = 0.25
α = 0.50
α = 0.75
L1
L2 − 1σ
L1
L2 − 1σ
L1
L2 − 1σ
1.55 e-02
5.35 e-03
1.86 e-03
9.58 e-04
6.68 e-04
1.71 e-04
1.20 e-03
1.21 e-03
3.71 e-03
2.64 e-03
3.51 e-03
3.86 e-03
5.31 e-02
2.07 e-02
7.84 e-03
3.10 e-03
2.26 e-03
1.26 e-03
2.50 e-03
2.19 e-03
3.02 e-03
1.58 e-03
2.51 e-03
2.37 e-03
1.33 e-01
5.88 e-02
2.55 e-02
1.09 e-02
8.36 e-03
4.59 e-03
6.28 e-03
1.53 e-03
7.84 e-04
4.75 e-04
3.39 e-04
3.52 e-04
Example 2 1D Time-fractional Convection-diffusion Equation
Consider the following one-dimensional time-fractional convection-diffusion equation, with
the exact solution given by u(x, t) = x2 + 2tα
Γ(1+α) .
= uxx,
∂αu(x, t)
∂tα
u(x, 0) = x2,
u(0, t) =
u(1, t) = 1 +
,
2tα
Γ(1 + α)
2tα
Γ(1 + α)
x ∈ [0, 1],
t ∈ (0, 1],
x ∈ [0, 1],
t ∈ [0, 1],
,
t ∈ [0, 1],
The same FNN architecture is employed in this experiment, following the configuration of
Example 1. We uniformly sample Nt time nodes from the interval [0, 1] and Nx spatial nodes
from the interval [0, 1]. Consequently, the training data comprises a total of Nt × Nx data
points. Similarly, we select 100 × 100 test data points. We begin the experiment by fixing
α = 0.5, Nt = 41, and Nx = 11. Fig.6 shows the comparison between the predicted solutions
obtained from the two models and the exact solution. The left panel depicts the graph of the
exact solution, while the middle and right panels display the predicted solutions using PMNN
on L1 and PMNN on L2 − 1σ, respectively. A visual analysis reveals a remarkable consistency
between the predicted solutions and the graph of the exact solution.
The error of the two PMNN models is depicted in Fig.7. It is evident that in this case, there
are fluctuations in the error within a small interval near t = 0, while the error remains stable
17
(a) Exact
(b) PMNN on L1
(c) PMNN on L2 − 1σ
Figure 6: 1D Single-term FPDE: the exact solution and the predict solution of PMNN.
for the rest of the time. Furthermore, it can be observed that during the fluctuation period,
the error exhibits symmetry around the spatial coordinate point x = 0.5. This is an intriguing
phenomenon. Additionally, the error of PMNN on L2 − 1σ converges to a stable state in a
shorter time frame.
(a) PMNN on L1
(b) PMNN on L2 − 1σ
Figure 7: 1D Single-term FPDE: the error presentation of PMNN.
The evolution of the loss functions for both models during the iterative process is visualized
in Fig.8. The first two subfigures in Fig.8 offer a comprehensive depiction of the dynamic
evolution of the individual components comprising the loss functions, whereas the last subfigure
portrays the overall variation of the loss. By comparing the two plots, it becomes apparent
that PMNN on L1 demonstrates a noticeably faster convergence rate, which is contrary to the
observations in Example 1.
18
(a) PMNN on L1
(b) PMNN on L2 − 1σ
(c) Comparison of the two models
Figure 8: 1D Single-term FPDE: the trend of the loss function with the number of iterations.
Table 4 provides the iteration counts and training times for the two models with varying
orders α. It is observed that PMNN on L1 converges faster when α = 0.25 and α = 0.5, whereas
PMNN on L2 − 1σ converges faster when α = 0.75. This indicates that the performance of the
two models is influenced by the choice of order in this particular example.
Table 4: The number of iterations and training time of two PMNN for 1D single-term FPDE
Iter
Training Time(s)
L1
L2 − 1σ
L1
L2 − 1σ
α = 0.25
α = 0.50
α = 0.75
919
901
1630
689
1058
1511
97.06
170.55
307.21
103.28
194.2
233.91
In the following experiments, we fix the number of time nodes at Nt = 41 and set α = 0.5.
We then change the number of spatial nodes, denoted as Nx, to investigate the influence on
the models. The corresponding L2 relative errors for each case are presented in Table 5. It
can be observed that as the number of spatial training points increases, the errors of both
models exhibit minimal fluctuations. This suggests that the quantity of spatial training points
has minimal impact on the model's performance. Therefore, it is feasible to select a smaller
number of spatial nodes for training, thereby reducing computational costs effectively.
Finally, we fix Nx = 11 and perform tests with different values of α and varying numbers
of spatial nodes Nx. The L2 relative errors are presented in Table 6. Consistent with the
19
Table 5: The L2 error of two PMNN for 1D single-term FPDE
Nx
6
11
21
41
81
101
α = 0.5
L1
3.24e-03
3.66e-03
3.45e-03
3.37e-03
3.52e-03
3.59e-03
L2 − 1σ
1.75e-03
1.64e-03
1.59e-03
1.61e-03
1.68e-03
1.63e-03
experimental results in Example 1, the errors of both models decrease as the number of time
nodes increases. Overall, PMNN on L2−1σ outperforms PMNN on L1 in terms of performance.
Table 6: The L2 error of two PMNN for 1D single-term FPDE
Nt
11
21
41
81
101
α = 0.25
α = 0.50
α = 0.75
L1
3.46e-02
1.81e-02
7.74e-03
2.21e-03
1.43e-03
L2 − 1σ
2.80e-02
1.58e-02
5.85e-03
9.73e-04
5.24e-04
L1
1.38e-02
6.43e-03
3.66e-03
1.85e-03
1.48e-03
L2 − 1σ
8.03e-03
3.59e-03
1.64e-03
6.74e-04
5.28e-04
L1
6.39e-03
3.52e-03
2.03e-03
1.13e-03
9.61e-04
L2 − 1σ
2.14e-03
1.17e-03
6.70e-04
3.81e-04
2.90e-04
Example 3 2D Time-fractional Convection-diffusion Equation
Consider the following time-fractional convection-diffusion equation, with an exact solution
given by u(x, t) = t2ex+y.
= ∆u(x, t) + f (x, t),
∂αu(x, t)
∂tα
u(x, t) = t2ex+y,
x ∈ Ω ⊂ R2,
t ∈ (0, 1),
x ∈ ∂Ω,
t ∈ (0, 1),
u(x, 0) = 0,
x ∈ Ω,
where f (x, t) = [ 2t2−α
Γ(3−α) − 2t2]ex+y. Ω = [0, 1] × [0, 1]
20
The present experiment follows the same configuration as the previous two experiments
using FNN. We uniformly select Nt time nodes on the interval [0, 1] and Nx × Nx spatial nodes
on the domain [0, 1] × [0, 1], resulting in a total of Nt × Nx × Nx training data points.
In
a similar manner, 100 × 100 × 100 test data points are selected. For the experiment, we set
α = 0.5, Nt = 21, and Nx = 11. Fig.9 illustrates the comparison between the exact solution
and the predicted solutions obtained by the two models at t = 1. On the left is the image of
the exact solution, in the middle is the image of the predicted solution using PMNN on L1, and
on the right is the image of the predicted solution using PMNN on L2 − 1σ. Through a visual
comparison, it is evident that the predicted solution is the same as the exact solution.
(a) Exact
(b) PMNN on L1
(c) PMNN on L2 − 1σ
Figure 9: 2D Single-term FPDE: the exact solution and the predict solution when t = 1.00.
Fig.10 depicts the errors of the two PMNN models at t = 1. It can be observed that the
error of PMNN on L1 is relatively larger near the center of the spatial plane, while it decreases
as it approaches the boundaries. On the other hand, the error of PMNN on L2 − 1σ exhibits
less fluctuation.
Fig.11 illustrates the trends in the loss functions of the two models. The first two subfigures
provide a detailed view of the changes in the individual loss components, while the last subfigure
depicts the overall loss of the models. Consistent with the experimental results in Example 1,
it is evident that PMNN on L2 − 1σ exhibits a faster convergence speed.
Table 7 presents the number of iterations and training time for both models when different
orders of α are chosen. It can be observed that PMNN on L1 converges faster when α = 0.25,
while PMNN on L2 − 1σ converges faster when α = 0.5 and α = 0.75. This indicates that the
21
(a) PMNN on L1
(b) PMNN on L2 − 1σ
Figure 10: 2D Single-term FPDE: the error presentation of PMNN when t = 1.00.
(a) PMNN on L1
(b) PMNN on L2 − 1σ
(c) Comparison of the two models
Figure 11: 2D Single-term FPDE: the trend of the loss function with the number of iterations.
performance of the two models is influenced by the order of the fractional derivative in this
example. This conclusion is consistent with Example 2.
Table 7: The number of iterations and training time of two PMNN for 2D single-term FPDE
Iter
Training Time(s)
L1
L2 − 1σ
L1
L2 − 1σ
α = 0.25
α = 0.50
α = 0.75
1595
1056
1076
1875
935
723
287.62
315.21
347.18
341.82
280.81
218.5
In the following, we fix Nt = 21 and α = 0.5, and then vary the number of spatial nodes, Nx,
to investigate their impact on the model. The corresponding L2 relative errors are presented
in Table 8. The analysis reveals that the model's performance is unaffected by the number of
22
spatial training points. Consequently, it is viable to employ a minimal number of spatial nodes
during training, resulting in reduced computational costs.
Table 8: The L2 error of two PMNN for 2D single-term FPDE
Nx
6
11
21
41
81
α = 0.5
L1
3.42e-04
3.16e-04
3.07e-04
3.10e-04
3.09e-04
L2 − 1σ
7.03e-05
4.67e-05
4.16e-05
4.25e-05
6.76e-05
Lastly, by fixing Nx = 11, we perform experiments with different values of α and varying Nt.
The L2 relative errors are presented in Table 9. In contrast to the previous two experiments,
the errors of both models do not consistently decrease as the number of time nodes increases.
Instead, they exhibit minor fluctuations. Overall, the PMNN on L2 − 1σ model demonstrates
superior performance compared to the PMNN on L1 model.
Table 9: The L2 error of two PMNN for 2D single-term FPDE
Nt
11
21
41
81
101
α = 0.25
α = 0.50
α = 0.75
L1
2.50e-04
8.27e-05
4.07e-05
2.34e-05
3.04e-05
L2 − 1σ
6.23e-05
4.01e-05
1.66e-04
3.32e-04
5.61e-05
L1
8.13e-04
3.16e-04
1.21e-04
5.26e-05
4.56e-05
L2 − 1σ
6.15e-05
4.67e-05
3.91e-05
5.25e-05
5.62e-05
L1
2.34e-03
1.01e-03
4.32e-04
1.76e-04
1.35e-04
L2 − 1σ
5.00e-05
4.17e-05
4.77e-05
5.08e-05
5.68e-05
5 Conclusions
In this paper, we introduce PMNN, an iteration scheme approximation method based on phys-
ical model-driven neural networks, to solve FDEs. This iteration scheme leverages the physical
23
information embedded in the equations, enabling the problem of solving FDEs to be reframed as
a learning task for the PMNN model. Specifically tailored for Caputo FDEs, PMNN overcomes
the limitations of automatic differentiation techniques in neural networks for solving fractional
derivatives. It combines the efficiency of traditional interpolation approximation and harnesses
the powerful fitting capabilities of neural networks. Through three numerical experiments,
we demonstrate the excellent performance of the proposed model. Moreover, we present two
variations of the model, and the numerical experiments show their distinct merits in various
scenarios. Hence, in practical applications, the selection of the suitable model can be selected
to cater to specific requirements.
In spite of that, PMNN on L2 − 1σ exhibits particularly
appealing performance in the majority of cases.
PMNN perfectly merges physical model-driven neural networks with interpolation approx-
imation techniques for fractional derivatives, offering a novel approach for numerically solving
FDEs. The proposed model currently applies only to the solution of single-term temporal
fractional differential equations. Furthermore, some interesting phenomena observed in the
experimental results still lack a clear explanation, presenting unresolved challenges for future
investigation. In the future, investigating neural network-based physical model-driven methods
for multi-term FDEs and spatial fractional-order differential equations could provide a potential
direction for further research.
CRediT authorship contribution statement
Zhiying Ma : Methodology, Software, Writing-original draft. Jie Hou : Methodology, Writing
– review & editing. Wenhao Zhu : Supervision, Writing-review & editing. Yaxin Peng :
Supervision, Writing-review & editing. Ying Li : Conceptualization, Funding acquisition,
Writing-review & editing.
24
Acknowledgments
This work is supported by the National Key Research and Development Program of China
(No.2021YFA1003004).
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal rela-
tionships that could have appeared to influence the work reported in this paper.
References
[1] Z. Sun and G. Gao, Fractional differential equations: finite difference methods. De Gruyter,
2020.
[2] M. R. Admon, N. Senu, A. Ahmadian, Z. A. Majid, and S. Salahshour, "A new efficient
algorithm based on feedforward neural network for solving differential equations of frac-
tional order," Commun. Nonlinear Sci. Numer. Simul., vol. 117, p. 106968, 2023. doi:
10.1016/j.cnsns.2022.106968.
[3] M. M. Meerschaert and C. Tadjeran, "Finite difference approximations for fractional ad-
vection–dispersion flow equations," J. Comput. Appl. Math., vol. 172, no. 1, pp. 65–77,
2004. doi: 10.1016/j.cam.2004.01.033.
[4] W. Deng, "Finite element method for the space and time fractional Fokker-Planck equa-
tion," SIAM J. Numer. Anal., vol. 47, no. 1, pp. 204–226, 2009. doi: 10.1137/080714130.
[5] Y. Jiang and J. Ma, "High-order finite element methods for time-fractional partial differ-
ential equations," J. Comput. Appl. Math., vol. 235, no. 11, pp. 3285–3290, 2011. doi:
10.1016/j.cam.2011.01.011.
25
[6] F. Zeng, F. Liu, C. Li, K. Burrage, I. Turner, and V. Anh, "A Crank-Nicolson ADI spectral
method for a two-dimensional Riesz space fractional nonlinear reaction-diffusion equation,"
SIAM J. Numer. Anal., vol. 52, no. 6, pp. 2599–2622, 2014. doi: 10.1137/130934192.
[7] A. Ahmadian, S. Salahshour, D. Baleanu, H. Amirkhani, and R. Yunus, "Tau method for
the numerical solution of a fuzzy fractional kinetic model and its application to the oil palm
frond as a promising source of xylose," J. Comput. Phys., vol. 294, pp. 562–584, 2015. doi:
10.1016/j.jcp.2015.03.011.
[8] A. H. Bhrawy, M. M. Tharwat, and A. Yildirim, "A new formula for fractional in-
tegrals of Chebyshev polynomials: Application for solving multi-term fractional dif-
ferential equations," Appl. Math. Model., vol. 37, no. 6, pp. 4245–4252, 2013.
doi:
10.1016/j.apm.2012.08.022.
[9] F. Mohammadi and C. Cattani, "A generalized fractional-order legendre wavelet Tau
method for solving fractional differential equations," J. Comput. Appl. Math., vol. 339,
pp. 306–316, 2018. doi: 10.1016/j.cam.2017.09.031.
[10] S. Kumar, A. Ahmadian, R. Kumar, D. Kumar, J. Singh, D. Baleanu, and M. Salimi, "An
efficient numerical method for fractional SIR epidemic model of infectious disease by using
Bernstein wavelets," Mathematics, vol. 8, no. 4, p. 558, 2020. doi: 10.3390/math8040558.
[11] H. Jafari, S. A. Yousefi, M. A. Firoozjaee, S. Momani, and C. M. Khalique, "Application
of legendre wavelets for solving fractional differential equations," Comput. Math. Appl.,
vol. 62, no. 3, pp. 1038–1045, 2011. doi: 10.1016/j.camwa.2011.04.024.
[12] Y. Talaei and M. Asgari, "An operational matrix based on Chelyshkov polynomials for solv-
ing multi-order fractional differential equations," Neural Comput. Appl., vol. 30, pp. 1369–
1376, 2018. doi: 10.1007/s00521-017-3118-1.
[13] A. Ahmadian, S. Salahshour, and C. S. Chan, "Fractional differential systems:
a
fuzzy solution based on operational matrix of shifted Chebyshev polynomials and its
26
applications," IEEE Trans. Fuzzy Syst., vol. 25, no. 1, pp. 218–236, 2016.
doi:
10.1109/TFUZZ.2016.2554156.
[14] A. M. Shloof, N. Senu, A. Ahmadian, and S. Salahshour, "An efficient operation matrix
method for solving fractal–fractional differential equations with generalized Caputo-type
fractional–fractal derivative," Math. Comput. Simulation, vol. 188, pp. 415–435, 2021. doi:
10.1016/j.matcom.2021.04.019.
[15] S. Salahshour, T. Allahviranloo, and S. Abbasbandy, "Solving fuzzy fractional differential
equations by fuzzy laplace transforms," Commun. Nonlinear Sci. Numer. Simul., vol. 17,
no. 3, pp. 1372–1381, 2012. doi: 10.1016/j.cnsns.2011.07.005.
[16] Z. M. Odibat and S. Momani, "Application of variational iteration method to nonlinear
differential equations of fractional order," Int. J. Nonlinear Sci. Numer. Simul., vol. 7,
no. 1, pp. 27–34, 2006. doi: 10.1515/IJNSNS.2006.7.1.27.
[17] S. S. Ray and R. K. Bera, "An approximate solution of a nonlinear fractional differen-
tial equation by Adomian decomposition method," Appl. Math. Comput., vol. 167, no. 1,
pp. 561–571, 2005. doi: 10.1016/j.amc.2004.07.020.
[18] S. Momani and Z. Odibat, "Analytical solution of a time-fractional Navier–Stokes equation
by Adomian decomposition method," Appl. Math. Comput., vol. 177, no. 2, pp. 488–494,
2006. doi: 10.1016/j.amc.2005.11.025.
[19] S. Momani and Z. Odibat, "Numerical approach to differential equations of
frac-
tional order," J. Comput. Appl. Math., vol. 207, no. 1, pp. 96–110, 2007.
doi:
10.1016/j.cam.2006.07.015.
[20] I. E. Lagaris, A. Likas, and D. I. Fotiadis, "Artificial neural networks for solving ordinary
and partial differential equations," IEEE Trans. Neural Netw., vol. 9, no. 5, pp. 987–1000,
1998.
[21] M. Raissi, P. Perdikaris, and G. E. Karniadakis, "Physics-informed neural networks:
A deep learning framework for solving forward and inverse problems involving nonlin-
27
ear partial differential equations," J. Comput. Phys., vol. 378, pp. 686–707, 2019. doi:
10.1016/j.jcp.2018.10.045.
[22] J. Yu, L. Lu, X. Meng, and G. E. Karniadakis, "Gradient-enhanced physics-informed neural
networks for forward and inverse PDE problems," Comput. Methods Appl. Mech. Engrg.,
vol. 393, p. 114823, 2022. doi: 10.1016/j.cma.2022.114823.
[23] L. Yuan, Y. Ni, X. Deng, and S. Hao, "A-PINN: Auxiliary physics informed neural networks
for forward and inverse problems of nonlinear integro-differential equations," J. Comput.
Phys., vol. 462, p. 111260, 2022. doi: 10.1016/j.jcp.2022.111260.
[24] X. Meng, Z. Li, D. Zhang, and G. E. Karniadakis, "PPINN: Parareal physics-informed
neural network for time-dependent PDEs," Comput. Methods Appl. Mech. Engrg., vol. 370,
p. 113250, 2020. doi: 10.1016/j.cma.2020.113250.
[25] G. Pang, M. D'Elia, M. Parks, and G. E. Karniadakis, "nPINNs: Nonlocal physics-
informed neural networks for a parametrized nonlocal universal
laplacian operator.
Algorithms and applications," J. Comput. Phys., vol. 422, p. 109760, 2020.
doi:
10.1016/j.jcp.2020.109760.
[26] P.-H. Chiu, J. C. Wong, C. Ooi, M. H. Dao, and Y.-S. Ong, "CAN-PINN: A fast
physics-informed neural network based on coupled-automatic–numerical differentiation
method," Comput. Methods Appl. Mech. Engrg., vol. 395, p. 114909, 2022.
doi:
10.1016/j.cma.2022.114909.
[27] L. Lu, P. Jin, G. Pang, Z. Zhang, and G. E. Karniadakis, "Learning nonlinear operators
via DeepONet based on the universal approximation theorem of operators," Nat. Mach.
Intell., vol. 3, pp. 218–229, 2021. doi: 10.1038/s42256-021-00302-5.
[28] P. Liu, L. Wang, R. Ranjan, G. He, and L. Zhao, "A survey on active deep learning: From
model driven to data driven," ACM Comput. Surv., vol. 54, no. 10s, pp. 1–34, 2022. doi:
10.1145/3510414.
28
[29] Y. Li, Z. Zhou, and S. Ying, "DeLISA: Deep learning based iteration scheme ap-
proximation for solving PDEs," J. Comput. Phys., vol. 451, p. 110884, 2022.
doi:
10.1016/j.jcp.2021.110884.
[30] Z. Long, Y. Lu, X. Ma, and B. Dong, "PDE-Net: Learning PDEs from data," in ICML,
pp. 3208–3216, PMLR, 2018. url: https://proceedings.mlr.press/v80/long18a.html.
[31] Z. Long, Y. Lu, and B. Dong, "PDE-Net 2.0: Learning PDEs from data with a numeric-
symbolic hybrid deep network," J. Comput. Phys., vol. 399, p. 108925, 2019.
doi:
10.1016/j.jcp.2019.108925.
[32] M. A. Z. Raja, J. A. Khan, and I. M. Qureshi, "Evolutionary computational intelligence
in solving the fractional differential equations," in Intelligent Information and Database
Systems, pp. 231–240, Springer Berlin Heidelberg, 2010. doi: 10.1007/978-3-642-12145-
6 ̇24.
[33] C. J. Z ́u ̃niga-Aguilar, H. M. Romero-Ugalde, J. F. G ́omez-Aguilar, R. F. Escobar-Jim ́enez,
and M. Valtierra-Rodr ́ıguez, "Solving fractional differential equations of variable-order in-
volving operators with Mittag-Leffler kernel using artificial neural networks," Chaos Soli-
tons Fractals, vol. 103, pp. 382–403, 2017. doi: 10.1016/j.chaos.2017.06.030.
[34] G. Pang, L. Lu, and G. E. Karniadakis, "fPINNs: Fractional physics-informed neu-
ral networks," SIAM J. Sci. Comput., vol. 41, no. 4, pp. A2603–A2626, 2019. doi:
10.1137/18M1229845.
[35] H. Qu, X. Liu, and Z. She, "Neural network method for fractional-order par-
tial differential equations," Neurocomputing, vol. 414, pp. 225–237, 2020.
doi:
10.1016/j.neucom.2020.07.063.
[36] H. Qu, X. Liu, X. Lu, M. ur Rahman, and Z. She, "Neural network method for solving non-
linear fractional advection-diffusion equation with spatiotemporal variable-order," Chaos
Solitons Fractals, vol. 156, p. 111856, 2022. doi: 10.1016/j.chaos.2022.111856.
29
[37] Y. Ye, H. Fan, Y. Li, X. Liu, and H. Zhang, "Deep neural network methods for solving for-
ward and inverse problems of time fractional diffusion equations with conformable deriva-
tive," Neurocomputing, vol. 509, pp. 177–192, 2022. doi: 10.1016/j.neucom.2022.08.030.
[38] X. Fang, L. Qiao, F. Zhang, and F. Sun, "Explore deep network for a class of fractional
partial differential equations," Chaos Solitons Fractals, vol. 172, p. 113528, 2023. doi:
10.1016/j.chaos.2023.113528.
[39] C. Li and F. Zeng, Numerical methods for fractional calculus. CRC Press, 2015.
[40] A. A. Alikhanov, "A new difference scheme for the time fractional diffusion equation," J.
Comput. Phys., vol. 280, pp. 424–438, 2015. doi: 10.1016/j.jcp.2014.09.031.
[41] C. Li and M. Cai, Theory and numerical approximations of fractional integrals and deriva-
tives. SIAM, 2019.
30
|
|
http://arxiv.org/abs/2310.04772v1 | "2023-10-07T10:49:30" | "2023-10-07T10:49:30" | Optimal Sequential Decision-Making in Geosteering: A Reinforcement
Learning Approach | Trajectory adjustment decisions throughout the drilling process, called
geosteering, affect subsequent choices and information gathering, thus
resulting in a coupled sequential decision problem. Previous works on applying
decision optimization methods in geosteering rely on greedy optimization or
Approximate Dynamic Programming (ADP). Either decision optimization method
requires explicit uncertainty and objective function models, making developing
decision optimization methods for complex and realistic geosteering
environments challenging to impossible. We use the Deep Q-Network (DQN) method,
a model-free reinforcement learning (RL) method that learns directly from the
decision environment, to optimize geosteering decisions. The expensive
computations for RL are handled during the offline training stage. Evaluating
DQN needed for real-time decision support takes milliseconds and is faster than
the traditional alternatives. Moreover, for two previously published synthetic
geosteering scenarios, our results show that RL achieves high-quality outcomes
comparable to the quasi-optimal ADP. Yet, the model-free nature of RL means
that by replacing the training environment, we can extend it to problems where
the solution to ADP is prohibitively expensive to compute. This flexibility
will allow applying it to more complex environments and make hybrid versions
trained with real data in the future. | [
"Ressi Bonti Muhammad",
"Sergey Alyaev",
"Reidar Brumer Bratvold"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04772v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04772v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"physics.geo-ph"
] | Highlights
Optimal Sequential Decision-Making in Geosteering: A Reinforce-
ment Learning Approach
Ressi Bonti Muhammad, Sergey Alyaev, Reidar Brumer Bratvold
• Reinforcement learning approach for geosteering decision-making prob-
lem
• Cost-efficient method with comparable results to approximate dynamic
programming
• Model-free method; allows for solving more complex geosteering envi-
ronments
3
2
0
2
t
c
O
7
]
G
L
.
s
c
[
1
v
2
7
7
4
0
.
0
1
3
2
:
v
i
X
r
a
Optimal Sequential Decision-Making in Geosteering: A
Reinforcement Learning Approach
Ressi Bonti Muhammada,∗, Sergey Alyaevb,∗, Reidar Brumer Bratvolda
aUniversity of Stavanger, Kjell Arholms gate 41, Stavanger, 4021, Norway
bNORCE Norwegian Research Centre, Nyg ̊ardsgaten 112, Bergen, 5008, Norway
Abstract
Trajectory adjustment decisions throughout the drilling process, called geosteer-
ing, affect subsequent choices and information gathering, thus resulting in a
coupled sequential decision problem. Previous works on applying decision
optimization methods in geosteering rely on greedy optimization or Approx-
imate Dynamic Programming (ADP). Either decision optimization method
requires explicit uncertainty and objective function models, making develop-
ing decision optimization methods for complex and realistic geosteering en-
vironments challenging to impossible. We use the Deep Q-Network (DQN)
method, a model-free reinforcement learning (RL) method that learns di-
rectly from the decision environment, to optimize geosteering decisions. The
expensive computations for RL are handled during the offline training stage.
Evaluating DQN needed for real-time decision support takes milliseconds
and is faster than the traditional alternatives. Moreover, for two previously
published synthetic geosteering scenarios, our results show that RL achieves
high-quality outcomes comparable to the quasi-optimal ADP. Yet, the model-
free nature of RL means that by replacing the training environment, we can
extend it to problems where the solution to ADP is prohibitively expensive
to compute. This flexibility will allow applying it to more complex environ-
ments and make hybrid versions trained with real data in the future.
Keywords: Geosteering, Geosteering decisions, Sequential decision-making,
Reinforcement learning, Machine learning, Subsurface energy resources
∗Corresponding authors:
Email addresses: ressi.b.muhammad@uis.no (Ressi Bonti Muhammad),
saly@norceresearch.no (Sergey Alyaev)
Preprint submitted to Journal
October 10, 2023
1. Introduction
Geosteering operations involve a series of important decisions made by
a geosteering team (GST) throughout the drilling process. These decisions
influence both the immediate and future outcomes. As the GST receives new
logging-while-drilling (LWD) data, they are constantly engaged in decision-
making. This dynamic nature of geosteering operations formally establishes
them as sequential decision problems (Kullawan et al., 2016b, 2018; Alyaev
et al., 2019, 2021). Markov Decision Process (MDP) is a widely used frame-
work that can effectively model and represent sequential decision problems.
MDP framework provides a formalized approach for modeling the sequen-
tial nature of decision-making, which considers several elements of the prob-
lem, including the objectives, the alternatives, and the available information.
These elements are important if the GST seeks high-quality decision-making
that increases the chances of optimally landing the well.
In recent years, several publications have attempted to produce a deci-
sion optimization method specifically tailored for geosteering environments.
Chen et al. (2014) introduced an automated workflow for proactive (greedy)
geosteering combined with continuous updating of the geological model us-
ing the ensemble Kalman Filter. Kullawan et al. (2016a) proposed a decision
optimization method that integrates the Bayesian framework with a multi-
objectives, decision-driven approach to geosteering. Kullawan et al. (2018)
combined the Bayesian framework with Discretized Stochastic Dynamic Pro-
gramming (DSDP), an Approximate Dynamic Programming (ADP) method,
to support directional changes in geosteering operations. Alyaev et al. (2019)
developed a decision support method that combines the ensemble Kalman
filter to sequentially update the geological model realization and an ADP
method to solve multi-target geosteering cases. Kristoffersen et al. (2021)
proposed to use an evolutionary algorithm to include the effect of Geosteer-
ing during well planning.
The decision support methods mentioned in the previous paragraph are
common in that they often require a complete model of the environment
(or environment model), which can be difficult or impossible to develop in
complex and uncertain environments like geosteering. A model-free method
like reinforcement learning (RL) may be more suitable in such cases. RL is
a type of machine learning that allows understanding of the problem to be
2
built up over time through trial-and-error (Sutton and Barto, 2018). In RL,
a decision-making agent interacts with an environment, receiving rewards
or penalties based on its actions, to learn an optimal policy for achieving a
desired goal. By allowing the agent to learn from experience rather than rely-
ing on a pre-defined environment model, reinforcement learning can enable a
more flexible decision support method that is better suited to the geosteering
context.
In oil and gas fields, RL has mainly been used for strategic decision-
making problems, in which the problems have a fairly long time window in
finding the decisions. Several recent publications have used RL to optimize
strategic problems in the oil and gas field. Dixit and ElSheikh (2022) showed
using RL for stochastic optimal well control to determine the optimal valve
openings. Nasir and Durlofsky (2022) compared the traditional closed-loop
reservoir management to the reinforcement learning method in determining
the optimal bottom-hole pressures of existing wells. He et al. (2022) proposed
an RL method for generalizable field development optimization scenarios.
All of these works have reached identical conclusions, in which the decision-
making policy produced by RL can be directly applied to new scenarios
within the range of applicability.
Recently, a synthetic study (Liu et al., 2018) showed the applicability of
RL in well-placement optimization. In this work, we aim to show the effec-
tiveness of RL by applying it to two published geosteering contexts: Kullawan
et al. (2016a) and Kullawan et al. (2018). In contrast to greedy optimization
and ADP methods used in these setups, which needed an explicit environ-
ment model, RL can learn directly from the geosteering contexts without
needing a pre-defined model. The flexibility of RL allows us to extend it to
new geosteering scenarios with minimum modifications.
Furthermore, instead of using a Bayesian framework like the previous
decision support methods, we use the inputs to the Bayesian framework as
the basis for our decision-making process. This method is made possible
because the input data is similar in type to the output data. As a result, the
computational costs are significantly reduced, as we do not need to model
the probabilistic behavior of the environment explicitly. Additionally, given
any available scenario, we also show that RL can provide optimized steering
decisions. It eliminates the need for training simulations for each scenario
and thus reduces overall computation costs.
Finally, we show that RL outperforms greedy optimization used in Kullawan
et al. (2016a) and yields comparable results to the ADP used in Kullawan
3
et al. (2018). Our results show that RL can provide near-optimal decision-
making policies for geosteering scenarios while being flexible, robust, and
computationally efficient.
The following 4 sections follow this introduction section. The first section
introduces the Markov Decision Process (MDP) and the Bellman equations,
emphasizing their importance as the basis for each decision optimization
method used in the study. The second section provides a detailed expla-
nation of each method and its relationship to the Bellman equation. This
section also discusses how RL model is constructed, trained, and evaluated.
The third section presents two examples used to compare and measure the
performance of RL to greedy optimization and ADP methods. Finally, the
last section concludes the study, summarizing the results and their implica-
tions.
2. Markov Decision Process
In this section, we delve into the fundamental concept of the Markov
Decision Process (MDP) and the Bellman equation and their significance as
the basis of decision optimization methods.
The Markov Decision Process (MDP) is a class of stochastic sequential de-
cision processes used to model decision-making problems in discrete, stochas-
tic, and sequential domains (Puterman, 1990). MDP includes 5 important
elements: (1) T, a set of time points when decisions can be made; (2) S, a
finite state space; (3) A, a finite action space; (4) P, a collection of tran-
sition probabilities; and (5) R, a real-valued reward function. The Markov
property is a fundamental assumption of the MDP and requires that state
transitions only depend on the state and action at the current time step and
are independent of all past states and actions.
The Markov property enables the use of the Bellman equation, which
provides a recursive relationship between the value function of a state func-
tion and its successor states. Sutton and Barto (2018) used the following
equation to describe the nature of this relationship:
Vπ(s) =
π(a|s) *
(cid:88)
a
(cid:88)
s′,r
p(s′, r|s, a)[r + γVπ(s′)].
(1)
Equation 1 describes the expected value of being in state s while following
policy π, which is known as the Bellman equation for the state-value function,
denoted by Vπ(s). This equation recursively breaks down the computation
4
into two parts: the immediate reward r and the discounted value of the suc-
cessor state, γvπ(s′). The discount factor, γ, whose value should be between
0 and 1, is a parameter used in MDP to balance the value of immediate re-
wards against those that may be obtained in the future. The policy, denoted
by π(a|s), represents the probability of taking action a in state s. Finally,
p(s′, r|s, a), sometimes referred to as transition probabilities, represents the
probability of transitioning from state s to state s′ and receiving reward r
when taking action a.
Sutton and Barto (2018) described another essential concept in the MDP,
the action-value (Q-value) function, denoted by Qπ(s, a). It represents the
expected cumulative reward obtained by taking action a in state s under
policy π:
Qπ(s, a) =
p(s′, r|s, a)[r + γVπ(s′)].
(2)
(cid:88)
s′,r
The Q-value function helps determine which actions to take in each state to
maximize the cumulative reward, as it allows us to compare the expected
cumulative reward of each possible action in a given state.
3. Decision Optimization Methods
This section investigates three decision optimization methods applied
in this study: greedy optimization, Approximate Dynamic Programming
(ADP), and Reinforcement Learning (RL). Solving MDP using different de-
cision optimization methods may require different Bellman equation formula-
tions for the action-value (Q-value) function, as each method uses its unique
approach to solve the equation. We will reformulate the equation for each
method, highlighting differences and enabling a comparative analysis of their
effectiveness in optimizing geosteering decision-making problems.
3.1. Greedy Optimization
The greedy optimization, also known as myopic, is a decision-making
strategy that relies solely on current knowledge and does not consider any
predictive analysis of the potential impact of present decisions on future
outcomes (Powell, 2009).
In the context of the Bellman equation, greedy
optimization sets the discount factor γ to 0 since future rewards are not con-
sidered in the decision-making process. Thus, we can reformulate Equation
5
2 as:
Q(s, a) =
(cid:88)
s′,r
p(s′, r|s, a) * r
(3)
where the Q-value function only considers the immediate reward r obtained
by taking action a in state s.
Kullawan et al. (2016a) proposed a decision-driven method that integrates
the Bayesian framework to address multi-criteria geosteering decisions. Their
method updated uncertainties ahead of the sensor location based on real-time
measurements and considered only those relevant to the current decision-
making stage to make decisions. Equation 3 presents the value function used
by the method, which emphasizes immediate uncertainties and rewards to
guide decision-making. The method follows greedy optimization, which does
not take into account future learning and decision-making, and generally
leads to locally optimal choices (Kullawan et al., 2016b). Additionally, it
also leads to lower value creation than possible.
3.2. Approximate Dynamic Programming
Dynamic Programming (DP) is an optimization technique that aims to
find optimal solutions for sequential decision problems by considering a se-
quence of decisions and information, as proposed by Bellman (1966). The
important element behind DP is the Bellman equation which incorporates a
discount factor to weigh immediate and future rewards. This factor enables
DP to evaluate the long-term consequences of each alternative and select the
globally optimal decision at each decision stage. As a result, DP is more
computationally demanding than the greedy optimization. In DP, the full
form of Equation 2 is used.
DP and the Bellman equation have been applied successfully in sequen-
tial decision problems across various fields (Wang et al., 2015; Zaccone et al.,
2018; Bahlawan et al., 2019). However, applying these techniques to geosteer-
ing scenarios requires addressing several challenges. One of the primary
challenges is the representation of uncertainty in geosteering, which is of-
ten continuous and challenging to handle with discrete methods. Stochastic
Dynamic Programming (SDP) is a traditional method for addressing this
challenge, but it may still require significant computational resources for
real-time geosteering operations (Kullawan et al., 2016b).
Another challenge in applying DP to geosteering is the absence of an ex-
plicit model of the subsurface or transition probabilities p(s′, r|s, a), which is
6
necessary for the Bellman equation. To address this issue, Kullawan et al.
(2018) proposed an Approximate Dynamic Programming (ADP) called the
Discretized Stochastic Dynamic Programming (DSDP) method, which ap-
proximates transition probabilities by discretizing the state space and using
Monte Carlo sampling to assign state-to-state transition probabilities. The
DSDP offers an alternative that can produce a quasi-optimal solution to DP.
We define quasi-optimal as the optimal solution for the discretized version of
the problem, which the DSDP can find with a significant reduction in compu-
tational cost. Moreover, the method is readily adapted to various geosteering
scenarios with minimal modifications (Kullawan et al., 2018).
Despite its advantages, the DSDP is still a dynamic programming method
that is susceptible to the curse of dimensionality. It has only been tested
on simple geosteering scenarios with a limited number of state space dis-
cretizations. Therefore, exploring more suitable decision-making optimiza-
tion methods for geosteering scenarios is important. The following section
presents a reinforcement learning method that can potentially provide com-
parable geosteering decisions with significantly lower long-term computa-
tional costs than the DSDP.
3.3. Reinforcement Learning
Reinforcement Learning (RL) refers to an optimization method for un-
derstanding and automating sequential decision-making (Sutton and Barto,
2018).
It involves a decision-making agent that learns an optimal policy
in an unpredictable and complex environment. Unlike supervised learning
methods, RL focuses on unsupervised and direct interactions between the
agent and the environment. The agent interacts with the environment in an
MDP system by receiving state st and reward rt at each time step t before
performing action at accordingly. The environment then transitions to a new
state st+1 and emits a reward rt+1 (time step increases after every interac-
tion with the environment) in response to the action taken. The agent learns
from experience and continuously adapts its policy to maximize the cumu-
lative reward. Figure 1 visually represents the interaction between an RL
decision-making agent and its environment.
3.3.1. Q-learning
This work focuses on model-free reinforcement learning, which can be fur-
ther divided into action-value-based and policy-optimization-based methods
7
Figure 1: RL agent interaction with an environment, inspired by Sutton and Barto (2018).
In an MDP system, a decision-making agent interacts with an environment by receiving
state st and reward rt inputs, taking action at, and receiving feedback st+1 and rt+1 in
response. The agent continually learns from experience to improve its policy and maximize
its cumulative reward over time.
.
(Sutton and Barto, 2018). We work with the Q-learning method, an action-
value-based method that uses an equation known as the Q-value update rule
to iteratively update the Q-value based on the agent's interaction with the
environment.
The Q-value update rule is as follows:
Q(st, at) ← Q(st, at) + α[rt+1 + γmaxa′Q(st+1, a′) − Q(st, at)].
(4)
Here, Q(st, at) represents the current Q-value of performing action at in state
st. The Q-value is updated based on the immediate reward rt+1, the maxi-
mum Q-value among all possible actions in the next state maxa′Q(st+1, a′),
and the current Q-value. The Q-value update rule does not depend on the
policy being followed. It solely relies on the maximum Q-value rather than
a Q-value of following a specific action to update the Q-value function.
The learning rate α controls the step size of the update, while the discount
factor γ determines the importance of the next state value. Like the DSDP,
Q-learning allows for a more flexible discount factor value, which can be
adjusted between 0 and 1, depending on the currently faced context.
8
The main difference between Q-learning, greedy optimization, and DSDP
lies in the information they use to calculate the Q-values. The Bellman
equation (Equation 2) assumes that the decision-making agent has com-
plete knowledge of the environment dynamics, or the transition probabilities
p(s′, r|s, a), and uses this information to calculate the Q-values. On the other
hand, Q-learning does not require complete knowledge of the environment
dynamics, and as a result, Equation 4 does not include the term for transi-
tion probabilities. Instead, Q-learning relies on a sequence of experiences to
update the Q-values.
The method follows an ε-greedy decision-making policy to balance ex-
ploration and exploitation trade-offs. With this policy, the agent selects a
random action with probability ε and the action corresponding to the max-
imum Q-value with probability 1-ε. This method ensures that the agent
explores sufficient experiences at the beginning of training before exploiting
the maximum Q-values. As training progresses, ε is gradually decreased to
a nonzero minimum value εmin, which allows the agent to continue exploring
even in later stages of training. Choosing an appropriate value for ε is im-
portant to achieving the desired level of exploration and exploitation based
on the problem domain.
3.3.2. Deep Q-Network (DQN)
Q-learning continuously updates all Q-values until convergence (Sutton
and Barto, 2018), which may not be practical for large-scale problems, es-
pecially those with continuous state spaces. The Deep Q-Network (DQN)
was developed to overcome this limitation. DQN approximates Q-values us-
ing a deep neural network, the Q-network, which is trained to minimize a
loss function that penalizes the difference between the predicted and target
Q-values.
The loss function in the DQN implementation is described as follows:
L(θ) = [yt − Q(st, at; θt)]2
(5)
where yt is the target Q-value and Q(st, at; θt) is the predicted Q-value. The
Q-network is trained using stochastic gradient descent to update the weights
of the network θt at each time-step t, ultimately leading to a better approxi-
mation of the Q-values. Mnih et al. (2015) demonstrates the effectiveness of
DQN for solving complex, high-dimensional reinforcement learning problems
by showing that the DQN agent can outperform professional humans on a
range of Atari games.
9
Incorporating a deep neural network into a reinforcement learning envi-
ronment introduces the possibility of unstable or divergent learning (Tsit-
siklis and Van Roy, 1997). It can be attributed to two primary causes, the
correlations between sequences of experiences, et = (st, at, rt+1, st+1), that
may lead to highly correlated data distribution and the correlations between
action-value and target-value (Mnih et al., 2015).
To address the first cause, DQN uses experience replay, which involves
storing the experience at each time step in a memory data set, Dt = e1, ..., et,
and uniformly sampling a minibatch of experience b ∼ U (D) from the mem-
ory data set to update the Q-network weights using the samples. The second
issue is addressed by introducing a separate network, the target network ˆQ,
with weight parameters θ−. While the initial network weight parameter θ
is updated at each iteration, the target network weight parameter θ− is up-
dated every C iteration step by cloning the weight parameters of the initial
network. Thus, the target-value in Equation 5 becomes:
yt = rt+1 + γmaxa′ ˆQ(st+1, a′; θ−
t ).
(6)
DQN is currently limited to solving problems with a discrete action space
consisting of a finite set of possible actions. Each action is typically assigned
a unique identifier (e.g., "one," "two") or index (e.g., "0," "1"). This differs
from the continuous action space, where an action is selected from a cer-
tain distribution. To tackle problems with continuous action spaces, another
branch of RL called the policy optimization-based method is needed.
To apply DQN to geosteering decision-making contexts, it is necessary
to ensure that the action space is discrete. While this limitation may seem
restrictive, it does not diminish the value of DQN compared to greedy op-
timization and DSDP, which are likewise confined to discrete action space
problems. On the other hand, DQN offers an advantage over DSDP due to
its more straightforward implementation. As illustrated in Figure 1, the RL
agent (or DQN agent) is independent of its environment, enabling the same
agent to be trained across multiple contexts without altering the method.
Table 1 summarizes the differences between the sequential decision-making
optimization methods described in this study.
3.3.3. Model Architecture
The model uses a deep neural network to estimate the Q-value for a given
state-action pair. Logically, the network takes the state-action pair as input
10
Table 1: Comparison of sequential decision-making optimization methods
Algorithms
Type
Greedy* Model-based
Model-based
Q-learning Model-free
DSDP
Future
Information
Not considered
Fully considered
Action
Space
Discrete
Discrete
Implicitly Considered Discrete
DQN
Model-free
Implicitly Considered Discrete
State
Space
Discrete
Discrete
Discrete
Discrete and
Continuous
*Greedy optimization as described and used in Kullawan et al. (2016a)
and produces the approximate Q-value as output. However, the ε-greedy
policy used in the method requires comparing the Q-values of all available
actions in a state, resulting in a linear increase in cost as the number of
possible actions increases. To address this issue, Mnih et al. (2015) proposes
an alternate network design that uses the state representation as input and
outputs the Q-value for each action, allowing for a single forward pass to
estimate the Q-value of a given state.
In this study, we use PyTorch (Paszke et al., 2019) to define our neural
network architecture and train the model. We choose a relatively simple two-
hidden-layer deep neural network instead of fully using the proposed design,
which uses convolutional hidden layers to capture images as its input. Our
network consists of two hidden fully-connected linear layers with a ReLU
activation function, with the first and second hidden layers containing 128
and 64 rectifier units, respectively. The input and output layers will vary
between examples/environments, which will be elaborated on in a subsequent
section. It is noteworthy that modifying the inputs and outputs does not
affect DQN as it only requires the number of states and actions to initialize
the neural network. Figure 2 illustrates the general network architecture
used in the study.
3.3.4. General Training and Evaluation
To ensure an unbiased comparison with greedy optimization and DSDP,
we train the RL agent using a simulated environment based on the geosteer-
ing settings mentioned in each journal. Figure 3 shows an example of the
simulated environment. We train the RL agent using 51 different random
seeds. We evaluate the performance of each trained agent by generating 1000
11
Figure 2: General neural network architecture used in the study. The neural network
architecture consists of two hidden layers that take the state representation as inputs and
outputs the Q-values for each available action.
subsurface realizations from the same distributions used during training. We
then compute the median of the average reward obtained by the 51 trained
agents. We name this median as "RL-Robust." RL-Robust is calculated as
follows:
rRL = Median ( ̄r1, ̄r2, . . . , ̄rm)
(cid:80)n
̄r =
i=1 ri
n
(7)
(8)
where m equals to 51 and ̄r is the average reward out of n = 1000 subsurface
realizations. In the second example, we introduce another term called the
"RL-Best," which considers only the best average reward out of 51 trained
agents. We will then compare RL results to the average reward obtained by
greedy optimization and DSDP.
4. Numerical Example
In this section, we show the application of RL by studying two examples
from published journals. Specifically, we analyze the studies did by Kullawan
et al. in 2014 and 2018 and show how RL can optimize decision-making in
complex and uncertain environments. We compare the results of RL to those
obtained using greedy optimization and DSDP. By comparing these results,
12
Figure 3: Illustration of the simulated environment used in the study, taken from the
second example. The white lines represent the reservoir boundaries, and the colored lines
represent the well trajectories. The changes in color represent sidetracks. The state
representation at each step is shown on the top left-hand side, and the corresponding
objective function values are displayed on the top right. The number of episodes is shown
on the top middle side. The horizontal and vertical axes show the horizontal distance and
the current depth in meters, respectively.
we can gain valuable insights into the abilities of RL to generate near-optimal
decision guidance and objective results.
4.1. First Example
This subsection presents the application of RL to the geosteering envi-
ronment, which is proposed by Kullawan et al. (2016a). The geosteering
scenario involves drilling a horizontal well in a three-layered model with non-
uniform reservoir thickness and quality. The reservoir consists of a sand layer
sandwiched between shale layers and is divided into two permeability zones:
a high-quality zone in the top 40 percent of the reservoir and a low-quality
zone comprising the remaining 60 percent.
Given the non-uniform thickness of the reservoir, primary uncertainties
in this geosteering example are the depths of the top and bottom reservoir
boundaries. Signals are received from the sensor, which is located at or
behind the bit, and these signals are used to determine the distance to the
13
boundaries (at or behind the bit). These distances are then, in turn, used
to update uncertainties about boundary locations ahead of the bit using a
Bayesian framework. The framework assumes that the signals are accurate.
The reservoir boundaries are discretized into N points. Steering decisions
are made by adjusting the well inclination at every n discretization point,
where the change in inclination at each decision stage is restricted to no more
than 5o. At each decision stage, there are 11 alternatives for inclination
adjustment, ranging from −5o to 5o in increments of 1o. The minimum
curvature method is used to calculate the trajectory of the well at each
discretization point based on the chosen inclination change.
Figure 4 shows the geosteering environment as described above. The blue
line represents the well trajectory drilled in the three-layered model. The red
dashed line indicates the boundary between the high-quality and low-quality
reservoir zones. Decisions are made at every n = 10 discretization point
to determine the path of the well. The thickness of the reservoir varies at
each discretization point, denoted by h. The distances from the well to the
upper and lower reservoir boundaries are denoted by DT U B and DT LB,
In addition, DT HQ denotes the
respectively, so h = DT U B + DT LB.
distance from the well to the high-quality zone.
Figure 4:
Illustration of the geosteering scenario, a remake based on Kullawan et al.
(2016a). At every n = 10 discretization points, decisions are made to determine the well
trajectory. The blue line represents the well path, while the red dashed line denotes the
boundary between high and low-quality reservoir zones. The thickness of the reservoir at
each discretization point is represented by h, while DT U B and DT LB denote the distances
from the well to the upper and lower reservoir boundaries, respectively. Additionally,
DT HQ denotes the distances from the well to the high-quality zone.
14
The primary objective of the example is to optimize the reward function
by maximizing the length of the well in the high-quality reservoir zone while
at the same time avoiding reservoir exit. Two reward functions are defined
for this purpose. The first reward function, r1,i at discretization point i, is:
r1,i = 14.654x3
i − 17.778x2
i + 7.2252xi
(9)
where xi is the distance between the well and the nearest reservoir boundary,
min(DT U B, DT LB), normalized by the reservoir thickness hi. The function
takes its maximum value (1) when the well is placed in the middle of the
reservoir (xi = 0.5). The second objective, r2,i at discretization point i, is:
r2,i = −2 × 10−5y2
i + 0.009yi.
(10)
Here, yi represents the permeability of the zone, and the equation is con-
structed for a scenario where the maximum permeability is 200 mD, which
results in a value of 1 for yi = 200.
The decision context described by Equations 9 and 10 is multi-objective
with two conflicting objectives. Equation 9 indicates that placing the well in
the center of the reservoir minimizes the risk of exiting the reservoir, while
Equation 10 suggests that the well should be positioned in the high-quality
zone to maximize its value. However, positioning the well in the high-quality
zone increases the risk of drilling into the upper shale layer, which goes
against the primary objective.
We thus apply a common multi-objective (Bratvold et al., 2010) decision
analytic approach where the objectives are weighted. This entails computing
the weighted overall reward for each of the 11 alternatives. The weighted
overall reward, rj, at decision stage j, is:
rj = w1
n∗j−1
(cid:88)
r1,i + w2
n∗j−1
(cid:88)
r2,i.
i=n∗(j−1)
i=n∗(j−1)
(11)
Here, w1 and w2 denote the weights assigned to the two objectives, and r1,i
and r2,i represent the computed reward for the ith discretization point for the
two objectives, respectively. With w1 + w2 = 1, the maximum value of rj is
n = 10.
4.1.1. RL Setting
In order to use RL method for sequential decision-making, we need to
define parameters such as the action space, reward function, and state space
15
based on the geosteering scenario. These parameters are needed for the RL
agent to learn and find the optimal strategy for the scenario.
Action space. The geosteerers are engaged in decision-making to place
the well optimally. They will make decisions, each with a set of alterna-
tives, consisting of 11 discrete values ranging from -5o to 5o at each decision
stage. As a result, the neural network has 11 output nodes in this scenario,
corresponding to the available actions that the RL agent can take.
Reward function. One of the objectives in Kullawan et al. (2016a)
was to study the effect of alternative weights for each objective on the final
well placement rather than the reward function. However, the RL agent is
trained to maximize the reward function defined in Equation 11 for every
available scenario. We compare greedy optimization and RL based on their
reward function to ensure consistent training and evaluation. We use N =
100 discretization points, and have 10 decision stages. Thus, the maximum
reward for a single geosteering equals to n ∗ 10 = 100.
State space. We need to specify a state space relevant to the reward
function to ensure that the RL agent has the necessary information to opti-
mize geosteering decisions. Specifically, we provide the RL agent with n + 1
pieces of information for reservoir thickness and the vertical distances to the
reservoir boundaries and high-quality zone, with the n pieces representing
posterior updates ahead of the sensor location and the +1 piece represent-
ing the sensor reading at the current decision stage.
In addition, the RL
agent receives another 5 pieces of information. These include the horizon-
tal distance from the starting point, the inclination assigned to the current
discretization point, the quality of the reservoir, and the weights associated
with each objective. With n = 10 or 10 points between each decision stage,
the RL agent receives 49 state information inputs, consisting of 40 posterior
information pieces, 4 sensor readings, and the 5 complementary information
pieces mentioned above. This configuration is referred to as "RL-Posterior."
In an alternative method, the Bayesian framework and posterior updates
are not used.
Instead, the RL agent receives sensor readings from n dis-
cretization points behind the sensor location, while other complementary
information is identical in both methods. This method can help us show
the capacity of RL (DQN) to optimize the problem by implicitly predict-
ing the boundaries ahead of the sensor location without the need for po-
tentially costly Bayesian computations. This configuration is referred to as
"RL-Sensor."
The state representation of both RL agents is summarized in Table 2.
16
The first two rows correspond to the n + 1 information described earlier.
However, the important distinction lies in the subscript notation of the in-
formation. For the RL-Posterior method, the information range from the
sensor location i to n discretization points ahead, while for the RL-Sensor
method, the information starts from n discretization points behind the sensor
location i. The remaining information, including Inci representing the incli-
nation at the current point, i denoting the current discretization point (or
equivalently, the horizontal distance from the starting point), y representing
the reservoir quality, and w1 and w2 denoting the weights of each objective,
remain consistent across both agents.
Table 2: Comparison of the state representations of the two RL methods
Model
RL-Posterior
RL-Sensor
State Representation
{DT U Bi,..., DT U Bi+n, DT LBi,..., DT LBi+n,
DT HQi,..., DT HQi+n, hi,..., hi+n,
Inci, i, y, w1, w2}
{DT U Bi−n,..., DT U Bi, DT LBi−n,..., DT LBi,
DT HQi−n,..., DT HQi, hi−n,..., hi,
Inci, i, y, w1, w2}
4.1.2. Training Results
Following Kullawan et al. (2016a), we split the example into two scenarios
based on the reservoir quality disparity between the two zones. We train the
RL agent to optimize both scenarios simultaneously to avoid the need to
train the RL agent multiple times. It could also show the generalizability of
the resulting decision-making policy.
Figure 5 visually shows the outcomes of training a single seed of the two
RL methods: the RL-Posterior and RL-Sensor, in the first example. The
red lines represent the RL-Posterior method, while the blue lines represent
the RL-Sensor method. The figure presents the evolution of the percent-
age of each individual objective, specifically the reservoir contact and the
high-quality zone percentages, alongside the rewards obtained during the
geosteering operation. The figure is constructed by taking the average of
the numbers (percentages and rewards) obtained during the last 100 training
episodes. This approach provides a smoothed representation of the per-
formance of an RL decision-making agent and helps mitigate the effects of
short-term fluctuations.
17
Both RL agents gradually improve their decision-making policies through-
out the training, as seen by the overall increase in all objectives and rewards.
The reservoir contact objective, which initially stands at less than 40 per-
cent during the early stage of training, improves significantly for both agents,
reaching approximately 90 percent by the end of the training. Additionally,
both agents increase the high-quality zone percentage from 20 percent to
approximately 60 percent after the training sequence.
Regarding the rewards, it is important to address the presence of large
negative values observed at the beginning of the training. These values are
caused by the reward function associated with the first objective. The re-
ward function assigns a large negative number when the well trajectory is
significantly distant from the target zone, resulting in the noticeable negative
values shown in the figure. However, as the RL agent learns from experience,
the rewards gradually increase and remain above zero when the training se-
quence ends.
While the difference between the two agents may appear negligible at
first glance, closer examination reveals a slight advantage for the RL-Sensor
method regarding the high-quality zone objective. It is important to note
that the figure shown is based on a single training seed, and a more compre-
hensive comparison will be done in the subsequent section. In that section,
the performance of all training seeds will be averaged, providing a more ro-
bust comparison of the relative performance between the RL agents.
Another important aspect is the computational cost of training a single
seed. The RL-Posterior method requires approximately 2500 seconds to com-
plete the training sequence, whereas the RL-Sensor method completes the
training in a significantly shorter time, around 500 seconds. This substantial
difference in training duration is caused by the utilization of the Bayesian
framework in the RL-Posterior method, which introduces additional com-
putational costs. On the other hand, the RL-Sensor method, which does
not rely on the Bayesian framework, offers a more computationally efficient
alternative.
4.1.3. Evaluation Results
We generate 1000 different reservoir realizations for evaluation purposes,
ensuring that the results represent various scenarios described below. This
subsection presents the results of the first study, while the subsequent sub-
section will focus on discussing those results in more detail.
Scenario 1. The permeability of the high-quality zone is 200 mD,
18
(a) Reservoir Contact
(b) High Quality Zone
(c) Rewards
Figure 5: Evolution of individual objectives (reservoir contact and high-quality zone per-
centages) and the overall rewards of two RL agents during training. The red lines represent
the RL-Posterior method, while the blue lines represent the RL-Sensor method. The figure
reflects the average from the last 100 training episodes.
whereas the permeability of the low-quality zone is 100 mD. There is a dis-
tinction in quality, although it is not substantial. Consequently, the first
objective is assigned a greater weight, with w1 = 0.67 and w2 = 0.33.
Table 3: Scenario 1 - Average results for greedy optimization and Median results for both
RL-agents
Methods
Greedy
RL-Posterior*
RL-Sensor*
*RL-Robust
Rewards Reservoir contact (%) High quality (%)
43.00
44.06
46.77
71.44
85.25
85.79
87.90
92.86
92.86
Table 3 presents the results of greedy optimization and two RL meth-
ods, RL-Posterior and RL-Sensor. The median reward of the RL-Posterior
method is 85.25 out of 100, representing a significant improvement of 19.34
percent over the greedy optimization. Meanwhile, the RL-Sensor method
19
achieves a slightly higher median reward of 85.79. Furthermore, both RL
agents yield better well placement by achieving higher figures on both objec-
tives.
Scenario 2. The permeability of the high-quality zone is 200 mD, while
the permeability of the low-quality zone is 20 mD. Given the more substantial
difference in quality compared to scenario 1, it is important to position the
well in the top portion of the reservoir. Therefore, the weight for the second
objective is greater than in the first objective, with w1 = 0.41 and w2 = 0.59.
Table 4: Scenario 2 - Average results for greedy optimization and Median results for both
RL-agents
Methods
Greedy
RL-Posterior*
RL-Sensor*
*RL-Robust
Rewards Reservoir contact (%) High quality (%)
53.20
65.62
70.22
55.57
73.76
74.21
82.50
89.85
88.65
Table 4 presents the average results of greedy optimization and median
results of both RL configurations in scenario 2. Similar to scenario 1, the
RL-Posterior and RL-Sensor methods outperform greedy optimization in all
three metrics, with higher rewards, reservoir contact percentage, and high-
quality percentage.
The primary objective in this scenario is to position the well inside the
high-quality zone. As a result, the well is placed closer to the upper reservoir
borders, which increases the probability of exiting the reservoir, leading to a
relatively low reward from the first reward function. Furthermore, the low-
quality zone in scenario 2 has a lower permeability value than in scenario 1,
reducing the overall reward of scenario 2. Nevertheless, the table illustrates
that RL has higher value in scenario 2 than in scenario 1, with a 32.74 percent
increase for the RL-Posterior method and a 33.55 percent increase for the
RL-Sensor method.
4.1.4. Discussion
The RL methods used in this study yield significantly better results than
greedy optimization. The superior performance of the RL methods is at-
tributed to their ability to learn from experience and explore different strate-
gies to maximize the reward. By contrast, greedy optimization only consid-
20
ers the immediate reward and does not consider future decisions and future
learning.
The results also show that the RL-Sensor method consistently outper-
forms the RL-Posterior method in terms of median reward across all scenar-
ios. Although the difference in performance is insignificant, it is consistent,
and the RL-Sensor method achieves the results without requiring posterior
updates, suggesting that it can implicitly anticipate reservoir boundaries us-
ing the sensor readings behind the sensor location. One plausible explana-
tion for the observed difference is that the posterior updates derived from
the Bayesian framework might contain inaccuracies and errors. Although the
implicit predictions from RL can also suffer from similar issues, the superior
performance of the RL-Sensor method implies that the implicit predictions
provide more accurate approximations compared to the posterior updates.
Moreover, eliminating the Bayesian framework in the RL-Sensor method
reduces the training time for a single seed from 2500 to 500 seconds while
still achieving superior results. With a computational cost that is 5 times
cheaper, the RL-Sensor method remains the superior method even when its
results are slightly worse than those of the RL-Posterior method. Therefore,
we exclusively use the RL-Sensor method for the second example described
in the following subsection.
4.2. Second Example
In this section, we show the application of the RL-Sensor method to
an example previously shown by Kullawan et al. (2018). Their study used
greedy optimization and DSDP to optimize a geosteering scenario in thin and
faulted reservoirs. The geosteering context for this example is similar to the
first example, where a horizontal well is drilled in a three-layered reservoir
model consisting of a sand reservoir sandwiched between shale layers.
The example considers a constant reservoir thickness and uniform qual-
ity, reducing uncertainties in this case to the depths of the upper reservoir
boundary and the location and displacement of faults. The prior knowledge
of the depth of boundaries is combined with fault information, such as the
number of faults, expected fault displacement, and possible fault location.
As in the first example, Kullawan et al. (2018) uses a Bayesian framework
to update the combined prior information based on real-time sensor data.
Additionally, the study assumes that the real-time information is accurate.
We use the same prior geomodel and fault uncertainty parameters as
Kullawan et al. (2018), shown in Figure 6. The reservoir boundaries are
21
discretized into 30 points (N = 30) spaced 30 meters apart, with solid black
lines indicating the expected upper and lower boundaries of the reservoir.
Green dashed lines represent potential fault displacements, with uncertainty
modeled using a normal distribution. Red dashed lines indicate possible fault
locations, with uncertainty modeled using discrete uniform distributions. For
instance, the first fault has an estimated displacement of 3 meters, with a
standard deviation of 1 meter, and may be located 120 meters, 150 meters,
or 180 meters from the first discretization point.
Figure 6: Illustration of prior geomodel and fault uncertainties remade based on Kullawan
et al. (2018). The expected upper and lower boundaries are shown as solid black lines.
Uncertainty in potential fault displacements is represented by green dashed lines, modeled
using a normal distribution. Uncertainty in possible fault locations is represented by red
dashed lines, modeled using discrete uniform distributions.
In this geosteering setting, there are 29 decision stages, and steering de-
cisions are made at every discretization point (n = 1) by directly modifying
the well depth without using the minimum curvature method. At each de-
cision stage j, 5 options are available for altering the well depth, ranging
from −0.5-m TVD to 0.5-m TVD with a 0.25-m TVD increase. Addition-
ally, sidetracking can be done if the well exits the reservoir after deciding
to modify or maintain the well depth. We refer to it as the default setup,
where a steering decision is followed by a sidetrack decision. Sidetracking can
ensure that the well is drilled towards the center of the boundary. However,
it incurs additional costs. In other words, sidetracking represents a trade-off
between future gain and present increased expense.
Figure 7 illustrates how each alternative changes the well depth at each
decision node. In this example, the blue line represents the well trajectory,
which has exited the reservoir boundaries, represented by the black lines.
When making a steering decision, the decision maker can adjust the well
22
depth using any of the 5 alternatives represented by the blue arrows. On the
other hand, if the decision maker chooses to execute a sidetrack, the well is
taken back to the previous decision stage and drilled directly to the middle of
the reservoir boundaries for the next decision stage, as shown by the red line
and arrows. The blue dashed line in the figure indicates that the previous
well trajectory is discarded as if it had never been drilled.
Figure 7: Illustration of alternatives from the second example. The blue line represents
the well trajectory, while the black lines represent the reservoir boundaries. The decision
maker can make a steering decision using the 5 alternatives represented by the blue arrows.
If the sidetrack is chosen, the well is taken back to the previous decision stage and drilled
directly to the middle of the reservoir boundaries for the next decision stage, as shown by
the red line and arrows.
In this example, we aim to optimize the reward of a geosteering project
by maximizing reservoir contact and minimizing operating costs. To this
end, the setting uses a reward function rj that combines the values vj and
operating costs cj at each decision stage j. Specifically, rj is defined as:
rj = vj − cj.
Here, vj represents the value given the location of the well, which is equal
to the production value vprod if the well is located within the reservoir and 0
otherwise. The operating cost cj is the sum of the drilling cost cd, and the
sidetrack cost cST if sidetracking is done. We use values of vprod ranging from
0.5 to 4.0, with cd and cST held constant at 0.0625 and 2.567, respectively.
Consequently, for 29 decision stages, the maximum value of a geosteering
project is 29 * vprod, and the minimum operating cost is 29 * cd = 1.81.
(12)
4.2.1. RL Setting
As in the first example, we need to specify the following three parameters
from the geosteering scenario to use RL for sequential decision-making:
23
Action space. In the default setup, there are two decision nodes in one
decision stage: the first for modifying the drill bit depth and the second for
performing a sidetrack. However, this configuration can lead to sub-optimal
results for specific scenarios when we use RL. For example, when the value
vprod is less than the sidetrack cost cST , an RL decision-making agent using
two decision nodes may follow a greedy decision-making policy and decline
to do a sidetrack. Conversely, when vprod exceeds cST , the agent will always
choose to sidetrack, irrespective of the actual value of the well. Thus, using
two decision nodes could limit the ability of the RL agent to make optimal
decisions regarding sidetracking.
To address this issue, we adapt the action space to include a single decision
node with 6 alternatives, 5 of which correspond to adjustments in the drill
bit depth, while the sixth alternative is for performing a sidetrack. As a
result, the neural network for the second scenario contains 6 output nodes.
However, this modification introduces another issue where the sidetrack
alternative is consistently available, whereas in the default setup, the side-
track option is restricted when the drill bit is already within the reservoir.
To address this issue, we temporarily force the RL agent to disregard the
sidetrack alternative when it is unnecessary. On the other hand, if the drill
bit exits the reservoir, every alternative is available for the RL agent. Hence,
it can either execute a sidetrack or continue making steering decisions for
the subsequent decision stages. This approach enables the agent to make
appropriate decisions based on the current location of the drill bit. As a
result, we can evaluate the ability of the RL agent to handle both steering
and sidetrack decisions effectively.
Reward function. The reward function used in the RL configuration
remains unchanged and is the same as the default setting, as shown in Equa-
tion 12. Thus, the RL agent receives a reward rj after each decision stage.
Moreover, we did not alter the evaluation method since the default setting
already used a consistent approach that compared the performance of dif-
ferent methods based on their total reward function, which is defined as the
sum of rewards over all decision stages, i.e., (cid:80) rj.
State space. As the second example assumes a constant reservoir thick-
ness and homogeneous reservoir quality, the RL-Sensor method requires less
information about the reservoir than in the first. We provide an RL decision-
making agent n + 1 information on vertical distances between the well tra-
jectory and reservoir boundaries. Additionally, with the inclusion of faults
and sidetracks in the geosteering setting, we also inform the agent about the
24
possible zone and the expected displacement of the subsequent fault.
Furthermore, it is important for the agent to know whether the well
trajectory is inside or outside the reservoir. We also inform the agent about
its horizontal distance from the initial point and the value of the current
geosteering project. Consequently, the RL-Sensor method gathers 9 pieces
of information at each decision stage, which serve as inputs for the neural
network.
4.2.2. Training Results
Figure 8 illustrates the training outcomes of the RL-Sensor method in
the second example. The training for a single seed requires approximately
20 minutes. Similar to the first example, the figure presents the evolution of
individual objectives, specifically the reservoir contact and the operating cost,
alongside the overall rewards obtained during the geosteering operation. The
figure is also constructed by taking the average obtained during the last 100
training steps. Moreover, the training also considers the number of scenarios
the example has. The scenario in this example depends on the production
value vprod that ranges from 0.5 to 4.
The figure illustrates the evolution of the RL-sensor method decision-
making policy. Over time, the RL-Sensor method improves the reservoir
contact from an initial percentage of 65 to approximately 90 percent. Simul-
taneously, it reduces the operating cost from a starting cost of 8 to around 3,
which correlates with decreased sidetrack operations. In other words, the RL-
Sensor method gradually learns to make a better steering decision, reducing
the need for frequent sidetrack operations.
The evolution of the average rewards shows a higher fluctuation level than
in the previous example. This increased variability is primarily attributed
to the influence of the production value, vprod, which is determined by the
random sampling procedures used during the training sequence. For instance,
when vprod is set to 0.5, the maximum reward attainable by a decision-making
agent in a single training episode is 29×0.5−1.81 = 12.69. Conversely, when
vprod equals 4, the maximum achievable reward becomes 29 × 4 − 1.81 =
114.19, approximately 10 times larger than the other scenario.
4.2.3. Evaluation Results
We run 1000 simulations of the geomodel shown in Figure 6 to evaluate
the performance of different methods by studying the impact of varying vprod
values on the rewards, reservoir contact, and operating cost. This subsection
25
(a) Reservoir Contact
(b) Operating Cost
(c) Rewards
Figure 8: Evolution of individual objectives (reservoir contact and operating costs) and the
overall rewards of the RL-Sensor method during training. The figure reflects the average
from the last 100 training episodes
presents the results, while the subsequent subsection will provide a discussion
and analysis of the results.
Scenario 1. vprod = 0.5, resulting in a very expensive sidetrack cost and
making sidetrack decisions less favorable than steering decisions (vprod <<<
cST ). Table 5 shows the rewards, reservoir contact, and operating cost of all
three methods for scenario 1.
Table 5: Scenario 1 - Results for Greedy Optimization, DSDP, RL-Sensor Robust, and
RL-Sensor Best
Methods
Greedy
DSDP
RL-Sensor
RL-Sensor Best
Rewards Reservoir contact (%) Operating Cost
1.81
2.01
1.81
1.82
8.33
11.40
11.50
11.72
69.94
92.47
91.80
93.37
At vprod = 0.5, greedy optimization never chooses to do a sidetrack, as
26
suggested by its minimum operating cost of 1.81. It achieves the lowest aver-
age reservoir contact of 69.94 percent and, unsurprisingly, the lowest average
reward among the other methods, at 8.33. On the other hand, the DSDP
achieves a significantly higher reservoir contact of 92.47 percent compared to
greedy optimization.
The RL-Sensor method achieves a high reservoir contact of 91.80 per-
cent while maintaining a minimal cost of operation.
In this scenario, the
RL-Sensor decision-making policy is similar to greedy optimization in that
it does not do sidetrack operations and relies only on steering decisions. De-
spite not performing any sidetracks, the results show that the RL-Sensor
method, with a median reward of 11.50, slightly outperforms the DSDP. We
also include RL-Sensor Best, and it further outperforms the DSDP with a
reservoir contact percentage of 93.37 and a median reward of 11.72.
Scenario 2. vprod = 2, which is still slightly lower than the sidetrack cost
(vprod < cST ). Table 6 shows the rewards, reservoir contact, and operating
cost of all three methods for scenario 2.
Table 6: Scenario 2 - Results for Greedy Optimization, DSDP, RL-Sensor Robust, and
RL-Sensor Best
Methods
Greedy
DSDP
RL-Sensor
RL-Sensor Best
Rewards Reservoir contact (%) Operating Cost
1.81
3.18
3.68
2.87
69.96
95.02
96.54
96.17
38.76
51.93
52.31
52.90
The decision-making policy of greedy optimization remains the same at
vprod = 2 as the production value is still below the sidetrack cost. As a
result, greedy optimization still achieves the minimum operating cost with
no improvement in reservoir contact. Similar to the first scenario, its average
reward is the lowest among all methods at 38.76. On the other hand, the
DSDP performs more sidetrack operations than in the previous scenario,
resulting in a higher cost. However, this method achieves an average reward
of 51.93, considerably better than greedy optimization.
Like the DSDP, the RL-Sensor method incurs a higher operating cost
than in scenario 1 due to performing more sidetrack operations. Specifically,
the decision-making policy of the RL-Sensor method leads to an operating
cost of 3.68 while achieving a high reservoir contact of 96.54 percent. These
27
results show the ability of the RL-Sensor method to strike a balance between
maximizing reservoir contact and minimizing operating cost, even when the
production value is still below the sidetrack cost. Compared to the DSDP,
the RL-Sensor method yields a slightly higher median reward of 52.31. The
RL-Sensor Best outperforms all other methods, achieving the highest average
reward of 52.90 with a reservoir contact of 96.17 percent and an operating
cost of 2.87.
Scenario 3.
vprod = 4, resulting in a very cheap sidetrack cost and
making it, when available, more favorable than steering decisions (vprod >>>
cST ). Table 7 shows the rewards, reservoir contact, and operating cost of all
three methods for scenario 3.
Table 7: Scenario 3 - Results for Greedy Optimization, DSDP, RL-Sensor Robust, and
RL-Sensor Best
Methods
Greedy
DSDP
RL-Sensor
RL-Sensor Best
Rewards Reservoir contact (%) Operating Cost
9.54
6.25
5.80
3.23
104.44
107.73
107.46
109.10
98.26
98.26
97.64
96.83
At vprod = 4, greedy optimization maximizes immediate reward by per-
forming a sidetrack whenever the well exits the reservoir, resulting in 98.26
percent reservoir contact. However, this strategy comes at a significant in-
crease in operating costs. On the other hand, the DSDP reaches the same
reservoir contact with fewer sidetracks, resulting in a higher average reward
of 107.73 compared to 104.4 for greedy optimization.
The RL-Sensor method achieves a reservoir contact of 97.64 percent but
Its average reward of
at a lower operating cost than the other methods.
107.46 is only 0.25 lower than the DSDP. However, this is the only scenario
where the RL-Sensor method cannot outperform the DSDP, which occurs
when the DSDP provides the least additional value over greedy optimiza-
tion. Nonetheless, the RL-Sensor Best achieves the highest reward among all
methods, with a reservoir contact of 96.83 percent and an operating cost of
3.23.
4.2.4. Discussion
The results from the second example provide additional evidence support-
ing our results that the RL-Sensor method outperforms greedy optimization.
28
This example effectively demonstrates the divergence in decision-making be-
tween the two methods. The greedy optimization makes sidetrack decisions
based solely on the value of vprod, whereby if it is lower than vST , greedy op-
timization always chooses to forego the sidetrack. On the other hand, greedy
optimization always chooses to sidetrack if vprod is higher than vST . On the
other hand, the sidetrack and overall decision-making policy of the RL-Sensor
method consider future values, leading to substantially higher rewards.
The results from all studied scenarios also indicate that the performance
of the RL-Sensor method is comparable to that of the DSDP, which is con-
sidered the quasi-optimal solution to the dynamic programming. In several
cases, the RL agent even outperforms the DSDP. One possible explanation
is that RL does not require discretization, unlike the DSDP, which may lead
to better performance. The absence of discretization in RL may enable it
to achieve more accurate results by avoiding information loss during the dis-
cretization process.
It is worth noting that there is one scenario where the RL-Sensor method
does not outperform the DSDP, although the difference is not statistically
significant. This scenario is where vprod is higher than vST , leading to a
preference for sidetracking over steering if the well exits the reservoir. One
plausible explanation is that sidetracking allows to adjust the well trajectory
by returning it to the center of the boundaries, thus mitigating the effects of
information loss caused by discretization.
In addition to comparable performance, the RL agent substantially re-
duces long-term computational costs compared to the DSDP. Specifically,
after training for approximately 20 minutes, the RL agent can evaluate 1000
reservoir realizations in less than 10 seconds. On the other hand, the current
discretization setup requires the DSDP to evaluate one realization in 15-20
seconds. The DSDP would take 4-5 hours to evaluate the same number of
reservoir realizations. These results suggest that RL may produce a more
computationally cost-efficient solution to the geosteering scenario than the
DSDP.
5. Conclusions
This study introduces and illustrates the application of reinforcement
learning (RL) as a flexible, robust, and computationally efficient sequential
decision-making tool in two distinct geosteering environments.
29
The results from the first example indicate that RL-Posterior method
suggests decisions that lead to significantly improved value function results
compared with greedy optimization, with a 19 to 33 percent increase de-
pending on the scenario. In addition to the RL-Posterior method, we intro-
duce an alternative method called the RL-Sensor method. The RL-Sensor
method ignores the posterior updates and relies on the inputs to the Bayesian
framework. The RL-Sensor method offers slightly better rewards than the
RL-Posterior method while significantly reducing the computational cost.
Specifically, the computation time is reduced from 2500 seconds to 500 sec-
onds.
Our results from the second example show that RL provides comparable
rewards to the DSDP, which we define as the quasi-optimal solution to dy-
namic programming. Notably, RL achieves these results with significantly
less computational cost. Specifically, the computation time for training an
RL decision-making agent and evaluating 1000 geomodel realizations is ap-
proximately 20 minutes (training) + 10 seconds (evaluating). On the other
hand, the DSDP requires 15 to 20 seconds for each realization, resulting in
approximately 4-5 hours to evaluate 1000 realizations. These results suggest
that RL is a promising alternative to the DSDP for optimizing geosteering
decision-making problems where computational efficiency is important.
We also highlight the ease of implementing RL method, which is inde-
pendent of the environment. The challenge lies in defining the appropriate
state representation to optimize the reward function for each environment.
As shown in our study, certain information may be relevant in one setting but
not another. For instance, inclination is included as one of the states in the
first environment but not in the second. Overall, the results show the flexi-
bility and potential of RL-based methods in optimizing complex geosteering
decision-making problems in various environments.
Our study assumes that the primary source of uncertainty in both en-
vironments is the reservoir boundaries and that there are no errors in the
sensor readings. In reality, geosteering decisions are made in the face of mul-
tiple uncertainties, and sensor readings have different levels of precision. To
address this limitation, future studies could explore the ability of RL in pro-
viding an efficient and robust geosteering decision-making strategy under any
number of uncertainties and can also deal with sensor reading errors. This
would provide a more realistic evaluation of the performance of RL method
and its potential for decision optimization in practical applications.
30
Acknowledgements
This work is part of the Center for Research-based Innovation DigiWells:
Digital Well Center for Value Creation, Competitiveness and Minimum En-
vironmental Footprint (NFR SFI project no. 309589, https://DigiWells.no).
The center is a cooperation of NORCE Norwegian Research Centre, the Uni-
versity of Stavanger, the Norwegian University of Science and Technology
It is funded by Aker BP, Cono-
(NTNU), and the University of Bergen.
coPhillips, Equinor, TotalEnergies, V ̊ar Energi, Wintershall Dea, and the
Research Council of Norway.
Declaration of generative AI and AI-assisted technologies in the
writing process
During the preparation of this work, the author(s) used ChatGPT in
order to improve the readability. After using this tool/service, the author(s)
reviewed and edited the content as needed and take(s) full responsibility for
the content of the publication.
References
Alyaev, S., Ivanova, S., Holsaeter, A., Bratvold, R.B., Bendiksen, M., 2021.
An interactive sequential-decision benchmark from geosteering. Applied
Computing and Geosciences 12, 100072. doi:https://doi.org/10.1016/
j.acags.2021.100072.
Alyaev, S., Suter, E., Bratvold, R.B., Hong, A., Luo, X., Fossum, K., 2019. A
decision support system for multi-target geosteering. Journal of Petroleum
Science and Engineering 183, 106381. doi:https://doi.org/10.1016/j.
petrol.2019.106381.
Bahlawan, H., Morini, M., Pinelli, M., Spina, P.R., 2019. Dynamic pro-
gramming based methodology for the optimization of the sizing and oper-
ation of hybrid energy plants. Applied Thermal Engineering 160, 113967.
doi:https://doi.org/10.1016/j.applthermaleng.2019.113967.
Bellman, R., 1966. Dynamic programming. Science 153, 34–37. doi:10.
1126/science.153.3731.34.
31
Bratvold, R., Begg, S., of Petroleum Engineers (U.S.), S., 2010. Making
Good Decisions. Society of Petroleum Engineers. URL: https://books.
google.co.id/books?id=d1kbkgAACAAJ.
Chen, Y., Lorentzen, R.J., Vefring, E.H., 2014. Optimization of Well Tra-
jectory Under Uncertainty for Proactive Geosteering. SPE Journal 20,
368–383. doi:10.2118/172497-PA.
Dixit, A., ElSheikh, A.H., 2022. Stochastic optimal well control in subsurface
reservoirs using reinforcement learning. Engineering Applications of Arti-
ficial Intelligence 114, 105106. doi:10.1016/j.engappai.2022.105106.
He, J., Tang, M., Hu, C., Tanaka, S., Wang, K., Wen, X.H., Nasir, Y.,
2022. Deep Reinforcement Learning for Generalizable Field Development
Optimization. SPE Journal 27, 226–245. doi:10.2118/203951-PA.
Kristoffersen, B.S., Silva, T.L., Bellout, M.C., Berg, C.F., 2021. Ef-
ficient well placement optimization under uncertainty using a virtual
drilling procedure. Computational Geosciences 26, 739–756. doi:10.1007/
s10596-021-10097-4.
Kullawan, K., Bratvold, R., Bickel, J., 2016a. Value creation with multi-
criteria decision making in geosteering operations. SPE Hydrocarbon Eco-
nomics and Evaluation Symposium doi:10.2118/169849-MS.
Kullawan, K., Bratvold, R., Bickel, J., 2018. Sequential geosteering decisions
for optimization of real-time well placement. Journal of Petroleum Science
and Engineering 165, 90–104. doi:https://doi.org/10.1016/j.petrol.
2018.01.068.
Kullawan, K., Bratvold, R.B., Nieto, C.M., 2016b. Decision-Oriented
Geosteering and the Value of Look-Ahead Information: A Case-Based
Study. SPE Journal 22, 767–782. doi:10.2118/184392-PA.
Liu, H., Zhu, D., Liu, Y., Du, A., Chen, D., Ye, Z., 2018. A reinforcement
learning based 3d guided drilling method: Beyond ground control, in: Pro-
ceedings of the 2018 VII International Conference on Network, Communi-
cation and Computing, Association for Computing Machinery, New York,
NY, USA. p. 44–48. doi:10.1145/3301326.3301374.
32
Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A.A., Veness, J., Bellemare,
M.G., Graves, A., Riedmiller, M., Fidjeland, A.K., Ostrovski, G., Pe-
tersen, S., Beattie, C., Sadik, A., Antonoglou, I., King, H., Kumaran,
D., Wierstra, D., Legg, S., Hassabis, D., 2015. Human-level control
through deep reinforcement learning. Nature 518, 529–533. doi:https:
//doi.org/10.1038/nature14236.
Nasir, Y., Durlofsky, L.J., 2022. Deep reinforcement learning for optimal
well control in subsurface systems with uncertain geology. arXiv preprint
doi:10.48550/ARXIV.2203.13375.
Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen,
T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang,
E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B.,
Fang, L., Bai, J., Chintala, S., 2019. Pytorch: An imperative style, high-
performance deep learning library, in: Advances in Neural Information
Processing Systems 32. Curran Associates, Inc., pp. 8024–8035.
Powell, W.B., 2009. What you should know about approximate dynamic
programming. Nav. Res. Logist. 56, 239–249. doi:https://doi.org/10.
1002/nav.20347.
Puterman, M.L., 1990. Chapter 8 markov decision processes, in: Stochas-
tic Models. Elsevier. volume 2 of Handbooks in Operations Research
and Management Science, pp. 331–434. doi:https://doi.org/10.1016/
S0927-0507(05)80172-0.
Sutton, R.S., Barto, A.G., 2018. Reinforcement Learning: An Introduction.
A Bradford Book, Cambridge, MA, USA.
Tsitsiklis, J., Van Roy, B., 1997. An analysis of temporal-difference learning
with function approximation. IEEE Transactions on Automatic Control
42, 674–690. doi:10.1109/9.580874.
Wang, X., He, H., Sun, F., Zhang, J., 2015. Application study on the dynamic
programming algorithm for energy management of plug-in hybrid electric
vehicles. Energies 8, 3225–3244. doi:10.3390/en8043225.
Zaccone, R., Ottaviani, E., Figari, M., Altosole, M., 2018.
Ship voy-
age optimization for safe and energy-efficient navigation: A dynamic
33
programming approach. Ocean Engineering 153, 215–224. doi:https:
//doi.org/10.1016/j.oceaneng.2018.01.100.
34
|
|
http://arxiv.org/abs/2310.04768v2 | "2023-10-10T01:55:28" | "2023-10-07T10:20:26" | Online Corrupted User Detection and Regret Minimization | In real-world online web systems, multiple users usually arrive sequentially
into the system. For applications like click fraud and fake reviews, some users
can maliciously perform corrupted (disrupted) behaviors to trick the system.
Therefore, it is crucial to design efficient online learning algorithms to
robustly learn from potentially corrupted user behaviors and accurately
identify the corrupted users in an online manner. Existing works propose bandit
algorithms robust to adversarial corruption. However, these algorithms are
designed for a single user, and cannot leverage the implicit social relations
among multiple users for more efficient learning. Moreover, none of them
consider how to detect corrupted users online in the multiple-user scenario. In
this paper, we present an important online learning problem named LOCUD to
learn and utilize unknown user relations from disrupted behaviors to speed up
learning, and identify the corrupted users in an online setting. To robustly
learn and utilize the unknown relations among potentially corrupted users, we
propose a novel bandit algorithm RCLUB-WCU. To detect the corrupted users, we
devise a novel online detection algorithm OCCUD based on RCLUB-WCU's inferred
user relations. We prove a regret upper bound for RCLUB-WCU, which
asymptotically matches the lower bound with respect to $T$ up to logarithmic
factors, and matches the state-of-the-art results in degenerate cases. We also
give a theoretical guarantee for the detection accuracy of OCCUD. With
extensive experiments, our methods achieve superior performance over previous
bandit algorithms and high corrupted user detection accuracy. | [
"Zhiyong Wang",
"Jize Xie",
"Tong Yu",
"Shuai Li",
"John C. S. Lui"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2310.04768v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2310.04768v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | 3
2
0
2
t
c
O
0
1
]
G
L
.
s
c
[
2
v
8
6
7
4
0
.
0
1
3
2
:
v
i
X
r
a
Online Corrupted User Detection and Regret
Minimization
Zhiyong Wang
The Chinese University of Hong Kong
zywang21@cse.cuhk.edu.hk
Jize Xie
Shanghai Jiao Tong University
xjzzjl@sjtu.edu.cn
Tong Yu
Adobe Research
worktongyu@gmail.com
Shuai Li∗
Shanghai Jiao Tong University
shuaili8@sjtu.edu.cn
John C.S. Lui
The Chinese University of Hong Kong
cslui@cse.cuhk.edu.hk
Abstract
In real-world online web systems, multiple users usually arrive sequentially into
the system. For applications like click fraud and fake reviews, some users can
maliciously perform corrupted (disrupted) behaviors to trick the system. There-
fore, it is crucial to design efficient online learning algorithms to robustly learn
from potentially corrupted user behaviors and accurately identify the corrupted
users in an online manner. Existing works propose bandit algorithms robust to
adversarial corruption. However, these algorithms are designed for a single user,
and cannot leverage the implicit social relations among multiple users for more
efficient learning. Moreover, none of them consider how to detect corrupted users
online in the multiple-user scenario. In this paper, we present an important on-
line learning problem named LOCUD to learn and utilize unknown user relations
from disrupted behaviors to speed up learning, and identify the corrupted users in
an online setting. To robustly learn and utilize the unknown relations among po-
tentially corrupted users, we propose a novel bandit algorithm RCLUB-WCU. To
detect the corrupted users, we devise a novel online detection algorithm OCCUD
based on RCLUB-WCU's inferred user relations. We prove a regret upper bound
for RCLUB-WCU, which asymptotically matches the lower bound with respect
to T up to logarithmic factors, and matches the state-of-the-art results in degen-
erate cases. We also give a theoretical guarantee for the detection accuracy of
OCCUD. With extensive experiments, our methods achieve superior performance
over previous bandit algorithms and high corrupted user detection accuracy.
1
Introduction
In real-world online recommender systems, data from many users arrive in a streaming fashion [4,
15, 2, 7, 35, 27, 26]. There may exist some corrupted (malicious) users, whose behaviors (e.g., click,
rating) can be adversarially corrupted (disrupted) over time to fool the system [29, 30, 12, 10, 9].
These corrupted behaviors could disrupt the user preference estimations of the algorithm. As a
result, the system would easily be misled and make sub-optimal recommendations [14, 23, 7, 41],
∗Corresponding author.
37th Conference on Neural Information Processing Systems (NeurIPS 2023).
which would hurt the user experience. Therefore, it is essential to design efficient online learning
algorithms to robustly learn from potentially disrupted behaviors and detect corrupted users in an
online manner.
There exist some works on bandits with adversarial corruption [29, 9, 22, 5, 12, 16]. However,
they have the following limitations. First, existing algorithms are initially designed for robust online
preference learning of a single user. In real-world scenarios with multiple users, they cannot robustly
infer and utilize the implicit user relations for more efficient learning. Second, none of them consider
how to identify corrupted users online in the multiple-user scenario. Though there also exist some
works on corrupted user detection [34, 6, 39, 28, 13], they all focus on detection with known user
information in an offline setting, thus can not be applied to do online detection from bandit feedback.
To address these limitations, we propose a novel bandit problem "Learning and Online Corrupted
Users Detection from bandit feedback" (LOCUD). To model and utilize the relations among users,
we assume there is an unknown clustering structure over users, where users with similar preferences
lie in the same cluster [8, 19, 21]. The agent can infer the clustering structure to leverage the
information of similar users for better recommendations. Among these users, there exists a small
fraction of corrupted users. They can occasionally perform corrupted behaviors to fool the agent [12,
29, 30, 9] while mimicking the behaviors of normal users most of the time to make themselves hard
to discover. The agent not only needs to learn the unknown user preferences and relations robustly
from potentially disrupted feedback, balance the exploration-exploitation trade-off to maximize the
cumulative reward, but also needs to detect the corrupted users online from bandit feedback.
The LOCUD problem is very challenging. First, the corrupted behaviors would cause inaccurate
user preference estimations, which could lead to erroneous user relation inference and sub-optimal
recommendations. Second, it is nontrivial to detect corrupted users online since their behaviors
are dynamic over time (sometimes regular while sometimes corrupted), whereas, in the offline set-
ting, corrupted users' information can be fully represented by static embeddings and the existing
approaches [18, 32] can typically do binary classifications offline, which are not adaptive over time.
We propose a novel learning framework composed of two algorithms to address these challenges.
RCLUB-WCU. To robustly estimate user preferences, learn the unknown relations from potentially
corrupted behaviors, and perform high-quality recommendations, we propose a novel bandit algo-
rithm "Robust CLUstering of Bandits With Corrupted Users" (RCLUB-WCU), which maintains a
dynamic graph over users to represent the learned clustering structure, where users linked by edges
are inferred to be in the same cluster. RCLUB-WCU adaptively deletes edges and recommends
arms based on aggregated interactive information in clusters. We do the following to ensure robust
clustering structure learning. (i) To relieve the estimation inaccuracy caused by disrupted behaviors,
we use weighted ridge regressions for robust user preference estimations. Specifically, we use the
inverse of the confidence radius to weigh each sample. If the confidence radius associated with user
it and arm at is large at t, the learner is quite uncertain about the estimation of it's preference on
at, indicating the sample at t is likely to be corrupted. Therefore, we use the inverse of the confi-
dence radius to assign minor importance to the possibly disrupted samples when doing estimations.
(ii) We design a robust edge deletion rule to divide the clusters by considering the potential effect
of corruptions, which, together with (i), can ensure that after some interactions, users in the same
connected component of the graph are in the same underlying cluster with high probability.
OCCUD. To detect corrupted users online, based on the learned clustering structure of RCLUB-
WCU, we devise a novel algorithm named "Online Cluster-based Corrupted User Detection" (OC-
CUD). At each round, we compare each user's non-robustly estimated preference vector (by ridge
regression) and the robust estimation (by weighted regression) of the user's inferred cluster. If the
gap exceeds a carefully-designed threshold, we detect this user as corrupted. The intuitions are as
follows. With misleading behaviors, the non-robust preference estimations of corrupted users would
be far from ground truths. On the other hand, with the accurate clustering of RCLUB-WCU, the ro-
bust estimations of users' inferred clusters should be close to ground truths. Therefore, for corrupted
users, their non-robust estimates should be far from the robust estimates of their inferred clusters.
We summarize our contributions as follows.
• We present a novel online learning problem LOCUD, where the agent needs to (i) robustly learn
and leverage the unknown user relations to improve online recommendation qualities under the
disruption of corrupted user behaviors; (ii) detect the corrupted users online from bandit feedback.
2
• We propose a novel online learning framework composed of two algorithms, RCLUB-WCU and
OCCUD, to tackle the challenging LOCUD problem. RCLUB-WCU robustly learns and utilizes the
unknown social relations among potentially corrupted users to efficiently minimize regret. Based on
RCLUB-WCU's inferred user relations, OCCUD accurately detects corrupted users online.
• We prove a regret upper bound for RCLUB-WCU, which matches the lower bound asymptotically
in T up to logarithmic factors and matches the state-of-the-art results in several degenerate cases.
We also give a theoretical performance guarantee for the online detection algorithm OCCUD.
• Experiments on both synthetic and real-world data clearly show the advantages of our methods.
2 Related Work
Our work is related to bandits with adversarial corruption and bandits leveraging user relations.
The work [29] first studies stochastic bandits with adversarial corruption, where the rewards are
corrupted with the sum of corruption magnitudes in all rounds constrained by the corruption level C.
They propose a robust elimination-based algorithm. The paper [9] proposes an improved algorithm
with a tighter regret bound. The paper [22] first studies stochastic linear bandits with adversarial
corruptions. To tackle the contextual linear bandit setting where the arm set changes over time, the
work [5] proposes a variant of the OFUL [1] that achieves a sub-linear regret. A recent work [12]
proposes the CW-OFUL algorithm that achieves a nearly optimal regret bound. All these works
focus on designing robust bandit algorithms for a single user; none consider how to robustly learn
and leverage the implicit relations among potentially corrupted users for more efficient learning.
Moreover, none of them consider how to online detect corrupted users in the multiple-user case.
Some works study how to leverage user relations to accelerate the bandit learning process in the
multiple-user case. The work [38] utilizes a known user adjacency graph to share context and payoffs
among neighbors. To adaptively learn and utilize unknown user relations, the paper [8] proposes the
clustering of bandits (CB) problem where there is an unknown user clustering structure to be learned
by the agent. The work [20] uses collaborative effects on items to guide the clustering of users.
The paper [19] studies the CB problem in the cascading bandit setting. The work [21] considers the
setting where users in the same cluster share both the same preference and the same arrival rate. The
paper [25] studies the federated CB problem, considering privacy and communication issues. All
these works only consider utilizing the relations among normal users; none of them consider how to
robustly learn the user relations from potentially disrupted behaviors, thus would easily be misled by
corrupted users. Also, none of them consider how to detect corrupted users from bandit feedback.
To the best of our knowledge, this is the first work to study the problem to (i) learn the unknown user
relations and preferences from potentially corrupted feedback, and leverage the learned relations to
speed up learning; (ii) adaptively detect the corrupted users online from bandit feedback.
3 Problem Setup
This section formulates the problem of "Learning and Online Corrupted Users Detection from ban-
x⊤M x, [m] = {1, . . . , m},
dit feedback" (LOCUD) (illustrated in Fig.1). We denote ∥x∥M =
number of elements in set A as |A|.
√
In LOCUD, there are u users, which we denote by set U = {1, 2, . . . , u}. Some of them are
corrupted users, denoted by set ̃U ⊆ U. These corrupted users, on the one hand, try to mimic
normal users to make themselves hard to detect; on the other hand, they can occasionally perform
corrupted behaviors to fool the agent into making sub-optimal decisions. Each user i ∈ U, no
matter a normal one or corrupted one, is associated with a (possibly mimicked for corrupted users)
preference feature vector θi ∈ Rd that is unknown and ∥θi∥2 ≤ 1. There is an underlying clustering
structure among all the users representing the similarity of their preferences, but it is unknown to
the agent and needs to be learned via interactions. Specifically, the set of users U can be partitioned
into m (m ≪ u) clusters, V1, V2, . . . Vm, where ∪j∈[m]Vj = U, and Vj ∩ Vj′ = ∅, for j ̸= j′. Users
in the same cluster have the same preference feature vector, while users in different clusters have
different preference vectors. We use θj to denote the common preference vector shared by users in
the j-th cluster Vj, and use j(i) to denote the index of cluster user i belongs to (i.e., i ∈ Vj(i)). For
3
any two users k, i ∈ U, if k ∈ Vj(i), then θk = θj(i) = θi; otherwise θk ̸= θi. We assume the arm
set A ⊆ Rd is finite. Each arm a ∈ A is associated with a feature vector xa ∈ Rd with ∥xa∥2 ≤ 1.
The learning process of the agent is as fol-
lows. At each round t ∈ [T ], a user
it ∈ U comes to be served, and the learn-
ing agent receives a set of arms At ⊆ A to
choose from. The agent infers the cluster
Vt that user it belongs to based on the in-
teraction history, and recommends an arm
at ∈ At according to the aggregated in-
formation gathered in the cluster Vt. After
receiving the recommended arm at, a nor-
mal user it will give a random reward with
expectation x⊤
at
θit to the agent.
To model the behaviors of corrupted users,
following [29, 9, 5, 12], we assume that
they can occasionally corrupt the rewards
to mislead the agent into recommending
sub-optimal arms. Specifically, at each
round t, if the current served user is a cor-
rupted user (i.e., it ∈ ̃U), the user can cor-
rupt the reward by ct.
In summary, we
model the reward received by the agent at
round t as
Figure 1: Illustration of LOCUD. The unknown user
relations are represented by dotted circles, e.g., user 3,
7 have similar preferences and thus can be in the same
user segment (i.e., cluster). Users 6 and 8 are corrupted
users with dynamic behaviors over time (e.g., for user
8, the behaviors are normal at t1 and t3 (blue), but
are adversarially corrupted at t2 and t4 (red)[29, 12]),
making them hard to be detected online. The agent
needs to learn user relations to utilize information
among similar users to speed up learning, and detect
corrupted users 6, 8 online from bandit feedback.
θit + ηt + ct ,
rt = x⊤
at
where ct = 0 if it is a normal user, (i.e., it /∈ ̃U), and ηt is 1-sub-Gaussian random noise.
As the number of corrupted users is usually small, and they only corrupt the rewards occasionally
with small magnitudes to make themselves hard to detect, we assume the sum of corruption magni-
tudes in all rounds is upper bounded by the corruption level C, i.e., (cid:80)T
We assume the clusters, users, and items satisfy the following assumptions. Note that all these
assumptions basically follow the settings from classical works on clustering of bandits [8, 19, 25,
36].
Assumption 1 (Gap between different clusters). The gap between any two preference vectors for
different clusters is at least an unknown positive constant γ
t=1 |ct| ≤ C [29, 9, 5, 12].
(cid:13)
(cid:13)
(cid:13)θj − θj′(cid:13)
(cid:13)
(cid:13)2
≥ γ > 0 , ∀j, j′ ∈ [m] , j ̸= j′ .
Assumption 2 (Uniform arrival of users). At each round t, a user it comes uniformly at random
from U with probability 1/u, independent of the past rounds.
Assumption 3 (Item regularity). At each round t, the feature vector xa of each arm a ∈ At is drawn
independently from a fixed unknown distribution ρ over {x ∈ Rd : ∥x∥2 ≤ 1}, where Ex∼ρ[xx⊤]'s
minimal eigenvalue λx > 0. At ∀t, for any fixed unit vector z ∈ Rd, (θ⊤z)2 has sub-Gaussian tail
with variance no greater than σ2.
t ∈ arg maxa∈Atx⊤
Let a∗
One objective of the learning agent is to minimize the expected cumulative regret
a θit denote an optimal arm with the highest expected reward at round t.
R(T ) = E[(cid:80)T
t=1(x⊤
a∗
t
Another objective is to detect corrupted users online accurately. Specifically, at round t, the agent
will give a set of users ̃Ut as the detected corrupted users, and we want ̃Ut to be as close to the
ground-truth set of corrupted users ̃U as possible.
θit − x⊤
at
θit)] .
(1)
4 Algorithms
This section introduces our algorithms RCLUB-WCU (Algo.1) and OCCUD (Algo.2). RCLUB-
WCU robustly learns the unknown user clustering structure and preferences from corrupted feed-
4
18765432187654321876543218765432back, and leverages the cluster-based information to accelerate learning. Based on the clustering
structure learned by RCLUB-WCU, OCCUD can accurately detect corrupted users online.
Algorithm 1 RCLUB-WCU
1: Input: Regularization parameter λ, confidence radius parameter β, threshold parameter α, edge
deletion parameter α1, f (T ) = (cid:112)(1 + ln(1 + T ))/(1 + T ).
2: Initialization: M i,0 = 0d×d, bi,0 = 0d×1, ̃M i,0 = 0d×d, ̃bi,0 = 0d×1, Ti,0 = 0 , ∀i ∈ U;
A complete graph G0 = (U, E0) over U.
3: for all t = 1, 2, . . . , T do
4:
5:
i∈Vt
M i,t−1 , bVt,t−1 = (cid:80)
Receive the index of the current served user it ∈ U, get the feasible arm set at this round At.
Determine the connected components Vt in the current maintained graph Gt−1 = (U, Et−1)
such that it ∈ Vt.
Calculate the robustly estimated statistics for the cluster Vt:
M Vt,t−1 = λI + (cid:80)
Select an arm at with largest UCB index in Eq.(3) and receive the corresponding reward rt;
Update the statistics for robust estimation of user it:
M it,t = M it,t−1 + wit,t−1xatx⊤
at
it,t = λI + M it,t, ˆθit,t = M ′−1
M ′
it,t bit,t , wit,t = min{1, α/∥xat∥M ′−1
Keep robust estimation statistics of other users unchanged:
M l,t = M l,t−1, bl,t = bl,t−1, Tl,t = Tl,t−1 , ˆθl,t = ˆθl,t−1, for all l ∈ U, l ̸= it;
Delete the edge (it, l) ∈ Et−1, if
, bit,t = bit,t−1 + wit,t−1rtxat , Tit,t = Tit,t−1 + 1 ,
bi,t−1 , ˆθVt,t−1 = M −1
Vt,t−1bVt,t−1 ;
i∈Vt
} ;
it,t
6:
7:
8:
9:
10:
(cid:13)
ˆθit,t − ˆθl,t
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
≥ α1
(cid:0)f (Tit,t) + f (Tl,t) + αC(cid:1) ,
and get an updated graph Gt = (U, Et);
Use the OCCUD Algorithm (Algo.2) to detect the corrupted users.
11:
12: end for
4.1 RCLUB-WCU
The corrupted behaviors may cause inaccurate preference estimations, leading to erroneous relation
inference and sub-optimal decisions. In this case, how to learn and utilize unknown user relations to
accelerate learning becomes non-trivial. Motivated by this, we design RCLUB-WCU as follows.
Assign the inferred cluster Vt for user it. RCLUB-WCU maintains a dynamic undirected graph
Gt = (U, Et) over users, which is initialized to be a complete graph (Algo.1 Line 2). Users with
similar learned preferences will be connected with edges in Et. The connected components in the
graph represent the inferred clusters by the algorithm. At round t, user it comes to be served with
a feasible arm set At for the agent to choose from (Line 4). In Line 5, RCLUB-WCU detects the
connected component Vt in the graph containing user it to be the current inferred cluster for it.
Robust preference estimation of cluster Vt. After determining the cluster Vt, RCLUB-WCU esti-
mates the common preferences for users in Vt using the historical feedback of all users in Vt and rec-
ommends an arm accordingly. The corrupted behaviors could cause inaccurate preference estimates,
which can easily mislead the agent. To address this, inspired by [40, 12], we use weighted ridge re-
gression to make corruption-robust estimations. Specifically, RCLUB-WCU robustly estimates the
common preference vector of cluster Vt by solving the following weighted ridge regression
ˆθVt,t−1 = arg min
θ∈Rd
(cid:80)
s∈[t−1]
is∈Vt
wis,s(rs − x⊤
as
θ)2 + λ ∥θ∥2
2 ,
(2)
where λ > 0 is a regularization coefficient. Its closed-form solution is ˆθVt,t−1 = M −1
where M Vt,t−1 = λI + (cid:80)
as, bVt,t−1 = (cid:80)
wis,sxasx⊤
wis,srasxas .
Vt,t−1bVt,t−1 ,
s∈[t−1]
is∈Vt
s∈[t−1]
is ∈Vt
}, where
We set the weight of sample for user is in Vt at round s as wis,s = min{1, α/ ∥xas∥M ′−1
α is a coefficient to be determined later. The intuitions of designing these weights are as follows.
is the confidence radius of arm as for user is at s, reflecting how confident
The term ∥xas∥M ′−1
the algorithm is about the estimation of is's preference on as at s. If ∥xas ∥M ′−1
is large, it means
the agent is uncertain of user is's preference on as, indicating this sample is probably corrupted.
is,s
is ,s
is,s
5
Therefore, we use the inverse of confidence radius to assign a small weight to this round's sample if
it is potentially corrupted. In this way, uncertain information for users in cluster Vt is assigned with
less importance when estimating the Vt's preference vector, which could help relieve the estimation
inaccuracy caused by corruption. For technical details, please refer to Section 5.1 and Appendix.
Recommend at with estimated preference of cluster Vt. Based on the corruption-robust pref-
erence estimation ˆθVt,t−1 of cluster Vt, in Line 7, the agent recommends an arm using the upper
confidence bound (UCB) strategy to balance exploration and exploitation
at = argmaxa∈Atx⊤
a
ˆθVt,t−1 + β ∥xa∥M −1
Vt,t−1
≜ ˆRa,t + Ca,t ,
(3)
√
(cid:113)
λ+
λd )+αC is the confidence radius parameter, ˆRa,t denotes
where β =
the estimated reward of arm a at t, Ca,t denotes the confidence radius of arm a at t. The design of
Ca,t theoretically relies on Lemma 2 that will be given in Section 5.
δ ) + d log(1 + T
2 log( 1
Update the robust estimation of user it. After receiving rt, the algorithm updates the estimation
statistics of user it, while keeping the statistics of others unchanged (Line 8 and Line 9). Specifically,
RCLUB-WCU estimates the preference vector of user it by solving a weighted ridge regression
ˆθit,t = arg min
θ∈Rd
(cid:80)
s∈[t]
is=it
wis,s(rs − x⊤
as
θ)2 + λ ∥θ∥2
2
(4)
with closed-form solution ˆθit,t = (λI + M it,t)−1bit,t , where M it,t = (cid:80)
wis,sxas x⊤
as,
bit,t = (cid:80)
wis,sras xas , and we design the weights in the same way by the same reasoning.
Update the dynamic graph. Finally, with the updated statistics of user it, RCLUB-WCU checks
s∈[t]
is=it
s∈[t]
is=it
Algorithm 2 OCCUD (At round t, used in Line 11 in Algo.1)
1: Initialize ̃Ut = ∅; input probability parameter δ.
2: Update the statistics for non-robust estimation of user it
̃M it,t = ̃M it,t−1 + xatx⊤
at , ̃bit,t = ̃bit,t−1 + rtxat , ̃θit,t = (λI + ̃M it,t)−1 ̃bit,t ,
3: Keep non-robust estimation statistics of other users unchanged
̃M l,t = ̃M l,t−1, ̃bl,t = ̃bl,t−1, ̃θl,t = ̃θl,t−1, for all l ∈ U, l ̸= it .
4: for all connected component Vj,t ∈ Gt do
5:
Calculate the robust estimation statistics for the cluster Vj,t:
M Vj,t,t = λI + (cid:80)
bVj,t,t = (cid:80)
for all user i ∈ Vj,t do
bl,t , ˆθVj,t,t = M −1
M l,t , TVj,t,t = (cid:80)
Vj,t,tbVj,t,t ;
Tl,t ,
l∈Vj,t
l∈Vj,t
l∈Vj,t
6:
7:
Detect user i to be a corrupted user and add user i to the set ̃Ut if the following holds:
(cid:113)
(cid:13)
(cid:13)
(cid:13)
̃θi,t − ˆθVi,t,t
(cid:13)
(cid:13)
(cid:13)2
>
d log(1 + Ti,t
(cid:113)
λd ) + 2 log( 1
λmin( ̃M i,t) + λ
δ ) +
(cid:113)
√
λ
+
d log(1 +
TVi,t,t
λd
(cid:113)
) + 2 log( 1
δ ) +
√
λ + αC
,
λmin(M Vi,t,t)
where λmin(*) denotes the minimum eigenvalue of the matrix argument.
end for
8:
9: end for
(5)
whether the inferred it's preference similarities with other users are still true, and updates the graph
accordingly. Precisely, if gap between the updated estimation ˆθit,t of it and the estimation ˆθl,t of
user l exceeds a threshold in Line 10, RCLUB-WCU will delete the edge (it, l) in Gt−1 to split them
apart. The threshold is carefully designed to handle the estimation uncertainty from both stochastic
noises and potential corruptions. The updated graph Gt = (U, Et) will be used in the next round.
4.2 OCCUD
Based on the inferred clustering structure of RCLUB-WCU, we devise a novel online detection
algorithm OCCUD (Algo.2). The design ideas and process of OCCUD are as follows.
6
Besides the robust preference estimations (with weighted regression) of users and clusters kept by
RCLUB-WCU, OCCUD also maintains the non-robust estimations for each user by online ridge
regression without weights (Line 2 and Line 3). Specifically, at round t, OCCUD updates the non-
robust estimation of user it by solving the following online ridge regression:
with solution ̃θit,t = (λI + ̃M it,t)
(cid:80)
̃θit,t = arg min
θ∈Rd
−1 ̃bit,t , where ̃M it,t = (cid:80)
(rs − x⊤
as
s∈[t]
is=it
θ)2 + λ ∥θ∥2
2 ,
xas x⊤
as , ̃bit,t = (cid:80)
ras xas .
s∈[t]
is=it
s∈[t]
is=it
(6)
With the robust and non-robust preference estimations, OCCUD does the following to detect cor-
rupted users based on the clustering structure inferred by RCLUB-WCU. First, OCCUD finds the
connected components in the graph kept by RCLUB-WCU, which represent the inferred clusters.
Then, for each inferred cluster Vj,t ∈ Gt: (1) OCCUD computes its robustly estimated preferences
vector ˆθVi,t,t (Line 5). (2) For each user i whose inferred cluster is Vj,t (i.e.,i ∈ Vj,t), OCCUD
computes the gap between user i's non-robustly estimated preference vector ̃θi,t and the robust es-
timation ˆθVi,t,t for user i's inferred cluster Vj,t. If the gap exceeds a carefully-designed threshold,
OCCUD will detect user i as corrupted and add i to the detected corrupted user set ̃Ut (Line 7).
(a) RCLUB-WCU
(b) OCCUD
Figure 2: Algorithm illustrations. Users 6 and 8 are corrupted users (orange), and the others are
normal (green). (a) illustrates RCLUB-WCU, which starts with a complete user graph, and adap-
tively deletes edges between users (dashed lines) with dissimilar robustly learned preferences. The
corrupted behaviors of users 6 and 8 may cause inaccurate preference estimations, leading to erro-
neous relation inference. In this case, how to delete edges correctly is non-trivial, and RCLUB-WCU
addresses this challenge (detailed in Section 4.1). (b) illustrates OCCUD at some round t, where per-
son icons with triangle hats represent the non-robust user preference estimations. The gap between
the non-robust estimation of user 6 and the robust estimation of user 6's inferred cluster (circle C1)
exceeds the threshold r6 at this round (Line 7 in Algo.2), so OCCUD detects user 6 to be corrupted.
The intuitions of OCCUD are as follows. On the one hand, after some interactions, RCLUB-WCU
will infer the user clustering structure accurately. Thus, at round t, the robust estimation ˆθVi,t,t for
user i's inferred cluster should be pretty close to user i's ground-truth preference vector θi. On the
other hand, since the feedback of normal users are always regular, at round t, if user i is a normal
user, the non-robust estimation ̃θi,t should also be close to the ground-truth θi. However, the non-
robust estimation of a corrupted user should be quite far from the ground truth due to corruptions.
Based on this reasoning, OCCUD compares each user's non-robust estimation and the robust esti-
mation of the user's inferred cluster to detect the corrupted users. For technical details, please refer
to Section 5.2 and Appendix. Simple illustrations of our proposed algorithms can be found in Fig.2.
5 Theoretical Analysis
In this section, we theoretically analyze the performances of our proposed algorithms, RCLUB-
WCU and OCCUD. Due to the page limit, we put the proofs in the Appendix.
5.1 Regret Analysis of RCLUB-WCU
This section gives an upper bound of the expected regret (defined in Eq.(1)) for RCLUB-WCU.
The following lemma provides a sufficient time T0(δ), after which RCLUB-WCU can cluster all the
users correctly with high probability.
7
18765432187654321876543237156842Lemma 1. With probability at least 1 − 3δ, RCLUB-WCU will cluster all the users correctly after
T0(δ) ≜ 16u log(
u
δ
) + 4u max{
288d
√
log(
γ2α
λ ̃λx
0 (1 − e− (λx−x)2
2σ2
for some δ ∈ (0, 1
3 ), where ̃λx ≜ (cid:82) λx
)Kdx, |At| ≤ K, ∀t ∈ [T ].
√
u
δ
),
16
̃λ2
x
log(
8d
̃λ2
xδ
),
λ
72
αγ2 ̃λx
,
72αC 2
√
λ ̃λx
γ2
}
After T0(δ), the following lemma gives a bound of the gap between ˆθVt,t−1 and the ground-truth
θit in direction of action vector xa for RCLUB-WCU, which supports the design in Eq.(3).
Lemma 2. With probability at least 1 − 4δ for some δ ∈ (0, 1
4 ), ∀t ≥ T0(δ), we have:
(cid:12)
(cid:12)xT
(cid:12)
(cid:12)
a (ˆθVt,t−1 − θit)
(cid:12)
(cid:12) ≤ β ∥xa∥M −1
Vt,t−1
≜ Ca,t .
With Lemma 1 and 2, we prove the following theorem on the regret upper bound of RCLUB-WCU.
Theorem 3 (Regret Upper Bound of RCLUB-WCU). With the assumptions in Section 3, and
picking α =
, the expected regret of the RCLUB-WCU algorithm for T rounds satisfies
√
√
λ
d+
C
R(T ) ≤ O(cid:0)(
√
C
d
γ2 ̃λx
+
1
̃λ2
x
)u log(T )(cid:1) + O(cid:0)d
√
mT log(T )(cid:1) + O(cid:0)mCd log1.5(T )(cid:1) .
(7)
Discussion and Comparison. The regret bound in Eq.(7) has three terms. The first term is the time
needed to get enough information for accurate robust estimations such that RCLUB-WCU could
cluster all users correctly afterward with high probability. This term is related to the corruption
level C, which is inevitable since, if there are more corrupted user feedback, it will be harder for the
algorithm to learn the clustering structure correctly. The last two terms correspond to the regret after
T0 with the correct clustering. Specifically, the second term is caused by stochastic noises when
leveraging the aggregated information within clusters to make recommendations; the third term
associated with the corruption level C is the regret caused by the disruption of corrupted behaviors.
When the corruption level C is unknown, we can use its estimated upper bound ˆC ≜
T to replace
C in the algorithm. In this way, if C ≤ ˆC, the bound will be replacing C with ˆC in Eq.(7); when
T , R(T ) = O(T ), which is already optimal for a large class of bandit algorithms [12].
C >
√
√
The following theorem gives a regret lower bound of the LOCUD problem.
Theorem 4 (Regret lower bound for LOCUD). There exists a problem instance for the LOCUD
problem such that for any algorithm
√
R(T ) ≥ Ω(d
mT + dC) .
Its proof and discussions can be found in Appendix D. The upper bound in Theorem 3 asymptotically
matches this lower bound in T up to logarithmic factors, showing our regret bound is nearly optimal.
We then compare our regret upper bound with several degenerated cases. First, when C = 0, i.e.,
all users are normal, our setting degenerates to the classic CB problem [8]. In this case the bound
in Theorem 3 becomes O(1/ ̃λ2
mT log(T )), perfectly matching the state-of-
the-art results in CB [8, 19, 21]. Second, when m = 1 and u = 1, i.e., there is only one user, our
setting degenerates to linear bandits with adversarial corruptions [22, 12], and the bound in Theorem
T log(T )) + O(Cd log1.5(T )), it also perfectly matches the nearly optimal result
3 becomes O(d
in [12]. The above comparisons also show the tightness of the regret bound of RCLUB-WCU.
x * u log(T )) + O(d
√
√
5.2 Theoretical Performance Guarantee for OCCUD
The following theorem gives a performance guarantee of the online detection algorithm OCCUD.
Theorem 5 (Theoretical Guarantee for OCCUD). With assumptions in Section 3, at ∀t ≥ T0(δ),
for any detected corrupted user i ∈ ̃Ut, with probability at least 1 − 5δ, i is indeed a corrupted user.
This theorem guarantees that after RCLUB-WCU learns the clustering structure accurately, with
high probability, the corrupted users detected by OCCUD are indeed corrupted, showing the high
detection accuracy of OCCUD. The proof of Theorem 5 can be found in Appendix D.
8
6 Experiments
This section shows experimental results on synthetic and real data to evaluate RCLUB-WCU's rec-
ommendation quality and OCCUD's detection accuracy. We compare RCLUB-WCU to LinUCB
[1] with a single non-robust estimated vector for all users, LinUCB-Ind with separate non-robust
estimated vectors for each user, CW-OFUL [12] with a single robust estimated vector for all users,
CW-OFUL-Ind with separate robust estimated vectors for each user, CLUB[8], and SCLUB[21].
More description of these baselines are in Appendix F. To show that the design of OCCUD is non-
trivial, we develop a straightforward detection algorithm GCUD, which leverages the same cluster
(cid:13)
(cid:13)
structure as OCCUD but detects corrupted users by selecting users with highest
(cid:13)2
in each inferred cluster. GCUD selects users according to the underlying percentage of corrupted
users, which is unrealistic in practice, but OCCUD still performs better in this unfair condition.
(cid:13)
ˆθi,t − ˆθVi,t,t−1
(cid:13)
(cid:13)
Remark. The offline detection methods [39, 6, 18, 32] need to know all the user information in
advance to derive the user embedding for classification, so they cannot be directly applied in online
detection with bandit feedback thus cannot be directly compared to OCCUD. However, we observe
the AUC achieved by OCCUD on Amazon and Yelp (in Tab.1) is similar to recent offline methods
[18, 32]. Additionally, OCCUD has rigorous theoretical performance guarantee (Section 5.2).
6.1 Experiments on Synthetic Dataset
We use u = 1, 000 users and m = 10 clusters, where each cluster contains 100 users. We randomly
select 100 users as the corrupted users. The preference and arm (item) vectors are drawn in d − 1
(d = 50) dimensions with each entry a standard Gaussian variable and then normalized, added one
√
2 [21]. We fix an arm set with |A| = 1000 items,
more dimension with constant 1, and divided by
at each round, 20 items are randomly selected to form a set At to choose from. Following [40, 3],
in the first k rounds, we always flip the reward of corrupted users by setting rt = −xT
θit,t + ηt.
at
And we leave the remaining T − k rounds intact. Here we set T = 1, 000, 000 and k = 20, 000.
(a) Synthetic
(b) Movielens
(c) Amazon
(d) Yelp
Figure 3: Recommendation results on the synthetic and real-world datasets
Fig.3(a) shows the recommendation results. RCLUB-WCU outperforms all baselines and achieves
a sub-linear regret. LinUCB and CW-OFUL perform worst as they ignore the preference differences
among users. CW-OFUL-Ind outperforms LinUCB-Ind because it considers the corruption, but
worse than RCLUB-WCU since it does not consider leveraging user relations to speed up learning.
The detection results are shown in Tab.1. We test the AUC of OCCUD and GCUD in every 200, 000
rounds. OCCUD's performance improves over time with more interactions, while GCUD's perfor-
mance is much worse as it detects corrupted users only relying on the robust estimations. OCCUD
finally achieves an AUC of 0.855, indicating it can identify most of the corrupted users.
6.2 Experiments on Real-world Datasets
We use three real-world data Movielens [11], Amazon[31], and Yelp [33]. The Movielens data does
not have the corrupted users' labels, so following [24], we manually select the corrupted users. On
Amazon data, following [39], we label the users with more than 80% helpful votes as normal users,
and label users with less than 20% helpful votes as corrupted users. The Yelp data contains users
and their comments on restaurants with true labels of the normal users and corrupted users.
We select 1,000 users and 1,000 items for Movielens; 1,400 users and 800 items for Amazon; 2,000
users and 2,000 items for Yelp. The ratios of corrupted users on these data are 10%, 3.5%, and
9
0.00.20.40.60.81.0 5 R X Q G1e602468 & |