Papers › LoLCATs: On Low-Rank Linearizing of Large Language Models

LoLCATs: On Low-Rank Linearizing of Large Language Models

14 Oct 2024arXiv:2410.10254archive 2025-07-28

Michael Zhang, Simran Arora, Rahul Chalamala, Alan Wu, Benjamin Spector, Aaryan Singhal, Krithik Ramesh, Christopher Ré

Recent works show we can linearize large language models (LLMs) -- swapping the quadratic attentions of popular Transformer-based LLMs with subquadratic analogs, such as linear attention -- avoiding the expensive pretraining costs. However, linearizing LLMs often significantly degrades model quality, still requires training over billions of tokens, and remains limited to smaller 1.3B to 7B LLMs. We thus propose Low-rank Linear Conversion via Attention Transfer (LoLCATs), a simple two-step method that improves LLM linearizing quality with orders of magnitudes less memory and compute. We base these steps on two findings. First, we can replace an LLM's softmax attentions with closely-approximating linear attentions, simply by training the linear attentions to match their softmax counterparts with an output MSE loss ("attention transfer"). Then, this enables adjusting for approximation errors and recovering LLM quality simply with low-rank adaptation (LoRA). LoLCATs significantly improves linearizing quality, training efficiency, and scalability. We significantly reduce the linearizing quality gap and produce state-of-the-art subquadratic LLMs from Llama 3 8B and Mistral 7B v0.1, leading to 20+ points of improvement on 5-shot MMLU. Furthermore, LoLCATs does so with only 0.2% of past methods' model parameters and 0.4% of their training tokens. Finally, we apply LoLCATs to create the first linearized 70B and 405B LLMs (50x larger than prior work). When compared with prior approaches under the same compute budgets, LoLCATs significantly improves linearizing quality, closing the gap between linearized and original Llama 3.1 70B and 405B LLMs by 77.8% and 78.1% on 5-shot MMLU.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.10254")

Code

Syntology Ran 23 of 32 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 7 ran · our draft was wrong; 3 ran · fixture could not drive it; 13 ran with no contract checked.

By repository: official repository: 32 samples from 1 repository, 23 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

hazyresearch/lolcats officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

32 samples harvested; 23 ran; 0 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

7ran · our draft was wrong
3ran · fixture could not drive it
13ran
9unverified

Licence: 0 of the 32 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from hazyresearch/lolcats. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

DynamicNTKScalingRotaryEmbedding hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran Apache-2.0 (permissive) · 363df15c92df5f35 · report
Exp hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · cdf03be65a92f940 · report
ExpHalfspace hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · 72f5147b8da94cef · report
FeatureMap hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · d60bb1001847bf81 · report
FeatureMapAct hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · 8508acb10b82cae5 · report
FeatureMapAdapter hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran Apache-2.0 (permissive) · 11df4b1bdd5a0634 · report
FeatureMapMLP hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran Apache-2.0 (permissive) · 624f03bff20eeff4 · report
LinearScalingRotaryEmbedding hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran Apache-2.0 (permissive) · 8e7478585c4a072f · report
PosELU hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · 222e712a93c7c816 · report
ReLU hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · f8a915d0998d5a10 · report
RotaryEmbedding hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran Apache-2.0 (permissive) · c2be9851321e656a · report
SoftmaxDim hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · 45348551e263b890 · report
SoftmaxDimHalfspace hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran fingerprinted Apache-2.0 (permissive) · 79ecf2b5021ec165 · report
apply_rotary_pos_emb hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · 8f7f3f7e4221d5c0 · report
get_rotary_embeddings hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 3d075a97ebad15d7 · report
init_feature_map hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 4fcb658ea76a7904 · report
init_feature_map_act hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · our draft was wrong Apache-2.0 (permissive) · d9fed240ed04f9af · report
init_learned_kernel hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 7ea7286d8db1055b · report
quadratic_attention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 95f5da87ec68a1ed · report
repeat_kv hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · ab05d5e4c4236572 · report
sliding_window_softmax_attention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 8e336d9e009bb875 · report
softmax_attention HazyResearch/lolcats/src/model/linear_attention/linear_attention.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 95392cd040b0c2e7 · report
softmax_attention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository ran · our draft was wrong Apache-2.0 (permissive) · f122b39d7b617e75 · report
LolcatsLinearAttention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository unverified Apache-2.0 (permissive) · 5ca6886743273ec2 · report
LolcatsLinearSlidingWindowAttention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository unverified Apache-2.0 (permissive) · 22e03adc01e6f4af · report
causal_dot_product HazyResearch/lolcats/src/model/linear_attention/linear_attention.py official repository unverified Apache-2.0 (permissive) · c61cbc5f0923bbf5 · report
evaluate_model HazyResearch/lolcats/distill_llama.py official repository unverified Apache-2.0 (permissive) · 99199bb3bba7f5ed · report
flash_attention_2 hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository unverified Apache-2.0 (permissive) · 7adc1fdae7b7a47d · report
hybrid_attention_linear hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository unverified Apache-2.0 (permissive) · 6cc2057faa9846d2 · report
linear_attention HazyResearch/lolcats/src/model/linear_attention/linear_attention.py official repository unverified Apache-2.0 (permissive) · d8595b54ec29491c · report
linear_attention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository unverified Apache-2.0 (permissive) · 61e674e010a5aa26 · report
under_window_linear_attention hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py official repository unverified Apache-2.0 (permissive) · 20430ccdc09ccdc0 · report

Tasks

MMLU

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionBASELLaMASoftmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections