Robert David Baum, 66, a retired specialist on African affairs who had served with the State Department for more than 25 years, died of a heart attack Saturday at George Washington University Hospital.

He joined the State Department as a civil service employe after serving in africa with the U.S. Army Air Force in World War II, and was a research analyst and intelligence research specialist.

Mr. Baum advised the U.S. delegations to the third and fourth sessions of the United Nations General Assembly. He was chief of the State Department's African branch and chief of the Africa division of the Office of Research and Analysis for the Middle East and Africa.

He also headed the West Africa division and was deputy director of the Office of Research and Analysis for Africa before retiring in 1973. He received the State Department's Superior Service Award in 1964.

After retiring, Mr. Baum was a consultant to the State Department and the Ford Foundation. While at State, he also taught African studies at American University and then at the Johns Hopkins School for advanced International Studies.

Mr. Baum contributed to several books on Africa and wrote numerous articles for scholarly journals. He was a founding fellow and director of the African Studies Association.

A graduate of Williams College, Where he was elected to Phi Beta Kappa, he earned master's and doctoral degrees in public law and government from Columbia University. He was a former fellow of the Brookings Institute and research technician with the National Resources Planning Board.

Mr. Baum had lived in Falls Church for many years until moving to Arlington about three years ago. His wife, Adelaide Chaisson, died earlier this year.

He is survived by a daughter, Caroline, of Washington; a son, Clayton, of Brunswick, Maine, and a brother James, of Los Angeles.

The family suggests that expressions of sympathy may be in the form of contributions to Williams College.