---
title: 'HAT-GAE: Hierarchical Adaptive Masking & Corruption'
url: https://www.emergentmind.com/topics/hierarchical-adaptive-masking-and-corruption-hat-gae
type: topic
---

# HAT-GAE: Hierarchical Adaptive Masking & Corruption

Hierarchical Adaptive Masking and Corruption (HAT-GAE) is a self-supervised generative graph auto-encoder architecture designed to enhance representation learning for graph-structured data. The model advances over prior self-supervised graph auto-encoders by incorporating a hierarchical adaptive masking mechanism, which incrementally increases the training difficulty, and a trainable corruption scheme, which enables the model to learn robust representations by undoing adaptively learned noise. HAT-GAE achieves leading performance across multiple transductive and inductive node classification benchmarks, demonstrating the effectiveness of its component innovations [2301.12063].

## 1. Architectural Overview

HAT-GAE consists of five principal modules: Adaptive and Hierarchical Masking, Trainable Corruption, a Graph Neural Network (GNN) Encoder, Masked Hidden Representation, and a Decoder with Feature Reconstruction. The model operates over the original graph $\mathcal{G} = (A, X^1)$, where $A$ is the adjacency matrix and $X^1$ is the node feature matrix. The training pipeline for each epoch performs the following steps:

1. **Hierarchical adaptive masking** is applied to $X^{n-1}$ to produce $X^n$, iteratively increasing masking at scheduled intervals.
2. **Trainable corruption** introduces learnable noise $W_n$ to a subset of node features, selected by a Bernoulli mask $M$, yielding corrupted features $\tilde{X}^n$.
3. The **encoder** $\mathcal{E}_\theta$ (multi-head GAT) computes hidden states $H^n$ for $(A, \tilde{X}^n)$.
4. Hidden states of “noisy” nodes in $H^n$ are zeroed-out, forming $\tilde{H}^n$.
5. The **decoder** $\mathcal{D}_\delta$ (GAT-based) reconstructs node features $Z^n$ from $(A, \tilde{H}^n)$.
6. Only the features corresponding to corrupted nodes are reconstructed via a cosine-similarity-based loss.

This configuration allows the model to focus learning capacity on features and nodes most relevant for robust recovery of meaningful representations.

## 2. Hierarchical Adaptive Masking Mechanism

The hierarchical adaptive masking strategy aims to simulate progressive curriculum learning by dynamically increasing feature masking difficulty during training. Masking is performed along feature dimensions, guided by quantifiable importance scores.

### 2.1 Node and Dimension Importance

Node importance $S_v$ is computed, by default, as the in-degree:
$$
S_v = \text{in\_de}(v) = \sum_u A_{uv} \qquad (1)
$$
Alternative importance metrics, such as eigenvector centrality or PageRank, are supported but not the default.

Feature dimension importance $Sd_u$ is then aggregated as:
$$
Sd_u = \sum_{v\in V} S_v \,|X_{v,u}^1|
$$
These scores are sorted in descending order, with less informative dimensions masked earlier in training.

### 2.2 Adaptive and Hierarchical Scheduling

In each adaptive masking step, a fraction of the lowest-scored dimensions for every node is zeroed, with the masking rate $p_f$ controlling the masked proportion:
$$
X^n = [m_{p_f}(X_{1}^{n-1}),\ \ldots,\ m_{p_f}(X_{N}^{n-1})]
$$
where $m_{p_f}(\cdot)$ masks the chosen dimensions (Eq. 4).

The masking schedule is governed by the number of rounds $num$ and total epochs $T$, with re-masking occurring every $T/num$ epochs. The dimensionality masked at each round $m_i$ is recursively decreased to avoid masking all features at once:
$$
m_1 = F\times p_f,\quad
m_i = (F - (i-1)m_{i-1})\times p_f,\;i>1 \qquad (6)
$$

Through this procedure, the model incrementally increases task difficulty, first challenging the network with less critical features and progressing towards increasingly difficult signal recovery.

## 3. Trainable Corruption Scheme

Unlike models relying on fixed or random feature corruption, HAT-GAE introduces a corruption process with a learnable noise component.

### 3.1 Bernoulli Mask Sampling

For each node-feature pair $(v, u)$, a binary mask $M_{v,u}$ is sampled as:
$$
M_{v,u} \sim \mathrm{Bernoulli}(1 - p_n)
$$
where $p_n$ is the noisy node rate specifying the expected fraction of entries corrupted per epoch.

### 3.2 Learnable Noise Injection

