LAION-AI / LAION-AI/Open-Assistant

For peft trainiing how to handle tokenizer changed?

Open
#3,648 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
37.4k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

If the model's num_embeddings is 10000,but we change the tokenizer to 10007.
After SFT training the model's num_embeddings will be 10016, that because in model/model_training/utils/utils.py get_model(conf, tokenizer, pad_vocab_size_to_multiple_of=16, check_freeze_layer=True) has parameter pad_vocab_size_to_multiple_of=16.
But when we try to start a peft training, It will fail because of the following code:
if len(tokenizer) != n_embs and check_freeze_layer:
assert not conf.freeze_layer, "Cannot change the number of embeddings if the model is frozen."

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in model/model_training/utils/utils.py at get_model and inspect how tokenizer length, num_embeddings, pad_vocab_size_to_multiple_of, and check_freeze_layer interact during PEFT training. Reproduce the failure with a tokenizer growing from 10,000 to 10,007 tokens and determine the expected behavior when conf.freeze_layer is enabled; done requires PEFT training to handle this mismatch without the reported assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.