SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.01162 · ICLR · 2021

Tilted Empirical Risk Minimization

Tian Li, Ahmad Facebook, Maziar Sanjabi, Virginia Smith

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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; 1 honoured the contract we drafted, 4 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 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/2007.01162.json · badge: /api/ran/2007.01162.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
istaustria-cvml/flea community
Papers with Code archive
5 ran · 1 no recorded run
litian96/TERM marked official in Papers with Code
Papers with Code archive
4 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_gradients_tilting Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
litian96/TERM/hierarchical/mixed_level1.py
code served (permissive licence) · get_code("fffbaed4c52dab4b")
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 ndarray, ndim 1, dtype family float, 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 numpy as np

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

# Parameters for the function
n_features = 4
n_samples_1 = 2
n_samples_2 = 2

# Create theta (model parameters)
theta = np.random.randn(n_features)

# Create X_1 and y_1 (first dataset)
X_1 = np.random.randn(n_samples_1, n_features)
y_1 = np.array([0, 1])

# Create X_2 and y_2 (second dataset)
X_2 = np.random.randn(n_samples_2, n_features)
y_2 = np.array([1, 0])

# Tilting parameters
t_in = 0.5
t_out = 0.3

ARGS = {
    "theta": theta,
    "X_1": X_1,
    "y_1": y_1,
    "X_2": X_2,
    "y_2": y_2,
    "t_in": t_in,
    "t_out": t_out,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 float, 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
cost_TERM Ran
ran; our contract draft was wrong, not the code
istaustria-cvml/flea/src/FLEA.py
code served (permissive licence) · get_code("b4a4c16131bfec48")
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 ArrayImpl, 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 jax
import jax.numpy as jnp
import numpy as np

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

# Create small test data
batch_size_a = 2
batch_size_b = 2
feature_dim = 4

# Xa: (2, 4) - features for dataset A
Xa = jnp.array(np.random.randn(batch_size_a, feature_dim), dtype=jnp.float32)

# ya: (2,) - binary labels for dataset A
ya = jnp.array(np.array([0.0, 1.0]), dtype=jnp.float32)

# Xb: (2, 4) - features for dataset B
Xb = jnp.array(np.random.randn(batch_size_b, feature_dim), dtype=jnp.float32)

# yb: (2,) - binary labels for dataset B
yb = jnp.array(np.array([1.0, 0.0]), dtype=jnp.float32)

# theta: (5,) - [intercept, w1, w2, w3, w4]
# First element is the intercept (c), rest are weights (w)
theta = jnp.array(np.random.randn(feature_dim + 1), dtype=jnp.float32)

# tau: temperature parameter for tilted loss
tau = 1.0

ARGS = {
    "theta": theta,
    "Xa": Xa,
    "ya": ya,
    "Xb": Xb,
    "yb": yb,
    "tau": tau,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
crossent Ran
ran, honoured the contract we drafted
istaustria-cvml/flea/src/FLEA.py
code served (permissive licence) · get_code("d3a4bb0de17305ec")
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 ArrayImpl, 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 jax
import jax.numpy as jnp

# The function crossent takes two arguments: x and y
# Both are used with jnp operations (clip, arithmetic, log, exp, mean)
# They should be JAX arrays with compatible shapes for element-wise operations

# Create small JAX arrays
x = jnp.array([[0.5, 1.2, -0.3, 2.1],
               [0.1, -0.5, 1.5, 0.8]], dtype=jnp.float32)

y = jnp.array([[1.0, 0.0, 1.0, 0.0],
               [0.0, 1.0, 0.0, 1.0]], dtype=jnp.float32)

ARGS = {
    "x": x,
    "y": y
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
logistic Ran
ran, violated the contract we drafted
istaustria-cvml/flea/src/FLEA.py
code served (permissive licence) · get_code("3592d26743a212ca")
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 ArrayImpl, ndim 1, dtype family float, 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 jax
import jax.numpy as jnp

@jax.jit
def logistic(r):
    return jax.scipy.special.expit(r)

# Create a small JAX array as input
# The function applies the logistic sigmoid function element-wise
r_value = jnp.array([0.0, 1.0, -1.0, 2.0])

ARGS = {
    "r": r_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 1, dtype family float, 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
loss Ran
ran, violated the contract we drafted
litian96/TERM/hierarchical/mixed_level1.py
code served (permissive licence) · get_code("cc0284ce34bec031")
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, 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 numpy as np
import torch

torch.manual_seed(0)

# The loss function takes h and y as parameters
# h: predicted probabilities (should be in range [0, 1])
# y: ground truth binary labels (0 or 1)
# Both should be numpy arrays of the same shape

# Create small example tensors and convert to numpy
h = np.array([[0.9, 0.1, 0.8, 0.2],
              [0.7, 0.3, 0.6, 0.4]], dtype=np.float32)

y = np.array([[1.0, 0.0, 1.0, 0.0],
              [1.0, 0.0, 0.0, 1.0]], dtype=np.float32)

ARGS = {
    'h': h,
    'y': y
}
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, 4) — shape (2, 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
predict_prob Ran
ran, violated the contract we drafted
litian96/TERM/hierarchical/mixed_level1.py
code served (permissive licence) · get_code("9062ac5b0aad4509")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Create small parameter vector theta
theta = np.array([0.5, -0.3, 0.2, 0.1])

# Create small feature matrix X (batch_size=2, num_features=4)
X = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [0.5, 1.5, 2.5, 3.5]
])

ARGS = {
    "theta": theta,
    "X": X
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 float, shape (2,) — shape (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
predict_proba Ran
ran; our contract draft was wrong, not the code
istaustria-cvml/flea/src/FLEA.py
code served (permissive licence) · get_code("6ed0279d608e9580")
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 ArrayImpl, ndim 1, dtype family float, shape (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 jax
import jax.numpy as jnp

# Set seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Create small test data
# theta: [c, w1, w2, w3, w4] - intercept + 4 weights
theta = jnp.array([0.5, 0.1, -0.2, 0.3, -0.1])

# X: batch of 2 samples, 4 features
X = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [0.5, 1.5, 2.5, 3.5]
])

ARGS = {
    'theta': theta,
    'X': X
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 1, dtype family float, shape (2,) — shape (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
sigmoid Ran
ran, violated the contract we drafted
litian96/TERM/hierarchical/mixed_level1.py
code served (permissive licence) · get_code("ea4aa57fb84c5048")
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 ndarray, ndim 1, dtype family float, 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 numpy as np

def sigmoid(z):
    return 1.0 / (1 + np.exp(-z))

# The sigmoid function takes a single parameter 'z' which should be a numeric value or array
# It computes the sigmoid function: 1 / (1 + exp(-z))

# Create a small numpy array as input
z_input = np.array([0.0, 1.0, -1.0, 2.0])

ARGS = {
    "z": z_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 float, 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
theta_to_cw Ran
ran; our contract draft was wrong, not the code
istaustria-cvml/flea/src/FLEA.py
code served (permissive licence) · get_code("b9aeb8b5d99c37d3")
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 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 jax
import jax.numpy as jnp

@jax.jit
def theta_to_cw(theta):
    return (theta[0], theta[1:])

# Create a simple JAX array as input
# theta should be a 1D array where we split the first element from the rest
theta_input = jnp.array([1.0, 2.0, 3.0, 4.0, 5.0])

ARGS = {
    "theta": theta_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — 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
predict_decision_function Not yet run
unverified (harvested, no recorded run)
istaustria-cvml/flea/src/FLEA.py
code served (permissive licence) · get_code("e7b75a8a5cbac25e")
How it ran

no invocation recorded.

Also present in other papers' code

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

Empirical risk minimization (ERM) is typically designed to perform well on the average loss, which can result in estimators that are sensitive to outliers, generalize poorly, or treat subgroups unfairly. While many methods aim to address these problems individually, in this work, we explore them through a unified frameworktilted empirical risk minimization (TERM). In particular, we show that it is possible to flexibly tune the impact of individual losses through a straightforward extension to ERM using a hyperparameter called the tilt. We provide several interpretations of the resulting framework: We show that TERM can increase or decrease the influence of outliers, respectively, to enable fairness or robustness; has variancereduction properties that can benefit generalization; and can be viewed as a smooth approximation to a superquantile method. We develop batch and stochastic firstorder optimization methods for solving TERM, and show that the problem can be efficiently solved relative to common alternatives. Finally, we demonstrate that TERM can be used for a multitude of applications, such as enforcing fairness between subgroups, mitigating the effect of outliers, and handling class imbalance. TERM is not only competitive with existing solutions tailored to these individual problems, but can also enable entirely new applications, such as simultaneously addressing outliers and promoting fairness.

For agents

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

get_harvested_code_for_paper("2007.01162")
get_code_for_paper("2007.01162")
have("2007.01162")

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

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

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

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

Connect an agent — have() is free.