Skip to content

Exclude Special Tokens from Masking in mlm_masking #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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