SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.12785 · NeurIPS · 2020

ShiftAddNet: A Hardware-Inspired Deep Network

Zhangyang Wang, Haoran You, Xiaohan Chen, Yongan Zhang, Chaojian Li, Sicheng Li, Zihao Liu, Yingyan Lin

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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 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/2010.12785.json · badge: /api/ran/2010.12785.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
RICE-EIC/ShiftAddNet canonical (classifier label)
classifier basis: census
3 ran · 1 no recorded run
FunctionStatusWhere it lives
adder2d_function Ran
ran on a synthesized input
RICE-EIC/ShiftAddNet/models/adder.py
code served (permissive licence) · get_code("1294aa155bf8944f")
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 4, dtype family float, shape (2, 4, 3, 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 torch
import math

torch.manual_seed(0)

# Create small test tensors
# X: (batch_size=2, channels=3, height=5, width=5)
X = torch.randn(2, 3, 5, 5)

# W: (n_filters=4, d_filter=3, h_filter=3, w_filter=3)
W = torch.randn(4, 3, 3, 3)

# stride and padding parameters
stride = 1
padding = 0

ARGS = {
    'X': X,
    'W': W,
    'stride': stride,
    'padding': padding
}
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 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 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
load_add_state_dict Ran
ran on a synthesized input
RICE-EIC/ShiftAddNet/generate_feature.py
code served (permissive licence) · get_code("82606b9cae77b5bf")
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 OrderedDict. 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 OrderedDict

torch.manual_seed(0)

# Create a mock state_dict that resembles a ResNet-like architecture
# The function transforms weight keys by replacing 'weight' with 'adder' 
# (except for conv1, bn layers, fc layers, and downsample.1)
state_dict = OrderedDict()

# conv1.weight - should NOT be transformed
state_dict['conv1.weight'] = torch.randn(4, 3, 3, 3)

# bn1.weight - should NOT be transformed (contains 'bn')
state_dict['bn1.weight'] = torch.randn(4)

# layer1.0.conv1.weight - should be transformed to layer1.0.adder
state_dict['layer1.0.conv1.weight'] = torch.randn(4, 4, 3, 3)

# layer1.0.conv2.weight - should be transformed to layer1.0.adder
state_dict['layer1.0.conv2.weight'] = torch.randn(4, 4, 3, 3)

# layer1.0.bn1.weight - should NOT be transformed (contains 'bn')
state_dict['layer1.0.bn1.weight'] = torch.randn(4)

# layer1.0.downsample.1.weight - should NOT be transformed (contains 'downsample.1')
state_dict['layer1.0.downsample.1.weight'] = torch.randn(4, 4, 1, 1)

# layer2.0.conv1.weight - should be transformed to layer2.0.adder
state_dict['layer2.0.conv1.weight'] = torch.randn(8, 4, 3, 3)

# fc.weight - should NOT be transformed (contains 'fc')
state_dict['fc.weight'] = torch.randn(10, 8)

# fc.bias - should NOT be transformed (no 'weight' in key)
state_dict['fc.bias'] = torch.randn(10)

ARGS = {
    'state_dict': state_dict
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
load_shiftadd_state_dict Ran
ran on a synthesized input
RICE-EIC/ShiftAddNet/generate_feature.py
code served (permissive licence) · get_code("5733b68d3e817cf1")
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 OrderedDict. 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 OrderedDict

torch.manual_seed(0)

# Create a mock state_dict with weights and biases
# The function filters and transforms weight keys, so we need various patterns
state_dict = OrderedDict()

# Regular conv weight (should have 'weight' in key and get transformed to 'adder')
state_dict['layer1.conv.weight'] = torch.randn(4, 3, 3, 3)

# Conv1 weight (should NOT be transformed - special case)
state_dict['conv1.weight'] = torch.randn(4, 3, 3, 3)

# Batch norm weight (should NOT be transformed - has 'bn' in key)
state_dict['layer1.bn.weight'] = torch.randn(4)

# Fully connected weight (should NOT be transformed - has 'fc' in key)
state_dict['fc.weight'] = torch.randn(4, 3)

# Downsample weight (should NOT be transformed - has 'downsample.2' in key)
state_dict['layer1.downsample.2.weight'] = torch.randn(4, 3, 3, 3)

# Another regular conv weight (should be transformed)
state_dict['layer2.block.conv.weight'] = torch.randn(4, 3, 3, 3)

# Bias (should pass through unchanged)
state_dict['layer1.conv.bias'] = torch.randn(4)

ARGS = {
    'state_dict': state_dict
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
accuracy Not yet run
unverified (harvested, no recorded run)
RICE-EIC/ShiftAddNet/generate_feature.py
code served (permissive licence) · get_code("f0c9a29156911331")
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 4 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 2 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
accuracy 71 other papers
42 dated earlier, 29 later · 2 only as an assembly brick
1505.05424 (2015-05)
Weight Uncertainty in Neural Networks
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1802.10399 (2018-02)
Compressing Neural Networks using the Variational Information Bottleneck
and 68 more not named here
adder2d_function 1 other paper
1 dated earlier
1912.13200 (2019-12)
AdderNet: Do We Really Need Multiplications in Deep Learning?

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

Multiplication (e.g., convolution) is arguably a cornerstone of modern deep neural networks (DNNs). However, intensive multiplications cause expensive resource costs that challenge DNNs' deployment on resource-constrained edge devices, driving several attempts for multiplication-less deep networks. This paper presented ShiftAddNet, whose main inspiration is drawn from a common practice in energyefficient hardware implementation, that is, multiplication can be instead performed with additions and logical bit-shifts. We leverage this idea to explicitly parameterize deep networks in this way, yielding a new type of deep network that involves only bit-shift and additive weight layers. This hardware-inspired ShiftAddNet immediately leads to both energy-efficient inference and training, without compromising the expressive capacity compared to standard DNNs. The two complementary operation types (bit-shift and add) additionally enable finer-grained control of the model's learning capacity, leading to more flexible trade-off between accuracy and (training) efficiency, as well as improved robustness to quantization and pruning. We conduct extensive experiments and ablation studies, all backed up by our FPGA-based ShiftAddNet implementation and energy measurements. Compared to existing DNNs or other multiplication-less models, ShiftAddNet aggressively reduces over 80% hardware-quantified energy cost of DNNs training and inference, while offering comparable or better accuracies. Codes and pre-trained models are available at https://github.com/RICE-EIC/ShiftAddNet.

For agents

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

get_harvested_code_for_paper("2010.12785")
get_code_for_paper("2010.12785")
have("2010.12785")

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

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

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

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

Connect an agent — have() is free.