Geometry Lab: fine-tuning ignores a scratch-trained model's own vocabulary
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python, typescript
調査の方向性
まず code/backend/src/llm_geometry/geo/finetune.py の157行目と207行目から始め、次に code/frontend/src/lib/staticClient/geo.ts の対応するフローと比較します。issue に記載されている scratch-training と fine-tuning の再現を実行します。fine-tuning によって scratch モデルの語彙が保持され、既知の単語が両方のパスで同じ token id に往復変換されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Found by an adversarial review of the feature-005 documentation: a panel note claimed
fine-tuning "keeps the existing vocabulary". It does not, and the underlying behaviour is
wrong rather than the note being merely sloppy.
What happens
train from scratch mints a model with a fresh 1000-word vocabulary built from the
user's text, so its token ids mean different words than the shipped checkpoint's.
Fine-tuning that model then encodes the fine-tuning text with the shipped vocabulary:
code/backend/src/llm_geometry/geo/finetune.py:157—ids = get_tokenizer().encode_stream(text)
(the module-level canonical tokenizer, nevertokenizer_for(base))code/frontend/src/lib/staticClient/geo.ts— same, and its own docstring says
"Fine-tuning keeps the shipped vocabulary"
So gradients land on rows whose ids mean something else entirely.
It also loses the base's vocabulary on the way out:
finetune.py:207 calls save_weight_set(new_ws, source="finetuned", store=store) with no
vocab_json, so tokenizer_for() falls back to the canonical tokenizer for the result —
and every dot on the sphere is relabelled with the shipped words.
Repro
- Train from scratch on any text with ≥1000 distinct types.
- Fine-tune the resulting model on a paragraph.
- Hover the dots: they are labelled with the shipped checkpoint's words, not yours.
Fix sketch
finetune.py: tokenize withtokenizer_for(base_token, store), and pass the base's
vocab_jsonthrough tosave_weight_setso the result keeps its own words.- Mirror in
staticClient/geo.tsvia the engine'stokenizerFor(base). - Test: scratch-train, fine-tune, assert the fine-tuned model's vocabulary equals the
scratch model's and that a known word round-trips to the same id.
Documented in the meantime: the Info tab and the fine-tune panel both now say outright that
fine-tuning uses the shipped vocabulary, and link here.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ContextLab/llm-geometry のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
getting startedオープン
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
ContextLab/llm-geometry#1 · コメント 9 件 ·
ContextLab/llm-geometry の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
mobile-next/mobile-mcp#526 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 1/5 1時間未満 初心者へのやさしさ 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信