你的 GPU 邻居能听见你的模型
Your GPU Neighbor Can Hear Your Model
原文由官网提供,中文由 GPT-6 Luna 翻译。相邻片段合并排版,正文与时间点保持对应。
已插入 22 张经核对的幻灯片或演示截图;点击图片可放大。图注链接为当前视频时间,左侧正文时间保留原转录版本,二者可能不同。
共 27 个阅读段落

大家好,这场演讲讨论的是:你的 LLM 架构信息可能通过共享 GPU 硬件泄露的风险。GPU 硬件泄露的风险。如果你在云端运行模型,使用的是与其他租户共享的 GPU,那么隔壁的用户就能了解到一些有关你模型的信息。他们可以判断你运行的是哪个模型、模型响应有多快,甚至能知道它现在正在做哪类工作,而且完全不接触你的数据,只需观察时序。这就是本次演讲要讲的内容:同一硬件上的租户可以仅凭时序了解到你的 LLM 的哪些信息,
Hello everyone, this talk is about the danger of your LLMZ formation leaking through shared GPU hardware. If you're running a model in the cloud on a GPU you share with other tenants, someone next to you can learn things about it. They can tell what model you're running, how fast it's responding, and even what kind work is doing right now, all without touching your data, just by watching timing. That's what this talk covers, what I quote tenets on the same hardware can learn about your LLM from timing alone

以及你能采取什么措施。首先,我叫 Branislav Brzak,是一名受雇于 Stealthium 的网络安全研究员。Stealthium 专注于保护 AI 系统运行的环境,并为这些环境提供可观测性。我的研究重点是 GPU 底层安全。这正是
and what you can do about it. To start, I'm Branislav Brzak, a cyber security researcher employed at Stealthium. At Stealthium we specialize in securing and providing observability into the environments AI systems run on. My area of focus is low-level GPU-related security research. That's something

本场演讲要讨论的内容。当多个租户共享一块 GPU 时,你可能会期待完全隔离,但所提供的隔离措施未必足够。对于这类攻击,攻击者甚至不需要 root 访问权限等特殊权限,也不需要任何传统的漏洞利用。它唯一要做的,就是测量租户之间仍然共享的那部分硬件的时序。
these stock covers. When you share a GPU between tenants, you would expect full isolation, but the isolation provided may not prove to be sufficient. In the case of this attack, the attacker doesn't even need any special permissions like root access. It doesn't need any traditional exploit either. The only thing it does is time the parts of the hardware that are still shared among

这段演示视频展示了受害者和攻击者的仪表板。左边是正在进行推理的 Qwen3 模型。右边是攻击者利用 Qwen3 运行时泄露出来的侧信道。通过这些信息,攻击者可以准确判断模型是什么,以及它此刻正在生成哪类文本。
tenants. This is a demonstration video of what the victims and the attackers dashboards look like. On the left, we have Qwen3 model doing inference. On the right, the attacker uses a side channel that Qwen3 leaks into as it's running. From that, it determines exactly what model it is and what kind of text it's producing right now.

这些只是核心结论,并非全部内容。我们能够以 97% 的准确率判断模型及其架构和深度。我们能够以 99.3% 的准确率判断生成速度。我们能够判断活动何时发生、规模有多大、繁忙时段、token 数量以及回答长度。我们还能判断它正在做哪类工作:代码、散文、JSON 或检索。但我们无法得知实际的提示词、回答或内容,只能看到时序。而且以上结果都来自真实 H100 上运行的真实 LLM。
These are just the headline claims, but not the whole story. We can tell which model it is, architecture and depth, with the 97% accuracy. We can tell how fast is the coding, with the 99.3% accuracy. We can tell when and how much, the busy periods, token counts, and the answer length. What we can tell what kind of work it's doing, code, pros, JSON, or retrieval. What we cannot tell though are the actual prompt, answers, or contents, just timing. And all of this on real H100s serving real LLMs.

