Skip to content

TOOD: Task-Aware Out-of-Distribution Score Calibration for Continual Learners

Source: arXiv:2607.29592 · Published 2026-07-31 · By Mostafa ElAraby, Samer B. Nashed, Liam Paull

TL;DR

This paper addresses a critical but under-explored issue in continual learning (CL) systems: the degradation of out-of-distribution (OOD) detection performance over time, termed OOD forgetting (OODF). While much prior work focuses on maintaining classification accuracy on learned tasks, this work reveals that OOD detection deteriorates through mechanisms distinct from accuracy forgetting. The authors identify two main causes of OODF — the Confidence Gap, where logits for earlier tasks shrink in scale relative to newer ones, and Manifold Crowding, where the latent space becomes densely populated by embeddings from new tasks, decreasing margins for feature-based OOD detection. To mitigate these issues without retraining or modifying the CL model, they propose TOOD, a training-free, task-aware, post-hoc calibration method that decomposes logits into per-task energy scores and normalizes them with statistics acquired from replay buffers. Extensive experiments on CIFAR-10, CIFAR-100, and a 100-task ImageNet-1K continual stream show that TOOD consistently improves OOD detection metrics over uncalibrated baselines, ranking first or second in 8 out of 10 CIFAR configurations. This demonstrates that a substantial portion of OOD deterioration arises from score miscalibration rather than from fundamental loss of feature discrimination.

Key findings

  • OOD forgetting (OODF) is only weakly anti-correlated (r = 0.365, p = 0.270) with classification feature drift (CKA), whereas feature drift strongly correlates with classification forgetting (r = 0.880, p < 0.001), indicating distinct underlying mechanisms.
  • The Confidence Gap—absolute logit scale for old tasks diminishes relative to new tasks during continual learning—causes ID energy scores for old tasks to collapse towards OOD scores (e.g., Task 0 ID mean energy drops ~18 to ~6 on CIFAR-10), severely degrading detection margins.
  • Manifold Crowding shrinks nearest-neighbor distances from OOD samples to ID manifold by ~28% on a 5-task CIFAR-10 stream, compressing margins for feature-based detectors without disrupting old-task feature representations.
  • TOOD’s task-wise energy score decomposition and normalization significantly reduces OODF, improving average AUROC by up to +7.4 points on CIFAR-100 and CIFAR-10, with the largest gains under severe confidence gap conditions.
  • TOOD achieves top 1 or 2 ranking in OOD detector performance in 8 of 10 CIFAR continual learning configurations evaluated under 3 random seeds.
  • Standard scalar post-hoc calibrations fail to improve AUROC because monotonic transformations preserve ranking; TOOD’s per-task normalization breaks this limitation by selectively re-centering scores across tasks.
  • TOOD’s training-free nature requires only a single forward pass over calibration memory after each task, without gradient updates or modification of the CL backbone.
  • Feature-space analogs of TOOD that attempt margin restoration fail (−0.76 Avg AUROC), confirming confidence gap dominates energy scores, while manifold crowding remains an open problem.

Threat model

The adversary is not explicitly modeled in a security context. The focus is on natural degradation of OOD detection capability in continual learning systems under a realistic non-stationary data distribution and model update regime. Assumptions include sequential task arrival with disjoint label sets, incremental model parameter updates, and growing classifier output heads. The adversary cannot access training-time replay buffers or modify the model itself.

Methodology — deep read

The paper begins by formalizing OOD forgetting (OODF) in continual learning, distinguishing it from classification accuracy forgetting. They define accuracy forgetting Fi as the max accuracy drop on task i after training on later tasks, and OOD forgetting Di as the AUROC drop measuring OOD detection degradation for samples from task i's distribution, evaluated along the entire task stream.

They study multiple CL methods (LwF, iCaRL, DER, BiC, WA) and OOD detection paradigms (energy based, feature based, activation shaping) to evaluate how OOD detection degrades during continual/task-incremental learning. The datasets used are CIFAR-10 (5 tasks, 2 classes each), CIFAR-100 (10 tasks, 10 classes each), and ImageNet-1K (100 tasks, 10 classes each).

Feature drift is measured using centered kernel alignment (CKA), showing strong correlation with accuracy forgetting but weak correlation with OODF, implying different failure modes.

The authors identify two distinct mechanisms for OODF: The Confidence Gap arises because classifier heads grow with new tasks but logits for old tasks shrink in absolute magnitude, causing old-task energy scores to collapse toward OOD scores. Manifold Crowding occurs as latent space becomes densely occupied by embeddings from new tasks, reducing geometric margins crucial for feature-based OOD detectors.

Based on this diagnosis, TOOD is developed as a training-free, post-hoc calibration method that decomposes logits into per-task energy scores (sum-exp of logits belonging to classes of each task), then normalizes each task’s energy scores using calibration statistics from replay buffers (either mean shift or robust median/MAD). The final OOD score is the max normalized energy across tasks. This per-task normalization breaks the monotonic transformation limitation of scalar global calibration, differentially adjusting ID and OOD distributions.

The CL methods are trained with published hyperparameters using ResNet-32 (CIFAR) or ResNet-18 (ImageNet) backbone and expanding linear output heads. Training runs 170 epochs per task with SGD and multi-step learning rate schedules. OOD detection baselines compared include MSP, Energy, Dice, ASH, ViM, MDS, NNGuide, and BER from OpenCIL.

Evaluation uses incremental AUROC averaged over near and far OOD datasets defined per benchmark (e.g., CIFAR-10 uses CIFAR-100 as near OOD and MNIST/SVHN/Textiles/Places365 as far OOD) across all tasks after each training step. OODF is evaluated via the average AUROC drop per task between initial and final checkpoints.

