The power of motifs as inductive bias for learning molecular distributions