如果你使用 NVIDIA 硬件,GPU 隔离通过多实例 GPU(Multi-Instance GPU,简称 MIG)实现,简称 MIG。每个隔离的 MIG 分区都有自己的物理计算单元和专用 VRAM,从而为这些部分提供硬件隔离。在我们的示例中,提供服务的 LLM 运行在一个分区上,该分区有 3 个计算单元和 40 GB VRAM。攻击则只使用 1 个计算单元和 10 GB VRAM。
If you're using NVIDIA hardware, GPU isolation is achieved using multi-instance GPU or MIG for short. Each isolated MIG slice has its own physical compute units and dedicated VRAM that provides hardware isolation on those parts. In our example, the LLM we are serving runs on a slice with 3 compute units and 40 GB of VRAM. The attack runs on just one compute unit and 10 GB of VRAM.

被隔离的包括计算单元、内存容量、带宽配额,以及故障和错误。L2 缓存也会按实例分区。实例之间不会发生缓存逐出。所以从这个意义上说,它不是共享的。真正泄露信息的是内存屏障,或者说 membar;它们的作用范围覆盖整块 GPU。一个实例发出的屏障仍会触及显卡上的每个 L2 分区。时序是唯一没有被隔离的东西。所以,当一个租户很忙时,另一个租户自己的读取操作会稍微变慢。关键在于,GPU 范围的内存屏障会在显卡的每个 L2 分区上生效。下一张幻灯片会基于这个事实展开整个攻击。
What's isolated are compute units, memory capacity, bandwidth quotas, and faults and errors. The L2 cache is partitioned per instance too. There is no cross-instance eviction. So it's not shared in that sense. The actual leaks are memory barriers or members, which are GPU-wide. One instance's barrier still touches every L2 partition on the card. Timing is the one thing that isn't isolated. So when one tenant is busy, the other tenant's own reads get slightly slower. The key point is that a GPU-wide memory barrier takes effect in every L2 partition on the card. The next slide builds the whole attack on that one fact.

攻击手段的特点是,攻击者始终只读取自己的内存。它只测量自己读取操作的时序,从不触碰受害者的内存。攻击分为三步:从自己的小缓冲区读取、测量读取耗时,并每隔 5 微秒重复一次。这种基本操作以及 MIG membar 泄露本身并不是我们的发现。这项基本操作以及 MIG membar 泄露本身并不是我们的发现;这要归功于 Behind Bars 的研究人员。非常感谢他们所做的工作。
The vector is that the attacker only ever reads its own memory. It only times its own reads, it never touches the victim's memory. There are three steps. Load from its own small buffer, time the load, and repeat every 5 microseconds. This primitive and the MIG member leak itself isn't our discovery. That goes to the researchers behind behind bars at using security. A big thanks for their work.

现在来看看时序差异。如果只用肉眼比较租户空闲时和为 LLM 提供服务时的情况,你甚至无法分辨两者。中位延迟只高出 3 微秒。但对攻击者来说,这 3 微秒已经足够了。
Now try looking at the timing differences. With the naked eye comparing your tenant idle versus serving an LLM, you wouldn't even be able to discern them. The median latency is only 3 microseconds higher. To the attacker though, those 3 microseconds are all it needs.

足以收集我们刚才提到的所有信息。在整张幻灯片展示期间,受害者的切片上都运行着一个拥有 80 亿参数的 Qwen3。所有捕获的数据都来自一个实时运行的模型。顶部显示的是 GPU 活动随时间的变化,每个 token 对应 1 次突发。下方显示的是攻击者自身延迟轨迹的频谱。其中有一个 881 Hz 的基频,对应每秒 token 数,此外还有谐波,因为每个token 都是多种不同频率的混合,并非单一、纯净的频率。
enough to gather all the information we already talked about. Qwen3 with 8 billion parameters is running on the victim's slides throughout this one. All captured data was taken from a live model. At the top is GPU activity over time, 1 burst per token. Below is the frequency spectrum of the attacker's own latency trace. There is a fundamental 881Hz which is just tokens per second plus harmonics, since each token is a mix of distinct frequencies, not one clean one.

这是一条真实轨迹,展示了一个 token 在时域中的表现。这个 token 总共出现了 39 个波峰。带绿色峰值的波峰对应各层的调用,橙色波峰则对应层与层之间额外的处理过程。稍后的幻灯片会演示如何确定实际的层数,尽管存在这些额外波峰。
This is a real trace, one token in the time domain. The token shows a total of 39 bumps. bumps with green peaks are the layer invocations, while orange ones are additional between layer processing. In a later slide we will demonstrate how we determine the actual layer counts even though those extra bumps are present.

