Live data from Hacker News

LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

dnhkng.github.io

21–30 of 44 posts

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#21

This was a little dense for me to grok. Are these well known results or is there an abstract-like summary? The RYS (repeat yourself) hypothesis that duplicating (the right) layers is enough to improve performance (sorry for not reading closely enough, it's really just stacking the relevant layers?). The ERD (encoding, reasoning, decoding) layer structure is a relatively robust observation? That the middle layers of t…

I find the RYS result far more surprising than the ERD result. Encode-Reasoning-Decode is after all a very popular way to design neural networks (even an autoencoder is just that without the reasoning step), the same structure emerging from optimization isn't that surprising.

But the methodology to measure it and put numbers on which layers are most involved in encoding/decoding and where the reasoning takes place is very valuable.

The finding that the phases are more cleanly separated in large-ish models is interesting. I wonder what this could mean for embedding models? Usually we take small LLMs and chop off the last couple layers to get an embedding model. But I wonder if you could get better embedding models using something like the first five layers of Qwen3.5-27B, or the first X layers of Kimi K2.5? The methodology in the article seems to give a straight forward way to find the optimal cutting point

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#22
post #4

Author here. Another thing I want to highlight: the language-agnostic "thinking space" finding came from Evan Maunder, who read Part 1 and ran an elegant experiment — same sentence in English, Mandarin, and Base64, cosine similarity at every layer. The representations converge by the early layers, stay nearly identical through the mid-stack, then diverge again at the end as the model commits to an output format. I ex…

Extrapolating the benchmarks, this would imply the best RYS 27B is capable of out performing the 397B MoE?

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#23
post #18

This was a little dense for me to grok. Are these well known results or is there an abstract-like summary? The RYS (repeat yourself) hypothesis that duplicating (the right) layers is enough to improve performance (sorry for not reading closely enough, it's really just stacking the relevant layers?). The ERD (encoding, reasoning, decoding) layer structure is a relatively robust observation? That the middle layers of t…

Perhaps not widely known but certainly known in LLM research. There was a bunch of these experiments done 2 years ago and what's interesting is that it still seems to work on the latest models. Though beware that the increased score on math and EQ could lead to other areas scoring less well; would love to see how these models score on all open benchmarks.

The author claimed that the models he modified with this layer repetition method topped the huggingface open llm leaderboard in his first post: https://dnhkng.github.io/posts/rys/

Do you remember the names of the previous experiments done on this? Would love to take a look.

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#24
David,

Thanks for this research. I remember being stunned when Goliath showed up and .. worked; this feels like under explored research right now.

I've been thinking about implications of this for local generation -- what's really nice about a repeated layer is it takes up no extra memory -- and therefore works well on the edge.

Can you suggest some exploration angles on the edge side? I've recently started looking at fixing expert layers for an entire generation run as interesting - basically you pay the memory cost once for loading in selected experts - and I think RYS type thinking is a natural extension of this. If you've got some ideas, I'm all ears.

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#25
post #5

Has anyone started to implement this technique in Llama.cpp or similar inference tool?

There was some work done on this a while back, during the FrankenMerge craze of 23' I am working with TurboDerp to integrate this into the Exllama v3 format.

Wow, super interesting keywords. Are you a ML researcher? What kind of experiments do you do?

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#27

David, Thanks for this research. I remember being stunned when Goliath showed up and .. worked; this feels like under explored research right now. I've been thinking about implications of this for local generation -- what's really nice about a repeated layer is it takes up no extra memory -- and therefore works well on the edge. Can you suggest some exploration angles on the edge side? I've recently started looking a…

Thanks!

I have pushed basic code to GitHub (https://github.com/dnhkng/RYS)

Some interesting areas to explore might be a combination of deleting some layers and duplicating others. i.e. reduce VRAM by dropping some layer (this works, well documented), and recovering performance by duplicating others (saves VRAM). I am not pursuing this, but it seems interesting!

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#28
post #4

Author here. Another thing I want to highlight: the language-agnostic "thinking space" finding came from Evan Maunder, who read Part 1 and ran an elegant experiment — same sentence in English, Mandarin, and Base64, cosine similarity at every layer. The representations converge by the early layers, stay nearly identical through the mid-stack, then diverge again at the end as the model commits to an output format. I ex…

A fun thing to do is convince a model to fluidly switch between character sets to express ideas as 'efficiently' as possible. It likes to use Chinese hanzi a lot for abstract concepts. I've also seen Gemini use them unprompted in the middle of an English sentence.

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#29
post #23
post #18

Earlier quoted context omitted.

Perhaps not widely known but certainly known in LLM research. There was a bunch of these experiments done 2 years ago and what's interesting is that it still seems to work on the latest models. Though beware that the increased score on math and EQ could lead to other areas scoring less well; would love to see how these models score on all open benchmarks.

The author claimed that the models he modified with this layer repetition method topped the huggingface open llm leaderboard in his first post: https://dnhkng.github.io/posts/rys/ Do you remember the names of the previous experiments done on this? Would love to take a look.

Just learned about it the other day from this thread from Feb, 2024: https://old.reddit.com/r/LocalLLaMA/comments/1aqrd7t/i_made_...

Has some interesting github links.

Re: LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

#30

David, Thanks for this research. I remember being stunned when Goliath showed up and .. worked; this feels like under explored research right now. I've been thinking about implications of this for local generation -- what's really nice about a repeated layer is it takes up no extra memory -- and therefore works well on the edge. Can you suggest some exploration angles on the edge side? I've recently started looking a…

Ever since I read about this, I have been thinking about the next logical step: train a NN to route the internal loops dynamically after each layer. Instead of just choosing a given set of layers that are repeated, let the new classifier decide whether it wants to loop, where it wants to loop, whether to loop multiple times, to loop a big part, or to just jump to the final layers straight away. Each token could loop more or less based on its relevance.

It has some similarities of a MoE architecture, but instead of choosing experts, it chooses layer routes. Training this NN classifier together with the LLM could condense the required amount of layers for a given intelligence down drastically if it works. If anyone wants to work on this, feel free to send me a message.

Post reply on HN