tokenizer
Adversarial Attacks Expose Path-Dependent Failures in Discrete Medical Image Tokenizers
Loughzali, Ahmed, Yallamati, Akash, Reki, Aadiv, Vaida, Aslan Shaukat, Krishnan, Jeyashree
Discrete image tokenizers convert medical images into token sequences that downstream models either decode into an image for a classifier (the reconstruction path), classify directly (the token path), or feed to a generative multimodal model. We ask whether imperceptible input perturbations can break these systems through the tokenizer alone. We evaluate four tokenizers on three imaging modalities and extend the strongest attack to a deployed generative model. Our central finding is path-dependence: the same tokenizer fails in opposite ways depending on how its output is used. A supervised attack collapses diagnostic accuracy on the reconstruction path, with ROC AUC falling to $\leq 0.013$ at $ฮต=2/255$ on all four tokenizers, while sparing the token path. An unsupervised, label-free attack does the reverse; its damage concentrates in the multi-codebook tokenizers, worst in MedITok, whose token-path AUC falls from 0.919 to 0.239. The same label-free attack transfers to LLaVA-Med, a frozen medical vision-language model built on MedITok, making it report proliferative diabetic retinopathy in a healthy retina or call a malignant lesion benign, without access to the question, answer, or language-model gradients. Harm is driven by how far the attack moves the tokenizer's internal representation, not by how many tokens change: on the learned-codebook tokenizers, a control attack that changes nearly all tokens but moves the representation less leaves every path and answer intact. Domain-specific pretraining does not provide robustness: MedITok has the best clean accuracy yet is the most fragile, more so than UniTok, its general-domain counterpart. None of six candidate defenses repairs every failure mode, and several fail once the attacker optimizes against the defense directly. Medical tokenizer robustness must therefore be evaluated per downstream path, against an adaptive adversary.
Explicit Boundary Markers for Subword Vocabularies
Subword tokenizers represent many common words twice in space-using writing systems, once with a leading space and once without. The two entries have separate embeddings in models, so occurrences of one word are divided across rows that are trained independently, and the two forms need not even segment the string the same way: together may be a single entry while the same word without a preceding space is tokenized as to gether. Capitalization divides a word further, into as many as six forms. We introduce an alternative to standard whitespace conventions using an explicit word boundary marker, which prevents such duplication. Words are delimited by the boundary markers, and spaces between words are represented as pairs of such markers. Two shift codes do the same for title case and upper case, allowing one internal representation of a word to be re-used across different settings. Switching to this convention mitigates the duplicate-entry issue, but does not improve tokenization compression: for both vocabularylearning algorithms, the best marker scheme stays within one percent of the baseline in characters per token, averaged across six languages. It does result in better language modeling performance. Every marker scheme tested downstream reaches lower bits per byte than the baseline, suggesting that duplication carries a cost that compression does not capture.
Compute Optimal Tokenization
Limisiewicz, Tomasz, Pagnoni, Artidoro, Iyer, Srini, Lewis, Mike, Mehta, Sachin, Liu, Alisa, Li, Margaret, Ghosh, Gargi, Zettlemoyer, Luke
Scaling laws have informed the efficient design of language models, prescribing the optimal balance between model size and training data (Kaplan et al., 2020; Hoffmann et al., 2022). Standard approaches estimate the optimal amount of data in tokens for a given compute budget (and model size). However, expressing data volume in tokens overlooks a critical aspect: the information density that each token represents. Consequently, scaling findings inherently depend on specific tokenizers and their key property: the compression rate. To fill the research gap, we introduce laws that are aware of the compression rate T, defined as the average number of bytes per token in a given dataset. For that purpose, we need to vary the compression rate without changing the vocabulary size (and thus the number of parameters). Therefore, in our experiments we rely on Byte Latent Transformer (BLT, Pagnoni et al., 2025), a recent architecture that segments byte-level input in a latent space. BLT's latent tokenization is a robust tool for this purpose, as it allows us to precisely adjust the compression rate by setting an average segment size.1 Additionally, compression plays a significant role in subword tokenization. We can order popular subword methods by their compression rate: from pure byte or character-level segmentation (T 1) (Xue et al., 2022; Wang et al., 2024), through widely used BPE (T 4.57) (Sennrich et al., 2016), to SuperBPE (T 6.16) (Liu et al., 2025), which achieves high compression by allowing multi-word tokens.2
Spectral Vision Transformer for Efficient Tokenization with Limited Data
Roberts, Alexandra G., John, Maneesh, Zhang, Jinwei, Romano, Dominick, Sisman, Mert, Choi, Ki Sueng, Kim, Heejong, Sabuncu, Mert R., Nguyen, Thanh D., Dimov, Alexey V., Spincemaille, Pascal, Kopell, Brian H., Wang, Yi
Vision transformers tokenize an image into patches, which couples the token count to resolution and requires the embedding to be learned from data. We propose a spectral vision transformer architecture for efficient tokenization in the limited-data regime, with an emphasis on medical imaging. Rather than using spatial patches, we tokenize into coefficients of a fixed basis. This approach defines each token as one spectral mode, and the sequence length is chosen rather than implied by resolution, reducing the cost of attention. Our proposed spectral ViT shows superior or comparable performance where data is scarce in public medical imaging benchmarks, natural images, object shapes, simulations, and protected clinical data.
Channel-wise Vector Quantization: Native 1D Visual Tokenization with Learnable Ordering
Song, Wei, Wang, Tianhang, Chen, Yitong, Zhang, Tong, Wu, Zuxuan, Li, Min, Wang, Jiaqi, Yu, Kaicheng
We present Channel-wise Vector Quantization (CVQ), a novel image tokenization paradigm that replaces patch-wise tokens with channel-wise tokens. Unlike conventional vector quantization, which assigns a discrete token to each patch feature vector, CVQ quantizes each channel of the feature map. This represents an image as a 1D channel sequence with learnable coarse-to-fine ordering, rather than a 2D patch grid. Based on CVQ, we introduce a new visual autoregressive framework with "next-channel prediction". Instead of rendering images patch by patch in raster order, our Channel-wise Autoregressive (CAR) model predicts image channels sequentially, producing progressively enriched visual details. Specifically, it first sketches global structure and then refines fine-grained attributes, akin to a human artist's workflow. Empirically, we show that: (1) CVQ exhibits strong codebook scalability, maintaining 95%+ utilization with up to $2^{16}$ entries while delivering growing reconstruction gains over VQ as the codebook scales up; and (2) CAR attains a DPG score of 86.7 and a GenEval score of 0.79, demonstrating strong effectiveness for text-to-image generation.
AnyMo: Geometry-Aware Setup-Agnostic Modeling of Human Motion in the Wild
Chen, Baiyu, Li, Zechen, Wongso, Wilson, Li, Lihuan, Lin, Xiachong, Xue, Hao, Tag, Benjamin, Salim, Flora
As wearable and mobile devices become increasingly embedded in daily life, they offer a practical way to continuously sense human motion in the wild. But inertial signals are highly dependent on the sensing setup, including body location, mounting position, sensor orientation, device hardware, and sampling protocol. This setup dependence makes it difficult to learn motion representations that transfer across devices and datasets, and limits the broader use of wearable IMUs beyond closed-set recognition. We introduce AnyMo, a geometry-aware framework for setup-agnostic human motion modeling. AnyMo uses physics-grounded IMU simulation over dense body-surface placements to generate diverse and plausible synthetic signals, pre-trains a graph encoder from paired synthetic placement views and masked partial observations, tokenizes multi-position IMU into full-body motion tokens, and aligns these tokens with an LLM for motion-language understanding. We evaluate AnyMo on three complementary tasks: zero-shot activity recognition across 14 unseen downstream datasets, cross-modal retrieval, and wearable IMU motion captioning, where it improves average Accuracy/F1/R@2 by 11.7\%/11.6\%/22.6\% on HAR, increases zero-shot IMU-to-text and text-to-IMU retrieval MRR by 15.9\% and 28.6\%, respectively, and improves zero-shot captioning BERT-F1 by 7.5\%. These results support AnyMo as a generalist model for wearable motion understanding in the wild. Project page: https://anymo-project.github.io.
Taming the Entropy Cliff: Variable Codebook Size Quantization for Autoregressive Visual Generation
Zheng, Bowen, Luo, Weijian, Yang, Guang, Zhang, Colin, Hu, Tianyang
Most discrete visual tokenizers rely on a default design: every position in the sequence shares the same codebook. Such a constant-codebook design can consume the finite-data entropy budget very quickly. We observe that the per-position empirical conditional entropy decays so quickly along the sequence that, after a few positions, the conditional distribution becomes essentially deterministic. On ImageNet with $K=16384$, this happens after only about 2 out of 256 positions, when most prefixes already identify individual images in the dataset. We call this phenomenon the Entropy Cliff. Under full conditional utilization, larger codebooks exhaust the finite-data entropy budget in fewer positions. The empirical entropy decreases more gradually in our language comparison, where the effective entropy per position stays below the codebook capacity. To address this, we propose Variable Codebook Size Quantization (VCQ), where the codebook size $K_t$ grows monotonically along the sequence from $K_{\min}=2$ to $K_{\max}$, leaving the loss function, parameter count, and AR training procedure unchanged. With a vanilla autoregressive Transformer and standard next-token prediction, VCQ-Base achieves gFID w/o CFG 14.80 on ImageNet $256\times256$, compared with 27.98 and 18.16 for constant codebooks of size 16384 and 8192, respectively. Scaled up, it reaches gFID 1.71 with 684M autoregressive parameters, without any extra training techniques such as semantic regularization or causal alignment. The extreme information bottleneck at $K_{\min}=2$ encourages semantic concentration in early encoder features: a linear probe on features from only the first 10 positions reaches 43.8% top-1 accuracy on ImageNet, compared to 27.1% for uniform codebooks. These results show that what matters is not only the total capacity of the codebook, but also how that capacity is distributed and organized.
Training with Subword Variants Delays Overfitting in Repeated-Data Language Modeling
Cosma, Adrian, Ruseti, Stefan, Radoi, Emilian, Dascalu, Mihai
Subword tokenization introduces a computational layer in language models, where many distinct token sequences decode to the same surface form while preserving meaning, yet induce different internal computations. Despite this non-uniqueness, language models are typically trained using a single canonical deterministic tokenization. In this work, we use non-canonical subword variants as a strictly meaning-preserving form of data augmentation. We introduce a lightweight training architecture that conditions canonical next-token prediction on sampled subword variants via an auxiliary causal encoder and block-causal cross-attention, without modifying the training objective or token interface. In data-constrained pretraining, augmentations with subword variants consistently delay overfitting under repeated data exposure and reduce held-out next-token loss across evaluation datasets. In multilingual fine-tuning, we find that the effectiveness of training with auxiliary subwords depends on tokenizer quality: gains are strongest when canonical tokens are highly compressed and diminish when the tokenizer already over-fragments the input.
AnyMo: Scaling Any-Modality Conditional Motion Generation with Masked Modeling
Li, Yiheng, Li, Zhuo, Hou, Ruibing, Chen, Yingjie, Chang, Hong, Liu, Hao, Shan, Shiguang
Conditional human motion generation remains a fundamental challenge in computer vision and robotics. Despite significant progress, current methods are often constrained by fixed modality configurations and task-specific architectures, leaving cross-modal interactions and the scaling laws of multimodal-conditioned synthesis largely underexplored. A key bottleneck is the scarcity of large-scale modality-aligned motion data, limiting generalization across diverse control signals. In this work, we introduce OmniHuMo, a large-scale, high-quality dataset comprising over 5,000 hours of motion and 3.2 million sequences with precisely aligned multimodal annotations (e.g., text, speech, music, and trajectory). Leveraging OmniHuMo, we propose AnyMo, a unified multimodal framework combining a Residual FSQ-based motion tokenizer with a scalable masked modeling transformer, enabling high-quality motion synthesis under arbitrary modality combinations. Extensive experiments show that AnyMo achieves high-fidelity synthesis while offering flexible control over both spatial and stylistic attributes.
Controlled Decoding Attacks on Black-Box LLMs
Wang, Jesson, Li, Shawn, Yang, Wei, Dernoncourt, Franck, Rossi, Ryan A., Peris, Charith, Zhao, Yue
If LLMs are incorporated into similar decision-making pipelines, jailbreak vulnerabilities may introduce additional safety and privacy risks by allowing adversarial users to bypass intended safeguards. Safety alignment trains language models to refuse harmful requests (Ouyang et al., 2022; Bai et al., 2022), but this behavior remains vulnerable to interventions during generation. Decoding-time attacks act directly on the next-token distribution, using a helper model to redirect an aligned target's output (Zhao et al., 2025; Zhou et al., 2024). Related techniques in proxy tuning and controlled generation likewise steer a frozen model by modifying its output distribution (Liu et al., 2024a; Dathathri et al., 2020; Krause et al., 2021; Yang & Klein, 2021). Their appeal is the granularity of control: an intervention can respond to the evolving answer at each generation step. Their limitation is access: applying such an intervention directly requires target weights or numerical token probabilities. We study whether this fine-grained control can be retained when the target exposes only sampled text. Existing black-box jailbreaks primarily manipulate the input through prompt search (Chao et al., 2023; Mehrotra et al., 2023), template evolution (Liu et al., 2024b), multi-turn interaction (Russinovich et al., 2024), or encoded instructions (Yuan et al., 2024), leaving decoding-time control under such access comparatively unexplored. A natural route is to estimate a next-token distribution from repeated sampled continuations of the same prefix, then apply control to the resulting estimate.