我们会查看解码速度本身。仅凭时序,我们就发现 token 速率完全可见。因此,攻击者能够准确恢复速度信息。但速度本身并不是一个清晰的指纹。Qwen3 80 亿参数和 Llama 3 80 亿参数的解码 token 速率只相差 1.6%。所以仅凭速度,你会以为它们是同一个模型。
we look at the decode speed itself. Just by timing we found the token rate completely bind. So speed alone is something an attacker can recover accurately. But speed by itself isn't a clean fingerprint. Qwen3 8 billion and Llama 3 8 billion decode only 1.6% apart in their token rate. So from speed alone you'd think they're the same model.

速度可以缩小范围,却无法准确识别。我们需要更精确的特征:层数。接下来的几张幻灯片就会讲这个。我们使用之前相同的折叠方法和平均 tick。这次我们针对每个模型运行一次,而不是针对每个 token 运行一次。得到的是一个比特计数,数值几乎正好是整数。对 22 条轨迹而言,与最近整数的平均距离只有 0.028。这就是识别特征。如果这只是某种固定硬件伪影除以不同 token 速率的结果,预期会得到小数,而不是整数。每个计数都对应模型的层数,再加上 1 到 3 个额外峰值。
It narrows things down but it doesn't nail it. We need something sharper, layer counts. That's what the next few slides get into. We use the same fold and average tick from before. This time we run it once per model instead of once per token. What comes out is a bit count that lands almost exactly on a whole number. The mean distance from an integer across 22 traces is just 0.028. That's the tell. If this were just a fixed hardware artifact divided by different token rates, it'd expect fractions, not whole numbers. Each count works out to the model's layer count plus 1 to 3 additional peaks.
每个模型都有自己的信号指纹。它由节奏和谐波结构混合而成。
model keeps its own signal fingerprint. A mix of tempo and harmonic structure.

需要说明的是,这不是经过训练的机器学习分类器。没有训练集、没有标签,也没有配置过程。代码不到 30 行。该方法会检查从 16 到 48 层的每个候选模型。它会测量该层数预期的特征在真实轨迹中呈现得有多明显。然后选出最合适的候选项。对于 Qwen3 80 亿参数、36 层的模型,它的得分明显最高,比下一个候选项高 4.0 倍。因为这是最佳拟合测试,而不是查找表,所以它也适用于从未见过的模型。其中包括专有模型和未发布的模型,因为它根本不需要事先见过这些模型。
To be clear, this is not a trained machine learning classifier. There's no training set, no labels, no configuration. It's under 30 lines of code. The method checks each candidate's depth from 16 to 48. It measures how strongly that depth's expected signature shows up in the real trace. Then it picks which are of its best. For Qwen3, 8 billion 36 layers wins Cleary by 4.0 times over the next candidate. Because this is a best fit test, not a lookup table, it also works on models it never seen before. That includes proprietary on unreleased ones, since there's nothing it needs to have seen in the first place.
而且效果出奇地好。层数拟合分类器还会输出置信度。在 R 项测试中,置信度最低的两个答案最终被判错。同样的方法也能识别采用相同基础模型的微调模型和蒸馏模型。这是因为它们的架构和层数保持不变。
And this works surprisingly well. The layer fit classifier also outputs the confidence level. Across R testing, only two least confident answers ended up being wrong ones. This same method also picks up fine tunes and distillations that share the same base model. That's because the architecture and layer count carry over unchanged.

以三个相关模型为例。Meta 的 Llama 3 80 亿参数版有 32 层。同样来自 Meta 的 Llama 3.1 80 亿参数版也使用相同的 32 层主干,只做了少量升级。DeepSeek 的 R1 蒸馏版 Llama 80 亿参数是在此基础上的改进版本。每层的时序只出现 1.6 纳秒的中位延迟差异。其余信号看起来都一样。尽管如此,我们的分类器仍能区分它们。
Take three related models as an example. Llama 3 8 billion from meta has 32 layers. Llama 3.1 8 billion also from meta uses that same 32 layer backbone with minor upgrades. A R1 distilled Llama 8 billion from DeepSeek is an improvement on top of that. The per-layer timing comes out to only 1.6 nanosecond median latency shifts of each other. The rest of the signal looks the same. Regardless of this, our classifier is still able to discern between them.

