learn to merge locally