Hacker News new | ask | show | jobs
by amluto 1 day ago
> Depth-wise cross-attention (split Q/K/V): While standard transformer attention operates across tokens in a sequence, DCA applies attention across layers in depth. Each token queries a dynamically weighted mix of all prior layer embeddings, unlocking the model's full historical context without the computational penalty usually required to scale traditional attention.

I’ve often thought that something like this might lead to a real solution to the infamous strawberry problem.

Ignoring pesky issues like tokenization, the actual input data is visible to the model as the embedding fed to the first layer, but the first layer is probably nowhere near smart enough to understand that the model is trying to count R instances. But by the time whatever layer is reached that might understand the goal, the non-wasteful part of the low-level memory (the K’s and V’s from the first layer) can’t be queried any more.

But this cross-depth attention can query them!

Admittedly, there are holes in this argument. Beyond just tokenization (to the extent that the model can see letters at all, it is reconstructing them), the attention mechanism doesn’t really have a clean “count the hits” operation.

2 comments

the strawberry problem is not a real problem and it's been understood how to solve it since it showed up. nobody does it because its not worth the compute.

besides making the letters visible in some way, you need to remove softmax normalization (not for the full model! just for the sections of it that do the counting) since it only allows you to represent outputs as a fraction of the inputs. no model architecture that normalizes this way will ever truly learn integer counting that generalizes to unseen inputs.

you also need a different activation function, relu and family cut away some crucial information.

just copy paste what I told you into a claude conversation, they can train a small llm that shows it easily on their server cpu or locally on your machine.

Or you give the model the ability to write code that reads the model’s transcript.

I’m not saying the strawberry problem is a big deal. I’m saying that models often have some difficulty perceiving their own input at a low level, and cross-layer attention seems like it could help in general.

Recent models have trained their way out of this by spelling things out with hyphens or new lines, then counting. Seems to work reasonably well
Batteries are not a real problem because we have solid state ones. We just don't do it yet because it's too expensive.

Traffic is not a real problem because we have flying cars. We just don't do it yet because it's too expensive.

I don't get what you're saying, is engineering meaningless to you?

Sadly cross-layer might be super slow for the people offloading to ram
Pin the layer outputs to VRAM? They say it's just 0.2% of total params. Layer ouput size is not the same but I still think it should be cheap.