SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1906.00391 · 2019

Sequential Scenario-Specific Meta Learner for Online Recommendation

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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 9 have no contract verdict; 0 failures of our instrument; 0 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/1906.00391.json · badge: /api/ran/1906.00391.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
THUDM/ScenarioMeta canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
binaryNDCG Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/evaluate.py
code served (permissive licence) · get_code("28475db193e3577e")
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 math

def binaryNDCG(ground_truth, test_result, topn):
    dcg, pdcg = (0.0, 0.0)
    for i, item in enumerate(test_result[:topn]):
        if item in ground_truth:
            dcg += 1 / math.log(i + 2)
    for i in range(min(len(ground_truth), topn)):
        pdcg += 1 / math.log(i + 2)
    return dcg / pdcg


# Construct valid arguments
ground_truth = {1, 3, 5, 7}
test_result = [1, 2, 3, 4, 5, 6, 7, 8]
topn = 5

ARGS = {
    "ground_truth": ground_truth,
    "test_result": test_result,
    "topn": topn
}
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 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
divide_support Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/dataset.py
code served (permissive licence) · get_code("408993d25a3f4a59")
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 list, ndim 4, dtype family int; 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.

import random

# Set seed for reproducibility
random.seed(0)

# task_ratings should be a list of lists, where each inner list contains
# tuples of (user_id, *others). The function iterates through these and
# groups by user_id, then splits into support and eval sets.

# Looking at the function:
# - ratings is iterated: for user_id, *others in ratings
# - user_id is used as dict key
# - others is stored as a list item and compared with "in"
# - item_id is extracted from itemset: for item_id in itemset
# - item_id is unpacked in tuple: (user_id, *item_id)

# So the structure should be:
# task_ratings = [
#   [
#     (user_id, item_data_1, item_data_2, ...),
#     ...
#   ],
#   ...
# ]

task_ratings = [
    [
        (0, 10, 20),
        (0, 10, 20),  # duplicate to test the "not in" check
        (1, 30, 40),
        (1, 30, 40),
        (2, 50, 60),
        (3, 70, 80),
    ],
    [
        (0, 100, 200),
        (1, 300, 400),
        (2, 500, 600),
        (3, 700, 800),
    ],
]

support_limit = 512
evaluate_limit = None

ARGS = {
    "task_ratings": task_ratings,
    "support_limit": support_limit,
    "evaluate_limit": evaluate_limit,
}
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 list, ndim 4, dtype family int — a list 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
filter_kcore Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/dataset.py
code served (permissive licence) · get_code("64c834c8614f221d")
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.

from collections import defaultdict

# Construct a small ratings dataset
# Each entry is (user_id, item_id, rating, timestamp)
ratings = [
    (0, 0, 5, 1000),
    (0, 1, 4, 1001),
    (0, 2, 3, 1002),
    (0, 3, 2, 1003),
    (0, 4, 1, 1004),
    (1, 0, 4, 1005),
    (1, 1, 5, 1006),
    (1, 2, 2, 1007),
    (1, 3, 3, 1008),
    (1, 4, 4, 1009),
    (2, 0, 3, 1010),
    (2, 1, 2, 1011),
    (2, 2, 5, 1012),
    (2, 3, 4, 1013),
    (2, 4, 1, 1014),
    (3, 0, 2, 1015),
    (3, 1, 3, 1016),
    (3, 2, 1, 1017),
    (3, 3, 5, 1018),
    (3, 4, 2, 1019),
    (4, 0, 1, 1020),
    (4, 1, 4, 1021),
    (4, 2, 2, 1022),
    (4, 3, 3, 1023),
    (4, 4, 5, 1024),
]

ARGS = {
    'ratings': ratings,
    'user_k': 5,
    'item_k': 5,
}
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 — 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
list2tensor Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/utils.py
code served (permissive licence) · get_code("3046101d6972ac13")
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 2, dtype family int, shape (3, 4) 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 list2tensor function
# The function takes a list of sequences and pads them to the same length

# data_list: a list of sequences (lists/arrays of integers)
data_list = [
    [1, 2, 3],
    [4, 5],
    [6, 7, 8, 9]
]

# padding_idx: the value to use for padding (typically 0)
padding_idx = 0

# dtype: torch data type (default is torch.long)
dtype = torch.long

# device: torch device (CPU only)
device = torch.device('cpu')

