SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.01266 · 2022

CIRS: Bursting Filter Bubbles by Counterfactual Interactive Recommender System

arXiv · PDF · Open in the Atlas

Code that ran

7 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 7 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2204.01266.json · badge: /api/ran/2204.01266.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
chongminggao/cirs-codes canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
compute_IPS_kuaishouRec Ran
ran on a synthesized input
chongminggao/cirs-codes/DeepFM-IPS-pairwise.py
code served (permissive licence) · get_code("70386f4c88fa86a6")
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 (6, 1) 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 collections
import numpy as np
import pandas as pd

# Create small test dataframes
df_x_all = pd.DataFrame({
    'photo_id': [1, 2, 1, 3, 2, 1]
})

df_big = pd.DataFrame({
    'photo_id': [1, 1, 1, 2, 2, 3, 4, 4, 4, 4]
})

ARGS = {
    'df_x_all': df_x_all,
    'df_big': df_big
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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 (6, 1) — shape (6, 1) 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_popularity_kuaishouRec Ran
ran on a synthesized input
chongminggao/cirs-codes/DICE.py
code served (permissive licence) · get_code("719e15eab107945d")
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 3, 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 pandas as pd
import numpy as np
import collections

# Create small DataFrames that mimic the structure expected by the function
# df_x: DataFrame with 'photo_id' column for positive samples
df_x = pd.DataFrame({
    'photo_id': [1, 2, 3, 1, 2]
})

# df_x_neg: DataFrame with 'photo_id' column for negative samples
df_x_neg = pd.DataFrame({
    'photo_id': [2, 3, 4, 1, 3]
})

# df_big: DataFrame with 'photo_id' column representing the full dataset
df_big = pd.DataFrame({
    'photo_id': [1, 1, 1, 2, 2, 3, 4, 5, 5, 5, 5]
})

ARGS = {
    'df_x': df_x,
    'df_x_neg': df_x_neg,
    'df_big': df_big
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family int — 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
loss_kuaishou_DICE Ran
ran on a synthesized input
chongminggao/cirs-codes/DICE.py
code served (permissive licence) · get_code("889422721f351800")
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
from torch import nn

torch.manual_seed(0)

# Create small tensors for all parameters
batch_size = 2
dim_size = 4

y = torch.randn(batch_size, dtype=torch.float32)
y_deepfm_pos = torch.randn(batch_size, dtype=torch.float32)
y_deepfm_neg = torch.randn(batch_size, dtype=torch.float32)
y_deepfm_pos_int = torch.randn(batch_size, dtype=torch.float32)
y_deepfm_neg_int = torch.randn(batch_size, dtype=torch.float32)
y_deepfm_pos_con = torch.randn(batch_size, dtype=torch.float32)
y_deepfm_neg_con = torch.randn(batch_size, dtype=torch.float32)
score = torch.randn(batch_size, dtype=torch.float32)

ARGS = {
    'y': y,
    'y_deepfm_pos': y_deepfm_pos,
    'y_deepfm_neg': y_deepfm_neg,
    'y_deepfm_pos_int': y_deepfm_pos_int,
    'y_deepfm_neg_int': y_deepfm_neg_int,
    'y_deepfm_pos_con': y_deepfm_pos_con,
    'y_deepfm_neg_con': y_deepfm_neg_con,
    'score': score
}
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
loss_kuaishou_IPS_pairwise Ran
ran on a synthesized input
chongminggao/cirs-codes/DeepFM-IPS-pairwise.py
code served (permissive licence) · get_code("7f9093fe709d8ffa")
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
from torch import nn

torch.manual_seed(0)

# Create small tensors for the function parameters
batch_size = 2

# y: target/label tensor
y = torch.randn(batch_size, dtype=torch.float32)

# y_deepfm_pos: positive predictions from deepfm
y_deepfm_pos = torch.randn(batch_size, dtype=torch.float32)

# y_deepfm_neg: negative predictions from deepfm
y_deepfm_neg = torch.randn(batch_size, dtype=torch.float32)

# IPS_score: inverse propensity score weights
IPS_score = torch.randn(batch_size, dtype=torch.float32).abs() + 0.1  # ensure positive

ARGS = {
    "y": y,
    "y_deepfm_pos": y_deepfm_pos,
    "y_deepfm_neg": y_deepfm_neg,
    "IPS_score": IPS_score,
}
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
loss_kuaishou_PD_pairwise Ran
ran on a synthesized input
chongminggao/cirs-codes/PD-pairwise.py
code served (permissive licence) · get_code("7621a99128ddbdb5")
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 small tensors for the function parameters
batch_size = 2
dim = 4

# y: target values
y = torch.randn(batch_size, dtype=torch.float32)

# y_deepfm_pos: positive predictions from deepfm model
y_deepfm_pos = torch.randn(batch_size, dtype=torch.float32)

# y_deepfm_neg: negative predictions from deepfm model
y_deepfm_neg = torch.randn(batch_size, dtype=torch.float32)

# popularity: popularity weights
popularity = torch.randn(batch_size, dtype=torch.float32)

ARGS = {
    'y': y,
    'y_deepfm_pos': y_deepfm_pos,
    'y_deepfm_neg': y_deepfm_neg,
    'popularity': popularity
}
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
loss_taobao Ran
ran on a synthesized input
chongminggao/cirs-codes/CIRS-UserModel-taobao.py
code served (permissive licence) · get_code("113fb75849cf13ed")
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 numpy as np

torch.manual_seed(0)

# Create small tensors for the function parameters
# y_predict: predicted values, shape (2, 4)
y_predict = torch.randn(2, 4)

# y_true: ground truth labels, shape (2, 4)
y_true = torch.randn(2, 4)

# exposure: exposure values, shape (2, 4)
exposure = torch.randn(2, 4)

# y_index: index values, shape (2, 4)
y_index = torch.randn(2, 4)

ARGS = {
    "y_predict": y_predict,
    "y_true": y_true,
    "exposure": exposure,
    "y_index": y_index,
}
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 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
loss_taobao Ran
ran on a synthesized input
chongminggao/cirs-codes/MLP-epsilonGreedy-taobao.py
code served (permissive licence) · get_code("b4943b59f166cb3c")
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

torch.manual_seed(0)

# y_predict: batch_size x total_output_dim tensor
# y_true: batch_size x total_output_dim tensor (last column is click)
# exposure: exposure information (used in weighting, but function doesn't use it directly)
# y_index: dict mapping output names to (start_idx, end_idx) tuples

batch_size = 2
total_output_dim = 4

y_predict = torch.randn(batch_size, total_output_dim)
y_true = torch.randn(batch_size, total_output_dim)
exposure = torch.ones(batch_size, 1)

# y_index maps output names to column ranges
# 'y' is the main output, others get weighted by click
y_index = {
    'y': (0, 2),           # columns 0-1 for main output
    'aux': (2, 4)          # columns 2-3 for auxiliary output
}

ARGS = {
    'y_predict': y_predict,
    'y_true': y_true,
    'exposure': exposure,
    'y_index': y_index
}
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
compute_popularity_kuaishouRec_pairwise Not yet run
unverified (harvested, no recorded run)
chongminggao/cirs-codes/PD-pairwise.py
code served (permissive licence) · get_code("d2a28d163defa4aa")
How it ran

no invocation recorded.

loss_kuaishou_pairwise Not yet run
unverified (harvested, no recorded run)
chongminggao/cirs-codes/CIRS-UserModel-kuaishou.py
code served (permissive licence) · get_code("827f1fc71245d861")
How it ran

no invocation recorded.

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-22.

Repositories linked to this paper

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

Abstract

While personalization increases the utility of recommender systems, it also brings the issue of filter bubbles. E.g., if the system keeps exposing and recommending the items that the user is interested in, it may also make the user feel bored and less satisfied. Existing work studies filter bubbles in static recommendation, where the effect of overexposure is hard to capture. In contrast, we believe it is more meaningful to study the issue in interactive recommendation and optimize long-term user satisfaction. Nevertheless, it is unrealistic to train the model online due to the high cost. As such, we have to leverage offline training data and disentangle the causal effect on user satisfaction. To achieve this goal, we propose a counterfactual interactive recommender system (CIRS) that augments offline reinforcement learning (offline RL) with causal inference. The basic idea is to first learn a causal user model on historical data to capture the overexposure effect of items on user satisfaction. It then uses the learned causal user model to help the planning of the RL policy. To conduct evaluation offline, we innovatively create an authentic RL environment (KuaiEnv) based on a real-world fully observed user rating dataset. The experiments show the effectiveness of CIRS in bursting filter bubbles and achieving long-term success in interactive recommendation. The implementation of CIRS is available via https://github.com/chongminggao/CIRS-codes.

For agents

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

get_harvested_code_for_paper("2204.01266")
get_code_for_paper("2204.01266")
have("2204.01266")

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

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

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

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

Connect an agent — have() is free.