Notes from the Wired

Functional Test Generation for In-Field Testing of Deep Learning Models with Test Storage Constraints

June 19, 2026 | 3,434 words | 17min read

Paper Title: Functional Test Generation for In-Field Testing of Deep Learning Models with Test Storage Constraints

Link to Paper: https://doi.org/10.1109/ITC58126.2025.00029

Date: 2025 (IEEE International Test Conference)

Paper Type: Test Generation, Functional Testing, Deep Neural Networks, In-Field Testing

Short Abstract: This paper proposes a storage-aware, fault-agnostic framework that jointly optimizes a fixed-size set of test patterns to maximize expected fault coverage under a probabilistic fault model. Using Monte Carlo sampling to estimate the expectation over the fault distribution, the method produces a test set of exactly K patterns, while achieving 100% coverage across multiple fault types (weight perturbation, bit flips, stuck-at, composite), outperforming random and adversarial baselines on classification (MLP, ConvNet-7, VGG-19) and segmentation (CamVid) tasks.

1. Introduction

DNNs deployed on specialized AI hardware accelerators (TPUs, GPUs) are structurally tested at manufacturing time, independent of the model executed. However, in-field reliability demands model-specific functional testing, as hardware failures from aging, environmental disturbances, or manufacturing escapes can degrade inference over time.

The paper identifies three key limitations in existing approaches:

  1. Predefined fault lists (e.g., Moussa et al. DATE 2023) cover only a fixed set of fault scenarios and fail to generalize to new or probabilistic hardware failures.
  2. Post-generation compaction generates patterns first, then compresses/compacts to fit storage, this ignores storage limits from the outset and introduces inefficiencies.
  3. Fault-model specificity, many methods target only one type (bit flips, stuck-at, or adversarial perturbations), limiting comprehensive assessment.

The core insight: instead of generating patterns for individual faults and then compacting, generate all K test patterns jointly with K as a user-defined parameter that directly encodes the storage budget. The patterns distribute responsibility across the fault distribution through a joint optimization objective.

“A more effective approach would integrate test storage constraints directly into the test generation process, ensuring that the final test set is optimized for both fault coverage and meets practical deployment constraints.”

The paper makes four contributions:

2. Methodology

2.1 Fault Model: Probabilistic and Agnostic

Unlike prior Tahoori-group papers that define a specific fault model (bit-level weight faults or neuron SAF), this paper treats the fault distribution \(p(f)\) as a general probabilistic model. Any fault model that supports sampling qualifies: weight perturbation (Gaussian noise), bit flips, stuck-at neurons, or composite mixtures. The faults are drawn i.i.d. from \(p(f)\).

2.2 Joint Optimization of a Fixed-Size Test Set

The key innovation: instead of generating one pattern per fault or iteratively covering faults, all K test patterns are optimized jointly. The objective maximizes the expected fault coverage under the fault distribution:

\[ X^\star = \arg\max_{X} \mathbb{E}_{p(f)}\left[ \max_{x \in X} d(x, f) \right] \]

Where:

This formulation has three properties:

  1. Automatic division of labor: patterns naturally distribute effort across different fault types/regions.
  2. Fault equivalence: faults causing similar output behavior are captured by the same pattern.
  3. Explicit storage constraint: the size K directly encodes the memory budget.

2.3 Monte Carlo Gradient Estimation

The expectation cannot be computed analytically, so the authors use Monte Carlo sampling with \(N\) fault samples per optimization step:

\[ \mathbb{E}_{p(f)}\left[ \max_{x \in X} d(x, f) \right] \approx \frac{1}{N} \sum_{n=1}^{N} \max_{x \in X} d(x, f^{(n)}) \]

with \(f^{(n)} \sim p(f)\)

The gradient is similarly estimated:

\[ \nabla_X \mathbb{E}_{p(f)}\left[ \max_{x \in X} d(x, f) \right] \approx \frac{1}{N} \sum_{n=1}^{N} \nabla_X \max_{x \in X} d(x, f^{(n)}) \]

Algorithm 1 in the paper:

  1. Initialize \(K\) test patterns randomly.
  2. For \(T = 500\) steps:
    • Sample \(N = 500\) faults from \(p(f)\).
    • Estimate objective and gradient via Monte Carlo.
    • Update patterns with Adam.
    • Project to feasible domain (e.g., clip pixel values to [0, 255]).
  3. Return the best set \(X^\star\) found.

Note: the same fault samples are reused for both objective and gradient estimation in each step.

2.4 Key Differences from Prior Tahoori Methods

