cs.LGOct 5, 2026

Algorithmically Aligned Neural Agglomerative Tree Construction

Authors: Robert R Nerem, Pranav Singh, Cheyenne Ward, Yusu Wang

Organizations: University of California San Diego · University of Washington

Abstract

Linkage algorithms for hierarchical clustering (HC) are a powerful and efficient framework for constructing clustering trees, yet it is often unclear which merge rule best suits a given dataset or task. In contrast, neural approaches can learn from data, but often fail to retain the efficiency and size generalization of classical algorithms. We introduce NN-linkage, a neural network (NN) model that can learn task-specific and locally dependent merge rules while retaining the recursive structure and efficient inference of classical linkage algorithms. In particular, our model is algorithmically aligned with the Lance-Williams (LW) recurrence, a parameterized framework for defining a broad, continuous family of linkage rules for agglomerative HC. Classical methods such as single linkage (SL), complete linkage (CL), and average linkage arise as discrete choices within this broader family. We show that NN-linkage is a universal approximator for continuous linkage functions, including LW recurrences, and, when paired with a transformer encoding, can also approximate globally dependent rules such as robust single-linkage. We further show that NN-linkage can exactly implement any symmetric constant-coefficient LW recurrence across all input sizes. On the empirical front, we evaluate NN-linkage in real-world applications, clock-tree routing and phylogenetic reconstruction, using both synthetic and real datasets, demonstrating its effectiveness over both classical algorithms and other neural approaches. By learning merge rules directly from target trees, NN-linkage extends efficient HC to scientific and engineering objectives not adequately captured by existing hand-designed linkage rules.

Figures & tables

Appendix figures & tables13 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Efficiently Learning Branching Networks for Multitask Algorithmic Reasoning

    Nov 30, 2025Dongyue Li, Zhenshuo Zhang, Minxuan Duan +2Graph Neural NetworksReasoning Benchmark

  2. Writhe-Based Polymer Link Classification Using Machine Learning

    Jul 22, 2026Jack Beda, Djordje Mihajlovic, Kasturi Barkataki +1Polymer Property PredictionNeural Network

  3. Code evolution for link prediction in complex networks

    Jun 18, 2026Alexey Vlaskin, Eduardo G. AltmannZero-Shot Link PredictionNetwork Science