Skip to main content
Back

UC San Diego's Sleep Replay Consolidation Fixes AI Overconfidence Without Retraining

A biologically inspired 'sleep' phase rewires a trained network's weights post-hoc, fixing overconfident predictions without any labeled data or retraining

Pro

  • SRC is a new post-hoc calibration method that fixes overconfident neural networks by running a "sleep phase" after training, with no labels or retraining needed.
  • It directly modifies network weights via Hebbian learning in a temporary spiking network, unlike temperature scaling which only remaps outputs.
  • On CIFAR-100 with ResNet-152, SRC reduced Expected Calibration Error by 79.2% (vs 72.8% for temperature scaling) while preserving accuracy.
  • SRC + temperature scaling combined achieves the best Brier score in 5 of 8 models tested across ImageNet and CIFAR-100.
  • Works best on models with deep feedforward heads; minimal effect on single-layer output heads like standard ResNet on ImageNet.
  • Algorithm is fully specified in the paper with pseudocode and hyperparameters; authors suggest it could extend to transformer MLP blocks and LLMs.

Every time a neural network says it is 95% sure about something, that number is probably a lie. Not intentionally -- it is a structural problem baked into how modern deep networks are trained. Their predicted probabilities are systematically higher than their actual accuracy, a flaw known as miscalibration. A model that is 95% confident but only right 70% of the time is not just wrong; it is dangerously misleading in any high-stakes setting like medical diagnosis or autonomous driving.

A new paper from UC San Diego and Georgia Tech proposes a fix inspired by an unlikely source: sleep. The method, called Sleep Replay Consolidation (SRC), adds a post-training "sleep phase" to an already-trained network. No labels, no retraining, no new data -- just an offline replay pass that directly modifies the network's weights and, in doing so, makes its confidence scores far more trustworthy.

Why your model is lying to you

Quantifying calibration quality is essential in safety-critical domains like autonomous driving or medical imaging. The dominant fix today is temperature scaling (TS) -- a one-parameter trick that divides the logits (inputs to the softmax function) by a learned scalar parameter to soften the output distribution. Temperature scaling is a popular yet straightforward approach that employs a global scalar parameter to rescale the logits, and an advantage is that logit-rescaling does not alter the ranking of the prediction vector, thereby preserving model accuracy.

The problem is that temperature scaling is a cosmetic fix. It remaps the output distribution without touching the underlying weights or internal representations. The model's internal notion of confidence is unchanged; you are just applying a filter on top. Other approaches like label smoothing or focal loss can improve calibration more deeply, but they require full retraining with modified loss functions -- expensive and not always feasible for deployed models.

This leaves a gap: a post-hoc method that actually modifies network weights. That is exactly what SRC fills.

The biology behind the algorithm

The inspiration is not metaphorical. Multiple lines of evidence indicate that sleep plays a critical role in shaping human judgment and confidence. By strengthening relevant memory traces and reducing representational noise, sleep helps align subjective confidence with actual performance. Crucially, sleep deprivation does the opposite -- people become overconfident and fail to update their beliefs. The parallel to neural networks is striking.

Sleep-dependent memory consolidation is mediated by spontaneous reactivation (replay) of memory traces, leading to synaptic modification. Prior work from the same group showed that this SRC framework enables replay and makes possible continual learning of multiple tasks without forgetting -- published in Nature Communications in 2022. This paper applies the same biological principle to a completely different problem: calibration.

How SRC works, step by step

The algorithm is applied only to the feedforward classification head of a trained CNN, after training is complete. Here is what happens during the "sleep phase":

  1. Convert to spiking network: SRC maps the ANN to a spiking neural network (SNN) with identical architecture. Activations are replaced with a Heaviside function, and weights are scaled by the maximum layer-wise activation observed during prior training to ensure stable firing activity.
  2. Generate synthetic replay: The network then undergoes successive forward passes driven by stochastic spike trains. For each input vector, spike probabilities are drawn from a Poisson distribution with mean rates proportional to feature-wise average intensities across previously seen training data, such that higher-mean features produce more active input neurons. No actual training data is stored or replayed -- only its statistical summary.
  3. Apply Hebbian weight updates: Local Hebbian-type plasticity is implemented to modify weights during the sleep phase: synaptic strength is increased if presynaptic activation is followed by postsynaptic activation, and reduced if postsynaptic activation occurs without presynaptic activation. This is the classic "neurons that fire together, wire together" rule -- and its inverse.
  4. Remap back to ANN: After the sleep phase, the SNN is remapped back to an ANN. The original activation function is restored, and the network resumes standard operation with updated weights.

