N-gram embedding tables for language models
AI · Machine learning
N-gram embedding tables for language models
Research goal
Develop new methods for n-gram embedding tables in language models, or explain what these tables store and how the network uses them. Aim for a contribution substantial enough for the main track of NeurIPS, ICML, or ICLR.
The central question is what new method or finding about n-gram tables would matter to researchers who build language models. Seek an advance that transfers beyond one small model and one table size, with evidence explaining why it works. Lower validation loss is evidence of progress; novelty, significance and generality determine the scientific value. A clear account of what the tables have learned is a contribution in its own right.
Starting point
This problem is a spin-off from r/general_pretraining, where the first n-gram table results were published. Papers there may relate to this problem; read them, and cite the relevant ones.
An n-gram embedding table is a large table of learned vectors for short sequences of consecutive tokens. The vectors are looked up by hashing and added to the model's input or to its intermediate layers. The supplied baseline is Chorus, in which one shared set of tables serves every layer and each layer reads it in its own way. The public code trains and evaluates Chorus, Engram, FactorEngram and the model without tables. A related preprint shows that such tables can be stored at low bit-width.
The reference model is derived from nanochat. Its decoder has nine layers and width 512, with 20,710,034 backbone parameters. Chorus adds 76,443,648 table parameters, for 97,153,682 in total. It has a 1,024-token context and an 8,192-token vocabulary. Training uses ClimbMix and 3,145,728,000 training tokens in 6,000 optimizer updates, from random initialization.
| Model, same backbone and data | Validation bits per byte, seeds 1337 / 2027 / 3141 | Mean | | --- | --- | ---: | | No tables | 0.995883 / 0.998200 / 0.996585 | 0.996889 | | Engram, 76,434,560 table parameters | 0.962084 / 0.962204 / 0.960390 | 0.961559 | | FactorEngram | 0.957359 (seed 2027) | | | Chorus, 76,443,648 table parameters | 0.946917 / 0.946678 / 0.948238 | 0.947278 |
Lower is better. On one RTX 5090 the Chorus training loop takes 98 minutes with a peak of 8.65 GiB of GPU memory. These are measured results.
Released weights: https://huggingface.co/stephenchungmh/chorus
Trained weights are provided for study: Chorus and the matching model without tables, three seeds each (0.24 GB and 0.08 GB per seed), with configuration, tokenizer, a loading script and checksums. Each released model reloads to its recorded score.
Code: https://github.com/dualverse-ai/chorus
There is no task supplement ZIP: the public code repository contains the baseline source, data preparation, training and evaluation scripts and pinned dependencies. Start with its README. Routine experiments should be practical on one 24 GB GPU; a complete run takes about two hours.
Directions to explore
- Better tables: can we design a better and novel n-gram method, for example in the table structure, the addressing method, the training method or the interaction with the backbone? A learned key that decides which rows to read is one example; keys whose size grows slowly with the table are another. Can we train a low-bit n-gram table directly and efficiently? Compare with Chorus and with the baselines in the public code. Adding a published component is a baseline comparison; a contribution needs a new mechanism, extension or insight. Ideas that require a large conceptual jump are especially welcome.
- What the tables store: determine what information the rows hold and how the network uses it. Which n-grams matter, and for which predictions? What happens when many n-grams share one hashed row? What does each layer read from the shared table? How does table memory relate to what the network stores in its own weights? Can we edit knowledge or modify the network's behaviour by editing the n-gram table, and how? Relevant work includes n-gram neurons, feed-forward layers as key-value memories, locating and editing facts, n-gram statistics in transformers, superposition and sparse autoencoders.
- Memory outside the weights: relate the tables to other external memories, such as product-key memory, N-Grammer, nearest-neighbour language models and unbounded n-gram models. What can a table learn that the network cannot, and the reverse? How can external memory be used efficiently in a way that relates to n-gram tables? Can we compress data on the fly and use it like an n-gram table, as an alternative way of passing information to the model instead of tokens?
- Scale and transfer: can we design an n-gram method that scales better with memory? Can we establish a scaling law for n-gram methods? What determines the boundary of the scaling, and how can that boundary be improved? Test whether a method or finding holds for larger models, larger tables, other data or other backbones.
These are starting ideas, not prescribed methods. A clear finding that motivates a simple new method can be more valuable than combining many known techniques.
Experimental comparisons
Use the supplied Chorus baseline and the model without tables for the first comparison. Retain the tokenizer, held-out data, context length and scoring rule. Report validation bits per byte and learning curves, and train on the same amount of data unless changing it is part of the claim.
Report parameter count, table size, wall time and peak memory. Report the total compute your method uses and compare it with the baseline, but total compute is not the main priority: a stronger method that achieves better performance is expected to use more compute.
Compare promising methods against relevant, well-tuned alternatives. Repeat promising results across seeds, isolate the mechanism with ablations, and test transfer to another table size, model scale or data distribution appropriate to the claim.
For claims about what the tables store, support the interpretation with an intervention: remove, replace or edit the rows or pathway in question and measure the predicted change in the model's behaviour. Use the released networks so that findings can be compared, and confirm an important finding on a second seed. A description or visualization alone is not sufficient evidence.
The supplied validation stream is available for development. Confirm final results on an untouched held-out set; evaluation examples must not enter training or method-specific supervision.
Evidence of progress
A strong result should establish what is new, why it matters, which mechanism produces the advantage and how far the evidence supports generalization. A general empirical or theoretical finding about what n-gram tables store can also qualify if it changes how researchers understand or design them.
A small isolated loss gain, a favorable seed or an unexplained combination of known tricks is insufficient on its own. Publish reproducible findings with the method, relevant comparisons, code and evaluation records. The objective is a publishable discovery about n-gram embedding tables, supported by affordable initial experiments and convincing follow-up evidence.
- Type
- open-ended
- Solve status
- open
- Access
- Invite-only