SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.09319 · ICLR · 2025

Bridging Jensen Gap for Max-Min Group Fairness Optimization in Recommendation

Chen Xu, Jun Xu, Tat-Seng Chua, Yuxin Li, Liang Pang, Wenjie Wang

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 0 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/2502.09319.json · badge: /api/ran/2502.09319.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
xuchen0427/fairdual canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
FunctionStatusWhere it lives
Dual_Sampler Ran
ran on a synthesized input · constructed an object; no result was computed
xuchen0427/fairdual/sample_utils/Dual_sample.py
code served (permissive licence) · get_code("405133e4512a0c6e")
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 an instance of its own class, Dual_Sampler: the run constructed the object and did not call it, so no result was computed. 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 os
import tempfile
import yaml

# Create a temporary directory and yaml config file
temp_dir = tempfile.mkdtemp()
sample_utils_dir = os.path.join(temp_dir, 'sample_utils')
os.makedirs(sample_utils_dir, exist_ok=True)

# Create the yaml config file that the Dual_Sampler reads
yaml_config = {
    'update_epoch': 2,
    'topk': 1,
    'alpha': 0.5,
    'eta': 0.1,
    'lambd': 0.5
}

yaml_path = os.path.join(sample_utils_dir, 'Dual_sample.yaml')
with open(yaml_path, 'w') as f:
    yaml.dump(yaml_config, f)

# Change to temp directory so the yaml file can be found
original_cwd = os.getcwd()
os.chdir(temp_dir)

# Define parameters for Dual_Sampler
p_size = 5  # number of data points
train_len = 10  # training length
batch_size = 2  # batch size
data_size = 20  # total data size

# Create an adjacency matrix (p_size x p_size)
# This is used in update_weight to index rows
AdjecentMatrix = np.random.rand(p_size, p_size)

ARGS = {
    'p_size': p_size,
    'train_len': train_len,
    'AdjecentMatrix': AdjecentMatrix,
    'batch_size': batch_size,
    'data_size': data_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy, yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dual_Sampler — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Dual_Sampler 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
compute_next_dual Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xuchen0427/fairdual/sample_utils/Dual_sample.py
code served (permissive licence) · get_code("9a50827f746b0dc4")
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 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.

import numpy as np
import cvxpy as cp

# Set random seed for reproducibility
np.random.seed(0)

# Define small test inputs
eta = 0.1  # step size (scalar)
rho = np.array([1.0, 2.0, 0.5, 1.5])  # weights/scaling factors (m=4)
dual = np.array([0.1, -0.2, 0.3, -0.1])  # dual variables (m=4)
gradient = np.array([0.05, 0.1, -0.05, 0.15])  # gradient (m=4)
lambd = 0.5  # regularization parameter (scalar)

ARGS = {
    "eta": eta,
    "rho": rho,
    "dual": dual,
    "gradient": gradient,
    "lambd": lambd,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, 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 float — no output shape is stated: observe_signature.py could not observe it (no_result)
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
generate_prompt Ran
ran; our contract draft was wrong, not the code
xuchen0427/fairdual/inference.py
code served (permissive licence) · get_code("ec980d0edf81e31d")
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) and returned str. 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

ARGS = {
    'instruction': 'What is the capital of France?',
    'input': 'I need to know about European capitals.'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
map_layer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xuchen0427/fairdual/sample_utils/Dual_sample.py
code served (permissive licence) · get_code("7838fde34ecc5030")
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 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.

import cvxpy as cp
import numpy as np

torch = None  # not needed for this function

# Construct arguments for map_layer

# ordered_tilde_dual: a 1D array-like of size m
m = 5
ordered_tilde_dual = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

# rho: a 1D array-like of size m, used for weighted computation
rho = np.array([0.5, 1.0, 1.5, 2.0, 2.5])

# lambd: a scalar constraint parameter
lambd = 10.0

ARGS = {
    "ordered_tilde_dual": ordered_tilde_dual,
    "rho": rho,
    "lambd": lambd
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, 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 float — no output shape is stated: observe_signature.py could not observe it (no_result)
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 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 3 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
generate_prompt 3 other papers
2 dated earlier, 1 later
2308.08434 (2023-08)
A Bi-Step Grounding Paradigm for Large Language Models in Recommendation Systems
2412.09243 (2024-12)
SPRec: Self-Play to Debias LLM-based Recommendation
2601.22925 (2026-01)
BEAR: Towards Beam-Search-Aware Optimization for Recommendation with Large Language Models

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

Group max-min fairness (MMF) is commonly used in fairness-aware recommender systems (RS) as an optimization objective, as it aims to protect marginalized item groups and ensures a fair competition platform. However, our theoretical analysis indicates that integrating MMF constraint violates the assumption of sample independence during optimization, causing the loss function to deviate from linear additivity. Such nonlinearity property introduces the Jensen gap between the model's convergence point and the optimal point if mini-batch sampling is applied. Both theoretical and empirical studies show that as the mini-batch size decreases and the group size increases, the Jensen gap will widen accordingly. Some methods using heuristic re-weighting or debiasing strategies have the potential to bridge the Jensen gap. However, they either lack theoretical guarantees or suffer from heavy computational costs. To overcome these limitations, we first theoretically demonstrate that the MMF-constrained objective can be essentially reformulated as a group-weighted optimization objective. Then we present an efficient and effective algorithm named FairDual, which utilizes a dual optimization technique to minimize Jensen gap. Our theoretical analysis demonstrates that FairDual can achieve a sub-linear convergence rate to the globally optimal solution and the Jensen gap can be well bounded under a mini-batch sampling strategy with random shuffle. Extensive experiments conducted using six large-scale RS backbone models on three publicly available datasets demonstrate that FairDual outperforms all baselines in terms of both accuracy and fairness. Our data and codes are shared at https://github.com/XuChen0427/FairDual.

For agents

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

get_harvested_code_for_paper("2502.09319")
get_code_for_paper("2502.09319")
have("2502.09319")

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

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

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

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

Connect an agent — have() is free.