How to compare the meaning of documents

I am trying to extract the meaning of a sentence and compare it with the meaning of another. The normal transformer ‘similarity’ models tend to compare words in both sentences and claim similarity if both sentences have similar words.

I am trying to compare, not work similarity, but meaning. As an example:

1 - Jack went to the movies
2 - Jack did not go to the movies.

These two sentences may be considered ‘similar’ as they use similar words, but they mean entirely different things. ChatGPT does understand their difference and that is exactly what I am looking for,

I would be grateful for your guidance.