SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1902.06704 · 2019

Towards Non-saturating Recurrent Units for Modelling Long-term Dependencies

arXiv · PDF · Open in the Atlas

Code that ran

8 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 8 have no contract verdict; 0 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/1902.06704.json · badge: /api/ran/1902.06704.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
apsarath/NRU canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
Selozhd/UngatedRNN community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
act_name Ran
ran on a synthesized input
apsarath/NRU/nru_project/utils/utils.py
code served (permissive licence) · get_code("909774cc194496f7")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# The function act_name takes an 'activation' parameter
# It checks if activation is None, torch.sigmoid, torch.nn.LogSoftmax, or torch.tanh
# and returns a string based on the comparison

# Test with None
ARGS = {
    'activation': None
}
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 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
compute_sequence_lengths Ran
ran on a synthesized input
Selozhd/UngatedRNN/tf_tools.py
code served (permissive licence) · get_code("cfe4e510a991ea63")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Create small tensor inputs
batch_size = 2
sequence_length = 4
feature_dim = 3

# Create sample input tensor
inputs = tf.constant(
    np.random.randn(batch_size, sequence_length, feature_dim).astype(np.float32)
)

# Create sample mask tensor (batch_size x sequence_length)
mask = tf.constant(
    np.array([[1.0, 1.0, 1.0, 0.0],
              [1.0, 1.0, 0.0, 0.0]], dtype=np.float32)
)

ARGS = {
    "inputs": inputs,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
cosine_similarity Ran
ran on a synthesized input
Selozhd/UngatedRNN/tf_tools.py
code served (permissive licence) · get_code("6694cfdd3a8e5d7a")
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 EagerTensor, ndim 2, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

# Create small tensors for x and y
# x: shape (2, 4) - 2 samples, 4 dimensions
# y: shape (4, 3) - 4 dimensions input, 3 dimensions output
x = tf.constant([[1.0, 2.0, 3.0, 4.0],
                 [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

y = tf.constant([[1.0, 0.5, 0.2],
                 [0.3, 0.7, 0.1],
                 [0.2, 0.3, 0.5],
                 [0.1, 0.2, 0.3]], dtype=tf.float32)

ARGS = {
    'x': x,
    'y': y,
    'name': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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, 3) — shape (2, 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
download_and_parse_mnist_file Ran
ran on a synthesized input
apsarath/NRU/nru_project/task/load_mnist.py
code served (permissive licence) · get_code("fdb63c23e69ffcc5")
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 int, shape (3, 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 tempfile
import os
import gzip
import struct
import array

# Create a minimal valid IDX file for testing
def create_test_idx_file(target_dir, fname):
    """Create a small valid IDX file for testing parse_idx"""
    filepath = os.path.join(target_dir, fname)
    
    # IDX format: 2 zero bytes + data type byte + num dimensions byte + dimension sizes + data
    with gzip.open(filepath, 'wb') as f:
        # Header: zeros (2 bytes), data_type (1 byte), num_dimensions (1 byte)
        # Using data_type 8 (unsigned byte 'B') and 2 dimensions
        f.write(struct.pack('>HBB', 0, 8, 2))
        
        # Dimension sizes: 2 dimensions of size 3 and 4 (3x4 = 12 items)
        f.write(struct.pack('>II', 3, 4))
        
        # Data: 12 bytes of pixel values
        data = array.array('B', range(12))
        data.byteswap()
        f.write(data.tobytes())
    
    return filepath

# Create temporary directory and test file
target_dir = tempfile.gettempdir()
test_fname = "test_mnist_file.gz"
create_test_idx_file(target_dir, test_fname)

ARGS = {
    'fname': test_fname,
    'target_dir': target_dir,
    'force': False
}
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 int, shape (3, 4) — shape (3, 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
download_file Ran
ran on a synthesized input
apsarath/NRU/nru_project/task/load_mnist.py
code served (permissive licence) · get_code("cc21f73dafd45cce")
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
import tempfile
from urllib.parse import urljoin
from urllib.request import urlretrieve

# Mock the urlretrieve and urljoin since we can't actually download
import unittest.mock as mock

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a dummy file to simulate an existing download
dummy_file_path = os.path.join(temp_dir, "test_file.bin")
with open(dummy_file_path, 'w') as f:
    f.write("dummy content")

ARGS = {
    'fname': 'test_file.bin',
    'target_dir': temp_dir,
    'force': False
}
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
my_variable Ran
ran on a synthesized input
apsarath/NRU/nru_project/utils/utils.py
code served (permissive licence) · get_code("e596020ee768543c")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.autograd import Variable

torch.manual_seed(0)

# Create a small tensor as input
input_tensor = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    "input": input_tensor,
    "use_gpu": False,
    "volatile": False,
    "requires_grad": True,
}
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 Tensor, 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
parse_idx Ran
ran on a synthesized input
apsarath/NRU/nru_project/task/load_mnist.py
code served (permissive licence) · get_code("2f7108d6302e9487")
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 int, shape (3, 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 io
import struct
import array

def create_valid_idx_file():
    """Create a valid IDX file in memory."""
    buffer = io.BytesIO()
    
    # Write header: zeros (2 bytes), data_type (1 byte), num_dimensions (1 byte)
    # zeros = 0, data_type = 8 (unsigned byte 'B'), num_dimensions = 2
    buffer.write(struct.pack('>HBB', 0, 8, 2))
    
    # Write dimension sizes: 3x4 (2 dimensions)
    buffer.write(struct.pack('>II', 3, 4))
    
    # Write data: 3*4 = 12 unsigned bytes
    data = array.array('B', range(12))
    data.byteswap()
    buffer.write(data.tobytes())
    
    # Reset position to beginning for reading
    buffer.seek(0)
    return buffer

fd = create_valid_idx_file()

ARGS = {
    'fd': fd
}
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 int, shape (3, 4) — shape (3, 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
tf_matmul Ran
ran on a synthesized input
Selozhd/UngatedRNN/tf_tools.py
code served (permissive licence) · get_code("3f581dc99da25b47")
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 EagerTensor, ndim 2, 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 tensorflow as tf

# Create small test tensors for tf_matmul
x_1d = tf.constant([1.0, 2.0, 3.0, 4.0], dtype=tf.float32)
y_1d = tf.constant([5.0, 6.0, 7.0, 8.0], dtype=tf.float32)

x_2d = tf.constant([[1.0, 2.0, 3.0, 4.0],
                     [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)
y_2d = tf.constant([[9.0, 10.0],
                    [11.0, 12.0],
                    [13.0, 14.0],
                    [15.0, 16.0]], dtype=tf.float32)

# Test case 1: 1D vectors (inner product case)
ARGS = {
    "x": x_1d,
    "y": y_1d,
    "name": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 — no output shape is stated: observe_signature.py recorded SymbolicTensor ndim 2, 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
create_config Not yet run
unverified (harvested, no recorded run)
apsarath/NRU/nru_project/utils/utils.py
code served (permissive licence) · get_code("33a1f20d474facef")
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

Modelling long-term dependencies is a challenge for recurrent neural networks. This is primarily due to the fact that gradients vanish during training, as the sequence length increases. Gradients can be attenuated by transition operators and are attenuated or dropped by activation functions. Canonical architectures like LSTM alleviate this issue by skipping information through a memory mechanism. We propose a new recurrent architecture (Non-saturating Recurrent Unit; NRU) that relies on a memory mechanism but forgoes both saturating activation functions and saturating gates, in order to further alleviate vanishing gradients. In a series of synthetic and real world tasks, we demonstrate that the proposed model is the only model that performs among the top 2 models across all tasks with and without long-term dependencies, when compared against a range of other architectures.

For agents

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

get_harvested_code_for_paper("1902.06704")
get_code_for_paper("1902.06704")
have("1902.06704")

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

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

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

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

Connect an agent — have() is free.