---
title: Gali: a small LLM between the halves of a frozen autoencoder
description: Draft paper on Gali's architecture: a frozen multilingual autoencoder, a trunk with long skips, two branches, passes and memory.
---

Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Gali** · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

This page as HTML: <https://gali.elamur.ai/free/en/0.6/papers/gali/>

# Gali: a small large language model between the halves of a frozen multilingual autoencoder

Draft, Gali 0.6 preview (tied to Mova 0.6). Elamur, November 2026. Open to edits until Mova 0.6 is released.

## Abstract

We describe Gali, a small large language model (sLLM) built around Mova, a deterministic parser and small language model (SLM). Gali never reads or writes characters: a multilingual encoder–decoder autoencoder, trained on about 280 languages with Mova's markup and then frozen, turns tokens into states and back, and Gali — a 40-block trunk with long skips and two 8-block branches — works between its halves. One branch writes the answer, the other writes Gali's own work: a thought in English and memory cells. Gali answers in passes, each reading the input together with the previous answer and work. Every training target is known without any AI: Mova's parses, human translations, and tasks built by code. We give examples from our experiments with their controls, including results that disappointed; full comparisons with alternative designs are left for later.

## 1. Introduction

Large language models learn language, knowledge and reasoning in one set of weights from raw text. Gali splits the problem. Reading and writing text — tokenisation, morphology, markup, many scripts — is learnt once by an autoencoder and frozen; Gali learns only what lies between reading and writing. The markup the autoencoder rebuilds is Mova's: dependency relations, pragmatics, features and WordNet concepts, so Gali's answers can carry it too. Gali thinks in English, whatever the language of the question and of the answer.

## 2. Related work

The autoencoder follows multilingual sequence-to-sequence pretraining (mBART, Liu et al. 2020; T5, Raffel et al. 2020), where one set of weights serves every language and a shared space appears without translation. Gali's passes over its own earlier output relate to recurrent-depth reasoning (Geiping et al. 2025) and to the deep supervision of hierarchical reasoning models (Wang et al. 2025; Jolicoeur-Martineau 2025). The long skips inside the encoder and the trunk are a sparse form of DenseFormer's depth-weighted averaging (Pagliardini et al. 2024). The idea list is a k-nearest-neighbour memory in the spirit of Memorizing Transformers (Wu et al. 2022) and kNN-LM (Khandelwal et al. 2020), and the pair of fast session memory and slow permanent memory follows complementary learning systems (McClelland et al. 1995). Latent reasoning without tokens (Coconut, Hao et al. 2024) is the alternative we did not take: Gali's thoughts are written in English tokens, so they can be read and supervised.

## 3. Architecture

Gali is a transformer that never reads or writes characters itself. A multilingual autoencoder, trained first and then frozen, turns tokens into states and states back into tokens; Gali works on those states in between. This draft describes the design of the preview tied to Mova 0.6.

Figure: text is coded by a bank and read by the frozen 12-block encoder; Gali's 20-block trunk (skips 4 → 12 and 8 → 16) feeds an output branch and a work branch of 4 blocks each; the frozen decoder writes the answer (@my_out) and the work (@my_work, in English or Lojban); the next pass reads the input with the previous answer and work, for at least three passes.

### The autoencoder: one reader and one writer for all languages

The autoencoder is a 16 + 16-block encoder–decoder transformer of width 512 (126 million parameters) with one set of weights for every language, working in the 16 384 ids of [the vocabulary](https://md.gali.elamur.ai/free/en/0.6/papers/vocabulary/). It is trained to rebuild a text from its bare words with the markup [Mova](https://mova.elamur.ai/free/en/) would write, then frozen: Gali uses its encoder to read and its decoder to write. Its design, tasks and measurements have [a page of their own](https://md.gali.elamur.ai/free/en/0.6/papers/autoencoder/).

### Gali: a trunk and two branches

```flow
title: one pass through Gali
- the encoder reads the input (and, from the second pass, the previous answer and work)
- Gali's trunk: 40 blocks of width 512, with long skips 8 → 24, 12 → 28 and 16 → 32
- the output branch (8 blocks) → the decoder writes the answer
- the work branch (8 blocks) → the decoder writes the work: a thought in English, memory cells
```

The trunk is a stack of 40 bidirectional transformer blocks of width 512 with 8 heads, the autoencoder's own width, so its states come in and leave through projections that start as identities. Three long skips carry the outputs of blocks 8, 12 and 16 into the inputs of blocks 24, 28 and 32, each through a linear map that starts at zero: the first blocks and the last ones work on their own, and the skips overlap in the middle. (The first Gali of this preview, whose results are below, had 20 blocks with skips 4 → 12 and 8 → 16 and branches of 4 blocks, on the earlier 12 + 12 × 384 autoencoder.)

After the trunk the stream splits into two parallel branches of 8 blocks each, with their own projections back to the autoencoder's width. The **output branch** writes the answer. The **work branch** writes everything that is the system's own: the thought in English before an answer, and the cells of memory. The same frozen decoder writes from either branch; what tells the two streams apart is the role token seeded into them (`@out` or `@work`, see below).

Every residual branch of Gali's blocks, every skip and every re-injection starts at zero, and the projections start as identities. So before training Gali is the identity: the decoder simply rewrites what the encoder read. Every gain is measured from that baseline.

- Trunk: 40 blocks × width 512, 8 heads, skips 8 → 24, 12 → 28 and 16 → 32
- Branches: output 8 blocks, work 8 blocks
- Parameters: about 176 million (the first Gali: 89.5 million)
- First stage of training: one pass, no scenes; passes, memory and scenes come second

### Passes: input, then output, then work

Gali answers in passes. On the first pass the encoder reads the input; the output branch writes an answer and the work branch writes a thought. On every later pass the encoder reads the input followed by the previous pass's answer and then its work, in this order, and both branches write again. The preview uses at least three passes.

In training the earlier answer is the right one with about 30 % of its tokens dropped, so the output branch learns to correct an answer rather than to copy it. In use, every pass reads Gali's own earlier output.

The thought is written in English, whatever the languages of the input and the answer. English has the richest parses of Mova and the most parallel text, so it is the language Gali thinks in; the answer is written in the language that was asked for. In this preview the work streams are also trained in Lojban, a logical language whose grammar has no ambiguity of structure, wherever a Lojban translation of the source exists ([Mova's Lojban grammar](https://mova.elamur.ai/free/en/docs/languages/jbo/)).

### Seeds: the language and the role, planted in every stream

Each stream — what the encoder reads, the answer, the work — carries a seed unit: the language's tag and a role token (`@in`, `@out`, `@work`). The unit stands twice at the start, again after 1, 2, 4 and 8 tokens, and then about every 16. The beginning is exact. Later only the density matters: a seed that comes too early or too late is wrong; its exact place is not. These tokens mean little by themselves. They keep the language and the role in view over long sequences.

### Memory

Memory is made of cells, each one vector of Gali's own width (512 numbers, 1 KB in 16-bit floats). A prompt has a few write slots in front of Gali's input; after the prompt's answer is known, a short write pass reads the input with the answer, and the slots' states after the work branch become the prompt's cells. So a cell knows both the question and the answer.

- **Session memory** is the cells of the session's earlier prompts, read as extra positions by every later prompt. The caller clears it; a session can be saved and restored.
- **The idea list** is Gali's permanent memory. Each entry is a key — the mean of the encoder's states of a prompt — and that prompt's cells. A new prompt reads the cells of the nearest entries. An entry is not written when a near-duplicate is there, and the least used entries leave first when the list is full. The lists of parallel copies of Gali merge into one by union, with near-duplicates kept once.

Whether 4 cells per prompt are enough, or 8 are needed, is measured in this preview.

### What is not here

Gali does not search the web, does not call tools and has no hidden channel: its thoughts and its memory are written in tokens or kept as cells that can be listed. Its weights and code are not published. These pages describe the design; they are drafts and will change.

## 4. Training

The autoencoder is trained first, on its own; then it is frozen and Gali is trained between its halves. Every task has an answer that is known without any AI: Mova's parse of the text, a human translation, or a chain of numbers built by code.

### The autoencoder's tasks

Text rebuilt with its markup, chains of numbers rewritten from one language's tokens into another's, and shared prompts diluted with words: see [the autoencoder](https://md.gali.elamur.ai/free/en/0.6/papers/autoencoder/#training).

### Gali's tasks

- Numbers: the same chains, through Gali
- Translation: human sentence pairs from Tatoeba between its languages, in both directions, with Tatoeba's own split into training and held-out translation groups
- Work: the English translation of the source, as the thought before the answer
- Recall: a prompt that holds only @recall must give back the earlier prompt of the session in another language, from the session's cells alone

The thought needs no AI either: Tatoeba groups translations of one sentence, so the English member of the group is the thought for any other pair in it. The open parallel corpora collected for Elamur — Europarl, the UN Parallel Corpus, the EU's translation memories and others, human translations under open licences — come next.

### Losses

- Words and markup are averaged apart and combined 90 to 10, so the markup is a light hint: the autoencoder is free to disagree with Mova where it is confident, and its confident disagreements become reports for Mova's own checking.
- Seeds are scored as described in [the architecture](https://md.gali.elamur.ai/free/en/0.6/papers/gali/#3-architecture): the start exactly, later only their density — at a loose seed both the seed and the next word are right, and so are the seed and the gold word just before it.
- Everything else is ordinary cross-entropy on the next token, with the decoder given the target so far.

### Data

Gali learns translation from human sentence pairs (Tatoeba: 8.5 million pairs among its languages, with its own split into training and held-out translation groups) and number chains built by code; its autoencoder reads about 830 million ids of text in about 280 languages — the sources, tasks and banks are described in [the autoencoder paper](https://md.gali.elamur.ai/free/en/0.6/papers/autoencoder/#data). Nothing written by another AI model is in the training data. Every source, with its authors and licence: [data and credits](https://md.gali.elamur.ai/free/en/0.6/credits/).

## 5. Examples from our experiments

The experiments below ran on the preview's first generation — the 12 + 12 × 384 autoencoder and the 20-block Gali; the 0.6 autoencoder's own runs are in [its paper](https://md.gali.elamur.ai/free/en/0.6/papers/autoencoder/#training).

This preview does not compare Gali with full alternative designs: there are no resources for such ablations yet. Below are examples from our own experiments, each with its date and the control it was read against.

### The autoencoder

The autoencoder's own results, the layer probe and the skip test are on [its page](https://md.gali.elamur.ai/free/en/0.6/papers/autoencoder/#measurements) and in [the study of the skip](https://md.gali.elamur.ai/free/en/0.6/studies/long-skip/).

### The skip from block 4 into block 8

Two autoencoders were continued from the same parent for 20 000 steps on the same data in the same order, one with a skip that adds block 4's states into block 8, one without (19 November 2026). With the skip, whole lines rebuilt without an error were ahead at every evaluation (35.9 % against 26.6 % at the end), the markup was behind (80.4 % against 83.5 %), and numbers were even (95.3 % and 96.9 %).

A probe of the token itself shows what the skip does: blocks 5 to 7 let the token fade faster (94.9 % against 98.1 % at block 7), block 8 brings it back, and at the top the two are the same (91.6 % and 91.9 %). The skip changes where the identity is held, not how much of it survives. We kept it: the idea is that a few blocks may work without the input's hints in between, as parallel work, while the long connection lowers the loss of what the input said.

### Continuing instead of starting over

We do not train the autoencoder from scratch when its tasks or data grow: it continues from its last checkpoint while the vocabulary layout stays. The cost is a dip, often deep, and then recovery:

- Seeds and roles added (language and role tokens planted in every stream, roles for a hundred copies of Gali): numbers fell from 95 % to 47 % after 5 000 steps and were back at 78 % after 10 000
- From 30 to 76 languages: markup on a mixed held-out set from 70 % to 76 % after 5 000 steps; numbers fell to 39 % and were at 58 % after 15 000
- From 76 to about 140 languages, with the small languages' Wikipedias: numbers at 64 % and 67 % after 5 000 and 10 000 steps

A model that has to keep old skills while it learns new ones loses them for a while; the evaluation sets change with the data, so numbers across these steps are read as trends, not as a table.

### The autoencoder as a checker of Mova

The markup is only a light hint in the loss, so where the autoencoder confidently disagrees with Mova, one of the two is wrong. On 430 held-out English sentences (20 November 2026; the autoencoder reads the bare words and is given Mova's markup so far), 39 775 markup positions, 4 408 disagreements, 379 with the autoencoder's own label at probability 0.9 or more. Case is not judged: the input has none. Of six cases we picked by hand as likely Mova errors, four were — an imperative form on a list fragment, a year read as the root, a compound for an adjective, an infinitive for a finite verb — and two were the autoencoder's mistakes. Mova's maintainers fixed the four with general rules; on the GUM and PUD treebanks 67 more tokens got the right labelled head and 40 the right head, and none of the 379 rows moved the wrong way.

A control plants errors: 5 % of Mova's labels are replaced by another label of the same family before the autoencoder reads them.

| family | planted | flagged at p ≥ 0.9 | restored to Mova's original |
|---|---|---|---|
| part of speech | 365 | 62 % | 84 % |
| dependency relation | 363 | 63 % | 83 % |
| head (distance) | 347 | 46 % | 71 % |
| all | 1526 | 64 % | 83 % |

So an error of this kind is caught about two times in three, and the head is the weakest family. A random confident disagreement is a Mova error in perhaps a third of cases: these are leads for review, not verdicts.

### A trap: copying the answer from the streams

The larger Gali reads, in some scenes, the noisy answer of another copy of Gali beside the source. After 24 000 steps its translations scored the same with the right source and with another source (word F1 0.075 and 0.072), while chains of numbers, which need the source, were right 78 % of the time: it had learnt to copy the streams. Making half of the translation items plain did not change that in the next 20 000 steps (0.136 and 0.133). The many translation directions at once (128 in the evaluation) are the next suspect; on English and French alone the small Gali followed its source clearly.

### Translation

The control for translation is the same model given another source sentence of the same direction: a model that ignores its input scores the same on both.

- English ↔ French, 3.1M-parameter Gali on a 5 + 5 autoencoder: word F1 0.63 against the reference, 0.13 with another source (no exact translation in 64)
- All directions among 30 languages, the same small Gali on the 30-language autoencoder: word F1 0.19, 0.16 with another source

So on two languages the answer clearly follows the source; across 30 it barely does yet, and the larger Gali (above) does not yet either. Character F-score (chrF) is reported beside word F1.

## 6. Limitations

The autoencoder is small for the about 280 languages it now reads, and translation across many languages does not yet follow the source. Concept labels from the most frequent WordNet sense and from Wikipedia links are noisy; they are only a light hint in the loss. Gali thinks in English (and in Lojban where it can): whatever does not pass well into English — an aspect system, an evidential, a pun, a register — can be lost in the thought before the answer is written. This is a deliberate trade: a thought in tokens of a language with rich parses can be read, checked and supervised, which a thought in hidden states cannot. A language of Gali's own, built on a logical language, is reserved for later. The passes and the seeds are new and their effect is not yet measured. Gali's weights and code are not published; these pages describe the design.

## References

- de Marneffe, M.-C., Manning, C. D., Nivre, J., Zeman, D. (2021). [Universal Dependencies](https://research.elamur.ai/free/en/papers/marneffe-2021-universal-dependencies/).
- Geiping, J. et al. (2025). [Scaling up test-time compute with latent reasoning: a recurrent depth approach](https://arxiv.org/abs/2502.05171).
- Hao, S. et al. (2024). [Training large language models to reason in a continuous latent space (Coconut)](https://arxiv.org/abs/2412.06769).
- Jolicoeur-Martineau, A. (2025). [Less is more: recursive reasoning with tiny networks](https://arxiv.org/abs/2510.04871).
- Khandelwal, U. et al. (2020). [Generalization through memorization: nearest neighbor language models](https://arxiv.org/abs/1911.00172).
- Liu, Y. et al. (2020). [Multilingual denoising pre-training for neural machine translation (mBART)](https://arxiv.org/abs/2001.08210).
- McClelland, J. L., McNaughton, B. L., O'Reilly, R. C. (1995). [Why there are complementary learning systems in the hippocampus and neocortex](https://doi.org/10.1037/0033-295X.102.3.419).
- McCrae, J. P. et al. (2019). [English WordNet 2019 — an open-source WordNet for English](https://research.elamur.ai/free/en/papers/mccrae-2019-english-wordnet/).
- Miller, G. A. (1994). [WordNet: a lexical database for English](https://research.elamur.ai/free/en/papers/miller-1994-wordnet/).
- Pagliardini, M. et al. (2024). [DenseFormer: enhancing information flow in transformers via depth weighted averaging](https://arxiv.org/abs/2402.02622).
- Popović, M. (2015). [chrF: character n-gram F-score for automatic MT evaluation](https://research.elamur.ai/free/en/papers/popovic-2015-chrf-character-n-gram-f/).
- Raffel, C. et al. (2020). [Exploring the limits of transfer learning with a unified text-to-text transformer (T5)](https://research.elamur.ai/free/en/papers/raffel-2019-exploring-limits-transfer-learning-unified/).
- Tiedemann, J. (2020). [The Tatoeba translation challenge — realistic data sets for low resource and multilingual MT](https://research.elamur.ai/free/en/papers/tiedemann-2020-tatoeba-translation-challenge-realistic-data/).
- Wang, G. et al. (2025). [Hierarchical reasoning model](https://arxiv.org/abs/2506.21734).
- Wu, Y. et al. (2022). [Memorizing transformers](https://arxiv.org/abs/2203.08913).

For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: https://gali.elamur.ai/sitemap.xml · https://gali.elamur.ai/llms.txt · https://md.gali.elamur.ai/free/en/0.6/papers/gali/
