Loading video...

Video Failed to Load

Go Home

🦍 Introducing Memorilla: memory as a modality for LLMs Memorilla turns everything a frozen LLM needs to remember into just 16 memory embeddings ⚡ It uses up to 4,212× fewer tokens and is 27× faster than full context inference while more accurate 🎯 Pushes the Pareto frontier over RAG...

51,306 views • 2 days ago •via X (Twitter)

51 Comments

Adib's profile picture
Adib2 days ago

A frozen encoder embeds each document once into a persistent store. Conditioned on the question, 16 memory slots read the store and produce embeddings fed directly into the LLM, like image embeddings. The LLM stays frozen. Only the memory module is trained.

Adib's profile picture
Adib2 days ago

We tested it on personalization, long-document and knowledge QA against full context, RAG, agentic memory and compression methods. Memorilla sits on the Pareto frontier of all 8 benchmarks and leads on 5.

Adib's profile picture
Adib2 days ago

Memorilla also works as an agent's memory. In TextWorld, every turn becomes a new memory, and RL on the game reward trains only the memory module. Compared to in-context learning alone, the same frozen agent solves 24.2% of games instead of 18.6%.

Adib's profile picture
Adib2 days ago

"What are some suitable foods for me to boost my energy during the day?" RAG suggests oats and brown rice. Memorilla remembers the user's iron-deficiency anemia from an old chat, even though that chat has little semantic connection to the question. On PersonaMem-v2 it gets 44.6% vs 30.9% for the next best method.

Adib's profile picture
Adib2 days ago

It's also better at connecting facts. On FactKG, RAG-50 drops from 79% to 52% as a claim combines more facts. Memorilla stays between 80% and 89%.

Adib's profile picture
Adib2 days ago

Memorilla and RAG get different questions right. Their union covers 94.3% of FactKG, vs 84.3% for Memorilla and 78.4% for RAG-50 alone.

Adib's profile picture
Adib2 days ago

Latency stays flat as memory grows. With 512 documents on one H100, Memorilla answers in 0.74 s and full context takes 19.9 s.

Adib's profile picture
Adib2 days ago

It of course has limitations Memorilla can lose fine-grained information, so RAG still wins "who" and "which" questions on NarrativeQA. The memory module is also tied to the LLM it was trained with, and moving to another LLM or a new domain takes some fine-tuning.

Adib's profile picture
Adib2 days ago

Humans have both episodic and semantic memory. If RAG is episodic, Memorilla is semantic. Just like us, LLMs need both. Memorilla isn't perfect, but we see it as a 0→1 change in how LLMs use memory, and we look forward to seeing where the community takes these ideas.

Adib's profile picture
Adib2 days ago

Big thank you the entire amazing team! @Radii2323 @kvignesh1420 @ShayanPardis @nikitamounier @ShirleyYXWu @jure @Stanford Website: Paper: Code: HuggingFace:

Ben Geist's profile picture
Ben Geist2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis nice to see this out !

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis thank you for the great support ben!

faraz's profile picture
faraz2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Very sick, ultra cool, congrats!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Thank you!

Faisal AlZaben • فيصل الزبن's profile picture
Faisal AlZaben • فيصل الزبن2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Adib you legend

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 🔥

Amir Zeinali's profile picture
Amir Zeinali2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis sick!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 🔥

J Vijayavallabh @ NEURIPS 2026's profile picture
J Vijayavallabh @ NEURIPS 20262 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Cool! In what ways would you adapt Memorilla for biomedical reasoning? [like a bio-specific encoder]

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Haha that is BioReason territory now

Arya Tschand's profile picture
Arya Tschand2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis awesome work, congrats!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis thank you!

Laurence Liang's profile picture
Laurence Liang2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Hype!!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 😀

Fathin Dosunmu's profile picture
Fathin Dosunmu2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis holf f***

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis indeed

Dhravya Shah's profile picture
Dhravya Shah2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis This is really cool

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Thank you 😀

John Rood's profile picture
John Rood2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 16 slots is a clean compression. what happens when two memories contradict and the newer one is the true one? that update path is what breaks agent memory in production, and it's rarely measured.

chelsea 🐟's profile picture
chelsea 🐟2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis this is so cool!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 😀

Soumil Bhandari's profile picture
Soumil Bhandari2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 16 embeddings for everything is wild compression. What happens with exact recall, like a specific number or ID from 50 turns ago? Feels like soft memory is great for gist but loses precise facts. Do you pair it with retrieval for those?

Zion's profile picture
Zion2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis This is pretty cool

Zachary Yu's profile picture
Zachary Yu2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis very cool work!

hamza mostafa's profile picture
hamza mostafa2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis yoo this is amazing, congrats!!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis thank you Hamza!

Mersad's profile picture
Mersad2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis this is amazing !!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis thank you mersad!

John K's profile picture
John K2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Compressing down to 16 soft tokens usually shifts the compute burden to an encoder step. Does updating the memory require reprocessing the whole context from scratch?

sensho's profile picture
sensho2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis v cool work Adib!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis thank you!

chi's profile picture
chi2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis super cool work!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis thank you!

NotaDEV * fireply.ai's profile picture
NotaDEV * fireply.ai2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 27x faster is the number i'd care about most. latency kills more products than accuracy does

Talu Güloglu's profile picture
Talu Güloglu2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis Saw the website a few days ago, looks great. Nice to see you working also on non-bio stuff!

Adib's profile picture
Adib2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis side quest!

max's profile picture
max2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis RETRO but much more deployment friendly Great work!

AI Lorekeeper's profile picture
AI Lorekeeper2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 16 memory embeddings replacing a huge context window is a clean reduction - curious if lookup stability holds across different base checkpoints

MonstarX's profile picture
MonstarX2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis 16 embeddings replacing full context is wild if it holds on long messy inputs. curious how it degrades when the memory has to carry conflicting facts.

avery's profile picture
avery2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis

medha's profile picture
medha2 days ago

@jure @Stanford @kvignesh1420 @Radii2323 @ShirleyYXWu @nikitamounier @ShayanPardis is this speedup using precomputed document embeddings or the actual online speed up ❓

Related Videos

New short course: LLMs as Operating Systems: Agent Memory, created with Letta, and taught by its founders Charles Packer and Sarah Wooders. An LLM's input context window has limited space. Using a longer input context also costs more and results in slower processing. So, managing what's stored in this context window is important. In the innovative paper MemGPT: Towards LLMs as Operating Systems, its authors (which include the instructors) proposed using an LLM agent to manage this context window. Their system uses a large persistent memory that stores everything that could be included in the input context, and an agent decides what is actually included. Take the example of building a chatbot that needs to remember what's been said earlier in a conversation (perhaps over many days of interaction with a user). As the conversation's length grows, the memory management agent will move information from the input context to a persistent searchable database; summarize information to keep relevant facts in the input context; and restore relevant conversation elements from further back in time. This allows a chatbot to keep what's currently most relevant in its input context memory to generate the next response. When I read the original MemGPT paper, I thought it was an innovative technique for handling memory for LLMs. The open-source Letta framework, which we'll use in this course, makes MemGPT easy to implement. It adds memory to your LLM agents and gives them transparent long-term memory. In detail, you’ll learn: - How to build an agent that can edit its own limited input context memory, using tools and multi-step reasoning - What is a memory hierarchy (an idea from computer operating systems, which use a cache to speed up memory access), and how these ideas apply to managing the LLM input context (where the input context window is a "cache" storing the most relevant information; and an agent decides what to move in and out of this to/from a larger persistent storage system) - How to implement multi-agent collaboration by letting different agents share blocks of memory This course will give you a sophisticated understanding of memory management for LLMs, which is important for chatbots having long conversations, and for complex agentic workflows. Please sign up here!

Andrew Ng

201,127 views • 2 years ago

Qwen3.8-Flash-Next is still going strong at 364.7K tokens of context on an M5 Max. And this isn’t just a static long-context test. The model was reasoning about how to speed up its own workflow while using tools, and the tool calls kept working without misses. Setup: • Qwen3.8-Flash-Next • M5 Max • 128GB unified memory • MLX-Serve PR #363 • OpenCode 2 • 364.7K context The interesting part isn’t simply getting hundreds of thousands of tokens into memory. It’s what happens once the context gets this large. Long-context inference usually comes with a painful tradeoff. As the KV cache grows, memory pressure increases and generation can slow down. But this setup is still pushing through 364K tokens while maintaining a usable agent workflow. The model can reason, call tools, inspect results, continue working, and keep the session moving. And the tool calls reportedly haven’t missed so far. That’s important for agentic coding. A huge context window is only useful if the model can actually operate reliably inside it. A 400K-token context that constantly breaks tool calls isn’t very useful. A 364K session that can keep reasoning and executing tools is a different story. And the test isn’t finished yet. The current run is approaching 400K tokens, with the expectation that it can keep going. This is also another interesting example of why Apple Silicon keeps showing up in local LLM experiments. The M5 Max’s unified memory gives a large model and its growing KV cache access to one shared memory pool. With MLX-Serve continuing to improve, these machines are becoming surprisingly capable long-context inference boxes. The bigger takeaway: Context length is becoming a workload, not just a model specification. Running a model at 256K is one thing. Keeping an agent alive at 300K+ while it reasons and uses tools is much more interesting. And Qwen3.8-Flash-Next is showing that this can be pushed surprisingly far on a single 128GB Mac. 364.7K and counting. Next stop: 400K.

FHILY👑

39,982 views • 2 months ago