SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.06721 · 2021

Training for the Future: A Simple Gradient Interpolation Loss to Generalize Along Time

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 5 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2108.06721.json · badge: /api/ran/2108.06721.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
anshuln/training-for-the-future canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
load_data Ran
ran on a synthesized input
anshuln/training-for-the-future/src/CDOT/ot_main.py
code served (permissive licence) · get_code("916f3b5d7666cb5a")
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 tempfile
import os
import numpy as np
import json

# Create a temporary directory to hold the data files
tmpdir = tempfile.mkdtemp()

# Create sample numpy arrays with distinct dimensions
X = np.random.randn(2, 4).astype(np.float32)
Y = np.random.randn(2, 3).astype(np.float32)
U = np.random.randn(2, 5).astype(np.float32)

# Save the numpy arrays
np.save(os.path.join(tmpdir, 'X.npy'), X)
np.save(os.path.join(tmpdir, 'Y.npy'), Y)
np.save(os.path.join(tmpdir, 'U.npy'), U)

# Create and save the indices JSON
indices = {"train": [0, 1], "test": []}
with open(os.path.join(tmpdir, 'indices.json'), 'w') as f:
    json.dump(indices, f)

ARGS = {
    'root': tmpdir
}
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
masked_cross_entropy Ran
ran on a synthesized input
anshuln/training-for-the-future/src/CIDA/utils.py
code served (permissive licence) · get_code("1272a3ba576cd814")
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 Tensor, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for the function
# pred: shape (length, classnum) - output logits/log probabilities
# label: shape (length,) - class indices
# mask: shape (length,) - binary mask for valid positions

length = 2
classnum = 4

pred = torch.randn(length, classnum)
label = torch.tensor([0, 2], dtype=torch.long)
mask = torch.tensor([1.0, 1.0])

# weight parameter is optional and defaults to None
weight = None

ARGS = {
    "pred": pred,
    "label": label,
    "mask": mask,
    "weight": weight
}
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 Tensor, 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
masked_mse Ran
ran on a synthesized input
anshuln/training-for-the-future/src/CIDA/utils.py
code served (permissive licence) · get_code("fb4e99638972135b")
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 Tensor, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Construct tensors with distinct dimensions to probe shapes later
batch_size = 2
feature_dim = 4
seq_len = 3

# pred: prediction tensor, shape (batch_size, feature_dim)
# Used in: pred * mask.unsqueeze(1), so needs to be compatible with (batch_size, 1)
pred = torch.randn(batch_size, feature_dim)

# label: label tensor, shape (batch_size,)
# Used in: label.unsqueeze(1), so needs to be 1D
label = torch.randn(batch_size)

# mask: mask tensor, shape (batch_size,)
# Used in: mask.unsqueeze(1) and mask.sum(0)
mask = torch.ones(batch_size)

# weight: optional parameter, not used in function body
weight = None

ARGS = {
    'pred': pred,
    'label': label,
    'mask': mask,
    'weight': weight
}
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 Tensor, 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
read_data Ran
ran on a synthesized input
anshuln/training-for-the-future/src/CIDA/data_loader.py
code served (permissive licence) · get_code("078fd72e0d08607d")
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 tempfile
import os
import numpy as np
import json

# Create a temporary directory to hold the data files
tmpdir = tempfile.mkdtemp()

# Create sample data arrays with distinct sizes
X = np.random.randn(2, 4).astype(np.float32)  # batch=2, features=4
Y = np.random.randn(2, 3).astype(np.float32)  # batch=2, targets=3
U = np.random.randn(2, 5).astype(np.float32)  # batch=2, other_dim=5

# Create sample indices
indices = {"train": [0, 1], "test": [2, 3]}

# Save all files to the temporary directory
np.save(os.path.join(tmpdir, 'X.npy'), X)
np.save(os.path.join(tmpdir, 'Y.npy'), Y)
np.save(os.path.join(tmpdir, 'U.npy'), U)
with open(os.path.join(tmpdir, 'indices.json'), 'w') as f:
    json.dump(indices, f)

ARGS = {
    'root': tmpdir
}
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
read_pickle Ran
ran; our contract draft was wrong, not the code
anshuln/training-for-the-future/src/CIDA/utils.py
code served (permissive licence) · get_code("3e3f8e045455f655")
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 dict. 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 _pickle as pickle
import tempfile
import os

# Create a temporary pickle file with some test data
temp_dir = tempfile.mkdtemp()
test_data = {
    'key1': 'value1',
    'key2': [1, 2, 3],
    'key3': {'nested': 'dict'}
}

pickle_file = os.path.join(temp_dir, 'test.pkl')
with open(pickle_file, 'wb') as f:
    pickle.dump(test_data, f)

ARGS = {
    'name': pickle_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
train_classifier Ran
ran on a synthesized input
anshuln/training-for-the-future/src/CDOT/ot_main.py
code served (permissive licence) · get_code("0c917287552e370b")
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 Tensor, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple classifier model
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Set up for binary classification case
batch_size = 2
input_dim = 4
output_dim = 2

X = torch.randn(batch_size, input_dim)
Y = torch.zeros(batch_size, output_dim)
Y[0, 0] = 1.0
Y[1, 1] = 1.0

classifier = SimpleClassifier(input_dim, output_dim)
classifier_optimizer = torch.optim.Adam(classifier.parameters(), lr=0.001)

binary = True

ARGS = {
    "X": X,
    "Y": Y,
    "classifier": classifier,
    "classifier_optimizer": classifier_optimizer,
    "binary": binary
}
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 Tensor, 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
naive_transport Not yet run
unverified (harvested, no recorded run)
anshuln/training-for-the-future/src/CDOT/transport.py
code served (permissive licence) · get_code("f8bfab7b7811c4b5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
read_pickle 2 other papers
2 later
2202.03628 (2022-02)
Graph-Relational Domain Adaptation
2307.13943 (2023-07)
Topology-aware Robust Optimization for Out-of-Distribution Generalization

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

In several real world applications, machine learning models are deployed to make predictions on data whose distribution changes gradually along time, leading to a drift between the train and test distributions. Such models are often re-trained on new data periodically, and they hence need to generalize to data not too far into the future. In this context, there is much prior work on enhancing temporal generalization, e.g. continuous transportation of past data, kernel smoothed time-sensitive parameters and more recently, adversarial learning of time-invariant features. However, these methods share several limitations, e.g, poor scalability, training instability, and dependence on unlabeled data from the future. Responding to the above limitations, we propose a simple method that starts with a model with time-sensitive parameters but regularizes its temporal complexity using a Gradient Interpolation (GI) loss. GI allows the decision boundary to change along time and can still prevent overfitting to the limited training time snapshots by allowing task-specific control over changes along time. We compare our method to existing baselines on multiple real-world datasets, which show that GI outperforms more complicated generative and adversarial approaches on the one hand, and simpler gradient regularization methods on the other.

For agents

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

get_harvested_code_for_paper("2108.06721")
get_code_for_paper("2108.06721")
have("2108.06721")

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

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

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

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

Connect an agent — have() is free.