AspectITC 2025 (this paper)D&T 2024 (min-max)TC 2025 (compressed)
Fault ModelAny probabilistic \(p(f)\)Bit-level weight faults (pw, pb)Neuron SAF
Pattern GenerationJoint (all K patterns simultaneously)Iterative (one at a time, removal)One per fault
Storage ConstraintExplicit (\(K\) = budget)Implicit (compaction ratio)Per-pattern compression
Fault CoverageExpected over \(p(f)\)100% on fixed fault list100% on targeted faults
Objective\(\max_X \mathbb{E}[\max_{x \in X} d(x,f)]\)\(\max_x \min_{f \in F} o(x,f)\)\(\max_\alpha o(B\alpha, f)\)
Method TypeStorage-aware generationPattern-count compactionPer-pattern compression

These three approaches from the Tahoori group are complementary and could in principle be combined: the ITC 2025 method provides storage-aware joint generation, which could feed into the D&T 2024 compaction, and patterns could be stored using the TC 2025 basis compression.

3. Experiments

3.1 Setup

3.2 Key Results

ModelDatasetFault ModelRandomAdv. [16]Proposed
MLPMNISTWP (p=5%, σ=0.1)66%56%100%
MLPMNISTBF (p=5%, ρ=0.1)79%76%100%
MLPMNISTSA (p=5%, ρ=0.1)68%26%100%
MLPMNISTComposite (p=5%)82%70%100%
ConvNet-7CIFAR-10WP (p=10%, σ=0.05)89%54%100%
ConvNet-7CIFAR-10BF (p=10%, ρ=0.05)94%66%99.6%
ConvNet-7CIFAR-10SA (p=10%, ρ=0.05)80%60%99.8%
ConvNet-7CIFAR-10Composite (p=10%)66%77%100%
VGG-19CIFAR-10WP (p=15%, σ=0.1)44%36%100%
VGG-19CIFAR-10BF (p=15%, ρ=0.1)68%28%100%
CNN-Seg.CamVidWP (p=15%, σ=0.1)90%33%100%
CNN-Seg.CamVidBF (p=15%, ρ=0.1)88%46%100%
CNN-Seg.CamVidSA (p=15%, ρ=0.1)87%43%100%
CNN-Seg.CamVidComposite (p=15%)61%60%100%

Key findings:

3.3 Fault Impact Analysis

The paper includes an extensive analysis of how different fault types affect inference accuracy across models (Fig. 2):

4. Conclusion

The paper introduces a storage-aware, fault-agnostic test pattern generation method that jointly optimizes a fixed-size set of patterns under a probabilistic fault model. By integrating the storage constraint (K patterns) directly into generation, it avoids the need for post-generation compaction while achieving up to 100% fault coverage across weight perturbation, bit flip, stuck-at, and composite faults, on classification (MLP, ConvNet-7, VGG-19) and segmentation (CamVid) models. This makes it well-suited for in-field testing on hardware-constrained AI accelerators.


5. FAQ: Detailed Questions and Answers

(1) What does “jointly optimize” mean in practice?

Instead of generating one pattern at a time (each focused on one specific fault), all K patterns are updated simultaneously during gradient ascent. At each step, every pattern “competes” to be the one that maximizes \(d(x, f)\) for each sampled fault. The gradient update encourages patterns to specialize, each takes responsibility for a subset of the fault distribution. The \(\max_{x \in X}\) operator in the objective ensures that once one pattern covers a fault well, other patterns are free to focus elsewhere.

(2) How is K chosen?

K is a user-defined parameter representing the storage budget (number of test patterns × bytes per pattern ≤ available memory). The paper treats K as a given constraint. Fig. 4 explores the coverage vs. K trade-off: more patterns → higher coverage, but diminishing returns. This is the first Tahoori paper where storage is an explicit input rather than an output metric.

(3) What fault models are supported?

Any probabilistic fault model \(p(f)\) that supports sampling. The paper demonstrates four: weight perturbation (Gaussian noise on weights), bit flip (random bit flips in weight representations), stuck-at-zero (neurons clamped to 0), and composite (all three combined at lower rates). This fault-agnostic property is the key generalization over prior work.

(4) What is the relationship to the other Tahoori papers?

This ITC 2025 paper is the third distinct methodological thread from the Tahoori group:

They are complementary and could be combined.

(5) Why does the adversarial baseline (FGSM) perform so poorly?

FGSM adversarial images are designed for imperceptibility (small perturbations around real images). They are not optimized for maximizing softmax divergence under faults. For stuck-at faults especially (26% coverage on MLP), the small perturbations fail to produce misclassification because they don’t exploit the fault’s effect on the network’s decision boundary.

(6) How does this scale to larger models compared to the other methods?

(7) What is the computational cost?

\(T = 500\) steps with \(N = 500\) Monte Carlo samples means 250,000 forward passes per optimization run for ConvNet-7 (500 × 500). For VGG-19, this is substantial but still feasible on an A100 GPU (as used in experiments). The paper notes this is an offline cost, the generated patterns are applied cheaply during in-field testing.

