20260617:目前有914 页

This commit is contained in:
2026-06-17 15:02:40 +08:00
parent e96b955fda
commit 91fac5b6fc
423 changed files with 20687 additions and 34 deletions

View File

@@ -0,0 +1,29 @@
---
title: "Position Encoding (位置编码)"
created: 2025-06-02
updated: 2025-06-02
type: concept
tags: [position-encoding, transformer, placeholder]
sources: []
---
# Position Encoding
> Transformer 模型中为 token 注入序列位置信息的技术。
## 主要方法
- **绝对位置编码**:为每个位置分配唯一向量(原始 Transformer
- **[[rotary-position-embedding|RoPE]](旋转位置编码)**:通过旋转矩阵编码相对位置,广泛用于现代 LLM
- **ALiBi**:通过注意力偏置编码相对位置
- **NTK-aware 插值**:扩展位置编码的范围(见 [[length-extrapolation|长度外推]]
## 在多轮推理中的挑战
[[goru-one-pass-to-reason-2025]] 揭示了 [[position-id-discrepancy|位置 ID 偏差]] 问题——同一 token 在生成和上下文两种场景中的绝对位置不同,需通过策略性位置 ID 分配解决。
## 相关
- [[rotary-position-embedding]]
- [[position-id-discrepancy]]
- [[goru-one-pass-to-reason-2025|One-Pass to Reason]]