SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.29592 · 2026

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

Liam Paull, Samer Nashed, Mostafa Elaraby

arXiv · PDF

Code that ran

8 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 0 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2607.29592.json · badge: /api/ran/2607.29592.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
mostafaelaraby/tood-continual-ood canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
auroc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mostafaelaraby/tood-continual-ood/analysis/toy_confidence_gap.py
code served (permissive licence) · get_code("798ae69ccfa89a8a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function auroc takes two array-like arguments: id_scores and ood_scores
# It computes the Mann-Whitney AUROC score.
# Both parameters are converted to numpy arrays internally and compared.

# Create small, distinct arrays for in-distribution and out-of-distribution scores
id_scores = np.array([0.8, 0.9, 0.85, 0.95])  # Higher scores for ID
ood_scores = np.array([0.2, 0.3, 0.25, 0.15])  # Lower scores for OOD

ARGS = {
    "id_scores": id_scores,
    "ood_scores": ood_scores,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_per_task_energy Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/managers/ood_manager.py
code served (permissive licence) · get_code("707222ad10698f3d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct arguments for compute_per_task_energy
logits = torch.randn(2, 4, dtype=torch.float32)  # [N=2, C=4] batch of logits

task_class_map = {
    0: [0, 1],      # Task 0 uses classes 0, 1
    1: [2, 3],      # Task 1 uses classes 2, 3
}

num_tasks = 2

ARGS = {
    "logits": logits,
    "task_class_map": task_class_map,
    "num_tasks": num_tasks,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_tood_score Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/managers/ood_manager.py
code served (permissive licence) · get_code("d0e41cdda3938700")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

torch.manual_seed(0)

# Build a minimal EnergyStatsStore class
class EnergyStats:
    def __init__(self, mean, std, median, mad):
        self.mean = mean
        self.std = std
        self.median = median
        self.mad = mad

class EnergyStatsStore:
    def __init__(self):
        self.stats = {}
        self.global_ref = EnergyStats(
            mean=0.0,
            std=1.0,
            median=0.0,
            mad=1.0
        )
    
    def has(self, task_id):
        return task_id in self.stats
    
    def get(self, task_id):
        return self.stats[task_id]
    
    def set(self, task_id, mean, std, median, mad):
        self.stats[task_id] = EnergyStats(mean, std, median, mad)

# Create a stats store with statistics for 2 tasks
stats_store = EnergyStatsStore()
stats_store.set(0, mean=-5.0, std=2.0, median=-4.5, mad=1.5)
stats_store.set(1, mean=-6.0, std=2.5, median=-5.5, mad=1.8)

# Create logits [N=2, C=4]
logits = torch.randn(2, 4)

# Create task_class_map mapping task_id to class indices
task_class_map = {
    0: [0, 1],      # Task 0 uses classes 0, 1
    1: [2, 3]       # Task 1 uses classes 2, 3
}

# Number of tasks
num_tasks = 2

# Normalization method
method = 'z_norm'

# Margin lambda parameter
margin_lambda = 0.5

ARGS = {
    'logits': logits,
    'task_class_map': task_class_map,
    'num_tasks': num_tasks,
    'stats_store': stats_store,
    'method': method,
    'margin_lambda': margin_lambda
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
enable_amp Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/cl_extensions/amp.py
code served (permissive licence) · get_code("0a9c2c3652d05396")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned AMPMinimalStrategy. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal strategy class that satisfies the function's usage
class MinimalStrategy:
    """Minimal strategy with required attributes for AMPMixin to work."""
    
    def __init__(self):
        self.optimizer = torch.optim.SGD([torch.nn.Parameter(torch.randn(2, 3))], lr=0.01)
        self.loss = torch.tensor(1.5, requires_grad=True)
        self.retain_graph = False
    
    def forward(self):
        """Minimal forward that returns a tensor."""
        return torch.randn(2, 4, dtype=torch.float16)


ARGS = {
    "strategy": MinimalStrategy()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AMPMinimalStrategy — a AMPMinimalStrategy output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AMPMinimalStrategy output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_blobs Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/analysis/toy_confidence_gap.py
code served (permissive licence) · get_code("aac9699fbf6aa0a0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a random number generator
rng = np.random.RandomState(42)

# Define centers for the blobs (3 classes, each with a 4-dimensional center)
centers = np.array([
    [0.0, 0.0, 0.0, 0.0],
    [5.0, 5.0, 5.0, 5.0],
    [10.0, 10.0, 10.0, 10.0]
])

# Number of samples per blob
n_per = 2

# Dimensionality of each sample
dim = 4

# Spread/standard deviation of the blobs
spread = 1.0

ARGS = {
    'rng': rng,
    'centers': centers,
    'n_per': n_per,
    'dim': dim,
    'spread': spread
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_energies Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/managers/ood_manager.py
code served (permissive licence) · get_code("f7c325faf019e03d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

class EnergyStats:
    """Container for per-task energy statistics"""
    def __init__(self, mean, std, median, mad):
        self.mean = mean
        self.std = std
        self.median = median
        self.mad = mad

class EnergyStatsStore:
    """Buffer for energy statistics across tasks"""
    def __init__(self):
        self._stats = {}
        self.global_ref = EnergyStats(
            mean=0.5,
            std=1.0,
            median=0.4,
            mad=0.8
        )
    
    def has(self, task_id):
        return task_id in self._stats
    
    def get(self, task_id):
        return self._stats[task_id]
    
    def add(self, task_id, stats):
        self._stats[task_id] = stats

# Create energies: [N=2, T=3] shape
energies = np.array([
    [1.0, 2.0, 3.0],
    [1.5, 2.5, 3.5]
], dtype=np.float32)

# Create stats store with statistics for tasks 0, 1, 2
stats_store = EnergyStatsStore()
stats_store.add(0, EnergyStats(mean=1.2, std=0.9, median=1.1, mad=0.7))
stats_store.add(1, EnergyStats(mean=2.1, std=1.1, median=2.0, mad=0.9))
stats_store.add(2, EnergyStats(mean=3.0, std=1.2, median=2.9, mad=1.0))

ARGS = {
    'energies': energies,
    'stats_store': stats_store,
    'method': 'z_norm'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
select_top_k_labels Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/openood/evaluators/ood_evaluator.py
code served (permissive licence) · get_code("dc51036cc5070dc8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from collections import Counter

# The function uses:
# - labels: a list of predicted labels
# - k: an integer for number of top labels to select
# Counter is used to count label frequencies
# most_common(k) is called to get top k items

# Create a sample list of labels with varying frequencies
labels = [
    'cat', 'dog', 'cat', 'bird', 'dog', 'cat', 
    'fish', 'bird', 'cat', 'dog', 'fish', 'cat',
    'dog', 'bird', 'cat', 'hamster', 'fish', 'cat',
    'dog', 'bird'
]

k = 10

ARGS = {
    'labels': labels,
    'k': k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_dataloader Ran
ran; our contract draft was wrong, not the code
mostafaelaraby/tood-continual-ood/openood/evaluators/ood_evaluator.py
code served (permissive licence) · get_code("c4e45a55ba72577a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Create a simple neural network that outputs class predictions
class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create a simple dataset
# We need samples that can be indexed and have a 'data' key
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self, num_samples=10):
        self.num_samples = num_samples
        self.data = torch.randn(num_samples, 4)
        self.labels = torch.randint(0, 3, (num_samples,))
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        return {'data': self.data[idx], 'label': self.labels[idx]}

# Create instances
net = SimpleNet()
dataset = SimpleDataset(num_samples=10)
dataloader = DataLoader(
    dataset,
    batch_size=2,
    shuffle=False,
    num_workers=0,
    pin_memory=False
)

# Define ARGS dictionary with all parameters for split_dataloader
ARGS = {
    'net': net,
    'dataloader': dataloader,
    'target_classes': [0, 1],
    'train_size': 0.8,
    'batch_size': 2,
    'stratify': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The primary challenge of continual learning (CL) systems is to learn new tasks while remaining performant on previously learned tasks. A similarly important though less well-studied aspect of CL systems is their ability to identify inputs that are unlikely to come from within the set of tasks the system has already encountered, often called out-of-distribution (OOD) detection. This paper presents several findings related to the dynamics of OOD detection in CL systems, causes of performance degradation over time which we call OOD forgetting (OODF), and proposed mitigation strategies for OODF. Chiefly, we find the unintuitive result that OODF is only weakly anti-correlated with classification performance on previous tasks, suggesting that the underlying mechanisms producing OODF are distinct. Moreover, this effect is observed for both energy-based and feature-based OOD detection methods. Energy-based detectors suffer a drop in logit scale as additional tasks are learned, which we term the Confidence Gap, while feature-based detectors also degrade under a complementary effect we call Manifold Crowding. Motivated by these observations, we propose Task-Aware OOD Score Calibration (TOOD), a training-free post-hoc method that decomposes logits into pertask energy scores and re-calibrates them using replay-buffer statistics. Experiments on CIFAR-10, CIFAR-100, and a 100-task ImageNet-1K stream show that TOOD improves OOD detection performance over uncalibrated energy in most settings and ranks first or second in eight of ten CIFAR configurations under 3-seed mean±std evaluation, with the largest gains when the confidence gap is most severe. These results suggest that a portion of OOD deterioration in continual learning arises from score miscalibration rather than from a complete loss of discriminative structure.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2607.29592")
get_code_for_paper("2607.29592")
have("2607.29592")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2607.29592.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2607.29592.svg)](https://syntology.ai/paper/2607.29592)

Connect an agent — have() is free.