The correct option that defines self-attention mechanism is:
4. Representation of a sentence is computed by relating different words in it.
Self-attention allows a model to weigh the significance of different words in a sentence when generating a representation, enabling it to capture contextual relationships effectively.