Files
myWiki/concepts/deepseek-vit.md

40 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "DeepSeek-ViT"
domain: "Deep Learning / Vision"
tags: [vit, vision-transformer, deepseek, visual-encoding]
sources: [[thinking-with-visual-primitives]]
---
# DeepSeek-ViT
> DeepSeek 自研的视觉 Transformer支持任意分辨率输入配合 3×3 空间压缩实现极致 token 效率。
## 架构
- 从头训练的 Vision Transformer
- 支持**任意分辨率**输入
- 14×14 patch size → 生成 patch tokens
- ViT 输出端施加 **3×3 空间 token 压缩**:每 9 个相邻 patch token 沿通道维度压缩为 1 个 token
## Token 压缩管道
以 756×756 图像为例:
```
原始像素 (571,536)
→ Patch Embedding → 2,916 patch tokens
→ 3×3 空间压缩 → 324 visual tokens (进入 LLM prefilling)
→ CSA 压缩 → 81 KV entries
```
**总压缩比7056×**
## 视觉 token 数量限制
为平衡性能和计算成本,视觉 token 输出限制在 **81 到 384** 之间。超出范围的图像在保留宽高比的前提下缩放。
## 相关概念
- [[compressed-sparse-attention|压缩稀疏注意力]] — ViT 之后的 KV cache 压缩
- [[visual-primitives|视觉原语]] — ViT 输出的使用方式
- [[token-efficiency|token-效率]] — 整体效率指标