NinaXander: Feasibility and Limits of Composing Frozen Language Models Across Architecture Families via a Shared Latent Space
Organizations: Graduate School of Informatics Nagoya University · Information Technology Center Nagoya University
Abstract
In this paper we propose NinaXander, a series of composed language models obtained by connecting layers of frozen language models from different architecture families with a single trained shared-latent adapter. A composed model runs the first layers of one model, converts the resulting intermediate representation once with the adapter, and then runs the remaining layers of the other model. Once the adapter is trained, several composed models that connect at different layers are obtained without retraining. Using the recurrent RWKV-4-Raven-7B and the Transformer-based Tulu-Pythia-6.9b, abbreviated as RWKV and Pythia, this study examines whether frozen models from different families can be recombined post hoc. The composed models answered multiple-choice questions, and those whose generations we examined produced syntactically well-formed text. The configuration that combines the first 5 layers of Pythia with the remaining 27 layers of RWKV reduced the Transformer key-value (KV) cache by 84.4% with accuracy not significantly different from that of RWKV alone. In multiple-choice accuracy, however, no composed model matched the parent model Pythia, and language-modeling performance decreased sharply on WikiText, a corpus of Wikipedia articles outside the training domain. The correspondence between intermediate representations was also obtained in one favorable case, with a shared tokenizer, the same depth, and the same hidden width, and does not show that the models share a general semantic space.
Figures & tables
| ARC | SciQ | |||||||
| R P | P R | R P | P R | |||||
| Ad | Af | Ad | Af | Ad | Af | Ad | Af | |
| 4 | 59.6 | 41.9 | 62.2 | 60.2 | 70.9 | 47.5 | 69.2 | 69.6 |
| 8 | 59.0 | 43.1 | 57.3 | 56.0 | 67.7 | 49.1 | 64.6 | 68.0 |
| 16 | 48.6 | 34.8 | 57.5 | 57.5 | 54.5 | 35.9 | 68.0 | 69.6 |
| 24 | 47.0 | 39.4 | 59.6 | 59.2 | 51.1 | 42.7 | 69.9 | 68.2 |
| ARC | SciQ | |||
|---|---|---|---|---|
| R P | P R | R P | P R | |
| 4 | ||||
| 8 | ||||
| 16 | ||||
| 24 | ||||
| R self | R P | P self | P R | |||||
|---|---|---|---|---|---|---|---|---|
| ARC | SciQ | ARC | SciQ | ARC | SciQ | ARC | SciQ | |
| 4 | 62.8 | 68.5 | 59.6 | 70.9 | 62.2 | 74.8 | 62.2 | 69.2 |
| 8 | 59.8 | 66.7 | 59.0 | 67.7 | 62.7 | 74.8 | 57.3 | 64.6 |
| 16 | 54.8 | 59.8 | 48.6 | 54.5 | 57.4 | 71.1 | 57.5 | 68.0 |
| 24 | 52.2 | 57.9 | 47.0 | 51.1 | 59.4 | 70.1 | 59.6 | 69.9 |
| ARC | SciQ | |||||
| vs RWKV | Dir. | vs RWKV | Dir. | |||
| R P | P R | P R R P | R P | P R | P R R P | |
| 4 | ||||||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| 8 | ||||||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| Config. | Trans- former layers | KV/token (KiB) | KV@4k (GiB) | Reduc. (%) | ARC/ SciQ | |
|---|---|---|---|---|---|---|
| P alone | – | 32 | 512 | 2.00 | 0 | 65.3/81.0 |
| R P | 4 | 27 | 432 | 1.69 | 15.6 | 59.6/70.9 |
| R P | 8 | 23 | 368 | 1.44 | 28.1 | 59.0/67.7 |
| R P | 16 | 15 | 240 | 0.94 | 53.1 | 48.6/54.5 |
| R P | 24 | 7 | 112 | 0.44 | 78.1 | 47.0/51.1 |
| P R | 24 | 25 | 400 | 1.56 | 21.9 | 59.6/69.9 |
| ARC | SciQ | |||||
|---|---|---|---|---|---|---|
| Config. | Trans- former | Diff. | Diff. | |||
| P R | 4 | 5 | ||||
| R P | 24 | 7 | ||||
| P R | 8 | 9 | ||||
| R P | 16 | 15 | ||||
| P R | 16 | 17 | ||||
| Prompt (verbatim) | Pythia alone | RWKV Pythia ( ) | RWKV alone | Pythia RWKV ( ) |
| ### Instruction: What is the capital of France? ### Response: | “The capital of France is Paris.” | “The capital of France is Paris.” ✓ | “Paris.” | “Paris.” ✓ |
| The three primary colors are | “red, yellow, and blue. These colors are often used in combination to create a wide variety of colors.” | “red, yellow, and blue.” ✓ | “red, blue, and yellow.” then drifts into a Q&A asking for green, the opposite color of red | “red, blue, and yellow.” then drifts into a Bob/Alice dialogue about green |
| Question: Water is made of hydrogen and Answer: | “Hydrogen is made of hydrogen and oxygen.” | “Hydrogen.” wrong | “hydrogen.” wrong | “hydrogen.” wrong |
| ### Instruction: Explain what a black hole is in one sentence. ### Response: | “A black hole is a region of spacetime where gravity is so strong that nothing, not even light, can escape its pull.” | “A black hole is a region in space where gravity is so strong that nothing, not even light, can escape its pull.” ✓ | “A black hole is a region of space where the gravitational pull is so strong that nothing, not even light, can escape.” | “A black hole is a type of celestial object that is formed when a star collapses and collapses into a black hole.” circular |