Onnx2TEE: Automated Graph-Aware Model Partitioning for TEE-based Edge AI Protection

summary

The gist

AI models are increasingly being deployed at the edge where protecting them from theft or manipulation is worthy of serious consideration.<ref:2611.33262#pg1,AI models are increasingly being deployed…

In short

Onnx2TEE creates an automated pipeline to partition ONNX models for Trusted Execution Environments (TEEs). It uses graph-aware segmentation to split nonsequential feed-forward networks into segments, preserving computational dependencies while minimizing communication and latency. This method helps protect AI models from theft or manipulation at the edge by intelligently distributing model parts across different execution environments.

Key concepts

Graph-Aware Segmentation
This is the core algorithm that breaks down a neural network's structure (its computational graph) into smaller, connected pieces. The goal is to ensure that when the model runs in separate TEEs, the necessary data flows between these pieces are preserved correctly, even though they are physically separated.
ONnx2TEE Pipeline
This is an automated system that takes a standard ONNX model and automatically partitions it. It determines where to split the model based on its structure and then generates separate submodels. These submodels are then compiled for use in both the Rich Execution Environment (REE) and the TEE.
Parameter Distribution Insights
The method finds that certain parts of a model contain most of its critical parameters, like weights. The paper suggests that focusing protection on these 'parameter-heavy' segments is more effective for security than just maximizing the total number of segments placed in the TEE.

Terminology used across episodes

This episode discusses

The paper

Onnx2TEE: Automated Graph-Aware Model Partitioning for TEE-based Edge AI Protection · Read on arXiv

Tennessee Technological University · Oak Ridge National Laboratory

AI models are increasingly being deployed at the edge. Since these models often require significant research and development to produce, are often deployed in potentially hostile environments, and downstream systems often rely on accurate data; protecting them from theft or manipulation is worthy of serious consideration. Trusted Execution Environments (TEEs), which provide hardware-enforced separation of software execution, can protect model weights but impose strict resource constraints, making full-model execution impractical for large neural networks. We present Onnx2TEE, an automated, model-independent pipeline that partitions ONNX models across rich, trusted execution environments for non-sequential feed-forward networks using graph-aware segmentation to preserve computational dependencies while minimizing boundary communication and reducing TEE-induced inference latency. Evaluation on an NVIDIA Jetson AGX Orin using an Arm TrustZone TEE demonstrates that model parameters can be highly concentrated in individual segments, supporting selective protection of parameter-dense model components. The evaluation further shows that the generated trusted app's memory requirements depend on both computation and intermediate tensor sizes.

Transcript

Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.

Nadia: We're looking at the paper: "Onnx2TEE: Automated Graph-Aware Model Partitioning for TEE-based Edge AI Protection".

Paper summary: Nadia: So we're talking about this paper called "Onnx2TEE: Automated Graph-Aware Model Partitioning for TEE-based Edge AI Protection". It looks like the authors are tackling the problem of protecting AI models that are being put at the edge, where they might be stolen or messed with.

Elias: Exactly. The big idea here is to use Trusted Execution Environments, or TEEs, which provide hardware-enforced separation for software running on them. But running the whole model in a TEE just doesn't work because of all these strict resource limits, so this paper proposes a way to partition the model across different execution environments.

Priya: So it’s about splitting the model up into pieces that run in different places, trying to balance security with those resource constraints. What makes this approach interesting is that it's aiming to be model-independent and automated, so you don't have to manually figure out how to split every single AI model.

Nadia: Right, so the main claim of Onnx2TEE is that they present an automated pipeline that takes a standard ONNX model and splits it up across rich execution environments and TEEs. They use something called graph-aware segmentation to make sure they keep the computational dependencies intact while cutting down on how much data has to travel between those different parts.

Elias: That's key, preserving those dependencies is crucial for a feed-forward network that isn't strictly sequential. They define a segmentation algorithm that breaks the model's computational graph into segments, where each segment is just one entry and one exit connected subgraph.

Priya: So how does this segmentation work in practice? If you have these candidate partition points, what are they based on? Are they just arbitrary points, or does the model structure dictate where they go?

Nadia: The candidate partition points include the model's input and output, plus those internal boundaries between consecutive segments. They then export these partitions as separate ONNX submodels and compile them into the client application running on a rich execution environment and the trusted application inference binaries for the TEE.

Elias: That means you get independent parts that each know what to do, which is good for security, but it introduces communication between them across those boundaries. The goal of their segmentation is to minimize that data communication while still keeping everything working together.

Priya: Minimizing communication sounds like a big win when you're dealing with sensitive model parameters, especially since weight exfiltration is a real risk when models are running on edge devices. Does the method address where those parameters actually live?

Nadia: They look at how the parameter distribution is spread across these segments, and they found that this distribution is highly non-uniform and depends on the specific model. For example, for an MNIST classifier, almost all of its parameters are concentrated in Segment S8.

Paper summary: Elias: That observation is interesting because it suggests a strategy: parameter-heavy segments might offer better protection than just maximizing the sheer number of segments you can fit into the TEE. The paper points out that for YOLO26nano, ninety-six point nine six percent of the learned parameters are in Segment S17.

Priya: So if we think about this from a practical side, what does parameter concentration tell us about making a deployment decision? Is it better to put a small segment with a lot of critical weights in the TEE, even if it's just one?

Nadia: That’s exactly what they are suggesting. They think that prioritizing those parameter-heavy segments could be more beneficial for protection than just trying to cram as many segments as possible into the TEE. It shifts the focus from segment count to parameter importance in terms of security.

Elias: Now, we have to talk about the constraints, because fitting these pieces into a TEE is hard. The paper notes that the required heap size for the TEE depends on both computation and those intermediate tensor sizes, and adding a segment can sometimes actually reduce the overall memory requirement because of boundary tensor effects.

Priya: That’s a crucial caveat. So you can think that adding more segments might not always mean using up more TEE memory; it could even be beneficial in terms of heap usage. But what happens when the estimated heap usage for a configuration exceeds what's available?

Nadia: If the estimated heap usage goes over, then that configuration is marked as undeployable. So the dependency on those boundary tensors really influences whether you can actually deploy a model, not just how many segments you choose.

Elias: And we can't forget the performance side of things. The evaluation shows that using a TEE introduces a measurable inference overhead compared to running everything only in the rich execution environment, and they attribute that cost partly to those secure monitor calls and world-switch overhead for every single inference session.

Priya: So even when you get this model partitioned up securely, you still pay a latency price for every time you run an inference. How much does that overhead vary between different configurations or different types of models?

Nadia: The magnitude of that latency cost changes depending on the specific partition configuration and the model being used, so it's not a fixed number across the board. You have to evaluate that trade-off based on what you're deploying.

Elias: So, looking at the whole picture of Onnx2TEE: Automated Graph-Aware Model Partitioning for TEE-based Edge AI Protection, what are the main things we should take away from this work regarding model protection?

Nadia: It boils down to this: effective TEE-based model weight protection isn't just about picking a random number of segments. It’s a whole partition selection problem that has to consider the model architecture, how the parameters are distributed, the memory capacity of the TEE, and also what you can expect in terms of inference latency.

Paper summary: Priya: And on top of all that, Onnx2TEE offers something useful by providing model-specific code generation. This avoids having to embed a general-purpose runtime inside your TEE application when you're building this protection layer.

Elias: That code generation is helpful because it embeds the model weights directly into the generated TEE application itself, rather than sending those model weights from the rich environment to the trusted application during inference.

Nadia: So, to summarize simply for our listeners, Onnx2TEE provides a pathway towards portability across different TEE implementations by using something called the GlobalPlatform TEE API. It gives developers a tool to create these split-inference applications without needing deep knowledge of every single TEE implementation details.

Elias: The paper points out that future work should focus on automatic security-aware partition selection for proprietary models, specifically based on how important those model parameters actually are. They suggest that effective partition selection must jointly consider both the coverage of the model's weights and all those resource requirements.

Priya: That sounds like a solid direction for next steps, focusing on using parameter importance to drive the partitioning decisions automatically in proprietary settings. That feels like a very practical application of what they've shown here with MNIST and YOLO26nano.

Nadia: It is practical because it moves away from manual configuration toward an automated pipeline that handles the graph awareness and dependency preservation for you. It shows how to get model-specific code generation to work within the TEE context.

Elias: And they’ve shown how this framework can be used with the GlobalPlatform TEE API, which gives a path for compatibility across different TEE hardware platforms. That makes the whole concept less of an isolated experiment and more of something that could scale up.

Priya: It's interesting because they are dealing with model weight exfiltration directly, targeting the deployed parameters during execution in environments where compromised software might be present. This makes the need for this separation much clearer than just protecting models when they are just sitting on disk.

Nadia: So, if you’re driving something or cooking dinner and you’re thinking about deploying an AI model securely on an edge device, remember Onnx2TEE is a pipeline that automates splitting that model across environments based on graph structure and parameter importance.

Elias: It gives you a way to manage those TEE memory constraints by considering boundary effects, even if it means dealing with some inference latency overhead from the secure monitor calls.

Priya: And remember, the paper itself points out that changing the protected model region requires you to do recompilation and redeployment. That’s a practical reality for deployment when you're trying to fine-tune security settings.

Nadia: That’s right, so Onnx2TEE is about finding that sweet spot between getting robust protection and making sure the system actually runs within the TEE's limits.

Conclusion: Nadia: So we’ve been looking at this paper called Onnx2TEE, which is all about how to protect AI models when they are running on edge devices using Trusted Execution Environments or TEEs.

Elias: Yeah, it’s by these authors who are focused on the cryptographic and parameter side of things. They present a whole automated pipeline for splitting those ONNX models up across different execution environments.

Nadia: It basically shows how to partition a model into pieces that run in different places, trying to keep the model's core functions separated while still letting them work together.

Elias: The authors use this graph-aware segmentation method to make sure they don't break the actual computational steps of the AI network.

Nadia: And they found that how much data has to move between these pieces is minimized, which is huge when you’re worried about stealing sensitive model information.

Elias: They also looked at where the model's parameters are concentrated, and they suggest that putting the heaviest parts of a model in one segment might be better for protection than just trying to fit as many segments as possible in the TEE.

Nadia: So, what does this mean practically? It means you don't have to manually figure out how to split every single AI model; there’s a system that tries to do it automatically.

Elias: That’s the goal, right? They build this framework that can generate the specific code needed for each segment so it runs properly inside the TEE.

Nadia: It also suggests embedding those model weights directly into the TEE application instead of sending them from another environment during inference, which cuts down on that data transfer risk.

Elias: That’s a big architectural shift for how you deploy these things securely on a chip. But there are still trade-offs to consider, like the memory limits of the TEE and some overhead in processing those boundary communications.

Nadia: Right, so while it automates the splitting, you still have to worry about fitting everything into those TEE memory constraints and dealing with that inference slowdown from switching between environments.

Elias: Exactly. The authors point out that effective protection is really a balancing act between making sure you cover all the model's weights and respecting all those resource requirements.

Nadia: It’s a practical tool for moving AI models securely to the edge, even though it needs careful setup and deployment steps to get it running on a specific hardware platform.

Elias: And future work they suggest is focusing on making that selection process automatic when you're dealing with proprietary models, based directly on the importance of those model parameters.

More episodes

← Home