Hunyuan HY4: How Identity Hyper Connections and Gated DSA Work
How Tencent's Hunyuan HY4 uses identity hyper connections and gated DSA to fix information loss and speed up million-token context handling.

What are identity hyper connections and gated DSA?
Identity hyper connections (IHC) and gated DSA are two architectural mechanisms built into Tencent’s Hunyuan HY4, a large mixture-of-experts model. IHC changes how information moves between layers so early signal doesn’t get diluted by the time it reaches deeper parts of the network. Gated DSA changes how the model handles attention over very long inputs, letting it skip most of the text instead of comparing every token to every other token. Together they’re aimed at two long-standing problems in large transformer models: information loss across depth, and the computational cost of long context.
TL;DR
- Identity hyper connections replace the single-path handoff between layers with several parallel routes, so information from early layers can reach late layers without degrading step by step.
- Gated DSA makes long-context attention selective, letting the model focus compute on the parts of a document that actually matter instead of scanning everything at full cost.
- Hunyuan HY4 is a mixture-of-experts model reported at 770 billion total parameters with only about 49 billion active per token, keeping inference cheaper than the total size suggests.
- The model supports a context window past 1 million tokens, which is the kind of scale that makes naive full attention impractical and motivates mechanisms like gated DSA.
- Tencent positions HY4 around agentic and coding workloads: terminal-style tasks, multi-step software engineering, office automation, and long-horizon agent work.
- In a hands-on test with a broken full-stack app (Flask backend, Postgres, Docker), an agent running on HY4 found and fixed a logic bug without being told where it was, though the session was slowed by heavy API load during the model’s free preview period.
- The architecture ideas are explained conceptually in Tencent’s materials and in third-party testing, but exact benchmark numbers and hardware requirements should be checked against Tencent’s own documentation rather than secondhand summaries.
Seven tools to build an app. Or just Remy.
Editor, preview, AI agents, deploy — all in one tab. Nothing to install.
Why does information get lost in deep transformer models?
Standard deep networks process information like a relay race. Each layer takes what the previous layer produced, does some work, and passes it forward. That’s efficient, but it has a known weakness: if something useful shows up early in the network, it has to survive many intermediate transformations before it reaches the final layers. Small distortions compound. By the time a signal from layer 3 might matter for a decision made at layer 60, it can be muddied by everything that happened in between.
This isn’t a new observation. Residual connections (skip connections) were introduced years ago as a partial fix, letting some information bypass a layer entirely. Hyper connections and IHC push that idea further.
How do identity hyper connections fix this?
Instead of a single handoff line between layers, identity hyper connections keep multiple parallel “memory lanes” running through the model at once. Early-layer information doesn’t have to survive a long chain of step-by-step transformations to reach a late layer. It can travel along a more direct path alongside the main computation.
A useful mental model: instead of a single-file relay race, the model runs several direct lines in parallel between distant points in the network. Some of these carry the original (“identity”) representation forward mostly untouched, which is where the mechanism gets its name. The result is a network that can be very deep in terms of layers while still preserving early representations more faithfully than a standard architecture would.
This matters most for large mixture-of-experts models like HY4, where different experts are activated per token and depth is used aggressively to build capability. Losing signal across layers is a more acute problem in these architectures than in smaller, shallower models.
How does gated DSA make million-token context feasible?
The second mechanism addresses a completely different bottleneck: attention cost over long sequences. In standard transformer attention, every token attends to every other token, which means cost grows quadratically as context length grows. That’s fine for a few thousand tokens. It becomes painfully slow and expensive at a million tokens, which is the scale HY4 is built to handle.
Gated DSA (a sparse, gated form of attention) lets the model be selective. Rather than comparing every token pair, it learns to identify which parts of the input are actually relevant to the current step of reasoning and largely ignores the rest. It also reuses information across layers instead of recomputing relevance from scratch every time.
The analogy used in early hands-on coverage of HY4 is a good one: it’s the difference between rereading an entire book every time you have a question about it, versus keeping bookmarks on the pages that matter and only revisiting those. That selectivity is what makes a context window past 1 million tokens computationally realistic rather than purely theoretical.
What is Hunyuan HY4 built for?
Tencent, the company behind WeChat, QQ, and a large gaming and cloud business, built HY4 through its Hunyan AI team as an open-weight mixture-of-experts model. Reported figures put it at 770 billion total parameters with roughly 49 billion active per token, meaning the model draws on a large pool of specialized parameters but only activates a fraction of them for any given token, which keeps inference more efficient than the raw parameter count implies.
The model is explicitly aimed at coding agents and long, multi-step productivity work: software engineering tasks, office automation, and even game prototyping. Tencent’s own blind evaluation, benchmarked against over a hundred and sixty human experts according to early coverage, reportedly had HY4 edging out other prominent open models on certain tasks. Independent benchmark write-ups also point to strong results on agentic and terminal-style evaluations, with the model trading the lead against top closed models depending on the specific task.
Is the architecture actually different from a normal MoE transformer, and does it matter in practice?
Mixture-of-experts routing (activating a subset of experts per token) is now common across large open models. What makes HY4’s architecture notable isn’t the MoE routing itself but the two additions layered on top of it. IHC targets a depth problem: how to keep a very deep MoE model coherent by giving information more direct paths through the network. Gated DSA targets a length problem: how to make attention over huge contexts computationally viable instead of just theoretically supported.
In a hands-on test, an agent connected to HY4 was given a broken full-stack retirement calculator app (Flask backend, Postgres database, Docker-based deployment) with numbers that were off by roughly 100x, and no hints about where the bug lived. The agent located the underlying logic error and applied a fix without being told what was wrong, though the session ran slowly due to heavy API traffic during the model’s free preview window rather than any inherent slowness in the model itself. That kind of multi-step, tool-using debugging task is exactly the profile HY4 is designed around, and it’s a more meaningful signal than a leaderboard score, though it’s a single anecdotal run rather than a systematic evaluation.
Whether the architectural choices translate into a durable advantage over other open models will depend on broader testing across coding benchmarks, long-context retrieval tasks, and cost-per-token comparisons once the free preview period ends and pricing becomes clearer.
Frequently Asked Questions
What problem do identity hyper connections solve?
They address information degradation across deep networks. In a standard architecture, signal from early layers can weaken as it passes through many sequential transformations. IHC adds parallel pathways so information can reach later layers more directly, reducing that loss.
What is gated DSA in simple terms?
It’s a sparse attention mechanism that lets a model skip most of a long document and focus only on the parts relevant to the current task, instead of comparing every token against every other token. This is what makes very long context windows computationally practical.
How big is Hunyuan HY4?
Early coverage puts it at 770 billion total parameters in a mixture-of-experts design, with about 49 billion active per token. That means only a fraction of the total model is used for any single prediction, which keeps inference cost lower than the total parameter count would suggest.
What is Hunyuan HY4 designed to be used for?
- ✕a coding agent
- ✕no-code
- ✕vibe coding
- ✕a faster Cursor
The one that tells the coding agents what to build.
Tencent positions it around agentic and productivity workloads: coding agents, multi-step software engineering tasks, office task automation, and long-context work that benefits from a context window past 1 million tokens.
Is Hunyuan HY4 open source?
It’s described as open weight, meaning the model weights are released for use, which is consistent with the broader trend of major Chinese labs releasing competitive open models alongside proprietary offerings from Western labs.


