Visualizing 🪆 Models

Diagrams of the nested model suite and its junction mechanism.

Architecture

The suggested Matryoshka Architecture Suite, outlined in the paper, essentially builds nested sub-models, such that each one is composed of its predecessors:

The Junction Mechanism

To deal with the size mismatch between the different submodels, they suggest the following “Junction” mechanism:

Junction J matches the old output norm to a fresh embedding, concatenates their 1024 and 1280 channels, then sends a 2304-channel vector to the next stage.

We do 2 things here:

  1. match the norm of the output, to the norm of the next sub-models’ embedding of the input.
  2. concat the normalized output from the previous model, to the input embedding, and feed both to the next submodel.

The Key Idea

The nested structure that we visualized here, is what allows the Matryushka models to be modular - we essentially trained one model (the largest one), and recieved the smaller models “for free” (hence the 36% reduction in training compute). The benefits of the structure are also related to sharing the KV-cache,and allowing for easier inter-model tasks, namely Speculative Decoding and Model Distillation.




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Critique of Matryoshka Language Model Suites
  • Why autoregressive and diffusion LMs can imitate each other (and why it still costs)
  • Matryoshka Language Model Suites in a thread
  • Editing the methods of
  • critique of matryoshka paper (GA26)