

A neural network system for summarizing source code is described. The neural network system includes one or more computers and one or more non-transitory computer storage media storing instructions that, when executed by the one or more computers, cause the one or more computers to implement: a heterogeneous code representation (HCR) generator; a sub-system; a Transformer encoder neural network; a tree-based encoder neural network; a heterogeneous graph transformer (HGT) neural network; and a graph aggregator. In some implementations, the neural network system includes one or more of a token index selector, a hierarchy-aware cross attention neural network layer, a gating neural network layer, and a Transformer decoder neural network.