现在我们沿着同一信道提出一个更深入的问题。不是在问哪个模型,而是在问它现在正在做什么。我们考察四种工作流类型。散文、代码、JSON 和检索。我们根据最近 5 秒的时序,每半秒对工作负载进行一次分类。40 个半秒工作负载中,有 31 个判断正确。此外,通过多数表决,完整回答中有 4 个被正确识别。这就是前面视频中同一个分类器,包括其中的错误案例。
Now we ask a deeper question on the same channel. Not which model, but what is doing right now. We look at four workflow types. Prose, code, JSON, and retrieval. We give a workload on every half second based on the last five seconds of timing. Out of 40 half-second workloads 31 were right. And four full responses were correctly identified by majority votes. This is the same classifier from the video earlier misses included.

有一个条件值得说明。这些测量是在启用推测解码的情况下进行的。这是 vLLM 中的一个可选功能,并非默认开启。下面解释其中的机制:文本的可预测程度会改变每一步接受多少个草拟 token。这会改变每一步的耗时,而这正是我们捕捉的信号。我们测试了 11 种配置,包括稠密模型和混合专家模型,以及 BF16 和 FP8。每次都能看到同一类图形,只是信号强度差异很大。GPT OSS 200 亿参数模型的差异幅度为 17.2%,而 GLM-4-9B 为 0.9%。11 轮中有 10 轮的散文生成最快,而仅凭随机机会命中率只有 1/4。
One condition is worth stating. This was measured with speculative decoding turn-on. That's an opt-in in vLLM, not the default. Here's the mechanism. How predictable the text is changes how many drafted tokens get accepted at each step. That changes step time and that's the signal we're picking up. We tested 11 configurations, dense and mixture of experts, BF16 and FP8. The same figure page showed up every time, just at very different strengths. 17.2% spread on GPT OSS 20 billion vs 0.9% on GLM-4-9B. 10 out of 11 round pros fastest when the chance alone would only give you 1 in 4.
所以,假设攻击者已经从前面的幻灯片得知模型,并且录制时恰好启用了推测解码,它还可以判断生成的文本属于哪种类型。
So say the attacker already knows the model from the earlier slides and specular the recording happens to be on. It can also tell what kind of text is coming out.

现在我们完全排除 MIG 的影响。MIG 要求攻击者与受害者位于同一块物理芯片上。这次攻击不需要。这里的配置是一台通过 NVSwitch 互连的 8 块 H100 服务器。受害者在 GPU 0 和 GPU 1 上进行张量并行。攻击者只需要同一台服务器上的另一块 GPU,本例中是 GPU 2。通过 NVSwitch 进行对等访问是受支持的预期功能,这是多 GPU 任务的正常工作方式,并不是被利用的漏洞。MIG 与张量并行也无法在同一设备上共存,所以这针对的是另一类部署,而不是对同一种
Now we take the Shadeship out of the picture entirely. MIG needs the attacker on the same physical die. This attack doesn't. The setup here is an 8x H100 server connected over an NVSwitch fabric. The victim runs tensor parallel across GPU 0 and 1. The attacker just needs any other GPU in that same server, GPU 2 in this case. Peer access over NVSwitch is a real intended feature. It's how multi-GPU jobs normally work, not a bug being abused. MIG tensor parallelism also can't coexist on the same device. So this is really a different population of deployments, not just the same

攻击的重复。探测程序运行在 GPU 2 上,并通过指针追踪,对实际位于 GPU 0 上的内存进行访问,通过 NVLink 传输,并对沿途每一跳计时。空闲时每一跳约需 890 纳秒。一旦受害者开始工作,延迟就会上升到 300 微秒。这里展示的是三段半秒钟的捕获数据,实际上用肉眼就能数出 token。与 MIG 攻击相比,我们失去的是层数特征;在这个距离下,它被噪声淹没了。因此,对留下的指纹进行某种处理后,剩下的主要是节奏特征,而非层数。
attack repeated. The probe runs on GPU 2. It pointer traces memory that actually is on GPU 0 over NVLink, timing every hop along the way. An idle hop takes about 890 nanoseconds. Once the victim starts working that climbs up to 300 microseconds. These are three half-second captures and you can actually count the tokens by eye. What we lose compared to MIG is the layer bit is below the noise at this distance. So over-enviling the fingerprints we were left with is mostly tempo, not layer count.

