Training processing when tokenization mismatch
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
```python
if cur_len < tokenizer.model_max_length:
if cur_len != total_len:
--> target[:] = IGNORE_TOKEN_ID
rank0_print(
f"WARNING: tokenization mismatch: {cur_len} vs. {total_len}."
f" #turn = {len(turns) - 1}. (ignored)"
)
```
Line 158 of https://github.com/lm-sys/FastChat/blob/main/fastchat/train/train.py set all the target tokens to ignore_token_id.
Why not mask out mismatch turn (usually the last turn) only? `target[cur_len:] = IGNORE_TOKEN_ID`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in fastchat/train/train.py around line 158, where the tokenization-mismatch branch assigns IGNORE_TOKEN_ID to the full target. Review how cur_len and total_len determine the mismatch, then verify that only the mismatched portion is ignored while valid target tokens remain available for training.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100