Lexinvariant Language Models
Qian Huang, Eric Zelikman, Sarah Li Chen, Yuhuai Wu, Gregory Valiant, Percy Liang
Abstract
Token embeddings, a mapping from discrete lexical symbols to continuous vectors, are at the heart of any language model (LM). However, lexical symbol meanings can also be determined and even redefined by their structural role in a long context. In this paper, we ask: is it possible for a language model to be performant without any fixed token embeddings? Such a language model would have to rely entirely on the co-occurence and repetition of tokens in the context rather than the a priori identity of any token. To answer this, we study lexinvariantlanguage models that are invariant to lexical symbols and therefore do not need fixed token embeddings in practice. First, we prove that we can construct a lexinvariant LM to converge to the true language model at a uniform rate that is polynomial in terms of the context length, with a constant factor that is sublinear in the vocabulary size. Second, to build a lexinvariant LM, we simply encode tokens using random Gaussian vectors, such that each token maps to the same representation within each sequence but different representations across sequences. Empirically, we demonstrate that it can indeed attain perplexity comparable to that of a standard language model, given a sufficiently long context. We further explore two properties of the lexinvariant language models: First, given text generated from a substitution cipher of English, it implicitly implements Bayesian in-context deciphering and infers the mapping to the underlying real tokens with high accuracy. Second, it has on average 4X better accuracy over synthetic in-context reasoning tasks. Finally, we discuss regularizing standard language models towards lexinvariance and potential practical applications.
Ask Lune
Ask anything. The answer quotes the paper.
Lune reads all of it and the papers around it, then shows you the passages behind every answer.
Lune answers from
the full paper · 2 top-tier papers that cite it · related work
Free to start. No credit card required.
Cited by top-tier papers2
- Mission: Impossible Language ModelsJulie Kallini, Isabel Papadimitriou, Richard Futrell, Kyle Mahowald et al.ACL 2024 · 15 citations
- Quadratic Coreset Selection: Certifying and Reconciling Sequence and Token Mining for Efficient Instruction TuningZiliang Chen, Yongsen Zheng, Zhao-Rong Lai, Zhanfu Yang et al.NeurIPS 2025 · 4 citations
Builds on3
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Learning to Recombine and Resample Data For Compositional GeneralizationEkin Akyürek, Afra Feyza Akyürek, Jacob AndreasICLR 2021 · 36 citations
- Can Sequence-to-Sequence Models Crack Substitution Ciphers?Nada Aldarrab, Jonathan MayACL 2021
Related papers
- Semantics or spelling? Probing contextual word embeddings with orthographic noiseJacob Matthews, John R. Starr, Marten van SchijndelACL Findings 2024 · 2 citations
- Interchangeable Token Embeddings for Extendable Vocabulary and Alpha-EquivalenceIlker Isik, Ramazan Gokberk Cinbis, Ebru Aydin GolICML 2025
- Reconstruction ProbingNajoung Kim, Jatin Khilnani, Alex Warstadt, Abdelrahim QaddoumiACL Findings 2023
- Rethinking Invariance in In-context LearningLizhe Fang, Yifei Wang, Khashayar Gatmiry, Lei Fang et al.ICLR 2025
- Is a cute puyfred cute? Context-dependent form-meaning systematicity in LLMsJaïr A. Waal, Giovanni CassaniACL Findings 2025
