Task Discovery: Finding the Tasks that Neural Networks Generalize on
Anonymous Author(s)
AffiliationAddress
Abstract
When developing deep learning models, we usually decide what task we want tosolve then search in the space of models in order to design one that generalizeswell on this task.
An intriguing question would be: what if, instead of fixing thetask and searching in the model space, we fix the model and search in the taskspace?
Can we find tasks that the model generalizes on?
How do they look, or dothey indicate anything?
This is the question we address in this paper.
We propose a task discoveryframework that automatically finds examples of such tasks via optimizing ageneralization-based quantity called agreement score .
With this framework, wedemonstrate that the same set of images can give rise to many tasks on whichneural networks generalize well.
The understandings from task discovery can alsoprovide a tool to shed more light on deep learning and its failure modes: as anexample, we show that the discovered tasks can be used to generate “adversarialtrain-test splits" which make a model fail at test time, without changing the pixelsor labels, but by only selecting how the datapoints should be split between trainingand testing.
Introduction
Deep learning models are found to generalize well, i.e. exhibit low test error, when trained on humanlabelled tasks (e.g., the “real” human-labelled task in Fig. 1).
This can be seen as a consequence ofthe models’ inductive biases that favour solutions with low test error over those which also have zerotraining loss but higher test error.
In this paper, we aim to find what are examples of other tasks 1 thatare preferred by neural networks, i.e., on which they generalize well.
We define a quantity called agreement score to measure how well a network generalizes on a task.
Itindicates whether two networks trained on the same task with different training stochasticity (e.g.,initialization) make similar predictions on new test images.
We show that it, indeed, makes for auseful metric and differentiates between human- and random-labelled tasks (see Fig. 1).
Intuitively,a high agreement score can be seen as a necessary condition for generalization, as there cannot begeneralization if the agreement score is low and networks converge to different solutions.
On theother hand, if the agreement is high, then there is a stable solution that different networks converge to,and, therefore, generalization is possible.
Based on the agreement score as a prerequisite of generalization, we develop a task discovery framework that optimizes it and finds new tasks on which neural networks generalize well.
Experimentally,
A R a n d o ml a b e ll e d T a s k
[Table]
A H u m a nl a b e ll e d T a s k
A D
i s c
o v e r e d
T a s k <latexit sha1_base64="
[Table]
[Figure] we found that the same images can allow for many different tasks on which different networkarchitectures generalize well (see an example in Fig. 1).
Finally, we show how the proposed framework can help us understand deep learning better bydemonstrating its failure modes.
We use the discovered tasks to split a dataset into a train-test split inan adversarial way.
After training on this train set, the network fails to make correct predictions onthe test set.
Unlike manually created benchmarks that reveals similar failing behaviour [54, 31, 65]or pixel-level adversarial attacks [58, 26, 38], the proposed approach finds the adversarial splitautomatically and does not need to change image pixels.
Related Work
Deep learning generalization.
It is not well understood yet why deep neural networks generalizewell in practice while being overparameterized and having large complexity [17, 14, 46, 67, 62].
Aline of work approach this question by investigating the role of the different components of deeplearning [1, 44, 2, 1, 40, 69, 59, 13] and developing novel complexity measures that could predictneural networks’ generalization [45, 20, 30, 41, 56].
The proposed task discovery framework canserve as an experimental tool to shed more light on when and how deep learning models generalize.
Similarity measures between networks.
Measuring how similar two networks are is challengingand depends on a particular application.
Two common approaches are to measure the similaritybetween hidden representations [29, 24, 27, 53, 28, 40] and the predictions made on unseen data [57].
Similar to our work, [13, 18, 51] also use the AS measure.
In contrast to these works, which mainlyuse the AS as a metric, we turn it into an optimization objective to find new tasks with the desiredproperty of good generalization.
Bias-variance decomposition.
The test, which is commonly used to measure generalization, can bedecomposed into bias and variance, known as the bias-variance decomposition [12, 5, 60, 9].
Recentworks investigate how both terms behave for modern deep learning models [4, 42, 66, 43].
Theagreement score used in this work can be seen as a measure of the variance in this decomposition.
We, however, characterize its dependence on the task being learned instead of the model’s complexityand find the tasks that maximizes it.
Meta-optimization.
Meta-optimization methods seek to optimize the parameters of another optimization method.
They are commonly used for hyper-parameter tuning [37, 32, 50, 3] and gradient-basedmeta-learning [11, 64, 48].
We use meta-optimization to find the task parameters that maximizethe agreement score, computation of which involves training two networks on this task.
Metaoptimization methods are memory and computationally expensive, and multiple solutions weredeveloped [34, 36, 47] to amortize these costs, which can also be applied to improve the efficiency ofthe proposed task discovery framework.
Creating distribution shifts.
Distributions shifts can result from e.g. spurious correlations, undersampling [65] or adversarial attacks [58, 26, 38].
To create such shifts to, e.g., study the failure modesof networks, one needs to manually define them [54, 31].
We show that it is possible to create manysuch shifts automatically on a given dataset using the discovered tasks.
The network’s accuracydrops significantly (from 0.8 to 0.2) under these shifts (see Sec.
5.3, Fig. 5).
Agreement Score: Measuring Consistency of Labeling Unseen Data
In this section, we introduce the basis for the task discovery framework: a task definition and ameasure of a task generalizability, the agreement score.
We, further, provide an empirical analysis ofthe agreement score and demonstrate that it differentiates two types of tasks: human-labelled real andrandom-labelled tasks.
Notation and Definitions.
Given a set of N images X = { x i } Ni =1 , x ∈ X , we define a task as abinary labelling of this set τ : X → { 0 , 1 } (a multi-class extension is straightforward).
We denotethe corresponding labelled dataset as D ( X, τ ) =
{ ( x, τ ( x )) | x ∈ X } and the set of all possible taskson X as T X .
As a learning algorithm A , we consider a neural network f ( · ; w ) :
X → [0 , 1] withweights w trained by gradient optimization on a dataset D ( X, τ ) with cross-entropy loss.
Due tothe inherent stochasticity, such as random initialization and mini-batching, this learning algorithminduces a distribution over the weights given a dataset w ∼ A
( D ( X, τ )) .
3.1 Agreement Score as a Measure of Generalization
A standard approach to measure how well a learning algorithm
A generalizes when given a trainingdataset D ( X tr , τ ) is to measure the test error on D ( X te , τ ) .
It can be decomposed into bias andvariance terms [5, 60, 9], where, in our case, the stochasticity is w.r.t.
A and the train-test split isfixed .
Most works study how this decomposition depends on the choice of A [43, 66], whereas weexamine its dependence on τ for a fixed A .
The bias term measures how much the average predictiondeviates from τ and can be simply set to zero by only changing the task’s test labels on X te .
Thevariance term captures how predictions of different models agree with each other and does not dependon task’s test labels, but only on training labels through D ( X tr , τ ) .
We, therefore, suggest to measurethe generalizability of a task τ with an agreement score , as defined below.
For given train-test splits X tr , X te and a task τ , we define the agreement score (AS) as:
[Equation]
where the first expectation is over different models trained on D ( X tr , τ ) and the inner expectationis averaging over the test set.
Practically, this corresponds to training two networks from differentinitializations on the training dataset labelled by τ and measuring the agreement between these twomodels’ predictions on the test set (see the inner-loop in Fig. 3).
The agreement score (Eq. 1) depends only on the task’s training labels and no test labels are needed.
It, however, is tightly connected to the test error, and having a high-AS task τ that labels trainingdata, one can construct a task with high test accuracy (see Appendix A).
Note, however, that whenthe task is given, the high-AS provides only a necessary but not a sufficient condition for high testaccuracy as test labels can take any values in general (e.g., be adversarial as in Sec. 5), and, thus, itcannot be used to predict the test accuracy in this case [18, 23].
3.2 Agreement Score Behaviour for Random and Real Tasks
Here we demonstrate that the agreement score exhibits the desired behaviour of differentiatinghuman-labelled real from random-labelled tasks.
We take the set of images X from CIFAR-10 dataset[25] and split the original training set into 45K images for X tr and 5K for X te .
We split 10 originalclasses differently into two sets of 5 classes to construct 5-vs-5 binary classification tasks τ r , out of all(cid:0) 10(cid:1) tasks we randomly sub-sample 20 ones to form the set of real tasks T Real
= { τ r } .
We constructthe set of 20 random tasks T Rnd , by generating a binary label for each image randomly and fixingthem throughout the training, similar to [68].
We use ResNet-18 [16] architecture and Adam [22]optimizer as the learning algorithm A , unless otherwise specified.
We measure the AS by trainingtwo networks for 100 epochs, which is enough to achieve zero training error for all considered tasks.
AS differentiates real tasks from random.
Fig.
1 shows that real tasks have higher AS than randomones.
This coincides with our intuition that one should not expect generalization on a random task,for which AS is close to the chance level of 0.5.
Note, however, that random tasks are just samplesfrom T X tr (which also includes real ones) and the corresponding empirical distribution of AS (Fig.
2)is an unbiased estimation of the AS distribution over T X tr , suggesting that high-AS tasks do not makefor a large fraction of all tasks.
A high AS of real tasks is also consistent with the understanding thata network is able to generalize when trained on CIFAR-10 labels.
How does the AS differ across architectures?
In addition to ResNet, we measure the agreementscore for real and random tasks using MLP [57] and ViT architectures [10] (see Appendix B).
Fig.
2shows that the AS for all the architectures differentiates real and random tasks well.
MLP and ViThave lower AS than ResNet-18, aligned with our understanding that convolutional networks shouldexhibit better generalization on this small dataset due to their architectural inductive biases.
Similar tothe architectural analysis, we provide the analysis on the data-dependence of the AS in Appendix H.
How does the AS depend on the training size?
When too little data is available for training, onecould expect the stochasticity in A to play a bigger role than data, i.e., the agreement score decreaseswith less data.
This intuition is consistent with empirical evidences on real tasks as can be seen in
Fig.
However, for random tasks, the AS increases with less data.
One possible conjecture is thatwhen training dataset is too small, two networks deviate less from their initializations, which giverise to similar tasks resulting in a high AS.
Any stochasticity is enough to provide differentiation.
We ablate the three sources of stochasticityin A : 1) initialization, 2) data-order and 3) CUDA stochasticity [19].
With all three sources fixed,the system is fully deterministic and AS = 1 .
Interestingly, we found that when any of these variableschange between two runs, the AS drops creating the same separation between real and random tasks.
Thse emperical observations show that the AS differentiate between real and random tasks acrossmultiple architectures, dataset sizes and the sources of stochasticity.
Task Discovery via Meta-Optimization of the Agreement Score
As we saw in the previous section, AS provides a useful measure of how well a network can generalizeon a given task.
A natural question that arises then: are there high-AS tasks other than real (i.e.,human-labelled) ones and what are they?
In this section, we establish a task discovery framework tostudy this question computationally.
4.1 Task Space parametrization and Agreement Score Meta-Optimization
Our goal is to find a task τ that maximizes AS( τ ) , which is a high-dimensional discrete optimizationproblem.
In order to make it differentiable and utilize first-order optimization methods, we, first, substitute the 0-1 loss in Eq.
1 with the cross-entropy loss l ce .
Then, we parameterize the space oftasks with a task-network t θ : X → { 0 , 1 } and treat the AS as a function of its parameters θ .
Given allthe components are differentiable, we can now evaluate the gradient of the AS w.r.t.
task parameters∇ θ AS ( t θ ) and use it for a gradient-based optimization.
This results in a meta-optimization problemwhere the inner-loop optimization is over parameters w 1 , w 2 and the outer-loop optimization is overtask parameters θ (see Fig. 3).
Evaluating the meta-gradient w.r.t.
θ has high memory and computational costs, as the inner-loopincorporates training two networks from scratch.
In practice, we found that even after a single epochthere is a separation in AS between random and real tasks, which provides a useful learning signal(see Appendix B).
We additionally use gradient checkpointing [7] after every inner-loop step in orderto avoid the linear memory consumption in the number of steps.
All this together allows us to run thediscovery process for the ResNet-18 model on a single 40GB A100.
4.2 Discovering a Set of Dissimilar Tasks with High Agreement Score
The aforementioned AS meta-optimization results in only a single high-AS task, whereas there arepotentially many tasks with high AS.
We, therefore, would like to discover and inspect a set of tasks
T = { t θ 1 , . . .
, t θ K } instead of a single one.
A naive approach to find such a set would be to run themeta-optimization from K different intializations of task-parameters θ .
However, this results in theset of similar (or even the same) tasks, as we also observed in our preliminary experiments.
We,therefore, aim to discover dissimilar tasks to better represent the set of all tasks with high AS.
Wemeasure the similarity between two tasks on a set X as follows:
[Equation]
where the maximum accounts for the label flipping.
Since this metric is not differentiable, we, instead,use a differentiable loss L sim to minimize the similarity (defined later in Sec.
4.3, Eq. 5).
Finally, weformulate the task discovery framework as the following optimization problem over T :
[Equation]
Note, that we naturally avoid discovering trivial solutions with high AS that are highly imbalanced(e.g., labelling all objects with class 0) due to the similarity loss, as these task will be similar to eachother, and a set T that includes them will be penalized.
In practice, we could solve this optimization sequentially, i.e., first find t θ 1 , freeze it and add it to T ,then optimize for t θ 2 , and so on.
However, we found this to be slow, so in the next section 4.3 weprovide a solution that is more efficient, i.e. can find more tasks with less compute.
Regulated Task discovery.
The task discovery formulation above only concerns with finding highAS tasks that are dissimilar.
One can introduce additional constraints to regulate the discoveryprocess, e.g., in the form of a regularizer or the task-network architecture.
This approach can alsoallow for a guided task discovery to favour the discovery of one task over the others.
We provide anexample in Sec. 5.1 by using self-supervised pre-trained embeddings as the input to the task-network.
4.3 Modelling The Set of Tasks with an Embedding Space
Modeling every task by a separate network increases both the memory and computational costs.
In order to amortize these costs, we adopt an approach popular in multi-task learning and modeltask-networks with a shared encoder e ( · ; θ e ) :
X → R d and a task-specific linear head θ l ∈ R d , sot θ ( x ) =
e ( x ; θ e ) ⊤ θ l .
See Fig.
3 for visualization.
Then, instead of learning a fixed set of differenttask-specific heads, we aim to learn an embedding space where any linear hyperplane gives rise to ahigh-AS task.
Thus, an encoder with parameters θ e defines the following set of tasks:
[Equation]
This set is not infinite as it might seem at first, since many linear layers will correspond to the sameshattering of X .
The size of T θ e as measured by the number of unique tasks on X is only limited by
[Table] [Table]
[Equation]
[Table] [Table]
w
[Table]
/DiiXkDUT0EMbdARAF5W0immK2AHLj9N2JH7804nfJbFZ1s4VgcqibvMRQRm2VmQ8LN5F4YRfpCIdez4HOQoGOsjLQPFxqmEQ70Ohw8EcOpCwQNT+gGZUFRa9TPkT2IwFAe1UhWkE/ujnhwklAeHFAHDN3Yb6gs7qGeuvFqPG3Y6HWEqfc+6NV9bqiUPKQ6MwWD+yTd9PfjyXX9tzV24h7VZ1wVPMk7DcN+oBbIZUSEdxkHpZjeEgLIj2oF9HHrUhbAZpStCFjDSIm1f4M+TJIlmMyLqhuGJayMy7jTMf4uDk77td2V7rRk5XtCV4LF0onaXE+mT+PwnLUcAk/wEB5QJB7kSdkgFZRJvibFZ+m2MjrfROnaCcNBIP+1E13UTzznmuy71WtFgN6uIjwzMYgPrZgvaeEnlLpcXO69eqmh5bXVtq5bHwBjm0Upj89lyHpM5BlJYY2Nzs5GH/dsqKWZ7e21leSOPqY9hthorz1eeY3tjoNjKU0mnXp3KObHhVLq+wF0BU9kKaBWZZtchnWXfaJ52as4b8aJkU5Lmchlpw0XsoM8ceth9gscdZeT3T3Hwrr5kNJaW3xjzT59p6VPW7mr3tYpmaKvaU+2F9lrb1VjJK30sfSp9Ln8t/yz/Kv9OoefPDXLuaGNP
[Figure]
c9faRth7g
[Figure]
the dimensionality of the embedding space d and the encoder’s expressivity.
Potentially, it can be asbig as the set of all shatterings when d = | X | − 1 and for an appropriate encoder e [61].
We adopt a uniformity loss over the embedding space [63] to induce dissimilarity between tasks:
[Equation]
where the expectation is taken w.r.t.
pairs of objects randomly sampled from the training set.
Itfavours the embeddings of images to be uniformly distributed on a sphere, and, if the encoder satisfiesthis property, any two orthogonal hyperplanes θ 1 l ⊥ θ 2 l (passing through origin) give rise to two taskswith similarity 0.5 as measured by Eq.
2 (see Fig. 3).
In order to optimize the AS averaged over T θ e in Eq.
3 , we use a Monte Carlo gradient estimatorby sampling one hyperplane θ l at each step.
To sample dissimilar tasks, we sample orthogonalhyperplanes, which result in dissimilar tasks due to uniformity.
See Appendix B for more details.
Asa result of running the task discovery framework, we find the encoder parameters θ ∗ e that optimize theobjective Eq. 3 and gives rise to the corresponding set of tasks T θ ∗ e (see Eq.
4 and Fig. 3).
4.4 Discovering high-AS tasks on CIFAR-10 dataset
In this section, we demonstrate that the proposed framework successfully finds dissimilar taskswith high AS.
We consider the same setting as in Sec. 3.2.
We use the encoder-based discoverydescribed in Sec.
4.3 and use the same ResNet-18 architecture for e ( · ; θ e ) by only changing the lastclassification layer with a linear projection to R d with d = 32 .
We use Adam as the meta-optimizerand SGD optimizer for the inner-loop.
Refer to Appendix B for more details.
We optimize Eq.
3 to find θ ∗ e and sample 32 tasks from T θ ∗ e by taking d orthogonal hyperplanes θ l .
We refer to this set of 32 tasks as T ResNet .
The average similarity Eq. 2 between all pairs of tasksfrom this set is 0 .
51 , close to the minimum 0 .
5 level.
For each discovered task, we evaluate its AS inthe same way as in Sec. 3.2 (according to Eq. 1).
Fig.
1 demonstrates that the proposed task discoveryframework successfully finds tasks with high AS similar to real tasks.
See more visualizations andanalyses on these discovered tasks in Sec.
5 and the Appendix C.
Random Networks are high-AS tasks.
Interestingly, in our experiments we found that if we simplyinitialize the task-network randomly, the corresponding task (after applying softmax) will havehigh AS, on par with real and discovered ones ( ≈ 0 . 85 ).
Different random initializations, however,give rise to very similar tasks (e.g., 32 randomly sampled network have the average similarity of0 .
68 against 0 .
51 for the task discovery framework, see Appendix D for more detailed comparison).
Therefore, this naive approach does not result in an efficient task discovery framework, as one needsto draw probibitely many initializations to get sufficiently dissimilar tasks.
[Figure]
An Empirical Study of the Discovered Tasks
In this section, we first perform a qualitative analysis on the discovered tasks in Sec. 5.1.
Second, weanalyze how discovered tasks differ for three different architectures in Sec. 5.2.
Finally, in Sec.
5.3,we present how the discovered tasks can be used to construct an adversarial attack for a network bysimply curating a train-test split.
5.1 Qualitative analyses of the discovered tasks
Here we attempt to analyze the discovered tasks.
Fig.
4 (top right) shows examples of images forthree discovered tasks found in Sec. 4.4.
For ease of visualization, we selected the most discriminativeimages from each class as measured by the network’s predicted probability.
Some tasks seems to bebased on color, e.g. τ 1 class 1 seems to includes images with blue (sky or water) color, and class 0images with orange color.
In the interest of space, the visuals for all tasks are in the Appendix C,alongside some post-hoc interpretability analysis.
Regulated task discovery with contrastive pre-training described in Sec.
4.2 allows us to incorporate additional information to favour tasks based on high-level concepts.
We use augmentation-basedcontrastive pre-training that learns embeddings that are invariant to color information [8, 15, 6, 39].
Specifically, we use embeddings of the ResNet-50 [16] trained with SimCLR [7] as the input to theencoder e instead of raw images, which in this case is a 2-layer fully-connected network.
Fig.
4 (bottom right) shows the resulting tasks.
As the encoder is now more invariant to color, thediscovered tasks seems to be more aligned with CIFAR-10 classes e.g. samples from τ 1 class 1 showvehicles against different backgrounds.
Thus, the framework is able to represent different types ofinductive biases, in this case, the effect of SSL pretraining, via the discovered tasks.
Do we discover human-labelled tasks?
A natural question to ask is whether the set of discoveredtasks contains real tasks corresponding to human-labelled semantic classes.
To answer this, for eachreal task τ r ∈ T real , we find the most similar discovered task ˆ τ d ∈ T θ ∗ e for the encoder θ ∗ e from
Sec. 4.4 (see Appendix E for more details).
We observe that no real task is contained in the set ofdiscovered set as all the similarities sim( τ r , ˆ τ d ) are below 0 .
We also found that simply increasingthe dimensionality of the embedding space does not help significantly.
Please see the Appendix formore discussions.
5.2 High-AS tasks for different architectures
In this section, we study whether the AS measured on different architectures correlate well ondifferent groups tasks discovered for each of these architectures.
We consider the same architectures
[Table]
x ) =
[Table]
d ( x
[Table]
=
[Table]
/PBfTyMt0LUsizzQKtqCJfADdTjDRTcvi+Dj+toPbu9vtXpOF0tEbAxCZ0PTQ1Yg1viEa6masPUYSZyM2EpVszSfWr1AjUsDJkVSvfz0dSRoNsH8ElMglLFCNgV7065P44sQ5t0oqdaHppM9ppUjf38ksC2ga6XYCel21XlKUNbFY30MLyW91yV2JBoz6M0yl9ukbQC1WZYjJwMiukL5f/NFrRDAVnlUgwGQemJINKNvhvNomDB6XTaVVP59jkHJtRLhlZc4U4rglvlbRbJrg7bttuteG6Izh/e8RAJA95QHH+B+Meoc8MIIFdjNwePhv4on/D8eoVV3wL8OET8BHlnxIQVMXiCY6p6Ic8yrPiS2x8Wh3zIa0ah09Xneera5/XGhtvi0d2znpgPbSWLcd6YW1YH6wd68Bitfnas9qb2nr9pP69/qP+c0SdqRWa+9bEqv/6C9dFfBw=</latexit> X advte
[Figure]
.t.
τ 1 is.
as in Sec. 4.4: ResNet-18, MLP, and ViT. We change both f and e to be one of MLP or ViT and runthe same discovery process as in Sec. 4.4.
As a result, we obtain three sets: T ResNet , T MLP , T ViT ,each of 32 tasks.
For each task, we evaluate its AS on all three architectures.
Fig.
4 shows thathigh-AS tasks for one architecture do not necessary have similar AS when measured on anotherarchitecture (e.g., T ResNet on MLP and ViT).
For MLP and ViT architectures, we find that the ASgroups correlate well for all groups, which is aligned with the understanding that these architecturesare more similar to each other than to ResNet-18.
More importantly, we note that it is not enough to compare architectures on any single group oftasks.
For example, if comparing the AS for ResNet-18 and MLP only on real tasks T Real , one mightconclude that they correlate well ( ρ = 0 . 8 ), suggesting they generalize similarly.
However, when theset T ResNet is taken into consideration, the conclusion changes ( ρ = 0 . 17 ).
Thus, it is important toanalyse the different architectures on a broader set of tasks not to bias our understanding, and theproposed task discovery framework allows for more complete analyses.
.3 Adversarial Splits
creating
adversarial train-test dataset partition using discovered tasks
For a given real task τ r , let us consider the standard procedure of training a network on D ( X tr , τ r )and testing it on D ( X te , τ r ) .
The network achieves high test accuracy on average when the train-testsplit is sampled randomly.
Using discovered tasks, we show how to construct adversarial splits onwhich the test accuracy drops significantly.
To do that, we consider a task τ
d and construct the split,s.t. two tasks τ r , τ d have the same labels on the training set X advtr and the opposite ones on the testset X advte (see Fig. 5):
[Equation]
Fig.
5 shows that for different pairs of ( τ r , τ d ) after training the the network on D ( X advtr , τ r ) , the testaccuracy on D ( X advte , τ r ) drops significantly from 0 .
8 to 0 .
2 , suggesting the network predicts 1 − τ ron X advte , which coincides with τ d .
We note that we keep the class-balance and sizes of the randomand adversarial splits approximately the same (see Fig. 5).
The discovered task τ d , in this case, can be seen as a spurious feature [55, 21] and the adversarial splitcreates a spurious correlation between τ r and τ d on X advtr , that fools the network.
Similar behaviourwas observed before on datasets where spurious correlations were curated manually [54, 31, 65].
Incontrast, the described approach using the discovered tasks allows us to find such spurious features,to which networks are vulnerable, automatically .
It can potentially find spurious correlations ondatasets where none was known to exist or find new ones on existing benchmarks as we show below.
Neural networks learn the task with a higher AS.
The empirical observation above demonstratesthat when a network is given a training dataset where τ r and τ d coincide, favours predicting the latter.
[Table]
+q+/RNt4yw==</latexit> X advtr <latexit sha1_base64="zuh3FrWeeQ0wfGCAlrKksFYRSyQ=">AAAG5nicjVRNb9NAEHUKDcVQaOHIZUVUUVBVxVABAiq10CIuiNLPVHGI1utJuqq/tLsujSzzE7ghrtz4TfwbZhO3cdZBdKXIk3nvzczu7KyXBFyqZvNPbeba9dn6jbmb9q3b83fuLizeO5RxKhgcsDiIRcujEgIewYHiKoBWIoCGXgBH3uk7jR+dgZA8jvbVIIFOSPsR73FGFbq6C7+XXIX8YPn8MVknzRX3NXGVzyWLUQV+4bavwnImWc6VYv2DpWO1FPXPbPwAfrsLjeZqc7hI1XAKo2EVa6e7OPvI9WOWhhApFlAp204zUZ2MCsVZALntphISyk5pH9poRjQE2cmGJ5qTJfT4pBcL/EWKDL1lRUZDKQehh8yQqhNpYto5DWunqveyk/EoSRVEbJSolwZExUS3h/hcAFPBAA3KBMdaCTuhgjKFTbRtN4KvLA5DGvmZq2I/zttOBy04V8MaMzzBPGs4eT5JpUkCkc/PBfTyMt0LUsizzQKtqCJfADdTjDRTcvi+Dj+toPbu9vtXpOF0tEbAxCZ0PTQ1Yg1viEa6masPUYSZyM2EpVszSfWr1AjUsDJkVSvfz0dSRoNsH8ElMglLFCNgV7065P44sQ5t0oqdaHppM9ppUjf38ksC2ga6XYCel21XlKUNbFY30MLyW91yV2JBoz6M0yl9ukbQC1WZYjJwMiukL5f/NFrRDAVnlUgwGQemJINKNvhvNomDB6XTaVVP59jkHJtRLhlZc4U4rglvlbRbJrg7bttuteG6Izh/e8RAJA95QHH+B+Meoc8MIIFdjNwePhv4on/D8eoVV3wL8OET8BHlnxIQVMXiCY6p6Ic8yrPiS2x8Wh3zIa0ah09Xneera5/XGhtvi0d2znpgPbSWLcd6YW1YH6wd68Bitfnas9qb2nr9pP69/qP+c0SdqRWa+9bEqv/6C9dFfBw=</latexit> X advte
[Figure]
While theoretical analysis is needed to answer and understand this phenomena, here, we provide anempirical clue towards its understanding.
We consider a set of 10 discovered tasks (5 from each of the discovery runs with d ∈ { 8 , 32 } ) and4 real tasks.
For each pair of tasks ( τ 1 , τ 2 ) , we construct the adversarial split according to Eq.
6,train a network on D ( X advtr , τ 1 ) and test it on D ( X advte , τ 1 ) .
Fig.
5 shows the test accuracy againstthe difference in the agreement score of these two tasks AS( τ 1 ) − AS( τ 2 ) .
We find that the testaccuracy w.r.t.
τ 1 well correlates with the difference in the agreement: when AS( τ 1 ) is sufficientlylarger than AS( τ 2 ) , the network makes predictions according to τ 1 , and vice-versa.
When agreementscores are similar, the network makes test predictions according to neither of them (but the AS on theadversarial split mostly remains high, see Appendix F).
Adversarial split for CelebA via random network task.
Hair color prediction on the CelebA dataset[33] is a popular benchmark for research on spurious correlations due to the naturally occurringcorrelation between hair color ( hair_blonde ∈ { 0 , 1 } ) and gender ( male ∈ { 0 , 1 } ): images with( hair_blonde =1, male =0) occurs more often than ( hair_blonde
=1, male =1).
We show theeffectiveness of our proposed approach and automatically create an adversarial split for this dataset.
We use the original set of train and val images from CelebA as X and the hair_blonde attribute as τ r .
To get a high-AS task, we utilize the phenomena observed in Sec. 4.4 and use a randomly initializednetwork as τ d . Fig.
6 shows images from the corresponding adversarial split and the test accuracyfor both splits.
We measure the test accuracy on all test images (average) and ( hair_blonde =1,male =1) images (the worst group).
The adversarial split fools the network significantly in this caseas well according to both average and worst-case accuracy.
Conclusion and Limitations
In this work, we introduce task discovery, a framework that finds examples of tasks on which a givennetwork architecture generalizes well.
It uses the agreement score as the measure of generalizationand optimizes it over the space of tasks.
We show the effectiveness of this approach and demonstratemultiple examples of such tasks, other than original human-labelled ones.
This framework providesan empirical tool to analyze neural networks through the lens of the tasks they generalize on and canpotentially help us to better understand how deep learning works.
We, however, only scratched thesurface of this more general research direction, and there are several limitations to our work.
Completeness: the set of discovered tasks is not complete and does not necessarily include all thetasks with high agreement score (e.g., human-labelled tasks).
Novel optimization methods that bettertraverse different optima, e.g. [49, 35], and further scaling are needed to address this problem.
Also,while the proposed encoder-based parametrization results in an efficient task discovery, there mightnot be an encoder such that the corresponding set of tasks T θ e contains all and only high-AS ones.
Scalability: the task discovery framework relies on an expensive meta-optimization, which limitsits applicability to large-scale detests.
This problem can be addressed in future works with recentadvances in efficient meta-optimization methods [34, 52].
Interpretability: Analysis of discovered high-AS tasks can shed more light on how deep learningworks (e.g., Sec. 5.3).
However, not all of these tasks might be easily interpreted and understood.
Checklist
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s
contributions and scope?
[Yes]
(b) Did you describe the limitations of your work?
[Yes]
(c) Did you discuss any potential negative societal impacts of your work?
[N/A]
(d) Have you read the ethics review guidelines and ensured that your paper conforms to
them?
[Yes]
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[N/A]
(b) Did you include complete proofs of all theoretical results?
[N/A]
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experi-
mental results (either in the supplemental material or as a URL)?
[Yes]
(b) Did you specify all the training details (e.g., data splits, hyperparameters,
how they
were chosen)?
[Yes]
(c) Did you report error bars (e.g., with respect to the random seed after running experi-
ments multiple times)?
[Yes]
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes]
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes]
(b) Did you mention the license of the assets?
[N/A]
(c) Did you include any new assets either in the supplemental material or as a URL?
[Yes]
(d) Did you discuss whether and how consent was obtained from people whose data you’reusing/curating?
[N/A]
(e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content?
[N/A]
If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable?
[N/A]
(b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable?
[N/A]
(c) Did you include the estimated hourly wage paid to participants and the total amount
spent on participant compensation?
[N/A]