Geometry Lab: fine-tuning ignores a scratch-trained model's own vocabulary
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- python, typescript
- Ambito
- backend, frontend, machine-learning
Direzione di ricerca
Inizia da code/backend/src/llm_geometry/geo/finetune.py alle righe 157 e 207, quindi confronta il flusso corrispondente in code/frontend/src/lib/staticClient/geo.ts. Esegui la riproduzione dello scratch training e del fine-tuning descritta nell’issue. Il lavoro è completato quando il fine-tuning preserva il vocabolario del modello addestrato da zero e una parola nota esegue un round-trip allo stesso ID del token in entrambi i percorsi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ContextLab/llm-geometry
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
getting startedAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
ContextLab/llm-geometry#1 · 9 commenti ·
Tutte le issue di ContextLab/llm-geometry
Issue simili
-
Edit: Tele Posadas HDApertacheck:passed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area:mcp bug has repro platform:vscode regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anthropics/claude-code#103970 ·
I maintainer di solito rispondono entro 1 giorno
-
skillopt: success-reflect prompt omits the edit schema, so every success-only edit is droppedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Workspace secrets/constants containing "$" are corrupted when resolved in data source optionsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
sdk-typescript: unquoted COPY globs in shell form are silently dropped from the image build contextApertabug javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno