Sean McLeish (@SeanMcleish) profile picture

PhD student at the University of Maryland

Joined November 2023
Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)Photo by Sean McLeish (@SeanMcleish)
Library of Layers: models which adapt layer order per input, routing over whole transformer blocks. This opens up a new avenue to control: the execution path the model uses. We use this to control the algorithm used to solve mazes and sudoku by only changing the layer order. 🧵 1/n
9
33
4
131
7,234
Sean McLeish retweeted
After reading the MEMENTO paper (@vkontonis @DimitrisPapail) I wondered if compactions needs explicit text at all. Turns out latent compaction is possible! AbridgeKV trains the model to compress its own output. Keeping 1/4 of the generated cache, it matches full-KV accuracy on competition math problem suite and finishes 3.2× faster on one H100. 🧵
7
17
4
77
7,384
Sean McLeish retweeted
SphereEncoder2 is out! Our 2nd-gen ImageNet model achieves SOTA image quality (FDr6 score) among all known pixel-space image generators, including diffusions. The Sphere Encoder is a faster alternative to diffusion that produces images in a single forward pass. It's basically an autoencoder on steroids that maps 100k-dimensional random latent vectors directly to natural images. Here's some single-pass images from a model trained only on ImageNet-1K.
5
37
3
246
15,518
Came across this interesting work by Chen et al. on loss spikes in LM pretraining. They trace this late emerging spike (⌛️💣 :) to rounding errors in the output layer. Interesting part is they show why three fixes (z-loss, μ-centering and momentum SGD) help in the same way. 1/12
3
12
1
94
17,656
📄 Library of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime by Abdellah Rahmani (@arahmani_AR), Sean McLeish (@SeanMcleish) et al. A router selects the next block from a shared layer library at each depth, so execution order changes per input instead of staying fixed. Key points: • Safety probe on sequence-level routing features reaches 0.95 AUROC • Maze strategy control hits 99.79-100% correct forced-strategy traces • Sudoku forced routing yields 99.5-100% requested-strategy accuracy Shows that layer order can be a learned, controllable part of transformer computation rather than a fixed architectural choice.
1
2
4
231
Also check out Abdellah’s and Micah’s tweets! teapaw.org/arahmani_AR/status/211… teapaw.org/micahgoldblum/status/2…
Programmers build wildly different algorithms by chaining the same few primitives in different orders. LLMs can’t: every input runs through the same layers in the same order. So we built a model that re-orders its own forward pass at runtime. 🧵 1/11
1
3
184
Sean McLeish retweeted
Library of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime Library of Layers lets models dynamically reorder a shared pool of transformer blocks during inference, achieving competitive results while enabling controllable problem-solving. arxivb.org/abs/2611.03526
5
8
66
2,137
Sean McLeish retweeted
Programmers build wildly different algorithms by chaining the same few primitives in different orders. LLMs can’t: every input runs through the same layers in the same order. So we built a model that re-orders its own forward pass at runtime. 🧵 1/11
9
30
3
240
9,761
Sean McLeish retweeted
What if an LLM could adapt its layer order to each input? What if it learned a different layer order for each classic algorithm that solves Sudoku or mazes, and you could fix that order at inference to choose which algorithm it runs? Meet LoL in under 4 minutes 🎥 (1/3)
2
12
52
2,350
Sean McLeish retweeted
What if we thought of layers as flexible building blocks that can be rearranged and parsed in an optimal order conditioned on the input itself? Our new work explores this question👇 Big congrats to @arahmani_AR, @SeanMcleish, @micahgoldblum on this great work!
Library of Layers: models which adapt layer order per input, routing over whole transformer blocks. This opens up a new avenue to control: the execution path the model uses. We use this to control the algorithm used to solve mazes and sudoku by only changing the layer order. 🧵 1/n
3
20
1,080
Sean McLeish retweeted
As someone who's bitter lesson pilled, I've always been fascinated by the idea of learning model arch through gradient descent rather than relying on inductive biases. MoE brought sparsity and dynamic routing to FFNs within individual transformer layers. Can we do the same across layers themselves? Congrats to @arahmani_AR and @SeanMcleish on this great work!
Library of Layers: models which adapt layer order per input, routing over whole transformer blocks. This opens up a new avenue to control: the execution path the model uses. We use this to control the algorithm used to solve mazes and sudoku by only changing the layer order. 🧵 1/n
1
4
17
933
Sean McLeish retweeted
We wanted to know whether fixing Softmax Collapse also prevents the delayed, unrecoverable “time-bomb” loss spikes we study in LLM pretraining. TLDR: in our setting the fix delays the bomb, but doesn’t defuse it. 🧵1/n
Hi all, I have a new result I'm excited to share. It turns out that *all existing implementations* of softmax and cross-entropy (that's JAX, PyTorch, textbooks, etc) have a subtle bug --- two bugs, actually. A simple rewrite fixes both, and eliminates "slingshots" when grokking:
7
15
1
115
7,779
Loss spikes appear to be coming from the growing lm head norm. We trace it further, finding a growing lm head norm causes increased quantisation error and a snowball effect that culminates in an irreversible loss spike. The fix: regularise to stay where the finite precision is high
LLM training runs can look healthy for billions of tokens or more then suddenly diverge. We find that quantization error in the LM head drives these delayed time-bomb loss spikes. A simple optimizer change can prevent them. 🧵 1/n
2
7
70
4,645