SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.11687 · ICML · 2024

Nonsmooth Implicit Differentiation: Deterministic and Stochastic Convergence Rates

Riccardo Grazzi, Massimiliano Pontil, Saverio Salzo

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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 0 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2403.11687.json · badge: /api/ran/2403.11687.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
prolearner/nonsmooth_implicit_diff canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
FunctionStatusWhere it lives
NSID Ran
ran; our contract draft was wrong, not the code
prolearner/nonsmooth_implicit_diff/nonsmooth_implicit_diff/stoch_hg.py
code served (permissive licence) · get_code("bf4766f4db09ee56")
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 list. 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 torch.nn as nn
from typing import List, Callable

torch.manual_seed(0)

# Define small parameter and hyperparameter tensors
params = [
    torch.randn(4, 3, requires_grad=True),
    torch.randn(5, requires_grad=True),
]

hparams = [
    torch.randn(2, requires_grad=True),
    torch.randn(3, requires_grad=True),
]

# Define step_size as a float
step_size = 0.01

# Define K (number of iterations)
K = 5

# Define T_hat_map: takes params and hparams, returns list of tensors with same shapes as params
def T_hat_map(params: List[torch.Tensor], hparams: List[torch.Tensor]) -> List[torch.Tensor]:
    return [p + 0.01 * h[0].unsqueeze(0) for p, h in zip(params, [hparams[0], hparams[1]])]

# Define T_bar_map: takes params and hparams, returns list of tensors with same shapes as params
def T_bar_map(params: List[torch.Tensor], hparams: List[torch.Tensor]) -> List[torch.Tensor]:
    return [p + 0.005 * h[0].unsqueeze(0) for p, h in zip(params, [hparams[0], hparams[1]])]

# Define G_map: takes params and hparams, returns list of tensors
def G_map(params: List[torch.Tensor], hparams: List[torch.Tensor]) -> List[torch.Tensor]:
    return [p * (1 + 0.1 * h[0].unsqueeze(0)) for p, h in zip(params, [hparams[0], hparams[1]])]

# Define outer_loss: takes params and hparams, returns a scalar tensor
def outer_loss(params: List[torch.Tensor], hparams: List[torch.Tensor]) -> torch.Tensor:
    loss = torch.tensor(0.0, requires_grad=True)
    for p in params:
        loss = loss + (p ** 2).sum()
    for h in hparams:
        loss = loss + (h ** 2).sum()
    return loss

ARGS = {
    "params": params,
    "hparams": hparams,
    "step_size": step_size,
    "K": K,
    "T_hat_map": T_hat_map,
    "T_bar_map": T_bar_map,
    "G_map": G_map,
    "outer_loss": outer_loss,
    "tol": 1e-10,
    "set_grad": True,
    "verbose": False,
    "print_interval": 10,
}
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 list — a list 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
grd Ran
ran; our contract draft was wrong, not the code
prolearner/nonsmooth_implicit_diff/nonsmooth_implicit_diff/stoch_hg.py
code served (permissive licence) · get_code("cca4e9457ccfb881")
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 torch.nn as nn

torch.manual_seed(0)

# Create a simple computational graph
# a will be the output tensor we want to compute gradients for
# b will be the input tensor we're computing gradients with respect to

b = torch.randn(2, 4, requires_grad=True)
x = b * 2
a = (x ** 2).sum()

ARGS = {
    "a": a,
    "b": b,
}
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 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
list_dot Ran
ran, honoured the contract we drafted
prolearner/nonsmooth_implicit_diff/nonsmooth_implicit_diff/stoch_hg.py
code served (permissive licence) · get_code("457e946465d39415")
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 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)

# Analyze the function: list_dot takes two parameters l1 and l2
# It zips them together, multiplies corresponding elements, sums each product,
# stacks the results, and sums the final stack.
# This means l1 and l2 should be iterables of tensors.

# Create two lists of tensors with distinct sizes
l1 = [
    torch.randn(2, 4),
    torch.randn(3, 5),
    torch.randn(2, 3)
]

l2 = [
    torch.randn(2, 4),
    torch.randn(3, 5),
    torch.randn(2, 3)
]

ARGS = {
    "l1": l1,
    "l2": l2
}
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 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
NSID Not yet run
unverified (harvested, no recorded run)
prolearner/nonsmooth_implicit_diff/nonsmooth_implicit_diff/stoch_hg.py
code served (permissive licence) · get_code("c1acff888fd776ca")
How it ran

no invocation recorded.

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

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

We study the problem of efficiently computing the derivative of the fixed-point of a parametric nondifferentiable contraction map. This problem has wide applications in machine learning, including hyperparameter optimization, meta-learning and data poisoning attacks. We analyze two popular approaches: iterative differentiation (ITD) and approximate implicit differentiation (AID). A key challenge behind the nonsmooth setting is that the chain rule does not hold anymore. We build upon the work by Bolte et al. ( 2022), who prove linear convergence of nonsmooth ITD under a piecewise Lipschitz smooth assumption. In the deterministic case, we provide a linear rate for AID and an improved linear rate for ITD which closely match the ones for the smooth setting. We also introduce NSID, a new stochastic method to compute the implicit derivative when the contraction map is defined as the composition of an outer map and an inner map which is accessible only through a stochastic unbiased estimator. We establish rates for the convergence of NSID, encompassing the best available rates in the smooth setting. We present illustrative experiments confirming our analysis.

For agents

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

get_harvested_code_for_paper("2403.11687")
get_code_for_paper("2403.11687")
have("2403.11687")

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

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

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

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

Connect an agent — have() is free.