SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.08627 · ICML · 2022

RECAPP: Crafting a More Efficient Catalyst for Convex Optimization

Yair Carmon, Yujia Jin, Aaron Sidford, Arun Jambulapati

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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, 0 violated it and 1 has no contract verdict; 5 failures of our instrument; 5 no recorded run), measured 2026-11-24; 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/2206.08627.json · badge: /api/ran/2206.08627.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
yaircarmon/recapp canonical (classifier label)
classifier basis: classifier_2025
7 ran · 5 no recorded run
FunctionStatusWhere it lives
FiniteSumObjective Ran
ran on a synthesized input
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("4df9d76d8dfe9f5f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 numpy as np
import scipy
from scipy.special import expit as sigmoid
from scipy.special import logsumexp, softmax
from typing import Sequence

def binary_logistic_loss(w, X, y):
    s = -y * (X @ w)
    loss = np.logaddexp(0, s).mean(0)
    grad = -y * sigmoid(s) @ X / X.shape[0]
    return (loss, grad)

def multiclass_log_loss(w, X, y):
    s = X @ w
    s_true = s[np.arange(X.shape[0]), y]
    loss = (logsumexp(s, axis=1) - s_true).mean(0)
    p_softmax = softmax(s, axis=1)
    p_softmax[np.arange(X.shape[0]), y] -= 1
    grad = X.T @ p_softmax / X.shape[0]
    return (loss, grad)

def norm(M, **kwargs):
    if scipy.sparse.issparse(M):
        return scipy.sparse.linalg.norm(M, **kwargs)
    else:
        return scipy.linalg.norm(M, **kwargs)

def square_loss(w, X, y):
    err = X @ w - y
    loss = 0.5 * (err ** 2).mean(0)
    grad = err @ X / X.shape[0]
    return (loss, grad)

class FiniteSumObjective:

    def __init__(self, data, loss='logistic', l2_reg=0.0):
        self.X, self.y = data
        self.loss = loss
        self.l2_reg = l2_reg
        if loss == 'logistic':
            self._assert_binary_labels()
            self.loss_and_gradient = binary_logistic_loss
            self._smoothness = norm(self.X, ord=2, axis=1).max() / 4
            self._argument_shape = (self.X.shape[1],)
        elif loss == 'multiclass_log':
            _, self.y = np.unique(self.y, return_inverse=True)
            self.loss_and_gradient = multiclass_log_loss
            self.num_labels = self.y.max() + 1
            self._smoothness = norm(self.X, ord=2, axis=1).max() / 4
            self._argument_shape = (self.X.shape[1], self.num_labels)
        elif loss == 'square_binary':
            self._assert_binary_labels()
            self.loss_and_gradient = square_loss
            self._smoothness = norm(self.X, ord=2, axis=1).max()
            self._argument_shape = (self.X.shape[1],)
        else:
            raise ValueError(f'Unknown loss type {loss}')
        self._X_dense = None

    def eval_full(self, w):
        return self.eval_inds(w, slice(None))

    def eval_inds(self, w, i):
        if not isinstance(i, (Sequence, np.ndarray, slice)):
            i = [i]
        loss, grad = self.loss_and_gradient(w, self.X[i], self.y[i])
        if self.l2_reg > 0:
            loss += self.l2_reg / 2 * (w ** 2).sum()
            grad += self.l2_reg * w
        return (loss, grad)

    def _assert_binary_labels(self):
        labels = tuple(np.unique(self.y))
        if labels == (-1, 1):
            pass
        elif labels == (0, 1):
            self.y = 2 * self.y - 1
        elif labels == (1, 2):
            self.y = 2 * self.y - 3
        else:
            raise ValueError(f'Label values are {labels}; this is not consistent with binary classification')

    @property
    def smoothness(self):
        return self._smoothness

    @property
    def argument_shape(self):
        return self._argument_shape

    @property
    def n(self):
        return self.X.shape[0]

    @property
    def X_dense(self):
        if self._X_dense is None:
            if scipy.sparse.issparse(self.X):
                self._X_dense = self.X.toarray()
            else:
                self._X_dense = self.X
        return self._X_dense


X = np.random.randn(2, 4)
y = np.array([0, 1])
data = (X, y)

INIT_ARGS = {
    'data': data,
    'loss': 'logistic',
    'l2_reg': 0.01
}

w = np.random.randn(4)

ARGS = {
    'w': w,
    'i': slice(None)
}

METHOD = 'eval_inds'

obj = FiniteSumObjective(**INIT_ARGS)
result = getattr(obj, METHOD)(**ARGS)
print(f"Loss: {result[0]}, Grad shape: {result[1].shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, scipy — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
binary_logistic_loss Ran
ran; our contract draft was wrong, not the code
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("e7acbe776681ba90")
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 numpy as np
from scipy.special import expit as sigmoid

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

# Create small sample data
# X: feature matrix (batch_size=2, n_features=4)
X = np.random.randn(2, 4).astype(np.float64)

# w: weight vector (n_features=4,)
w = np.random.randn(4).astype(np.float64)

# y: binary labels (batch_size=2,) with values in {-1, 1} for logistic loss
y = np.array([-1.0, 1.0], dtype=np.float64)

ARGS = {
    "w": w,
    "X": X,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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
efficient_logistic_regression_svrg Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("60ca55a34ee76f7f")
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, 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
import numba

np.random.seed(0)

# Dimensions: batch_size=2, feature_dim=4
batch_size = 2
feature_dim = 4

# bA: matrix of shape (batch_size, feature_dim) - feature vectors for logistic regression
bA = np.random.randn(batch_size, feature_dim).astype(np.float64)

# x: current parameter vector of shape (feature_dim,)
x = np.random.randn(feature_dim).astype(np.float64)

# x_vr: variance reduction snapshot of shape (feature_dim,)
x_vr = np.random.randn(feature_dim).astype(np.float64)

# x_prox: proximal coefficient vector of shape (feature_dim,)
x_prox = np.random.randn(feature_dim).astype(np.float64)

# grad_x_vr: precomputed gradient at x_vr of shape (feature_dim,)
grad_x_vr = np.random.randn(feature_dim).astype(np.float64)

# eta: step size (scalar learning rate)
eta = 0.01

# prox_lambda: proximal parameter (scalar)
prox_lambda = 0.1

# l2_reg: L2 regularization coefficient (scalar)
l2_reg = 0.001

# tail_averaging_thresh: threshold for when to start averaging (scalar integer)
tail_averaging_thresh = 1

ARGS = {
    'bA': bA,
    'x': x,
    'x_vr': x_vr,
    'x_prox': x_prox,
    'grad_x_vr': grad_x_vr,
    'eta': eta,
    'prox_lambda': prox_lambda,
    'l2_reg': l2_reg,
    'tail_averaging_thresh': tail_averaging_thresh,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, 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
efficient_sparse_logistic_regression_svrg Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("d6566714749c202d")
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, 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
import numba

# Create small sparse matrix in CSR format
# We'll create a 5x4 sparse matrix (5 samples, 4 features)
n_samples = 5
n_features = 4
nnz = 8  # number of non-zero entries

# CSR format components
A_data = np.array([1.5, 2.0, 1.0, 0.5, 2.5, 1.2, 0.8, 1.3], dtype=np.float64)
A_indices = np.array([0, 2, 1, 3, 0, 1, 2, 3], dtype=np.int32)
A_indptr = np.array([0, 2, 4, 6, 7, 8], dtype=np.int32)

# Labels (binary classification)
b = np.array([1.0, -1.0, 1.0, -1.0, 1.0], dtype=np.float64)

# Sample indices to process
sample_inds = np.array([0, 1, 2, 3, 4], dtype=np.int64)

# Coefficient vectors
x = np.array([0.1, 0.2, 0.15, 0.05], dtype=np.float64)
x_vr = np.array([0.1, 0.2, 0.15, 0.05], dtype=np.float64)
x_prox = np.array([0.05, 0.1, 0.08, 0.02], dtype=np.float64)

# Gradient of x_vr (pre-computed full gradient)
grad_x_vr = np.array([0.01, 0.02, 0.015, 0.005], dtype=np.float64)

# Hyperparameters
eta = 0.01  # step size
prox_lambda = 0.1  # proximal parameter
l2_reg = 0.001  # L2 regularization
tail_averaging_thresh = 2  # start averaging after this many iterations

ARGS = {
    'sample_inds': sample_inds,
    'b': b,
    'A_data': A_data,
    'A_indices': A_indices,
    'A_indptr': A_indptr,
    'x': x,
    'x_vr': x_vr,
    'x_prox': x_prox,
    'grad_x_vr': grad_x_vr,
    'eta': eta,
    'prox_lambda': prox_lambda,
    'l2_reg': l2_reg,
    'tail_averaging_thresh': tail_averaging_thresh,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, 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
multiclass_log_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("6c3f7bcf62817357")
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 numpy as np
from scipy.special import logsumexp, softmax

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

# Create small test data
# X: (batch_size=2, num_features=4)
# y: (batch_size=2,) with class indices
# w: (num_features=4,) weight vector for 3 classes

batch_size = 2
num_features = 4
num_classes = 3

X = np.random.randn(batch_size, num_features).astype(np.float32)
y = np.array([0, 2], dtype=np.int64)  # class labels for each sample
w = np.random.randn(num_features, num_classes).astype(np.float32)

ARGS = {
    "w": w,
    "X": X,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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
norm Ran
ran, honoured the contract we drafted
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("d35071d927f4e662")
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 float64, ndim 0, 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 scipy
import numpy as np

# Create a dense matrix for testing
dense_matrix = np.array([[1.0, 2.0, 3.0],
                         [4.0, 5.0, 6.0],
                         [7.0, 8.0, 9.0]])

# Create a sparse matrix for testing
sparse_matrix = scipy.sparse.csr_matrix(dense_matrix)

# Test with dense matrix as M
M = dense_matrix

ARGS = {
    "M": M
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
square_loss Ran
ran; our contract draft was wrong, not the code
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("acdf7f747567c8b5")
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 torch
import numpy as np

torch.manual_seed(0)

# Construct arguments for square_loss(w, X, y)
# The function expects:
# - w: weight vector (1D tensor)
# - X: feature matrix (2D tensor, shape [batch_size, num_features])
# - y: target vector (1D tensor, shape [batch_size])

batch_size = 2
num_features = 4

# w: weight vector with shape [num_features]
w = torch.randn(num_features)

# X: feature matrix with shape [batch_size, num_features]
X = torch.randn(batch_size, num_features)

# y: target vector with shape [batch_size]
y = torch.randn(batch_size)

ARGS = {
    'w': w,
    'X': X,
    'y': y
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
MLMC_svrg Not yet run
unverified (harvested, no recorded run)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("08775ca0003e49ee")
How it ran

no invocation recorded.

RecappConfig Not yet run
unverified (harvested, no recorded run)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("6787bf6d5a7e0aa3")
How it ran

no invocation recorded.

one_epoch_svrg Not yet run
unverified (harvested, no recorded run)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("d92f3ca647808505")
How it ran

no invocation recorded.

recapp Not yet run
unverified (harvested, no recorded run)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("9fd40c963958257d")
How it ran

no invocation recorded.

warmstart_svrg Not yet run
unverified (harvested, no recorded run)
yaircarmon/recapp/recapp.py
code served (permissive licence) · get_code("4a2e8fd1c8861f78")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

The accelerated proximal point algorithm (APPA), also known as "Catalyst", is a wellestablished reduction from convex optimization to approximate proximal point computation (i.e., regularized minimization). This reduction is conceptually elegant and yields strong convergence rate guarantees. However, these rates feature an extraneous logarithmic term arising from the need to compute each proximal point to high accuracy. In this work, we propose a novel Relaxed Error Criterion for Accelerated Proximal Point (RECAPP) that eliminates the need for high accuracy subproblem solutions. We apply RECAPP to two canonical problems: finitesum and max-structured minimization. For finite-sum problems, we match the best known complexity, previously obtained by carefully-designed problem-specific algorithms. For minimizing max y f (x, y) where f is convex in x and strongly-concave in y, we improve on the best known (Catalyst-based) bound by a logarithmic factor.

For agents

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

get_harvested_code_for_paper("2206.08627")
get_code_for_paper("2206.08627")
have("2206.08627")

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

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

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

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

Connect an agent — have() is free.