Token Lab搜索

← Token Lab
TOKEN LAB / LEARN BY DOING

动手实验,学会 AI 工程。

从 LLM、RAG、Agent 到评测与推理:先预测结果,改变一个变量,运行实验,再检查证据。

50交互实验500练习题0API keys

50 个实验基于 10 个可复用引擎,每个有独立假设和预设。

01注意力与掩码02向量几何03KV 缓存与分页04训练神经网络05有边界的 Agent 工作流06混合检索与重排07LLM 裁判审计08模型路由与回退09量化与离群值10请求缓存与 TTL

技术场景说明、参数名称与参考答案目前为英文。

注意力与掩码

阅读方法,改变一个输入,对比两次运行的导出结果。

01

因果注意力基线

Future positions must receive zero probability.

本地计算 / 模拟 · 打开实验 ↗
02

双向上下文

Removing the mask exposes future keys.

本地计算 / 模拟 · 打开实验 ↗
03

尖锐注意力

Larger logits concentrate probability on the largest visible score.

本地计算 / 模拟 · 打开实验 ↗
04

均匀注意力

Equal visible logits yield uniform weights.

本地计算 / 模拟 · 打开实验 ↗
05

平滑注意力

A smaller scale moves weights toward uniform without changing visibility.

本地计算 / 模拟 · 打开实验 ↗

向量几何

阅读方法,改变一个输入,对比两次运行的导出结果。

06

余弦近邻

A large document norm should not dominate cosine ranking.

本地计算 / 模拟 · 打开实验 ↗
07

点积范数偏差

The long vector may outrank a better-aligned short vector.

本地计算 / 模拟 · 打开实验 ↗
08

查询旋转

Rotating the query changes which document aligns best.

本地计算 / 模拟 · 打开实验 ↗
09

反向向量

Opposite vectors receive negative cosine scores.

本地计算 / 模拟 · 打开实验 ↗
10

零向量边界

The lab returns zero scores for an undefined cosine denominator.

本地计算 / 模拟 · 打开实验 ↗

KV 缓存与分页

阅读方法,改变一个输入,对比两次运行的导出结果。

11

GQA 基线

Eight KV heads use one quarter the cache of 32 heads.

本地计算 / 模拟 · 打开实验 ↗
12

多头注意力缓存

More KV heads scale cache bytes linearly.

本地计算 / 模拟 · 打开实验 ↗
13

多查询注意力缓存

One KV head sharply reduces logical cache size.

本地计算 / 模拟 · 打开实验 ↗
14

长上下文批次

Sequence and batch size multiply memory demand.

本地计算 / 模拟 · 打开实验 ↗
15

分页碎片

One extra token allocates an additional page per sequence.

本地计算 / 模拟 · 打开实验 ↗

训练神经网络

在浏览器里训练小型神经网络,观察决策边界变化。

16

学习 XOR 象限

A nonlinear hidden layer can fit this non-linearly separable task.

浏览器真实训练 · 打开实验 ↗
17

隐藏层容量不足

One hidden unit limits the available decision boundaries.

浏览器真实训练 · 打开实验 ↗
18

小学习率

A lower learning rate may need more epochs.

浏览器真实训练 · 打开实验 ↗
19

圆形分类

The hidden layer can approximate a curved boundary.

浏览器真实训练 · 打开实验 ↗
20

随机种子敏感性

Initialization and sampled data affect the learning trajectory.

浏览器真实训练 · 打开实验 ↗

有边界的 Agent 工作流

阅读方法,改变一个输入,对比两次运行的导出结果。

21

人工批准关卡

A write pauses without the mock approval toggle.

本地计算 / 模拟 · 打开实验 ↗
22

已批准的模拟写入

Approval permits only the local mock write.

本地计算 / 模拟 · 打开实验 ↗
23

工具白名单

A disallowed calculator call stops the workflow.

本地计算 / 模拟 · 打开实验 ↗
24

