Sometimes, if you are very far behind, the nicer AI's will offer you free techs unsolicited. I've seen Mansa Musa, Cyrus and FDR do it, and this is on emperor. Also if you can secure a permanent alliance you get all of their technologies for free, and you can ask for any resource or any amount...