Two open-weight models are drawing serious attention from users who run AI locally: Google's Gemma 4 31B and Alibaba's Qwen 3.5 27B. The comparison centers on long context performance - a practical concern for anyone processing lengthy documents, large codebases, or extensive research without sending data to a third-party API.
The context window is how much text a model can process in a single session before it starts losing track of earlier content. Think of it as working memory: exceed the limit, and the model begins forgetting what it read at the start. For anyone feeding an AI a full contract, an entire GitHub repository, or a 10,000-word research report, this limit directly shapes what work is possible.
Both models sit close in size - 31B and 27B parameters respectively. Parameters are roughly analogous to the complexity of a model's internal reasoning machinery, and models at this scale can run on high-end consumer GPUs, making them realistic for individuals and small teams who want to keep data off cloud servers.
Where the Numbers Lie
Raw context window size is only part of the equation. A model can technically accept a long input but still produce weaker answers when key details appear far from the end of the document - a known failure mode called "lost in the middle," where models over-weight information at the beginning and end of their input and under-weight whatever falls in between. Community testing regularly surfaces this problem faster than official benchmarks do, because real documents don't look like benchmark test sets.
The meaningful question isn't "how large a context window does each model support?" but "how accurately does each model recall a detail from page 40 of a 100-page document?" That's harder to quantify and takes hands-on testing to answer.
For users weighing local options, both models represent the current ceiling for what's achievable without enterprise hardware. Cloud-based alternatives like Claude handle longer contexts with more consistency, but at a per-token cost that's hard to justify for bulk document processing. The local model comparison matters precisely because of that cost gap - and which model wins depends on your document type, hardware, and language requirements.