Skip to navigation

Hy4-flash is a vision-language Mixture-of-Experts model from Tencent. Its 42-layer decoder carries four hyper-connection streams, multi-head latent attention that alternates between sparse layers (a compressed indexer keeps 2,048 keys per query) and sliding-window layers (512 tokens), a latent MoE with 512 routed experts (16 active) plus one shared expert on layers 1-41, and Engram n-gram memory on four layers. The Hugging Face configuration declares the HYV4FlashForConditionalGeneration architecture.

Fine-Tune Hy4-flash

Follow the installation instructions, then review the checked-in recipes and their declared topology below before choosing a local or cluster launcher.

Use the Slurm launcher guide for the multi-node runs.

Choose a Workflow

GoalStart Here
Full fine-tuning on MedPix-VQAUse hy4_flash_medpix_4k_ep64.yaml.
LoRA fine-tuning on MedPix-VQAUse hy4_flash_medpix_4k_ep16_lora.yaml.
Text fine-tuning on long packed sequencesSee the language model card.

Configuration

SettingConfiguration
Hardware8 nodes x 8 H100 80GB (full fine-tuning); 2 nodes x 8 H100 80GB (LoRA)
StrategyFSDP2; tp_size=1, pp_size=1, cp_size=1; ep_size=64 (full fine-tuning), ep_size=16 (LoRA)
Nodes8 (full fine-tuning); 2 (LoRA)
FeaturesActivation checkpointing (activation_checkpointing=true), HybridEP (dispatcher=hybridep)
Advancedbfloat16, attention=cudnn, linear=torch, experts=torch_mm, dispatcher=hybridep, compile_hc=true, compile_norm=true

Both recipes train on 64 samples per optimizer step with one sample per GPU. The LoRA recipe reaches that on 16 GPUs with four accumulated micro-batches (global_batch_size: 64, local_batch_size: 1). LoRA keeps no gradients or optimizer state for the expert and Engram shards, so a GPU holds one sixteenth of the model at a peak of about 45 GiB allocated.

Samples are rendered in the model’s fast-thinking mode (reasoning_effort=no_think), as the official fine-tuning code does for answer-only data. A sample whose assistant turn carries reasoning (reasoning_content or reasoning) is rejected with an error: training on reasoning traces is not supported.

Launch Requirements

The multi-node launch requirements (NCCL_PXN_DISABLE=1, JIT cache placement, and the compiled cores) are on the language model card.

Model Reference

Model Architecture

PropertyValue
TaskImage-text-to-text
ArchitectureHYV4FlashForConditionalGeneration
Parameters219B total / 11B activated
Hugging Face Organizationtencent

Available Models

ModelHF ID
Hy4-flashtencent/Hy4-flash