benchflow-ai/skillsbench/mhc-algorithm
Claude Code and agent skill by benchflow-ai/skillsbench
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Implement mHC (Manifold-Constrained Hyper-Connections) for stabilizing deep network training. Use when implementing residual connection improvements with doubly stochastic matrices via Sinkhorn-Knopp algorithm. Based on DeepSeek's 2025 paper (arXiv:2512.24880).
Install
npx vskill@latest install benchflow-ai/skillsbench/mhc-algorithmSKILL.md
mHC: Manifold-Constrained Hyper-Connections
Overview
mHC (Manifold-Constrained Hyper-Connections) stabilizes deep network training by constraining residual mixing matrices to be doubly stochastic. It provides:
- Stable Training: Lower gradient norm variance via doubly stochastic constraints
- Multiple Streams: Hyper-Connections with learnable mixing across residual streams
- Sinkhorn Projection: Log-space Sinkhorn-Knopp algorithm for doubly stochastic projection
- GPT Integration: Pattern for wrapping attention and MLP layers
Two components:
- HyperConnections Module: Core PyTorch module with H_res, H_pre, H_post matrices
- Sinkhorn-Knopp: Log-space projection to doubly stochastic manifold
Quick Reference
| Topic | Reference | |
|---|---|---|
| Core Concepts & Math | Core Concepts | |
| Sinkhorn Algorithm | Sinkhorn-Knopp | |
| HyperConnections Module | Module Implementation | |
| GPT Integration | GPT Integration | |
| Common Pitfalls | Pitfalls |
Installation
Minimal Example
Common Imports
When to Use What
| Scenario | Approach | |
|---|---|---|
| Standard residual connection | No mHC needed | |
| Deep networks (>12 layers) with stability issues | Use mHC with num_streams=4 | |
| GPT/Transformer training | Wrap both attention and MLP with HyperConnections | |
| Custom Sinkhorn iterations | Adjust num_iters (20 default) and tau (0.05 default) | |
| Memory-constrained training | Reduce num_streams or batch size |
External Resources
- mHC Paper: https://arxiv.org/abs/2512.24880
- Hyper-Connections: https://arxiv.org/abs/2409.19606
- Sinkhorn's Theorem: https://en.wikipedia.org/wiki/Sinkhorn%27s_theorem
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtasks-extra/mhc-layer-impl/environment/skills/mhc-algorithm/SKILL.md
Popularity
- Repository stars
- 1,474
- Repository forks
- 325
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/benchflow-ai/skillsbench/mhc-algorithm)