Motivated by cognitive radio applications, we consider mitigating the effect of interference by exploiting known properties about its signal structure. Specifically, we analyze communication between a source and destination with an interferer that induces random variations in the source-destination channel. The interferer transmits a sequence chosen uniformly from a randomly generated codebook, which has an i.i.d. structure, or a superposition structure. It is assumed that both the encoder and decoder know the interferer's codebook. We first provide a definition of capacity for these settings. When the encoder knows the interferer's message noncausally, it can use Gel'fand-Pinsker (GP) encoding to precode against interference. Alternatively, it can encode by taking into account that the interference is a codeword, to enable the decoder to decode both messages. It is demonstrated by an example that the latter can outperform GP encoding. Two upper bounds to the performance of this channel are then presented. Next, a more realistic scenario is considered in which the interference is learned at the cognitive encoder causally through a noisy channel. It is shown that for the case of i.i.d. generated interference, this information has no value. In contrast, when the interference is a codeword from an i.i.d. generated codebook, this fact can be exploited to obtain higher rates between the cognitive pair.