SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1502.05767 · 2015

Automatic differentiation in machine learning: a survey

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/1502.05767.json · badge: /api/ran/1502.05767.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
bigaidream-projects/drmad community (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
datapath Ran
ran on a synthesized input
bigaidream-projects/drmad/cpu_ver/hypergrad/cifar10.py
code served (permissive licence) · get_code("9aeb785d120a1afa")
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 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 os

datadir = os.path.expanduser('~/repos/drmad/data/cifar10')

def datapath(fname):
    return os.path.join(datadir, fname)

# The function takes a single parameter 'fname' which is a filename string
# and returns the full path by joining it with datadir using os.path.join

ARGS = {
    'fname': 'train_batch_1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
datapath Ran
ran on a synthesized input
bigaidream-projects/drmad/cpu_ver/hypergrad/data.py
code served (permissive licence) · get_code("8530312518e21c41")
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 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 os

# The function datapath takes a single parameter 'fname' which is a filename string
# It simply constructs a path by joining a data directory with the filename
# No complex objects needed - just a simple string filename

ARGS = {
    'fname': 'train.pkl'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
format_as Ran
ran on a synthesized input
bigaidream-projects/drmad/gpu_ver/hypergrad.py
code served (permissive licence) · get_code("c77cfd4cb69810a9")
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 list, ndim 3, 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 torch

torch.manual_seed(0)

# The function format_as takes three parameters:
# 1. use_list: boolean flag
# 2. use_tuple: boolean flag
# 3. outputs: can be a single value, a list, or a tuple

# Let's create test cases for different scenarios:
# Scenario 1: use_list=True, outputs is a single tensor
# Scenario 2: use_tuple=True, outputs is a single tensor
# Scenario 3: use_list=False, use_tuple=False, outputs is a single tensor
# Scenario 4: use_list=True, outputs is already a list
# Scenario 5: use_tuple=True, outputs is already a tuple

# We'll go with a simple case that exercises the main logic
outputs_single = torch.randn(2, 4)
outputs_list = [torch.randn(2, 4), torch.randn(3, 5)]
outputs_tuple = (torch.randn(2, 4),)

ARGS = {
    "use_list": True,
    "use_tuple": False,
    "outputs": outputs_single
}
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 list, ndim 3, dtype family float — a list 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
getval Ran
ran on a synthesized input
bigaidream-projects/drmad/cpu_ver/funkyyak/scheme/core.py
code served (permissive licence) · get_code("306d1cf5e4cb6fad")
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 tape. 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
from collections import namedtuple

torch.manual_seed(0)

call = namedtuple('call', ('funname', 'args'))
kyfun = namedtuple('kyfun', ('argnames', 'body', 'env'))
grad = namedtuple('grad', ('funname', 'argnum'))
tape = namedtuple('tape', ('value', 'env'))

# Create a tape object with required structure
tape_env = {
    'outgrad': kyfun(
        argnames=(),
        body=call('identity', ()),
        env={}
    )
}
tape_value = torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]])
tape_obj = tape(value=tape_value, env=tape_env)

# Create a grad object
grad_obj = grad(funname='mul', argnum=0)

# Create a local environment dict
localenv = {
    'add': kyfun(
        argnames=('a', 'b'),
        body=call('add_impl', ()),
        env={}
    ),
    'outgrad': kyfun(
        argnames=(),
        body=call('zero', ()),
        env={}
    )
}

ARGS = {
    'arg': tape_obj,
    'grad': grad_obj,
    'localenv': localenv
}
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 tape — a tape 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
make_exp_kernel Ran
ran on a synthesized input
bigaidream-projects/drmad/cpu_ver/hypergrad/kernel_methods.py
code served (permissive licence) · get_code("35a6803eda0b78c1")
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 function. 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

# L0 is a length scale parameter used in the exponential kernel
# It should be a positive scalar value
L0 = 0.5

ARGS = {
    "L0": L0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
make_sq_exp_kernel Ran
ran on a synthesized input
bigaidream-projects/drmad/cpu_ver/hypergrad/kernel_methods.py
code served (permissive licence) · get_code("9100a3ac53dc7b36")
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 function. 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

# L0 is a length scale parameter for the squared exponential kernel
# It should be a positive float value
L0 = 0.5

ARGS = {
    "L0": L0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
weighted_neighbors_loss Ran
ran on a synthesized input
bigaidream-projects/drmad/cpu_ver/hypergrad/kernel_methods.py
code served (permissive licence) · get_code("028b580dcd973ebd")
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 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 numpy as np

def kernel_fn(X_valid, X_train):
    """Simple kernel that computes similarity weights."""
    # X_valid: (n_valid, d), X_train: (n_train, d)
    # Returns (n_valid, n_train) weight matrix
    n_valid = X_valid.shape[0]
    n_train = X_train.shape[0]
    # Simple RBF-like kernel: exp(-||x_valid - x_train||^2)
    weights = np.zeros((n_valid, n_train))
    for i in range(n_valid):
        for j in range(n_train):
            dist_sq = np.sum((X_valid[i] - X_train[j]) ** 2)
            weights[i, j] = np.exp(-dist_sq)
    return weights

# Create small training data
# X_train: (n_train=3, d=4), T_train: (n_train=3, n_classes=2)
X_train = np.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.6, 0.7, 0.8],
    [0.9, 1.0, 1.1, 1.2]
], dtype=np.float32)

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

# Create small validation data
# X_valid: (n_valid=2, d=4), T_valid: (n_valid=2, n_classes=2)
X_valid = np.array([
    [0.2, 0.3, 0.4, 0.5],
    [0.8, 0.9, 1.0, 1.1]
], dtype=np.float32)

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

train_data = (X_train, T_train)
valid_data = (X_valid, T_valid)

ARGS = {
    'train_data': train_data,
    'valid_data': valid_data,
    'kernel': kernel_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
load_data Not yet run
unverified (harvested, no recorded run)
bigaidream-projects/drmad/cpu_ver/hypergrad/cifar10.py
code served (permissive licence) · get_code("96e9899611d6d9f6")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
bigaidream-projects/drmad/cpu_ver/hypergrad/data.py
code served (permissive licence) · get_code("56dfab3bce86044d")
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

Derivatives, mostly in the form of gradients and Hessians, are ubiquitous in machine learning. Automatic differentiation (AD), also called algorithmic differentiation or simply "autodiff", is a family of techniques similar to but more general than backpropagation for efficiently and accurately evaluating derivatives of numeric functions expressed as computer programs. AD is a small but established field with applications in areas including computational fluid dynamics, atmospheric sciences, and engineering design optimization. Until very recently, the fields of machine learning and AD have largely been unaware of each other and, in some cases, have independently discovered each other's results. Despite its relevance, general-purpose AD has been missing from the machine learning toolbox, a situation slowly changing with its ongoing adoption under the names "dynamic computational graphs" and "differentiable programming". We survey the intersection of AD and machine learning, cover applications where AD has direct relevance, and address the main implementation techniques. By precisely defining the main differentiation techniques and their interrelationships, we aim to bring clarity to the usage of the terms "autodiff", "automatic differentiation", and "symbolic differentiation" as these are encountered more and more in machine learning settings.

For agents

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

get_harvested_code_for_paper("1502.05767")
get_code_for_paper("1502.05767")
have("1502.05767")

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

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

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

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

Connect an agent — have() is free.