Log date · Sun
Does hiding neural network architecture prevent extraction?
No. Research shows hidden architecture can be recovered in its scope; our toy model compares numeric and label outputs.
Does hiding a model’s architecture prevent extraction?
Hiding the architecture is not a reliable extraction barrier. A 2026 study shows that, for the fully connected ReLU networks it investigates, traces from black-box queries can help recover architecture and parameters. [1] In our own toy model, six inputs produced four distinct numeric outputs but only two threshold labels.
Less output does not prove a model safe: labels can still expose a decision boundary, and restricting output can reduce product quality. Decide what the interface actually needs to return, then weigh exposure against the cost to users.
| Question | Finding |
|---|---|
| Is hidden architecture enough? | The paper demonstrates joint architecture and parameter recovery within its scope. |
| How many distinct sample outputs? | Four numeric values; two threshold labels. |
| Do labels guarantee safety? | No such conclusion; our test did not measure extraction difficulty. |
What the paper studied
Yantian Shen, Yi Chen, Anyu Wang, Hongbo Yu and Xiaoyun Wang submitted v1 on 2026-09-13 UTC; v2 followed on 2026-09-19. [1] Earlier cryptanalytic extraction usually assumed the architecture was known. Their guess-and-determine framework instead targets depth, hidden-layer dimensions and parameters together.
The abstract describes two architecture-sensitive signals: a zero suffix in merged weight vectors produced by signature recovery, and an equality pattern associated with the true dimension in preimage-based sign recovery. The authors also propose methods to identify the second-to-last layer and its dimension, and demonstrate end-to-end extraction on expansive and non-expansive networks. They describe this as the first practical demonstration of functionally equivalent extraction of deep networks without assuming a known architecture. [1] Functional equivalence concerns input-output behavior; it does not require a unique internal representation.
The paper’s conclusion concerns fully connected ReLU networks and should not be generalized directly to other models. The abstract does not give query costs; precision, interface constraints and costs in a deployment need separate evaluation.
Observing output detail with a toy model
We wrote a scalar ReLU in Python 3.12.14: subtract 2 from the input, take the greater of that and zero, then add 1. Python’s max returns the larger argument. [2] For the same integer inputs we return either the numeric value or a label indicating whether it is at least 3. This is an illustration of interface detail using an available tool, not a replication of the paper’s experiment, architecture recovery or attack cost.
def model(x):
return max(0, x - 2) + 1
xs = range(0, 6)
raw = [model(x) for x in xs]
label = [int(y >= 3) for y in raw]In the output, numeric values begin changing after input 2, and adjacent differences switch from 0 to 1. The label changes to 1 at input 4. At these points the numeric response reveals more detail about the curve, while the label still reveals an interval containing the threshold.
inputs: [0, 1, 2, 3, 4, 5]
numeric: [1, 1, 1, 2, 3, 4]
threshold labels: [0, 0, 0, 0, 1, 1]
numeric distinct: 4
label distinct: 2
numeric adjacent differences: [0, 0, 1, 1, 1]Different internal structures can produce the same outputs on observed inputs. These six points cannot establish the actual number of layers or parameters, or behavior at other inputs. Keep that distinction when testing output policies: observing some information is different from establishing that the whole model can be recovered.
Recommendations by deployment
The following are design recommendations, not protection effects measured by our experiment. List the model’s business value, legitimate usage patterns and the cost of false positives before choosing controls.
| Case | Recommendation |
|---|---|
| Model shipped with an app | Plan for the file to be obtainable; inventory it and its dependencies, and keep server secrets out of the package. |
| API needs full numeric results | Keep necessary precision; set quotas and monitoring by identity and use. |
| Product needs only a category | Evaluate returning only labels, while testing accuracy and normal user experience. |
| Unusually frequent or systematic queries | Combine quotas, alerts and review; provide a route for legitimate batch work. |
Server deployment gives control over file distribution and access, but an inference interface still exposes behavior through queries. Consider quotas across accounts and time windows, and distinguish product testing and accessibility use from abuse. Terms can prohibit extraction but do not replace technical controls. Before changing responses, measure accuracy loss, latency and user impact on real tasks.
Check your own inference interface
We built and ran a small sample to check both outputs. Then, for a model you are authorized to test, use a fixed set of representative inputs in a test environment and record the current and proposed responses. Coordinate before sending large batches to a production service.
python3 --version
python3 - <<'PYCODE'
def model(x):
return max(0, x - 2) + 1
xs = range(0, 6)
raw = [model(x) for x in xs]
label = [int(y >= 3) for y in raw]
print('inputs:', list(xs))
print('numeric:', raw)
print('threshold labels:', label)
print('numeric distinct:', len(set(raw)))
print('label distinct:', len(set(label)))
print('numeric adjacent differences:', [raw[i+1]-raw[i] for i in range(len(raw)-1)])
PYCODERecord model version, input range, output precision, caller identity and per-call limits. Compare which response fields the product actually needs, and check whether logs can associate activity with accounts and time windows. Before release, test normal user paths and batch jobs, then exercise the message and recovery flow when a quota is reached.
Include this inventory in reviews of model and API changes. Exposing a score again or increasing precision may change what can be observed. Keep the before-and-after comparison and the owner’s decision for the next review.
Your checklist
- Inventory on-device and server-side models and their value.
- Identify the fields and precision the API actually needs.
- Compare numeric and label responses in a test environment.
- Set quotas and monitor unusual queries by identity and use.
- Test legitimate batch work and recovery after quota limits.
Primary sources
- arXiv: Cryptanalytic Extraction of Neural Networks Without Known Architecture Assumption (2609.14379) · Source date 2026-09-13 · Checked 2026-10-12
- Python documentation: built-in functions · Checked 2026-11-11