Token Lab検索

← Token Lab
TOKEN LAB / LEARN BY DOING

実験して学ぶ AI エンジニアリング。

LLM、RAG、エージェント、評価、推論。予測し、変数を一つ変え、実験で確かめましょう。

50対話型ラボ500練習問題0API keys

10 の共通エンジンによる 50 の実験。それぞれ異なる仮説と設定があります。

01注意力とマスク02埋め込みの幾何03KV キャッシュとページング04ニューラルネットを学習05制限付きエージェント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.

ブラウザ内の実学習 · ラボを開く ↗

制限付きエージェント

方法を読み、一つの変数を変えて出力を比較してください。

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

4 ビット量子化

Fewer representable values introduce rounding error.

ローカル計算・シミュレーション · ラボを開く ↗
42

8 ビット再構成

More quantization levels usually reduce reconstruction error.

ローカル計算・シミュレーション · ラボを開く ↗
43

2 ビットの限界

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 を使わないローカル教材です。合成データの結果は本番測定ではありません。