Reproduce “Implant Global and Local Hierarchy Information to Sequence based Code Representation Models” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Kechi Zhang, Zhuo Li, Zhi Jin, Ge Li

Peking University researchers introduced HiT, a Hierarchy Transformer, that integrates comprehensive global and local hierarchical information into sequence-based code representations. This method achieved state-of-the-art performance in code classification, clone detection, and method name prediction across multiple languages, doing so with minimal additional parameters and improved training stability.

Key insights

  • Both statement-level global hierarchy and token-level local hierarchy are crucial and complementary for learning robust code representations.
  • Integrating comprehensive hierarchical information into sequence models allows for a preferable balance between efficiency and semantic richness.
  • Explicitly modeling global hierarchy significantly improves a model's ability to understand block structure and variable scope, crucial for code semantics.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.