The code you’ve sent looks fine to me.

The result still not good as same as the implementation without shared embedding, could you give me an example?

You’ve got better results on your GEC task with the same implementation but seperate embeddings?