Robert Važan

Why context stuffing?

The two most popular ways to populate the context window of LLMs are RAG and agents. I am a big fan of context stuffing though. Context stuffing tries to preload as much information as possible, ideally everything there is, into the context window before text generation starts.

Context stuffing has several advantages:

Some people fear that overloading the context will make the LLM distracted, but reasoning LLMs can always move relevant bits of context to the end where LLM's attention is strongest. If I were to point to a real weakness of context stuffing, it would be large projects. Rule-based retrieval (recent, mentioned, core, and related files) becomes ineffective when the context is only a small fraction of total project size. For large projects, it is more effective to use agentic retrieval. Some amount of context stuffing however still helps.