预算耗尽

The second paid action is blocked before exceeding budget.

本地计算 / 模拟 · 打开实验 ↗
25

记忆截断

Only the latest result survives FIFO truncation.

本地计算 / 模拟 · 打开实验 ↗

混合检索与重排

阅读方法,改变一个输入,对比两次运行的导出结果。

26

混合融合基线

Combining independent ranks can promote shared candidates.

本地计算 / 模拟 · 打开实验 ↗
27

纯词法检索

Exact query words alone set the ranking.

本地计算 / 模拟 · 打开实验 ↗
28

纯向量检索

Only vector direction determines the ranking.

本地计算 / 模拟 · 打开实验 ↗
29

理想重排上界

Perfect labels can improve ordering only inside the candidate pool.

本地计算 / 模拟 · 打开实验 ↗
30

候选集不足

Even an oracle cannot recover documents excluded before reranking.

本地计算 / 模拟 · 打开实验 ↗

LLM 裁判审计

阅读方法,改变一个输入,对比两次运行的导出结果。

31

混合裁判一致性

Agreement and order consistency measure different properties.

本地计算 / 模拟 · 打开实验 ↗
32

完全一致

Perfect labels yield agreement and consistency of one.

本地计算 / 模拟 · 打开实验 ↗
33

总选第一个

Selecting the first position fails swap consistency.

本地计算 / 模拟 · 打开实验 ↗
34

平局占多数

A large tie class can make aggregate agreement misleading.

本地计算 / 模拟 · 打开实验 ↗
35

稳定但错误

A judge can be order-consistent and disagree with every human label.

本地计算 / 模拟 · 打开实验 ↗

模型路由与回退

阅读方法,改变一个输入,对比两次运行的导出结果。

36

两级路由

Most traffic uses the cheap path; failures add strong-model cost.

本地计算 / 模拟 · 打开实验 ↗
37

全部强模型

Strong-only routing provides a simple cost baseline.

本地计算 / 模拟 · 打开实验 ↗
38

频繁回退

High fallback frequency can erase routing savings.

本地计算 / 模拟 · 打开实验 ↗
39

低成本模型故障

Every request pays both cost and latency before successful fallback.

本地计算 / 模拟 · 打开实验 ↗
40

主模型无故障

Expected cost is a weighted average without retries.

本地计算 / 模拟 · 打开实验 ↗

量化与离群值

阅读方法,改变一个输入,对比两次运行的导出结果。

41

四位量化基线

Fewer representable values introduce rounding error.

本地计算 / 模拟 · 打开实验 ↗
42

八位重建

More quantization levels usually reduce reconstruction error.

本地计算 / 模拟 · 打开实验 ↗
43

两位压力测试

Only three signed levels preserve little detail.

本地计算 / 模拟 · 打开实验 ↗
44

离群值支配尺度

An outlier enlarges the global step and collapses small values.

本地计算 / 模拟 · 打开实验 ↗
45

全零张量

The zero-range safeguard reconstructs all zeros exactly.

本地计算 / 模拟 · 打开实验 ↗

请求缓存与 TTL

阅读方法,改变一个输入,对比两次运行的导出结果。

46

局部性基线

Repeated keys can avoid repeated model work.

本地计算 / 模拟 · 打开实验 ↗
47

容量抖动

A tiny cache evicts useful entries before reuse.

本地计算 / 模拟 · 打开实验 ↗
48

TTL 到期

Entries expire at the next request with this interval.

本地计算 / 模拟 · 打开实验 ↗
49

高复用负载

Temporal locality improves the hit rate.

本地计算 / 模拟 · 打开实验 ↗
50

全部唯一请求

Unique keys provide no exact-match cache savings.

本地计算 / 模拟 · 打开实验 ↗

Tokenizers · RAG chunking · Sampling · Evals

本地教学实验,不调用外部 API。合成示例不能替代生产环境测量。