encode relative position in local LM