SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1606.08415 · 2016

Gaussian Error Linear Units (GELUs)

Dan Hendrycks, Kevin Gimpel

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 (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 1 failure 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/1606.08415.json · badge: /api/ran/1606.08415.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
hendrycks/GELUs canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
MaximeVandegar/Papers-in-100-Lines-of-Code community
Papers with Code archive
1 ran · 0 no recorded run
nardeas/MHGAN community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
GELU Ran
ran on a synthesized input · constructed an object; no result was computed
MaximeVandegar/Papers-in-100-Lines-of-Code/Gaussian_Error_Linear_Units_GELUs/gelu.py
code served (permissive licence) · get_code("947842dcbef5f862")
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, GELU: 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 torch
import numpy as np
import torch.nn as nn

torch.manual_seed(0)

class GELU(nn.Module):

    def __init__(self, alpha=1.0):
        super(GELU, self).__init__()
        self.alpha = alpha

    def forward(self, x):
        return x * 0.5 * (1 + torch.erf(x / np.sqrt(2.0)))

ARGS = {
    'alpha': 1.0
}
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 GELU — 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 GELU 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
add_context Ran
ran on a synthesized input
hendrycks/GELUs/timit_fcn.py
code served (permissive licence) · get_code("35c1769491b04ae0")
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 (3, 78) 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

# The function add_context takes a sentence (which should be a list/array of coefficient vectors)
# and num_frames (number of context frames, must be odd)
# It returns a reshaped array with context added

# Create a small sentence with vectors of n_coeffs=26 dimensions
# Using a small sentence with 3 time steps
sentence = np.random.randn(3, 26).astype(np.float32)

ARGS = {
    "sentence": sentence,
    "num_frames": 3
}
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 ndarray, ndim 2, dtype family float, shape (3, 78) — shape (3, 78) 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
embeddings_to_dict Ran
ran on a synthesized input
hendrycks/GELUs/twitter_pos.py
code served (permissive licence) · get_code("7d646d3612cadf34")
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 dict. 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 io
import tempfile
import os

# Create a temporary file with word embeddings in the expected format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf-8')
temp_filename = temp_file.name

# Write sample embeddings data in the format: word[tab]dim1[space]dim2[space]...[space]dim50
embeddings_data = [
    "hello\t0.1 0.2 0.3 0.4 0.5",
    "world\t0.6 0.7 0.8 0.9 1.0",
    "python\t1.1 1.2 1.3 1.4 1.5"
]

for line in embeddings_data:
    temp_file.write(line + '\n')

temp_file.close()

ARGS = {
    'filename': temp_filename
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
gelu Ran
ran, honoured the contract we drafted
nardeas/MHGAN/mhgan/ops.py
code served (permissive licence) · get_code("f34536b4c0da6083")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor for testing
x_value = tf.constant([[1.0, 2.0, 3.0, 4.0],
                       [0.5, 1.5, 2.5, 3.5]], dtype=tf.float32)

ARGS = {
    'x': x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
load_batch Ran
ran on a synthesized input
hendrycks/GELUs/load_cifar10.py
code served (permissive licence) · get_code("8633f606824fb007")
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 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 pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'batch.pkl')

# Create sample data that matches what load_batch expects
sample_data = {
    'data': [[1, 2, 3, 4], [5, 6, 7, 8]],
    'labels': [0, 1]
}

# Write the pickle file
with open(temp_file, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    'fpath': temp_file
}
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 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
to_categorical Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hendrycks/GELUs/load_cifar10.py
code served (permissive licence) · get_code("70f5b5175a23f59d")
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 (5, 3) 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

# The function to_categorical takes:
# - y: array-like of class indices
# - nb_classes: number of classes (int or None/falsy)

# Create a small sample of class indices
y_sample = np.array([0, 1, 2, 1, 0])

# Set number of classes
nb_classes_value = 3

ARGS = {
    'y': y_sample,
    'nb_classes': nb_classes_value
}
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 ndarray, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
unpickle Ran
ran on a synthesized input
hendrycks/GELUs/SGDR_WRNs_gelu.py
code served (permissive licence) · get_code("9cf114efaf65dc13")
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 dict. 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 pickle
import tempfile
import os

# Create a temporary pickle file for the unpickle function to read
temp_dir = tempfile.mkdtemp()
test_data = {"key1": "value1", "key2": [1, 2, 3], "key3": {"nested": "dict"}}
test_file = os.path.join(temp_dir, "test.pkl")

with open(test_file, 'wb') as f:
    pickle.dump(test_data, f)

ARGS = {
    "file": test_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
enumerate_context Not yet run
unverified (harvested, no recorded run)
hendrycks/GELUs/timit_fcn.py
code served (permissive licence) · get_code("ada13f1c1f56cd40")
How it ran

no invocation recorded.

load_data10 Not yet run
unverified (harvested, no recorded run)
hendrycks/GELUs/load_cifar10.py
code served (permissive licence) · get_code("9db68167799bea76")
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, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 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
to_categorical 3 other papers
3 later
1608.00530 (2016-08)
Early Methods for Detecting Adversarial Images
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
aaai_28047 (2024 (year only))
Rethinking Robustness of Model Attributions
load_batch 2 other papers
2 later
1608.00530 (2016-08)
Early Methods for Detecting Adversarial Images
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
load_data10 2 other papers
2 later
1608.00530 (2016-08)
Early Methods for Detecting Adversarial Images
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
unpickle 2 other papers
2 later
1608.00530 (2016-08)
Early Methods for Detecting Adversarial Images
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
embeddings_to_dict 1 other paper
1 later
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
gelu
brick of this paper's assembly: entry
1 other paper
1 later
1811.11357 (2018-11)
Metropolis-Hastings Generative Adversarial Networks

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

We propose the Gaussian Error Linear Unit (GELU), a high-performing neural network activation function. The GELU activation function is xΦ(x), where Φ(x) the standard Gaussian cumulative distribution function. The GELU nonlinearity weights inputs by their value, rather than gates inputs by their sign as in ReLUs (x1 x>0 ). We perform an empirical evaluation of the GELU nonlinearity against the ReLU and ELU activations and find performance improvements across all considered computer vision, natural language processing, and speech tasks.

For agents

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

get_harvested_code_for_paper("1606.08415")
get_code_for_paper("1606.08415")
have("1606.08415")

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

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

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

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

Connect an agent — have() is free.