A trainable noise parameter $W_n \in \mathbb{R}^{N \times F}$ is combined with the mask to produce corrupted features:
$$
\tilde{X}^n = X^n + W_n \odot M^T
$$
$W_n$ is optimized jointly with the encoder and decoder through the self-supervised reconstruction loss, with no additional regularization. This challenges the auto-encoder to become robust to adversarially-learned, rather than random, perturbations.

## 4. Self-Supervised Optimization Objective

After reconstruction, the model’s objective is to accurately recover only the corrupted node features. For nodes $\tilde{V} = \{v \mid \exists u: M_{v,u} = 1\}$, the cosine similarity between true and reconstructed features is:
$$
\mathrm{dst}(x, z) = \frac{x^\top z}{\|x\|\|z\|}
$$
The loss is:
$$
\mathcal{L} = \frac{1}{|\tilde{V}|} \sum_{v \in \tilde{V}} \left[1 - \mathrm{dst}(\tilde{X}^n_v, Z^n_v)\right]^2 \qquad (13)
$$
No auxiliary contrastive or adversarial losses are introduced. This singular focus facilitates computational efficiency while still providing strong training signal.

## 5. Implementation Specifications

HAT-GAE is implemented with a 2-layer Graph Attention Network for both encoder and decoder, using four attention heads per layer and a PReLU activation. Hidden dimension per node is set between 256 and 1024 depending on the dataset. The Adam optimizer initializes with a learning rate of 0.001, dataset-dependent weight decay, no warm-up, and a learning rate decay schedule. Hyperparameter choices include adaptive mask rates $p_f \in \{0.1, 0.2\}$, noise rates $p_n$ in $[0.5, 0.75]$, and number of hierarchical rounds $num$ approximately $200$–$300$. Training durations range from 500 to 2000 epochs, implemented in PyTorch 1.9.1 with DGL 0.8.2, and trained on Tesla V100 GPUs.

## 6. Experimental Results and Analysis

HAT-GAE was evaluated using linear probing on ten standard benchmarks: eight transductive datasets (e.g., Cora, Citeseer, Pubmed, Amazon-Photo, Amazon-Computer, Coauthor-CS, Coauthor-Physics, OGBN-arXiv) and two inductive datasets (Reddit, PPI).

### 6.1 Transductive Node Classification

The model achieved the highest unsupervised accuracy on 7 of 8 datasets, outperforming both contrastive (DGI, GRACE, MVGRL, BGRL, InfoGCL, CCA-SSG) and generative (GAE, GPT-GNN, GATE, GraphMAE) baselines. Representative scores for selected benchmarks:

| Dataset          | HAT-GAE | Best Baseline | Baseline Name     |
|------------------|---------|---------------|-------------------|
| Cora             | 84.78   | 84.19         | GraphMAE          |
| Citeseer         | 74.28   | 73.41         | GraphMAE          |
| Pubmed           | 81.88   | 81.21         | GraphMAE          |
| Amazon-Photo     | 93.58   | 93.01         | GraphMAE          |
| Amazon-Computer  | 88.55   | 88.32         | GraphMAE          |
| Coauthor-CS      | 93.17   | 92.79         | GraphMAE          |
| Coauthor-Physics | 95.57   | 95.30         | GraphMAE          |
| OGBN-arXiv       | 71.99   | 71.59         | GraphMAE          |

### 6.2 Inductive Node Classification

On Reddit, HAT-GAE attained 96.06 micro-F1 (vs. 95.89 for GraphMAE). On PPI, HAT-GAE scored 74.72 (vs. 74.39 for GraphMAE).

### 6.3 Ablation and Sensitivity Studies

Ablation experiments demonstrate that each component—random masking, single adaptive mask, and omission of trainable corruption—results in notable declines of 0.7–2.7% absolute performance, validating the contributions of hierarchical masking and trainable corruption. Sensitivity to $p_f$ and $p_n$ is moderate for values below $0.7$; higher rates cause sharp accuracy degradation due to over-masking/noising. Optimal performance is achieved with $400$–$500$ masking rounds on datasets such as Cora when training for $2000$ epochs.

## 7. Summary and Context

HAT-GAE introduces a curriculum-inspired masking approach that leverages quantifiable feature and node importance to tailor self-supervised graph representation learning, while trainable corruption provides adversarial challenge adapted to the learned data manifold. The resulting architecture is simple, requiring only a single cosine reconstruction loss, and empirically robust, matching or surpassing contemporary generative and contrastive graph neural network pretraining methods on diverse benchmarks. The method exemplifies the effectiveness of integrating adaptive, hierarchy-aware data corruption and progressive self-supervision for non-Euclidean domains [2301.12063].

Source: https://www.emergentmind.com/topics/hierarchical-adaptive-masking-and-corruption-hat-gae