Improbable Bigrams Expose Vulnerabilities of Incomplete Tokens in Byte-Level Tokenizers
Jang, Lee, Chung et al.
Tokenization is a crucial step that bridges human-readable text with model-readable discrete tokens. However, recent studies have revealed that tokenizers can be exploited to elicit unwanted model behaviors. In this work, we investigate incomplete tokens, i.e., undecodable tokens with stray bytes resulting from byte-level byte-pair encoding (BPE) tokenization. We hypothesize that such tokens are heavily reliant on their adjacent tokens and are fragile when paired with unfamiliar tokens. To demonstrate this vulnerability, we introduce improbable bigrams: out-of-distribution combinations of incomplete tokens designed to exploit their dependency. Our experiments show that improbable bigrams are significantly prone to hallucinatory behaviors. Surprisingly, the same phrases have drastically lower rates of hallucination (90% reduction in Llama3.1) when an alternative tokenization is used. We caution against the potential vulnerabilities introduced by byte-level BPE tokenizers, which may introduce blind spots to language models.
본 논문은 바이트 수준 바이트 쌍 인코딩(BPE) 토크나이저의 불완전한 토큰 취약성 문제를 연구합니다. 저자들은 산재된 바이트를 포함하는 이러한 불완전한 토큰이 인접 토큰에 심각하게 의존하며, 낯선 토큰과 쌍을 이룰 때 문제가 발생함을 발견했습니다. "불가능한 이원조"(불완전한 토큰의 분포 외 조합)를 구성함으로써, 저자들은 이러한 취약성이 상당한 환각 행동을 초래함을 입증했습니다. 실험 결과 대체 토크나이제이션 방법 사용 시 동일한 구문의 환각률이 대폭 감소했습니다(Llama3.1에서 90% 감소).
단계 1: 구조 분석
- 토큰의 시작 바이트 및 연속 바이트 식별
- 토큰이 필요하거나 제공하는 바이트 수 결정
단계 2: 호환성 매칭
- 구조적으로 상호 보완적인 토큰 쌍 탐색
- 조합이 유효한 유니코드 문자를 형성하도록 보장
단계 3: 실행 가능성 검증
- 디코드-인코드 테스트 실행
- 생성된 문자열이 예상대로 토크나이제이션되는지 검증
Land, S. & Bartolo, M. (2024). Fishing for magikarp: Automatically detecting under-trained tokens in large language models.
Bostrom, K. & Durrett, G. (2020). Byte pair encoding is suboptimal for language model pretraining.
Sennrich, R., Haddow, B., & Birch, A. (2016). Neural machine translation of rare words with subword units.
Limisiewicz, T. et al. (2024). MYTE: Morphology-driven byte encoding for better and fairer multilingual language modeling.
종합 평가: 이는 바이트 수준 BPE 토크나이저의 중요한 보안 취약성을 식별한 고품질 연구 논문입니다. 일부 한계가 있지만, 그 독창성, 실험의 엄밀성, 실용적 가치는 토크나이저 보안 연구 분야에 중요한 기여를 합니다. 본 연구는 대규모 언어 모델의 안전성과 견고성 향상에 중요한 의미를 갖습니다.