ARGS = {
    'data_list': data_list,
    'padding_idx': padding_idx,
    'dtype': dtype,
    'device': device
}
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 2, dtype family int, shape (3, 4) — shape (3, 4) 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
pad_tensor Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/utils.py
code served (permissive licence) · get_code("ec1263e33cee1529")
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 2, dtype family float, shape (5, 4) 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)

# Create a small tensor to pad
# Using shape (2, 4) - batch size 2, feature dimension 4
tensor = torch.randn(2, 4)

# Define padding parameters
length = 5  # Target length along the dimension to pad
value = 0   # Padding value
dim = 0     # Dimension along which to pad

ARGS = {
    "tensor": tensor,
    "length": length,
    "value": value,
    "dim": dim
}
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 2, dtype family float, shape (5, 4) — shape (5, 4) 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
task_preprocess Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/dataset.py
code served (permissive licence) · get_code("d99474e619a4dfc6")
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 torch

torch.manual_seed(0)

# The function expects tasks, which is a list of lists of tuples.
# Each element in tasks is a list of (user_id, item_id) pairs (ratings).
# The function extracts item candidates and builds user-to-itemset mappings.

tasks = [
    [(0, 'item_a'), (1, 'item_b'), (0, 'item_c')],
    [(2, 'item_x'), (3, 'item_y'), (2, 'item_z'), (3, 'item_x')]
]

ARGS = {
    'tasks': 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 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
topNPrecision Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/evaluate.py
code served (permissive licence) · get_code("244fd712035d4b0f")
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 torch

# Construct valid arguments for topNPrecision
# The function expects:
# - ground_truth: a collection (list) of items to check against
# - test_result: a collection (list) of items to check
# - topn: optional integer for top-N cutoff

# Create simple list-based ground truth and test results
ground_truth = [1, 3, 5, 7, 9]
test_result = [1, 2, 3, 4, 5, 6, 7, 8]

# topn can be None (will use min of lengths) or an integer
topn = 3

ARGS = {
    "ground_truth": ground_truth,
    "test_result": test_result,
    "topn": topn
}
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 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
topNRecall Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/evaluate.py
code served (permissive licence) · get_code("e12ebd7aa5db83eb")
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 torch

torch.manual_seed(0)

# ground_truth: a list of paper identifiers that are relevant
ground_truth = [1, 3, 5, 7, 9]

# test_result: a list of paper identifiers returned by the test/model
test_result = [1, 2, 3, 4, 5, 6, 7, 8]

# topn: number of top results to consider
topn = 5

ARGS = {
    "ground_truth": ground_truth,
    "test_result": test_result,
    "topn": topn
}
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 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
unserialize Ran
ran on a synthesized input
THUDM/ScenarioMeta/src/utils.py
code served (permissive licence) · get_code("f20422f0da2b9005")
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 1, dtype family int, shape (4,) 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 tempfile
import os
import json
import numpy as np
import pickle

# Create temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a .npy file
npy_path = os.path.join(temp_dir, 'test.npy')
np.save(npy_path, np.array([1, 2, 3, 4]))

# Create a .json file
json_path = os.path.join(temp_dir, 'test.json')
with open(json_path, 'w') as f:
    json.dump({'key': 'value', 'number': 42}, f)

# Create a .pkl file (pickle format)
pkl_path = os.path.join(temp_dir, 'test.pkl')
with open(pkl_path, 'wb') as f:
    pickle.dump({'data': [1, 2, 3]}, f)

# Define ARGS - test with the .npy file path
ARGS = {
    'path': npy_path
}
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 ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) 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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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

Cold-start problems are long-standing challenges for practical recommendations. Most existing recommendation algorithms rely on extensive observed data and are brittle to recommendation scenarios with few interactions. This paper addresses such problems using few-shot learning and meta learning. Our approach is based on the insight that having a good generalization from a few examples relies on both a generic model initialization and an effective strategy for adapting this model to newly arising tasks. To accomplish this, we combine the scenario-specific learning with a model-agnostic sequential meta-learning and unify them into an integrated end-to-end framework, namely Scenario-specific Sequential Meta learner (or s^2 meta). By doing so, our meta-learner produces a generic initial model through aggregating contextual information from a variety of prediction tasks while effectively adapting to specific tasks by leveraging learning-to-learn knowledge. Extensive experiments on various real-world datasets demonstrate that our proposed model can achieve significant gains over the state-of-the-arts for cold-start problems in online recommendation. Deployment is at the Guess You Like session, the front page of the Mobile Taobao.

For agents

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

get_harvested_code_for_paper("1906.00391")
get_code_for_paper("1906.00391")
have("1906.00391")

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

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

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

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

Connect an agent — have() is free.