Skip to content

Conversation

jihobak
Copy link

@jihobak jihobak commented Mar 25, 2025

Modified the mlm_masking method to exclude special tokens from the masking process.
Previously, the method applied masking uniformly to all tokens without considering special tokens.

Changes

  • Added a special_tokens parameter to allow specifying token IDs (e.g., [CLS], [SEP]) to be excluded from masking.
  • Updated the eligible mask logic to filter out both special tokens and pad tokens before applying masking.
  • Refactored the masking process to ensure that only eligible tokens are considered for the 80/10/10 masking scheme.

Discussions

  • Issue #212 regarding this change.
  • If needed, I will add unit tests for this function in a subsequent commit.

Tests

  • Is the new feature tested? (Not always necessary for all changes -- just adding to the checklist to keep track)
  • Have you ran all the tests?
  • Do the tests all pass?
  • If not, have you included an explanation of which tests this PR breaks and/or why (below this checklisT)

- Added a `special_tokens` parameter to allow specifying token IDs (e.g., [CLS], [SEP]) to be excluded from masking.
- Updated the eligible mask logic to filter out both special tokens and pad tokens before applying masking.
- Refactored the masking process to ensure that only eligible tokens are considered for the 80/10/10 masking scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant