← notes Architectures

NEO: one transformer reads pixels and words

NEO drops the vision encoder. Image patches enter the same layers as text, and new row and column RoPE channels give the image a 2D layout without touching the LLM.

19 min read 7 interactive

Two machines, or one

Most vision–language models are modular: a vision encoder (a ViT such as CLIP, SigLIP or InternViT) reads the image, an MLP projector converts its output, and a pretrained LLM reads the result next to the text. LLaVA, InternVL3 and Qwen2.5-VL follow this pattern. The two halves are different machines:

PropertyVision encoder (ViT)LLM
Attentionbidirectionalcausal
Position codeabsolute or 2D-RoPE1D-RoPE
RoPE base10 0001 000 000
Trainingcontrastive / masked / distillationnext-token prediction

The paper lists three costs of this split. The encoder brings biases from its own pre-training (fixed resolution, CLIP-style semantics, lost fine detail). Aligning the two halves needs many training stages. And capacity trade-offs and deployment get more complex.

A native VLM removes the encoder. Pixels go through a very small embedding layer and then into the same transformer as the words (early fusion). Fuyu, EVE, SOLO, Mono-InternVL, HoVLE and SAIL went this way. They hit known problems: vision learned inside a pretrained LLM is slow and unstable, and it can damage the language knowledge of the LLM.

NEO’s answer is one layer type, the native VLM primitive, used for every layer. It keeps the Qwen3 block:

x′=x+MHNA(RMSNorm(x)),xout=x′+FFN(RMSNorm(x′)).x' = x + \mathrm{MHNA}(\mathrm{RMSNorm}(x)), \qquad x_{\text{out}} = x' + \mathrm{FFN}(\mathrm{RMSNorm}(x')).

RMSNorm and the SwiGLU FFN are identical to Qwen3. All the new parts sit inside MHNA (multi-head native attention): extra query/key channels for height and width, Native-RoPE, and a mixed attention mask.

From pixels to one sequence

The patch embedding layer is two convolutions:

xv=Conv2(GELU(Conv1(I))+PE).x_v = \mathrm{Conv2}\big(\mathrm{GELU}(\mathrm{Conv1}(I)) + \mathrm{PE}\big).

First the image is resized so that both sides are multiples of 32, with the aspect ratio kept (native resolution, as in NaViT). Training uses images from 2562256^2 to 204822048^2 pixels. Conv1 has kernel = stride = 16, so each 16 × 16 patch becomes one vector. A 2D position code PE is added after the GELU. Conv2 has kernel = stride = 2 and folds each 2 × 2 group of patches into one token of the LLM width. Net effect: one visual token per 32 × 32 pixels. Special tokens <img> and </img> mark the image boundaries.

Each token then gets three indices (t,h,w)(t, h, w):

  • A text token gets the running position as tt, and h=w=0h = w = 0.
  • All tokens of one image share one tt. Their (h,w)(h, w) is their row and column, from (0,0)(0, 0) for every image.
  • After the image, tt continues from the previous maximum + 1. In video, tt goes up by one for each frame.

animation

An image becomes 192 tokens in the text sequence

Press Play, or use Step. Change the image size, then hover the strip to read the (t, h, w) of any token.

image token covers the red pill covers the blue pill text or marker token
image tokens
sequence length
largest t (NEO)
largest position (1D)
The default is the source's worked example: a 500 × 375 photo becomes 192 tokens, and the full sequence has 201 tokens. All image tokens share t = 1, so the last t is 9. Flat 1D positions would go up to 200. The slider range stays inside the training range, so only the rounding to multiples of 32 applies.

Why an image needs two more coordinates

RoPE encodes the position mm of a token by rotating pairs of query and key channels. A DD-dim vector has D/2D/2 pairs, and pair kk turns by the angle mθkm\theta_k with θk=β−2k/D\theta_k = \beta^{-2k/D}. Here β\beta is the base. After the rotation, the score between positions mm and nn depends only on n−mn - m. Fast pairs (small kk) encode local order. Slow pairs encode long-range order.

Qwen3 uses β=106\beta = 10^6. This pushes most pairs to low frequency. That is good for 32k-token text but bad for small spatial distances, because an image is only tens of patches wide.

The simplest way to use RoPE on an image is to flatten it row by row and use 1D positions, as InternVL does. Then the row structure is lost. The token below you is a full row away in flat order, and the last token of the row above can be your direct neighbour.

NEO needs a 2D position more than most models. All tokens of one image share one tt, so the tt channels see no difference between them. Without hh and ww channels, attention sees the image as an unordered bag of patches.

playground

Flat positions break the image layout

Click any patch to make it the query Q. Switch between flat 1D positions and separate h, w channels, and between the two bases.

Positions
RoPE base
A · cell straight below
B · end of the row above
contrast (max − min)

Scores are the mean cos over all pairs for all-ones q and k, the same measure the source uses. With 1D positions the far cell B scores higher than the true neighbour A. With h, w channels A wins. Base 10⁴ gives a larger contrast over the image than base 10⁶.

Add channels, do not borrow them

One RoPE pair turns by one position number, so it can hold tt, or hh, or ww, but never two at once. A token with three coordinates needs three groups of pairs. The question is where the hh and ww groups come from.

M-RoPE (Qwen2-VL) splits the LLM’s own 128 channels. With mrope_section = [16, 24, 24], pairs 0–15 carry tt, pairs 16–39 carry hh and pairs 40–63 carry ww, all on one base-10610^6 ladder.

NEO keeps all 128 channels for tt and adds 128 new ones per head. Two new linear layers, q_proj_hw and k_proj_hw, produce them. Their output is cut in half: 64 channels (32 pairs) for hh and 64 for ww, each half with its own QK-RMSNorm and base 10410^4, the usual ViT base. The values and the output projection do not change, so the layer output has the same shape. The score of one head is a sum of three parts:

sij=1128(q~i T⋅k~j T+q~i H⋅k~j H+q~i W⋅k~j W),s_{ij} = \frac{1}{\sqrt{128}}\Big(\tilde q^{\,T}_i \cdot \tilde k^{\,T}_j + \tilde q^{\,H}_i \cdot \tilde k^{\,H}_j + \tilde q^{\,W}_i \cdot \tilde k^{\,W}_j\Big),

where the tilde means “after QK-norm and RoPE”. The scale stays 1/1281/\sqrt{128}, the scale of the pretrained LLM, not 1/2561/\sqrt{256}. The frequency sets are ΘT={βT−2k/d}\Theta_T = \{\beta_T^{-2k/d}\} for 64 pairs and ΘH=ΘW={βH−4i/d}\Theta_H = \Theta_W = \{\beta_H^{-4i/d}\} for 32 pairs, with βT=106\beta_T = 10^6 and βH=βW=104\beta_H = \beta_W = 10^4.

The source names three problems of the shared layout:

  1. Text loses channels. If text gets h=w=0h = w = 0, the 48 hh and ww pairs of M-RoPE never rotate for text. That is 75% of the head. The pretrained attention patterns break. Qwen2-VL avoids this by setting h=w=th = w = t for text, and that choice has a cost (next section). In NEO the new channels hold hh and ww, so the 128 tt channels behave exactly as before for text.
  2. Columns get the slowest frequencies. The fastest ww pair of M-RoPE turns only 1.8×10−41.8 \times 10^{-4} rad per column. Across a 32-column image that is 0.0055 rad, or 0.3°. In NEO the fastest ww pair turns 1 rad per column.
  3. Rows and columns differ. In M-RoPE the hh section is about 180× faster than the ww section. In NEO the two sets of 32 frequencies are identical.

playground

Every RoPE pair of one head, as a dial

Each dial is one channel pair; its hand turns by Δ · θ. Move Δh and Δw, then switch the layout. Set Δh = Δw = 0 and move Δt to compare two text tokens.

Head layout
t pair h pair w pair
pairs that carry this move
pairs turned ≥ 0.1 rad
w pairs ≥ 0.1 rad / column
fastest w pair turns by
In M-RoPE the 24 w pairs barely move even across 31 columns (0.3°). In NEO, 9 of 32 w pairs turn at least 0.1 rad per column, and the h and w blocks are identical. The 64 t pairs of NEO are the original Qwen3 channels.

The extra channels cost parameters. One Qwen3-1.7B block has 50.3M weights. The new q_proj_hw (4.19M) and k_proj_hw (2.10M) add 6.29M, which is 12.5% per block. For Qwen3-8B the same count gives 10.9%.

Rows and columns restart at zero

Problem 1 forces M-RoPE to give text h=w=th = w = t. Then the image must sit at the right place on that diagonal, so its rows and columns are shifted by the position ss where the image starts: an image token gets (s,s+row,s+col)(s, s + \text{row}, s + \text{col}). NEO has separate h,wh, w channels that text never needed, so it can put all text at h=w=0h = w = 0 and let every image use its plain rows and columns 0,1,2,…0, 1, 2, \dots

This changes what a question sees. Take the query “left” and an image token in column cc. Let DD be the distance from the image to the question. RoPE sees the key index minus the query index:

M-RoPE: Δw=c−D,NEO: Δw=c−0=c.\text{M-RoPE: } \Delta w = c - D, \qquad \text{NEO: } \Delta w = c - 0 = c.

In M-RoPE the useful signal cc is mixed with DD, and DD changes from one example to the next: a short or long system prompt, a multi-turn chat, an image at the start or at the end.

playground

Move the question away from the image

Drag the distance D. Switch to one pair (θ = 0.1) to reproduce the source's worked example.

w channels
NEO: offset = c (any D) M-RoPE: offset = c − D
NEO best column
M-RoPE best column
M-RoPE range over columns
Same channels, same query, same image; only D changes. NEO's curve does not move, so one query vector can always mean 'look left'. In M-RoPE the best column jumps (c = 12 at D = 30, c = 15 at D = 5000) and the curve gets flat as D grows.

The source gives three reasons why this helps long contexts:

  • The spatial signal does not depend on distance. “Left” or “top row” mean the same thing 5 or 50 000 tokens away. The distance is still known, but only through the tt channels, which were built for long distances.
  • h,wh, w stay in the training range. The largest training image is 204822048^2 pixels, or 64 × 64 tokens, so h,w∈[0,63]h, w \in [0, 63] always. In M-RoPE a 100k-token context gives h,wh, w values near 100 000.
  • An image costs one tt step. One 204822048^2 image uses 4096 positions with 1D-RoPE, 64 with M-RoPE and 1 with NEO.

There is also a bonus. Because every image restarts at (0,0)(0, 0), the same place in two images gets the same (h,w)(h, w). That helps the model compare images.

One mask, two habits

A ViT lets every patch see every patch. An LLM must be causal for next-token prediction. NEO uses both: text tokens are causal, and the tokens of one image attend to each other in both directions while they still see earlier context causally. The released code builds this mask from the tt indices alone:

mask = (idx_j == idx_i) | (arange_j <= arange_i)   # same t index OR past token

All tokens of one image share one tt, so “same tt” means “same image”. Text tokens have unique tt values and get a plain causal mask. The paper runs this with FlexAttention.

playground

The mixed mask on the paper's toy sequence

Click a row label or a cell to pick a query. Toggle Causal and Mixed. Change the image size.

Mask
causal (j ≤ i) same image, j ≤ i same image, j > i (extra) blocked

allowed cells
extra cells vs causal
The t indices come from the code's cumsum rule. Only the solid orange cells differ from a causal mask: 12 for two 2 × 2 images. Image 2 can see image 1, but image 1 cannot see image 2.

The two parts work together. In the ablations, the mixed mask adds only 0.7 points with 1D-RoPE but 3.7 points with Native-RoPE. Bidirectional attention inside an image helps much more when the model also has real 2D positions.

Start as the LLM, then grow vision

During pre-training the backbone has two parts:

  • pre-Buffer: L1L_1 native primitives with random initialisation. They pre-align pixels and words, like an encoder.
  • post-LLM: L2L_2 native primitives initialised from Qwen3. They do full alignment and reasoning.

NEO-2.2B uses L1=12L_1 = 12 and L2=28L_2 = 28 (Qwen3-1.7B), so 40 layers. NEO-9B uses L1=6L_1 = 6 and L2=36L_2 = 36 (Qwen3-8B), so 42 layers. After pre-training the split goes away and all layers train together as one backbone.

The new channels of the post-LLM start in a special way: WQH,WW_Q^{H,W} is a copy of WQTW_Q^{T}, and WKH,WW_K^{H,W} is zero.

animation

Why copy Q and zero K

Pick a start, then press Train or +10 steps. Reset to watch from step 0.

Start of q, k (h, w channels)

step
h, w term at step 0
p(top-left)
gradient on k
Toy numbers: the source's worked example with three keys, one h pair and one w pair (θ = 0.5), trained to prefer the top-left key. NEO starts at the LLM's uniform 1/3 and learns. Both-zero never moves. Random learns, but it changes the LLM's scores before training.

Training has three stages. The loss in all of them is next-token cross-entropy on text; image tokens are inputs only. All stages use AdamW, bf16 and 16 nodes × 8 GPUs.

StageDataTrainedSteps · batch · lr
1. Pre-training345M caption pairs; 30% of the mix is text-onlypatch embedding, pre-Buffer, new h/w q/k and norms. LLM frozen190k · 2560 · 8e-4
2. Mid-training40M: caption 66%, conversation 11%, detection 8%, OCR 15%everything50k · 1200 · 4e-5
3. SFTabout 4M instructionseverything6k · 650 · 5e-5

The LLM is frozen in Stage 1 because the data are noisy web captions, and moving LLM weights on them would damage the language knowledge. That is a known failure of EVE- and SOLO-type models. The random pre-Buffer turns pixels into tokens that the LLM can read, and the new h,wh, w channels let the frozen layers look at space without changes to their old weights. Text passes through the pre-Buffer too, so the 30% text-only data keep that path good.

What the numbers say

The fairest comparison in the paper is Encoder-Based: the authors’ own modular baseline, Qwen3 + InternViT-300M, with the same mid-training and SFT data as NEO. Its vision encoder was pre-trained on more than 6B samples. NEO’s whole pre-training used 345M.

playground

Benchmarks and ablations

Switch between the 2B and 8B tables and the ablation table. Hover a bar for its value.

View

'Best previous native' is the maximum over all earlier native models for each benchmark, so it can be a different model for each bar. Ablations use 20M pre-training samples, 2M SFT samples and Qwen3-1.7B.

How to read it:

  • Against earlier native VLMs, NEO is best on most general benchmarks, with less data than SAIL (512M) or Mono-InternVL-1.5 (400M + 150M).
  • Against Encoder-Based, NEO is on par or better on MMMU, MMB (2B), SEED, POPE, AI2D and ChartQA.
  • OCR and knowledge-heavy tasks lag: InfoVQA is 14 points below Encoder-Based at 8B. NEO-9B is even below NEO-2.2B on DocVQA and InfoVQA. The authors blame the data, not the architecture.
  • Architecture, not data: EVEv1, EVEv1.5 and EVEv2 re-implemented on the same Qwen3-1.7B and data score 33.4, 40.2 and 41.5, against 44.0 for NEO.
  • pre-Buffer depth: 0 layers give 32.0, 4 layers 44.0, 12 layers 48.8. The gain saturates after about 8.
  • pre-Buffer as an encoder: the trained pre-Buffer, put into a fresh Qwen3-1.7B and retrained on 22M samples, is only 1.7 to 3.7 points behind CLIP, InternViT and SigLIP, which saw billions of samples.