Lexinvariant Language Models

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 \emph{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 \textit{a priori} identity of any token. To answer this, we study \textit{lexinvariant}language 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.

Paper

References (28)

Scroll for more · 16 remaining

Similar papers

Peer review

Reviewer gQ1h6/10 · confidence 4/52023-07-06

Summary

This paper introduces lexinvariant language models, where the probability of any sequence is equal up to permutation of the vocabulary (e.g. P(A A B C) = P(B B C A)). In practice, the token embeddings within a Transformer model are replaced by random Gaussian vectors, which are consistent across a single sequence, but not over different examples. The authors show that a lexinvariant language model converges to modeling the true language distribution, in part because it is possible to infer the permutation (given a long enough sequence). While lexinvariant language models are not practical for many tasks, the paper shows that they can obtain better performance on some synthetic reasoning tasks. The authors also briefly discuss regularizing models with lexinvariance.

Strengths

To my knowledge, lexinvariance has not been explored before previously for natural language. The experiments are pretty thorough, for example by demonstrating how lexinvariant models converge, exposing how to recover cipher permutations (with an additional probe), and showing superior performance on synthetic reasoning tasks where tokens have no predefined meaning. The paper is generally clear and well-organized. It introduces the notion of lexinvariance, presents some theoretical properties (or characteristics) and describes how to construct a lexinvariant LM. This paper challenges (to some degree) the notion that stable word/token embeddings are required for language modeling.

Weaknesses

While the authors acknowledge the practical limitations of the approach, convergence can become quite slow as vocabulary size grows. Given that the approach is mostly suitable for small vocabularies, a more thorough comparison with byte-level LMs (which also use a small vocabulary and tokens have limited semantics) could be helpful. While I find the paper interesting, the motivation behind the problem/approach is unclear.

Questions

Is there a specific reason why spaces are not permuted for character-level examples? I would assume it's to simplify the presentation. How long are the prompts for the synthetic reasoning tasks? [L45] Typo in doesnt

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

Yes, limitations are discussed in the introduction (and elsewhere in the paper).

Reviewer 1RPb7/10 · confidence 4/52023-07-11

Summary

This paper presents “lexinvariant models” which eschew learning an embedding matrix for the symbols in the sequence and instead of modeling the identity of the symbols, they model the repetition and co-occurence patterns of the symbols in a sequence. Specifically, these symbols are interchangeable among all the items in the vocabulary and can be trained by drawing random vectors from a normal distribution to represent each symbol per sequence. This model is theoretically analyzed and it is shown that it can match with a standard autoregressive language model distribution as the context length increases. The models are mainly analyzed on symbol manipulation and decipherment tasks on synthetically generated data. A variant is also studied on natural language and code data.

Strengths

– This is an interesting class of models and an intriguing question that investigates how far could we go with just the surface patterns of symbols and without knowing the symbols. – The experiments on synthetic data show that such models have strong implicit decipherment capabilities and perform well on symbol manipulation tasks. This raises a possibility to augment standard language models with ideas from this approach to make the standard models more robust and performant on symbol manipulation and variable binding tasks. – The ideas are novel and the synthetic experiments are well-designed to explore the various facets of the models. The related work section does a good job of linking the ideas in this paper to other related topics in language modeling and symbolic representation.

Weaknesses

– The experiments are mostly on synthetic data and tasks. The performance on real world data lags behind the simple standard approach. While interesting, the practical utility of these models is still questionable and their applicability feels limited to controlled toyish scenarios. – The theoretical analysis seems to have fairly loose bounds. Especially, the distribution matching looks feasible only for impractical long context lengths and there might be a large gap for realistic context lengths that the models and data typically work with today. Also, \delta less than 0.5 is fairly loose. – Figure 2 seems awkward in the sense it implies that the model is essentially mixture of first order HMMs which seems far removed from the neural autoregressive models actually used in the experiments. – Section 3.2: 100 sequences seem too few as is suggested by the large variance of the proposed approach. Although the standard model seems to have a much smaller variance across the 100 sequences. This shows a further potential drawback of the proposed approach.

Questions

See above.

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

See above.

Reviewer zdSX8/10 · confidence 4/52023-07-23

Summary

This work explores neural language modelling without fixed token embeddings. Being invariant to symbols forces the model to rely on discovering patterns across sequences (e.g. co-occurrences, repeating symbols) that enable it to infer the underlying symbol sequence. For example, suppose the symbol-substituted sequence 123 123 145673 corresponds to “bye bye birdie”, the model can learn to predict the next symbol given enough training examples of different mappings of “bye bye” and, importantly, a sufficiently long context. The authors start out by formally defining lexinvariance and proving its convergence to standard LMs. Their theorem establishes theoretically that lexinvariant LM performance converges to standard LM performance quite efficiently as context length grows. This paves the way to implement a lexinvariant LM. During training, each token is represented with random Gaussian embeddings. Identical tokens are mapped to the same embedding within a sequence but to different embeddings across different sequences. Results show that a character-level invariant LM converges to standard LM performance as context length grows, reflecting the convergence theorem empirically. It is also shown that the invariant LM is implicitly learning Bayesian deciphering over different potential symbol permutations, using probing to extract model ciphers. Finally, the authors introduce some potential practical uses of lexinvariance, such as improved performance on in-context symbol manipulation tasks and LM lexical regularisation.

Strengths

-- #1 -- The theoretical and empirical findings of the paper are valuable contributions to our knowledge about the capabilities of language models and neural sequence models more generally. Fixed token embeddings are one of the core building blocks of LLMs and this paper explores LM behavior in their absence, leading to findings that many in the deep learning research community would find interesting. -- #2 -- The sections on symbol deciphering and uncertainty provide a useful analysis of how invariant LMs work under the hood. The roles of Bayesian deciphering and context length are made clear. The authors have proposed a model and explained a good deal about how it works. This is a nice contribution to the NLP interpretability literature. -- #3 -- The potential practical value of lexinvariant LMs (symbol manipulation tasks and lexical regularisation) are promising and worth further investigation. I could see this work being taken up by future researchers.

Weaknesses

-- #1 -- The probing experiments can be improved by discussing some potential pitfalls of the technique in this context and/or including more results. The main pitfall to consider is the fact that the probe could be responsible for learning part of the cipher, as opposed to the lexinvariant LM. How do we separate what the lexinvariant LM has learned from what the probe learns by itself? In the extreme case of the lexinvariant LM not learning any deciphering (not realistic, just to demonstrate) the probe might still be able to learn some deciphering based on the contextual information in the LM representations. In the more realistic case, suppose the lexinvariant learns the entire cipher except for a few token mappings. Then the probe could infer the remaining mappings during its training. This is unlikely given the task complexity of deciphering, but it could be worth discussing. The paper would be strengthened by adding results that separate model knowledge from probe knowledge e.g. including cipher probe accuracy for a randomly initialised model. See section 4.1 of this paper https://direct.mit.edu/coli/article/48/1/207/107571/Probing-Classifiers-Promises-Shortcomings-and for an overview of potential control methods. -- #2 -- The related works section is slightly disjointed. I understand that this is a result of the novelty of your idea and the far-reaching influences of the work. However, you could consider grouping the related work a bit more coherently. 4.1 and 4.3 could be connected as symbol grounding / invariance as augmentation, while 4.4 and 4.5 could be connected as downstream tasks related to your idea. * The symbol grounding subsection is interesting but requires slightly more explanation or references to previous works to clarify the matter to those unfamiliar with the problem. For example, Searle’s Chinese room argument is mentioned only by name. * The connection to ByT5 is not clear to me. In the extreme ByT5 would not become lexinvariant, it would just operate on finer grained units. Lexinvariance could be applied to any sequence unit or tokenisation scheme. If I’m misunderstanding something, please clarify, or perhaps consider omitting the subsection on ByT5.

Questions

1. Include more examples of semantic deciphering. If possible, include demantic deciphering accuracy compared to a random multiple choice selection baseline. It’s clear from your current example that the model can figure out that has to copy one of the possible answers, but not clear if the correct prediction of “coffee” is down to anything other than chance. 2. Could you please clarify the link you are making to ByT5? -- Typos -- - Fix typo line 45 “doesn’t”.

Rating

8: Strong Accept: Technically strong paper, with novel ideas, excellent impact on at least one area, or high-to-excellent impact on multiple areas, with excellent evaluation, resources, and reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

4 excellent

Limitations

NA

Reviewer Kmx73/10 · confidence 4/52023-07-24

Summary

The paper investigates the problem in which language model's tokens can be arbitrarily permuted (e.g., randomly interchanging two words $x$ and $y$ and stipulate that the new $x$ takes $y$'s meaning and vice versa -- such a process can happen over the entire vocabulary). The authors offer theoretical analysis and demonstrate that, to certain extent, it may be possible to train a language model invariant to permutations of the vocabulary.

