{"slug": "glm-5-2-and-indexshare-for-long-context-sparse-attention", "title": "GLM-5.2 and IndexShare for Long-Context Sparse Attention", "summary": "Z.ai released GLM-5.2, an open-weight model that the author calls the best open-weight model available. The model introduces IndexShare, a cross-layer reuse trick for DeepSeek Sparse Attention that reduces the cost of 1M-token inference by running the sparse-attention indexer only once every four layers. GLM-5.2 scored 68.8 on the Artificial Analysis Coding Index, outperforming Claude Opus 4.8 by more than 10 points.", "body_md": "# GLM-5.2 and IndexShare for Long-Context Sparse Attention\n\n[GLM-5.2](https://huggingface.co/zai-org/GLM-5.2) is a recent open-weight model release from Z.ai. My first impression is that it is the best open-weight model today. As usual for fresh releases, I would treat the release-time leaderboard position as date-sensitive.\n\nArchitecture-wise, it builds on the earlier GLM-5 and GLM-5.1 architecture. In particular, it reuses [Multi-head Latent Attention](/llm-architecture-gallery/mla/) and [DeepSeek Sparse Attention](/llm-architecture-gallery/deepseek-sparse-attention/), the DSA mechanism from DeepSeek V3.2 that I covered in the [DeepSeek V3 to V3.2 article](https://magazine.sebastianraschka.com/p/technical-deepseek).\n\nWhat’s new is IndexShare. This is a cross-layer reuse trick for DSA. Instead of recomputing the sparse-attention top-k indexer in every layer, GLM-5.2 runs the full indexer only once every four layers. The following layers then reuse the selected token indices.\n\nThis keeps the same DSA idea but makes 1M-token inference cheaper. The attention pattern is still adaptive, but the model spends less work repeatedly deciding which earlier tokens to attend to.\n\nThe local [GLM-5.2 architecture card](/llm-architecture-gallery/#card-glm-5-2) has the current summary, config links, and [benchmark](/glossary/#benchmark) references.\n\nBy the way, in the [Artificial Analysis Coding Index](https://artificialanalysis.ai/) snapshot below, GLM-5.2 scores 68.8 versus 56.7 for Claude Opus 4.8 (max), more than 10 points higher on coding benchmarks. That’s super impressive for a fresh open-weight model.\n\nSource: lightly edited website version of my [Substack note](https://substack.com/@rasbt/note/c-278515750).\n\n## Read Next\n\n[Inkling: A New Open-Weight 975B MoE with a Few Surprises Short note on Thinking Machines Lab's 975B Inkling open-weight model, its benchmark profile, sparse MoE design, short convolutions, embedding RMSNorm, and](/blog/2026/inkling-architecture-benchmark-notes.html)\n\n[200,000 Subscribers Short note celebrating Ahead of AI reaching 200,000 subscribers.](/blog/2026/ahead-of-ai-reached-200000-subscribers.html)\n\n[GPT 5.6 Has 72 Possible Configurations. What's A Good Default? Short note on how GPT 5.6 model and effort choices map onto training-time and inference-time scaling, producing 72 configurations.](/blog/2026/gpt-5-6-configurations.html)", "url": "https://wpnews.pro/news/glm-5-2-and-indexshare-for-long-context-sparse-attention", "canonical_source": "https://sebastianraschka.com/blog/2026/glm-5-2-indexshare.html", "published_at": "2026-06-18 09:16:05+00:00", "updated_at": "2026-07-16 15:01:51.897349+00:00", "lang": "en", "topics": ["large-language-models", "artificial-intelligence", "ai-products", "ai-research"], "entities": ["Z.ai", "GLM-5.2", "DeepSeek", "Claude Opus 4.8", "Artificial Analysis"], "alternates": {"html": "https://wpnews.pro/news/glm-5-2-and-indexshare-for-long-context-sparse-attention", "markdown": "https://wpnews.pro/news/glm-5-2-and-indexshare-for-long-context-sparse-attention.md", "text": "https://wpnews.pro/news/glm-5-2-and-indexshare-for-long-context-sparse-attention.txt", "jsonld": "https://wpnews.pro/news/glm-5-2-and-indexshare-for-long-context-sparse-attention.jsonld"}}