这里我们在完全相同的服务配置上测试 5 个模型。泄露的信息只有模型本身,攻击者据此判断模型身份。这种方法的准确率为 79.2%。正如预期,它恰好会在节奏特征失效的地方出错。LAMA 3.58 billion 和 R1D Steel 都是 80 亿参数模型,代码生成速度只差 3 Hz。所以它们会混在一起,而 MIG 的层数特征本来可以轻松区分它们。结论是,NVLink 信号的信噪比比 MIG 更差,因为它丢失了层数特征。但信噪比更差并不等于安全。79% 的准确率相对于 20% 的基线
Here we test the five models on identical serving setup. Only the model itself gives away which one it is. This method gives 79.2% accuracy. Now it fails exactly where you'd expect the tempo to fail. LAMA 3.58 billion and R1D Steel are both 8 billion models that they code 3Hz apart. So they blur together, where MIG's layer counts would have separated them easily. The takeaway is that the NVLink signal-to-noise ratio is worse than MIGs, since it loses the layer bit. But worse signal-to-noise ratio isn't the same as safety. 79% against the 20% baseline

仍然是真实的指纹,而不是噪声。先说个好消息:我们的产品在实际运行中开箱即用就检测到了这次攻击。Stealthium 会监控每一块 GPU 上的每一次内核启动,分析可疑工作负载,并通过完整的告警流程处理,并非每家厂商都能做到这一点。以下是这次攻击显得特别异常的原因:同一个内核重新启动了约 3000 次,一次次访问完全相同的 40 KB 内存,整个过程中只向 CPU 回传了 1 KB 数据,因为载荷是时序本身,而不是输出内容。
is still a real fingerprint, not noise. First, some good news. Our own product at work caught the attack straight out of the box. Stealthium monitors every single kernel launch across every GPU, analyzes suspicious workloads and runs them through a full alert pipeline, which is something not every vendor can do. Here is what made this one stand out. A single kernel relaunched about 3000 times, hitting the exact same 40 kilobytes of memory over and over instead of moving to new data. Only one kilowatt of data was sent back to the CPU the entire time because the timing itself was the payload, not the output.
从实际情况看,整个过程从开始到结束不到 600 毫秒,每次回复不到 50 个 token。在回复内容刚打出一半之前,我们就检测到了它。
In real terms, that is under 600 milliseconds start to finish with fewer than 50 tokens over reply. We caught it before the response was ever half typed.

所以,总结三点。第一,运维人员确实可以控制工作负载的部署位置。不要把不可信租户的 MIG 分区紧挨着敏感模型放置。第二,要了解其中的取舍。MIG 会阻止点对点通信,这意味着不能在MIG 上进行张量并行。改用 NVLink 分片后,泄露的信息会局限于时序,而不是层数计数。第三,监控 GPU 本身。确保主机基础设施会主动核查硬件上是否有恶意工作负载在运行,并及时发现。这正是 Stealthium 的工作:根据内核行为发现这些探测活动。
So, three takeaways. First, placement is something operators actually control. So do not put an untrusted tenant's MIG slice right next to sensitive model. Second, know the trade-off. MIG rules out peer-to-peer communication, meaning there is no tensor parallelism on MIG. Sharding over NVLink instead limits what leaks to timing alone rather than the layer accounts. Third, watch the GPU itself. Make sure the host infrastructure is actively verifying that no malicious workloads are running on the hardware. That's exactly what Stealthium does by catching these probes straight from the Chrome behavior.
共享 GPU 意味着仅凭时序就可能泄露模型、速度和工作负载类型。即使通过 NVLink 也是如此,而且无需将任何数据导出。Stealthium 能实时看到这种情况。大多数组织仍然缺乏这种可见性。再次感谢 Behind Bars 的研究人员;这场演讲全部建立在他们的工作之上。感谢大家观看。
Sharing a GPU means timing alone can give away the model, the speed, and the workload. That's true even across NVLink, without needing any export at all. Stealthium sees this happen in real time. Most organizations still don't have that kind of visibility. Thanks again to the researchers of Behind Bars, this whole talk builds upon their work. Thank you all for watching.