Mutation testing for deep learning (DL) faces a cost-realism trade-off. The pre-training approach produces realistic but computationally expensive mutants, whereas existing post-training operators modify trained models efficiently but produce mutants that less closely resemble real faults. This study asks whether the trade-off is necessary: can the weight-space effect of a fault-informed pre-training mutation operator be predicted from a trained model, without retraining it? We answer this question with TensorMutation, which represents a trained model as a neural graph and uses a mutation-conditioned graph neural network (GNN) to predict parameter changes. The GNN is trained offline and reused across unseen models so that TensorMutation can generate executable mutants without retraining. We construct a corpus of 25,252 original-mutant pairs from 71 multilayer perceptron (MLP) classifiers using 11 fault-informed pre-training operators, including 25 newly curated subjects. TensorMutation partially reproduces the behavioral effects of pre-training mutations on nine held-out subjects, and direct weight-space supervision significantly improves weight-space fidelity. On 12 real-fault subjects, TensorMutation achieves the highest median behavioral similarity among the evaluated approaches. The improvement over the post-training tool DeepMutation++ is statistically significant (Holm-adjusted p=0.018), whereas the differences from the pre-training tool DeepCrime and the norm-matched random control are not significant. These results show that fault-informed pre-training mutations leave learnable structure in weight space that transfers to unseen models.
Figures & tables
Fig. 1: Mutant-generation workflow of TensorMutation. Given a trained original model Mo and a mutation specification m , TensorMutation constructs a mutation-aware neural graph, uses the trained GNN fϕ to predict parameter changes, applies deterministic architectural changes when required, and reconstructs the executable mutant Mm without retraining.
Fig. 2: Mutation-aware neural-graph representation used by TensorMutation. Each original–mutant pair yields one supervised graph sample. The original model provides the node and edge input features, while the corresponding parameter differences provide the bias- and weight-delta supervision targets. The mutation specification is associated with the graph and conditions GNN processing through FiLM.
Fig. 3: Offline training of the TensorMutation GNN. The trained GNN is subsequently reused unchanged in the mutant-generation workflow of Fig. 1 .
Fig. 4: Overview of the TensorMutation study design. The study constructs and splits the mutation corpus, trains TensorMutation, evaluates behavioral and weight-space fidelity on held-out subjects, and compares the generated mutants with real faults. TM-B and TM-J denote TensorMutation trained with the behavioral objective only and with the full objective, respectively (Section IV-E ).
ID
Operator
Fault type
Configuration space
HBS
Change batch size
Suboptimal batch size
{b/4,b/2,2b,4b}
HLR
Decrease learning rate
Suboptimal learning rate
(∼0,lr] , binary search with precision lr/10
HNE
Change number of epochs
Suboptimal number of epochs
[1,e] , binary search with precision e/10
HDB
Disable data batching
Data batching required
Batch size set to the training-set size; only if batching is used
ACH
Change activation function
Wrong type of activation function
Each layer with a non-linear activation × each other non-linear activation
ARM
Remove activation function
Missing activation function
Each layer with a non-linear activation
TABLE I: Selected DeepCrime Mutation Operators with Fault Types and Configuration Spaces
IoU
CS
Subject
TM-B
Rand. B
TM-J
Rand. J
TM-B
TM-J
cleanml018
0.246
0.153
0.232
0.118
0.483
0.483
cleanml019
0.297
0.243
0.299
0.214
0.482
0.441
deepfd030
0.162
0.190
0.179
0.202
0.163
0.229
deepfd050
0.178
0.164
0.248
0.087
0.228
0.316
deeplocalize030
0.091
0.109
0.099
0.085
0.355
0.411
TABLE II: Behavioral similarity to the corresponding DeepCrime mutants on the test subjects
Fig. 5: Operator-level median IoU of TM-B and TM-J with the corresponding DeepCrime mutants across the test subjects. Numbers in parentheses give the number of test subjects to which each operator applies.
Cosine
Log-norm ratio
Norm. L2
Subject
TM-B
TM-J
TM-B
TM-J
TM-B
TM-J
cleanml018
0.146
0.422
0.046
−0.151
1.377
1.030
cleanml019
0.282
0.532
−0.114
−0.226
1.009
0.925
deepfd030
0.020
0.115
0.130
−0.171
1.717
1.125
deepfd050
0.080
0.227
−0.175
−0.479
1.074
0.983
deeplocalize030
0.030
0.156
0.156
−0.154
1.777
1.117
TABLE III: Weight-space fidelity to the corresponding DeepCrime deltas on the test subjects
Fig. 6: Operator-level median cosine similarity of TM-B and TM-J with the corresponding DeepCrime deltas across the test subjects. Numbers in parentheses give the number of test subjects to which each operator applies.
Spearman ρ
Subject
Configurations
TM-B
TM-J
cleanml018
53
0.242
0.241
cleanml019
54
0.339
0.202
deepfd030
119
0.404
0.151
deepfd050
87
0.360
0.573
deeplocalize030
120
0.412
0.119
TABLE IV: Spearman correlation between configuration-level cosine similarity and IoU on the test subjects
Fig. 7: IoU with the real fault on the 12 subjects. Boxes show the IoU of individual mutants, and black diamonds show the subject summaries of Table V , on which the tests are based. † Subjects with fewer than 50 real-fault kills.
IoU with real fault
DC
Subject
TM-J
DC
Rand.
DM++
KI
ceiling
defect4ml038
0.248
0.008
0.117
0.010
486
0.008
defect4ml061
0.172
0.105
0.116
0.131
120
0.131
defect4ml067
0.257
0.175
0.135
0.057
7041
0.250
defect4ml068
0.000
0.000
0.000
0.000
500
0.000
defect4ml069 †
0.000
0.000
0.000
0.000
12
0.000
TABLE V: Real-fault similarity on the 12 subjects
Comparator
W/L/T
Median Δ
p
pHolm
r
DM++
9/1/2
0.112
0.006
0.018
0.927
Random
9/1/2
0.067
0.084
0.168
0.636
DeepCrime
8/2/2
0.018
0.322
0.322
0.382
TABLE VI: Paired subject-level comparisons of TM-J with each approach