In this paper, we present a machine learning algorithm to synthesize defect-free single-degree-of-freedom spatial mechanisms for the Alt–Burmester problem. The Alt–Burmester problem is a generalization of a pure motion synthesis problem to include via path-points with missing orientations. While much work has been done towards the synthesis of planar and, to some extent, spherical mechanisms, the generation of mechanisms that are free of circuit, branch, and order defects has proven to be a difficult task. This is even more challenging for spatial mechanisms, which can consist of a large number of circuits and branches. Moreover, the Alt–Burmester problem makes solving such problems using an analytical approach further demanding. In this paper, we present a novel machine learning algorithm for solving the Alt–Burmester problem for spatial 5-SS platform mechanism using a variational autoencoder (VAE) architecture. The VAE helps capture the relationship between path and orientation properties of the motion of the 5-SS mechanisms, which enables reformulating the Alt–Burmester problem into a pure motion synthesis problem. The end goal is to produce defect-free spatial mechanism design solutions. While our focus in this paper is on the 5-SS mechanisms, this approach can be scaled to any single-degree-of-freedom spatial mechanisms.