(8) What about segmentation tasks — how is the objective defined?

For segmentation, the same softmax divergence is used, but applied at the pixel level. Each pixel’s softmax distribution is compared between fault-free and faulty networks. The objective aggregates across all pixels. This makes segmentation inherently more fault-sensitive than classification (more output dimensions to deviate).


6. Research Gaps

(1) No unseen-fault generalization analysis

Like the other Tahoori papers, fault coverage is evaluated against faults drawn from the same distribution \(p(f)\) used during optimization. The paper does not test generalization to:

The 100% coverage claim applies to Monte Carlo estimates from the same distribution, how well it transfers to real hardware fault distributions remains open.

(2) White-box assumption during generation

Test pattern generation requires full access to model parameters, gradients, and softmax outputs. This is acceptable for offline generation, but the method assumes the network is differentiable and accessible, which may not hold for proprietary or hardware-encrypted models.

(3) Fault distribution must be known or assumable

The method requires a probabilistic fault model \(p(f)\) to sample from. In practice, the true hardware fault distribution may be unknown or vary between chips, operating conditions, and aging states. The paper uses simple parametric distributions (Gaussian, uniform bit flip), real fault distributions may be more complex.

(4) VGG-19 is the largest model tested

While VGG-19 (~144M parameters) is used, modern LLMs have 7B–175B+ parameters. The per-step cost of 500 Monte Carlo forward passes through a 7B model is prohibitive (each forward pass is ~14GB of compute on an A100). The paper does not address this.

(5) No localization capability

The method detects faults (via misclassification) but provides no information about where the fault occurred. Unlike DTPG approaches (which include fault-to-fault separability for localization), this is purely a detection method.


7. Scalability to LLMs and Potential Directions

This is perhaps the most significant open challenge for all ATPG methods, including this paper. Below is an analysis of why LLM-scale ATPG is hard and what approaches could address it.

7.1 Why This Method Does Not Scale to LLMs

Computational barrier: Each optimization step requires \(N = 500\) forward passes through the full model. For a 7B-parameter LLM:

Compare to ConvNet-7 (CIFAR-10): each forward pass is ~2 ms, so 500 steps × 500 samples × 2 ms = 500 seconds total.

Discrete token problem: The method operates on continuous input spaces (pixel values in [0, 255]). LLMs operate on discrete token IDs from a finite vocabulary. Gradient-based optimization on discrete tokens requires relaxation (Gumbel-Softmax, continuous embeddings) or search-based alternatives. Neither is explored in this paper.

Fault model mismatch: The paper’s fault models (weight perturbation, bit flips, stuck-at neurons) are designed for vision models with ReLU activations. LLMs use LayerNorm, GELU/SwiGLU, residual connections, and attention mechanisms, a neuron stuck at zero behaves fundamentally differently in these architectures.

7.2 Potential Approaches to Address LLM Scalability

A. Efficient Monte Carlo via Subnet Sampling

The main cost driver is \(N\) forward passes per step. Instead of running the full model \(N\) times, subnet sampling could be used: for each fault sample, only recompute the affected subgraph. If faults are sparse (e.g., one attention head), only that head’s computation path needs re-evaluation. This could reduce per-sample cost from \(O(L)\) to \(O(1)\) for sparse faults.

B. Importance-Weighted Fault Sampling

The current method samples faults uniformly from \(p(f)\). For LLMs, weights have highly uneven importance, a single critical weight flip can jailbreak an LLM (PrisonBreak), while most flips have no effect. Importance-weighted sampling (using gradient-based sensitivity scores) would focus Monte Carlo samples on faults that actually matter, reducing N needed for good gradient estimates.

C. Gradient Accumulation over Mini-Batches

Instead of estimating gradients with \(N = 500\) full-model passes, use gradient accumulation with smaller batch sizes over more steps. Each step uses \(N = 1\) fault sample, with gradient noise compensated by more total steps. This trades per-step accuracy for wall-clock time.

D. Discrete Token Optimization via Continuous Relaxation

For the discrete token problem, three approaches are promising:

  1. Soft-embedding optimization: Optimize in the continuous embedding space rather than token space. Start from a random embedding sequence, apply gradient updates, then project back to the nearest valid token sequence at test time.
  2. Prompt-level patterns: Instead of optimizing individual tokens, optimize entire prompt embeddings (soft prompts) that maximize divergence under faults.
  3. Gumbel-Softmax reparameterization: Use the Gumbel-Softmax trick to make the discrete token sampling differentiable, enabling gradient-based optimization over the vocabulary.

E. Precomputation + Caching

