If there is any chordal instrument it's easier than trying to figure out what a guitarist is thinking when he's riffing away on single notes. Three things are essential to improv over a song you don't know. First, a "vocabulary" of common chord patterns; second, a trained ear; third, a smattering of theory. And of course, the work ethic to make it all come together. Honestly, it doesn't come overnight. I'll bet you do. There's nothing random about music, it must be intentional. I've heard that too, and it sometimes happens when a player mistakes the interval, but it's not a plan for improvisational success! Without hearing what your writing partner is putting out, I'll suggest the problem might not be YOUR problem. I've heard some pretty awful original stuff that I might kindly call "atonal" (just to give it some musical cred).