This paper proposes a method for AIBO, a four-legged robot, to acquire asmooth walking pattern automatically. In our approach for pattern acquisition, we prepare a variety ofAIBO's postures as templates, and apply Q-learning to find a sequenceof postures which realizes a smooth walk.Here the templates contribute to reducethe search space. The usefulness of the proposed method is evaluatedthrough experiments.