Nutrition affects the composition of semen. Eating certain foods can influence the taste of ejaculate. It's not uncommon for the taste of semen to change from time to time.
Coffee and garlic can give semen a bitter taste. Anything that is acid tends to give semen a bitter taste. To counter the bitterness from coffee and garlic, a man can increase the amount of alkaline foods in his diet. Consuming more alkaline rich food really helps in improving the taste of semen. Fruits and vegetables are good sources of alkaline. Especially, pineapple and papaya, these two fruits can really make semen taste sweeter.
Also, coffee and medications with caffeine appear to make sperm sluggish. Here are some other things that can make semen taste bad:
"Cures for Male Infertility". Male Fertility Specialists.
"The Semen Taste Test". British Broadcasting Corporation (BBC).
"Sperm Taste - Improve Your Semen Taste and Your Health". Health Fitness 4 Men.