I always assumed it was a multiplier to the beakers you put toward the tech, not a reduction in cost.
This is exactly how it is. I just examined the game's code, and found out just how the research modifier is calculated. The relevant function is CvPlayer::calculateResearchModifier(TechTypes eTech) in CvPlayer.cpp.
The research modifier starts at 100%. This can be increased up to 150% if you have all the prerequisites, and if every rival civ in the game knows the tech and also has contact with you.
Up to 30% bonus comes from rival civs: start with the number of civs who have both the tech and contact with you, multiply by 30, and then divide by the number of civs left in the game. The other 20% bonus comes from prerequisites. As has already been mentioned, only the line-arrow prerequisites count. ("OR" techs, in the code, as opposed to "AND" techs. Consider Divine Right requiring both Theology AND Monarchy.) Take the number of prereqs you have, multiply by 20, and divide by the number of possible prereqs to get your bonus from prereqs. Then, just add your bonuses together.
Using Writing as an example: I've met two civs who already know Writing, and there are three more civs that I haven't met out there in the fog. 2 civs, times 30%, divided by 6 civs in the game, gives 10% bonus from rival civs. The only prerequisite I know is Animal Husbandry. 1 tech, times 20%, divided by 3 possible prereqs, gives 6.66% bonus from prerequisites. Thus, I'll be researching Writing at 116.66% normal speed.
Or to put it another way, I get 16.66% more beakers for Writing.