Files
myWiki/concepts/selective-copy.md

49 lines
2.0 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: "Selective Copying"
created: 2026-06-18
updated: 2026-06-18
type: concept
tags: ["synthetic-task", "sequence-modeling", "content-awareness"]
sources: ["https://arxiv.org/abs/2312.00752"]
---
# Selective Copying
## 定义
Selective Copying选择性复制是 Mamba 论文中用于诊断序列模型内容感知能力的合成任务。它修改了经典的 Copying 任务Arjovsky et al., 2016使待复制 token 的位置**随机变化**,要求模型根据 token 内容判断"哪些该记住、哪些该忽略"。
## 任务设置
给定一个输入序列,其中:
- **有色 token**(如蓝色/红色)是需要复制的目标
- **白色 token** 是需要忽略的填充
输出:仅复制有色 token跳过白色 token。与经典 Copying 的关键区别:有色 token 之间的间距是**随机且变化的**。
## 为什么揭示 LTI 弱点
- 经典 Copying 的 token 间距固定 → 全局卷积可以学习固定的"延迟"模式 → LTI时间不变模型能解决
- Selective Copying 的间距随机 → 卷积核无法捕捉变化的时间模式 → **只有内容感知(时间变化)的模型能解决**
```
经典 Copying: [A] . . . . [A] [B] . . . . [B] ← 固定间距
Selective: [A] . . [B] . . . . [A] . . . [B] ← 随机间距
```
## 在 Mamba 中的作用
Mamba 论文将此作为核心动机之一S4LTI无法解决 Selective Copying而 S6选择性通过 [[selective-state-space]])不仅解决了,还能**无限外推**到超过 1M token——因为模型学会了内容感知的泛化规则而非仅学习固定时间模式。
## 相关概念
- [[induction-heads]] — 另一个诊断 LLM 能力的合成任务
- [[content-based-reasoning]] — Selective Copying 测试的核心能力
- [[selective-state-space]] — Mamba 解决此任务的关键机制
- [[structured-state-space-models]] — S4LTI在此任务上失败
## 参考
- Arjovsky et al. (2016) — 原始 Copying 任务
- [[gu-mamba|Mamba]] (Gu & Dao, 2024) Section 3.1