Reproducibility is supported by releasing code and using standardized benchmarks (Avalanche, OpenOOD). Calibration buffers are small class-balanced replay samples. Ablations test mean-shift and robust-anchor normalization, margin terms, and splitting tasks into subclasses.

A concrete example is shown on CIFAR-10 with iCaRL: after learning 5 tasks, TOOD restores the large drop in Task 0 mean energy score from 18 to 6, increasing AUROC by ~35 points. Visualizations demonstrate ID and OOD score distributions before and after TOOD normalization across continual steps and methods.

Technical innovations

  • Formalization and quantification of out-of-distribution forgetting (OODF) as distinct from classification forgetting in continual learning.
  • Identification of two separate mechanisms driving OODF: the Confidence Gap (task-age-dependent logit scale shrinkage) and Manifold Crowding (latent feature space saturation).
  • Development of TOOD, a training-free, post-hoc task-aware calibration technique that decomposes logits into per-task energies and normalizes them using replay buffer statistics.
  • Demonstration that per-task energy normalization breaks the AUROC-invariant monotonic transformation constraint, enabling improved OOD detection without model retraining.

Datasets

  • CIFAR-10 — 60,000 images — public benchmark
  • CIFAR-100 — 60,000 images — public benchmark
  • ImageNet-1K — ~1.28 million images — public benchmark
  • Near and Far OOD datasets from OpenOOD benchmark, including TinyImageNet, MNIST, SVHN, Textures, Places365, SSB-hard, NINCO, iNaturalist, OpenImage-O

Baselines vs proposed

  • iCaRL + Energy (Uncalibrated): Avg AUROC = 65.9 ±1.5; TOOD (Robust Anchor): improved by +3.1 points
  • CIFAR-10, iCaRL method: TOOD variants rank 1st or 2nd in 8/10 configurations by Avg AUROC
  • Feature-based MDS baseline on CIFAR-10 iCaRL: AUROC = 58.4 ±0.1 vs TOOD = 66.5 ± (exact value from text)
  • ASH performance fluctuates across CL methods, e.g. 65.9 on iCaRL, 57.7 on DER, while TOOD maintains consistent gains
  • Scalar post-hoc calibrations without per-task decomposition fail to improve AUROC, sometimes reducing Avg AUROC by 3.6 points compared to uncalibrated energy.

Figures from the paper

Figures are reproduced from the source paper for academic discussion. Original copyright: the paper authors. See arXiv:2607.29592.

Fig 1

Fig 1: Feature drift explains accuracy forgetting but not OOD forgetting. Each point is a CL method on CIFAR-

Fig 2

Fig 2: Continual learners retain classification accuracy on old tasks while losing OOD separability. Left:

Fig 3

Fig 3: TOOD restores ID/OOD separability across CL methods. Each column corresponds to a different CL

Fig 4

Fig 4 (page 6).

Fig 4

Fig 4: Effect of buffer size B (CIFAR-10, N = 5 tasks). Average area under the receiver operating characteristic

Fig 5

Fig 5: Manifold Crowding: new task embeddings erode the OOD detection margin without displacing old

Fig 6

Fig 6: TOOD selectively shifts the ID score distribution rightward while OOD scores remain anchored

Fig 7

Fig 7: Controlled single-seed confidence-gap toy experiment. (a) the toy geometry: class clusters on a shell around

Limitations

  • TOOD addresses only score miscalibration (Confidence Gap) and not latent manifold crowding, so feature-based OOD detectors still degrade due to margin compression.
  • Experiments focus primarily on class-incremental learning (CIL); extension to task- and domain-incremental learning settings remains future work.
  • Calibration requires a replay buffer or held-out task samples, which may not always be available or scalable to very large tasks.
  • The method assumes knowledge of task-to-class partitions during training, which may not be feasible in fully task-agnostic continual learning scenarios.
  • Experiments are limited to ResNet backbones on image classification benchmarks; applicability to other modalities or architectures like transformers is tested only in limited ablations.
  • Manifold crowding remains an open problem, and TOOD’s effectiveness is limited when the latent space becomes too saturated.

Open questions / follow-ons

  • How to mitigate manifold crowding to preserve geometric margins for feature-based OOD detectors in continual learning?
  • How does TOOD generalize to domain-incremental and task-incremental settings where label space does not expand or task identity is provided at test time?
  • Can calibration strategies be developed that do not require task annotations or replay buffers, for fully task-agnostic continual learning scenarios?
  • What are effective replay or regularization mechanisms that preserve both accuracy and OOD detection in very large-scale task streams?

Why it matters for bot defense

For bot-defense and CAPTCHA practitioners, maintaining reliable OOD detection in continually updating ML models is crucial to avoid false positives or increased vulnerability to novel bot inputs. This work highlights that OOD detection deterioration occurs via distinct mechanisms from classification forgetting, mainly due to calibration shifts rather than loss of representational discrimination. TOOD offers a practical, training-free recalibration approach that can be applied post-hoc on continual learners to restore score separability without retraining. Implementing similar per-task score normalization strategies could improve anomaly/bot detection consistency across evolving models without system overhaul. However, manifold crowding remains a challenge—meaning feature-space based detectors may degrade nonetheless, suggesting a combined approach to calibration and representation regularization might be necessary for robust lifelong bot-defense.

Cite

bibtex
@article{arxiv2607_29592,
  title={ TOOD: Task-Aware Out-of-Distribution Score Calibration for Continual Learners },
  author={ Mostafa ElAraby and Samer B. Nashed and Liam Paull },
  journal={arXiv preprint arXiv:2607.29592},
  year={ 2026 },
  url={https://arxiv.org/abs/2607.29592}
}

Read the full paper

Articles are CC BY 4.0 — feel free to quote with attribution