SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.08012 · 2023

AutoFHE: Automated Adaption of CNNs for Efficient Evaluation over FHE

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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; 3 honoured the contract we drafted, 0 violated it and 0 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/2310.08012.json · badge: /api/ran/2310.08012.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
human-analysis/AutoFHE canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
eval_poly Ran
ran; our contract draft was wrong, not the code
human-analysis/AutoFHE/search/models/activation.py
code served (permissive licence) · get_code("75fb9ab50069d8da")
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. 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)

# Construct arguments for eval_poly
x = torch.randn(2, 4)  # Small tensor: batch size 2, dimension 4
coeff = [0.5, 1.2, 0.3, 2.1, 0.7, 1.8, 0.2]  # List of coefficients

ARGS = {
    "x": x,
    "coeff": coeff
}
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
select Ran
ran, honoured the contract we drafted
human-analysis/AutoFHE/search/evolution.py
code served (permissive licence) · get_code("ae2424c41336eb30")
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 1, dtype family int; 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

# Construct arguments for the select function
# The function expects:
# - fronts: a list of numpy arrays (fronts in multi-objective optimization)
# - NP: an integer (population size)
# - pressure: an integer with default value 3 (tournament pressure)

# Create some small front arrays for multi-objective optimization
# Each front is a 1D array of rank/fitness values
front1 = np.array([0.5, 0.3, 0.8, 0.2])
front2 = np.array([0.9, 0.1])
front3 = np.array([0.6, 0.4, 0.7])

fronts = [front1, front2, front3]

# Population size to select
NP = 5

# Tournament pressure (number of candidates to compare)
pressure = 3

ARGS = {
    "fronts": fronts,
    "NP": NP,
    "pressure": pressure
}
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 list, ndim 1, dtype family int — 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
train Ran
ran, honoured the contract we drafted
human-analysis/AutoFHE/search/helper.py
code served (permissive licence) · get_code("36eaee98c81df5c9")
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 float, 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
import torch.nn as nn
import torchmetrics

torch.manual_seed(0)

# Tiny student model
class StudentModel(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Tiny teacher model
class TeacherModel(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Create models
num_classes = 3
model = StudentModel(num_classes=num_classes)
teacher = TeacherModel(num_classes=num_classes)

# Create tiny train loader: list of (images, targets) tuples
train_loader = [
    (torch.randn(2, 4), torch.randint(0, num_classes, (2,))),
    (torch.randn(2, 4), torch.randint(0, num_classes, (2,))),
]

# Create optimizer
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Device
device = torch.device('cpu')

ARGS = {
    'model': model,
    'teacher': teacher,
    'train_loader': train_loader,
    'optimizer': optimizer,
    'num_classes': num_classes,
    'device': device,
    'grad_clip': 1.0,
    'alpha': 0.9,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
validate Ran
ran, honoured the contract we drafted
human-analysis/AutoFHE/search/helper.py
code served (permissive licence) · get_code("52b18766423d228b")
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 float, 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
import torch.nn as nn
import torchmetrics

torch.manual_seed(0)

# Define a minimal model that takes images and outputs logits
class SimpleModel(nn.Module):
    def __init__(self, num_classes):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        # x shape: (batch, 4)
        return self.fc(x)

# Create model
num_classes = 5
model = SimpleModel(num_classes=num_classes)

# Create validation loader as a list of (images, targets) tuples
# Each image is a small tensor of shape (1, 4) to match model input
# Batch size 2, so we stack to get (2, 4)
val_loader = [
    (torch.randn(2, 4), torch.randint(0, num_classes, (2,))),
    (torch.randn(2, 4), torch.randint(0, num_classes, (2,))),
]

device = torch.device('cpu')

ARGS = {
    'model': model,
    'val_loader': val_loader,
    'num_classes': num_classes,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
coeffs2ckks Not yet run
unverified (harvested, no recorded run)
human-analysis/AutoFHE/search/ckks.py
code served (permissive licence) · get_code("5e43d3caa917fa9d")
How it ran

no invocation recorded.

create_subloader Not yet run
unverified (harvested, no recorded run)
human-analysis/AutoFHE/search/datasets.py
code served (permissive licence) · get_code("c8e61707f6338fa0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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

Secure inference of deep convolutional neural networks (CNNs) under RNS-CKKS involves polynomial approximation of unsupported non-linear activation functions. However, existing approaches have three main limitations: 1) Inflexibility: The polynomial approximation and associated homomorphic evaluation architecture are customized manually for each CNN architecture and do not generalize to other networks. 2) Suboptimal Approximation: Each activation function is approximated instead of the function represented by the CNN. 3) Restricted Design: Either high-degree or low-degree polynomial approximations are used. The former retains high accuracy but slows down inference due to bootstrapping operations, while the latter accelerates ciphertext inference but compromises accuracy. To address these limitations, we present AutoFHE, which automatically adapts standard CNNs for secure inference under RNS-CKKS. The key idea is to adopt layerwise mixed-degree polynomial activation functions, which are optimized jointly with the homomorphic evaluation architecture in terms of the placement of bootstrapping operations. The problem is modeled within a multi-objective optimization framework to maximize accuracy and minimize the number of bootstrapping operations. AutoFHE can be applied flexibly on any CNN architecture, and it provides diverse solutions that span the trade-off between accuracy and latency. Experimental evaluation over RNS-CKKS encrypted CIFAR datasets shows that AutoFHE accelerates secure inference by $1.32\times$ to $1.8\times$ compared to methods employing high-degree polynomials. It also improves accuracy by up to 2.56% compared to methods using low-degree polynomials. Lastly, AutoFHE accelerates inference and improves accuracy by $103\times$ and 3.46%, respectively, compared to CNNs under TFHE.

For agents

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

get_harvested_code_for_paper("2310.08012")
get_code_for_paper("2310.08012")
have("2310.08012")

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

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

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

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

Connect an agent — have() is free.