Strengths

- The paper provides a large set of interesting empirical experiments showcasing that - Despite the significant theoretical flaw (see below), the analysis provided in the paper is an interesting (though rather irrelevant) result with a novel proof idea. It is a pity that the derived result is not useful for the paper’s claim. The techniques used in the “proof” is quite creative as far as I can tell.

Weaknesses

The paper has an important theoretical flaw, which is that the constructed lexinvariant LM *may not* be an LM. Let’s consider a concrete example: In the paper, the authors claim that, given an arbitrary LM $p(\dotsm)$, one can construct a lexinvariant “LM” (call it $p'$) that is “almost equivalent” to $p$. The specific construction offered by the authors is $p'(x_1,\dots,x_n)=\mathbb{E}_{\pi}[p(\pi^{-1}(x_1),\dots,\pi^{-1}(x_n))]$. However, problems arise upon closer inspection. By this definition, we first have $$ p'(X_1=x_1,X_2=x_2)=\frac{1}{2}p(X_1=x_1,X_2=x_2)+\frac{1}{2}p(X_1=x_2,X_2=x_1). $$ On the other hand, $$ p'(X_1=x_1,X_2=x_2,X_3=x_3)=\frac{1}{6}\sum_{\pi\in S_3}p(X_1=x_{\pi^{-1}(1)},X_2=x_{\pi^{-1}(2)},X_3=x_{\pi^{-1}(3)}). $$ When we marginalize the above over $X_3$, we get $$ p'(X_1=x_1,X_2=x_2)=\frac{1}{6}\Big( p(X_1=x_1,X_2=x_2)+ p(X_1=x_1,X_3=x_1)+ p(X_1=x_2,X_2=x_1)+ p(X_1=x_2,X_3=x_1)+ p(X_2=x_1,X_3=x_2)+ p(X_2=x_2,X_3=x_1) \Big). $$ We can clearly see that, for most LM’s, the above doesn’t agree with the first marginal (unless they satisfy very special conditions)! This shows that, the constructed lexinvariant “LM” isn’t in fact an “LM”. It’s a sequence of incompatible joint distributions. In other words, one cannot construct a stochastic process based on the definition of $p'$ by invoking Kolmogorov’s extension theorem, because the marginals are incompatible. Based on the this, the paper’s various premises and conclusions start to fall apart. First of all, Theorem 2.1 becomes a “correct” but irrelevant result (it is slightly incorect in the sense that $p'$ is no longer a languge model). At best, Theorem 2.1 can be interpreted as that for an arbitrary LM, there exists a sequence of (incomptaible) conditional distributions such that, when $x_{1:T}$ is sampled from $p$, w.h.p., the (incompatible) conditionals are close to conditionals of $p$ (this is what appears to be what the proof is proving, though I have not checked the 6-page proof in the appendix too closely and can’t speak to its correctness). Such an understanding of this result would significantly undermine various claims in the paper in the following ways: 1. First, one cannot conclude from the paper that given an arbitrary LM, there exists a “symmetrized” (i.e., lexinvariant) approximation of it. Therefore, one cannot, at least in theory, conclude that as the context gets longer, the “distance” between some lexinvariant model to an arbitrary LM will approach 0. 1. It is also quite likely that there exists such counterexamples — an LM in which no symmetric LM is a good approximation of it over any context length. If the authors are trying to provide a proof in that direction in the future, they may want to make an attempt at finding such counterexamples. 2. Furthermore, the empirical evidence is inconclusive as to the question of whether the specific implementation of the lexinvariant LM approximates the true conditionals. One may also look at Figure 3 and 7 and say that the perplexity curves have flattened out and that there is a systemic bias between the lexinvariant model and the standard language model. 2. Next, since $p'(\dotsm)$ is a sequence of incompatible joints, it is unclear if sampling from such a sequence of conditionals will yield something that can be justified. If the authors cannot repair this theoretical flaw, I cannot recommend the paper accepted as-is since the paper’s current narrative revolves around a “theoretical proof then empirical validation” narrative. If the theory turns out to be irreparable, the paper should be rephrased as a series of experiments without theoretical underpinnings. Finally, a minor detail is that the presentation frequently switches notation for unclear reasons, which is very confusing. Most notably, it is unclear why the paper sometimes use $p$ but then immediately switches to $\mathcal{P}$ (e.g., in Eq.(3), $\mathcal{P}$ appears without introduction; similar situation happens in line 481).

Questions

* In the proof in Appendix, A, line 482-483, can you elaborate why can we regard samples from $p$ and $\tilde p$ as the same?

Rating

3: Reject: For instance, a paper with technical flaws, weak evaluation, inadequate reproducibility and incompletely addressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

1 poor

Presentation

2 fair

Contribution

2 fair

Limitations

See weaknesses.

Reviewer xQSK7/10 · confidence 2/52023-07-27

Summary

The paper proposes a new language modelling approach, called *lexinvariance*, where entries in vocabulary are permuted (with an unknown permutation). The paper proves that a lexinvariant language model can predict language well: it converges to a true language model with a polynomial rate in terms of context length. The paper presents empirical evidence to support that. Besides, lexinvariant LM can also infer unknown permutation (i.e. "deciphering"). It can also help improve LMs by being used as regularization (similar to dropout).

Strengths

* The work is original. The idea of lexinvariance is interesting, and more importantly, the paper proves its convergence to true language model. Using gaussians to construct a lexivariant LM is a nice idea to reuse the standard LM architecture. * In terms of quality and clarity, the paper has a good balance between theory and experiment. The theoretical claim is proved, and supported by empirical evidence. The paper also shows possible applications of lexinvariance (deciphering, regularising a LM).

Weaknesses

The main weakness of the paper is that its application is limited. The most promising application is to use it to regularize a LM. However, it is unclear about the benefits of using lexivariant LM over using dropout. The experimental setting for char-permutation maybe biased. We should also consider "space" as a char. Otherwise, the model would have some good hint for word tokenization.

Questions

* It's confusing when using p as invariant LM (line 84) and a standard LM (the rest of the paper). * How to derive eq 3 from the definition of p'? * Line 314, "lexinvariant LM is one step further away from physical grounding." This work hardly supports the claim, because it shows convergence of lexi LM to standard LM rather than to grounded LM.

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

4 excellent

Presentation

2 fair

Contribution

3 good

Limitations

It is unclear about the work's application.

Reviewer xQSK2023-08-16

I would like to thank the authors for the response, which answers my questions. I increase the rating to 7.

Reviewer zdSX2023-08-12

I'd like to thank the authors for addressing my queries, clarifying a few points, and especially for running additional experiments. I am happy with what they have reported and will keep my ratings as is. I agree with the authors that the main strength of their work lies in its value as a scientific investigation. From this perspective I think it is a useful contribution to the field.

Reviewer 1RPb2023-08-16

Thanks for the response

I am keeping my initial score.

Reviewer gQ1h2023-08-21

Thank you for your response. I am generally satisfied with it. Although I am still not fully certain about the impact of the paper, you have shown potential future research directions.

Program Chairsdecision2023-09-21

Decision

Accept (spotlight)

© 2026 NYSGPT2525 LLC