自定义词表扩充/发布场景下增加 Tokenizer 隐私防泄露提示及低频词元过滤支持
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Half a day
- Newbie friendliness
- 62/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation, tooling
Research direction
Start by locating the docs section that covers vocabulary expansion and custom tokenizer training/publishing, and check how min_frequency is currently surfaced there. For context on the risk, read the linked paper (arXiv:2510.05699) and its Tokenizer-MIA repo, which show that published tokenizer.json / .model files leak membership. Done means a short privacy note warning against publishing tokenizers built on sensitive corpora without low-frequency token filtering and recommending a non-zero min_frequency; the optional static pre-export check is a separate follow-up to scope with a maintainer.
Written by the indexing model from the issue text.
Description
Checklist / 检查清单
- I have searched existing issues, and this is a new feature request. / 我已经搜索过现有的 issues,确认这是一个新的 Feature Request。
Feature Request Description / Feature Request 描述
你好,提一个关于自定义词表 / Tokenizer 隐私安全的小建议。
很多开发者会用 ms-swift 在私有或敏感领域数据上做持续预训练、微调以及词表扩充(Vocabulary Expansion),并在完成后对外发布模型和对应的 tokenizer.json / .model 文件。但如果在构建或扩充词表时没有做词频剪枝(如 min_frequency 过滤),私有语料中的低频特定子词和合并规则会被直接记住在词表里。
我们在 USENIX Security 2026 的论文(arXiv:2510.05699,代码:https://github.com/mengtong0110/Tokenizer-MIA ,目前也已收录进 OWASP AISVS v1.0 Req. 11.2.5)中验证过:攻击者不需要调用模型推理、不需要访问模型权重,仅凭公开的 Tokenizer 文件就能直接做离线成员推理攻击(MIA),绕过所有推理阶段的隐私防御。
感谢阅读,如果可以我十分乐意参与进来补充:
- 文档补充:在词表扩充或自定义训练相关文档中增加一小段隐私提示,提醒在敏感数据上训练/扩充词表并公开发布时,注意过滤低频词元或设置非零
min_frequency。 - 可选的静态检查/过滤:在导出或发布前的工具链中,是否适合加一个轻量级的低频/异常词元检查选项(纯静态解析,不引入额外重依赖)。
Pull Request / Pull Request 信息
目前尚未提交 PR。如果团队认可这个方向,我可以先提一个轻量的文档 PR 补充隐私提示;如果可以,确认好放哪个模块后我也可以一起实现并补齐单测。
- Dominant language
- Python
- Stars
- 16.2k
- Forks
- 1.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 68
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from modelscope/ms-swift
-
get_multimodal_target_regex(..., exclude_router=True) does not exclude shared_expert_gatePossibly taken @KonnyakuMatcha claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelscope/ms-swift#10696 ·
Maintainers usually reply within 1 day
-
[BUG] GRPO REAL loss crashes with beta>0 and kl_in_reward=True (NoneType * Tensor)Possibly taken @newcloud123 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
modelscope/ms-swift#10690 ·
Maintainers usually reply within 1 day
-
[BUG] GRPO REAL loss divides by all groups instead of valid groups, silently scaling gradientsPossibly taken @newcloud123 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelscope/ms-swift#10688 ·
Maintainers usually reply within 1 day
-
[Bug] `get_seed` consumes a draw from the shared RandomState even when decision augmentation is disabled, changing the train/val split and dataset shufflePossibly taken @ryznren claimed this 38 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelscope/ms-swift#10466 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] `swift --help` raises KeyError instead of showing CLI helpPossibly taken @haahy claimed this 64 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelscope/ms-swift#10287 ·
Maintainers usually reply within 1 day
All issues in modelscope/ms-swift
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day