As conjunctions, but and yet are interchangeable. One is often substituted for the other to avoid repetition. Using one or the other in both spots would also create the same meaning, but it might sound repetitive.
Both words also work as adverbs, and in their adverbial senses they are not interchangeable. Yet usually means up to this time, while the adverbial but usually means only. For example, but and yet are not interchangeable.
Source: Grammarist