Add reference position encoding