Hyperparameters (time steps, decay rate, spiking thresholds, STDP increments) are tuned per model using a genetic algorithm on a held-out validation set, strictly separated from the test set to prevent leakage.

2D histogram comparing baseline confidence vs SRC confidence for ResNet-152 on CIFAR-100, showing SRC can both increase and decrease confidence unlike temperature scaling

What actually changes inside the network

The paper's mechanistic analysis is one of its most interesting contributions. After SRC, three things consistently happen to the network's internals:

  • Weights shrink: Most synaptic weights decrease. This weakens connections where postsynaptic neurons fired without corresponding presynaptic activity -- essentially pruning irrelevant pathways.
  • Feature magnitudes compress: The distribution of activation magnitudes in the feedforward head narrows, closely matching what you see after retraining with label smoothing -- but without any retraining.
  • Representations get sparser: Applying SRC results in significantly sparser representations, with nonzero feature percentages ranging from 67% to 81%, compared to 82% to 90% for the baseline. Sparser activations mean each class prediction relies on a few strong, selective signals rather than the accumulation of many weak ones -- which prevents softmax from producing overconfident outputs on ambiguous inputs.

The key insight is that SRC is the only post-hoc method here that can both increase and decrease individual predictions' confidence. Temperature scaling can only reduce confidence uniformly. SRC reshapes confidence from the inside out.

The numbers

Experiments ran across ResNet-152, VGG19, AlexNet, and GoogLeNet on ImageNet and CIFAR-100, with 10 trials per configuration. The headline results:

  • On CIFAR-100, SRC reduced ECE (Expected Calibration Error -- the average gap between predicted confidence and actual accuracy) from 0.062 to 0.002, a 79.2% reduction, compared to 72.8% for temperature scaling.
  • SRC alone achieved the best post-hoc ECE in 4 of 8 models tested.
  • Combining SRC with temperature scaling frequently produced the optimal post-hoc Brier score in 5 out of 8 models.
  • SRC always increased prediction entropy across all models tested, and even increased entropy more than retraining with Focal Loss on CIFAR-100.
  • Accuracy remains largely unchanged after SRC across models, with only one exception (GoogLeNet), and that accuracy drop was eliminated when a custom multi-layer head was prepended.

SRC works best on models with deep feedforward classification heads. On models with a single output layer (like a standard ResNet on ImageNet), gains are minimal. Adding a multi-layer head preserves accuracy while giving SRC the representational depth it needs to operate.

2D density scatter plot comparing baseline confidence vs temperature scaling confidence, showing TS only reduces confidence while SRC can do both

When to use it -- and when not to

SRC is not a universal drop-in replacement for temperature scaling. Here is how to think about the tradeoffs:

  • Use SRC when you need strong calibration improvements, can afford a one-time offline replay phase, and want zero per-query inference overhead afterward. Unlike temperature scaling, which applies a transform at every inference step, SRC's cost is paid once.
  • Use SRC + TS together when you want the best Brier score and entropy tradeoffs -- the paper consistently shows this combination wins on holistic calibration.
  • Stick with TS alone when you need the absolute lowest NLL (negative log-likelihood). Temperature scaling is the only method here that consistently improves NLL, because it directly reallocates probability mass toward the correct class.
  • Skip SRC on shallow single-layer heads -- it has minimal effect and can be unstable.

The method is also not limited to CNNs. Because SRC operates on feedforward components, it can in principle be applied to other architectures, including transformer MLP blocks. The authors explicitly flag LLMs as a future target, noting that large language models remain poorly calibrated.

The bigger picture

The real breakthrough here is not the calibration numbers -- it is the category of method. SRC is the first post-hoc calibration technique that modifies network weights without any labeled data or supervision. It sits in a previously empty slot between "output-level remapping" (temperature scaling) and "full retraining" (label smoothing, focal loss). That opens a new design space for calibration research.

No code repository is linked in the paper , but the algorithm is fully specified including pseudocode (Algorithm 1) and all hyperparameters used per model in the appendix, making it reproducible. The prior SRC codebase for catastrophic forgetting is available on GitHub and shares the core algorithm. The broader implication -- that sleep-inspired replay can serve as a general-purpose post-training improvement mechanism -- is one worth watching as the field looks for ways to make deployed models more reliable without the cost of retraining.