The Monte Carlo samples \(f^{(n)}\) are drawn from \(p(f)\) at each step. For LLMs, the fault distribution may be relatively static. Precomputing fault effects on a representative set of input prompts and caching the results could reduce the per-step cost to a table lookup + interpolation, completely avoiding forward passes during optimization.

F. Surrogate Model for Gradient Estimation

Train a smaller surrogate model that mimics the LLM’s output behavior under faults. Use this surrogate for the Monte Carlo gradient estimation during pattern optimization. The surrogate would be much cheaper per forward pass (e.g., distilled 1B model for a 7B target). Only the final pattern verification would run on the full model.

G. Layer-Wise Pattern Generation

Instead of generating end-to-end test patterns for the full LLM, generate patterns for individual layers or attention heads and compose them. Each layer’s pattern is optimized against faults in that layer only, using a reduced model (the layer + surrounding context). This reduces the per-optimization model size from \(O(L)\) to \(O(1)\).

7.3 Summary

ApproachKey IdeaCost ReductionFeasibility
Subnet samplingOnly recompute affected subgraph\(O(L) \to O(1)\) per sampleMedium — requires graph tracing
Importance-weighted samplingFocus on critical weights\(N\) can be reduced 10-100×High — PrisonBreak shows weight importance
Gradient accumulationN=1 per step, more stepsConstant per-step cost, more stepsHigh — standard ML technique
Soft-embedding optimizationContinuous embedding spaceSolves discrete token problemHigh — used in prompt tuning
Precomputation + cachingPrecompute fault effectsAvoids forward passes entirelyLow — fault effects may be input-dependent
Surrogate modelSmaller model for gradientsReduction proportional to surrogate sizeMedium — surrogate accuracy may limit quality
Layer-wise generationPatterns per layer, not full model\(O(L) \to O(1)\) per optimizationMedium — assumes fault effects are local

None of these are explored in this paper, but they represent concrete paths for extending the storage-aware joint optimization framework to LLM-scale models.


All three Tahoori-group papers (DATE 2023, D&T 2024, TC 2025) and the current ITC 2025 paper share the same research group and the misclassification detection criterion. However, each represents a distinct methodological thread:

The ITC 2025 paper is the first to treat K as an explicit constraint and the first to use a probabilistic fault model rather than a fixed fault list.

AspectThis Paper (ITC 2025)Testing for Multiple Faults (D&T 2024)Compressed TPG (TC 2025)DATE 2023 (compact)ATPG & Compaction (Zhang et al.)ATPG for Printed Neuro (2025)
TargetDNN acceleratorsDNN acceleratorsDNN acceleratorsDNN acceleratorsDNNs (software model)Printed neuromorphic circuits
Fault ModelAny probabilistic (WP, BF, SA, CF)Multiple bit-level weight faults (pw, pb)Neuron SAFSame as D&T 2024Stuck-at neuron/filter outputCrossbar, p-tanh, p-inv (analog)
Fault ScopeMultiple faults (via \(p(f)\) sampling)Multiple faults (simultaneous)Single/multiple neuronsMultiple faultsSingle fault per testSingle fault assumption
Storage ConstraintExplicit (\(K\) = budget)Implicit (compaction ratio)Implicit (basis dimension \(D\))ImplicitNot addressed
DetectionMisclassification (label change)Misclassification (label change)MisclassificationSameOutput deviation (Euclidean)Output deviation (KL divergence)
OptimizationJoint (all K patterns via MC expectation)Min-max (max lower bound)Gradient-based (single fault)SameGradient-based (single fault)Gradient-based (KL divergence)
GenerationSingle-stage, \(K\) patterns jointlyIterative (one pattern, remove faults)One per faultSameOne per faultOne per fault
CompressionNone needed (K is the budget)Iterative set coverBasis representationSameK-means + greedy set coverNot addressed
Max Coverage100% (all 4 fault types)100% (targeted list), 99.9% (unseen)100% (targeted neurons)100% (targeted list)Not reported98%
BaselinesRandom + AdversarialRandom + AdversarialRandom + AdversarialNoneNot comparedRandom patterns
Segmentation?Yes (CamVid)NoNoNoNoNo
Largest ModelVGG-19 (19 layers)VGG-19 (19 layers)VGG-19 (19 layers)ConvNet-7 (7 layers)ConvNet-7Small pNCs
AuthorsMoussa et al. (Tahoori group)Moussa et al. (Tahoori group)Moussa et al. (Tahoori group)Moussa et al. (Tahoori group)Zhang et al.Azimi et al.

The key distinction for this ITC 2025 paper: it is the first storage-aware method in this family, the first fault-agnostic (supports any probabilistic fault model), and the first to test on segmentation tasks. The non-Tahoori approaches use output deviation (not misclassification) and target fundamentally different domains (software DNN models, printed neuromorphic circuits).

Email Icon reply via email