﻿# Torch export lifted parameters: raw graph placeholders are not all caller inputs

Interpret exported PyTorch graph inputs using their parameter, buffer, constant and user-input roles instead of exposing every graph placeholder as a public inference field.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-torch-export-lifted-parameters-constants-state/
Language: en

## A raw graph appears to require model weights from the client

An integrator inspects an exported graph and finds more placeholders than the original forward method accepted. They expose all placeholders in a prediction request, accidentally turning model parameters into caller-controlled inputs. The raw compiler interface includes lifted state as well as user values. Inspect the graph signature before designing the external API. A compiler-friendly function can make dependencies explicit without intending that every dependency becomes a public field that an application client chooses independently for every inference operation.

## The signature classifies the input roles

The [export API](https://docs.pytorch.org/docs/2.15/user_guide/torch_compiler/export/api_reference.html) documents input specifications and examples distinguishing parameters, buffers and user inputs. Map each placeholder to its declared role rather than relying on position or a name copied from graph text. A parameter is associated with model release state; a user input belongs to the request contract. Treat constants and mutable buffers according to their own semantics instead of combining all tensors into an undifferentiated argument list whose ownership is unclear during deployment integration.

## Exported representation separates graph and state

The [IR specification](https://docs.pytorch.org/docs/2.15/user_guide/torch_compiler/export/ir_spec.html) describes the exported graph and its supporting state. Preserve that relationship when serializing, transforming or compiling the artifact. [Artifact verification](/journal/artifact-signature-verification/) helps establish the identity of the complete release. A graph with missing or mismatched state can still look structurally recognizable while representing a different numerical model. Conversely, unchanged graph structure does not prove unchanged inference identity if its parameter values or constant interpretation artifacts have changed between released packages.

## The supported module interface restores convenient calling

The [programming-model guide](https://docs.pytorch.org/docs/2.15/user_guide/torch_compiler/export/programming_model.html) explains captured values and their static or dynamic treatment. Distinguish the supported exported-module invocation from direct use of a lower-level graph interface. [Tokenizer release manifests](/journal/tokenizer-artifact-release-manifest/) provide analogous context for values that belong to the model release rather than to each caller request. Keep the release boundary explicit so a wrapper does not mistakenly allow clients to alter hidden state or assume a baked-in constant remains a freely varying application parameter after capture.

## Verify ownership with a controlled release

Compare the original module and deployed wrapper using the same user payload and identified model state. Confirm that release parameters are supplied from the intended artifact and that user fields map only to the public inputs. Then change an actual user value and observe the expected result without rebuilding state. A useful integration document identifies who owns each input category and how it is bound, instead of treating every visible graph placeholder as another required field in the prediction API.
