Understanding Tea Cache and Blockswapping

How Blocks Work in Transformer Models
Think of a transformer model like a really fancy sandwich. Instead of just bread and filling, it’s got stacked layers (blocks)—each one adding a bit more flavour (or intelligence) to the final output.
Each block does roughly three things:
Looks at the input – It checks out the words, images, or whatever it’s working with.
Processes the information – It figures out how different parts relate to each other using attention mechanisms (basically deciding which words matter more).
Passes the results to the next block – Like passing a note in class, each block refines the info before handing it off.
The deeper the model (more blocks), the better it gets at spotting complex patterns.
Block Swapping (a.k.a. Model Surgery for Mad Scientists)
Imagine you’ve got two transformer models. One is really good at writing Shakespearean sonnets, the other is great at generating cooking recipes. Block swapping means you can take a few layers (blocks) from one model and shove them into another.
Why?
Maybe the sonnet model has really good language skills, but the cooking model knows more about food. Swapping blocks lets you mix the strengths of both.
Instead of training a whole new model from scratch, you just Frankenstein bits together to get a hybrid model with new abilities.
TEAching (TEA Caching, not your afternoon brew)
This is a fancy trick where, instead of running a full model every time you need an answer, you cache (store) the useful bits of information from certain blocks.
Think of it like this:
You ask an AI model, “What’s the capital of France?”
Normally, the model has to process all the layers every time to give you “Paris.”
With TEAching, the model remembers that answer from previous runs and skips unnecessary calculations.
This makes it faster and more efficient without losing accuracy.
Why Should You Care?
Block swapping = Mixing and matching AI skills without retraining everything.
TEAching = Making AI run faster by reusing work instead of starting from scratch each time.
TL;DR: Transformers are like big layered sandwiches, you can swap ingredients (blocks) to customise them, and caching makes them remember useful stuff to speed things up.